Previous 199869 Revisions Next

r31481 Thursday 31st July, 2014 at 19:30:08 UTC by Wilbert Pol
sh4.c: Get rid of pointers to member functions (nw)
[src/emu/cpu/sh4]sh4.c sh4.h

trunk/src/emu/cpu/sh4/sh4.c
r31480r31481
289289 *  0011 nnnn mmmm 1100  1       -
290290 *  ADD     Rm,Rn
291291 */
292void sh34_base_device::ADD(const UINT16 opcode)
292inline void sh34_base_device::ADD(const UINT16 opcode)
293293{
294294   m_r[Rn] += m_r[Rm];
295295}
r31480r31481
298298 *  0111 nnnn iiii iiii  1       -
299299 *  ADD     #imm,Rn
300300 */
301void sh34_base_device::ADDI(const UINT16 opcode)
301inline void sh34_base_device::ADDI(const UINT16 opcode)
302302{
303303   m_r[Rn] += (INT32)(INT16)(INT8)(opcode&0xff);
304304}
r31480r31481
307307 *  0011 nnnn mmmm 1110  1       carry
308308 *  ADDC    Rm,Rn
309309 */
310void sh34_base_device::ADDC(const UINT16 opcode)
310inline void sh34_base_device::ADDC(const UINT16 opcode)
311311{
312312   UINT32 m = Rm; UINT32 n = Rn;
313313   UINT32 tmp0, tmp1;
r31480r31481
327327 *  0011 nnnn mmmm 1111  1       overflow
328328 *  ADDV    Rm,Rn
329329 */
330void sh34_base_device::ADDV(const UINT16 opcode)
330inline void sh34_base_device::ADDV(const UINT16 opcode)
331331{
332332   UINT32 m = Rm; UINT32 n = Rn;
333333   INT32 dest, src, ans;
r31480r31481
362362 *  0010 nnnn mmmm 1001  1       -
363363 *  AND     Rm,Rn
364364 */
365void sh34_base_device::AND(const UINT16 opcode)
365inline void sh34_base_device::AND(const UINT16 opcode)
366366{
367367   m_r[Rn] &= m_r[Rm];
368368}
r31480r31481
372372 *  1100 1001 iiii iiii  1       -
373373 *  AND     #imm,R0
374374 */
375void sh34_base_device::ANDI(const UINT16 opcode)
375inline void sh34_base_device::ANDI(const UINT16 opcode)
376376{
377377   m_r[0] &= (opcode&0xff);
378378}
r31480r31481
381381 *  1100 1101 iiii iiii  1       -
382382 *  AND.B   #imm,@(R0,GBR)
383383 */
384void sh34_base_device::ANDM(const UINT16 opcode)
384inline void sh34_base_device::ANDM(const UINT16 opcode)
385385{
386386   UINT32 temp;
387387
r31480r31481
395395 *  1000 1011 dddd dddd  3/1     -
396396 *  BF      disp8
397397 */
398void sh34_base_device::BF(const UINT16 opcode)
398inline void sh34_base_device::BF(const UINT16 opcode)
399399{
400400   if ((m_sr & T) == 0)
401401   {
r31480r31481
409409 *  1000 1111 dddd dddd  3/1     -
410410 *  BFS     disp8
411411 */
412void sh34_base_device::BFS(const UINT16 opcode)
412inline void sh34_base_device::BFS(const UINT16 opcode)
413413{
414414   if ((m_sr & T) == 0)
415415   {
r31480r31481
424424 *  1010 dddd dddd dddd  2       -
425425 *  BRA     disp12
426426 */
427void sh34_base_device::BRA(const UINT16 opcode)
427inline void sh34_base_device::BRA(const UINT16 opcode)
428428{
429429   INT32 disp = ((INT32)(opcode&0xfff) << 20) >> 20;
430430
r31480r31481
448448 *  0000 mmmm 0010 0011  2       -
449449 *  BRAF    Rm
450450 */
451void sh34_base_device::BRAF(const UINT16 opcode)
451inline void sh34_base_device::BRAF(const UINT16 opcode)
452452{
453453   m_delay = m_pc;
454454   m_pc += m_r[Rn] + 2;
r31480r31481
459459 *  1011 dddd dddd dddd  2       -
460460 *  BSR     disp12
461461 */
462void sh34_base_device::BSR(const UINT16 opcode)
462inline void sh34_base_device::BSR(const UINT16 opcode)
463463{
464464   INT32 disp = ((INT32)(opcode&0xfff) << 20) >> 20;
465465
r31480r31481
473473 *  0000 mmmm 0000 0011  2       -
474474 *  BSRF    Rm
475475 */
476void sh34_base_device::BSRF(const UINT16 opcode)
476inline void sh34_base_device::BSRF(const UINT16 opcode)
477477{
478478   m_pr = m_pc + 2;
479479   m_delay = m_pc;
r31480r31481
485485 *  1000 1001 dddd dddd  3/1     -
486486 *  BT      disp8
487487 */
488void sh34_base_device::BT(const UINT16 opcode)
488inline void sh34_base_device::BT(const UINT16 opcode)
489489{
490490   if ((m_sr & T) != 0)
491491   {
r31480r31481
499499 *  1000 1101 dddd dddd  2/1     -
500500 *  BTS     disp8
501501 */
502void sh34_base_device::BTS(const UINT16 opcode)
502inline void sh34_base_device::BTS(const UINT16 opcode)
503503{
504504   if ((m_sr & T) != 0)
505505   {
r31480r31481
514514 *  0000 0000 0010 1000  1       -
515515 *  CLRMAC
516516 */
517void sh34_base_device::CLRMAC(const UINT16 opcode)
517inline void sh34_base_device::CLRMAC(const UINT16 opcode)
518518{
519519   m_mach = 0;
520520   m_macl = 0;
r31480r31481
524524 *  0000 0000 0000 1000  1       -
525525 *  CLRT
526526 */
527void sh34_base_device::CLRT(const UINT16 opcode)
527inline void sh34_base_device::CLRT(const UINT16 opcode)
528528{
529529   m_sr &= ~T;
530530}
r31480r31481
533533 *  0011 nnnn mmmm 0000  1       comparison result
534534 *  CMP_EQ  Rm,Rn
535535 */
536void sh34_base_device::CMPEQ(const UINT16 opcode)
536inline void sh34_base_device::CMPEQ(const UINT16 opcode)
537537{
538538   if (m_r[Rn] == m_r[Rm])
539539      m_sr |= T;
r31480r31481
545545 *  0011 nnnn mmmm 0011  1       comparison result
546546 *  CMP_GE  Rm,Rn
547547 */
548void sh34_base_device::CMPGE(const UINT16 opcode)
548inline void sh34_base_device::CMPGE(const UINT16 opcode)
549549{
550550   if ((INT32) m_r[Rn] >= (INT32) m_r[Rm])
551551      m_sr |= T;
r31480r31481
557557 *  0011 nnnn mmmm 0111  1       comparison result
558558 *  CMP_GT  Rm,Rn
559559 */
560void sh34_base_device::CMPGT(const UINT16 opcode)
560inline void sh34_base_device::CMPGT(const UINT16 opcode)
561561{
562562   if ((INT32) m_r[Rn] > (INT32) m_r[Rm])
563563      m_sr |= T;
r31480r31481
569569 *  0011 nnnn mmmm 0110  1       comparison result
570570 *  CMP_HI  Rm,Rn
571571 */
572void sh34_base_device::CMPHI(const UINT16 opcode)
572inline void sh34_base_device::CMPHI(const UINT16 opcode)
573573{
574574   if ((UINT32) m_r[Rn] > (UINT32) m_r[Rm])
575575      m_sr |= T;
r31480r31481
581581 *  0011 nnnn mmmm 0010  1       comparison result
582582 *  CMP_HS  Rm,Rn
583583 */
584void sh34_base_device::CMPHS(const UINT16 opcode)
584inline void sh34_base_device::CMPHS(const UINT16 opcode)
585585{
586586   if ((UINT32) m_r[Rn] >= (UINT32) m_r[Rm])
587587      m_sr |= T;
r31480r31481
594594 *  0100 nnnn 0001 0101  1       comparison result
595595 *  CMP_PL  Rn
596596 */
597void sh34_base_device::CMPPL(const UINT16 opcode)
597inline void sh34_base_device::CMPPL(const UINT16 opcode)
598598{
599599   if ((INT32) m_r[Rn] > 0)
600600      m_sr |= T;
r31480r31481
606606 *  0100 nnnn 0001 0001  1       comparison result
607607 *  CMP_PZ  Rn
608608 */
609void sh34_base_device::CMPPZ(const UINT16 opcode)
609inline void sh34_base_device::CMPPZ(const UINT16 opcode)
610610{
611611   if ((INT32) m_r[Rn] >= 0)
612612      m_sr |= T;
r31480r31481
618618 *  0010 nnnn mmmm 1100  1       comparison result
619619 * CMP_STR  Rm,Rn
620620 */
621void sh34_base_device::CMPSTR(const UINT16 opcode)
621inline void sh34_base_device::CMPSTR(const UINT16 opcode)
622622{
623623   UINT32 temp;
624624   INT32 HH, HL, LH, LL;
r31480r31481
638638 *  1000 1000 iiii iiii  1       comparison result
639639 *  CMP/EQ #imm,R0
640640 */
641void sh34_base_device::CMPIM(const UINT16 opcode)
641inline void sh34_base_device::CMPIM(const UINT16 opcode)
642642{
643643   UINT32 imm = (UINT32)(INT32)(INT16)(INT8)(opcode&0xff);
644644
r31480r31481
652652 *  0010 nnnn mmmm 0111  1       calculation result
653653 *  DIV0S   Rm,Rn
654654 */
655void sh34_base_device::DIV0S(const UINT16 opcode)
655inline void sh34_base_device::DIV0S(const UINT16 opcode)
656656{
657657   UINT32 m = Rm; UINT32 n = Rn;
658658
r31480r31481
674674 *  0000 0000 0001 1001  1       0
675675 *  DIV0U
676676 */
677void sh34_base_device::DIV0U(const UINT16 opcode)
677inline void sh34_base_device::DIV0U(const UINT16 opcode)
678678{
679679   m_sr &= ~(M | Q | T);
680680}
r31480r31481
683683 *  0011 nnnn mmmm 0100  1       calculation result
684684 *  DIV1 Rm,Rn
685685 */
686void sh34_base_device::DIV1(const UINT16 opcode)
686inline void sh34_base_device::DIV1(const UINT16 opcode)
687687{
688688   UINT32 m = Rm; UINT32 n = Rn;
689689
r31480r31481
777777}
778778
779779/*  DMULS.L Rm,Rn */
780void sh34_base_device::DMULS(const UINT16 opcode)
780inline void sh34_base_device::DMULS(const UINT16 opcode)
781781{
782782   UINT32 m = Rm; UINT32 n = Rn;
783783
r31480r31481
828828}
829829
830830/*  DMULU.L Rm,Rn */
831void sh34_base_device::DMULU(const UINT16 opcode)
831inline void sh34_base_device::DMULU(const UINT16 opcode)
832832{
833833   UINT32 m = Rm; UINT32 n = Rn;
834834
r31480r31481
858858}
859859
860860/*  DT      Rn */
861void sh34_base_device::DT(const UINT16 opcode)
861inline void sh34_base_device::DT(const UINT16 opcode)
862862{
863863   UINT32 n = Rn;
864864
r31480r31481
886886}
887887
888888/*  EXTS.B  Rm,Rn */
889void sh34_base_device::EXTSB(const UINT16 opcode)
889inline void sh34_base_device::EXTSB(const UINT16 opcode)
890890{
891891   m_r[Rn] = ((INT32)m_r[Rm] << 24) >> 24;
892892}
893893
894894/*  EXTS.W  Rm,Rn */
895void sh34_base_device::EXTSW(const UINT16 opcode)
895inline void sh34_base_device::EXTSW(const UINT16 opcode)
896896{
897897   m_r[Rn] = ((INT32)m_r[Rm] << 16) >> 16;
898898}
899899
900900/*  EXTU.B  Rm,Rn */
901void sh34_base_device::EXTUB(const UINT16 opcode)
901inline void sh34_base_device::EXTUB(const UINT16 opcode)
902902{
903903   m_r[Rn] = m_r[Rm] & 0x000000ff;
904904}
905905
906906/*  EXTU.W  Rm,Rn */
907void sh34_base_device::EXTUW(const UINT16 opcode)
907inline void sh34_base_device::EXTUW(const UINT16 opcode)
908908{
909909   m_r[Rn] = m_r[Rm] & 0x0000ffff;
910910}
911911
912912/*  JMP     @Rm */
913void sh34_base_device::JMP(const UINT16 opcode)
913inline void sh34_base_device::JMP(const UINT16 opcode)
914914{
915915   m_delay = m_pc;
916916   m_pc = m_ea = m_r[Rn];
917917}
918918
919919/*  JSR     @Rm */
920void sh34_base_device::JSR(const UINT16 opcode)
920inline void sh34_base_device::JSR(const UINT16 opcode)
921921{
922922   m_delay = m_pc;
923923   m_pr = m_pc + 2;
r31480r31481
927927
928928
929929/*  LDC     Rm,SR */
930void sh34_base_device::LDCSR(const UINT16 opcode)
930inline void sh34_base_device::LDCSR(const UINT16 opcode)
931931{
932932   UINT32 reg;
933933
r31480r31481
941941}
942942
943943/*  LDC     Rm,GBR */
944void sh34_base_device::LDCGBR(const UINT16 opcode)
944inline void sh34_base_device::LDCGBR(const UINT16 opcode)
945945{
946946   m_gbr = m_r[Rn];
947947}
948948
949949/*  LDC     Rm,VBR */
950void sh34_base_device::LDCVBR(const UINT16 opcode)
950inline void sh34_base_device::LDCVBR(const UINT16 opcode)
951951{
952952   m_vbr = m_r[Rn];
953953}
954954
955955/*  LDC.L   @Rm+,SR */
956void sh34_base_device::LDCMSR(const UINT16 opcode)
956inline void sh34_base_device::LDCMSR(const UINT16 opcode)
957957{
958958   UINT32 old;
959959
r31480r31481
970970}
971971
972972/*  LDC.L   @Rm+,GBR */
973void sh34_base_device::LDCMGBR(const UINT16 opcode)
973inline void sh34_base_device::LDCMGBR(const UINT16 opcode)
974974{
975975   m_ea = m_r[Rn];
976976   m_gbr = RL(m_ea );
r31480r31481
979979}
980980
981981/*  LDC.L   @Rm+,VBR */
982void sh34_base_device::LDCMVBR(const UINT16 opcode)
982inline void sh34_base_device::LDCMVBR(const UINT16 opcode)
983983{
984984   m_ea = m_r[Rn];
985985   m_vbr = RL(m_ea );
r31480r31481
988988}
989989
990990/*  LDS     Rm,MACH */
991void sh34_base_device::LDSMACH(const UINT16 opcode)
991inline void sh34_base_device::LDSMACH(const UINT16 opcode)
992992{
993993   m_mach = m_r[Rn];
994994}
995995
996996/*  LDS     Rm,MACL */
997void sh34_base_device::LDSMACL(const UINT16 opcode)
997inline void sh34_base_device::LDSMACL(const UINT16 opcode)
998998{
999999   m_macl = m_r[Rn];
10001000}
10011001
10021002/*  LDS     Rm,PR */
1003void sh34_base_device::LDSPR(const UINT16 opcode)
1003inline void sh34_base_device::LDSPR(const UINT16 opcode)
10041004{
10051005   m_pr = m_r[Rn];
10061006}
10071007
10081008/*  LDS.L   @Rm+,MACH */
1009void sh34_base_device::LDSMMACH(const UINT16 opcode)
1009inline void sh34_base_device::LDSMMACH(const UINT16 opcode)
10101010{
10111011   m_ea = m_r[Rn];
10121012   m_mach = RL(m_ea );
r31480r31481
10141014}
10151015
10161016/*  LDS.L   @Rm+,MACL */
1017void sh34_base_device::LDSMMACL(const UINT16 opcode)
1017inline void sh34_base_device::LDSMMACL(const UINT16 opcode)
10181018{
10191019   m_ea = m_r[Rn];
10201020   m_macl = RL(m_ea );
r31480r31481
10221022}
10231023
10241024/*  LDS.L   @Rm+,PR */
1025void sh34_base_device::LDSMPR(const UINT16 opcode)
1025inline void sh34_base_device::LDSMPR(const UINT16 opcode)
10261026{
10271027   m_ea = m_r[Rn];
10281028   m_pr = RL(m_ea );
r31480r31481
10301030}
10311031
10321032/*  MAC.L   @Rm+,@Rn+ */
1033void sh34_base_device::MAC_L(const UINT16 opcode)
1033inline void sh34_base_device::MAC_L(const UINT16 opcode)
10341034{
10351035   UINT32 m = Rm; UINT32 n = Rn;
10361036
r31480r31481
11091109}
11101110
11111111/*  MAC.W   @Rm+,@Rn+ */
1112void sh34_base_device::MAC_W(const UINT16 opcode)
1112inline void sh34_base_device::MAC_W(const UINT16 opcode)
11131113{
11141114   UINT32 m = Rm; UINT32 n = Rn;
11151115
r31480r31481
11631163}
11641164
11651165/*  MOV     Rm,Rn */
1166void sh34_base_device::MOV(const UINT16 opcode)
1166inline void sh34_base_device::MOV(const UINT16 opcode)
11671167{
11681168   m_r[Rn] = m_r[Rm];
11691169}
11701170
11711171/*  MOV.B   Rm,@Rn */
1172void sh34_base_device::MOVBS(const UINT16 opcode)
1172inline void sh34_base_device::MOVBS(const UINT16 opcode)
11731173{
11741174   m_ea = m_r[Rn];
11751175   WB(m_ea, m_r[Rm] & 0x000000ff);
11761176}
11771177
11781178/*  MOV.W   Rm,@Rn */
1179void sh34_base_device::MOVWS(const UINT16 opcode)
1179inline void sh34_base_device::MOVWS(const UINT16 opcode)
11801180{
11811181   m_ea = m_r[Rn];
11821182   WW(m_ea, m_r[Rm] & 0x0000ffff);
11831183}
11841184
11851185/*  MOV.L   Rm,@Rn */
1186void sh34_base_device::MOVLS(const UINT16 opcode)
1186inline void sh34_base_device::MOVLS(const UINT16 opcode)
11871187{
11881188   m_ea = m_r[Rn];
11891189   WL(m_ea, m_r[Rm] );
11901190}
11911191
11921192/*  MOV.B   @Rm,Rn */
1193void sh34_base_device::MOVBL(const UINT16 opcode)
1193inline void sh34_base_device::MOVBL(const UINT16 opcode)
11941194{
11951195   m_ea = m_r[Rm];
11961196   m_r[Rn] = (UINT32)(INT32)(INT16)(INT8) RB( m_ea );
11971197}
11981198
11991199/*  MOV.W   @Rm,Rn */
1200void sh34_base_device::MOVWL(const UINT16 opcode)
1200inline void sh34_base_device::MOVWL(const UINT16 opcode)
12011201{
12021202   m_ea = m_r[Rm];
12031203   m_r[Rn] = (UINT32)(INT32)(INT16) RW(m_ea );
12041204}
12051205
12061206/*  MOV.L   @Rm,Rn */
1207void sh34_base_device::MOVLL(const UINT16 opcode)
1207inline void sh34_base_device::MOVLL(const UINT16 opcode)
12081208{
12091209   m_ea = m_r[Rm];
12101210   m_r[Rn] = RL(m_ea );
12111211}
12121212
12131213/*  MOV.B   Rm,@-Rn */
1214void sh34_base_device::MOVBM(const UINT16 opcode)
1214inline void sh34_base_device::MOVBM(const UINT16 opcode)
12151215{
12161216   UINT32 data = m_r[Rm] & 0x000000ff;
12171217
r31480r31481
12201220}
12211221
12221222/*  MOV.W   Rm,@-Rn */
1223void sh34_base_device::MOVWM(const UINT16 opcode)
1223inline void sh34_base_device::MOVWM(const UINT16 opcode)
12241224{
12251225   UINT32 data = m_r[Rm] & 0x0000ffff;
12261226
r31480r31481
12291229}
12301230
12311231/*  MOV.L   Rm,@-Rn */
1232void sh34_base_device::MOVLM(const UINT16 opcode)
1232inline void sh34_base_device::MOVLM(const UINT16 opcode)
12331233{
12341234   UINT32 data = m_r[Rm];
12351235
r31480r31481
12381238}
12391239
12401240/*  MOV.B   @Rm+,Rn */
1241void sh34_base_device::MOVBP(const UINT16 opcode)
1241inline void sh34_base_device::MOVBP(const UINT16 opcode)
12421242{
12431243   UINT32 m = Rm; UINT32 n = Rn;
12441244
r31480r31481
12481248}
12491249
12501250/*  MOV.W   @Rm+,Rn */
1251void sh34_base_device::MOVWP(const UINT16 opcode)
1251inline void sh34_base_device::MOVWP(const UINT16 opcode)
12521252{
12531253   UINT32 m = Rm; UINT32 n = Rn;
12541254
r31480r31481
12581258}
12591259
12601260/*  MOV.L   @Rm+,Rn */
1261void sh34_base_device::MOVLP(const UINT16 opcode)
1261inline void sh34_base_device::MOVLP(const UINT16 opcode)
12621262{
12631263   UINT32 m = Rm; UINT32 n = Rn;
12641264
r31480r31481
12681268}
12691269
12701270/*  MOV.B   Rm,@(R0,Rn) */
1271void sh34_base_device::MOVBS0(const UINT16 opcode)
1271inline void sh34_base_device::MOVBS0(const UINT16 opcode)
12721272{
12731273   m_ea = m_r[Rn] + m_r[0];
12741274   WB(m_ea, m_r[Rm] & 0x000000ff );
12751275}
12761276
12771277/*  MOV.W   Rm,@(R0,Rn) */
1278void sh34_base_device::MOVWS0(const UINT16 opcode)
1278inline void sh34_base_device::MOVWS0(const UINT16 opcode)
12791279{
12801280   m_ea = m_r[Rn] + m_r[0];
12811281   WW(m_ea, m_r[Rm] & 0x0000ffff );
12821282}
12831283
12841284/*  MOV.L   Rm,@(R0,Rn) */
1285void sh34_base_device::MOVLS0(const UINT16 opcode)
1285inline void sh34_base_device::MOVLS0(const UINT16 opcode)
12861286{
12871287   m_ea = m_r[Rn] + m_r[0];
12881288   WL(m_ea, m_r[Rm] );
12891289}
12901290
12911291/*  MOV.B   @(R0,Rm),Rn */
1292void sh34_base_device::MOVBL0(const UINT16 opcode)
1292inline void sh34_base_device::MOVBL0(const UINT16 opcode)
12931293{
12941294   m_ea = m_r[Rm] + m_r[0];
12951295   m_r[Rn] = (UINT32)(INT32)(INT16)(INT8) RB( m_ea );
12961296}
12971297
12981298/*  MOV.W   @(R0,Rm),Rn */
1299void sh34_base_device::MOVWL0(const UINT16 opcode)
1299inline void sh34_base_device::MOVWL0(const UINT16 opcode)
13001300{
13011301   m_ea = m_r[Rm] + m_r[0];
13021302   m_r[Rn] = (UINT32)(INT32)(INT16) RW(m_ea );
13031303}
13041304
13051305/*  MOV.L   @(R0,Rm),Rn */
1306void sh34_base_device::MOVLL0(const UINT16 opcode)
1306inline void sh34_base_device::MOVLL0(const UINT16 opcode)
13071307{
13081308   m_ea = m_r[Rm] + m_r[0];
13091309   m_r[Rn] = RL(m_ea );
13101310}
13111311
13121312/*  MOV     #imm,Rn */
1313void sh34_base_device::MOVI(const UINT16 opcode)
1313inline void sh34_base_device::MOVI(const UINT16 opcode)
13141314{
13151315   m_r[Rn] = (UINT32)(INT32)(INT16)(INT8)(opcode&0xff);
13161316}
13171317
13181318/*  MOV.W   @(disp8,PC),Rn */
1319void sh34_base_device::MOVWI(const UINT16 opcode)
1319inline void sh34_base_device::MOVWI(const UINT16 opcode)
13201320{
13211321   UINT32 disp = opcode & 0xff;
13221322   m_ea = m_pc + disp * 2 + 2;
r31480r31481
13241324}
13251325
13261326/*  MOV.L   @(disp8,PC),Rn */
1327void sh34_base_device::MOVLI(const UINT16 opcode)
1327inline void sh34_base_device::MOVLI(const UINT16 opcode)
13281328{
13291329   UINT32 disp = opcode & 0xff;
13301330   m_ea = ((m_pc + 2) & ~3) + disp * 4;
r31480r31481
13321332}
13331333
13341334/*  MOV.B   @(disp8,GBR),R0 */
1335void sh34_base_device::MOVBLG(const UINT16 opcode)
1335inline void sh34_base_device::MOVBLG(const UINT16 opcode)
13361336{
13371337   UINT32 disp = opcode & 0xff;
13381338   m_ea = m_gbr + disp;
r31480r31481
13401340}
13411341
13421342/*  MOV.W   @(disp8,GBR),R0 */
1343void sh34_base_device::MOVWLG(const UINT16 opcode)
1343inline void sh34_base_device::MOVWLG(const UINT16 opcode)
13441344{
13451345   UINT32 disp = opcode & 0xff;
13461346   m_ea = m_gbr + disp * 2;
r31480r31481
13481348}
13491349
13501350/*  MOV.L   @(disp8,GBR),R0 */
1351void sh34_base_device::MOVLLG(const UINT16 opcode)
1351inline void sh34_base_device::MOVLLG(const UINT16 opcode)
13521352{
13531353   UINT32 disp = opcode & 0xff;
13541354   m_ea = m_gbr + disp * 4;
r31480r31481
13561356}
13571357
13581358/*  MOV.B   R0,@(disp8,GBR) */
1359void sh34_base_device::MOVBSG(const UINT16 opcode)
1359inline void sh34_base_device::MOVBSG(const UINT16 opcode)
13601360{
13611361   UINT32 disp = opcode & 0xff;
13621362   m_ea = m_gbr + disp;
r31480r31481
13641364}
13651365
13661366/*  MOV.W   R0,@(disp8,GBR) */
1367void sh34_base_device::MOVWSG(const UINT16 opcode)
1367inline void sh34_base_device::MOVWSG(const UINT16 opcode)
13681368{
13691369   UINT32 disp = opcode & 0xff;
13701370   m_ea = m_gbr + disp * 2;
r31480r31481
13721372}
13731373
13741374/*  MOV.L   R0,@(disp8,GBR) */
1375void sh34_base_device::MOVLSG(const UINT16 opcode)
1375inline void sh34_base_device::MOVLSG(const UINT16 opcode)
13761376{
13771377   UINT32 disp = opcode & 0xff;
13781378   m_ea = m_gbr + disp * 4;
r31480r31481
13801380}
13811381
13821382/*  MOV.B   R0,@(disp4,Rm) */
1383void sh34_base_device::MOVBS4(const UINT16 opcode)
1383inline void sh34_base_device::MOVBS4(const UINT16 opcode)
13841384{
13851385   UINT32 disp = opcode & 0x0f;
13861386   m_ea = m_r[Rm] + disp;
r31480r31481
13881388}
13891389
13901390/*  MOV.W   R0,@(disp4,Rm) */
1391void sh34_base_device::MOVWS4(const UINT16 opcode)
1391inline void sh34_base_device::MOVWS4(const UINT16 opcode)
13921392{
13931393   UINT32 disp = opcode & 0x0f;
13941394   m_ea = m_r[Rm] + disp * 2;
r31480r31481
13961396}
13971397
13981398/* MOV.L Rm,@(disp4,Rn) */
1399void sh34_base_device::MOVLS4(const UINT16 opcode)
1399inline void sh34_base_device::MOVLS4(const UINT16 opcode)
14001400{
14011401   UINT32 disp = opcode & 0x0f;
14021402   m_ea = m_r[Rn] + disp * 4;
r31480r31481
14041404}
14051405
14061406/*  MOV.B   @(disp4,Rm),R0 */
1407void sh34_base_device::MOVBL4(const UINT16 opcode)
1407inline void sh34_base_device::MOVBL4(const UINT16 opcode)
14081408{
14091409   UINT32 disp = opcode & 0x0f;
14101410   m_ea = m_r[Rm] + disp;
r31480r31481
14121412}
14131413
14141414/*  MOV.W   @(disp4,Rm),R0 */
1415void sh34_base_device::MOVWL4(const UINT16 opcode)
1415inline void sh34_base_device::MOVWL4(const UINT16 opcode)
14161416{
14171417   UINT32 disp = opcode & 0x0f;
14181418   m_ea = m_r[Rm] + disp * 2;
r31480r31481
14201420}
14211421
14221422/*  MOV.L   @(disp4,Rm),Rn */
1423void sh34_base_device::MOVLL4(const UINT16 opcode)
1423inline void sh34_base_device::MOVLL4(const UINT16 opcode)
14241424{
14251425   UINT32 disp = opcode & 0x0f;
14261426   m_ea = m_r[Rm] + disp * 4;
r31480r31481
14281428}
14291429
14301430/*  MOVA    @(disp8,PC),R0 */
1431void sh34_base_device::MOVA(const UINT16 opcode)
1431inline void sh34_base_device::MOVA(const UINT16 opcode)
14321432{
14331433   UINT32 disp = opcode & 0xff;
14341434   m_ea = ((m_pc + 2) & ~3) + disp * 4;
r31480r31481
14421442}
14431443
14441444/*  MUL.L   Rm,Rn */
1445void sh34_base_device::MULL(const UINT16 opcode)
1445inline void sh34_base_device::MULL(const UINT16 opcode)
14461446{
14471447   m_macl = m_r[Rn] * m_r[Rm];
14481448   m_sh4_icount--;
14491449}
14501450
14511451/*  MULS    Rm,Rn */
1452void sh34_base_device::MULS(const UINT16 opcode)
1452inline void sh34_base_device::MULS(const UINT16 opcode)
14531453{
14541454   m_macl = (INT16) m_r[Rn] * (INT16) m_r[Rm];
14551455}
14561456
14571457/*  MULU    Rm,Rn */
1458void sh34_base_device::MULU(const UINT16 opcode)
1458inline void sh34_base_device::MULU(const UINT16 opcode)
14591459{
14601460   m_macl = (UINT16) m_r[Rn] * (UINT16) m_r[Rm];
14611461}
14621462
14631463/*  NEG     Rm,Rn */
1464void sh34_base_device::NEG(const UINT16 opcode)
1464inline void sh34_base_device::NEG(const UINT16 opcode)
14651465{
14661466   m_r[Rn] = 0 - m_r[Rm];
14671467}
14681468
14691469/*  NEGC    Rm,Rn */
1470void sh34_base_device::NEGC(const UINT16 opcode)
1470inline void sh34_base_device::NEGC(const UINT16 opcode)
14711471{
14721472   UINT32 temp;
14731473
r31480r31481
14801480}
14811481
14821482/*  NOP */
1483void sh34_base_device::NOP(const UINT16 opcode)
1483inline void sh34_base_device::NOP(const UINT16 opcode)
14841484{
14851485}
14861486
14871487/*  NOT     Rm,Rn */
1488void sh34_base_device::NOT(const UINT16 opcode)
1488inline void sh34_base_device::NOT(const UINT16 opcode)
14891489{
14901490   m_r[Rn] = ~m_r[Rm];
14911491}
14921492
14931493/*  OR      Rm,Rn */
1494void sh34_base_device::OR(const UINT16 opcode)
1494inline void sh34_base_device::OR(const UINT16 opcode)
14951495{
14961496   m_r[Rn] |= m_r[Rm];
14971497}
14981498
14991499/*  OR      #imm,R0 */
1500void sh34_base_device::ORI(const UINT16 opcode)
1500inline void sh34_base_device::ORI(const UINT16 opcode)
15011501{
15021502   m_r[0] |= (opcode&0xff);
15031503   m_sh4_icount -= 2;
15041504}
15051505
15061506/*  OR.B    #imm,@(R0,GBR) */
1507void sh34_base_device::ORM(const UINT16 opcode)
1507inline void sh34_base_device::ORM(const UINT16 opcode)
15081508{
15091509   UINT32 temp;
15101510
r31480r31481
15151515}
15161516
15171517/*  ROTCL   Rn */
1518void sh34_base_device::ROTCL(const UINT16 opcode)
1518inline void sh34_base_device::ROTCL(const UINT16 opcode)
15191519{
15201520   UINT32 n = Rn;
15211521
r31480r31481
15271527}
15281528
15291529/*  ROTCR   Rn */
1530void sh34_base_device::ROTCR(const UINT16 opcode)
1530inline void sh34_base_device::ROTCR(const UINT16 opcode)
15311531{
15321532   UINT32 n = Rn;
15331533
r31480r31481
15411541}
15421542
15431543/*  ROTL    Rn */
1544void sh34_base_device::ROTL(const UINT16 opcode)
1544inline void sh34_base_device::ROTL(const UINT16 opcode)
15451545{
15461546   UINT32 n = Rn;
15471547
r31480r31481
15501550}
15511551
15521552/*  ROTR    Rn */
1553void sh34_base_device::ROTR(const UINT16 opcode)
1553inline void sh34_base_device::ROTR(const UINT16 opcode)
15541554{
15551555   UINT32 n = Rn;
15561556
r31480r31481
15591559}
15601560
15611561/*  RTE */
1562void sh34_base_device::RTE(const UINT16 opcode)
1562inline void sh34_base_device::RTE(const UINT16 opcode)
15631563{
15641564   m_delay = m_pc;
15651565   m_pc = m_ea = m_spc;
r31480r31481
15731573}
15741574
15751575/*  RTS */
1576void sh34_base_device::RTS(const UINT16 opcode)
1576inline void sh34_base_device::RTS(const UINT16 opcode)
15771577{
15781578   m_delay = m_pc;
15791579   m_pc = m_ea = m_pr;
r31480r31481
15811581}
15821582
15831583/*  SETT */
1584void sh34_base_device::SETT(const UINT16 opcode)
1584inline void sh34_base_device::SETT(const UINT16 opcode)
15851585{
15861586   m_sr |= T;
15871587}
15881588
15891589/*  SHAL    Rn      (same as SHLL) */
1590void sh34_base_device::SHAL(const UINT16 opcode)
1590inline void sh34_base_device::SHAL(const UINT16 opcode)
15911591{
15921592   UINT32 n = Rn;
15931593
r31480r31481
15961596}
15971597
15981598/*  SHAR    Rn */
1599void sh34_base_device::SHAR(const UINT16 opcode)
1599inline void sh34_base_device::SHAR(const UINT16 opcode)
16001600{
16011601   UINT32 n = Rn;
16021602
r31480r31481
16051605}
16061606
16071607/*  SHLL    Rn      (same as SHAL) */
1608void sh34_base_device::SHLL(const UINT16 opcode)
1608inline void sh34_base_device::SHLL(const UINT16 opcode)
16091609{
16101610   UINT32 n = Rn;
16111611
r31480r31481
16141614}
16151615
16161616/*  SHLL2   Rn */
1617void sh34_base_device::SHLL2(const UINT16 opcode)
1617inline void sh34_base_device::SHLL2(const UINT16 opcode)
16181618{
16191619   m_r[Rn] <<= 2;
16201620}
16211621
16221622/*  SHLL8   Rn */
1623void sh34_base_device::SHLL8(const UINT16 opcode)
1623inline void sh34_base_device::SHLL8(const UINT16 opcode)
16241624{
16251625   m_r[Rn] <<= 8;
16261626}
16271627
16281628/*  SHLL16  Rn */
1629void sh34_base_device::SHLL16(const UINT16 opcode)
1629inline void sh34_base_device::SHLL16(const UINT16 opcode)
16301630{
16311631   m_r[Rn] <<= 16;
16321632}
16331633
16341634/*  SHLR    Rn */
1635void sh34_base_device::SHLR(const UINT16 opcode)
1635inline void sh34_base_device::SHLR(const UINT16 opcode)
16361636{
16371637   UINT32 n = Rn;
16381638
r31480r31481
16411641}
16421642
16431643/*  SHLR2   Rn */
1644void sh34_base_device::SHLR2(const UINT16 opcode)
1644inline void sh34_base_device::SHLR2(const UINT16 opcode)
16451645{
16461646   m_r[Rn] >>= 2;
16471647}
16481648
16491649/*  SHLR8   Rn */
1650void sh34_base_device::SHLR8(const UINT16 opcode)
1650inline void sh34_base_device::SHLR8(const UINT16 opcode)
16511651{
16521652   m_r[Rn] >>= 8;
16531653}
16541654
16551655/*  SHLR16  Rn */
1656void sh34_base_device::SHLR16(const UINT16 opcode)
1656inline void sh34_base_device::SHLR16(const UINT16 opcode)
16571657{
16581658   m_r[Rn] >>= 16;
16591659}
16601660
16611661/*  SLEEP */
1662void sh34_base_device::SLEEP(const UINT16 opcode)
1662inline void sh34_base_device::SLEEP(const UINT16 opcode)
16631663{
16641664   /* 0 = normal mode */
16651665   /* 1 = enters into power-down mode */
r31480r31481
16751675}
16761676
16771677/*  STC     SR,Rn */
1678void sh34_base_device::STCSR(const UINT16 opcode)
1678inline void sh34_base_device::STCSR(const UINT16 opcode)
16791679{
16801680   m_r[Rn] = m_sr;
16811681}
16821682
16831683/*  STC     GBR,Rn */
1684void sh34_base_device::STCGBR(const UINT16 opcode)
1684inline void sh34_base_device::STCGBR(const UINT16 opcode)
16851685{
16861686   m_r[Rn] = m_gbr;
16871687}
16881688
16891689/*  STC     VBR,Rn */
1690void sh34_base_device::STCVBR(const UINT16 opcode)
1690inline void sh34_base_device::STCVBR(const UINT16 opcode)
16911691{
16921692   m_r[Rn] = m_vbr;
16931693}
16941694
16951695/*  STC.L   SR,@-Rn */
1696void sh34_base_device::STCMSR(const UINT16 opcode)
1696inline void sh34_base_device::STCMSR(const UINT16 opcode)
16971697{
16981698   UINT32 n = Rn;
16991699
r31480r31481
17041704}
17051705
17061706/*  STC.L   GBR,@-Rn */
1707void sh34_base_device::STCMGBR(const UINT16 opcode)
1707inline void sh34_base_device::STCMGBR(const UINT16 opcode)
17081708{
17091709   UINT32 n = Rn;
17101710
r31480r31481
17151715}
17161716
17171717/*  STC.L   VBR,@-Rn */
1718void sh34_base_device::STCMVBR(const UINT16 opcode)
1718inline void sh34_base_device::STCMVBR(const UINT16 opcode)
17191719{
17201720   UINT32 n = Rn;
17211721
r31480r31481
17261726}
17271727
17281728/*  STS     MACH,Rn */
1729void sh34_base_device::STSMACH(const UINT16 opcode)
1729inline void sh34_base_device::STSMACH(const UINT16 opcode)
17301730{
17311731   m_r[Rn] = m_mach;
17321732}
17331733
17341734/*  STS     MACL,Rn */
1735void sh34_base_device::STSMACL(const UINT16 opcode)
1735inline void sh34_base_device::STSMACL(const UINT16 opcode)
17361736{
17371737   m_r[Rn] = m_macl;
17381738}
17391739
17401740/*  STS     PR,Rn */
1741void sh34_base_device::STSPR(const UINT16 opcode)
1741inline void sh34_base_device::STSPR(const UINT16 opcode)
17421742{
17431743   m_r[Rn] = m_pr;
17441744}
17451745
17461746/*  STS.L   MACH,@-Rn */
1747void sh34_base_device::STSMMACH(const UINT16 opcode)
1747inline void sh34_base_device::STSMMACH(const UINT16 opcode)
17481748{
17491749   UINT32 n = Rn;
17501750
r31480r31481
17541754}
17551755
17561756/*  STS.L   MACL,@-Rn */
1757void sh34_base_device::STSMMACL(const UINT16 opcode)
1757inline void sh34_base_device::STSMMACL(const UINT16 opcode)
17581758{
17591759   UINT32 n = Rn;
17601760
r31480r31481
17641764}
17651765
17661766/*  STS.L   PR,@-Rn */
1767void sh34_base_device::STSMPR(const UINT16 opcode)
1767inline void sh34_base_device::STSMPR(const UINT16 opcode)
17681768{
17691769   UINT32 n = Rn;
17701770
r31480r31481
17741774}
17751775
17761776/*  SUB     Rm,Rn */
1777void sh34_base_device::SUB(const UINT16 opcode)
1777inline void sh34_base_device::SUB(const UINT16 opcode)
17781778{
17791779   m_r[Rn] -= m_r[Rm];
17801780}
17811781
17821782/*  SUBC    Rm,Rn */
1783void sh34_base_device::SUBC(const UINT16 opcode)
1783inline void sh34_base_device::SUBC(const UINT16 opcode)
17841784{
17851785   UINT32 m = Rm; UINT32 n = Rn;
17861786
r31480r31481
17981798}
17991799
18001800/*  SUBV    Rm,Rn */
1801void sh34_base_device::SUBV(const UINT16 opcode)
1801inline void sh34_base_device::SUBV(const UINT16 opcode)
18021802{
18031803   UINT32 m = Rm; UINT32 n = Rn;
18041804
r31480r31481
18311831}
18321832
18331833/*  SWAP.B  Rm,Rn */
1834void sh34_base_device::SWAPB(const UINT16 opcode)
1834inline void sh34_base_device::SWAPB(const UINT16 opcode)
18351835{
18361836   UINT32 m = Rm; UINT32 n = Rn;
18371837
r31480r31481
18441844}
18451845
18461846/*  SWAP.W  Rm,Rn */
1847void sh34_base_device::SWAPW(const UINT16 opcode)
1847inline void sh34_base_device::SWAPW(const UINT16 opcode)
18481848{
18491849   UINT32 m = Rm; UINT32 n = Rn;
18501850
r31480r31481
18551855}
18561856
18571857/*  TAS.B   @Rn */
1858void sh34_base_device::TAS(const UINT16 opcode)
1858inline void sh34_base_device::TAS(const UINT16 opcode)
18591859{
18601860   UINT32 n = Rn;
18611861
r31480r31481
18741874}
18751875
18761876/*  TRAPA   #imm */
1877void sh34_base_device::TRAPA(const UINT16 opcode)
1877inline void sh34_base_device::TRAPA(const UINT16 opcode)
18781878{
18791879   UINT32 imm = opcode & 0xff;
18801880
r31480r31481
19161916}
19171917
19181918/*  TST     Rm,Rn */
1919void sh34_base_device::TST(const UINT16 opcode)
1919inline void sh34_base_device::TST(const UINT16 opcode)
19201920{
19211921   if ((m_r[Rn] & m_r[Rm]) == 0)
19221922      m_sr |= T;
r31480r31481
19251925}
19261926
19271927/*  TST     #imm,R0 */
1928void sh34_base_device::TSTI(const UINT16 opcode)
1928inline void sh34_base_device::TSTI(const UINT16 opcode)
19291929{
19301930   UINT32 imm = opcode & 0xff;
19311931
r31480r31481
19361936}
19371937
19381938/*  TST.B   #imm,@(R0,GBR) */
1939void sh34_base_device::TSTM(const UINT16 opcode)
1939inline void sh34_base_device::TSTM(const UINT16 opcode)
19401940{
19411941   UINT32 imm = opcode & 0xff;
19421942
r31480r31481
19491949}
19501950
19511951/*  XOR     Rm,Rn */
1952void sh34_base_device::XOR(const UINT16 opcode)
1952inline void sh34_base_device::XOR(const UINT16 opcode)
19531953{
19541954   m_r[Rn] ^= m_r[Rm];
19551955}
19561956
19571957/*  XOR     #imm,R0 */
1958void sh34_base_device::XORI(const UINT16 opcode)
1958inline void sh34_base_device::XORI(const UINT16 opcode)
19591959{
19601960   UINT32 imm = opcode & 0xff;
19611961   m_r[0] ^= imm;
19621962}
19631963
19641964/*  XOR.B   #imm,@(R0,GBR) */
1965void sh34_base_device::XORM(const UINT16 opcode)
1965inline void sh34_base_device::XORM(const UINT16 opcode)
19661966{
19671967   UINT32 imm = opcode & 0xff;
19681968   UINT32 temp;
r31480r31481
19751975}
19761976
19771977/*  XTRCT   Rm,Rn */
1978void sh34_base_device::XTRCT(const UINT16 opcode)
1978inline void sh34_base_device::XTRCT(const UINT16 opcode)
19791979{
19801980   UINT32 m = Rm; UINT32 n = Rn;
19811981
r31480r31481
19871987}
19881988
19891989/*  STC     SSR,Rn */
1990void sh34_base_device::STCSSR(const UINT16 opcode)
1990inline void sh34_base_device::STCSSR(const UINT16 opcode)
19911991{
19921992   m_r[Rn] = m_ssr;
19931993}
19941994
19951995/*  STC     SPC,Rn */
1996void sh34_base_device::STCSPC(const UINT16 opcode)
1996inline void sh34_base_device::STCSPC(const UINT16 opcode)
19971997{
19981998   m_r[Rn] = m_spc;
19991999}
20002000
20012001/*  STC     SGR,Rn */
2002void sh34_base_device::STCSGR(const UINT16 opcode)
2002inline void sh34_base_device::STCSGR(const UINT16 opcode)
20032003{
20042004   m_r[Rn] = m_sgr;
20052005}
20062006
20072007/*  STS     FPUL,Rn */
2008void sh34_base_device::STSFPUL(const UINT16 opcode)
2008inline void sh34_base_device::STSFPUL(const UINT16 opcode)
20092009{
20102010   m_r[Rn] = m_fpul;
20112011}
20122012
20132013/*  STS     FPSCR,Rn */
2014void sh34_base_device::STSFPSCR(const UINT16 opcode)
2014inline void sh34_base_device::STSFPSCR(const UINT16 opcode)
20152015{
20162016   m_r[Rn] = m_fpscr & 0x003FFFFF;
20172017}
20182018
20192019/*  STC     DBR,Rn */
2020void sh34_base_device::STCDBR(const UINT16 opcode)
2020inline void sh34_base_device::STCDBR(const UINT16 opcode)
20212021{
20222022   m_r[Rn] = m_dbr;
20232023}
20242024
20252025/*  STCRBANK   Rm_BANK,Rn */
2026void sh34_base_device::STCRBANK(const UINT16 opcode)
2026inline void sh34_base_device::STCRBANK(const UINT16 opcode)
20272027{
20282028   UINT32 m = Rm;
20292029
r31480r31481
20312031}
20322032
20332033/*  STCMRBANK   Rm_BANK,@-Rn */
2034void sh34_base_device::STCMRBANK(const UINT16 opcode)
2034inline void sh34_base_device::STCMRBANK(const UINT16 opcode)
20352035{
20362036   UINT32 m = Rm; UINT32 n = Rn;
20372037
r31480r31481
20422042}
20432043
20442044/*  MOVCA.L     R0,@Rn */
2045void sh34_base_device::MOVCAL(const UINT16 opcode)
2045inline void sh34_base_device::MOVCAL(const UINT16 opcode)
20462046{
20472047   m_ea = m_r[Rn];
20482048   WL(m_ea, m_r[0] );
20492049}
20502050
2051void sh34_base_device::CLRS(const UINT16 opcode)
2051inline void sh34_base_device::CLRS(const UINT16 opcode)
20522052{
20532053   m_sr &= ~S;
20542054}
20552055
2056void sh34_base_device::SETS(const UINT16 opcode)
2056inline void sh34_base_device::SETS(const UINT16 opcode)
20572057{
20582058   m_sr |= S;
20592059}
20602060
20612061/*  STS.L   SGR,@-Rn */
2062void sh34_base_device::STCMSGR(const UINT16 opcode)
2062inline void sh34_base_device::STCMSGR(const UINT16 opcode)
20632063{
20642064   UINT32 n = Rn;
20652065
r31480r31481
20692069}
20702070
20712071/*  STS.L   FPUL,@-Rn */
2072void sh34_base_device::STSMFPUL(const UINT16 opcode)
2072inline void sh34_base_device::STSMFPUL(const UINT16 opcode)
20732073{
20742074   UINT32 n = Rn;
20752075
r31480r31481
20792079}
20802080
20812081/*  STS.L   FPSCR,@-Rn */
2082void sh34_base_device::STSMFPSCR(const UINT16 opcode)
2082inline void sh34_base_device::STSMFPSCR(const UINT16 opcode)
20832083{
20842084   UINT32 n = Rn;
20852085
r31480r31481
20892089}
20902090
20912091/*  STC.L   DBR,@-Rn */
2092void sh34_base_device::STCMDBR(const UINT16 opcode)
2092inline void sh34_base_device::STCMDBR(const UINT16 opcode)
20932093{
20942094   UINT32 n = Rn;
20952095
r31480r31481
20992099}
21002100
21012101/*  STC.L   SSR,@-Rn */
2102void sh34_base_device::STCMSSR(const UINT16 opcode)
2102inline void sh34_base_device::STCMSSR(const UINT16 opcode)
21032103{
21042104   UINT32 n = Rn;
21052105
r31480r31481
21092109}
21102110
21112111/*  STC.L   SPC,@-Rn */
2112void sh34_base_device::STCMSPC(const UINT16 opcode)
2112inline void sh34_base_device::STCMSPC(const UINT16 opcode)
21132113{
21142114   UINT32 n = Rn;
21152115
r31480r31481
21192119}
21202120
21212121/*  LDS.L   @Rm+,FPUL */
2122void sh34_base_device::LDSMFPUL(const UINT16 opcode)
2122inline void sh34_base_device::LDSMFPUL(const UINT16 opcode)
21232123{
21242124   m_ea = m_r[Rn];
21252125   m_fpul = RL(m_ea );
r31480r31481
21272127}
21282128
21292129/*  LDS.L   @Rm+,FPSCR */
2130void sh34_base_device::LDSMFPSCR(const UINT16 opcode)
2130inline void sh34_base_device::LDSMFPSCR(const UINT16 opcode)
21312131{
21322132   UINT32 s;
21332133
r31480r31481
21472147}
21482148
21492149/*  LDC.L   @Rm+,DBR */
2150void sh34_base_device::LDCMDBR(const UINT16 opcode)
2150inline void sh34_base_device::LDCMDBR(const UINT16 opcode)
21512151{
21522152   m_ea = m_r[Rn];
21532153   m_dbr = RL(m_ea );
r31480r31481
21552155}
21562156
21572157/*  LDC.L   @Rn+,Rm_BANK */
2158void sh34_base_device::LDCMRBANK(const UINT16 opcode)
2158inline void sh34_base_device::LDCMRBANK(const UINT16 opcode)
21592159{
21602160   UINT32 m = Rm; UINT32 n = Rn;
21612161
r31480r31481
21652165}
21662166
21672167/*  LDC.L   @Rm+,SSR */
2168void sh34_base_device::LDCMSSR(const UINT16 opcode)
2168inline void sh34_base_device::LDCMSSR(const UINT16 opcode)
21692169{
21702170   m_ea = m_r[Rn];
21712171   m_ssr = RL(m_ea );
r31480r31481
21732173}
21742174
21752175/*  LDC.L   @Rm+,SPC */
2176void sh34_base_device::LDCMSPC(const UINT16 opcode)
2176inline void sh34_base_device::LDCMSPC(const UINT16 opcode)
21772177{
21782178   m_ea = m_r[Rn];
21792179   m_spc = RL(m_ea );
r31480r31481
21812181}
21822182
21832183/*  LDS     Rm,FPUL */
2184void sh34_base_device::LDSFPUL(const UINT16 opcode)
2184inline void sh34_base_device::LDSFPUL(const UINT16 opcode)
21852185{
21862186   m_fpul = m_r[Rn];
21872187}
21882188
21892189/*  LDS     Rm,FPSCR */
2190void sh34_base_device::LDSFPSCR(const UINT16 opcode)
2190inline void sh34_base_device::LDSFPSCR(const UINT16 opcode)
21912191{
21922192   UINT32 s;
21932193
r31480r31481
22042204}
22052205
22062206/*  LDC     Rm,DBR */
2207void sh34_base_device::LDCDBR(const UINT16 opcode)
2207inline void sh34_base_device::LDCDBR(const UINT16 opcode)
22082208{
22092209   m_dbr = m_r[Rn];
22102210}
22112211
22122212/*  SHAD    Rm,Rn */
2213void sh34_base_device::SHAD(const UINT16 opcode)
2213inline void sh34_base_device::SHAD(const UINT16 opcode)
22142214{
22152215   UINT32 m = Rm; UINT32 n = Rn;
22162216
r31480r31481
22262226}
22272227
22282228/*  SHLD    Rm,Rn */
2229void sh34_base_device::SHLD(const UINT16 opcode)
2229inline void sh34_base_device::SHLD(const UINT16 opcode)
22302230{
22312231   UINT32 m = Rm; UINT32 n = Rn;
22322232
r31480r31481
22392239}
22402240
22412241/*  LDCRBANK   Rn,Rm_BANK */
2242void sh34_base_device::LDCRBANK(const UINT16 opcode)
2242inline void sh34_base_device::LDCRBANK(const UINT16 opcode)
22432243{
22442244   UINT32 m = Rm;
22452245
r31480r31481
22472247}
22482248
22492249/*  LDC     Rm,SSR */
2250void sh34_base_device::LDCSSR(const UINT16 opcode)
2250inline void sh34_base_device::LDCSSR(const UINT16 opcode)
22512251{
22522252   m_ssr = m_r[Rn];
22532253}
22542254
22552255/*  LDC     Rm,SPC */
2256void sh34_base_device::LDCSPC(const UINT16 opcode)
2256inline void sh34_base_device::LDCSPC(const UINT16 opcode)
22572257{
22582258   m_spc = m_r[Rn];
22592259}
22602260
22612261/*  PREF     @Rn */
2262void sh34_base_device::PREFM(const UINT16 opcode)
2262inline void sh34_base_device::PREFM(const UINT16 opcode)
22632263{
22642264   int a;
22652265   UINT32 addr,dest,sq;
r31480r31481
23372337/*  FMOV    @Rm+,DRn PR=0 SZ=1 1111nnn0mmmm1001 */
23382338/*  FMOV    @Rm+,XDn PR=0 SZ=1 1111nnn1mmmm1001 */
23392339/*  FMOV    @Rm+,XDn PR=1      1111nnn1mmmm1001 */
2340void sh34_base_device::FMOVMRIFR(const UINT16 opcode)
2340inline void sh34_base_device::FMOVMRIFR(const UINT16 opcode)
23412341{
23422342   UINT32 m = Rm; UINT32 n = Rn;
23432343
r31480r31481
23752375/*  FMOV    DRm,@Rn PR=0 SZ=1 1111nnnnmmm01010 */
23762376/*  FMOV    XDm,@Rn PR=0 SZ=1 1111nnnnmmm11010 */
23772377/*  FMOV    XDm,@Rn PR=1      1111nnnnmmm11010 */
2378void sh34_base_device::FMOVFRMR(const UINT16 opcode)
2378inline void sh34_base_device::FMOVFRMR(const UINT16 opcode)
23792379{
23802380   UINT32 m = Rm; UINT32 n = Rn;
23812381
r31480r31481
24072407/*  FMOV    DRm,@-Rn PR=0 SZ=1 1111nnnnmmm01011 */
24082408/*  FMOV    XDm,@-Rn PR=0 SZ=1 1111nnnnmmm11011 */
24092409/*  FMOV    XDm,@-Rn PR=1      1111nnnnmmm11011 */
2410void sh34_base_device::FMOVFRMDR(const UINT16 opcode)
2410inline void sh34_base_device::FMOVFRMDR(const UINT16 opcode)
24112411{
24122412   UINT32 m = Rm; UINT32 n = Rn;
24132413
r31480r31481
24432443/*  FMOV    DRm,@(R0,Rn) PR=0 SZ=1 1111nnnnmmm00111 */
24442444/*  FMOV    XDm,@(R0,Rn) PR=0 SZ=1 1111nnnnmmm10111 */
24452445/*  FMOV    XDm,@(R0,Rn) PR=1      1111nnnnmmm10111 */
2446void sh34_base_device::FMOVFRS0(const UINT16 opcode)
2446inline void sh34_base_device::FMOVFRS0(const UINT16 opcode)
24472447{
24482448   UINT32 m = Rm; UINT32 n = Rn;
24492449
r31480r31481
24752475/*  FMOV    @(R0,Rm),DRn PR=0 SZ=1 1111nnn0mmmm0110 */
24762476/*  FMOV    @(R0,Rm),XDn PR=0 SZ=1 1111nnn1mmmm0110 */
24772477/*  FMOV    @(R0,Rm),XDn PR=1      1111nnn1mmmm0110 */
2478void sh34_base_device::FMOVS0FR(const UINT16 opcode)
2478inline void sh34_base_device::FMOVS0FR(const UINT16 opcode)
24792479{
24802480   UINT32 m = Rm; UINT32 n = Rn;
24812481
r31480r31481
25082508/*  FMOV    @Rm,XDn PR=0 SZ=1 1111nnn1mmmm1000 */
25092509/*  FMOV    @Rm,XDn PR=1      1111nnn1mmmm1000 */
25102510/*  FMOV    @Rm,DRn PR=1      1111nnn0mmmm1000 */
2511void sh34_base_device::FMOVMRFR(const UINT16 opcode)
2511inline void sh34_base_device::FMOVMRFR(const UINT16 opcode)
25122512{
25132513   UINT32 m = Rm; UINT32 n = Rn;
25142514
r31480r31481
25492549/*  FMOV    XDm,DRn PR=1      XDm -> DRn 1111nnn0mmm11100 */
25502550/*  FMOV    DRm,XDn PR=1      DRm -> XDn 1111nnn1mmm01100 */
25512551/*  FMOV    XDm,XDn PR=1      XDm -> XDn 1111nnn1mmm11100 */
2552void sh34_base_device::FMOVFR(const UINT16 opcode)
2552inline void sh34_base_device::FMOVFR(const UINT16 opcode)
25532553{
25542554   UINT32 m = Rm; UINT32 n = Rn;
25552555
r31480r31481
25772577}
25782578
25792579/*  FLDI1  FRn 1111nnnn10011101 */
2580void sh34_base_device::FLDI1(const UINT16 opcode)
2580inline void sh34_base_device::FLDI1(const UINT16 opcode)
25812581{
25822582   m_fr[Rn] = 0x3F800000;
25832583}
25842584
25852585/*  FLDI0  FRn 1111nnnn10001101 */
2586void sh34_base_device::FLDI0(const UINT16 opcode)
2586inline void sh34_base_device::FLDI0(const UINT16 opcode)
25872587{
25882588   m_fr[Rn] = 0;
25892589}
25902590
25912591/*  FLDS FRm,FPUL 1111mmmm00011101 */
2592void sh34_base_device:: FLDS(const UINT16 opcode)
2592inline void sh34_base_device:: FLDS(const UINT16 opcode)
25932593{
25942594   m_fpul = m_fr[Rn];
25952595}
25962596
25972597/*  FSTS FPUL,FRn 1111nnnn00001101 */
2598void sh34_base_device:: FSTS(const UINT16 opcode)
2598inline void sh34_base_device:: FSTS(const UINT16 opcode)
25992599{
26002600   m_fr[Rn] = m_fpul;
26012601}
r31480r31481
26162616
26172617/* FTRC FRm,FPUL PR=0 1111mmmm00111101 */
26182618/* FTRC DRm,FPUL PR=1 1111mmm000111101 */
2619void sh34_base_device::FTRC(const UINT16 opcode)
2619inline void sh34_base_device::FTRC(const UINT16 opcode)
26202620{
26212621   UINT32 n = Rn;
26222622
r31480r31481
26342634
26352635/* FLOAT FPUL,FRn PR=0 1111nnnn00101101 */
26362636/* FLOAT FPUL,DRn PR=1 1111nnn000101101 */
2637void sh34_base_device::FLOAT(const UINT16 opcode)
2637inline void sh34_base_device::FLOAT(const UINT16 opcode)
26382638{
26392639   UINT32 n = Rn;
26402640
r31480r31481
26512651
26522652/* FNEG FRn PR=0 1111nnnn01001101 */
26532653/* FNEG DRn PR=1 1111nnn001001101 */
2654void sh34_base_device::FNEG(const UINT16 opcode)
2654inline void sh34_base_device::FNEG(const UINT16 opcode)
26552655{
26562656   UINT32 n = Rn;
26572657
r31480r31481
26642664
26652665/* FABS FRn PR=0 1111nnnn01011101 */
26662666/* FABS DRn PR=1 1111nnn001011101 */
2667void sh34_base_device::FABS(const UINT16 opcode)
2667inline void sh34_base_device::FABS(const UINT16 opcode)
26682668{
26692669   UINT32 n = Rn;
26702670
r31480r31481
26832683
26842684/* FCMP/EQ FRm,FRn PR=0 1111nnnnmmmm0100 */
26852685/* FCMP/EQ DRm,DRn PR=1 1111nnn0mmm00100 */
2686void sh34_base_device::FCMP_EQ(const UINT16 opcode)
2686inline void sh34_base_device::FCMP_EQ(const UINT16 opcode)
26872687{
26882688   UINT32 m = Rm; UINT32 n = Rn;
26892689
r31480r31481
27042704
27052705/* FCMP/GT FRm,FRn PR=0 1111nnnnmmmm0101 */
27062706/* FCMP/GT DRm,DRn PR=1 1111nnn0mmm00101 */
2707void sh34_base_device::FCMP_GT(const UINT16 opcode)
2707inline void sh34_base_device::FCMP_GT(const UINT16 opcode)
27082708{
27092709   UINT32 m = Rm; UINT32 n = Rn;
27102710
r31480r31481
27242724}
27252725
27262726/* FCNVDS DRm,FPUL PR=1 1111mmm010111101 */
2727void sh34_base_device::FCNVDS(const UINT16 opcode)
2727inline void sh34_base_device::FCNVDS(const UINT16 opcode)
27282728{
27292729   UINT32 n = Rn;
27302730
r31480r31481
27372737}
27382738
27392739/* FCNVSD FPUL, DRn PR=1 1111nnn010101101 */
2740void sh34_base_device::FCNVSD(const UINT16 opcode)
2740inline void sh34_base_device::FCNVSD(const UINT16 opcode)
27412741{
27422742   UINT32 n = Rn;
27432743
r31480r31481
27492749
27502750/* FADD FRm,FRn PR=0 1111nnnnmmmm0000 */
27512751/* FADD DRm,DRn PR=1 1111nnn0mmm00000 */
2752void sh34_base_device::FADD(const UINT16 opcode)
2752inline void sh34_base_device::FADD(const UINT16 opcode)
27532753{
27542754   UINT32 m = Rm; UINT32 n = Rn;
27552755
r31480r31481
27642764
27652765/* FSUB FRm,FRn PR=0 1111nnnnmmmm0001 */
27662766/* FSUB DRm,DRn PR=1 1111nnn0mmm00001 */
2767void sh34_base_device::FSUB(const UINT16 opcode)
2767inline void sh34_base_device::FSUB(const UINT16 opcode)
27682768{
27692769   UINT32 m = Rm; UINT32 n = Rn;
27702770
r31480r31481
27802780
27812781/* FMUL FRm,FRn PR=0 1111nnnnmmmm0010 */
27822782/* FMUL DRm,DRn PR=1 1111nnn0mmm00010 */
2783void sh34_base_device::FMUL(const UINT16 opcode)
2783inline void sh34_base_device::FMUL(const UINT16 opcode)
27842784{
27852785   UINT32 m = Rm; UINT32 n = Rn;
27862786
r31480r31481
27952795
27962796/* FDIV FRm,FRn PR=0 1111nnnnmmmm0011 */
27972797/* FDIV DRm,DRn PR=1 1111nnn0mmm00011 */
2798void sh34_base_device::FDIV(const UINT16 opcode)
2798inline void sh34_base_device::FDIV(const UINT16 opcode)
27992799{
28002800   UINT32 m = Rm; UINT32 n = Rn;
28012801
r31480r31481
28132813}
28142814
28152815/* FMAC FR0,FRm,FRn PR=0 1111nnnnmmmm1110 */
2816void sh34_base_device::FMAC(const UINT16 opcode)
2816inline void sh34_base_device::FMAC(const UINT16 opcode)
28172817{
28182818   UINT32 m = Rm; UINT32 n = Rn;
28192819
r31480r31481
28242824
28252825/* FSQRT FRn PR=0 1111nnnn01101101 */
28262826/* FSQRT DRn PR=1 1111nnnn01101101 */
2827void sh34_base_device::FSQRT(const UINT16 opcode)
2827inline void sh34_base_device::FSQRT(const UINT16 opcode)
28282828{
28292829   UINT32 n = Rn;
28302830
r31480r31481
28412841}
28422842
28432843/* FSRRA FRn PR=0 1111nnnn01111101 */
2844void sh34_base_device::FSRRA(const UINT16 opcode)
2844inline void sh34_base_device::FSRRA(const UINT16 opcode)
28452845{
28462846   UINT32 n = Rn;
28472847
r31480r31481
28632863}
28642864
28652865/* FIPR FVm,FVn PR=0 1111nnmm11101101 */
2866void sh34_base_device::FIPR(const UINT16 opcode)
2866inline void sh34_base_device::FIPR(const UINT16 opcode)
28672867{
28682868   UINT32 n = Rn;
28692869
r31480r31481
28962896      FP_RFS(n + i) = sum[i];
28972897}
28982898
2899void sh34_base_device::op1111_0xf13(const UINT16 opcode)
2899inline void sh34_base_device::op1111_0xf13(const UINT16 opcode)
29002900{
29012901   if (opcode & 0x100) {
29022902         if (opcode & 0x200) {
r31480r31481
29262926}
29272927
29282928
2929sh34_base_device::sh4ophandler sh34_base_device::s_master_ophandler_table[0x10000];
2930
2931const sh34_base_device::sh4ophandler sh34_base_device::s_op1111_0x13_handlers[16] =
2929inline void sh34_base_device::op1111_0x13(UINT16 opcode)
29322930{
2933   &sh34_base_device::FSTS,       &sh34_base_device::FLDS,       &sh34_base_device::FLOAT,      &sh34_base_device::FTRC,
2934   &sh34_base_device::FNEG,       &sh34_base_device::FABS,       &sh34_base_device::FSQRT,      &sh34_base_device::FSRRA,
2935   &sh34_base_device::FLDI0,      &sh34_base_device::FLDI1,      &sh34_base_device::FCNVSD,     &sh34_base_device::FCNVDS,
2936   &sh34_base_device::dbreak,     &sh34_base_device::dbreak,     &sh34_base_device::FIPR,       &sh34_base_device::op1111_0xf13
2937};
2938
2939void sh34_base_device::op1111_0x13(UINT16 opcode)
2940{
2941   (this->*s_op1111_0x13_handlers[(opcode&0xf0)>>4])(opcode);
2931   switch((opcode >> 4) & 0x0f)
2932   {
2933      case 0x00:  FSTS(opcode); break;
2934      case 0x01:  FLDS(opcode); break;
2935      case 0x02:  FLOAT(opcode); break;
2936      case 0x03:  FTRC(opcode); break;
2937      case 0x04:  FNEG(opcode); break;
2938      case 0x05:  FABS(opcode); break;
2939      case 0x06:  FSQRT(opcode); break;
2940      case 0x07:  FSRRA(opcode); break;
2941      case 0x08:  FLDI0(opcode); break;
2942      case 0x09:  FLDI1(opcode); break;
2943      case 0x0a:  FCNVSD(opcode); break;
2944      case 0x0b:  FCNVDS(opcode); break;
2945      case 0x0c:  dbreak(opcode); break;
2946      case 0x0d:  dbreak(opcode); break;
2947      case 0x0e:  FIPR(opcode); break;
2948      case 0x0f:  op1111_0xf13(opcode); break;
2949   }
29422950}
29432951
29442952
r31480r31481
30393047   m_sleep_mode = 0;
30403048
30413049   m_sh4_mmu_enabled = 0;
3042
3043   sh4_build_optable();
30443050}
30453051
30463052/*-------------------------------------------------
r31480r31481
30723078   m_SH4_TCNT2 = 0xffffffff;
30733079}
30743080
3075/* These tables are combined into our main opcode jump table, master_ophandler_table in the RESET function */
3076
3077#define SH4OP(x)  &sh34_base_device::x
3078
3079const sh34_base_device::sh4ophandler sh34_base_device::s_op1000_handler[16] =
3081inline void sh34_base_device::execute_one_0000(const UINT16 opcode)
30803082{
3081   SH4OP(MOVBS4),     SH4OP(MOVWS4),     SH4OP(NOP),        SH4OP(NOP),        SH4OP(MOVBL4),     SH4OP(MOVWL4),     SH4OP(NOP),        SH4OP(NOP),
3082   SH4OP(CMPIM),      SH4OP(BT),         SH4OP(NOP),        SH4OP(BF),         SH4OP(NOP),        SH4OP(BTS),        SH4OP(NOP),        SH4OP(BFS)
3083    switch(opcode & 0xff)
3084    {
3085      // 0x00
3086      case 0x00:  NOP(opcode); break;
3087      case 0x10:  NOP(opcode); break;
3088      case 0x20:  NOP(opcode); break;
3089      case 0x30:  NOP(opcode); break;
3090      case 0x40:  NOP(opcode); break;
3091      case 0x50:  NOP(opcode); break;
3092      case 0x60:  NOP(opcode); break;
3093      case 0x70:  NOP(opcode); break;
3094      case 0x80:  NOP(opcode); break;
3095      case 0x90:  NOP(opcode); break;
3096      case 0xa0:  NOP(opcode); break;
3097      case 0xb0:  NOP(opcode); break;
3098      case 0xc0:  NOP(opcode); break;
3099      case 0xd0:  NOP(opcode); break;
3100      case 0xe0:  NOP(opcode); break;
3101      case 0xf0:  NOP(opcode); break;
3102      // 0x10
3103      case 0x01:  NOP(opcode); break;
3104      case 0x11:  NOP(opcode); break;
3105      case 0x21:  NOP(opcode); break;
3106      case 0x31:  NOP(opcode); break;
3107      case 0x41:  NOP(opcode); break;
3108      case 0x51:  NOP(opcode); break;
3109      case 0x61:  NOP(opcode); break;
3110      case 0x71:  NOP(opcode); break;
3111      case 0x81:  NOP(opcode); break;
3112      case 0x91:  NOP(opcode); break;
3113      case 0xa1:  NOP(opcode); break;
3114      case 0xb1:  NOP(opcode); break;
3115      case 0xc1:  NOP(opcode); break;
3116      case 0xd1:  NOP(opcode); break;
3117      case 0xe1:  NOP(opcode); break;
3118      case 0xf1:  NOP(opcode); break;
3119      // 0x20
3120      case 0x02:  STCSR(opcode); break;
3121      case 0x12:  STCGBR(opcode); break;
3122      case 0x22:  STCVBR(opcode); break;
3123      case 0x32:  STCSSR(opcode); break;
3124      case 0x42:  STCSPC(opcode); break;
3125      case 0x52:  NOP(opcode); break;
3126      case 0x62:  NOP(opcode); break;
3127      case 0x72:  NOP(opcode); break;
3128      case 0x82:  STCRBANK(opcode); break;
3129      case 0x92:  STCRBANK(opcode); break;
3130      case 0xa2:  STCRBANK(opcode); break;
3131      case 0xb2:  STCRBANK(opcode); break;
3132      case 0xc2:  STCRBANK(opcode); break;
3133      case 0xd2:  STCRBANK(opcode); break;
3134      case 0xe2:  STCRBANK(opcode); break;
3135      case 0xf2:  STCRBANK(opcode); break;
3136      // 0x30
3137      case 0x03:  BSRF(opcode); break;
3138      case 0x13:  NOP(opcode); break;
3139      case 0x23:  BRAF(opcode); break;
3140      case 0x33:  NOP(opcode); break;
3141      case 0x43:  NOP(opcode); break;
3142      case 0x53:  NOP(opcode); break;
3143      case 0x63:  NOP(opcode); break;
3144      case 0x73:  NOP(opcode); break;
3145      case 0x83:  PREFM(opcode); break;
3146      case 0x93:  TODO(opcode); break;
3147      case 0xa3:  TODO(opcode); break;
3148      case 0xb3:  TODO(opcode); break;
3149      case 0xc3:  MOVCAL(opcode); break;
3150      case 0xd3:  NOP(opcode); break;
3151      case 0xe3:  NOP(opcode); break;
3152      case 0xf3:  NOP(opcode); break;
3153      // 0x40
3154      case 0x04:  MOVBS0(opcode); break;
3155      case 0x14:  MOVBS0(opcode); break;
3156      case 0x24:  MOVBS0(opcode); break;
3157      case 0x34:  MOVBS0(opcode); break;
3158      case 0x44:  MOVBS0(opcode); break;
3159      case 0x54:  MOVBS0(opcode); break;
3160      case 0x64:  MOVBS0(opcode); break;
3161      case 0x74:  MOVBS0(opcode); break;
3162      case 0x84:  MOVBS0(opcode); break;
3163      case 0x94:  MOVBS0(opcode); break;
3164      case 0xa4:  MOVBS0(opcode); break;
3165      case 0xb4:  MOVBS0(opcode); break;
3166      case 0xc4:  MOVBS0(opcode); break;
3167      case 0xd4:  MOVBS0(opcode); break;
3168      case 0xe4:  MOVBS0(opcode); break;
3169      case 0xf4:  MOVBS0(opcode); break;
3170      // 0x50
3171      case 0x05:  MOVWS0(opcode); break;
3172      case 0x15:  MOVWS0(opcode); break;
3173      case 0x25:  MOVWS0(opcode); break;
3174      case 0x35:  MOVWS0(opcode); break;
3175      case 0x45:  MOVWS0(opcode); break;
3176      case 0x55:  MOVWS0(opcode); break;
3177      case 0x65:  MOVWS0(opcode); break;
3178      case 0x75:  MOVWS0(opcode); break;
3179      case 0x85:  MOVWS0(opcode); break;
3180      case 0x95:  MOVWS0(opcode); break;
3181      case 0xa5:  MOVWS0(opcode); break;
3182      case 0xb5:  MOVWS0(opcode); break;
3183      case 0xc5:  MOVWS0(opcode); break;
3184      case 0xd5:  MOVWS0(opcode); break;
3185      case 0xe5:  MOVWS0(opcode); break;
3186      case 0xf5:  MOVWS0(opcode); break;
3187      // 0x60
3188      case 0x06:  MOVLS0(opcode); break;
3189      case 0x16:  MOVLS0(opcode); break;
3190      case 0x26:  MOVLS0(opcode); break;
3191      case 0x36:  MOVLS0(opcode); break;
3192      case 0x46:  MOVLS0(opcode); break;
3193      case 0x56:  MOVLS0(opcode); break;
3194      case 0x66:  MOVLS0(opcode); break;
3195      case 0x76:  MOVLS0(opcode); break;
3196      case 0x86:  MOVLS0(opcode); break;
3197      case 0x96:  MOVLS0(opcode); break;
3198      case 0xa6:  MOVLS0(opcode); break;
3199      case 0xb6:  MOVLS0(opcode); break;
3200      case 0xc6:  MOVLS0(opcode); break;
3201      case 0xd6:  MOVLS0(opcode); break;
3202      case 0xe6:  MOVLS0(opcode); break;
3203      case 0xf6:  MOVLS0(opcode); break;
3204      // 0x70
3205      case 0x07:  MULL(opcode); break;
3206      case 0x17:  MULL(opcode); break;
3207      case 0x27:  MULL(opcode); break;
3208      case 0x37:  MULL(opcode); break;
3209      case 0x47:  MULL(opcode); break;
3210      case 0x57:  MULL(opcode); break;
3211      case 0x67:  MULL(opcode); break;
3212      case 0x77:  MULL(opcode); break;
3213      case 0x87:  MULL(opcode); break;
3214      case 0x97:  MULL(opcode); break;
3215      case 0xa7:  MULL(opcode); break;
3216      case 0xb7:  MULL(opcode); break;
3217      case 0xc7:  MULL(opcode); break;
3218      case 0xd7:  MULL(opcode); break;
3219      case 0xe7:  MULL(opcode); break;
3220      case 0xf7:  MULL(opcode); break;
3221      // 0x80
3222      case 0x08:  CLRT(opcode); break;
3223      case 0x18:  SETT(opcode); break;
3224      case 0x28:  CLRMAC(opcode); break;
3225      case 0x38:  TODO(opcode); break;
3226      case 0x48:  CLRS(opcode); break;
3227      case 0x58:  SETS(opcode); break;
3228      case 0x68:  NOP(opcode); break;
3229      case 0x78:  NOP(opcode); break;
3230      case 0x88:  CLRT(opcode); break;
3231      case 0x98:  SETT(opcode); break;
3232      case 0xa8:  CLRMAC(opcode); break;
3233      case 0xb8:  TODO(opcode); break;
3234      case 0xc8:  CLRS(opcode); break;
3235      case 0xd8:  SETS(opcode); break;
3236      case 0xe8:  NOP(opcode); break;
3237      case 0xf8:  NOP(opcode); break;
3238      // 0x90
3239      case 0x09:  NOP(opcode); break;
3240      case 0x19:  DIV0U(opcode); break;
3241      case 0x29:  MOVT(opcode); break;
3242      case 0x39:  NOP(opcode); break;
3243      case 0x49:  NOP(opcode); break;
3244      case 0x59:  DIV0U(opcode); break;
3245      case 0x69:  MOVT(opcode); break;
3246      case 0x79:  NOP(opcode); break;
3247      case 0x89:  NOP(opcode); break;
3248      case 0x99:  DIV0U(opcode); break;
3249      case 0xa9:  MOVT(opcode); break;
3250      case 0xb9:  NOP(opcode); break;
3251      case 0xc9:  NOP(opcode); break;
3252      case 0xd9:  DIV0U(opcode); break;
3253      case 0xe9:  MOVT(opcode); break;
3254      case 0xf9:  NOP(opcode); break;
3255      // 0xa0
3256      case 0x0a:  STSMACH(opcode); break;
3257      case 0x1a:  STSMACL(opcode); break;
3258      case 0x2a:  STSPR(opcode); break;
3259      case 0x3a:  STCSGR(opcode); break;
3260      case 0x4a:  NOP(opcode); break;
3261      case 0x5a:  STSFPUL(opcode); break;
3262      case 0x6a:  STSFPSCR(opcode); break;
3263      case 0x7a:  STCDBR(opcode); break;
3264      case 0x8a:  STSMACH(opcode); break;
3265      case 0x9a:  STSMACL(opcode); break;
3266      case 0xaa:  STSPR(opcode); break;
3267      case 0xba:  STCSGR(opcode); break;
3268      case 0xca:  NOP(opcode); break;
3269      case 0xda:  STSFPUL(opcode); break;
3270      case 0xea:  STSFPSCR(opcode); break;
3271      case 0xfa:  STCDBR(opcode); break;
3272      // 0xb0
3273      case 0x0b:  RTS(opcode); break;
3274      case 0x1b:  SLEEP(opcode); break;
3275      case 0x2b:  RTE(opcode); break;
3276      case 0x3b:  NOP(opcode); break;
3277      case 0x4b:  RTS(opcode); break;
3278      case 0x5b:  SLEEP(opcode); break;
3279      case 0x6b:  RTE(opcode); break;
3280      case 0x7b:  NOP(opcode); break;
3281      case 0x8b:  RTS(opcode); break;
3282      case 0x9b:  SLEEP(opcode); break;
3283      case 0xab:  RTE(opcode); break;
3284      case 0xbb:  NOP(opcode); break;
3285      case 0xcb:  RTS(opcode); break;
3286      case 0xdb:  SLEEP(opcode); break;
3287      case 0xeb:  RTE(opcode); break;
3288      case 0xfb:  NOP(opcode); break;
3289      // 0xc0
3290      case 0x0c:  MOVBL0(opcode); break;
3291      case 0x1c:  MOVBL0(opcode); break;
3292      case 0x2c:  MOVBL0(opcode); break;
3293      case 0x3c:  MOVBL0(opcode); break;
3294      case 0x4c:  MOVBL0(opcode); break;
3295      case 0x5c:  MOVBL0(opcode); break;
3296      case 0x6c:  MOVBL0(opcode); break;
3297      case 0x7c:  MOVBL0(opcode); break;
3298      case 0x8c:  MOVBL0(opcode); break;
3299      case 0x9c:  MOVBL0(opcode); break;
3300      case 0xac:  MOVBL0(opcode); break;
3301      case 0xbc:  MOVBL0(opcode); break;
3302      case 0xcc:  MOVBL0(opcode); break;
3303      case 0xdc:  MOVBL0(opcode); break;
3304      case 0xec:  MOVBL0(opcode); break;
3305      case 0xfc:  MOVBL0(opcode); break;
3306      // 0xd0
3307      case 0x0d:  MOVWL0(opcode); break;
3308      case 0x1d:  MOVWL0(opcode); break;
3309      case 0x2d:  MOVWL0(opcode); break;
3310      case 0x3d:  MOVWL0(opcode); break;
3311      case 0x4d:  MOVWL0(opcode); break;
3312      case 0x5d:  MOVWL0(opcode); break;
3313      case 0x6d:  MOVWL0(opcode); break;
3314      case 0x7d:  MOVWL0(opcode); break;
3315      case 0x8d:  MOVWL0(opcode); break;
3316      case 0x9d:  MOVWL0(opcode); break;
3317      case 0xad:  MOVWL0(opcode); break;
3318      case 0xbd:  MOVWL0(opcode); break;
3319      case 0xcd:  MOVWL0(opcode); break;
3320      case 0xdd:  MOVWL0(opcode); break;
3321      case 0xed:  MOVWL0(opcode); break;
3322      case 0xfd:  MOVWL0(opcode); break;
3323      // 0xe0
3324      case 0x0e:  MOVLL0(opcode); break;
3325      case 0x1e:  MOVLL0(opcode); break;
3326      case 0x2e:  MOVLL0(opcode); break;
3327      case 0x3e:  MOVLL0(opcode); break;
3328      case 0x4e:  MOVLL0(opcode); break;
3329      case 0x5e:  MOVLL0(opcode); break;
3330      case 0x6e:  MOVLL0(opcode); break;
3331      case 0x7e:  MOVLL0(opcode); break;
3332      case 0x8e:  MOVLL0(opcode); break;
3333      case 0x9e:  MOVLL0(opcode); break;
3334      case 0xae:  MOVLL0(opcode); break;
3335      case 0xbe:  MOVLL0(opcode); break;
3336      case 0xce:  MOVLL0(opcode); break;
3337      case 0xde:  MOVLL0(opcode); break;
3338      case 0xee:  MOVLL0(opcode); break;
3339      case 0xfe:  MOVLL0(opcode); break;
3340      // 0xf0
3341      case 0x0f:  MAC_L(opcode); break;
3342      case 0x1f:  MAC_L(opcode); break;
3343      case 0x2f:  MAC_L(opcode); break;
3344      case 0x3f:  MAC_L(opcode); break;
3345      case 0x4f:  MAC_L(opcode); break;
3346      case 0x5f:  MAC_L(opcode); break;
3347      case 0x6f:  MAC_L(opcode); break;
3348      case 0x7f:  MAC_L(opcode); break;
3349      case 0x8f:  MAC_L(opcode); break;
3350      case 0x9f:  MAC_L(opcode); break;
3351      case 0xaf:  MAC_L(opcode); break;
3352      case 0xbf:  MAC_L(opcode); break;
3353      case 0xcf:  MAC_L(opcode); break;
3354      case 0xdf:  MAC_L(opcode); break;
3355      case 0xef:  MAC_L(opcode); break;
3356      case 0xff:  MAC_L(opcode); break;
3357   }
30833358};
30843359
3085const sh34_base_device::sh4ophandler sh34_base_device::s_op1100_handler[16] =
3360inline void sh34_base_device::execute_one_4000(const UINT16 opcode)
30863361{
3087   SH4OP(MOVBSG),     SH4OP(MOVWSG),     SH4OP(MOVLSG),     SH4OP(TRAPA),      SH4OP(MOVBLG),     SH4OP(MOVWLG),     SH4OP(MOVLLG),     SH4OP(MOVA),
3088   SH4OP(TSTI),       SH4OP(ANDI),       SH4OP(XORI),       SH4OP(ORI),        SH4OP(TSTM),       SH4OP(ANDM),       SH4OP(XORM),       SH4OP(ORM)
3089};
3362   switch(opcode & 0xff)
3363   {
3364      // 0x00
3365      case 0x00:  SHLL(opcode); break;
3366      case 0x10:  DT(opcode); break;
3367      case 0x20:  SHAL(opcode); break;
3368      case 0x30:  NOP(opcode); break;
3369      case 0x40:  SHLL(opcode); break;
3370      case 0x50:  DT(opcode); break;
3371      case 0x60:  SHAL(opcode); break;
3372      case 0x70:  NOP(opcode); break;
3373      case 0x80:  SHLL(opcode); break;
3374      case 0x90:  DT(opcode); break;
3375      case 0xa0:  SHAL(opcode); break;
3376      case 0xb0:  NOP(opcode); break;
3377      case 0xc0:  SHLL(opcode); break;
3378      case 0xd0:  DT(opcode); break;
3379      case 0xe0:  SHAL(opcode); break;
3380      case 0xf0:  NOP(opcode); break;
3381      // 0x10
3382      case 0x01:  SHLR(opcode); break;
3383      case 0x11:  CMPPZ(opcode); break;
3384      case 0x21:  SHAR(opcode); break;
3385      case 0x31:  NOP(opcode); break;
3386      case 0x41:  SHLR(opcode); break;
3387      case 0x51:  CMPPZ(opcode); break;
3388      case 0x61:  SHAR(opcode); break;
3389      case 0x71:  NOP(opcode); break;
3390      case 0x81:  SHLR(opcode); break;
3391      case 0x91:  CMPPZ(opcode); break;
3392      case 0xa1:  SHAR(opcode); break;
3393      case 0xb1:  NOP(opcode); break;
3394      case 0xc1:  SHLR(opcode); break;
3395      case 0xd1:  CMPPZ(opcode); break;
3396      case 0xe1:  SHAR(opcode); break;
3397      case 0xf1:  NOP(opcode); break;
3398      // 0x20
3399      case 0x02:  STSMMACH(opcode); break;
3400      case 0x12:  STSMMACL(opcode); break;
3401      case 0x22:  STSMPR(opcode); break;
3402      case 0x32:  STCMSGR(opcode); break;
3403      case 0x42:  NOP(opcode); break;
3404      case 0x52:  STSMFPUL(opcode); break;
3405      case 0x62:  STSMFPSCR(opcode); break;
3406      case 0x72:  NOP(opcode); break;
3407      case 0x82:  NOP(opcode); break;
3408      case 0x92:  NOP(opcode); break;
3409      case 0xa2:  NOP(opcode); break;
3410      case 0xb2:  NOP(opcode); break;
3411      case 0xc2:  NOP(opcode); break;
3412      case 0xd2:  NOP(opcode); break;
3413      case 0xe2:  NOP(opcode); break;
3414      case 0xf2:  STCMDBR(opcode); break;
3415      // 0x30
3416      case 0x03:  STCMSR(opcode); break;
3417      case 0x13:  STCMGBR(opcode); break;
3418      case 0x23:  STCMVBR(opcode); break;
3419      case 0x33:  STCMSSR(opcode); break;
3420      case 0x43:  STCMSPC(opcode); break;
3421      case 0x53:  NOP(opcode); break;
3422      case 0x63:  NOP(opcode); break;
3423      case 0x73:  NOP(opcode); break;
3424      case 0x83:  STCMRBANK(opcode); break;
3425      case 0x93:  STCMRBANK(opcode); break;
3426      case 0xa3:  STCMRBANK(opcode); break;
3427      case 0xb3:  STCMRBANK(opcode); break;
3428      case 0xc3:  STCMRBANK(opcode); break;
3429      case 0xd3:  STCMRBANK(opcode); break;
3430      case 0xe3:  STCMRBANK(opcode); break;
3431      case 0xf3:  STCMRBANK(opcode); break;
3432      // 0x40
3433      case 0x04:  ROTL(opcode); break;
3434      case 0x14:  NOP(opcode); break;
3435      case 0x24:  ROTCL(opcode); break;
3436      case 0x34:  NOP(opcode); break;
3437      case 0x44:  ROTL(opcode); break;
3438      case 0x54:  NOP(opcode); break;
3439      case 0x64:  ROTCL(opcode); break;
3440      case 0x74:  NOP(opcode); break;
3441      case 0x84:  ROTL(opcode); break;
3442      case 0x94:  NOP(opcode); break;
3443      case 0xa4:  ROTCL(opcode); break;
3444      case 0xb4:  NOP(opcode); break;
3445      case 0xc4:  ROTL(opcode); break;
3446      case 0xd4:  NOP(opcode); break;
3447      case 0xe4:  ROTCL(opcode); break;
3448      case 0xf4:  NOP(opcode); break;
3449      // 0x50
3450      case 0x05:  ROTR(opcode); break;
3451      case 0x15:  CMPPL(opcode); break;
3452      case 0x25:  ROTCR(opcode); break;
3453      case 0x35:  NOP(opcode); break;
3454      case 0x45:  ROTR(opcode); break;
3455      case 0x55:  CMPPL(opcode); break;
3456      case 0x65:  ROTCR(opcode); break;
3457      case 0x75:  NOP(opcode); break;
3458      case 0x85:  ROTR(opcode); break;
3459      case 0x95:  CMPPL(opcode); break;
3460      case 0xa5:  ROTCR(opcode); break;
3461      case 0xb5:  NOP(opcode); break;
3462      case 0xc5:  ROTR(opcode); break;
3463      case 0xd5:  CMPPL(opcode); break;
3464      case 0xe5:  ROTCR(opcode); break;
3465      case 0xf5:  NOP(opcode); break;
3466      // 0x60
3467      case 0x06:  LDSMMACH(opcode); break;
3468      case 0x16:  LDSMMACL(opcode); break;
3469      case 0x26:  LDSMPR(opcode); break;
3470      case 0x36:  NOP(opcode); break;
3471      case 0x46:  NOP(opcode); break;
3472      case 0x56:  LDSMFPUL(opcode); break;
3473      case 0x66:  LDSMFPSCR(opcode); break;
3474      case 0x76:  NOP(opcode); break;
3475      case 0x86:  NOP(opcode); break;
3476      case 0x96:  NOP(opcode); break;
3477      case 0xa6:  NOP(opcode); break;
3478      case 0xb6:  NOP(opcode); break;
3479      case 0xc6:  NOP(opcode); break;
3480      case 0xd6:  NOP(opcode); break;
3481      case 0xe6:  NOP(opcode); break;
3482      case 0xf6:  LDCMDBR(opcode); break;
3483      // 0x70
3484      case 0x07:  LDCMSR(opcode); break;
3485      case 0x17:  LDCMGBR(opcode); break;
3486      case 0x27:  LDCMVBR(opcode); break;
3487      case 0x37:  LDCMSSR(opcode); break;
3488      case 0x47:  LDCMSPC(opcode); break;
3489      case 0x57:  NOP(opcode); break;
3490      case 0x67:  NOP(opcode); break;
3491      case 0x77:  NOP(opcode); break;
3492      case 0x87:  LDCMRBANK(opcode); break;
3493      case 0x97:  LDCMRBANK(opcode); break;
3494      case 0xa7:  LDCMRBANK(opcode); break;
3495      case 0xb7:  LDCMRBANK(opcode); break;
3496      case 0xc7:  LDCMRBANK(opcode); break;
3497      case 0xd7:  LDCMRBANK(opcode); break;
3498      case 0xe7:  LDCMRBANK(opcode); break;
3499      case 0xf7:  LDCMRBANK(opcode); break;
3500      // 0x80
3501      case 0x08:  SHLL2(opcode); break;
3502      case 0x18:  SHLL8(opcode); break;
3503      case 0x28:  SHLL16(opcode); break;
3504      case 0x38:  NOP(opcode); break;
3505      case 0x48:  SHLL2(opcode); break;
3506      case 0x58:  SHLL8(opcode); break;
3507      case 0x68:  SHLL16(opcode); break;
3508      case 0x78:  NOP(opcode); break;
3509      case 0x88:  SHLL2(opcode); break;
3510      case 0x98:  SHLL8(opcode); break;
3511      case 0xa8:  SHLL16(opcode); break;
3512      case 0xb8:  NOP(opcode); break;
3513      case 0xc8:  SHLL2(opcode); break;
3514      case 0xd8:  SHLL8(opcode); break;
3515      case 0xe8:  SHLL16(opcode); break;
3516      case 0xf8:  NOP(opcode); break;
3517      // 0x90
3518      case 0x09:  SHLR2(opcode); break;
3519      case 0x19:  SHLR8(opcode); break;
3520      case 0x29:  SHLR16(opcode); break;
3521      case 0x39:  NOP(opcode); break;
3522      case 0x49:  SHLR2(opcode); break;
3523      case 0x59:  SHLR8(opcode); break;
3524      case 0x69:  SHLR16(opcode); break;
3525      case 0x79:  NOP(opcode); break;
3526      case 0x89:  SHLR2(opcode); break;
3527      case 0x99:  SHLR8(opcode); break;
3528      case 0xa9:  SHLR16(opcode); break;
3529      case 0xb9:  NOP(opcode); break;
3530      case 0xc9:  SHLR2(opcode); break;
3531      case 0xd9:  SHLR8(opcode); break;
3532      case 0xe9:  SHLR16(opcode); break;
3533      case 0xf9:  NOP(opcode); break;
3534      // 0xa0
3535      case 0x0a:  LDSMACH(opcode); break;
3536      case 0x1a:  LDSMACL(opcode); break;
3537      case 0x2a:  LDSPR(opcode); break;
3538      case 0x3a:  NOP(opcode); break;
3539      case 0x4a:  NOP(opcode); break;
3540      case 0x5a:  LDSFPUL(opcode); break;
3541      case 0x6a:  LDSFPSCR(opcode); break;
3542      case 0x7a:  NOP(opcode); break;
3543      case 0x8a:  NOP(opcode); break;
3544      case 0x9a:  NOP(opcode); break;
3545      case 0xaa:  NOP(opcode); break;
3546      case 0xba:  NOP(opcode); break;
3547      case 0xca:  NOP(opcode); break;
3548      case 0xda:  NOP(opcode); break;
3549      case 0xea:  NOP(opcode); break;
3550      case 0xfa:  LDCDBR(opcode); break;
3551      // 0xb0
3552      case 0x0b:  JSR(opcode); break;
3553      case 0x1b:  TAS(opcode); break;
3554      case 0x2b:  JMP(opcode); break;
3555      case 0x3b:  NOP(opcode); break;
3556      case 0x4b:  JSR(opcode); break;
3557      case 0x5b:  TAS(opcode); break;
3558      case 0x6b:  JMP(opcode); break;
3559      case 0x7b:  NOP(opcode); break;
3560      case 0x8b:  JSR(opcode); break;
3561      case 0x9b:  TAS(opcode); break;
3562      case 0xab:  JMP(opcode); break;
3563      case 0xbb:  NOP(opcode); break;
3564      case 0xcb:  JSR(opcode); break;
3565      case 0xdb:  TAS(opcode); break;
3566      case 0xeb:  JMP(opcode); break;
3567      case 0xfb:  NOP(opcode); break;
3568      // 0xc0
3569      case 0x0c:  SHAD(opcode); break;
3570      case 0x1c:  SHAD(opcode); break;
3571      case 0x2c:  SHAD(opcode); break;
3572      case 0x3c:  SHAD(opcode); break;
3573      case 0x4c:  SHAD(opcode); break;
3574      case 0x5c:  SHAD(opcode); break;
3575      case 0x6c:  SHAD(opcode); break;
3576      case 0x7c:  SHAD(opcode); break;
3577      case 0x8c:  SHAD(opcode); break;
3578      case 0x9c:  SHAD(opcode); break;
3579      case 0xac:  SHAD(opcode); break;
3580      case 0xbc:  SHAD(opcode); break;
3581      case 0xcc:  SHAD(opcode); break;
3582      case 0xdc:  SHAD(opcode); break;
3583      case 0xec:  SHAD(opcode); break;
3584      case 0xfc:  SHAD(opcode); break;
3585      // 0xd0
3586      case 0x0d:  SHLD(opcode); break;
3587      case 0x1d:  SHLD(opcode); break;
3588      case 0x2d:  SHLD(opcode); break;
3589      case 0x3d:  SHLD(opcode); break;
3590      case 0x4d:  SHLD(opcode); break;
3591      case 0x5d:  SHLD(opcode); break;
3592      case 0x6d:  SHLD(opcode); break;
3593      case 0x7d:  SHLD(opcode); break;
3594      case 0x8d:  SHLD(opcode); break;
3595      case 0x9d:  SHLD(opcode); break;
3596      case 0xad:  SHLD(opcode); break;
3597      case 0xbd:  SHLD(opcode); break;
3598      case 0xcd:  SHLD(opcode); break;
3599      case 0xdd:  SHLD(opcode); break;
3600      case 0xed:  SHLD(opcode); break;
3601      case 0xfd:  SHLD(opcode); break;
3602      // 0xe0
3603      case 0x0e:  LDCSR(opcode); break;
3604      case 0x1e:  LDCGBR(opcode); break;
3605      case 0x2e:  LDCVBR(opcode); break;
3606      case 0x3e:  LDCSSR(opcode); break;
3607      case 0x4e:  LDCSPC(opcode); break;
3608      case 0x5e:  NOP(opcode); break;
3609      case 0x6e:  NOP(opcode); break;
3610      case 0x7e:  NOP(opcode); break;
3611      case 0x8e:  LDCRBANK(opcode); break;
3612      case 0x9e:  LDCRBANK(opcode); break;
3613      case 0xae:  LDCRBANK(opcode); break;
3614      case 0xbe:  LDCRBANK(opcode); break;
3615      case 0xce:  LDCRBANK(opcode); break;
3616      case 0xde:  LDCRBANK(opcode); break;
3617      case 0xee:  LDCRBANK(opcode); break;
3618      case 0xfe:  LDCRBANK(opcode); break;
3619      // 0xf0
3620      case 0x0f:  MAC_W(opcode); break;
3621      case 0x1f:  MAC_W(opcode); break;
3622      case 0x2f:  MAC_W(opcode); break;
3623      case 0x3f:  MAC_W(opcode); break;
3624      case 0x4f:  MAC_W(opcode); break;
3625      case 0x5f:  MAC_W(opcode); break;
3626      case 0x6f:  MAC_W(opcode); break;
3627      case 0x7f:  MAC_W(opcode); break;
3628      case 0x8f:  MAC_W(opcode); break;
3629      case 0x9f:  MAC_W(opcode); break;
3630      case 0xaf:  MAC_W(opcode); break;
3631      case 0xbf:  MAC_W(opcode); break;
3632      case 0xcf:  MAC_W(opcode); break;
3633      case 0xdf:  MAC_W(opcode); break;
3634      case 0xef:  MAC_W(opcode); break;
3635      case 0xff:  MAC_W(opcode); break;
3636   }
3637}
30903638
3091const sh34_base_device::sh4ophandler sh34_base_device::s_op0000_handlers[256] =
3092{
3093   SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3094   SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3095   SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3096   SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3097   SH4OP(STCSR),      SH4OP(STCGBR),     SH4OP(STCVBR),     SH4OP(STCSSR),     SH4OP(STCSPC),     SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3098   SH4OP(STCRBANK),   SH4OP(STCRBANK),   SH4OP(STCRBANK),   SH4OP(STCRBANK),   SH4OP(STCRBANK),   SH4OP(STCRBANK),   SH4OP(STCRBANK),   SH4OP(STCRBANK),
3099   SH4OP(BSRF),       SH4OP(NOP),        SH4OP(BRAF),       SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3100   SH4OP(PREFM),      SH4OP(TODO),       SH4OP(TODO),       SH4OP(TODO),       SH4OP(MOVCAL),     SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3101   SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),
3102   SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),     SH4OP(MOVBS0),
3103   SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),
3104   SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),     SH4OP(MOVWS0),
3105   SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),
3106   SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),     SH4OP(MOVLS0),
3107   SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),
3108   SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),       SH4OP(MULL),
3109   SH4OP(CLRT),       SH4OP(SETT),       SH4OP(CLRMAC),     SH4OP(TODO),       SH4OP(CLRS),       SH4OP(SETS),       SH4OP(NOP),        SH4OP(NOP),
3110   SH4OP(CLRT),       SH4OP(SETT),       SH4OP(CLRMAC),     SH4OP(TODO),       SH4OP(CLRS),       SH4OP(SETS),       SH4OP(NOP),        SH4OP(NOP),
3111   SH4OP(NOP),        SH4OP(DIV0U),      SH4OP(MOVT),       SH4OP(NOP),        SH4OP(NOP),        SH4OP(DIV0U),      SH4OP(MOVT),       SH4OP(NOP),
3112   SH4OP(NOP),        SH4OP(DIV0U),      SH4OP(MOVT),       SH4OP(NOP),        SH4OP(NOP),        SH4OP(DIV0U),      SH4OP(MOVT),       SH4OP(NOP),
3113   SH4OP(STSMACH),    SH4OP(STSMACL),    SH4OP(STSPR),      SH4OP(STCSGR),     SH4OP(NOP),        SH4OP(STSFPUL),    SH4OP(STSFPSCR),   SH4OP(STCDBR),
3114   SH4OP(STSMACH),    SH4OP(STSMACL),    SH4OP(STSPR),      SH4OP(STCSGR),     SH4OP(NOP),        SH4OP(STSFPUL),    SH4OP(STSFPSCR),   SH4OP(STCDBR),
3115   SH4OP(RTS),        SH4OP(SLEEP),      SH4OP(RTE),        SH4OP(NOP),        SH4OP(RTS),        SH4OP(SLEEP),      SH4OP(RTE),        SH4OP(NOP),
3116   SH4OP(RTS),        SH4OP(SLEEP),      SH4OP(RTE),        SH4OP(NOP),        SH4OP(RTS),        SH4OP(SLEEP),      SH4OP(RTE),        SH4OP(NOP),
3117   SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),
3118   SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),     SH4OP(MOVBL0),
3119   SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),
3120   SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),     SH4OP(MOVWL0),
3121   SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),
3122   SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),     SH4OP(MOVLL0),
3123   SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),
3124   SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L),      SH4OP(MAC_L)
3125};
31263639
3127const sh34_base_device::sh4ophandler sh34_base_device::s_op0100_handlers[256] =
3640inline void sh34_base_device::execute_one(const UINT16 opcode)
31283641{
3129   SH4OP(SHLL),       SH4OP(DT),         SH4OP(SHAL),       SH4OP(NOP),        SH4OP(SHLL),       SH4OP(DT),         SH4OP(SHAL),       SH4OP(NOP),
3130   SH4OP(SHLL),       SH4OP(DT),         SH4OP(SHAL),       SH4OP(NOP),        SH4OP(SHLL),       SH4OP(DT),         SH4OP(SHAL),       SH4OP(NOP),
3131   SH4OP(SHLR),       SH4OP(CMPPZ),      SH4OP(SHAR),       SH4OP(NOP),        SH4OP(SHLR),       SH4OP(CMPPZ),      SH4OP(SHAR),       SH4OP(NOP),
3132   SH4OP(SHLR),       SH4OP(CMPPZ),      SH4OP(SHAR),       SH4OP(NOP),        SH4OP(SHLR),       SH4OP(CMPPZ),      SH4OP(SHAR),       SH4OP(NOP),
3133   SH4OP(STSMMACH),   SH4OP(STSMMACL),   SH4OP(STSMPR),     SH4OP(STCMSGR),    SH4OP(NOP),        SH4OP(STSMFPUL),   SH4OP(STSMFPSCR),  SH4OP(NOP),
3134   SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(STCMDBR),
3135   SH4OP(STCMSR),     SH4OP(STCMGBR),    SH4OP(STCMVBR),    SH4OP(STCMSSR),    SH4OP(STCMSPC),    SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3136   SH4OP(STCMRBANK),  SH4OP(STCMRBANK),  SH4OP(STCMRBANK),  SH4OP(STCMRBANK),  SH4OP(STCMRBANK),  SH4OP(STCMRBANK),  SH4OP(STCMRBANK),  SH4OP(STCMRBANK),
3137   SH4OP(ROTL),       SH4OP(NOP),        SH4OP(ROTCL),      SH4OP(NOP),        SH4OP(ROTL),       SH4OP(NOP),        SH4OP(ROTCL),      SH4OP(NOP),
3138   SH4OP(ROTL),       SH4OP(NOP),        SH4OP(ROTCL),      SH4OP(NOP),        SH4OP(ROTL),       SH4OP(NOP),        SH4OP(ROTCL),      SH4OP(NOP),
3139   SH4OP(ROTR),       SH4OP(CMPPL),      SH4OP(ROTCR),      SH4OP(NOP),        SH4OP(ROTR),       SH4OP(CMPPL),      SH4OP(ROTCR),      SH4OP(NOP),
3140   SH4OP(ROTR),       SH4OP(CMPPL),      SH4OP(ROTCR),      SH4OP(NOP),        SH4OP(ROTR),       SH4OP(CMPPL),      SH4OP(ROTCR),      SH4OP(NOP),
3141   SH4OP(LDSMMACH),   SH4OP(LDSMMACL),   SH4OP(LDSMPR),     SH4OP(NOP),        SH4OP(NOP),        SH4OP(LDSMFPUL),   SH4OP(LDSMFPSCR),  SH4OP(NOP),
3142   SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(LDCMDBR),
3143   SH4OP(LDCMSR),     SH4OP(LDCMGBR),    SH4OP(LDCMVBR),    SH4OP(LDCMSSR),    SH4OP(LDCMSPC),    SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3144   SH4OP(LDCMRBANK),  SH4OP(LDCMRBANK),  SH4OP(LDCMRBANK),  SH4OP(LDCMRBANK),  SH4OP(LDCMRBANK),  SH4OP(LDCMRBANK),  SH4OP(LDCMRBANK),  SH4OP(LDCMRBANK),
3145   SH4OP(SHLL2),      SH4OP(SHLL8),      SH4OP(SHLL16),     SH4OP(NOP),        SH4OP(SHLL2),      SH4OP(SHLL8),      SH4OP(SHLL16),     SH4OP(NOP),
3146   SH4OP(SHLL2),      SH4OP(SHLL8),      SH4OP(SHLL16),     SH4OP(NOP),        SH4OP(SHLL2),      SH4OP(SHLL8),      SH4OP(SHLL16),     SH4OP(NOP),
3147   SH4OP(SHLR2),      SH4OP(SHLR8),      SH4OP(SHLR16),     SH4OP(NOP),        SH4OP(SHLR2),      SH4OP(SHLR8),      SH4OP(SHLR16),     SH4OP(NOP),
3148   SH4OP(SHLR2),      SH4OP(SHLR8),      SH4OP(SHLR16),     SH4OP(NOP),        SH4OP(SHLR2),      SH4OP(SHLR8),      SH4OP(SHLR16),     SH4OP(NOP),
3149   SH4OP(LDSMACH),    SH4OP(LDSMACL),    SH4OP(LDSPR),      SH4OP(NOP),        SH4OP(NOP),        SH4OP(LDSFPUL),    SH4OP(LDSFPSCR),   SH4OP(NOP),
3150   SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),        SH4OP(LDCDBR),
3151   SH4OP(JSR),        SH4OP(TAS),        SH4OP(JMP),        SH4OP(NOP),        SH4OP(JSR),        SH4OP(TAS),        SH4OP(JMP),        SH4OP(NOP),
3152   SH4OP(JSR),        SH4OP(TAS),        SH4OP(JMP),        SH4OP(NOP),        SH4OP(JSR),        SH4OP(TAS),        SH4OP(JMP),        SH4OP(NOP),
3153   SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),
3154   SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),       SH4OP(SHAD),
3155   SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),
3156   SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),       SH4OP(SHLD),
3157   SH4OP(LDCSR),      SH4OP(LDCGBR),     SH4OP(LDCVBR),     SH4OP(LDCSSR),     SH4OP(LDCSPC),     SH4OP(NOP),        SH4OP(NOP),        SH4OP(NOP),
3158   SH4OP(LDCRBANK),   SH4OP(LDCRBANK),   SH4OP(LDCRBANK),   SH4OP(LDCRBANK),   SH4OP(LDCRBANK),   SH4OP(LDCRBANK),   SH4OP(LDCRBANK),   SH4OP(LDCRBANK),
3159   SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),
3160   SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W),      SH4OP(MAC_W)
3161};
3642   switch(opcode & 0xf000)
3643   {
3644      case 0x0000:
3645         execute_one_0000(opcode);
3646         break;
31623647
3648      case 0x1000:
3649         MOVLS4(opcode);
3650         break;
31633651
3164const sh34_base_device::sh4ophandler sh34_base_device::s_upper4bits[256] =
3165{
3166   /* j = 0x0000 - uses op0000_handlers*/
3167   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3168   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3169   /* j = 0x1000 */
3170   SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),
3171   SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),     SH4OP(MOVLS4),
3172   /* j = 0x2000 */
3173   SH4OP(MOVBS),      SH4OP(MOVWS),      SH4OP(MOVLS),      SH4OP(NOP),        SH4OP(MOVBM),      SH4OP(MOVWM),      SH4OP(MOVLM),      SH4OP(DIV0S),
3174   SH4OP(TST),        SH4OP(AND),        SH4OP(XOR),        SH4OP(OR),         SH4OP(CMPSTR),     SH4OP(XTRCT),      SH4OP(MULU),       SH4OP(MULS),
3175   /* j = 0x3000 */
3176   SH4OP(CMPEQ),      SH4OP(NOP),        SH4OP(CMPHS),      SH4OP(CMPGE),      SH4OP(DIV1),       SH4OP(DMULU),      SH4OP(CMPHI),      SH4OP(CMPGT),
3177   SH4OP(SUB),        SH4OP(NOP),        SH4OP(SUBC),       SH4OP(SUBV),       SH4OP(ADD),        SH4OP(DMULS),      SH4OP(ADDC),       SH4OP(ADDV),
3178   /* j = 0x4000 - uses op0100_handlers*/
3179   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3180   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3181   /* j = 0x5000 */
3182   SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),
3183   SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),     SH4OP(MOVLL4),
3184   /* j = 0x6000 */
3185   SH4OP(MOVBL),      SH4OP(MOVWL),      SH4OP(MOVLL),      SH4OP(MOV),        SH4OP(MOVBP),      SH4OP(MOVWP),      SH4OP(MOVLP),      SH4OP(NOT),
3186   SH4OP(SWAPB),      SH4OP(SWAPW),      SH4OP(NEGC),       SH4OP(NEG),        SH4OP(EXTUB),      SH4OP(EXTUW),      SH4OP(EXTSB),      SH4OP(EXTSW),
3187   /* j = 0x7000 */
3188   SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),
3189   SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),       SH4OP(ADDI),
3190   /* j = 0x8000 - uses op1000_handlers */
3191   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3192   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3193   /* j = 0x9000 */
3194   SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),
3195   SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),      SH4OP(MOVWI),
3196      /* j = 0xa000 */
3197   SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),
3198   SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),        SH4OP(BRA),
3199   /* j = 0xb000 */
3200   SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),
3201   SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),        SH4OP(BSR),
3202   /* j = 0xc000 - uses op1100_handlers */
3203   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3204   NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,          NULL,
3205   /* j = 0xd000 */
3206   SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),
3207   SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),      SH4OP(MOVLI),
3208   /* j = 0xe000 */
3209   SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),
3210   SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),       SH4OP(MOVI),
3211   /* j = 0xf000 */
3212   SH4OP(FADD),       SH4OP(FSUB),       SH4OP(FMUL),       SH4OP(FDIV),       SH4OP(FCMP_EQ),    SH4OP(FCMP_GT),    SH4OP(FMOVS0FR),   SH4OP(FMOVFRS0),
3213   SH4OP(FMOVMRFR),   SH4OP(FMOVMRIFR),  SH4OP(FMOVFRMR),   SH4OP(FMOVFRMDR),  SH4OP(FMOVFR),     SH4OP(op1111_0x13),SH4OP(FMAC),       SH4OP(dbreak)
3214};
3652      case 0x2000:
3653         switch(opcode & 0x0f)
3654         {
3655            case 0x00:  MOVBS(opcode); break;
3656            case 0x01:  MOVWS(opcode); break;
3657            case 0x02:  MOVLS(opcode); break;
3658            case 0x03:  NOP(opcode); break;
3659            case 0x04:  MOVBM(opcode); break;
3660            case 0x05:  MOVWM(opcode); break;
3661            case 0x06:  MOVLM(opcode); break;
3662            case 0x07:  DIV0S(opcode); break;
3663            case 0x08:  TST(opcode); break;
3664            case 0x09:  AND(opcode); break;
3665            case 0x0a:  XOR(opcode); break;
3666            case 0x0b:  OR(opcode); break;
3667            case 0x0c:  CMPSTR(opcode); break;
3668            case 0x0d:  XTRCT(opcode); break;
3669            case 0x0e:  MULU(opcode); break;
3670            case 0x0f:  MULS(opcode); break;
3671         }
3672         break;
32153673
3216void sh34_base_device::sh4_build_optable()
3217{
3218   int j,y,x,z;
3219
3220   // combine our opcode handler tables into one larger table thus reducing level of indirection on all opcode handlers
3221   for (j = 0; j<0x10000;j+=0x1000)
3222   {
3223      for (y = 0; y<0x1000;y+=0x100)
3224      {
3225         for (x=0; x<0x100;x+=0x10)
3674      case 0x3000:
3675         switch(opcode & 0x0f)
32263676         {
3227            for (z=0;z<0x10;z++)
3228            {
3229               s_master_ophandler_table[j+y+x+z] = s_upper4bits[(((j+z)&0xf000)>>8) + (z & 0xf)];
3230            }
3677            case 0x00:  CMPEQ(opcode); break;
3678            case 0x01:  NOP(opcode); break;
3679            case 0x02:  CMPHS(opcode); break;
3680            case 0x03:  CMPGE(opcode); break;
3681            case 0x04:  DIV1(opcode); break;
3682            case 0x05:  DMULU(opcode); break;
3683            case 0x06:  CMPHI(opcode); break;
3684            case 0x07:  CMPGT(opcode); break;
3685            case 0x08:  SUB(opcode); break;
3686            case 0x09:  NOP(opcode); break;
3687            case 0x0a:  SUBC(opcode); break;
3688            case 0x0b:  SUBV(opcode); break;
3689            case 0x0c:  ADD(opcode); break;
3690            case 0x0d:  DMULS(opcode); break;
3691            case 0x0e:  ADDC(opcode); break;
3692            case 0x0f:  ADDV(opcode); break;
32313693         }
3232      }
3233   }
3694         break;
32343695
3235   j = 0x0000;
3236   //for (j = 0; j<0x10000;j+=0x1000)
3237   {
3238      for (y = 0; y<0x1000;y+=0x100)
3239      {
3240         for (x=0; x<0x100;x+=0x10)
3696      case 0x4000:
3697         execute_one_4000(opcode);
3698         break;
3699
3700      case 0x5000:
3701         MOVLL4(opcode);
3702         break;
3703
3704      case 0x6000:
3705         switch(opcode & 0x0f)
32413706         {
3242            for (z=0;z<0x10;z++)
3243            {
3244               s_master_ophandler_table[j+y+x+z] = s_op0000_handlers[((((j+y+x+z)&0xf0)>>4)) | ((((j+y+x+z)&0xf)<<4))];
3245            }
3707            case 0x00:  MOVBL(opcode); break;
3708            case 0x01:  MOVWL(opcode); break;
3709            case 0x02:  MOVLL(opcode); break;
3710            case 0x03:  MOV(opcode); break;
3711            case 0x04:  MOVBP(opcode); break;
3712            case 0x05:  MOVWP(opcode); break;
3713            case 0x06:  MOVLP(opcode); break;
3714            case 0x07:  NOT(opcode); break;
3715            case 0x08:  SWAPB(opcode); break;
3716            case 0x09:  SWAPW(opcode); break;
3717            case 0x0a:  NEGC(opcode); break;
3718            case 0x0b:  NEG(opcode); break;
3719            case 0x0c:  EXTUB(opcode); break;
3720            case 0x0d:  EXTUW(opcode); break;
3721            case 0x0e:  EXTSB(opcode); break;
3722            case 0x0f:  EXTSW(opcode); break;
32463723         }
3247      }
3248   }
3724         break;
32493725
3250   j = 0x4000;
3251   //for (j = 0; j<0x10000;j+=0x1000)
3252   {
3253      for (y = 0; y<0x1000;y+=0x100)
3254      {
3255         for (x=0; x<0x100;x+=0x10)
3726      case 0x7000:
3727         ADDI(opcode);
3728         break;
3729
3730      case 0x8000:
3731         switch((opcode >> 8) & 0x0f)
32563732         {
3257            for (z=0;z<0x10;z++)
3258            {
3259               s_master_ophandler_table[j+y+x+z] = s_op0100_handlers[((((j+y+x+z)&0xf0)>>4)) | ((((j+y+x+z)&0xf)<<4))];
3260            }
3733            case 0x00:  MOVBS4(opcode); break;
3734            case 0x01:  MOVWS4(opcode); break;
3735            case 0x02:  NOP(opcode); break;
3736            case 0x03:  NOP(opcode); break;
3737            case 0x04:  MOVBL4(opcode); break;
3738            case 0x05:  MOVWL4(opcode); break;
3739            case 0x06:  NOP(opcode); break;
3740            case 0x07:  NOP(opcode); break;
3741            case 0x08:  CMPIM(opcode); break;
3742            case 0x09:  BT(opcode); break;
3743            case 0x0a:  NOP(opcode); break;
3744            case 0x0b:  BF(opcode); break;
3745            case 0x0c:  NOP(opcode); break;
3746            case 0x0d:  BTS(opcode); break;
3747            case 0x0e:  NOP(opcode); break;
3748            case 0x0f:  BFS(opcode); break;
32613749         }
3262      }
3263   }
3750         break;
32643751
3752      case 0x9000:
3753         MOVWI(opcode);
3754         break;
32653755
3266   j = 0x8000;
3267   //for (j = 0; j<0x10000;j+=0x1000)
3268   {
3269      for (y = 0; y<0x1000;y+=0x100)
3270      {
3271         for (x=0; x<0x100;x+=0x10)
3756      case 0xa000:
3757         BRA(opcode);
3758         break;
3759
3760      case 0xb000:
3761         BSR(opcode);
3762         break;
3763
3764      case 0xc000:
3765         switch((opcode >> 8) & 0x0f)
32723766         {
3273            for (z=0;z<0x10;z++)
3274            {
3275               s_master_ophandler_table[j+y+x+z] = s_op1000_handler[((((j+y+x+z)&0xf00)>>8))];
3276            }
3767            case 0x00:  MOVBSG(opcode); break;
3768            case 0x01:  MOVWSG(opcode); break;
3769            case 0x02:  MOVLSG(opcode); break;
3770            case 0x03:  TRAPA(opcode); break;
3771            case 0x04:  MOVBLG(opcode); break;
3772            case 0x05:  MOVWLG(opcode); break;
3773            case 0x06:  MOVLLG(opcode); break;
3774            case 0x07:  MOVA(opcode); break;
3775            case 0x08:  TSTI(opcode); break;
3776            case 0x09:  ANDI(opcode); break;
3777            case 0x0a:  XORI(opcode); break;
3778            case 0x0b:  ORI(opcode); break;
3779            case 0x0c:  TSTM(opcode); break;
3780            case 0x0d:  ANDM(opcode); break;
3781            case 0x0e:  XORM(opcode); break;
3782            case 0x0f:  ORM(opcode); break;
32773783         }
3278      }
3279   }
3784         break;
32803785
3281   j = 0xc000;
3282   //for (j = 0; j<0x10000;j+=0x1000)
3283   {
3284      for (y = 0; y<0x1000;y+=0x100)
3285      {
3286         for (x=0; x<0x100;x+=0x10)
3786      case 0xd000:
3787         MOVLI(opcode);
3788         break;
3789
3790      case 0xe000:
3791         MOVI(opcode);
3792         break;
3793
3794      case 0xf000:
3795         switch(opcode & 0x0f)
32873796         {
3288            for (z=0;z<0x10;z++)
3289            {
3290               s_master_ophandler_table[j+y+x+z] = s_op1100_handler[((((j+y+x+z)&0xf00)>>8))];
3291            }
3797            case 0x00:  FADD(opcode); break;
3798            case 0x01:  FSUB(opcode); break;
3799            case 0x02:  FMUL(opcode); break;
3800            case 0x03:  FDIV(opcode); break;
3801            case 0x04:  FCMP_EQ(opcode); break;
3802            case 0x05:  FCMP_GT(opcode); break;
3803            case 0x06:  FMOVS0FR(opcode); break;
3804            case 0x07:  FMOVFRS0(opcode); break;
3805            case 0x08:  FMOVMRFR(opcode); break;
3806            case 0x09:  FMOVMRIFR(opcode); break;
3807            case 0x0a:  FMOVFRMR(opcode); break;
3808            case 0x0b:  FMOVFRMDR(opcode); break;
3809            case 0x0c:  FMOVFR(opcode); break;
3810            case 0x0d:  op1111_0x13(opcode); break;
3811            case 0x0e:  FMAC(opcode); break;
3812            case 0x0f:  dbreak(opcode); break;
32923813         }
3293      }
3814         break;
32943815   }
3295
3296
32973816}
32983817
32993818
r31480r31481
33173836         m_delay = 0;
33183837         m_ppc = m_pc;
33193838
3320         (this->*s_master_ophandler_table[opcode])(opcode);
3839         execute_one(opcode);
33213840
33223841         if (m_test_irq && !m_delay)
33233842         {
r31480r31481
33263845      }
33273846      else
33283847      {
3329         const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_pc & AM), WORD2_XOR_LE(0));
3848         const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_pc & AM), WORD2_XOR_LE(0));
33303849
33313850         debugger_instruction_hook(this, m_pc & AM);
33323851
33333852         m_pc += 2;
33343853         m_ppc = m_pc;
33353854
3336         (this->*s_master_ophandler_table[opcode])(opcode);
3855         execute_one(opcode);
33373856
33383857         if (m_test_irq && !m_delay)
33393858         {
r31480r31481
33643883         m_delay = 0;
33653884         m_ppc = m_pc;
33663885
3367         (this->*s_master_ophandler_table[opcode])(opcode);
3886         execute_one(opcode);
33683887
33693888
33703889         if (m_test_irq && !m_delay)
r31480r31481
33833902         m_pc += 2;
33843903         m_ppc = m_pc;
33853904
3386         (this->*s_master_ophandler_table[opcode])(opcode);
3905         execute_one(opcode);
33873906
33883907         if (m_test_irq && !m_delay)
33893908         {
r31480r31481
34143933         m_delay = 0;
34153934         m_ppc = m_pc;
34163935
3417         (this->*s_master_ophandler_table[opcode])(opcode);
3936         execute_one(opcode);
34183937
34193938
34203939         if (m_test_irq && !m_delay)
r31480r31481
34333952         m_pc += 2;
34343953         m_ppc = m_pc;
34353954
3436         (this->*s_master_ophandler_table[opcode])(opcode);
3955         execute_one(opcode);
34373956
34383957         if (m_test_irq && !m_delay)
34393958         {
trunk/src/emu/cpu/sh4/sh4.h
r31480r31481
362362   UINT64 m_debugger_temp;
363363
364364
365   typedef void (sh34_base_device::*sh4ophandler)(const UINT16);
366
367   static sh4ophandler s_master_ophandler_table[0x10000];
368   static const sh4ophandler s_op1111_0x13_handlers[16];
369   static const sh4ophandler s_op1000_handler[16];
370   static const sh4ophandler s_op1100_handler[16];
371   static const sh4ophandler s_op0000_handlers[256];
372   static const sh4ophandler s_op0100_handlers[256];
373   static const sh4ophandler s_upper4bits[256];
374
375
365   void execute_one_0000(const UINT16 opcode);
366   void execute_one_4000(const UINT16 opcode);
367   void execute_one(const UINT16 opcode);
376368   inline void sh4_check_pending_irq(const char *message) // look for highest priority active exception and handle it
377369   {
378370      int a,irq,z;
r31480r31481
627619   void sh4_dmac_nmi();
628620   void sh4_handler_ipra_w(UINT32 data, UINT32 mem_mask);
629621   UINT32 sh4_getsqremap(UINT32 address);
630   void sh4_build_optable();
631622   void sh4_parse_configuration();
632623   void sh4_timer_recompute(int which);
633624   UINT32 sh4_handle_tcnt0_addr_r(UINT32 mem_mask);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team