Advertisement
Guest User

Untitled

a guest
Nov 11th, 2012
693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 236.96 KB | None | 0 0
  1. // /usr/lib/gcc/arm-linux-gnueabihf/4.6/cc1 -quiet -I ./advance/osd -I ./src -I ./src/includes -I ./src/debug -I obj/mame/linux/blend/cpu/m68000 -I ./src/cpu/m68000 -imultilib . -imultiarch arm-linux-gnueabihf -D HAVE_CONFIG_H -D USE_LSB -D NDEBUG -D _REENTRANT -D MAME -D PI=M_PI -D stricmp=strcasecmp -D strnicmp=strncasecmp -D LSB_FIRST -D INLINE=static __inline__ -D asm=__asm__ -D HAS_ARM=1 -D HAS_ARM7=1 -D HAS_SE3208=1 -D HAS_ALPHA8201=1 -D HAS_ALPHA8301=1 -D HAS_ADSP2100=1 -D HAS_ADSP2101=1 -D HAS_ADSP2104=1 -D HAS_ADSP2105=1 -D HAS_ADSP2115=1 -D HAS_ADSP2181=1 -D HAS_ADSP21062=1 -D HAS_DSP32C=1 -D HAS_ASAP=1 -D HAS_JAGUAR=1 -D HAS_CCPU=1 -D HAS_T11=1 -D HAS_G65816=1 -D HAS_HD6309=1 -D HAS_H83002=1 -D HAS_SH2=1 -D HAS_H6280=1 -D HAS_E116T=1 -D HAS_E116XT=0 -D HAS_E116XS=0 -D HAS_E116XSR=0 -D HAS_E132N=1 -D HAS_E132T=0 -D HAS_E132XN=0 -D HAS_E132XT=1 -D HAS_E132XS=0 -D HAS_E132XSR=0 -D HAS_GMS30C2116=1 -D HAS_GMS30C2132=0 -D HAS_GMS30C2216=0 -D HAS_GMS30C2232=0 -D HAS_8080=1 -D HAS_8085A=1 -D HAS_I8035=1 -D HAS_I8039=1 -D HAS_I8048=1 -D HAS_N7751=1 -D HAS_I8X41=1 -D HAS_I8051=1 -D HAS_I8052=1 -D HAS_I8751=1 -D HAS_I8752=1 -D HAS_I86=1 -D HAS_I88=1 -D HAS_I186=1 -D HAS_I188=0 -D HAS_I286=0 -D HAS_I386=1 -D HAS_I486=0 -D HAS_PENTIUM=1 -D HAS_MEDIAGX=1 -D HAS_I960=1 -D HAS_KONAMI=1 -D HAS_PIC16C54=0 -D HAS_PIC16C55=1 -D HAS_PIC16C56=0 -D HAS_PIC16C57=1 -D HAS_PIC16C58=0 -D HAS_R3000=1 -D HAS_R4600=1 -D HAS_R4650=1 -D HAS_R4700=1 -D HAS_R5000=1 -D HAS_QED5271=1 -D HAS_RM7000=1 -D HAS_M37702=1 -D HAS_M37710=1 -D HAS_M6502=1 -D HAS_M65C02=1 -D HAS_M65SC02=1 -D HAS_M65CE02=0 -D HAS_M6509=0 -D HAS_M6510=1 -D HAS_M6510T=0 -D HAS_M7501=0 -D HAS_M8502=0 -D HAS_N2A03=1 -D HAS_DECO16=1 -D HAS_M4510=0 -D HAS_M6800=1 -D HAS_M6801=1 -D HAS_M6802=1 -D HAS_M6803=1 -D HAS_M6808=1 -D HAS_HD63701=1 -D HAS_NSC8105=1 -D HAS_M6805=1 -D HAS_M68705=1 -D HAS_HD63705=1 -D HAS_M6809=1 -D HAS_M6809E=1 -D HAS_MC68HC11=1 -D HAS_M68000=1 -D HAS_M68008=0 -D HAS_M68010=1 -D HAS_M68EC020=1 -D HAS_M68020=1 -D HAS_M68040=1 -D HAS_DSP56156=1 -D HAS_PPC403=1 -D HAS_PPC602=1 -D HAS_PPC603=1 -D HAS_V20=1 -D HAS_V30=1 -D HAS_V33=1 -D HAS_V60=1 -D HAS_V70=1 -D HAS_V810=1 -D HAS_UPD7810=1 -D HAS_UPD7807=1 -D HAS_RSP=1 -D HAS_S2650=1 -D HAS_SPC700=1 -D HAS_PSXCPU=1 -D HAS_TMS9900=0 -D HAS_TMS9940=0 -D HAS_TMS9980=1 -D HAS_TMS9985=0 -D HAS_TMS9989=0 -D HAS_TMS9995=1 -D HAS_TMS99105A=0 -D HAS_TMS99110A=0 -D HAS_TMS99000=0 -D HAS_TI990_10=0 -D HAS_TMS34010=1 -D HAS_TMS34020=1 -D HAS_TMS32010=1 -D HAS_TMS32025=1 -D HAS_TMS32026=1 -D HAS_TMS32031=1 -D HAS_TMS32051=1 -D HAS_Z80=1 -D HAS_Z180=1 -D HAS_Z8000=1 -D HAS_CUSTOM=1 -D HAS_SAMPLES=1 -D HAS_DAC=1 -D HAS_DMADAC=1 -D HAS_CDDA=1 -D HAS_DISCRETE=1 -D HAS_POKEY=1 -D HAS_TIA=1 -D HAS_ASTROCADE=1 -D HAS_CEM3394=1 -D HAS_BSMT2000=1 -D HAS_ES5503=1 -D HAS_ES5505=1 -D HAS_ES5506=1 -D HAS_ES8712=1 -D HAS_GAELCO_CG1V=1 -D HAS_GAELCO_GAE1=1 -D HAS_AY8910=1 -D HAS_HC55516=1 -D HAS_C6280=1 -D HAS_ICS2115=1 -D HAS_IREMGA20=1 -D HAS_K005289=1 -D HAS_K007232=1 -D HAS_K051649=1 -D HAS_K053260=1 -D HAS_K054539=1 -D HAS_NAMCO=1 -D HAS_NAMCO_15XX=1 -D HAS_NAMCO_CUS30=1 -D HAS_NAMCO_52XX=1 -D HAS_NAMCO_54XX=1 -D HAS_NAMCO_63701X=1 -D HAS_NAMCONA=1 -D HAS_C140=1 -D HAS_C352=1 -D HAS_NES=1 -D HAS_UPD7759=1 -D HAS_MSM5205=1 -D HAS_MSM5232=1 -D HAS_OKIM6295=1 -D HAS_SAA1099=1 -D HAS_QSOUND=1 -D HAS_RF5C68=1 -D HAS_RF5C400=1 -D HAS_SEGAPCM=1 -D HAS_MULTIPCM=1 -D HAS_SCSP=1 -D HAS_ST0016=1 -D HAS_X1_010=1 -D HAS_PSXSPU=1 -D HAS_SP0250=1 -D HAS_SN76477=1 -D HAS_SN76496=1 -D HAS_TMS36XX=1 -D HAS_TMS5110=1 -D HAS_TMS5220=1 -D HAS_VLM5030=1 -D HAS_VOTRAX=0 -D HAS_VRENDER0=1 -D HAS_YM2151=1 -D HAS_YM2203=1 -D HAS_YM2413=1 -D HAS_YM2608=1 -D HAS_YM2610=1 -D HAS_YM2610B=1 -D HAS_YM2612=1 -D HAS_YM3438=1 -D HAS_YM3812=1 -D HAS_YM3526=1 -D HAS_Y8950=1 -D HAS_YMF262=1 -D HAS_YMF271=1 -D HAS_YMF278B=1 -D HAS_YMZ280B=1 src/cpu/sh2/sh2.c -quiet -dumpbase sh2.c -march=armv6 -mfloat-abi=hard -mfpu=vfp -auxbase-strip obj/mame/linux/blend/cpu/sh2/sh2.o -O2 -Wall -Wno-sign-compare -Wno-unused -fomit-frame-pointer -fno-merge-constants -o - -frandom-seed=0
  2. # 1 "src/cpu/sh2/sh2.c"
  3. # 1 "<built-in>"
  4. # 1 "<command-line>"
  5. # 1 "src/cpu/sh2/sh2.c"
  6. # 103 "src/cpu/sh2/sh2.c"
  7. # 1 "/usr/include/signal.h" 1 3 4
  8. # 29 "/usr/include/signal.h" 3 4
  9. # 1 "/usr/include/features.h" 1 3 4
  10. # 323 "/usr/include/features.h" 3 4
  11. # 1 "/usr/include/arm-linux-gnueabihf/bits/predefs.h" 1 3 4
  12. # 324 "/usr/include/features.h" 2 3 4
  13. # 356 "/usr/include/features.h" 3 4
  14. # 1 "/usr/include/arm-linux-gnueabihf/sys/cdefs.h" 1 3 4
  15. # 359 "/usr/include/arm-linux-gnueabihf/sys/cdefs.h" 3 4
  16. # 1 "/usr/include/arm-linux-gnueabihf/bits/wordsize.h" 1 3 4
  17. # 360 "/usr/include/arm-linux-gnueabihf/sys/cdefs.h" 2 3 4
  18. # 357 "/usr/include/features.h" 2 3 4
  19. # 388 "/usr/include/features.h" 3 4
  20. # 1 "/usr/include/arm-linux-gnueabihf/gnu/stubs.h" 1 3 4
  21. # 389 "/usr/include/features.h" 2 3 4
  22. # 30 "/usr/include/signal.h" 2 3 4
  23.  
  24.  
  25.  
  26. # 1 "/usr/include/arm-linux-gnueabihf/bits/sigset.h" 1 3 4
  27. # 24 "/usr/include/arm-linux-gnueabihf/bits/sigset.h" 3 4
  28. typedef int __sig_atomic_t;
  29.  
  30.  
  31.  
  32.  
  33. typedef struct
  34. {
  35. unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  36. } __sigset_t;
  37. # 104 "/usr/include/arm-linux-gnueabihf/bits/sigset.h" 3 4
  38. extern int __sigismember (__const __sigset_t *, int);
  39. extern int __sigaddset (__sigset_t *, int);
  40. extern int __sigdelset (__sigset_t *, int);
  41. # 118 "/usr/include/arm-linux-gnueabihf/bits/sigset.h" 3 4
  42. extern __inline int __sigismember (__const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; }
  43. extern __inline int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); }
  44. extern __inline int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); }
  45. # 34 "/usr/include/signal.h" 2 3 4
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. typedef __sig_atomic_t sig_atomic_t;
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62. typedef __sigset_t sigset_t;
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. # 1 "/usr/include/arm-linux-gnueabihf/bits/types.h" 1 3 4
  70. # 28 "/usr/include/arm-linux-gnueabihf/bits/types.h" 3 4
  71. # 1 "/usr/include/arm-linux-gnueabihf/bits/wordsize.h" 1 3 4
  72. # 29 "/usr/include/arm-linux-gnueabihf/bits/types.h" 2 3 4
  73.  
  74.  
  75. typedef unsigned char __u_char;
  76. typedef unsigned short int __u_short;
  77. typedef unsigned int __u_int;
  78. typedef unsigned long int __u_long;
  79.  
  80.  
  81. typedef signed char __int8_t;
  82. typedef unsigned char __uint8_t;
  83. typedef signed short int __int16_t;
  84. typedef unsigned short int __uint16_t;
  85. typedef signed int __int32_t;
  86. typedef unsigned int __uint32_t;
  87.  
  88.  
  89.  
  90.  
  91. __extension__ typedef signed long long int __int64_t;
  92. __extension__ typedef unsigned long long int __uint64_t;
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. __extension__ typedef long long int __quad_t;
  101. __extension__ typedef unsigned long long int __u_quad_t;
  102. # 131 "/usr/include/arm-linux-gnueabihf/bits/types.h" 3 4
  103. # 1 "/usr/include/arm-linux-gnueabihf/bits/typesizes.h" 1 3 4
  104. # 132 "/usr/include/arm-linux-gnueabihf/bits/types.h" 2 3 4
  105.  
  106.  
  107. __extension__ typedef __u_quad_t __dev_t;
  108. __extension__ typedef unsigned int __uid_t;
  109. __extension__ typedef unsigned int __gid_t;
  110. __extension__ typedef unsigned long int __ino_t;
  111. __extension__ typedef __u_quad_t __ino64_t;
  112. __extension__ typedef unsigned int __mode_t;
  113. __extension__ typedef unsigned int __nlink_t;
  114. __extension__ typedef long int __off_t;
  115. __extension__ typedef __quad_t __off64_t;
  116. __extension__ typedef int __pid_t;
  117. __extension__ typedef struct { int __val[2]; } __fsid_t;
  118. __extension__ typedef long int __clock_t;
  119. __extension__ typedef unsigned long int __rlim_t;
  120. __extension__ typedef __u_quad_t __rlim64_t;
  121. __extension__ typedef unsigned int __id_t;
  122. __extension__ typedef long int __time_t;
  123. __extension__ typedef unsigned int __useconds_t;
  124. __extension__ typedef long int __suseconds_t;
  125.  
  126. __extension__ typedef int __daddr_t;
  127. __extension__ typedef long int __swblk_t;
  128. __extension__ typedef int __key_t;
  129.  
  130.  
  131. __extension__ typedef int __clockid_t;
  132.  
  133.  
  134. __extension__ typedef void * __timer_t;
  135.  
  136.  
  137. __extension__ typedef long int __blksize_t;
  138.  
  139.  
  140.  
  141.  
  142. __extension__ typedef long int __blkcnt_t;
  143. __extension__ typedef __quad_t __blkcnt64_t;
  144.  
  145.  
  146. __extension__ typedef unsigned long int __fsblkcnt_t;
  147. __extension__ typedef __u_quad_t __fsblkcnt64_t;
  148.  
  149.  
  150. __extension__ typedef unsigned long int __fsfilcnt_t;
  151. __extension__ typedef __u_quad_t __fsfilcnt64_t;
  152.  
  153. __extension__ typedef int __ssize_t;
  154.  
  155.  
  156.  
  157. typedef __off64_t __loff_t;
  158. typedef __quad_t *__qaddr_t;
  159. typedef char *__caddr_t;
  160.  
  161.  
  162. __extension__ typedef int __intptr_t;
  163.  
  164.  
  165. __extension__ typedef unsigned int __socklen_t;
  166. # 58 "/usr/include/signal.h" 2 3 4
  167. # 1 "/usr/include/arm-linux-gnueabihf/bits/signum.h" 1 3 4
  168. # 59 "/usr/include/signal.h" 2 3 4
  169.  
  170.  
  171.  
  172. typedef __pid_t pid_t;
  173.  
  174.  
  175.  
  176.  
  177.  
  178. typedef __uid_t uid_t;
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. # 1 "/usr/include/time.h" 1 3 4
  187. # 120 "/usr/include/time.h" 3 4
  188. struct timespec
  189. {
  190. __time_t tv_sec;
  191. long int tv_nsec;
  192. };
  193. # 77 "/usr/include/signal.h" 2 3 4
  194.  
  195.  
  196. # 1 "/usr/include/arm-linux-gnueabihf/bits/siginfo.h" 1 3 4
  197. # 25 "/usr/include/arm-linux-gnueabihf/bits/siginfo.h" 3 4
  198. # 1 "/usr/include/arm-linux-gnueabihf/bits/wordsize.h" 1 3 4
  199. # 26 "/usr/include/arm-linux-gnueabihf/bits/siginfo.h" 2 3 4
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207. typedef union sigval
  208. {
  209. int sival_int;
  210. void *sival_ptr;
  211. } sigval_t;
  212. # 51 "/usr/include/arm-linux-gnueabihf/bits/siginfo.h" 3 4
  213. typedef struct siginfo
  214. {
  215. int si_signo;
  216. int si_errno;
  217.  
  218. int si_code;
  219.  
  220. union
  221. {
  222. int _pad[((128 / sizeof (int)) - 3)];
  223.  
  224.  
  225. struct
  226. {
  227. __pid_t si_pid;
  228. __uid_t si_uid;
  229. } _kill;
  230.  
  231.  
  232. struct
  233. {
  234. int si_tid;
  235. int si_overrun;
  236. sigval_t si_sigval;
  237. } _timer;
  238.  
  239.  
  240. struct
  241. {
  242. __pid_t si_pid;
  243. __uid_t si_uid;
  244. sigval_t si_sigval;
  245. } _rt;
  246.  
  247.  
  248. struct
  249. {
  250. __pid_t si_pid;
  251. __uid_t si_uid;
  252. int si_status;
  253. __clock_t si_utime;
  254. __clock_t si_stime;
  255. } _sigchld;
  256.  
  257.  
  258. struct
  259. {
  260. void *si_addr;
  261. } _sigfault;
  262.  
  263.  
  264. struct
  265. {
  266. long int si_band;
  267. int si_fd;
  268. } _sigpoll;
  269. } _sifields;
  270. } siginfo_t;
  271. # 129 "/usr/include/arm-linux-gnueabihf/bits/siginfo.h" 3 4
  272. enum
  273. {
  274. SI_ASYNCNL = -60,
  275.  
  276. SI_TKILL = -6,
  277.  
  278. SI_SIGIO,
  279.  
  280. SI_ASYNCIO,
  281.  
  282. SI_MESGQ,
  283.  
  284. SI_TIMER,
  285.  
  286. SI_QUEUE,
  287.  
  288. SI_USER,
  289.  
  290. SI_KERNEL = 0x80
  291.  
  292. };
  293.  
  294.  
  295.  
  296. enum
  297. {
  298. ILL_ILLOPC = 1,
  299.  
  300. ILL_ILLOPN,
  301.  
  302. ILL_ILLADR,
  303.  
  304. ILL_ILLTRP,
  305.  
  306. ILL_PRVOPC,
  307.  
  308. ILL_PRVREG,
  309.  
  310. ILL_COPROC,
  311.  
  312. ILL_BADSTK
  313.  
  314. };
  315.  
  316.  
  317. enum
  318. {
  319. FPE_INTDIV = 1,
  320.  
  321. FPE_INTOVF,
  322.  
  323. FPE_FLTDIV,
  324.  
  325. FPE_FLTOVF,
  326.  
  327. FPE_FLTUND,
  328.  
  329. FPE_FLTRES,
  330.  
  331. FPE_FLTINV,
  332.  
  333. FPE_FLTSUB
  334.  
  335. };
  336.  
  337.  
  338. enum
  339. {
  340. SEGV_MAPERR = 1,
  341.  
  342. SEGV_ACCERR
  343.  
  344. };
  345.  
  346.  
  347. enum
  348. {
  349. BUS_ADRALN = 1,
  350.  
  351. BUS_ADRERR,
  352.  
  353. BUS_OBJERR
  354.  
  355. };
  356.  
  357.  
  358. enum
  359. {
  360. TRAP_BRKPT = 1,
  361.  
  362. TRAP_TRACE
  363.  
  364. };
  365.  
  366.  
  367. enum
  368. {
  369. CLD_EXITED = 1,
  370.  
  371. CLD_KILLED,
  372.  
  373. CLD_DUMPED,
  374.  
  375. CLD_TRAPPED,
  376.  
  377. CLD_STOPPED,
  378.  
  379. CLD_CONTINUED
  380.  
  381. };
  382.  
  383.  
  384. enum
  385. {
  386. POLL_IN = 1,
  387.  
  388. POLL_OUT,
  389.  
  390. POLL_MSG,
  391.  
  392. POLL_ERR,
  393.  
  394. POLL_PRI,
  395.  
  396. POLL_HUP
  397.  
  398. };
  399. # 273 "/usr/include/arm-linux-gnueabihf/bits/siginfo.h" 3 4
  400. typedef struct sigevent
  401. {
  402. sigval_t sigev_value;
  403. int sigev_signo;
  404. int sigev_notify;
  405.  
  406. union
  407. {
  408. int _pad[((64 / sizeof (int)) - 3)];
  409.  
  410.  
  411.  
  412. __pid_t _tid;
  413.  
  414. struct
  415. {
  416. void (*_function) (sigval_t);
  417. void *_attribute;
  418. } _sigev_thread;
  419. } _sigev_un;
  420. } sigevent_t;
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427. enum
  428. {
  429. SIGEV_SIGNAL = 0,
  430.  
  431. SIGEV_NONE,
  432.  
  433. SIGEV_THREAD,
  434.  
  435.  
  436. SIGEV_THREAD_ID = 4
  437.  
  438. };
  439. # 80 "/usr/include/signal.h" 2 3 4
  440.  
  441.  
  442.  
  443.  
  444. typedef void (*__sighandler_t) (int);
  445.  
  446.  
  447.  
  448.  
  449. extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
  450. __attribute__ ((__nothrow__));
  451. # 99 "/usr/include/signal.h" 3 4
  452.  
  453.  
  454. extern __sighandler_t signal (int __sig, __sighandler_t __handler)
  455. __attribute__ ((__nothrow__));
  456. # 113 "/usr/include/signal.h" 3 4
  457.  
  458. # 126 "/usr/include/signal.h" 3 4
  459. extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__));
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__));
  467.  
  468.  
  469.  
  470.  
  471. extern int raise (int __sig) __attribute__ ((__nothrow__));
  472.  
  473.  
  474.  
  475.  
  476. extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
  477. __attribute__ ((__nothrow__));
  478. extern int gsignal (int __sig) __attribute__ ((__nothrow__));
  479.  
  480.  
  481.  
  482.  
  483. extern void psignal (int __sig, __const char *__s);
  484.  
  485.  
  486.  
  487.  
  488. extern void psiginfo (__const siginfo_t *__pinfo, __const char *__s);
  489. # 168 "/usr/include/signal.h" 3 4
  490. extern int __sigpause (int __sig_or_mask, int __is_sig);
  491. # 196 "/usr/include/signal.h" 3 4
  492. extern int sigblock (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
  493.  
  494.  
  495. extern int sigsetmask (int __mask) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
  496.  
  497.  
  498. extern int siggetmask (void) __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
  499. # 216 "/usr/include/signal.h" 3 4
  500. typedef __sighandler_t sig_t;
  501.  
  502.  
  503.  
  504.  
  505.  
  506. extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  507.  
  508.  
  509. extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  510.  
  511.  
  512. extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  513.  
  514.  
  515. extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  516.  
  517.  
  518. extern int sigismember (__const sigset_t *__set, int __signo)
  519. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  520. # 252 "/usr/include/signal.h" 3 4
  521. # 1 "/usr/include/arm-linux-gnueabihf/bits/sigaction.h" 1 3 4
  522. # 25 "/usr/include/arm-linux-gnueabihf/bits/sigaction.h" 3 4
  523. struct sigaction
  524. {
  525.  
  526.  
  527. union
  528. {
  529.  
  530. __sighandler_t sa_handler;
  531.  
  532. void (*sa_sigaction) (int, siginfo_t *, void *);
  533. }
  534. __sigaction_handler;
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542. __sigset_t sa_mask;
  543.  
  544.  
  545. int sa_flags;
  546.  
  547.  
  548. void (*sa_restorer) (void);
  549. };
  550. # 253 "/usr/include/signal.h" 2 3 4
  551.  
  552.  
  553. extern int sigprocmask (int __how, __const sigset_t *__restrict __set,
  554. sigset_t *__restrict __oset) __attribute__ ((__nothrow__));
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561. extern int sigsuspend (__const sigset_t *__set) __attribute__ ((__nonnull__ (1)));
  562.  
  563.  
  564. extern int sigaction (int __sig, __const struct sigaction *__restrict __act,
  565. struct sigaction *__restrict __oact) __attribute__ ((__nothrow__));
  566.  
  567.  
  568. extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575. extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig)
  576. __attribute__ ((__nonnull__ (1, 2)));
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583. extern int sigwaitinfo (__const sigset_t *__restrict __set,
  584. siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591. extern int sigtimedwait (__const sigset_t *__restrict __set,
  592. siginfo_t *__restrict __info,
  593. __const struct timespec *__restrict __timeout)
  594. __attribute__ ((__nonnull__ (1)));
  595.  
  596.  
  597.  
  598. extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val)
  599. __attribute__ ((__nothrow__));
  600. # 310 "/usr/include/signal.h" 3 4
  601. extern __const char *__const _sys_siglist[65];
  602. extern __const char *__const sys_siglist[65];
  603.  
  604.  
  605. struct sigvec
  606. {
  607. __sighandler_t sv_handler;
  608. int sv_mask;
  609.  
  610. int sv_flags;
  611.  
  612. };
  613. # 334 "/usr/include/signal.h" 3 4
  614. extern int sigvec (int __sig, __const struct sigvec *__vec,
  615. struct sigvec *__ovec) __attribute__ ((__nothrow__));
  616.  
  617.  
  618.  
  619. # 1 "/usr/include/arm-linux-gnueabihf/bits/sigcontext.h" 1 3 4
  620. # 28 "/usr/include/arm-linux-gnueabihf/bits/sigcontext.h" 3 4
  621. # 1 "/usr/include/arm-linux-gnueabihf/asm/sigcontext.h" 1 3 4
  622. # 9 "/usr/include/arm-linux-gnueabihf/asm/sigcontext.h" 3 4
  623. struct sigcontext {
  624. unsigned long trap_no;
  625. unsigned long error_code;
  626. unsigned long oldmask;
  627. unsigned long arm_r0;
  628. unsigned long arm_r1;
  629. unsigned long arm_r2;
  630. unsigned long arm_r3;
  631. unsigned long arm_r4;
  632. unsigned long arm_r5;
  633. unsigned long arm_r6;
  634. unsigned long arm_r7;
  635. unsigned long arm_r8;
  636. unsigned long arm_r9;
  637. unsigned long arm_r10;
  638. unsigned long arm_fp;
  639. unsigned long arm_ip;
  640. unsigned long arm_sp;
  641. unsigned long arm_lr;
  642. unsigned long arm_pc;
  643. unsigned long arm_cpsr;
  644. unsigned long fault_address;
  645. };
  646. # 29 "/usr/include/arm-linux-gnueabihf/bits/sigcontext.h" 2 3 4
  647. # 340 "/usr/include/signal.h" 2 3 4
  648.  
  649.  
  650. extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__));
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  658. # 212 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 3 4
  659. typedef unsigned int size_t;
  660. # 350 "/usr/include/signal.h" 2 3 4
  661.  
  662.  
  663.  
  664.  
  665. extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__));
  666.  
  667. # 1 "/usr/include/arm-linux-gnueabihf/bits/sigstack.h" 1 3 4
  668. # 26 "/usr/include/arm-linux-gnueabihf/bits/sigstack.h" 3 4
  669. struct sigstack
  670. {
  671. void *ss_sp;
  672. int ss_onstack;
  673. };
  674.  
  675.  
  676.  
  677. enum
  678. {
  679. SS_ONSTACK = 1,
  680.  
  681. SS_DISABLE
  682.  
  683. };
  684. # 50 "/usr/include/arm-linux-gnueabihf/bits/sigstack.h" 3 4
  685. typedef struct sigaltstack
  686. {
  687. void *ss_sp;
  688. int ss_flags;
  689. size_t ss_size;
  690. } stack_t;
  691. # 357 "/usr/include/signal.h" 2 3 4
  692.  
  693.  
  694. # 1 "/usr/include/arm-linux-gnueabihf/sys/ucontext.h" 1 3 4
  695. # 25 "/usr/include/arm-linux-gnueabihf/sys/ucontext.h" 3 4
  696. # 1 "/usr/include/signal.h" 1 3 4
  697. # 26 "/usr/include/arm-linux-gnueabihf/sys/ucontext.h" 2 3 4
  698.  
  699.  
  700.  
  701. # 1 "/usr/include/arm-linux-gnueabihf/bits/sigcontext.h" 1 3 4
  702. # 30 "/usr/include/arm-linux-gnueabihf/sys/ucontext.h" 2 3 4
  703.  
  704. typedef int greg_t;
  705.  
  706.  
  707.  
  708.  
  709.  
  710. typedef greg_t gregset_t[18];
  711.  
  712.  
  713. enum
  714. {
  715. REG_R0 = 0,
  716.  
  717. REG_R1 = 1,
  718.  
  719. REG_R2 = 2,
  720.  
  721. REG_R3 = 3,
  722.  
  723. REG_R4 = 4,
  724.  
  725. REG_R5 = 5,
  726.  
  727. REG_R6 = 6,
  728.  
  729. REG_R7 = 7,
  730.  
  731. REG_R8 = 8,
  732.  
  733. REG_R9 = 9,
  734.  
  735. REG_R10 = 10,
  736.  
  737. REG_R11 = 11,
  738.  
  739. REG_R12 = 12,
  740.  
  741. REG_R13 = 13,
  742.  
  743. REG_R14 = 14,
  744.  
  745. REG_R15 = 15
  746.  
  747. };
  748.  
  749. struct _libc_fpstate
  750. {
  751. struct
  752. {
  753. unsigned int sign1:1;
  754. unsigned int unused:15;
  755. unsigned int sign2:1;
  756. unsigned int exponent:14;
  757. unsigned int j:1;
  758. unsigned int mantissa1:31;
  759. unsigned int mantissa0:32;
  760. } fpregs[8];
  761. unsigned int fpsr:32;
  762. unsigned int fpcr:32;
  763. unsigned char ftype[8];
  764. unsigned int init_flag;
  765. };
  766.  
  767. typedef struct _libc_fpstate fpregset_t;
  768.  
  769.  
  770.  
  771.  
  772.  
  773. typedef struct sigcontext mcontext_t;
  774.  
  775.  
  776. typedef struct ucontext
  777. {
  778. unsigned long uc_flags;
  779. struct ucontext *uc_link;
  780. stack_t uc_stack;
  781. mcontext_t uc_mcontext;
  782. __sigset_t uc_sigmask;
  783. unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
  784. } ucontext_t;
  785. # 360 "/usr/include/signal.h" 2 3 4
  786.  
  787.  
  788.  
  789.  
  790.  
  791. extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
  792. __attribute__ ((__nothrow__)) __attribute__ ((__deprecated__));
  793.  
  794.  
  795.  
  796. extern int sigaltstack (__const struct sigaltstack *__restrict __ss,
  797. struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__));
  798. # 394 "/usr/include/signal.h" 3 4
  799. # 1 "/usr/include/arm-linux-gnueabihf/bits/pthreadtypes.h" 1 3 4
  800. # 22 "/usr/include/arm-linux-gnueabihf/bits/pthreadtypes.h" 3 4
  801. # 1 "/usr/include/endian.h" 1 3 4
  802. # 37 "/usr/include/endian.h" 3 4
  803. # 1 "/usr/include/arm-linux-gnueabihf/bits/endian.h" 1 3 4
  804. # 38 "/usr/include/endian.h" 2 3 4
  805. # 61 "/usr/include/endian.h" 3 4
  806. # 1 "/usr/include/arm-linux-gnueabihf/bits/byteswap.h" 1 3 4
  807. # 62 "/usr/include/endian.h" 2 3 4
  808. # 23 "/usr/include/arm-linux-gnueabihf/bits/pthreadtypes.h" 2 3 4
  809. # 38 "/usr/include/arm-linux-gnueabihf/bits/pthreadtypes.h" 3 4
  810. typedef unsigned long int pthread_t;
  811.  
  812.  
  813. typedef union
  814. {
  815. char __size[36];
  816. long int __align;
  817. } pthread_attr_t;
  818.  
  819.  
  820. typedef struct __pthread_internal_slist
  821. {
  822. struct __pthread_internal_slist *__next;
  823. } __pthread_slist_t;
  824.  
  825.  
  826.  
  827.  
  828. typedef union
  829. {
  830. struct __pthread_mutex_s
  831. {
  832. int __lock;
  833. unsigned int __count;
  834. int __owner;
  835.  
  836.  
  837. int __kind;
  838. unsigned int __nusers;
  839. __extension__ union
  840. {
  841. int __spins;
  842. __pthread_slist_t __list;
  843. };
  844. } __data;
  845. char __size[24];
  846. long int __align;
  847. } pthread_mutex_t;
  848.  
  849. typedef union
  850. {
  851. char __size[4];
  852. long int __align;
  853. } pthread_mutexattr_t;
  854.  
  855.  
  856.  
  857.  
  858. typedef union
  859. {
  860. struct
  861. {
  862. int __lock;
  863. unsigned int __futex;
  864. __extension__ unsigned long long int __total_seq;
  865. __extension__ unsigned long long int __wakeup_seq;
  866. __extension__ unsigned long long int __woken_seq;
  867. void *__mutex;
  868. unsigned int __nwaiters;
  869. unsigned int __broadcast_seq;
  870. } __data;
  871. char __size[48];
  872. __extension__ long long int __align;
  873. } pthread_cond_t;
  874.  
  875. typedef union
  876. {
  877. char __size[4];
  878. long int __align;
  879. } pthread_condattr_t;
  880.  
  881.  
  882.  
  883. typedef unsigned int pthread_key_t;
  884.  
  885.  
  886.  
  887. typedef int pthread_once_t;
  888.  
  889.  
  890.  
  891.  
  892.  
  893. typedef union
  894. {
  895. struct
  896. {
  897. int __lock;
  898. unsigned int __nr_readers;
  899. unsigned int __readers_wakeup;
  900. unsigned int __writer_wakeup;
  901. unsigned int __nr_readers_queued;
  902. unsigned int __nr_writers_queued;
  903. # 141 "/usr/include/arm-linux-gnueabihf/bits/pthreadtypes.h" 3 4
  904. unsigned char __flags;
  905. unsigned char __shared;
  906. unsigned char __pad1;
  907. unsigned char __pad2;
  908.  
  909. int __writer;
  910. } __data;
  911. char __size[32];
  912. long int __align;
  913. } pthread_rwlock_t;
  914.  
  915. typedef union
  916. {
  917. char __size[8];
  918. long int __align;
  919. } pthread_rwlockattr_t;
  920.  
  921.  
  922.  
  923.  
  924.  
  925. typedef volatile int pthread_spinlock_t;
  926.  
  927.  
  928.  
  929.  
  930. typedef union
  931. {
  932. char __size[20];
  933. long int __align;
  934. } pthread_barrier_t;
  935.  
  936. typedef union
  937. {
  938. char __size[4];
  939. int __align;
  940. } pthread_barrierattr_t;
  941. # 395 "/usr/include/signal.h" 2 3 4
  942. # 1 "/usr/include/arm-linux-gnueabihf/bits/sigthread.h" 1 3 4
  943. # 31 "/usr/include/arm-linux-gnueabihf/bits/sigthread.h" 3 4
  944. extern int pthread_sigmask (int __how,
  945. __const __sigset_t *__restrict __newmask,
  946. __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__));
  947.  
  948.  
  949. extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__));
  950. # 396 "/usr/include/signal.h" 2 3 4
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957. extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__));
  958.  
  959. extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__));
  960.  
  961.  
  962.  
  963.  
  964. # 104 "src/cpu/sh2/sh2.c" 2
  965. # 1 "./src/debugger.h" 1
  966. # 12 "./src/debugger.h"
  967.  
  968.  
  969.  
  970.  
  971.  
  972. # 1 "./src/mame.h" 1
  973. # 15 "./src/mame.h"
  974. # 1 "./src/mamecore.h" 1
  975. # 12 "./src/mamecore.h"
  976.  
  977.  
  978.  
  979.  
  980.  
  981. # 1 "/usr/include/stdio.h" 1 3 4
  982. # 30 "/usr/include/stdio.h" 3 4
  983.  
  984.  
  985.  
  986.  
  987. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  988. # 35 "/usr/include/stdio.h" 2 3 4
  989. # 45 "/usr/include/stdio.h" 3 4
  990. struct _IO_FILE;
  991.  
  992.  
  993.  
  994. typedef struct _IO_FILE FILE;
  995.  
  996.  
  997.  
  998.  
  999.  
  1000. # 65 "/usr/include/stdio.h" 3 4
  1001. typedef struct _IO_FILE __FILE;
  1002. # 75 "/usr/include/stdio.h" 3 4
  1003. # 1 "/usr/include/libio.h" 1 3 4
  1004. # 32 "/usr/include/libio.h" 3 4
  1005. # 1 "/usr/include/_G_config.h" 1 3 4
  1006. # 15 "/usr/include/_G_config.h" 3 4
  1007. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  1008. # 16 "/usr/include/_G_config.h" 2 3 4
  1009.  
  1010.  
  1011.  
  1012.  
  1013. # 1 "/usr/include/wchar.h" 1 3 4
  1014. # 83 "/usr/include/wchar.h" 3 4
  1015. typedef struct
  1016. {
  1017. int __count;
  1018. union
  1019. {
  1020.  
  1021. unsigned int __wch;
  1022.  
  1023.  
  1024.  
  1025. char __wchb[4];
  1026. } __value;
  1027. } __mbstate_t;
  1028. # 21 "/usr/include/_G_config.h" 2 3 4
  1029.  
  1030. typedef struct
  1031. {
  1032. __off_t __pos;
  1033. __mbstate_t __state;
  1034. } _G_fpos_t;
  1035. typedef struct
  1036. {
  1037. __off64_t __pos;
  1038. __mbstate_t __state;
  1039. } _G_fpos64_t;
  1040. # 53 "/usr/include/_G_config.h" 3 4
  1041. typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
  1042. typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
  1043. typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
  1044. typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
  1045. # 33 "/usr/include/libio.h" 2 3 4
  1046. # 53 "/usr/include/libio.h" 3 4
  1047. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stdarg.h" 1 3 4
  1048. # 40 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stdarg.h" 3 4
  1049. typedef __builtin_va_list __gnuc_va_list;
  1050. # 54 "/usr/include/libio.h" 2 3 4
  1051. # 170 "/usr/include/libio.h" 3 4
  1052. struct _IO_jump_t; struct _IO_FILE;
  1053. # 180 "/usr/include/libio.h" 3 4
  1054. typedef void _IO_lock_t;
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. struct _IO_marker {
  1061. struct _IO_marker *_next;
  1062. struct _IO_FILE *_sbuf;
  1063.  
  1064.  
  1065.  
  1066. int _pos;
  1067. # 203 "/usr/include/libio.h" 3 4
  1068. };
  1069.  
  1070.  
  1071. enum __codecvt_result
  1072. {
  1073. __codecvt_ok,
  1074. __codecvt_partial,
  1075. __codecvt_error,
  1076. __codecvt_noconv
  1077. };
  1078. # 271 "/usr/include/libio.h" 3 4
  1079. struct _IO_FILE {
  1080. int _flags;
  1081.  
  1082.  
  1083.  
  1084.  
  1085. char* _IO_read_ptr;
  1086. char* _IO_read_end;
  1087. char* _IO_read_base;
  1088. char* _IO_write_base;
  1089. char* _IO_write_ptr;
  1090. char* _IO_write_end;
  1091. char* _IO_buf_base;
  1092. char* _IO_buf_end;
  1093.  
  1094. char *_IO_save_base;
  1095. char *_IO_backup_base;
  1096. char *_IO_save_end;
  1097.  
  1098. struct _IO_marker *_markers;
  1099.  
  1100. struct _IO_FILE *_chain;
  1101.  
  1102. int _fileno;
  1103.  
  1104.  
  1105.  
  1106. int _flags2;
  1107.  
  1108. __off_t _old_offset;
  1109.  
  1110.  
  1111.  
  1112. unsigned short _cur_column;
  1113. signed char _vtable_offset;
  1114. char _shortbuf[1];
  1115.  
  1116.  
  1117.  
  1118. _IO_lock_t *_lock;
  1119. # 319 "/usr/include/libio.h" 3 4
  1120. __off64_t _offset;
  1121. # 328 "/usr/include/libio.h" 3 4
  1122. void *__pad1;
  1123. void *__pad2;
  1124. void *__pad3;
  1125. void *__pad4;
  1126. size_t __pad5;
  1127.  
  1128. int _mode;
  1129.  
  1130. char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
  1131.  
  1132. };
  1133.  
  1134.  
  1135. typedef struct _IO_FILE _IO_FILE;
  1136.  
  1137.  
  1138. struct _IO_FILE_plus;
  1139.  
  1140. extern struct _IO_FILE_plus _IO_2_1_stdin_;
  1141. extern struct _IO_FILE_plus _IO_2_1_stdout_;
  1142. extern struct _IO_FILE_plus _IO_2_1_stderr_;
  1143. # 364 "/usr/include/libio.h" 3 4
  1144. typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152. typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
  1153. size_t __n);
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161. typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
  1162.  
  1163.  
  1164. typedef int __io_close_fn (void *__cookie);
  1165. # 416 "/usr/include/libio.h" 3 4
  1166. extern int __underflow (_IO_FILE *);
  1167. extern int __uflow (_IO_FILE *);
  1168. extern int __overflow (_IO_FILE *, int);
  1169. # 460 "/usr/include/libio.h" 3 4
  1170. extern int _IO_getc (_IO_FILE *__fp);
  1171. extern int _IO_putc (int __c, _IO_FILE *__fp);
  1172. extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
  1173. extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
  1174.  
  1175. extern int _IO_peekc_locked (_IO_FILE *__fp);
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181. extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
  1182. extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
  1183. extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
  1184. # 490 "/usr/include/libio.h" 3 4
  1185. extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
  1186. __gnuc_va_list, int *__restrict);
  1187. extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
  1188. __gnuc_va_list);
  1189. extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
  1190. extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
  1191.  
  1192. extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
  1193. extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
  1194.  
  1195. extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
  1196. # 76 "/usr/include/stdio.h" 2 3 4
  1197.  
  1198.  
  1199.  
  1200.  
  1201. typedef __gnuc_va_list va_list;
  1202. # 91 "/usr/include/stdio.h" 3 4
  1203. typedef __off_t off_t;
  1204. # 103 "/usr/include/stdio.h" 3 4
  1205. typedef __ssize_t ssize_t;
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213. typedef _G_fpos_t fpos_t;
  1214.  
  1215.  
  1216.  
  1217.  
  1218. # 161 "/usr/include/stdio.h" 3 4
  1219. # 1 "/usr/include/arm-linux-gnueabihf/bits/stdio_lim.h" 1 3 4
  1220. # 162 "/usr/include/stdio.h" 2 3 4
  1221.  
  1222.  
  1223.  
  1224. extern struct _IO_FILE *stdin;
  1225. extern struct _IO_FILE *stdout;
  1226. extern struct _IO_FILE *stderr;
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234. extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
  1235.  
  1236. extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
  1237.  
  1238.  
  1239.  
  1240.  
  1241. extern int renameat (int __oldfd, __const char *__old, int __newfd,
  1242. __const char *__new) __attribute__ ((__nothrow__));
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251. extern FILE *tmpfile (void) ;
  1252. # 206 "/usr/include/stdio.h" 3 4
  1253. extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259. extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
  1260. # 224 "/usr/include/stdio.h" 3 4
  1261. extern char *tempnam (__const char *__dir, __const char *__pfx)
  1262. __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271. extern int fclose (FILE *__stream);
  1272.  
  1273.  
  1274.  
  1275.  
  1276. extern int fflush (FILE *__stream);
  1277.  
  1278. # 249 "/usr/include/stdio.h" 3 4
  1279. extern int fflush_unlocked (FILE *__stream);
  1280. # 263 "/usr/include/stdio.h" 3 4
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287. extern FILE *fopen (__const char *__restrict __filename,
  1288. __const char *__restrict __modes) ;
  1289.  
  1290.  
  1291.  
  1292.  
  1293. extern FILE *freopen (__const char *__restrict __filename,
  1294. __const char *__restrict __modes,
  1295. FILE *__restrict __stream) ;
  1296. # 292 "/usr/include/stdio.h" 3 4
  1297.  
  1298. # 303 "/usr/include/stdio.h" 3 4
  1299. extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
  1300. # 316 "/usr/include/stdio.h" 3 4
  1301. extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
  1302. __attribute__ ((__nothrow__)) ;
  1303.  
  1304.  
  1305.  
  1306.  
  1307. extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ;
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314. extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
  1315.  
  1316.  
  1317.  
  1318. extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
  1319. int __modes, size_t __n) __attribute__ ((__nothrow__));
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325. extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
  1326. size_t __size) __attribute__ ((__nothrow__));
  1327.  
  1328.  
  1329. extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338. extern int fprintf (FILE *__restrict __stream,
  1339. __const char *__restrict __format, ...);
  1340.  
  1341.  
  1342.  
  1343.  
  1344. extern int printf (__const char *__restrict __format, ...);
  1345.  
  1346. extern int sprintf (char *__restrict __s,
  1347. __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353. extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
  1354. __gnuc_va_list __arg);
  1355.  
  1356.  
  1357.  
  1358.  
  1359. extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
  1360.  
  1361. extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
  1362. __gnuc_va_list __arg) __attribute__ ((__nothrow__));
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368. extern int snprintf (char *__restrict __s, size_t __maxlen,
  1369. __const char *__restrict __format, ...)
  1370. __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
  1371.  
  1372. extern int vsnprintf (char *__restrict __s, size_t __maxlen,
  1373. __const char *__restrict __format, __gnuc_va_list __arg)
  1374. __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
  1375.  
  1376. # 414 "/usr/include/stdio.h" 3 4
  1377. extern int vdprintf (int __fd, __const char *__restrict __fmt,
  1378. __gnuc_va_list __arg)
  1379. __attribute__ ((__format__ (__printf__, 2, 0)));
  1380. extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
  1381. __attribute__ ((__format__ (__printf__, 2, 3)));
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. extern int fscanf (FILE *__restrict __stream,
  1391. __const char *__restrict __format, ...) ;
  1392.  
  1393.  
  1394.  
  1395.  
  1396. extern int scanf (__const char *__restrict __format, ...) ;
  1397.  
  1398. extern int sscanf (__const char *__restrict __s,
  1399. __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
  1400. # 445 "/usr/include/stdio.h" 3 4
  1401. extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
  1402.  
  1403. ;
  1404. extern int scanf (__const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
  1405. ;
  1406. extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__))
  1407.  
  1408. ;
  1409. # 465 "/usr/include/stdio.h" 3 4
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418. extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
  1419. __gnuc_va_list __arg)
  1420. __attribute__ ((__format__ (__scanf__, 2, 0))) ;
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426. extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
  1427. __attribute__ ((__format__ (__scanf__, 1, 0))) ;
  1428.  
  1429.  
  1430. extern int vsscanf (__const char *__restrict __s,
  1431. __const char *__restrict __format, __gnuc_va_list __arg)
  1432. __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
  1433. # 496 "/usr/include/stdio.h" 3 4
  1434. extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
  1435.  
  1436.  
  1437.  
  1438. __attribute__ ((__format__ (__scanf__, 2, 0))) ;
  1439. extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
  1440.  
  1441. __attribute__ ((__format__ (__scanf__, 1, 0))) ;
  1442. extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__))
  1443.  
  1444.  
  1445.  
  1446. __attribute__ ((__format__ (__scanf__, 2, 0)));
  1447. # 524 "/usr/include/stdio.h" 3 4
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457. extern int fgetc (FILE *__stream);
  1458. extern int getc (FILE *__stream);
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464. extern int getchar (void);
  1465.  
  1466. # 552 "/usr/include/stdio.h" 3 4
  1467. extern int getc_unlocked (FILE *__stream);
  1468. extern int getchar_unlocked (void);
  1469. # 563 "/usr/include/stdio.h" 3 4
  1470. extern int fgetc_unlocked (FILE *__stream);
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482. extern int fputc (int __c, FILE *__stream);
  1483. extern int putc (int __c, FILE *__stream);
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489. extern int putchar (int __c);
  1490.  
  1491. # 596 "/usr/include/stdio.h" 3 4
  1492. extern int fputc_unlocked (int __c, FILE *__stream);
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500. extern int putc_unlocked (int __c, FILE *__stream);
  1501. extern int putchar_unlocked (int __c);
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508. extern int getw (FILE *__stream);
  1509.  
  1510.  
  1511. extern int putw (int __w, FILE *__stream);
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520. extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
  1521. ;
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528. extern char *gets (char *__s) ;
  1529.  
  1530. # 658 "/usr/include/stdio.h" 3 4
  1531. extern __ssize_t __getdelim (char **__restrict __lineptr,
  1532. size_t *__restrict __n, int __delimiter,
  1533. FILE *__restrict __stream) ;
  1534. extern __ssize_t getdelim (char **__restrict __lineptr,
  1535. size_t *__restrict __n, int __delimiter,
  1536. FILE *__restrict __stream) ;
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544. extern __ssize_t getline (char **__restrict __lineptr,
  1545. size_t *__restrict __n,
  1546. FILE *__restrict __stream) ;
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555. extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561. extern int puts (__const char *__s);
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568. extern int ungetc (int __c, FILE *__stream);
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575. extern size_t fread (void *__restrict __ptr, size_t __size,
  1576. size_t __n, FILE *__restrict __stream) ;
  1577.  
  1578.  
  1579.  
  1580.  
  1581. extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
  1582. size_t __n, FILE *__restrict __s);
  1583.  
  1584. # 730 "/usr/include/stdio.h" 3 4
  1585. extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
  1586. size_t __n, FILE *__restrict __stream) ;
  1587. extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
  1588. size_t __n, FILE *__restrict __stream);
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597. extern int fseek (FILE *__stream, long int __off, int __whence);
  1598.  
  1599.  
  1600.  
  1601.  
  1602. extern long int ftell (FILE *__stream) ;
  1603.  
  1604.  
  1605.  
  1606.  
  1607. extern void rewind (FILE *__stream);
  1608.  
  1609. # 766 "/usr/include/stdio.h" 3 4
  1610. extern int fseeko (FILE *__stream, __off_t __off, int __whence);
  1611.  
  1612.  
  1613.  
  1614.  
  1615. extern __off_t ftello (FILE *__stream) ;
  1616. # 785 "/usr/include/stdio.h" 3 4
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623. extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
  1624.  
  1625.  
  1626.  
  1627.  
  1628. extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
  1629. # 808 "/usr/include/stdio.h" 3 4
  1630.  
  1631. # 817 "/usr/include/stdio.h" 3 4
  1632.  
  1633.  
  1634. extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
  1635.  
  1636. extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
  1637.  
  1638. extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
  1639.  
  1640.  
  1641.  
  1642.  
  1643. extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
  1644. extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
  1645. extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. extern void perror (__const char *__s);
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661. # 1 "/usr/include/arm-linux-gnueabihf/bits/sys_errlist.h" 1 3 4
  1662. # 27 "/usr/include/arm-linux-gnueabihf/bits/sys_errlist.h" 3 4
  1663. extern int sys_nerr;
  1664. extern __const char *__const sys_errlist[];
  1665. # 847 "/usr/include/stdio.h" 2 3 4
  1666.  
  1667.  
  1668.  
  1669.  
  1670. extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
  1671.  
  1672.  
  1673.  
  1674.  
  1675. extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
  1676. # 866 "/usr/include/stdio.h" 3 4
  1677. extern FILE *popen (__const char *__command, __const char *__modes) ;
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683. extern int pclose (FILE *__stream);
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689. extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
  1690. # 906 "/usr/include/stdio.h" 3 4
  1691. extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
  1692.  
  1693.  
  1694.  
  1695. extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
  1696.  
  1697.  
  1698. extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
  1699. # 927 "/usr/include/stdio.h" 3 4
  1700. # 1 "/usr/include/arm-linux-gnueabihf/bits/stdio.h" 1 3 4
  1701. # 36 "/usr/include/arm-linux-gnueabihf/bits/stdio.h" 3 4
  1702. extern __inline int
  1703. vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg)
  1704. {
  1705. return vfprintf (stdout, __fmt, __arg);
  1706. }
  1707.  
  1708.  
  1709.  
  1710. extern __inline int
  1711. getchar (void)
  1712. {
  1713. return _IO_getc (stdin);
  1714. }
  1715.  
  1716.  
  1717.  
  1718.  
  1719. extern __inline int
  1720. fgetc_unlocked (FILE *__fp)
  1721. {
  1722. return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
  1723. }
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729. extern __inline int
  1730. getc_unlocked (FILE *__fp)
  1731. {
  1732. return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
  1733. }
  1734.  
  1735.  
  1736. extern __inline int
  1737. getchar_unlocked (void)
  1738. {
  1739. return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
  1740. }
  1741.  
  1742.  
  1743.  
  1744.  
  1745. extern __inline int
  1746. putchar (int __c)
  1747. {
  1748. return _IO_putc (__c, stdout);
  1749. }
  1750.  
  1751.  
  1752.  
  1753.  
  1754. extern __inline int
  1755. fputc_unlocked (int __c, FILE *__stream)
  1756. {
  1757. return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
  1758. }
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764. extern __inline int
  1765. putc_unlocked (int __c, FILE *__stream)
  1766. {
  1767. return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
  1768. }
  1769.  
  1770.  
  1771. extern __inline int
  1772. putchar_unlocked (int __c)
  1773. {
  1774. return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
  1775. }
  1776. # 125 "/usr/include/arm-linux-gnueabihf/bits/stdio.h" 3 4
  1777. extern __inline int
  1778. __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream)
  1779. {
  1780. return (((__stream)->_flags & 0x10) != 0);
  1781. }
  1782.  
  1783.  
  1784. extern __inline int
  1785. __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream)
  1786. {
  1787. return (((__stream)->_flags & 0x20) != 0);
  1788. }
  1789. # 928 "/usr/include/stdio.h" 2 3 4
  1790. # 936 "/usr/include/stdio.h" 3 4
  1791.  
  1792. # 18 "./src/mamecore.h" 2
  1793. # 1 "/usr/include/string.h" 1 3 4
  1794. # 29 "/usr/include/string.h" 3 4
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  1801. # 35 "/usr/include/string.h" 2 3 4
  1802.  
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811. extern void *memcpy (void *__restrict __dest,
  1812. __const void *__restrict __src, size_t __n)
  1813. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  1814.  
  1815.  
  1816. extern void *memmove (void *__dest, __const void *__src, size_t __n)
  1817. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824. extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
  1825. int __c, size_t __n)
  1826. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832. extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  1833.  
  1834.  
  1835. extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
  1836. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1837. # 95 "/usr/include/string.h" 3 4
  1838. extern void *memchr (__const void *__s, int __c, size_t __n)
  1839. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
  1840.  
  1841.  
  1842. # 126 "/usr/include/string.h" 3 4
  1843.  
  1844.  
  1845. extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
  1846. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  1847.  
  1848. extern char *strncpy (char *__restrict __dest,
  1849. __const char *__restrict __src, size_t __n)
  1850. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  1851.  
  1852.  
  1853. extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
  1854. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  1855.  
  1856. extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
  1857. size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  1858.  
  1859.  
  1860. extern int strcmp (__const char *__s1, __const char *__s2)
  1861. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1862.  
  1863. extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
  1864. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1865.  
  1866.  
  1867. extern int strcoll (__const char *__s1, __const char *__s2)
  1868. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1869.  
  1870. extern size_t strxfrm (char *__restrict __dest,
  1871. __const char *__restrict __src, size_t __n)
  1872. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879. # 1 "/usr/include/xlocale.h" 1 3 4
  1880. # 28 "/usr/include/xlocale.h" 3 4
  1881. typedef struct __locale_struct
  1882. {
  1883.  
  1884. struct __locale_data *__locales[13];
  1885.  
  1886.  
  1887. const unsigned short int *__ctype_b;
  1888. const int *__ctype_tolower;
  1889. const int *__ctype_toupper;
  1890.  
  1891.  
  1892. const char *__names[13];
  1893. } *__locale_t;
  1894.  
  1895.  
  1896. typedef __locale_t locale_t;
  1897. # 163 "/usr/include/string.h" 2 3 4
  1898.  
  1899.  
  1900. extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
  1901. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
  1902.  
  1903. extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
  1904. __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910. extern char *strdup (__const char *__s)
  1911. __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. extern char *strndup (__const char *__string, size_t __n)
  1919. __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
  1920. # 210 "/usr/include/string.h" 3 4
  1921.  
  1922. # 235 "/usr/include/string.h" 3 4
  1923. extern char *strchr (__const char *__s, int __c)
  1924. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
  1925. # 262 "/usr/include/string.h" 3 4
  1926. extern char *strrchr (__const char *__s, int __c)
  1927. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
  1928.  
  1929.  
  1930. # 281 "/usr/include/string.h" 3 4
  1931.  
  1932.  
  1933.  
  1934. extern size_t strcspn (__const char *__s, __const char *__reject)
  1935. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1936.  
  1937.  
  1938. extern size_t strspn (__const char *__s, __const char *__accept)
  1939. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1940. # 314 "/usr/include/string.h" 3 4
  1941. extern char *strpbrk (__const char *__s, __const char *__accept)
  1942. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1943. # 342 "/usr/include/string.h" 3 4
  1944. extern char *strstr (__const char *__haystack, __const char *__needle)
  1945. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  1946.  
  1947.  
  1948.  
  1949.  
  1950. extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
  1951. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  1952.  
  1953.  
  1954.  
  1955.  
  1956. extern char *__strtok_r (char *__restrict __s,
  1957. __const char *__restrict __delim,
  1958. char **__restrict __save_ptr)
  1959. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
  1960.  
  1961. extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
  1962. char **__restrict __save_ptr)
  1963. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
  1964. # 397 "/usr/include/string.h" 3 4
  1965.  
  1966.  
  1967. extern size_t strlen (__const char *__s)
  1968. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974. extern size_t strnlen (__const char *__string, size_t __maxlen)
  1975. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. extern char *strerror (int __errnum) __attribute__ ((__nothrow__));
  1982.  
  1983. # 427 "/usr/include/string.h" 3 4
  1984. extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__))
  1985.  
  1986. __attribute__ ((__nonnull__ (2)));
  1987. # 445 "/usr/include/string.h" 3 4
  1988. extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__));
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994. extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  1995.  
  1996.  
  1997.  
  1998. extern void bcopy (__const void *__src, void *__dest, size_t __n)
  1999. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2000.  
  2001.  
  2002. extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2003.  
  2004.  
  2005. extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
  2006. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  2007. # 489 "/usr/include/string.h" 3 4
  2008. extern char *index (__const char *__s, int __c)
  2009. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
  2010. # 517 "/usr/include/string.h" 3 4
  2011. extern char *rindex (__const char *__s, int __c)
  2012. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
  2013.  
  2014.  
  2015.  
  2016.  
  2017. extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
  2018. # 536 "/usr/include/string.h" 3 4
  2019. extern int strcasecmp (__const char *__s1, __const char *__s2)
  2020. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  2021.  
  2022.  
  2023. extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
  2024. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
  2025. # 559 "/usr/include/string.h" 3 4
  2026. extern char *strsep (char **__restrict __stringp,
  2027. __const char *__restrict __delim)
  2028. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2029.  
  2030.  
  2031.  
  2032.  
  2033. extern char *strsignal (int __sig) __attribute__ ((__nothrow__));
  2034.  
  2035.  
  2036. extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
  2037. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2038. extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
  2039. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2040.  
  2041.  
  2042.  
  2043. extern char *__stpncpy (char *__restrict __dest,
  2044. __const char *__restrict __src, size_t __n)
  2045. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2046. extern char *stpncpy (char *__restrict __dest,
  2047. __const char *__restrict __src, size_t __n)
  2048. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2049. # 634 "/usr/include/string.h" 3 4
  2050. # 1 "/usr/include/arm-linux-gnueabihf/bits/string.h" 1 3 4
  2051. # 635 "/usr/include/string.h" 2 3 4
  2052.  
  2053.  
  2054. # 1 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 1 3 4
  2055. # 80 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2056. typedef struct { unsigned char __arr[2]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR2;
  2057. typedef struct { unsigned char __arr[3]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR3;
  2058. typedef struct { unsigned char __arr[4]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR4;
  2059. typedef struct { unsigned char __arr[5]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR5;
  2060. typedef struct { unsigned char __arr[6]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR6;
  2061. typedef struct { unsigned char __arr[7]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR7;
  2062. typedef struct { unsigned char __arr[8]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR8;
  2063. # 394 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2064. extern void *__rawmemchr (const void *__s, int __c);
  2065. # 969 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2066. extern __inline size_t __strcspn_c1 (__const char *__s, int __reject);
  2067. extern __inline size_t
  2068. __strcspn_c1 (__const char *__s, int __reject)
  2069. {
  2070. register size_t __result = 0;
  2071. while (__s[__result] != '\0' && __s[__result] != __reject)
  2072. ++__result;
  2073. return __result;
  2074. }
  2075.  
  2076. extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1,
  2077. int __reject2);
  2078. extern __inline size_t
  2079. __strcspn_c2 (__const char *__s, int __reject1, int __reject2)
  2080. {
  2081. register size_t __result = 0;
  2082. while (__s[__result] != '\0' && __s[__result] != __reject1
  2083. && __s[__result] != __reject2)
  2084. ++__result;
  2085. return __result;
  2086. }
  2087.  
  2088. extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1,
  2089. int __reject2, int __reject3);
  2090. extern __inline size_t
  2091. __strcspn_c3 (__const char *__s, int __reject1, int __reject2,
  2092. int __reject3)
  2093. {
  2094. register size_t __result = 0;
  2095. while (__s[__result] != '\0' && __s[__result] != __reject1
  2096. && __s[__result] != __reject2 && __s[__result] != __reject3)
  2097. ++__result;
  2098. return __result;
  2099. }
  2100. # 1045 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2101. extern __inline size_t __strspn_c1 (__const char *__s, int __accept);
  2102. extern __inline size_t
  2103. __strspn_c1 (__const char *__s, int __accept)
  2104. {
  2105. register size_t __result = 0;
  2106.  
  2107. while (__s[__result] == __accept)
  2108. ++__result;
  2109. return __result;
  2110. }
  2111.  
  2112. extern __inline size_t __strspn_c2 (__const char *__s, int __accept1,
  2113. int __accept2);
  2114. extern __inline size_t
  2115. __strspn_c2 (__const char *__s, int __accept1, int __accept2)
  2116. {
  2117. register size_t __result = 0;
  2118.  
  2119. while (__s[__result] == __accept1 || __s[__result] == __accept2)
  2120. ++__result;
  2121. return __result;
  2122. }
  2123.  
  2124. extern __inline size_t __strspn_c3 (__const char *__s, int __accept1,
  2125. int __accept2, int __accept3);
  2126. extern __inline size_t
  2127. __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
  2128. {
  2129. register size_t __result = 0;
  2130.  
  2131. while (__s[__result] == __accept1 || __s[__result] == __accept2
  2132. || __s[__result] == __accept3)
  2133. ++__result;
  2134. return __result;
  2135. }
  2136. # 1121 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2137. extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
  2138. int __accept2);
  2139. extern __inline char *
  2140. __strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
  2141. {
  2142.  
  2143. while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
  2144. ++__s;
  2145. return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
  2146. }
  2147.  
  2148. extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
  2149. int __accept2, int __accept3);
  2150. extern __inline char *
  2151. __strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
  2152. int __accept3)
  2153. {
  2154.  
  2155. while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
  2156. && *__s != __accept3)
  2157. ++__s;
  2158. return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
  2159. }
  2160. # 1172 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2161. extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
  2162. extern __inline char *
  2163. __strtok_r_1c (char *__s, char __sep, char **__nextp)
  2164. {
  2165. char *__result;
  2166. if (__s == ((void *)0))
  2167. __s = *__nextp;
  2168. while (*__s == __sep)
  2169. ++__s;
  2170. __result = ((void *)0);
  2171. if (*__s != '\0')
  2172. {
  2173. __result = __s++;
  2174. while (*__s != '\0')
  2175. if (*__s++ == __sep)
  2176. {
  2177. __s[-1] = '\0';
  2178. break;
  2179. }
  2180. }
  2181. *__nextp = __s;
  2182. return __result;
  2183. }
  2184. # 1204 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2185. extern char *__strsep_g (char **__stringp, __const char *__delim);
  2186. # 1222 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2187. extern __inline char *__strsep_1c (char **__s, char __reject);
  2188. extern __inline char *
  2189. __strsep_1c (char **__s, char __reject)
  2190. {
  2191. register char *__retval = *__s;
  2192. if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0))
  2193. *(*__s)++ = '\0';
  2194. return __retval;
  2195. }
  2196.  
  2197. extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2);
  2198. extern __inline char *
  2199. __strsep_2c (char **__s, char __reject1, char __reject2)
  2200. {
  2201. register char *__retval = *__s;
  2202. if (__retval != ((void *)0))
  2203. {
  2204. register char *__cp = __retval;
  2205. while (1)
  2206. {
  2207. if (*__cp == '\0')
  2208. {
  2209. __cp = ((void *)0);
  2210. break;
  2211. }
  2212. if (*__cp == __reject1 || *__cp == __reject2)
  2213. {
  2214. *__cp++ = '\0';
  2215. break;
  2216. }
  2217. ++__cp;
  2218. }
  2219. *__s = __cp;
  2220. }
  2221. return __retval;
  2222. }
  2223.  
  2224. extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
  2225. char __reject3);
  2226. extern __inline char *
  2227. __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
  2228. {
  2229. register char *__retval = *__s;
  2230. if (__retval != ((void *)0))
  2231. {
  2232. register char *__cp = __retval;
  2233. while (1)
  2234. {
  2235. if (*__cp == '\0')
  2236. {
  2237. __cp = ((void *)0);
  2238. break;
  2239. }
  2240. if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
  2241. {
  2242. *__cp++ = '\0';
  2243. break;
  2244. }
  2245. ++__cp;
  2246. }
  2247. *__s = __cp;
  2248. }
  2249. return __retval;
  2250. }
  2251. # 1298 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2252. # 1 "/usr/include/stdlib.h" 1 3 4
  2253. # 33 "/usr/include/stdlib.h" 3 4
  2254. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  2255. # 34 "/usr/include/stdlib.h" 2 3 4
  2256.  
  2257.  
  2258. # 469 "/usr/include/stdlib.h" 3 4
  2259.  
  2260.  
  2261. extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
  2262.  
  2263. extern void *calloc (size_t __nmemb, size_t __size)
  2264. __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
  2265.  
  2266. # 964 "/usr/include/stdlib.h" 3 4
  2267.  
  2268. # 1299 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 2 3 4
  2269.  
  2270.  
  2271.  
  2272.  
  2273. extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
  2274. # 1322 "/usr/include/arm-linux-gnueabihf/bits/string2.h" 3 4
  2275. extern char *__strndup (__const char *__string, size_t __n)
  2276. __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
  2277. # 638 "/usr/include/string.h" 2 3 4
  2278. # 646 "/usr/include/string.h" 3 4
  2279.  
  2280. # 19 "./src/mamecore.h" 2
  2281. # 1 "/usr/include/stdlib.h" 1 3 4
  2282. # 33 "/usr/include/stdlib.h" 3 4
  2283. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  2284. # 324 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 3 4
  2285. typedef unsigned int wchar_t;
  2286. # 34 "/usr/include/stdlib.h" 2 3 4
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295. # 1 "/usr/include/arm-linux-gnueabihf/bits/waitflags.h" 1 3 4
  2296. # 43 "/usr/include/stdlib.h" 2 3 4
  2297. # 1 "/usr/include/arm-linux-gnueabihf/bits/waitstatus.h" 1 3 4
  2298. # 67 "/usr/include/arm-linux-gnueabihf/bits/waitstatus.h" 3 4
  2299. union wait
  2300. {
  2301. int w_status;
  2302. struct
  2303. {
  2304.  
  2305. unsigned int __w_termsig:7;
  2306. unsigned int __w_coredump:1;
  2307. unsigned int __w_retcode:8;
  2308. unsigned int:16;
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316. } __wait_terminated;
  2317. struct
  2318. {
  2319.  
  2320. unsigned int __w_stopval:8;
  2321. unsigned int __w_stopsig:8;
  2322. unsigned int:16;
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329. } __wait_stopped;
  2330. };
  2331. # 44 "/usr/include/stdlib.h" 2 3 4
  2332. # 68 "/usr/include/stdlib.h" 3 4
  2333. typedef union
  2334. {
  2335. union wait *__uptr;
  2336. int *__iptr;
  2337. } __WAIT_STATUS __attribute__ ((__transparent_union__));
  2338. # 96 "/usr/include/stdlib.h" 3 4
  2339.  
  2340.  
  2341. typedef struct
  2342. {
  2343. int quot;
  2344. int rem;
  2345. } div_t;
  2346.  
  2347.  
  2348.  
  2349. typedef struct
  2350. {
  2351. long int quot;
  2352. long int rem;
  2353. } ldiv_t;
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361. __extension__ typedef struct
  2362. {
  2363. long long int quot;
  2364. long long int rem;
  2365. } lldiv_t;
  2366.  
  2367.  
  2368. # 140 "/usr/include/stdlib.h" 3 4
  2369. extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ;
  2370.  
  2371.  
  2372.  
  2373.  
  2374. extern double atof (__const char *__nptr)
  2375. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
  2376.  
  2377. extern int atoi (__const char *__nptr)
  2378. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
  2379.  
  2380. extern long int atol (__const char *__nptr)
  2381. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387. __extension__ extern long long int atoll (__const char *__nptr)
  2388. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394. extern double strtod (__const char *__restrict __nptr,
  2395. char **__restrict __endptr)
  2396. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402. extern float strtof (__const char *__restrict __nptr,
  2403. char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2404.  
  2405. extern long double strtold (__const char *__restrict __nptr,
  2406. char **__restrict __endptr)
  2407. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413. extern long int strtol (__const char *__restrict __nptr,
  2414. char **__restrict __endptr, int __base)
  2415. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2416.  
  2417. extern unsigned long int strtoul (__const char *__restrict __nptr,
  2418. char **__restrict __endptr, int __base)
  2419. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2420.  
  2421.  
  2422.  
  2423.  
  2424. __extension__
  2425. extern long long int strtoq (__const char *__restrict __nptr,
  2426. char **__restrict __endptr, int __base)
  2427. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2428.  
  2429. __extension__
  2430. extern unsigned long long int strtouq (__const char *__restrict __nptr,
  2431. char **__restrict __endptr, int __base)
  2432. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438. __extension__
  2439. extern long long int strtoll (__const char *__restrict __nptr,
  2440. char **__restrict __endptr, int __base)
  2441. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2442.  
  2443. __extension__
  2444. extern unsigned long long int strtoull (__const char *__restrict __nptr,
  2445. char **__restrict __endptr, int __base)
  2446. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2447.  
  2448. # 277 "/usr/include/stdlib.h" 3 4
  2449.  
  2450. extern __inline double
  2451. __attribute__ ((__nothrow__)) atof (__const char *__nptr)
  2452. {
  2453. return strtod (__nptr, (char **) ((void *)0));
  2454. }
  2455. extern __inline int
  2456. __attribute__ ((__nothrow__)) atoi (__const char *__nptr)
  2457. {
  2458. return (int) strtol (__nptr, (char **) ((void *)0), 10);
  2459. }
  2460. extern __inline long int
  2461. __attribute__ ((__nothrow__)) atol (__const char *__nptr)
  2462. {
  2463. return strtol (__nptr, (char **) ((void *)0), 10);
  2464. }
  2465.  
  2466.  
  2467.  
  2468.  
  2469. __extension__ extern __inline long long int
  2470. __attribute__ ((__nothrow__)) atoll (__const char *__nptr)
  2471. {
  2472. return strtoll (__nptr, (char **) ((void *)0), 10);
  2473. }
  2474.  
  2475. # 311 "/usr/include/stdlib.h" 3 4
  2476. extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ;
  2477.  
  2478.  
  2479. extern long int a64l (__const char *__s)
  2480. __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
  2481.  
  2482.  
  2483.  
  2484.  
  2485. # 1 "/usr/include/arm-linux-gnueabihf/sys/types.h" 1 3 4
  2486. # 28 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493. typedef __u_char u_char;
  2494. typedef __u_short u_short;
  2495. typedef __u_int u_int;
  2496. typedef __u_long u_long;
  2497. typedef __quad_t quad_t;
  2498. typedef __u_quad_t u_quad_t;
  2499. typedef __fsid_t fsid_t;
  2500.  
  2501.  
  2502.  
  2503.  
  2504. typedef __loff_t loff_t;
  2505.  
  2506.  
  2507.  
  2508. typedef __ino_t ino_t;
  2509. # 61 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2510. typedef __dev_t dev_t;
  2511.  
  2512.  
  2513.  
  2514.  
  2515. typedef __gid_t gid_t;
  2516.  
  2517.  
  2518.  
  2519.  
  2520. typedef __mode_t mode_t;
  2521.  
  2522.  
  2523.  
  2524.  
  2525. typedef __nlink_t nlink_t;
  2526. # 105 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2527. typedef __id_t id_t;
  2528. # 116 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2529. typedef __daddr_t daddr_t;
  2530. typedef __caddr_t caddr_t;
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536. typedef __key_t key_t;
  2537. # 133 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2538. # 1 "/usr/include/time.h" 1 3 4
  2539. # 58 "/usr/include/time.h" 3 4
  2540.  
  2541.  
  2542. typedef __clock_t clock_t;
  2543.  
  2544.  
  2545.  
  2546. # 74 "/usr/include/time.h" 3 4
  2547.  
  2548.  
  2549. typedef __time_t time_t;
  2550.  
  2551.  
  2552.  
  2553. # 92 "/usr/include/time.h" 3 4
  2554. typedef __clockid_t clockid_t;
  2555. # 104 "/usr/include/time.h" 3 4
  2556. typedef __timer_t timer_t;
  2557. # 134 "/usr/include/arm-linux-gnueabihf/sys/types.h" 2 3 4
  2558. # 147 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2559. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  2560. # 148 "/usr/include/arm-linux-gnueabihf/sys/types.h" 2 3 4
  2561.  
  2562.  
  2563.  
  2564. typedef unsigned long int ulong;
  2565. typedef unsigned short int ushort;
  2566. typedef unsigned int uint;
  2567. # 195 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2568. typedef int int8_t __attribute__ ((__mode__ (__QI__)));
  2569. typedef int int16_t __attribute__ ((__mode__ (__HI__)));
  2570. typedef int int32_t __attribute__ ((__mode__ (__SI__)));
  2571. typedef int int64_t __attribute__ ((__mode__ (__DI__)));
  2572.  
  2573.  
  2574. typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
  2575. typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
  2576. typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
  2577. typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
  2578.  
  2579. typedef int register_t __attribute__ ((__mode__ (__word__)));
  2580. # 220 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2581. # 1 "/usr/include/arm-linux-gnueabihf/sys/select.h" 1 3 4
  2582. # 31 "/usr/include/arm-linux-gnueabihf/sys/select.h" 3 4
  2583. # 1 "/usr/include/arm-linux-gnueabihf/bits/select.h" 1 3 4
  2584. # 32 "/usr/include/arm-linux-gnueabihf/sys/select.h" 2 3 4
  2585.  
  2586.  
  2587. # 1 "/usr/include/arm-linux-gnueabihf/bits/sigset.h" 1 3 4
  2588. # 35 "/usr/include/arm-linux-gnueabihf/sys/select.h" 2 3 4
  2589. # 44 "/usr/include/arm-linux-gnueabihf/sys/select.h" 3 4
  2590. # 1 "/usr/include/time.h" 1 3 4
  2591. # 45 "/usr/include/arm-linux-gnueabihf/sys/select.h" 2 3 4
  2592.  
  2593. # 1 "/usr/include/arm-linux-gnueabihf/bits/time.h" 1 3 4
  2594. # 75 "/usr/include/arm-linux-gnueabihf/bits/time.h" 3 4
  2595. struct timeval
  2596. {
  2597. __time_t tv_sec;
  2598. __suseconds_t tv_usec;
  2599. };
  2600. # 47 "/usr/include/arm-linux-gnueabihf/sys/select.h" 2 3 4
  2601.  
  2602.  
  2603. typedef __suseconds_t suseconds_t;
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609. typedef long int __fd_mask;
  2610. # 67 "/usr/include/arm-linux-gnueabihf/sys/select.h" 3 4
  2611. typedef struct
  2612. {
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619. __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
  2620.  
  2621.  
  2622. } fd_set;
  2623.  
  2624.  
  2625.  
  2626.  
  2627.  
  2628.  
  2629. typedef __fd_mask fd_mask;
  2630. # 99 "/usr/include/arm-linux-gnueabihf/sys/select.h" 3 4
  2631.  
  2632. # 109 "/usr/include/arm-linux-gnueabihf/sys/select.h" 3 4
  2633. extern int select (int __nfds, fd_set *__restrict __readfds,
  2634. fd_set *__restrict __writefds,
  2635. fd_set *__restrict __exceptfds,
  2636. struct timeval *__restrict __timeout);
  2637. # 121 "/usr/include/arm-linux-gnueabihf/sys/select.h" 3 4
  2638. extern int pselect (int __nfds, fd_set *__restrict __readfds,
  2639. fd_set *__restrict __writefds,
  2640. fd_set *__restrict __exceptfds,
  2641. const struct timespec *__restrict __timeout,
  2642. const __sigset_t *__restrict __sigmask);
  2643.  
  2644.  
  2645.  
  2646. # 221 "/usr/include/arm-linux-gnueabihf/sys/types.h" 2 3 4
  2647.  
  2648.  
  2649. # 1 "/usr/include/arm-linux-gnueabihf/sys/sysmacros.h" 1 3 4
  2650. # 30 "/usr/include/arm-linux-gnueabihf/sys/sysmacros.h" 3 4
  2651. __extension__
  2652. extern unsigned int gnu_dev_major (unsigned long long int __dev)
  2653. __attribute__ ((__nothrow__));
  2654. __extension__
  2655. extern unsigned int gnu_dev_minor (unsigned long long int __dev)
  2656. __attribute__ ((__nothrow__));
  2657. __extension__
  2658. extern unsigned long long int gnu_dev_makedev (unsigned int __major,
  2659. unsigned int __minor)
  2660. __attribute__ ((__nothrow__));
  2661.  
  2662.  
  2663. __extension__ extern __inline unsigned int
  2664. __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
  2665. {
  2666. return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
  2667. }
  2668.  
  2669. __extension__ extern __inline unsigned int
  2670. __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
  2671. {
  2672. return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
  2673. }
  2674.  
  2675. __extension__ extern __inline unsigned long long int
  2676. __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
  2677. {
  2678. return ((__minor & 0xff) | ((__major & 0xfff) << 8)
  2679. | (((unsigned long long int) (__minor & ~0xff)) << 12)
  2680. | (((unsigned long long int) (__major & ~0xfff)) << 32));
  2681. }
  2682. # 224 "/usr/include/arm-linux-gnueabihf/sys/types.h" 2 3 4
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688. typedef __blksize_t blksize_t;
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695. typedef __blkcnt_t blkcnt_t;
  2696.  
  2697.  
  2698.  
  2699. typedef __fsblkcnt_t fsblkcnt_t;
  2700.  
  2701.  
  2702.  
  2703. typedef __fsfilcnt_t fsfilcnt_t;
  2704. # 274 "/usr/include/arm-linux-gnueabihf/sys/types.h" 3 4
  2705.  
  2706. # 321 "/usr/include/stdlib.h" 2 3 4
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713. extern long int random (void) __attribute__ ((__nothrow__));
  2714.  
  2715.  
  2716. extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722. extern char *initstate (unsigned int __seed, char *__statebuf,
  2723. size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  2724.  
  2725.  
  2726.  
  2727. extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735. struct random_data
  2736. {
  2737. int32_t *fptr;
  2738. int32_t *rptr;
  2739. int32_t *state;
  2740. int rand_type;
  2741. int rand_deg;
  2742. int rand_sep;
  2743. int32_t *end_ptr;
  2744. };
  2745.  
  2746. extern int random_r (struct random_data *__restrict __buf,
  2747. int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2748.  
  2749. extern int srandom_r (unsigned int __seed, struct random_data *__buf)
  2750. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  2751.  
  2752. extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
  2753. size_t __statelen,
  2754. struct random_data *__restrict __buf)
  2755. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
  2756.  
  2757. extern int setstate_r (char *__restrict __statebuf,
  2758. struct random_data *__restrict __buf)
  2759. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766. extern int rand (void) __attribute__ ((__nothrow__));
  2767.  
  2768. extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));
  2769.  
  2770.  
  2771.  
  2772.  
  2773. extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781. extern double drand48 (void) __attribute__ ((__nothrow__));
  2782. extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2783.  
  2784.  
  2785. extern long int lrand48 (void) __attribute__ ((__nothrow__));
  2786. extern long int nrand48 (unsigned short int __xsubi[3])
  2787. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2788.  
  2789.  
  2790. extern long int mrand48 (void) __attribute__ ((__nothrow__));
  2791. extern long int jrand48 (unsigned short int __xsubi[3])
  2792. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2793.  
  2794.  
  2795. extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
  2796. extern unsigned short int *seed48 (unsigned short int __seed16v[3])
  2797. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2798. extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804. struct drand48_data
  2805. {
  2806. unsigned short int __x[3];
  2807. unsigned short int __old_x[3];
  2808. unsigned short int __c;
  2809. unsigned short int __init;
  2810. unsigned long long int __a;
  2811. };
  2812.  
  2813.  
  2814. extern int drand48_r (struct drand48_data *__restrict __buffer,
  2815. double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2816. extern int erand48_r (unsigned short int __xsubi[3],
  2817. struct drand48_data *__restrict __buffer,
  2818. double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2819.  
  2820.  
  2821. extern int lrand48_r (struct drand48_data *__restrict __buffer,
  2822. long int *__restrict __result)
  2823. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2824. extern int nrand48_r (unsigned short int __xsubi[3],
  2825. struct drand48_data *__restrict __buffer,
  2826. long int *__restrict __result)
  2827. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2828.  
  2829.  
  2830. extern int mrand48_r (struct drand48_data *__restrict __buffer,
  2831. long int *__restrict __result)
  2832. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2833. extern int jrand48_r (unsigned short int __xsubi[3],
  2834. struct drand48_data *__restrict __buffer,
  2835. long int *__restrict __result)
  2836. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2837.  
  2838.  
  2839. extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
  2840. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  2841.  
  2842. extern int seed48_r (unsigned short int __seed16v[3],
  2843. struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2844.  
  2845. extern int lcong48_r (unsigned short int __param[7],
  2846. struct drand48_data *__buffer)
  2847. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  2848. # 479 "/usr/include/stdlib.h" 3 4
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855. extern void *realloc (void *__ptr, size_t __size)
  2856. __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
  2857.  
  2858. extern void free (void *__ptr) __attribute__ ((__nothrow__));
  2859.  
  2860.  
  2861.  
  2862.  
  2863. extern void cfree (void *__ptr) __attribute__ ((__nothrow__));
  2864.  
  2865.  
  2866.  
  2867. # 1 "/usr/include/alloca.h" 1 3 4
  2868. # 25 "/usr/include/alloca.h" 3 4
  2869. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stddef.h" 1 3 4
  2870. # 26 "/usr/include/alloca.h" 2 3 4
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878. extern void *alloca (size_t __size) __attribute__ ((__nothrow__));
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885. # 498 "/usr/include/stdlib.h" 2 3 4
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891. extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
  2892.  
  2893.  
  2894.  
  2895.  
  2896. extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
  2897. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2898.  
  2899.  
  2900.  
  2901.  
  2902. extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
  2903.  
  2904.  
  2905.  
  2906. extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2907. # 531 "/usr/include/stdlib.h" 3 4
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913. extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
  2914. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921. extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
  2922. # 554 "/usr/include/stdlib.h" 3 4
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929. extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936. extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2937.  
  2938.  
  2939.  
  2940.  
  2941. extern char *__secure_getenv (__const char *__name)
  2942. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948. extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954. extern int setenv (__const char *__name, __const char *__value, int __replace)
  2955. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  2956.  
  2957.  
  2958. extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965. extern int clearenv (void) __attribute__ ((__nothrow__));
  2966. # 606 "/usr/include/stdlib.h" 3 4
  2967. extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2968. # 620 "/usr/include/stdlib.h" 3 4
  2969. extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
  2970. # 642 "/usr/include/stdlib.h" 3 4
  2971. extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
  2972. # 663 "/usr/include/stdlib.h" 3 4
  2973. extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  2974. # 712 "/usr/include/stdlib.h" 3 4
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980. extern int system (__const char *__command) ;
  2981.  
  2982. # 734 "/usr/include/stdlib.h" 3 4
  2983. extern char *realpath (__const char *__restrict __name,
  2984. char *__restrict __resolved) __attribute__ ((__nothrow__)) ;
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991. typedef int (*__compar_fn_t) (__const void *, __const void *);
  2992. # 752 "/usr/include/stdlib.h" 3 4
  2993.  
  2994.  
  2995.  
  2996. extern void *bsearch (__const void *__key, __const void *__base,
  2997. size_t __nmemb, size_t __size, __compar_fn_t __compar)
  2998. __attribute__ ((__nonnull__ (1, 2, 5))) ;
  2999.  
  3000.  
  3001.  
  3002. extern void qsort (void *__base, size_t __nmemb, size_t __size,
  3003. __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
  3004. # 771 "/usr/include/stdlib.h" 3 4
  3005. extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
  3006. extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
  3007.  
  3008.  
  3009.  
  3010. __extension__ extern long long int llabs (long long int __x)
  3011. __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019. extern div_t div (int __numer, int __denom)
  3020. __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
  3021. extern ldiv_t ldiv (long int __numer, long int __denom)
  3022. __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
  3023.  
  3024.  
  3025.  
  3026.  
  3027. __extension__ extern lldiv_t lldiv (long long int __numer,
  3028. long long int __denom)
  3029. __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
  3030.  
  3031. # 808 "/usr/include/stdlib.h" 3 4
  3032. extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
  3033. int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
  3034.  
  3035.  
  3036.  
  3037.  
  3038. extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
  3039. int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
  3040.  
  3041.  
  3042.  
  3043.  
  3044. extern char *gcvt (double __value, int __ndigit, char *__buf)
  3045. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
  3046.  
  3047.  
  3048.  
  3049.  
  3050. extern char *qecvt (long double __value, int __ndigit,
  3051. int *__restrict __decpt, int *__restrict __sign)
  3052. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
  3053. extern char *qfcvt (long double __value, int __ndigit,
  3054. int *__restrict __decpt, int *__restrict __sign)
  3055. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
  3056. extern char *qgcvt (long double __value, int __ndigit, char *__buf)
  3057. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
  3058.  
  3059.  
  3060.  
  3061.  
  3062. extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
  3063. int *__restrict __sign, char *__restrict __buf,
  3064. size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
  3065. extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
  3066. int *__restrict __sign, char *__restrict __buf,
  3067. size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
  3068.  
  3069. extern int qecvt_r (long double __value, int __ndigit,
  3070. int *__restrict __decpt, int *__restrict __sign,
  3071. char *__restrict __buf, size_t __len)
  3072. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
  3073. extern int qfcvt_r (long double __value, int __ndigit,
  3074. int *__restrict __decpt, int *__restrict __sign,
  3075. char *__restrict __buf, size_t __len)
  3076. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084. extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ;
  3085.  
  3086.  
  3087. extern int mbtowc (wchar_t *__restrict __pwc,
  3088. __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ;
  3089.  
  3090.  
  3091. extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ;
  3092.  
  3093.  
  3094.  
  3095. extern size_t mbstowcs (wchar_t *__restrict __pwcs,
  3096. __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));
  3097.  
  3098. extern size_t wcstombs (char *__restrict __s,
  3099. __const wchar_t *__restrict __pwcs, size_t __n)
  3100. __attribute__ ((__nothrow__));
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109. extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
  3110. # 896 "/usr/include/stdlib.h" 3 4
  3111. extern int getsubopt (char **__restrict __optionp,
  3112. char *__const *__restrict __tokens,
  3113. char **__restrict __valuep)
  3114. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
  3115. # 948 "/usr/include/stdlib.h" 3 4
  3116. extern int getloadavg (double __loadavg[], int __nelem)
  3117. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  3118. # 964 "/usr/include/stdlib.h" 3 4
  3119.  
  3120. # 20 "./src/mamecore.h" 2
  3121. # 1 "./advance/osd/osd_cpu.h" 1
  3122. # 34 "./advance/osd/osd_cpu.h"
  3123. # 1 "./advance/osd/osdutils.h" 1
  3124. # 35 "./advance/osd/osdutils.h"
  3125. # 1 "/usr/include/ctype.h" 1 3 4
  3126. # 30 "/usr/include/ctype.h" 3 4
  3127.  
  3128. # 48 "/usr/include/ctype.h" 3 4
  3129. enum
  3130. {
  3131. _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
  3132. _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
  3133. _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
  3134. _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
  3135. _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
  3136. _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
  3137. _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
  3138. _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
  3139. _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
  3140. _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
  3141. _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
  3142. _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
  3143. };
  3144. # 81 "/usr/include/ctype.h" 3 4
  3145. extern __const unsigned short int **__ctype_b_loc (void)
  3146. __attribute__ ((__nothrow__)) __attribute__ ((__const));
  3147. extern __const __int32_t **__ctype_tolower_loc (void)
  3148. __attribute__ ((__nothrow__)) __attribute__ ((__const));
  3149. extern __const __int32_t **__ctype_toupper_loc (void)
  3150. __attribute__ ((__nothrow__)) __attribute__ ((__const));
  3151. # 96 "/usr/include/ctype.h" 3 4
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158. extern int isalnum (int) __attribute__ ((__nothrow__));
  3159. extern int isalpha (int) __attribute__ ((__nothrow__));
  3160. extern int iscntrl (int) __attribute__ ((__nothrow__));
  3161. extern int isdigit (int) __attribute__ ((__nothrow__));
  3162. extern int islower (int) __attribute__ ((__nothrow__));
  3163. extern int isgraph (int) __attribute__ ((__nothrow__));
  3164. extern int isprint (int) __attribute__ ((__nothrow__));
  3165. extern int ispunct (int) __attribute__ ((__nothrow__));
  3166. extern int isspace (int) __attribute__ ((__nothrow__));
  3167. extern int isupper (int) __attribute__ ((__nothrow__));
  3168. extern int isxdigit (int) __attribute__ ((__nothrow__));
  3169.  
  3170.  
  3171.  
  3172. extern int tolower (int __c) __attribute__ ((__nothrow__));
  3173.  
  3174.  
  3175. extern int toupper (int __c) __attribute__ ((__nothrow__));
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184. extern int isblank (int) __attribute__ ((__nothrow__));
  3185.  
  3186.  
  3187. # 142 "/usr/include/ctype.h" 3 4
  3188. extern int isascii (int __c) __attribute__ ((__nothrow__));
  3189.  
  3190.  
  3191.  
  3192. extern int toascii (int __c) __attribute__ ((__nothrow__));
  3193.  
  3194.  
  3195.  
  3196. extern int _toupper (int) __attribute__ ((__nothrow__));
  3197. extern int _tolower (int) __attribute__ ((__nothrow__));
  3198. # 190 "/usr/include/ctype.h" 3 4
  3199. extern __inline int
  3200. __attribute__ ((__nothrow__)) tolower (int __c)
  3201. {
  3202. return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
  3203. }
  3204.  
  3205. extern __inline int
  3206. __attribute__ ((__nothrow__)) toupper (int __c)
  3207. {
  3208. return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
  3209. }
  3210. # 247 "/usr/include/ctype.h" 3 4
  3211. extern int isalnum_l (int, __locale_t) __attribute__ ((__nothrow__));
  3212. extern int isalpha_l (int, __locale_t) __attribute__ ((__nothrow__));
  3213. extern int iscntrl_l (int, __locale_t) __attribute__ ((__nothrow__));
  3214. extern int isdigit_l (int, __locale_t) __attribute__ ((__nothrow__));
  3215. extern int islower_l (int, __locale_t) __attribute__ ((__nothrow__));
  3216. extern int isgraph_l (int, __locale_t) __attribute__ ((__nothrow__));
  3217. extern int isprint_l (int, __locale_t) __attribute__ ((__nothrow__));
  3218. extern int ispunct_l (int, __locale_t) __attribute__ ((__nothrow__));
  3219. extern int isspace_l (int, __locale_t) __attribute__ ((__nothrow__));
  3220. extern int isupper_l (int, __locale_t) __attribute__ ((__nothrow__));
  3221. extern int isxdigit_l (int, __locale_t) __attribute__ ((__nothrow__));
  3222.  
  3223. extern int isblank_l (int, __locale_t) __attribute__ ((__nothrow__));
  3224.  
  3225.  
  3226.  
  3227. extern int __tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
  3228. extern int tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
  3229.  
  3230.  
  3231. extern int __toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
  3232. extern int toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
  3233. # 323 "/usr/include/ctype.h" 3 4
  3234.  
  3235. # 36 "./advance/osd/osdutils.h" 2
  3236.  
  3237.  
  3238. # 1 "/usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stdarg.h" 1 3 4
  3239. # 39 "./advance/osd/osdutils.h" 2
  3240.  
  3241. # 1 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 1 3 4
  3242. # 39 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3243. # 1 "/usr/include/time.h" 1 3 4
  3244. # 40 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 2 3 4
  3245. # 105 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3246.  
  3247.  
  3248. # 1 "/usr/include/arm-linux-gnueabihf/bits/stat.h" 1 3 4
  3249. # 39 "/usr/include/arm-linux-gnueabihf/bits/stat.h" 3 4
  3250. struct stat
  3251. {
  3252. __dev_t st_dev;
  3253. unsigned short int __pad1;
  3254.  
  3255. __ino_t st_ino;
  3256.  
  3257.  
  3258.  
  3259. __mode_t st_mode;
  3260. __nlink_t st_nlink;
  3261. __uid_t st_uid;
  3262. __gid_t st_gid;
  3263. __dev_t st_rdev;
  3264. unsigned short int __pad2;
  3265.  
  3266. __off_t st_size;
  3267.  
  3268.  
  3269.  
  3270. __blksize_t st_blksize;
  3271.  
  3272.  
  3273. __blkcnt_t st_blocks;
  3274. # 73 "/usr/include/arm-linux-gnueabihf/bits/stat.h" 3 4
  3275. struct timespec st_atim;
  3276. struct timespec st_mtim;
  3277. struct timespec st_ctim;
  3278. # 88 "/usr/include/arm-linux-gnueabihf/bits/stat.h" 3 4
  3279. unsigned long int __unused4;
  3280. unsigned long int __unused5;
  3281.  
  3282.  
  3283.  
  3284. };
  3285. # 108 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 2 3 4
  3286. # 211 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3287. extern int stat (__const char *__restrict __file,
  3288. struct stat *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  3289.  
  3290.  
  3291.  
  3292. extern int fstat (int __fd, struct stat *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  3293. # 240 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3294. extern int fstatat (int __fd, __const char *__restrict __file,
  3295. struct stat *__restrict __buf, int __flag)
  3296. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
  3297. # 265 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3298. extern int lstat (__const char *__restrict __file,
  3299. struct stat *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
  3300. # 286 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3301. extern int chmod (__const char *__file, __mode_t __mode)
  3302. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308. extern int lchmod (__const char *__file, __mode_t __mode)
  3309. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  3310.  
  3311.  
  3312.  
  3313.  
  3314. extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__));
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320. extern int fchmodat (int __fd, __const char *__file, __mode_t __mode,
  3321. int __flag)
  3322. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) ;
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329. extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__));
  3330. # 323 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3331. extern int mkdir (__const char *__path, __mode_t __mode)
  3332. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338. extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
  3339. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346. extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
  3347. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353. extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
  3354. __dev_t __dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360. extern int mkfifo (__const char *__path, __mode_t __mode)
  3361. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367. extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
  3368. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374. extern int utimensat (int __fd, __const char *__path,
  3375. __const struct timespec __times[2],
  3376. int __flags)
  3377. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
  3378.  
  3379.  
  3380.  
  3381.  
  3382. extern int futimens (int __fd, __const struct timespec __times[2]) __attribute__ ((__nothrow__));
  3383. # 401 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3384. extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
  3385. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
  3386. extern int __xstat (int __ver, __const char *__filename,
  3387. struct stat *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
  3388. extern int __lxstat (int __ver, __const char *__filename,
  3389. struct stat *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
  3390. extern int __fxstatat (int __ver, int __fildes, __const char *__filename,
  3391. struct stat *__stat_buf, int __flag)
  3392. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));
  3393. # 444 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3394. extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
  3395. __dev_t *__dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
  3396.  
  3397. extern int __xmknodat (int __ver, int __fd, __const char *__path,
  3398. __mode_t __mode, __dev_t *__dev)
  3399. __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 5)));
  3400.  
  3401.  
  3402.  
  3403.  
  3404. extern __inline int
  3405. __attribute__ ((__nothrow__)) stat (__const char *__path, struct stat *__statbuf)
  3406. {
  3407. return __xstat (3, __path, __statbuf);
  3408. }
  3409.  
  3410.  
  3411. extern __inline int
  3412. __attribute__ ((__nothrow__)) lstat (__const char *__path, struct stat *__statbuf)
  3413. {
  3414. return __lxstat (3, __path, __statbuf);
  3415. }
  3416.  
  3417.  
  3418. extern __inline int
  3419. __attribute__ ((__nothrow__)) fstat (int __fd, struct stat *__statbuf)
  3420. {
  3421. return __fxstat (3, __fd, __statbuf);
  3422. }
  3423.  
  3424.  
  3425. extern __inline int
  3426. __attribute__ ((__nothrow__)) fstatat (int __fd, __const char *__filename, struct stat *__statbuf, int __flag)
  3427.  
  3428. {
  3429. return __fxstatat (3, __fd, __filename, __statbuf, __flag);
  3430. }
  3431.  
  3432.  
  3433.  
  3434. extern __inline int
  3435. __attribute__ ((__nothrow__)) mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
  3436. {
  3437. return __xmknod (1, __path, __mode, &__dev);
  3438. }
  3439.  
  3440.  
  3441.  
  3442. extern __inline int
  3443. __attribute__ ((__nothrow__)) mknodat (int __fd, __const char *__path, __mode_t __mode, __dev_t __dev)
  3444.  
  3445. {
  3446. return __xmknodat (1, __fd, __path, __mode, &__dev);
  3447. }
  3448. # 536 "/usr/include/arm-linux-gnueabihf/sys/stat.h" 3 4
  3449.  
  3450. # 41 "./advance/osd/osdutils.h" 2
  3451. # 69 "./advance/osd/osdutils.h"
  3452. static inline int strcmpi(const char* a, const char* b)
  3453. {
  3454. return strcasecmp(a, b);
  3455. }
  3456.  
  3457.  
  3458.  
  3459.  
  3460. static inline int strncmpi(const char* a, const char* b, size_t count)
  3461. {
  3462. return strncasecmp(a, b, count);
  3463. }
  3464.  
  3465.  
  3466.  
  3467. static inline void strlwr(char* s)
  3468. {
  3469. while (*s) {
  3470. *s = (__extension__ ({ int __res; if (sizeof (*s) > 1) { if (__builtin_constant_p (*s)) { int __c = (*s); __res = __c < -128 || __c > 255 ? __c : (*__ctype_tolower_loc ())[__c]; } else __res = tolower (*s); } else __res = (*__ctype_tolower_loc ())[(int) (*s)]; __res; }));
  3471. ++s;
  3472. }
  3473. }
  3474.  
  3475.  
  3476.  
  3477. static inline void strupr(char* s)
  3478. {
  3479. while (*s) {
  3480. *s = (__extension__ ({ int __res; if (sizeof (*s) > 1) { if (__builtin_constant_p (*s)) { int __c = (*s); __res = __c < -128 || __c > 255 ? __c : (*__ctype_toupper_loc ())[__c]; } else __res = toupper (*s); } else __res = (*__ctype_toupper_loc ())[(int) (*s)]; __res; }));
  3481. ++s;
  3482. }
  3483. }
  3484.  
  3485.  
  3486. static inline void osd_mkdir(const char* dir)
  3487. {
  3488.  
  3489.  
  3490.  
  3491. mkdir(dir, (0400|0200|0100) | (0400 >> 3) | ((0400 >> 3) >> 3));
  3492.  
  3493. }
  3494. # 35 "./advance/osd/osd_cpu.h" 2
  3495. # 43 "./advance/osd/osd_cpu.h"
  3496. typedef unsigned char UINT8;
  3497. typedef unsigned short UINT16;
  3498. typedef unsigned int UINT32;
  3499. __extension__ typedef unsigned long long UINT64;
  3500. typedef signed char INT8;
  3501. typedef signed short INT16;
  3502. typedef signed int INT32;
  3503. __extension__ typedef signed long long INT64;
  3504. # 21 "./src/mamecore.h" 2
  3505. # 35 "./src/mamecore.h"
  3506. typedef UINT32 FPTR;
  3507.  
  3508.  
  3509.  
  3510.  
  3511. typedef void genf(void);
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517. typedef struct _mame_display mame_display;
  3518. typedef struct _game_driver game_driver;
  3519. typedef struct _machine_config machine_config;
  3520. typedef struct _rom_load_data rom_load_data;
  3521. typedef struct _xml_data_node xml_data_node;
  3522. typedef struct _performance_info performance_info;
  3523. typedef struct _osd_create_params osd_create_params;
  3524. typedef struct _gfx_element gfx_element;
  3525. typedef struct _input_port_entry input_port_entry;
  3526. typedef struct _input_port_default_entry input_port_default_entry;
  3527. typedef struct _mame_file mame_file;
  3528. typedef struct _chd_file chd_file;
  3529. typedef enum _osd_file_error osd_file_error;
  3530.  
  3531.  
  3532.  
  3533. typedef UINT32 pen_t;
  3534.  
  3535.  
  3536. typedef UINT32 rgb_t;
  3537.  
  3538.  
  3539. typedef INT32 stream_sample_t;
  3540.  
  3541.  
  3542. typedef UINT32 input_code;
  3543.  
  3544.  
  3545.  
  3546. typedef struct _mame_bitmap mame_bitmap;
  3547. struct _mame_bitmap
  3548. {
  3549. int width,height;
  3550. int depth;
  3551. void **line;
  3552.  
  3553.  
  3554. void *base;
  3555. int rowpixels;
  3556. int rowbytes;
  3557.  
  3558.  
  3559. void (*plot)(struct _mame_bitmap *bitmap,int x,int y,pen_t pen);
  3560. pen_t (*read)(struct _mame_bitmap *bitmap,int x,int y);
  3561. void (*plot_box)(struct _mame_bitmap *bitmap,int x,int y,int width,int height,pen_t pen);
  3562. };
  3563.  
  3564.  
  3565.  
  3566. typedef struct _rectangle rectangle;
  3567. struct _rectangle
  3568. {
  3569. int min_x,max_x;
  3570. int min_y,max_y;
  3571. };
  3572.  
  3573. typedef struct _ui_menu_item ui_menu_item;
  3574. struct _ui_menu_item
  3575. {
  3576. const char *text;
  3577. const char *subtext;
  3578. UINT32 flags;
  3579. void *ref;
  3580. };
  3581. # 118 "./src/mamecore.h"
  3582. typedef union
  3583. {
  3584.  
  3585. struct { UINT8 l,h,h2,h3; } b;
  3586. struct { UINT16 l,h; } w;
  3587.  
  3588.  
  3589.  
  3590.  
  3591. UINT32 d;
  3592. } PAIR;
  3593. # 138 "./src/mamecore.h"
  3594. typedef union
  3595. {
  3596.  
  3597. struct { UINT8 l,h,h2,h3,h4,h5,h6,h7; } b;
  3598. struct { UINT16 l,h,h2,h3; } w;
  3599. struct { UINT32 l,h; } d;
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605. UINT64 lw;
  3606. } PAIR64;
  3607. # 359 "./src/mamecore.h"
  3608. int mame_stricmp(const char *s1, const char *s2);
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616. int mame_strnicmp(const char *s1, const char *s2, size_t n);
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624. char *mame_strdup(const char *str);
  3625. # 385 "./src/mamecore.h"
  3626. static __inline__ void sect_rect(rectangle *dst, const rectangle *src)
  3627. {
  3628. if (src->min_x > dst->min_x) dst->min_x = src->min_x;
  3629. if (src->max_x < dst->max_x) dst->max_x = src->max_x;
  3630. if (src->min_y > dst->min_y) dst->min_y = src->min_y;
  3631. if (src->max_y < dst->max_y) dst->max_y = src->max_y;
  3632. }
  3633.  
  3634.  
  3635.  
  3636. static __inline__ float u2f(UINT32 v)
  3637. {
  3638. union {
  3639. float ff;
  3640. UINT32 vv;
  3641. } u;
  3642. u.vv = v;
  3643. return u.ff;
  3644. }
  3645.  
  3646.  
  3647.  
  3648. static __inline__ UINT32 f2u(float f)
  3649. {
  3650. union {
  3651. float ff;
  3652. UINT32 vv;
  3653. } u;
  3654. u.ff = f;
  3655. return u.vv;
  3656. }
  3657.  
  3658.  
  3659.  
  3660. static __inline__ double u2d(UINT64 v)
  3661. {
  3662. union {
  3663. double dd;
  3664. UINT64 vv;
  3665. } u;
  3666. u.vv = v;
  3667. return u.dd;
  3668. }
  3669.  
  3670.  
  3671.  
  3672. static __inline__ UINT64 d2u(double d)
  3673. {
  3674. union {
  3675. double dd;
  3676. UINT64 vv;
  3677. } u;
  3678. u.dd = d;
  3679. return u.vv;
  3680. }
  3681. # 455 "./src/mamecore.h"
  3682. static __inline__ UINT32 count_leading_zeros(UINT32 val)
  3683. {
  3684. UINT32 count;
  3685. for (count = 0; (INT32)val >= 0; count++) val <<= 1;
  3686. return count;
  3687. }
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693. static __inline__ UINT32 count_leading_ones(UINT32 val)
  3694. {
  3695. UINT32 count;
  3696. for (count = 0; (INT32)val < 0; count++) val <<= 1;
  3697. return count;
  3698. }
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704. static __inline__ INT32 fixed_mul_shift(INT32 val1, INT32 val2, UINT8 shift)
  3705. {
  3706. return (INT32)(((INT64)val1 * (INT64)val2) >> shift);
  3707. }
  3708. # 491 "./src/mamecore.h"
  3709. static __inline__ int bcd_adjust(int value)
  3710. {
  3711. if ((value & 0xf) >= 0xa)
  3712. value = value + 0x10 - 0xa;
  3713. if ((value & 0xf0) >= 0xa0)
  3714. value = value - 0xa0 + 0x100;
  3715. return value;
  3716. }
  3717.  
  3718.  
  3719. static __inline__ int dec_2_bcd(int a)
  3720. {
  3721. return (a % 10) | ((a / 10) << 4);
  3722. }
  3723.  
  3724.  
  3725. static __inline__ int bcd_2_dec(int a)
  3726. {
  3727. return (a & 0xf) + (a >> 4) * 10;
  3728. }
  3729. # 520 "./src/mamecore.h"
  3730. static __inline__ int gregorian_is_leap_year(int year)
  3731. {
  3732. return !(year % 100 ? year % 4 : year % 400);
  3733. }
  3734.  
  3735.  
  3736.  
  3737. static __inline__ int gregorian_days_in_month(int month, int year)
  3738. {
  3739. if (month == 2)
  3740. return gregorian_is_leap_year(year) ? 29 : 28;
  3741. else if (month == 4 || month == 6 || month == 9 || month == 11)
  3742. return 30;
  3743. else
  3744. return 31;
  3745. }
  3746. # 593 "./src/mamecore.h"
  3747. void fatalerror(const char *text,...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn));
  3748. # 16 "./src/mame.h" 2
  3749. # 63 "./src/mame.h"
  3750. enum
  3751. {
  3752. REGION_INVALID = 0x80,
  3753. REGION_CPU1,
  3754. REGION_CPU2,
  3755. REGION_CPU3,
  3756. REGION_CPU4,
  3757. REGION_CPU5,
  3758. REGION_CPU6,
  3759. REGION_CPU7,
  3760. REGION_CPU8,
  3761. REGION_GFX1,
  3762. REGION_GFX2,
  3763. REGION_GFX3,
  3764. REGION_GFX4,
  3765. REGION_GFX5,
  3766. REGION_GFX6,
  3767. REGION_GFX7,
  3768. REGION_GFX8,
  3769. REGION_PROMS,
  3770. REGION_SOUND1,
  3771. REGION_SOUND2,
  3772. REGION_SOUND3,
  3773. REGION_SOUND4,
  3774. REGION_SOUND5,
  3775. REGION_SOUND6,
  3776. REGION_SOUND7,
  3777. REGION_SOUND8,
  3778. REGION_USER1,
  3779. REGION_USER2,
  3780. REGION_USER3,
  3781. REGION_USER4,
  3782. REGION_USER5,
  3783. REGION_USER6,
  3784. REGION_USER7,
  3785. REGION_USER8,
  3786. REGION_DISKS,
  3787. REGION_PLDS,
  3788. REGION_MAX
  3789. };
  3790.  
  3791. extern const char *memory_region_names[REGION_MAX];
  3792. # 120 "./src/mame.h"
  3793. typedef struct _running_machine running_machine;
  3794. struct _running_machine
  3795. {
  3796.  
  3797. const game_driver * gamedrv;
  3798. const machine_config * drv;
  3799.  
  3800.  
  3801. gfx_element * gfx[32];
  3802. rectangle visible_area;
  3803. rectangle absolute_visible_area;
  3804. float refresh_rate;
  3805. pen_t * pens;
  3806. UINT16 * game_colortable;
  3807. pen_t * remapped_colortable;
  3808. int color_depth;
  3809.  
  3810.  
  3811. int sample_rate;
  3812.  
  3813.  
  3814. input_port_entry * input_ports;
  3815. mame_file * record_file;
  3816. mame_file * playback_file;
  3817.  
  3818.  
  3819. int ui_orientation;
  3820.  
  3821.  
  3822. int debug_mode;
  3823. # 161 "./src/mame.h"
  3824. };
  3825. # 188 "./src/mame.h"
  3826. typedef struct _global_options global_options;
  3827. struct _global_options
  3828. {
  3829. mame_file * record;
  3830. mame_file * playback;
  3831. mame_file * language_file;
  3832. mame_file * logfile;
  3833.  
  3834. int mame_debug;
  3835. int cheat;
  3836. int gui_host;
  3837. int skip_disclaimer;
  3838. int skip_gameinfo;
  3839. int skip_warnings;
  3840.  
  3841. int samplerate;
  3842. int use_samples;
  3843.  
  3844. float brightness;
  3845. float pause_bright;
  3846. float gamma;
  3847. int vector_width;
  3848. int vector_height;
  3849. int ui_orientation;
  3850.  
  3851. int beam;
  3852. float vector_flicker;
  3853. float vector_intensity;
  3854. int translucency;
  3855. int antialias;
  3856.  
  3857. int use_artwork;
  3858. int artwork_res;
  3859. int artwork_crop;
  3860.  
  3861. const char * savegame;
  3862. int auto_save;
  3863. char * bios;
  3864.  
  3865. int debug_width;
  3866. int debug_height;
  3867. int debug_depth;
  3868.  
  3869. const char *controller;
  3870. # 241 "./src/mame.h"
  3871. };
  3872. # 251 "./src/mame.h"
  3873. extern global_options options;
  3874. extern running_machine *Machine;
  3875. extern const char *mame_disclaimer;
  3876. extern char giant_string_buffer[];
  3877.  
  3878. extern char build_version[];
  3879. # 268 "./src/mame.h"
  3880. int run_game(int game);
  3881.  
  3882.  
  3883. int mame_get_phase(void);
  3884.  
  3885.  
  3886. void add_exit_callback(void (*callback)(void));
  3887.  
  3888.  
  3889. void add_reset_callback(void (*callback)(void));
  3890.  
  3891.  
  3892. void add_pause_callback(void (*callback)(int));
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899. void mame_schedule_exit(void);
  3900.  
  3901.  
  3902. void mame_schedule_hard_reset(void);
  3903.  
  3904.  
  3905. void mame_schedule_soft_reset(void);
  3906.  
  3907.  
  3908. void mame_schedule_save(const char *filename);
  3909.  
  3910.  
  3911. void mame_schedule_load(const char *filename);
  3912.  
  3913.  
  3914. int mame_is_scheduled_event_pending(void);
  3915.  
  3916.  
  3917. void mame_pause(int pause);
  3918.  
  3919.  
  3920. int mame_is_paused(void);
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927. int new_memory_region(int type, size_t length, UINT32 flags);
  3928.  
  3929.  
  3930. void free_memory_region(int num);
  3931.  
  3932.  
  3933. UINT8 *memory_region(int num);
  3934.  
  3935.  
  3936. size_t memory_region_length(int num);
  3937.  
  3938.  
  3939. UINT32 memory_region_type(int num);
  3940.  
  3941.  
  3942. UINT32 memory_region_flags(int num);
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949. void begin_resource_tracking(void);
  3950.  
  3951.  
  3952. void end_resource_tracking(void);
  3953.  
  3954.  
  3955. static __inline__ int get_resource_tag(void)
  3956. {
  3957. extern int resource_tracking_tag;
  3958. return resource_tracking_tag;
  3959. }
  3960.  
  3961.  
  3962.  
  3963. void *_malloc_or_die(size_t size, const char *file, int line) __attribute__((malloc));
  3964.  
  3965.  
  3966.  
  3967. void *_auto_malloc(size_t size, const char *file, int line) __attribute__((malloc));
  3968.  
  3969.  
  3970. char *auto_strdup(const char *str) __attribute__((malloc));
  3971.  
  3972.  
  3973.  
  3974.  
  3975.  
  3976.  
  3977. void logerror(const char *text,...) __attribute__((format(printf, 1, 2)));
  3978.  
  3979.  
  3980. void add_logerror_callback(void (*callback)(const char *));
  3981.  
  3982.  
  3983. UINT32 mame_rand(void);
  3984.  
  3985.  
  3986. int mame_find_cpu_index(const char *tag);
  3987. # 18 "./src/debugger.h" 2
  3988. # 46 "./src/debugger.h"
  3989. void mame_debug_init(void);
  3990.  
  3991.  
  3992. void mame_debug_hook(void);
  3993.  
  3994.  
  3995. void mame_debug_break(void);
  3996. # 105 "src/cpu/sh2/sh2.c" 2
  3997. # 1 "src/cpu/sh2/sh2.h" 1
  3998. # 31 "src/cpu/sh2/sh2.h"
  3999. # 1 "./src/cpuintrf.h" 1
  4000. # 12 "./src/cpuintrf.h"
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006. # 1 "./src/memory.h" 1
  4007. # 12 "./src/memory.h"
  4008.  
  4009. # 52 "./src/memory.h"
  4010. typedef UINT32 offs_t;
  4011.  
  4012.  
  4013. typedef UINT8 (*read8_handler) (__attribute__((__unused__)) offs_t offset);
  4014. typedef void (*write8_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
  4015. typedef UINT16 (*read16_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
  4016. typedef void (*write16_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
  4017. typedef UINT32 (*read32_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
  4018. typedef void (*write32_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask);
  4019. typedef UINT64 (*read64_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask);
  4020. typedef void (*write64_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask);
  4021. typedef offs_t (*opbase_handler) (__attribute__((__unused__)) offs_t address);
  4022.  
  4023.  
  4024. struct _data_accessors
  4025. {
  4026. UINT8 (*read_byte)(offs_t offset);
  4027. UINT16 (*read_word)(offs_t offset);
  4028. UINT32 (*read_dword)(offs_t offset);
  4029. UINT64 (*read_qword)(offs_t offset);
  4030.  
  4031. void (*write_byte)(offs_t offset, UINT8 data);
  4032. void (*write_word)(offs_t offset, UINT16 data);
  4033. void (*write_dword)(offs_t offset, UINT32 data);
  4034. void (*write_qword)(offs_t offset, UINT64 data);
  4035. };
  4036. typedef struct _data_accessors data_accessors;
  4037. # 552 "./src/memory.h"
  4038. typedef struct _handler_data handler_data;
  4039.  
  4040.  
  4041. union _read_handlers
  4042. {
  4043. genf * handler;
  4044. read8_handler handler8;
  4045. read16_handler handler16;
  4046. read32_handler handler32;
  4047. read64_handler handler64;
  4048. };
  4049. typedef union _read_handlers read_handlers;
  4050.  
  4051.  
  4052. union _write_handlers
  4053. {
  4054. genf * handler;
  4055. write8_handler handler8;
  4056. write16_handler handler16;
  4057. write32_handler handler32;
  4058. write64_handler handler64;
  4059. };
  4060. typedef union _write_handlers write_handlers;
  4061.  
  4062.  
  4063. struct _address_map
  4064. {
  4065. UINT32 flags;
  4066. offs_t start, end;
  4067. offs_t mirror;
  4068. offs_t mask;
  4069. read_handlers read;
  4070. const char * read_name;
  4071. write_handlers write;
  4072. const char * write_name;
  4073. void * memory;
  4074. UINT32 share;
  4075. void ** base;
  4076. size_t * size;
  4077. UINT32 region;
  4078. offs_t region_offs;
  4079. };
  4080. typedef struct _address_map address_map;
  4081.  
  4082.  
  4083. struct _address_space
  4084. {
  4085. offs_t addrmask;
  4086. UINT8 * readlookup;
  4087. UINT8 * writelookup;
  4088. handler_data * readhandlers;
  4089. handler_data * writehandlers;
  4090. data_accessors * accessors;
  4091. };
  4092. typedef struct _address_space address_space;
  4093. # 617 "./src/memory.h"
  4094. typedef address_map *(*construct_map_t)(address_map *map);
  4095. # 731 "./src/memory.h"
  4096. extern const char *address_space_names[3];
  4097. # 772 "./src/memory.h"
  4098. UINT8 program_read_byte_8(offs_t address);
  4099. void program_write_byte_8(offs_t address, UINT8 data);
  4100.  
  4101. UINT8 program_read_byte_16be(offs_t address);
  4102. UINT16 program_read_word_16be(offs_t address);
  4103. void program_write_byte_16be(offs_t address, UINT8 data);
  4104. void program_write_word_16be(offs_t address, UINT16 data);
  4105.  
  4106. UINT8 program_read_byte_16le(offs_t address);
  4107. UINT16 program_read_word_16le(offs_t address);
  4108. void program_write_byte_16le(offs_t address, UINT8 data);
  4109. void program_write_word_16le(offs_t address, UINT16 data);
  4110.  
  4111. UINT8 program_read_byte_32be(offs_t address);
  4112. UINT16 program_read_word_32be(offs_t address);
  4113. UINT32 program_read_dword_32be(offs_t address);
  4114. void program_write_byte_32be(offs_t address, UINT8 data);
  4115. void program_write_word_32be(offs_t address, UINT16 data);
  4116. void program_write_dword_32be(offs_t address, UINT32 data);
  4117.  
  4118. UINT8 program_read_byte_32le(offs_t address);
  4119. UINT16 program_read_word_32le(offs_t address);
  4120. UINT32 program_read_dword_32le(offs_t address);
  4121. void program_write_byte_32le(offs_t address, UINT8 data);
  4122. void program_write_word_32le(offs_t address, UINT16 data);
  4123. void program_write_dword_32le(offs_t address, UINT32 data);
  4124.  
  4125. UINT8 program_read_byte_64be(offs_t address);
  4126. UINT16 program_read_word_64be(offs_t address);
  4127. UINT32 program_read_dword_64be(offs_t address);
  4128. UINT64 program_read_qword_64be(offs_t address);
  4129. void program_write_byte_64be(offs_t address, UINT8 data);
  4130. void program_write_word_64be(offs_t address, UINT16 data);
  4131. void program_write_dword_64be(offs_t address, UINT32 data);
  4132. void program_write_qword_64be(offs_t address, UINT64 data);
  4133.  
  4134. UINT8 program_read_byte_64le(offs_t address);
  4135. UINT16 program_read_word_64le(offs_t address);
  4136. UINT32 program_read_dword_64le(offs_t address);
  4137. UINT64 program_read_qword_64le(offs_t address);
  4138. void program_write_byte_64le(offs_t address, UINT8 data);
  4139. void program_write_word_64le(offs_t address, UINT16 data);
  4140. void program_write_dword_64le(offs_t address, UINT32 data);
  4141. void program_write_qword_64le(offs_t address, UINT64 data);
  4142.  
  4143.  
  4144. UINT8 data_read_byte_8(offs_t address);
  4145. void data_write_byte_8(offs_t address, UINT8 data);
  4146.  
  4147. UINT8 data_read_byte_16be(offs_t address);
  4148. UINT16 data_read_word_16be(offs_t address);
  4149. void data_write_byte_16be(offs_t address, UINT8 data);
  4150. void data_write_word_16be(offs_t address, UINT16 data);
  4151.  
  4152. UINT8 data_read_byte_16le(offs_t address);
  4153. UINT16 data_read_word_16le(offs_t address);
  4154. void data_write_byte_16le(offs_t address, UINT8 data);
  4155. void data_write_word_16le(offs_t address, UINT16 data);
  4156.  
  4157. UINT8 data_read_byte_32be(offs_t address);
  4158. UINT16 data_read_word_32be(offs_t address);
  4159. UINT32 data_read_dword_32be(offs_t address);
  4160. void data_write_byte_32be(offs_t address, UINT8 data);
  4161. void data_write_word_32be(offs_t address, UINT16 data);
  4162. void data_write_dword_32be(offs_t address, UINT32 data);
  4163.  
  4164. UINT8 data_read_byte_32le(offs_t address);
  4165. UINT16 data_read_word_32le(offs_t address);
  4166. UINT32 data_read_dword_32le(offs_t address);
  4167. void data_write_byte_32le(offs_t address, UINT8 data);
  4168. void data_write_word_32le(offs_t address, UINT16 data);
  4169. void data_write_dword_32le(offs_t address, UINT32 data);
  4170.  
  4171. UINT8 data_read_byte_64be(offs_t address);
  4172. UINT16 data_read_word_64be(offs_t address);
  4173. UINT32 data_read_dword_64be(offs_t address);
  4174. UINT64 data_read_qword_64be(offs_t address);
  4175. void data_write_byte_64be(offs_t address, UINT8 data);
  4176. void data_write_word_64be(offs_t address, UINT16 data);
  4177. void data_write_dword_64be(offs_t address, UINT32 data);
  4178. void data_write_qword_64be(offs_t address, UINT64 data);
  4179.  
  4180. UINT8 data_read_byte_64le(offs_t address);
  4181. UINT16 data_read_word_64le(offs_t address);
  4182. UINT32 data_read_dword_64le(offs_t address);
  4183. UINT64 data_read_qword_64le(offs_t address);
  4184. void data_write_byte_64le(offs_t address, UINT8 data);
  4185. void data_write_word_64le(offs_t address, UINT16 data);
  4186. void data_write_dword_64le(offs_t address, UINT32 data);
  4187. void data_write_qword_64le(offs_t address, UINT64 data);
  4188.  
  4189.  
  4190. UINT8 io_read_byte_8(offs_t address);
  4191. void io_write_byte_8(offs_t address, UINT8 data);
  4192.  
  4193. UINT8 io_read_byte_16be(offs_t address);
  4194. UINT16 io_read_word_16be(offs_t address);
  4195. void io_write_byte_16be(offs_t address, UINT8 data);
  4196. void io_write_word_16be(offs_t address, UINT16 data);
  4197.  
  4198. UINT8 io_read_byte_16le(offs_t address);
  4199. UINT16 io_read_word_16le(offs_t address);
  4200. void io_write_byte_16le(offs_t address, UINT8 data);
  4201. void io_write_word_16le(offs_t address, UINT16 data);
  4202.  
  4203. UINT8 io_read_byte_32be(offs_t address);
  4204. UINT16 io_read_word_32be(offs_t address);
  4205. UINT32 io_read_dword_32be(offs_t address);
  4206. void io_write_byte_32be(offs_t address, UINT8 data);
  4207. void io_write_word_32be(offs_t address, UINT16 data);
  4208. void io_write_dword_32be(offs_t address, UINT32 data);
  4209.  
  4210. UINT8 io_read_byte_32le(offs_t address);
  4211. UINT16 io_read_word_32le(offs_t address);
  4212. UINT32 io_read_dword_32le(offs_t address);
  4213. void io_write_byte_32le(offs_t address, UINT8 data);
  4214. void io_write_word_32le(offs_t address, UINT16 data);
  4215. void io_write_dword_32le(offs_t address, UINT32 data);
  4216.  
  4217. UINT8 io_read_byte_64be(offs_t address);
  4218. UINT16 io_read_word_64be(offs_t address);
  4219. UINT32 io_read_dword_64be(offs_t address);
  4220. UINT64 io_read_qword_64be(offs_t address);
  4221. void io_write_byte_64be(offs_t address, UINT8 data);
  4222. void io_write_word_64be(offs_t address, UINT16 data);
  4223. void io_write_dword_64be(offs_t address, UINT32 data);
  4224. void io_write_qword_64be(offs_t address, UINT64 data);
  4225.  
  4226. UINT8 io_read_byte_64le(offs_t address);
  4227. UINT16 io_read_word_64le(offs_t address);
  4228. UINT32 io_read_dword_64le(offs_t address);
  4229. UINT64 io_read_qword_64le(offs_t address);
  4230. void io_write_byte_64le(offs_t address, UINT8 data);
  4231. void io_write_word_64le(offs_t address, UINT16 data);
  4232. void io_write_dword_64le(offs_t address, UINT32 data);
  4233. void io_write_qword_64le(offs_t address, UINT64 data);
  4234. # 918 "./src/memory.h"
  4235. int memory_init(void);
  4236. void memory_exit(void);
  4237. void memory_set_context(int activecpu);
  4238.  
  4239.  
  4240. const address_map *memory_get_map(int cpunum, int spacenum);
  4241.  
  4242.  
  4243. opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function);
  4244. void memory_set_opbase(offs_t offset);
  4245.  
  4246.  
  4247. void memory_set_decrypted_region(int cpunum, offs_t start, offs_t end, void *base);
  4248.  
  4249.  
  4250. void * memory_get_read_ptr(int cpunum, int spacenum, offs_t offset);
  4251. void * memory_get_write_ptr(int cpunum, int spacenum, offs_t offset);
  4252. void * memory_get_op_ptr(int cpunum, offs_t offset, int arg);
  4253.  
  4254.  
  4255. void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride);
  4256. void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride);
  4257. void memory_set_bank(int banknum, int entrynum);
  4258. void memory_set_bankptr(int banknum, void *base);
  4259.  
  4260.  
  4261. void memory_set_debugger_access(int debugger);
  4262. void memory_set_log_unmap(int spacenum, int log);
  4263. int memory_get_log_unmap(int spacenum);
  4264.  
  4265.  
  4266. void * _memory_install_read_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, int handler, const char *handler_name);
  4267. UINT8 * _memory_install_read8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name);
  4268. UINT16 * _memory_install_read16_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name);
  4269. UINT32 * _memory_install_read32_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name);
  4270. UINT64 * _memory_install_read64_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name);
  4271. void * _memory_install_write_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, int handler, const char *handler_name);
  4272. UINT8 * _memory_install_write8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name);
  4273. UINT16 * _memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name);
  4274. UINT32 * _memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name);
  4275. UINT64 * _memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name);
  4276.  
  4277. void * _memory_install_read_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, int handler, const char *handler_name);
  4278. UINT8 * _memory_install_read8_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name);
  4279. UINT16 * _memory_install_read16_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name);
  4280. UINT32 * _memory_install_read32_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name);
  4281. UINT64 * _memory_install_read64_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name);
  4282. void * _memory_install_write_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, int handler, const char *handler_name);
  4283. UINT8 * _memory_install_write8_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name);
  4284. UINT16 * _memory_install_write16_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name);
  4285. UINT32 * _memory_install_write32_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name);
  4286. UINT64 * _memory_install_write64_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name);
  4287.  
  4288.  
  4289. void memory_dump(FILE *file);
  4290. const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset);
  4291. # 983 "./src/memory.h"
  4292. extern UINT8 opcode_entry;
  4293. extern UINT8 * opcode_base;
  4294. extern UINT8 * opcode_arg_base;
  4295. extern offs_t opcode_mask;
  4296. extern offs_t opcode_memory_min;
  4297. extern offs_t opcode_memory_max;
  4298. extern address_space active_address_space[];
  4299. extern address_map * construct_map_0(address_map *map);
  4300. # 1072 "./src/memory.h"
  4301. static __inline__ UINT8 program_read_byte (offs_t offset) { return (*active_address_space[0].accessors->read_byte)(offset); }
  4302. static __inline__ UINT16 program_read_word (offs_t offset) { return (*active_address_space[0].accessors->read_word)(offset); }
  4303. static __inline__ UINT32 program_read_dword(offs_t offset) { return (*active_address_space[0].accessors->read_dword)(offset); }
  4304. static __inline__ UINT64 program_read_qword(offs_t offset) { return (*active_address_space[0].accessors->read_qword)(offset); }
  4305.  
  4306. static __inline__ void program_write_byte (offs_t offset, UINT8 data) { (*active_address_space[0].accessors->write_byte)(offset, data); }
  4307. static __inline__ void program_write_word (offs_t offset, UINT16 data) { (*active_address_space[0].accessors->write_word)(offset, data); }
  4308. static __inline__ void program_write_dword(offs_t offset, UINT32 data) { (*active_address_space[0].accessors->write_dword)(offset, data); }
  4309. static __inline__ void program_write_qword(offs_t offset, UINT64 data) { (*active_address_space[0].accessors->write_qword)(offset, data); }
  4310.  
  4311. static __inline__ UINT8 data_read_byte (offs_t offset) { return (*active_address_space[1].accessors->read_byte)(offset); }
  4312. static __inline__ UINT16 data_read_word (offs_t offset) { return (*active_address_space[1].accessors->read_word)(offset); }
  4313. static __inline__ UINT32 data_read_dword(offs_t offset) { return (*active_address_space[1].accessors->read_dword)(offset); }
  4314. static __inline__ UINT64 data_read_qword(offs_t offset) { return (*active_address_space[1].accessors->read_qword)(offset); }
  4315.  
  4316. static __inline__ void data_write_byte (offs_t offset, UINT8 data) { (*active_address_space[1].accessors->write_byte)(offset, data); }
  4317. static __inline__ void data_write_word (offs_t offset, UINT16 data) { (*active_address_space[1].accessors->write_word)(offset, data); }
  4318. static __inline__ void data_write_dword(offs_t offset, UINT32 data) { (*active_address_space[1].accessors->write_dword)(offset, data); }
  4319. static __inline__ void data_write_qword(offs_t offset, UINT64 data) { (*active_address_space[1].accessors->write_qword)(offset, data); }
  4320.  
  4321. static __inline__ UINT8 io_read_byte (offs_t offset) { return (*active_address_space[2].accessors->read_byte)(offset); }
  4322. static __inline__ UINT16 io_read_word (offs_t offset) { return (*active_address_space[2].accessors->read_word)(offset); }
  4323. static __inline__ UINT32 io_read_dword(offs_t offset) { return (*active_address_space[2].accessors->read_dword)(offset); }
  4324. static __inline__ UINT64 io_read_qword(offs_t offset) { return (*active_address_space[2].accessors->read_qword)(offset); }
  4325.  
  4326. static __inline__ void io_write_byte (offs_t offset, UINT8 data) { (*active_address_space[2].accessors->write_byte)(offset, data); }
  4327. static __inline__ void io_write_word (offs_t offset, UINT16 data) { (*active_address_space[2].accessors->write_word)(offset, data); }
  4328. static __inline__ void io_write_dword(offs_t offset, UINT32 data) { (*active_address_space[2].accessors->write_dword)(offset, data); }
  4329. static __inline__ void io_write_qword(offs_t offset, UINT64 data) { (*active_address_space[2].accessors->write_qword)(offset, data); }
  4330.  
  4331.  
  4332. UINT8 cpu_readop_safe(offs_t offset);
  4333. UINT16 cpu_readop16_safe(offs_t offset);
  4334. UINT32 cpu_readop32_safe(offs_t offset);
  4335. UINT64 cpu_readop64_safe(offs_t offset);
  4336. UINT8 cpu_readop_arg_safe(offs_t offset);
  4337. UINT16 cpu_readop_arg16_safe(offs_t offset);
  4338. UINT32 cpu_readop_arg32_safe(offs_t offset);
  4339. UINT64 cpu_readop_arg64_safe(offs_t offset);
  4340. # 1124 "./src/memory.h"
  4341. static __inline__ void * cpu_opptr(offs_t A) { if ((0)) { memory_set_opbase(A); } return ((void *)&opcode_base[(A) & opcode_mask]); }
  4342. static __inline__ UINT8 cpu_readop(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_base[(A) & opcode_mask]); }
  4343. static __inline__ UINT16 cpu_readop16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_base[(A) & opcode_mask]); }
  4344. static __inline__ UINT32 cpu_readop32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_base[(A) & opcode_mask]); }
  4345. static __inline__ UINT64 cpu_readop64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_base[(A) & opcode_mask]); }
  4346. static __inline__ UINT8 cpu_readop_arg(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_arg_base[(A) & opcode_mask]); }
  4347. static __inline__ UINT16 cpu_readop_arg16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_arg_base[(A) & opcode_mask]); }
  4348. static __inline__ UINT32 cpu_readop_arg32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_arg_base[(A) & opcode_mask]); }
  4349. static __inline__ UINT64 cpu_readop_arg64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_arg_base[(A) & opcode_mask]); }
  4350. # 18 "./src/cpuintrf.h" 2
  4351. # 1 "./src/cpuint.h" 1
  4352. # 12 "./src/cpuint.h"
  4353.  
  4354. # 29 "./src/cpuint.h"
  4355. int cpuint_init(void);
  4356.  
  4357. void cpuint_reset(void);
  4358.  
  4359. extern int (*cpu_irq_callbacks[])(int);
  4360. # 44 "./src/cpuint.h"
  4361. void cpunum_set_input_line(int cpunum, int line, int state);
  4362.  
  4363.  
  4364. void cpunum_set_input_line_vector(int cpunum, int irqline, int vector);
  4365.  
  4366.  
  4367. void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector);
  4368.  
  4369.  
  4370. void cpunum_set_irq_callback(int cpunum, int (*callback)(int irqline));
  4371. # 19 "./src/cpuintrf.h" 2
  4372. # 1 "./src/cpuexec.h" 1
  4373. # 12 "./src/cpuexec.h"
  4374.  
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380. # 1 "./src/timer.h" 1
  4381. # 13 "./src/timer.h"
  4382.  
  4383. # 94 "./src/timer.h"
  4384. typedef struct _mame_timer mame_timer;
  4385.  
  4386.  
  4387. typedef INT64 subseconds_t;
  4388. typedef INT32 seconds_t;
  4389.  
  4390. typedef struct _mame_time mame_time;
  4391. struct _mame_time
  4392. {
  4393. seconds_t seconds;
  4394. subseconds_t subseconds;
  4395. };
  4396. # 114 "./src/timer.h"
  4397. extern mame_time time_zero;
  4398. extern mame_time time_never;
  4399.  
  4400.  
  4401. extern subseconds_t subseconds_per_cycle[];
  4402. extern UINT32 cycles_per_second[];
  4403. extern double cycles_to_sec[];
  4404. extern double sec_to_cycles[];
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412. void timer_init(void);
  4413. void timer_free(void);
  4414. int timer_count_anonymous(void);
  4415.  
  4416. mame_time mame_timer_next_fire_time(void);
  4417. void mame_timer_set_global_time(mame_time newbase);
  4418. mame_timer *_mame_timer_alloc(void (*callback)(int), const char *file, int line, const char *func);
  4419. mame_timer *_mame_timer_alloc_ptr(void (*callback)(void *), void *param, const char *file, int line, const char *func);
  4420. void mame_timer_adjust(mame_timer *which, mame_time duration, INT32 param, mame_time period);
  4421. void mame_timer_adjust_ptr(mame_timer *which, mame_time duration, mame_time period);
  4422. void _mame_timer_pulse(mame_time period, INT32 param, void (*callback)(int), const char *file, int line, const char *func);
  4423. void _mame_timer_pulse_ptr(mame_time period, void *param, void (*callback)(void *), const char *file, int line, const char *func);
  4424. void _mame_timer_set(mame_time duration, INT32 param, void (*callback)(int), const char *file, int line, const char *func);
  4425. void _mame_timer_set_ptr(mame_time duration, void *param, void (*callback)(void *), const char *file, int line, const char *func);
  4426. void mame_timer_reset(mame_timer *which, mame_time duration);
  4427. int mame_timer_enable(mame_timer *which, int enable);
  4428. mame_time mame_timer_timeelapsed(mame_timer *which);
  4429. mame_time mame_timer_timeleft(mame_timer *which);
  4430. mame_time mame_timer_get_time(void);
  4431. mame_time mame_timer_starttime(mame_timer *which);
  4432. mame_time mame_timer_firetime(mame_timer *which);
  4433. # 162 "./src/timer.h"
  4434. static __inline__ mame_time make_mame_time(seconds_t _secs, subseconds_t _subsecs)
  4435. {
  4436. mame_time result;
  4437. result.seconds = _secs;
  4438. result.subseconds = _subsecs;
  4439. return result;
  4440. }
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448. static __inline__ double mame_time_to_double(mame_time _time)
  4449. {
  4450. return (double)_time.seconds + ((double)(_time.subseconds) * (1.0 / (double)((subseconds_t)1000000000 * (subseconds_t)1000000000)));
  4451. }
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459. static __inline__ mame_time double_to_mame_time(double _time)
  4460. {
  4461. mame_time abstime;
  4462.  
  4463.  
  4464. if (_time >= (1.0e30))
  4465. return time_never;
  4466.  
  4467.  
  4468. abstime.seconds = (seconds_t)_time;
  4469.  
  4470.  
  4471. _time -= (double)abstime.seconds;
  4472. abstime.subseconds = ((subseconds_t)((_time) * (double)((subseconds_t)1000000000 * (subseconds_t)1000000000)));
  4473. return abstime;
  4474. }
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481. static __inline__ mame_time add_mame_times(mame_time _time1, mame_time _time2)
  4482. {
  4483. mame_time result;
  4484.  
  4485.  
  4486. if (_time1.seconds >= ((seconds_t)1000000000) || _time2.seconds >= ((seconds_t)1000000000))
  4487. return time_never;
  4488.  
  4489.  
  4490. result.subseconds = _time1.subseconds + _time2.subseconds;
  4491. result.seconds = _time1.seconds + _time2.seconds;
  4492.  
  4493.  
  4494. if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000))
  4495. {
  4496. result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000);
  4497. result.seconds++;
  4498. }
  4499. return result;
  4500. }
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508. static __inline__ mame_time add_subseconds_to_mame_time(mame_time _time1, subseconds_t _subseconds)
  4509. {
  4510. mame_time result;
  4511.  
  4512.  
  4513. if (_time1.seconds >= ((seconds_t)1000000000))
  4514. return time_never;
  4515.  
  4516.  
  4517. result.subseconds = _time1.subseconds + _subseconds;
  4518. result.seconds = _time1.seconds;
  4519.  
  4520.  
  4521. if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000))
  4522. {
  4523. result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000);
  4524. result.seconds++;
  4525. }
  4526. return result;
  4527. }
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534. static __inline__ mame_time sub_mame_times(mame_time _time1, mame_time _time2)
  4535. {
  4536. mame_time result;
  4537.  
  4538.  
  4539. if (_time1.seconds >= ((seconds_t)1000000000))
  4540. return time_never;
  4541.  
  4542.  
  4543. result.subseconds = _time1.subseconds - _time2.subseconds;
  4544. result.seconds = _time1.seconds - _time2.seconds;
  4545.  
  4546.  
  4547. if (result.subseconds < 0)
  4548. {
  4549. result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000);
  4550. result.seconds--;
  4551. }
  4552. return result;
  4553. }
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561. static __inline__ mame_time sub_subseconds_from_mame_time(mame_time _time1, subseconds_t _subseconds)
  4562. {
  4563. mame_time result;
  4564.  
  4565.  
  4566. if (_time1.seconds >= ((seconds_t)1000000000))
  4567. return time_never;
  4568.  
  4569.  
  4570. result.subseconds = _time1.subseconds - _subseconds;
  4571. result.seconds = _time1.seconds;
  4572.  
  4573.  
  4574. if (result.subseconds < 0)
  4575. {
  4576. result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000);
  4577. result.seconds--;
  4578. }
  4579. return result;
  4580. }
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587. static __inline__ int compare_mame_times(mame_time _time1, mame_time _time2)
  4588. {
  4589. if (_time1.seconds > _time2.seconds)
  4590. return 1;
  4591. if (_time1.seconds < _time2.seconds)
  4592. return -1;
  4593. if (_time1.subseconds > _time2.subseconds)
  4594. return 1;
  4595. if (_time1.subseconds < _time2.subseconds)
  4596. return -1;
  4597. return 0;
  4598. }
  4599. # 19 "./src/cpuexec.h" 2
  4600. # 28 "./src/cpuexec.h"
  4601. typedef struct _cpu_config cpu_config;
  4602. struct _cpu_config
  4603. {
  4604. int cpu_type;
  4605. int cpu_flags;
  4606. int cpu_clock;
  4607. construct_map_t construct_map[3][2];
  4608. void (*vblank_interrupt)(void);
  4609. int vblank_interrupts_per_frame;
  4610. void (*timed_interrupt)(void);
  4611. double timed_interrupt_period;
  4612. void * reset_param;
  4613. const char *tag;
  4614. };
  4615. # 51 "./src/cpuexec.h"
  4616. enum
  4617. {
  4618.  
  4619.  
  4620. CPU_DISABLE = 0x0001
  4621. };
  4622. # 68 "./src/cpuexec.h"
  4623. int cpuexec_init(void);
  4624.  
  4625.  
  4626. void cpuexec_timeslice(void);
  4627. # 82 "./src/cpuexec.h"
  4628. void watchdog_reset(void);
  4629.  
  4630.  
  4631.  
  4632. void watchdog_enable(int enable);
  4633. # 97 "./src/cpuexec.h"
  4634. enum
  4635. {
  4636. SUSPEND_REASON_HALT = 0x0001,
  4637. SUSPEND_REASON_RESET = 0x0002,
  4638. SUSPEND_REASON_SPIN = 0x0004,
  4639. SUSPEND_REASON_TRIGGER = 0x0008,
  4640. SUSPEND_REASON_DISABLE = 0x0010,
  4641. SUSPEND_ANY_REASON = ~0
  4642. };
  4643.  
  4644.  
  4645. void cpunum_suspend(int cpunum, int reason, int eatcycles);
  4646.  
  4647.  
  4648. void cpunum_resume(int cpunum, int reason);
  4649.  
  4650.  
  4651. int cpunum_is_suspended(int cpunum, int reason);
  4652.  
  4653.  
  4654. void activecpu_abort_timeslice(void);
  4655.  
  4656.  
  4657. mame_time cpunum_get_localtime(int cpunum);
  4658.  
  4659.  
  4660.  
  4661.  
  4662. int cpunum_get_clock(int cpunum);
  4663.  
  4664.  
  4665. void cpunum_set_clock(int cpunum, int clock);
  4666. void cpunum_set_clock_period(int cpunum, subseconds_t clock_period);
  4667.  
  4668.  
  4669. double cpunum_get_clockscale(int cpunum);
  4670.  
  4671.  
  4672. void cpunum_set_clockscale(int cpunum, double clockscale);
  4673.  
  4674.  
  4675. void cpu_boost_interleave(double timeslice_time, double boost_duration);
  4676. # 149 "./src/cpuexec.h"
  4677. int cycles_currently_ran(void);
  4678.  
  4679.  
  4680. int cycles_left_to_run(void);
  4681.  
  4682.  
  4683. UINT32 activecpu_gettotalcycles(void);
  4684. UINT64 activecpu_gettotalcycles64(void);
  4685.  
  4686.  
  4687. UINT32 cpunum_gettotalcycles(int cpunum);
  4688. UINT64 cpunum_gettotalcycles64(int cpunum);
  4689.  
  4690.  
  4691. int activecpu_geticount(void);
  4692.  
  4693.  
  4694. void activecpu_eat_cycles(int cycles);
  4695.  
  4696.  
  4697. int cpu_scalebyfcount(int value);
  4698. # 180 "./src/cpuexec.h"
  4699. void cpu_compute_scanline_timing(void);
  4700.  
  4701.  
  4702. int cpu_getcurrentframe(void);
  4703.  
  4704.  
  4705. int cpu_getscanline(void);
  4706.  
  4707.  
  4708. mame_time cpu_getscanlinetime_mt(int scanline);
  4709. double cpu_getscanlinetime(int scanline);
  4710.  
  4711.  
  4712. mame_time cpu_getscanlineperiod_mt(void);
  4713. double cpu_getscanlineperiod(void);
  4714.  
  4715.  
  4716. int cpu_gethorzbeampos(void);
  4717.  
  4718.  
  4719. int cpu_getvblank(void);
  4720. # 211 "./src/cpuexec.h"
  4721. void cpu_trigger(int trigger);
  4722.  
  4723.  
  4724. void cpu_triggertime(double duration, int trigger);
  4725.  
  4726.  
  4727. void cpu_triggerint(int cpunum);
  4728.  
  4729.  
  4730. void cpu_spinuntil_trigger(int trigger);
  4731.  
  4732.  
  4733. void cpunum_spinuntil_trigger( int cpunum, int trigger );
  4734.  
  4735.  
  4736. void cpu_yielduntil_trigger(int trigger);
  4737.  
  4738.  
  4739. void cpu_spinuntil_int(void);
  4740.  
  4741.  
  4742. void cpu_yielduntil_int(void);
  4743.  
  4744.  
  4745. void cpu_spin(void);
  4746.  
  4747.  
  4748. void cpu_yield(void);
  4749.  
  4750.  
  4751. void cpu_spinuntil_time(double duration);
  4752.  
  4753.  
  4754. void cpu_yielduntil_time(double duration);
  4755. # 259 "./src/cpuexec.h"
  4756. int cpu_getiloops(void);
  4757. # 20 "./src/cpuintrf.h" 2
  4758. # 1 "./src/state.h" 1
  4759. # 12 "./src/state.h"
  4760.  
  4761. # 75 "./src/state.h"
  4762. void state_init(void);
  4763.  
  4764.  
  4765. void state_save_free(void);
  4766. void state_save_allow_registration(int allowed);
  4767. int state_save_registration_allowed(void);
  4768.  
  4769.  
  4770. int state_save_get_reg_count(void);
  4771.  
  4772. void state_save_register_memory(const char *module, UINT32 instance, const char *name, void *val, UINT32 valsize, UINT32 valcount);
  4773. void state_save_register_bitmap(const char *module, UINT32 instance, const char *name, mame_bitmap *val);
  4774.  
  4775. void state_save_register_func_presave(void (*func)(void));
  4776. void state_save_register_func_postload(void (*func)(void));
  4777.  
  4778. void state_save_register_func_presave_int(void (*func)(int), int param);
  4779. void state_save_register_func_postload_int(void (*func)(int), int param);
  4780.  
  4781. void state_save_register_func_presave_ptr(void (*func)(void *), void *param);
  4782. void state_save_register_func_postload_ptr(void (*func)(void *), void *param);
  4783.  
  4784.  
  4785.  
  4786. int state_save_save_begin(mame_file *file);
  4787. int state_save_load_begin(mame_file *file);
  4788.  
  4789. void state_save_push_tag(int tag);
  4790. void state_save_pop_tag(void);
  4791.  
  4792. void state_save_save_continue(void);
  4793. void state_save_load_continue(void);
  4794.  
  4795. void state_save_save_finish(void);
  4796. void state_save_load_finish(void);
  4797.  
  4798.  
  4799. void state_save_dump_registry(void);
  4800.  
  4801. const char *state_save_get_indexed_item(int index, void **base, UINT32 *valsize, UINT32 *valcount);
  4802.  
  4803.  
  4804. int state_save_check_file(mame_file *file, const char *gamename, int validate_signature, void ( *errormsg)(const char *fmt, ...));
  4805. # 21 "./src/cpuintrf.h" 2
  4806. # 30 "./src/cpuintrf.h"
  4807. enum
  4808. {
  4809. CPU_DUMMY,
  4810. CPU_Z80,
  4811. CPU_Z180,
  4812. CPU_8080,
  4813. CPU_8085A,
  4814. CPU_M6502,
  4815. CPU_M65C02,
  4816. CPU_M65SC02,
  4817. CPU_M65CE02,
  4818. CPU_M6509,
  4819. CPU_M6510,
  4820. CPU_M6510T,
  4821. CPU_M7501,
  4822. CPU_M8502,
  4823. CPU_N2A03,
  4824. CPU_DECO16,
  4825. CPU_M4510,
  4826. CPU_H6280,
  4827. CPU_I86,
  4828. CPU_I88,
  4829. CPU_I186,
  4830. CPU_I188,
  4831. CPU_I286,
  4832. CPU_V20,
  4833. CPU_V30,
  4834. CPU_V33,
  4835. CPU_V60,
  4836. CPU_V70,
  4837. CPU_I8035,
  4838. CPU_I8039,
  4839. CPU_I8048,
  4840. CPU_N7751,
  4841. CPU_I8X41,
  4842. CPU_I8051,
  4843. CPU_I8052,
  4844. CPU_I8751,
  4845. CPU_I8752,
  4846. CPU_M6800,
  4847. CPU_M6801,
  4848. CPU_M6802,
  4849. CPU_M6803,
  4850. CPU_M6808,
  4851. CPU_HD63701,
  4852. CPU_NSC8105,
  4853. CPU_M6805,
  4854. CPU_M68705,
  4855. CPU_HD63705,
  4856. CPU_HD6309,
  4857. CPU_M6809,
  4858. CPU_M6809E,
  4859. CPU_KONAMI,
  4860. CPU_M68000,
  4861. CPU_M68008,
  4862. CPU_M68010,
  4863. CPU_M68EC020,
  4864. CPU_M68020,
  4865. CPU_M68040,
  4866. CPU_T11,
  4867. CPU_S2650,
  4868. CPU_TMS34010,
  4869. CPU_TMS34020,
  4870. CPU_TI990_10,
  4871. CPU_TMS9900,
  4872. CPU_TMS9940,
  4873. CPU_TMS9980,
  4874. CPU_TMS9985,
  4875. CPU_TMS9989,
  4876. CPU_TMS9995,
  4877. CPU_TMS99100,
  4878. CPU_TMS99105A,
  4879. CPU_TMS99110A,
  4880. CPU_Z8000,
  4881. CPU_TMS32010,
  4882. CPU_TMS32025,
  4883. CPU_TMS32026,
  4884. CPU_TMS32031,
  4885. CPU_TMS32051,
  4886. CPU_CCPU,
  4887. CPU_ADSP2100,
  4888. CPU_ADSP2101,
  4889. CPU_ADSP2104,
  4890. CPU_ADSP2105,
  4891. CPU_ADSP2115,
  4892. CPU_ADSP2181,
  4893. CPU_PSXCPU,
  4894. CPU_ASAP,
  4895. CPU_UPD7810,
  4896. CPU_UPD7807,
  4897. CPU_JAGUARGPU,
  4898. CPU_JAGUARDSP,
  4899. CPU_R3000BE,
  4900. CPU_R3000LE,
  4901. CPU_R4600BE,
  4902. CPU_R4600LE,
  4903. CPU_R4650BE,
  4904. CPU_R4650LE,
  4905. CPU_R4700BE,
  4906. CPU_R4700LE,
  4907. CPU_R5000BE,
  4908. CPU_R5000LE,
  4909. CPU_QED5271BE,
  4910. CPU_QED5271LE,
  4911. CPU_RM7000BE,
  4912. CPU_RM7000LE,
  4913. CPU_ARM,
  4914. CPU_ARM7,
  4915. CPU_SH2,
  4916. CPU_DSP32C,
  4917. CPU_PIC16C54,
  4918. CPU_PIC16C55,
  4919. CPU_PIC16C56,
  4920. CPU_PIC16C57,
  4921. CPU_PIC16C58,
  4922. CPU_G65816,
  4923. CPU_SPC700,
  4924. CPU_E116T,
  4925. CPU_E116XT,
  4926. CPU_E116XS,
  4927. CPU_E116XSR,
  4928. CPU_E132N,
  4929. CPU_E132T,
  4930. CPU_E132XN,
  4931. CPU_E132XT,
  4932. CPU_E132XS,
  4933. CPU_E132XSR,
  4934. CPU_GMS30C2116,
  4935. CPU_GMS30C2132,
  4936. CPU_GMS30C2216,
  4937. CPU_GMS30C2232,
  4938. CPU_I386,
  4939. CPU_I486,
  4940. CPU_PENTIUM,
  4941. CPU_MEDIAGX,
  4942. CPU_I960,
  4943. CPU_H83002,
  4944. CPU_V810,
  4945. CPU_M37702,
  4946. CPU_M37710,
  4947. CPU_PPC403,
  4948. CPU_PPC602,
  4949. CPU_PPC603,
  4950. CPU_SE3208,
  4951. CPU_MC68HC11,
  4952. CPU_ADSP21062,
  4953. CPU_DSP56156,
  4954. CPU_RSP,
  4955. CPU_ALPHA8201,
  4956. CPU_ALPHA8301,
  4957. # 198 "./src/cpuintrf.h"
  4958. CPU_COUNT
  4959. };
  4960. # 209 "./src/cpuintrf.h"
  4961. enum
  4962. {
  4963.  
  4964. CLEAR_LINE = 0,
  4965. ASSERT_LINE,
  4966. HOLD_LINE,
  4967. PULSE_LINE,
  4968.  
  4969.  
  4970. INTERNAL_CLEAR_LINE = 100 + CLEAR_LINE,
  4971. INTERNAL_ASSERT_LINE = 100 + ASSERT_LINE,
  4972.  
  4973.  
  4974. MAX_INPUT_LINES = 32+3,
  4975. INPUT_LINE_IRQ0 = 0,
  4976. INPUT_LINE_IRQ1 = 1,
  4977. INPUT_LINE_IRQ2 = 2,
  4978. INPUT_LINE_IRQ3 = 3,
  4979. INPUT_LINE_IRQ4 = 4,
  4980. INPUT_LINE_IRQ5 = 5,
  4981. INPUT_LINE_IRQ6 = 6,
  4982. INPUT_LINE_IRQ7 = 7,
  4983. INPUT_LINE_IRQ8 = 8,
  4984. INPUT_LINE_IRQ9 = 9,
  4985. INPUT_LINE_NMI = MAX_INPUT_LINES - 3,
  4986.  
  4987.  
  4988. INPUT_LINE_RESET = MAX_INPUT_LINES - 2,
  4989. INPUT_LINE_HALT = MAX_INPUT_LINES - 1,
  4990.  
  4991.  
  4992. MAX_OUTPUT_LINES = 32
  4993. };
  4994. # 251 "./src/cpuintrf.h"
  4995. enum
  4996. {
  4997. MAX_REGS = 256
  4998. };
  4999.  
  5000.  
  5001. enum
  5002. {
  5003.  
  5004. CPUINFO_INT_FIRST = 0x00000,
  5005.  
  5006. CPUINFO_INT_CONTEXT_SIZE = CPUINFO_INT_FIRST,
  5007. CPUINFO_INT_INPUT_LINES,
  5008. CPUINFO_INT_OUTPUT_LINES,
  5009. CPUINFO_INT_DEFAULT_IRQ_VECTOR,
  5010. CPUINFO_INT_ENDIANNESS,
  5011. CPUINFO_INT_CLOCK_DIVIDER,
  5012. CPUINFO_INT_MIN_INSTRUCTION_BYTES,
  5013. CPUINFO_INT_MAX_INSTRUCTION_BYTES,
  5014. CPUINFO_INT_MIN_CYCLES,
  5015. CPUINFO_INT_MAX_CYCLES,
  5016.  
  5017. CPUINFO_INT_DATABUS_WIDTH,
  5018. CPUINFO_INT_DATABUS_WIDTH_LAST = CPUINFO_INT_DATABUS_WIDTH + 3 - 1,
  5019. CPUINFO_INT_ADDRBUS_WIDTH,
  5020. CPUINFO_INT_ADDRBUS_WIDTH_LAST = CPUINFO_INT_ADDRBUS_WIDTH + 3 - 1,
  5021. CPUINFO_INT_ADDRBUS_SHIFT,
  5022. CPUINFO_INT_ADDRBUS_SHIFT_LAST = CPUINFO_INT_ADDRBUS_SHIFT + 3 - 1,
  5023. CPUINFO_INT_LOGADDR_WIDTH,
  5024. CPUINFO_INT_LOGADDR_WIDTH_LAST = CPUINFO_INT_LOGADDR_WIDTH + 3 - 1,
  5025. CPUINFO_INT_PAGE_SHIFT,
  5026. CPUINFO_INT_PAGE_SHIFT_LAST = CPUINFO_INT_PAGE_SHIFT + 3 - 1,
  5027.  
  5028. CPUINFO_INT_SP,
  5029. CPUINFO_INT_PC,
  5030. CPUINFO_INT_PREVIOUSPC,
  5031. CPUINFO_INT_INPUT_STATE,
  5032. CPUINFO_INT_INPUT_STATE_LAST = CPUINFO_INT_INPUT_STATE + MAX_INPUT_LINES - 1,
  5033. CPUINFO_INT_OUTPUT_STATE,
  5034. CPUINFO_INT_OUTPUT_STATE_LAST = CPUINFO_INT_OUTPUT_STATE + MAX_OUTPUT_LINES - 1,
  5035. CPUINFO_INT_REGISTER,
  5036. CPUINFO_INT_REGISTER_LAST = CPUINFO_INT_REGISTER + MAX_REGS - 1,
  5037.  
  5038. CPUINFO_INT_CPU_SPECIFIC = 0x08000,
  5039.  
  5040.  
  5041. CPUINFO_PTR_FIRST = 0x10000,
  5042.  
  5043. CPUINFO_PTR_SET_INFO = CPUINFO_PTR_FIRST,
  5044. CPUINFO_PTR_GET_CONTEXT,
  5045. CPUINFO_PTR_SET_CONTEXT,
  5046. CPUINFO_PTR_INIT,
  5047. CPUINFO_PTR_RESET,
  5048. CPUINFO_PTR_EXIT,
  5049. CPUINFO_PTR_EXECUTE,
  5050. CPUINFO_PTR_BURN,
  5051. CPUINFO_PTR_DISASSEMBLE,
  5052. CPUINFO_PTR_DISASSEMBLE_NEW,
  5053. CPUINFO_PTR_TRANSLATE,
  5054. CPUINFO_PTR_READ,
  5055. CPUINFO_PTR_WRITE,
  5056. CPUINFO_PTR_READOP,
  5057. CPUINFO_PTR_DEBUG_SETUP_COMMANDS,
  5058. CPUINFO_PTR_INSTRUCTION_COUNTER,
  5059. CPUINFO_PTR_REGISTER_LAYOUT,
  5060. CPUINFO_PTR_WINDOW_LAYOUT,
  5061. CPUINFO_PTR_INTERNAL_MEMORY_MAP,
  5062. CPUINFO_PTR_INTERNAL_MEMORY_MAP_LAST = CPUINFO_PTR_INTERNAL_MEMORY_MAP + 3 - 1,
  5063. CPUINFO_PTR_DEBUG_REGISTER_LIST,
  5064.  
  5065. CPUINFO_PTR_CPU_SPECIFIC = 0x18000,
  5066.  
  5067.  
  5068. CPUINFO_STR_FIRST = 0x20000,
  5069.  
  5070. CPUINFO_STR_NAME = CPUINFO_STR_FIRST,
  5071. CPUINFO_STR_CORE_FAMILY,
  5072. CPUINFO_STR_CORE_VERSION,
  5073. CPUINFO_STR_CORE_FILE,
  5074. CPUINFO_STR_CORE_CREDITS,
  5075. CPUINFO_STR_FLAGS,
  5076. CPUINFO_STR_REGISTER,
  5077. CPUINFO_STR_REGISTER_LAST = CPUINFO_STR_REGISTER + MAX_REGS - 1,
  5078.  
  5079. CPUINFO_STR_CPU_SPECIFIC = 0x28000
  5080. };
  5081.  
  5082.  
  5083. union cpuinfo
  5084. {
  5085. INT64 i;
  5086. void * p;
  5087. genf * f;
  5088. char * s;
  5089.  
  5090. void (*setinfo)(UINT32 state, union cpuinfo *info);
  5091. void (*getcontext)(void *context);
  5092. void (*setcontext)(void *context);
  5093. void (*init)(int index, int clock, const void *config, int (*irqcallback)(int));
  5094. void (*reset)(void);
  5095. void (*exit)(void);
  5096. int (*execute)(int cycles);
  5097. void (*burn)(int cycles);
  5098. offs_t (*disassemble)(char *buffer, offs_t pc);
  5099. offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
  5100. int (*translate)(int space, offs_t *address);
  5101. int (*read)(int space, UINT32 offset, int size, UINT64 *value);
  5102. int (*write)(int space, UINT32 offset, int size, UINT64 value);
  5103. int (*readop)(UINT32 offset, int size, UINT64 *value);
  5104. void (*setup_commands)(void);
  5105. int * icount;
  5106. construct_map_t internal_map;
  5107. };
  5108.  
  5109.  
  5110.  
  5111. enum
  5112. {
  5113.  
  5114.  
  5115.  
  5116. REG_PREVIOUSPC = CPUINFO_INT_PREVIOUSPC - CPUINFO_INT_REGISTER,
  5117.  
  5118.  
  5119.  
  5120. REG_PC = CPUINFO_INT_PC - CPUINFO_INT_REGISTER,
  5121.  
  5122.  
  5123.  
  5124. REG_SP = CPUINFO_INT_SP - CPUINFO_INT_REGISTER
  5125. };
  5126.  
  5127.  
  5128.  
  5129. enum
  5130. {
  5131. CPU_IS_LE = 0,
  5132. CPU_IS_BE
  5133. };
  5134. # 409 "./src/cpuintrf.h"
  5135. struct _cpu_interface
  5136. {
  5137.  
  5138. void (*get_info)(UINT32 state, union cpuinfo *info);
  5139. void (*set_info)(UINT32 state, union cpuinfo *info);
  5140. void (*get_context)(void *buffer);
  5141. void (*set_context)(void *buffer);
  5142. void (*init)(int index, int clock, const void *config, int (*irqcallback)(int));
  5143. void (*reset)(void);
  5144. void (*exit)(void);
  5145. int (*execute)(int cycles);
  5146. void (*burn)(int cycles);
  5147. offs_t (*disassemble)(char *buffer, offs_t pc);
  5148. offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
  5149. int (*translate)(int space, offs_t *address);
  5150.  
  5151.  
  5152. size_t context_size;
  5153. INT8 address_shift;
  5154. int * icount;
  5155. };
  5156. typedef struct _cpu_interface cpu_interface;
  5157. # 441 "./src/cpuintrf.h"
  5158. void cpuintrf_init(void);
  5159.  
  5160.  
  5161. int cpuintrf_init_cpu(int cpunum, int cputype, int clock, const void *config, int (*irqcallback)(int));
  5162.  
  5163.  
  5164. void cpuintrf_exit_cpu(int cpunum);
  5165.  
  5166.  
  5167. void cpuintrf_push_context(int cpunum);
  5168.  
  5169.  
  5170. void cpuintrf_pop_context(void);
  5171.  
  5172.  
  5173. char *cpuintrf_temp_str(void);
  5174.  
  5175.  
  5176. void cpuintrf_set_dasm_override(offs_t (*dasm_override)(int cpunum, char *buffer, offs_t pc));
  5177. # 470 "./src/cpuintrf.h"
  5178. INT64 activecpu_get_info_int(UINT32 state);
  5179. void *activecpu_get_info_ptr(UINT32 state);
  5180. genf *activecpu_get_info_fct(UINT32 state);
  5181. const char *activecpu_get_info_string(UINT32 state);
  5182.  
  5183.  
  5184. void activecpu_set_info_int(UINT32 state, INT64 data);
  5185. void activecpu_set_info_ptr(UINT32 state, void *data);
  5186. void activecpu_set_info_fct(UINT32 state, genf *data);
  5187.  
  5188.  
  5189. void activecpu_adjust_icount(int delta);
  5190.  
  5191.  
  5192. int activecpu_get_icount(void);
  5193.  
  5194.  
  5195. void activecpu_reset_banking(void);
  5196.  
  5197.  
  5198. void activecpu_set_input_line(int irqline, int state);
  5199.  
  5200.  
  5201. offs_t activecpu_get_physical_pc_byte(void);
  5202.  
  5203.  
  5204. void activecpu_set_opbase(offs_t val);
  5205.  
  5206.  
  5207. offs_t activecpu_dasm(char *buffer, offs_t pc);
  5208. offs_t activecpu_dasm_new(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
  5209.  
  5210.  
  5211. const char *activecpu_dump_state(void);
  5212. # 544 "./src/cpuintrf.h"
  5213. INT64 cpunum_get_info_int(int cpunum, UINT32 state);
  5214. void *cpunum_get_info_ptr(int cpunum, UINT32 state);
  5215. genf *cpunum_get_info_fct(int cpunum, UINT32 state);
  5216. const char *cpunum_get_info_string(int cpunum, UINT32 state);
  5217.  
  5218.  
  5219. void cpunum_set_info_int(int cpunum, UINT32 state, INT64 data);
  5220. void cpunum_set_info_ptr(int cpunum, UINT32 state, void *data);
  5221. void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data);
  5222.  
  5223.  
  5224. int cpunum_execute(int cpunum, int cycles);
  5225.  
  5226.  
  5227. void cpunum_reset(int cpunum);
  5228.  
  5229.  
  5230. UINT8 cpunum_read_byte(int cpunum, offs_t address);
  5231.  
  5232.  
  5233. void cpunum_write_byte(int cpunum, offs_t address, UINT8 data);
  5234.  
  5235.  
  5236.  
  5237. void *cpunum_get_context_ptr(int cpunum);
  5238.  
  5239.  
  5240. offs_t cpunum_get_physical_pc_byte(int cpunum);
  5241.  
  5242.  
  5243. void cpunum_set_opbase(int cpunum, offs_t val);
  5244.  
  5245.  
  5246. offs_t cpunum_dasm(int cpunum, char *buffer, offs_t pc);
  5247. offs_t cpunum_dasm_new(int cpunum, char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
  5248.  
  5249.  
  5250. const char *cpunum_dump_state(int cpunum);
  5251. # 622 "./src/cpuintrf.h"
  5252. INT64 cputype_get_info_int(int cputype, UINT32 state);
  5253. void *cputype_get_info_ptr(int cputype, UINT32 state);
  5254. genf *cputype_get_info_fct(int cputype, UINT32 state);
  5255. const char *cputype_get_info_string(int cputype, UINT32 state);
  5256. # 659 "./src/cpuintrf.h"
  5257. void cpu_dump_states(void);
  5258. # 682 "./src/cpuintrf.h"
  5259. static __inline__ const cpu_interface *cputype_get_interface(int cputype)
  5260. {
  5261. extern cpu_interface cpuintrf[];
  5262. return &cpuintrf[cputype];
  5263. }
  5264.  
  5265.  
  5266.  
  5267. static __inline__ int cpu_getactivecpu(void)
  5268. {
  5269. extern int activecpu;
  5270. return activecpu;
  5271. }
  5272.  
  5273.  
  5274.  
  5275. static __inline__ int cpu_getexecutingcpu(void)
  5276. {
  5277. extern int executingcpu;
  5278. return executingcpu;
  5279. }
  5280.  
  5281.  
  5282.  
  5283. static __inline__ int cpu_gettotalcpu(void)
  5284. {
  5285. extern int totalcpu;
  5286. return totalcpu;
  5287. }
  5288.  
  5289.  
  5290.  
  5291. static __inline__ offs_t safe_activecpu_get_pc(void)
  5292. {
  5293. return (cpu_getactivecpu() >= 0) ? ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))) : ~0;
  5294. }
  5295. # 32 "src/cpu/sh2/sh2.h" 2
  5296. # 52 "src/cpu/sh2/sh2.h"
  5297. enum {
  5298. SH2_PC=1, SH2_SR, SH2_PR, SH2_GBR, SH2_VBR, SH2_MACH, SH2_MACL,
  5299. SH2_R0, SH2_R1, SH2_R2, SH2_R3, SH2_R4, SH2_R5, SH2_R6, SH2_R7,
  5300. SH2_R8, SH2_R9, SH2_R10, SH2_R11, SH2_R12, SH2_R13, SH2_R14, SH2_R15, SH2_EA
  5301. };
  5302.  
  5303. enum
  5304. {
  5305. CPUINFO_INT_SH2_FRT_INPUT = CPUINFO_INT_CPU_SPECIFIC
  5306. };
  5307.  
  5308. enum
  5309. {
  5310. CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC,
  5311. };
  5312.  
  5313. struct sh2_config
  5314. {
  5315. int is_slave;
  5316. };
  5317.  
  5318. extern void sh2_get_info(UINT32 state, union cpuinfo *info);
  5319.  
  5320. void sh2_internal_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask);
  5321. UINT32 sh2_internal_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
  5322. # 106 "src/cpu/sh2/sh2.c" 2
  5323. # 118 "src/cpu/sh2/sh2.c"
  5324. typedef struct
  5325. {
  5326. int irq_vector;
  5327. int irq_priority;
  5328. } irq_entry;
  5329.  
  5330. typedef struct
  5331. {
  5332. UINT32 ppc;
  5333. UINT32 pc;
  5334. UINT32 pr;
  5335. UINT32 sr;
  5336. UINT32 gbr, vbr;
  5337. UINT32 mach, macl;
  5338. UINT32 r[16];
  5339. UINT32 ea;
  5340. UINT32 delay;
  5341. UINT32 cpu_off;
  5342. UINT32 dvsr, dvdnth, dvdntl, dvcr;
  5343. UINT32 pending_irq;
  5344. UINT32 test_irq;
  5345. irq_entry irq_queue[16];
  5346.  
  5347. INT8 irq_line_state[17];
  5348. int (*irq_callback)(int irqline);
  5349. UINT32 *m;
  5350. INT8 nmi_line_state;
  5351.  
  5352. UINT16 frc;
  5353. UINT16 ocra, ocrb, icr;
  5354. UINT32 frc_base;
  5355.  
  5356. int frt_input;
  5357. int internal_irq_level;
  5358. int internal_irq_vector;
  5359.  
  5360. void *timer;
  5361. void *dma_timer[2];
  5362. int dma_timer_active[2];
  5363.  
  5364. int is_slave, cpu_number;
  5365.  
  5366. void (*ftcsr_read_callback)(UINT32 data);
  5367. } SH2;
  5368.  
  5369. static int sh2_icount;
  5370. static SH2 sh2;
  5371.  
  5372.  
  5373.  
  5374.  
  5375. static const int div_tab[4] = { 3, 5, 3, 0 };
  5376.  
  5377. enum {
  5378. ICF = 0x00800000,
  5379. OCFA = 0x00080000,
  5380. OCFB = 0x00040000,
  5381. OVF = 0x00020000
  5382. };
  5383.  
  5384. static void sh2_timer_callback(int data);
  5385. # 193 "src/cpu/sh2/sh2.c"
  5386. static __inline__ UINT8 RB(offs_t A)
  5387. {
  5388. if (A >= 0xe0000000)
  5389. return sh2_internal_r((A & 0x1fc)>>2, ~(0xff << (((~A) & 3)*8))) >> (((~A) & 3)*8);
  5390.  
  5391. if (A >= 0xc0000000)
  5392. return program_read_byte_32be(A);
  5393.  
  5394. if (A >= 0x40000000)
  5395. return 0xa5;
  5396.  
  5397. return program_read_byte_32be(A & 0x07ffffff);
  5398. }
  5399.  
  5400. static __inline__ UINT16 RW(offs_t A)
  5401. {
  5402. if (A >= 0xe0000000)
  5403. return sh2_internal_r((A & 0x1fc)>>2, ~(0xffff << (((~A) & 2)*8))) >> (((~A) & 2)*8);
  5404.  
  5405. if (A >= 0xc0000000)
  5406. return program_read_word_32be(A);
  5407.  
  5408. if (A >= 0x40000000)
  5409. return 0xa5a5;
  5410.  
  5411. return program_read_word_32be(A & 0x07ffffff);
  5412. }
  5413.  
  5414. static __inline__ UINT32 RL(offs_t A)
  5415. {
  5416. if (A >= 0xe0000000)
  5417. return sh2_internal_r((A & 0x1fc)>>2, 0);
  5418.  
  5419. if (A >= 0xc0000000)
  5420. return program_read_dword_32be(A);
  5421.  
  5422. if (A >= 0x40000000)
  5423. return 0xa5a5a5a5;
  5424.  
  5425. return program_read_dword_32be(A & 0x07ffffff);
  5426. }
  5427.  
  5428. static __inline__ void WB(offs_t A, UINT8 V)
  5429. {
  5430.  
  5431. if (A >= 0xe0000000)
  5432. {
  5433. sh2_internal_w((A & 0x1fc)>>2, V << (((~A) & 3)*8), ~(0xff << (((~A) & 3)*8)));
  5434. return;
  5435. }
  5436.  
  5437. if (A >= 0xc0000000)
  5438. {
  5439. program_write_byte_32be(A,V);
  5440. return;
  5441. }
  5442.  
  5443. if (A >= 0x40000000)
  5444. return;
  5445.  
  5446. program_write_byte_32be(A & 0x07ffffff,V);
  5447. }
  5448.  
  5449. static __inline__ void WW(offs_t A, UINT16 V)
  5450. {
  5451. if (A >= 0xe0000000)
  5452. {
  5453. sh2_internal_w((A & 0x1fc)>>2, V << (((~A) & 2)*8), ~(0xffff << (((~A) & 2)*8)));
  5454. return;
  5455. }
  5456.  
  5457. if (A >= 0xc0000000)
  5458. {
  5459. program_write_word_32be(A,V);
  5460. return;
  5461. }
  5462.  
  5463. if (A >= 0x40000000)
  5464. return;
  5465.  
  5466. program_write_word_32be(A & 0x07ffffff,V);
  5467. }
  5468.  
  5469. static __inline__ void WL(offs_t A, UINT32 V)
  5470. {
  5471. if (A >= 0xe0000000)
  5472. {
  5473. sh2_internal_w((A & 0x1fc)>>2, V, 0);
  5474. return;
  5475. }
  5476.  
  5477. if (A >= 0xc0000000)
  5478. {
  5479. program_write_dword_32be(A,V);
  5480. return;
  5481. }
  5482.  
  5483. if (A >= 0x40000000)
  5484. return;
  5485.  
  5486. program_write_dword_32be(A & 0x07ffffff,V);
  5487. }
  5488.  
  5489. static __inline__ void sh2_exception(const char *message, int irqline)
  5490. {
  5491. int vector;
  5492.  
  5493. if (irqline != 16)
  5494. {
  5495. if (irqline <= ((sh2.sr >> 4) & 15))
  5496. return;
  5497.  
  5498.  
  5499. if (sh2.internal_irq_level == irqline)
  5500. {
  5501. vector = sh2.internal_irq_vector;
  5502. ;
  5503. }
  5504. else
  5505. {
  5506. if(sh2.m[0x38] & 0x00010000)
  5507. {
  5508. vector = sh2.irq_callback(irqline);
  5509. ;
  5510. }
  5511. else
  5512. {
  5513. sh2.irq_callback(irqline);
  5514. vector = 64 + irqline/2;
  5515. ;
  5516. }
  5517. }
  5518. }
  5519. else
  5520. {
  5521. vector = 11;
  5522. ;
  5523. }
  5524.  
  5525. sh2.r[15] -= 4;
  5526. WL( sh2.r[15], sh2.sr );
  5527. sh2.r[15] -= 4;
  5528. WL( sh2.r[15], sh2.pc );
  5529.  
  5530.  
  5531. if (irqline > 15)
  5532. sh2.sr = sh2.sr | 0x000000f0;
  5533. else
  5534. sh2.sr = (sh2.sr & ~0x000000f0) | (irqline << 4);
  5535.  
  5536.  
  5537. sh2.pc = RL( sh2.vbr + vector * 4 );
  5538. do { if (active_address_space[0].readlookup[(((sh2.pc & 0x07ffffff) & active_address_space[0].addrmask) >> (32 - 18))] != opcode_entry) memory_set_opbase(sh2.pc & 0x07ffffff); } while (0);
  5539. }
  5540. # 373 "src/cpu/sh2/sh2.c"
  5541. static UINT8 sh2_reg_layout[] = {
  5542. SH2_PC, SH2_R15, SH2_SR, SH2_PR, -1,
  5543. SH2_GBR, SH2_VBR, SH2_MACH, SH2_MACL,-1,
  5544. SH2_R0, SH2_R1, SH2_R2, SH2_R3, -1,
  5545. SH2_R4, SH2_R5, SH2_R6, SH2_R7, -1,
  5546. SH2_R8, SH2_R9, SH2_R10, SH2_R11, -1,
  5547. SH2_R12, SH2_R13, SH2_R14, SH2_EA, 0
  5548. };
  5549.  
  5550.  
  5551. static UINT8 sh2_win_layout[] = {
  5552. 0, 0,80, 6,
  5553. 0, 7,39,15,
  5554. 40, 7,39, 7,
  5555. 40,15,39, 7,
  5556. 0,23,80, 1,
  5557. };
  5558.  
  5559.  
  5560.  
  5561.  
  5562.  
  5563. static __inline__ void ADD(UINT32 m, UINT32 n)
  5564. {
  5565. sh2.r[n] += sh2.r[m];
  5566. }
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572. static __inline__ void ADDI(UINT32 i, UINT32 n)
  5573. {
  5574. sh2.r[n] += (INT32)(INT16)(INT8)i;
  5575. }
  5576.  
  5577.  
  5578.  
  5579.  
  5580.  
  5581. static __inline__ void ADDC(UINT32 m, UINT32 n)
  5582. {
  5583. UINT32 tmp0, tmp1;
  5584.  
  5585. tmp1 = sh2.r[n] + sh2.r[m];
  5586. tmp0 = sh2.r[n];
  5587. sh2.r[n] = tmp1 + (sh2.sr & 0x00000001);
  5588. if (tmp0 > tmp1)
  5589. sh2.sr |= 0x00000001;
  5590. else
  5591. sh2.sr &= ~0x00000001;
  5592. if (tmp1 > sh2.r[n])
  5593. sh2.sr |= 0x00000001;
  5594. }
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600. static __inline__ void ADDV(UINT32 m, UINT32 n)
  5601. {
  5602. INT32 dest, src, ans;
  5603.  
  5604. if ((INT32) sh2.r[n] >= 0)
  5605. dest = 0;
  5606. else
  5607. dest = 1;
  5608. if ((INT32) sh2.r[m] >= 0)
  5609. src = 0;
  5610. else
  5611. src = 1;
  5612. src += dest;
  5613. sh2.r[n] += sh2.r[m];
  5614. if ((INT32) sh2.r[n] >= 0)
  5615. ans = 0;
  5616. else
  5617. ans = 1;
  5618. ans += dest;
  5619. if (src == 0 || src == 2)
  5620. {
  5621. if (ans == 1)
  5622. sh2.sr |= 0x00000001;
  5623. else
  5624. sh2.sr &= ~0x00000001;
  5625. }
  5626. else
  5627. sh2.sr &= ~0x00000001;
  5628. }
  5629.  
  5630.  
  5631.  
  5632.  
  5633.  
  5634. static __inline__ void AND(UINT32 m, UINT32 n)
  5635. {
  5636. sh2.r[n] &= sh2.r[m];
  5637. }
  5638.  
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644. static __inline__ void ANDI(UINT32 i)
  5645. {
  5646. sh2.r[0] &= i;
  5647. }
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653. static __inline__ void ANDM(UINT32 i)
  5654. {
  5655. UINT32 temp;
  5656.  
  5657. sh2.ea = sh2.gbr + sh2.r[0];
  5658. temp = i & RB( sh2.ea );
  5659. WB( sh2.ea, temp );
  5660. sh2_icount -= 2;
  5661. }
  5662.  
  5663.  
  5664.  
  5665.  
  5666.  
  5667. static __inline__ void BF(UINT32 d)
  5668. {
  5669. if ((sh2.sr & 0x00000001) == 0)
  5670. {
  5671. INT32 disp = ((INT32)d << 24) >> 24;
  5672. sh2.pc = sh2.ea = sh2.pc + disp * 2 + 2;
  5673. do { if (active_address_space[0].readlookup[(((sh2.pc & 0x07ffffff) & active_address_space[0].addrmask) >> (32 - 18))] != opcode_entry) memory_set_opbase(sh2.pc & 0x07ffffff); } while (0);
  5674. sh2_icount -= 2;
  5675. }
  5676. }
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682. static __inline__ void BFS(UINT32 d)
  5683. {
  5684. if ((sh2.sr & 0x00000001) == 0)
  5685. {
  5686. INT32 disp = ((INT32)d << 24) >> 24;
  5687. sh2.delay = sh2.pc;
  5688. sh2.pc = sh2.ea = sh2.pc + disp * 2 + 2;
  5689. sh2_icount--;
  5690. }
  5691. }
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697. static __inline__ void BRA(UINT32 d)
  5698. {
  5699. INT32 disp = ((INT32)d << 20) >> 20;
  5700.  
  5701.  
  5702. if (disp == -2)
  5703. {
  5704. UINT32 next_opcode = RW(sh2.ppc & 0x07ffffff);
  5705.  
  5706.  
  5707.  
  5708. if (next_opcode == 0x0009)
  5709. sh2_icount %= 3;
  5710. }
  5711.  
  5712. sh2.delay = sh2.pc;
  5713. sh2.pc = sh2.ea = sh2.pc + disp * 2 + 2;
  5714. sh2_icount--;
  5715. }
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721. static __inline__ void BRAF(UINT32 m)
  5722. {
  5723. sh2.delay = sh2.pc;
  5724. sh2.pc += sh2.r[m] + 2;
  5725. sh2_icount--;
  5726. }
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732. static __inline__ void BSR(UINT32 d)
  5733. {
  5734. INT32 disp = ((INT32)d << 20) >> 20;
  5735.  
  5736. sh2.pr = sh2.pc + 2;
  5737. sh2.delay = sh2.pc;
  5738. sh2.pc = sh2.ea = sh2.pc + disp * 2 + 2;
  5739. sh2_icount--;
  5740. }
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746. static __inline__ void BSRF(UINT32 m)
  5747. {
  5748. sh2.pr = sh2.pc + 2;
  5749. sh2.delay = sh2.pc;
  5750. sh2.pc += sh2.r[m] + 2;
  5751. sh2_icount--;
  5752. }
  5753.  
  5754.  
  5755.  
  5756.  
  5757.  
  5758. static __inline__ void BT(UINT32 d)
  5759. {
  5760. if ((sh2.sr & 0x00000001) != 0)
  5761. {
  5762. INT32 disp = ((INT32)d << 24) >> 24;
  5763. sh2.pc = sh2.ea = sh2.pc + disp * 2 + 2;
  5764. do { if (active_address_space[0].readlookup[(((sh2.pc & 0x07ffffff) & active_address_space[0].addrmask) >> (32 - 18))] != opcode_entry) memory_set_opbase(sh2.pc & 0x07ffffff); } while (0);
  5765. sh2_icount -= 2;
  5766. }
  5767. }
  5768.  
  5769.  
  5770.  
  5771.  
  5772.  
  5773. static __inline__ void BTS(UINT32 d)
  5774. {
  5775. if ((sh2.sr & 0x00000001) != 0)
  5776. {
  5777. INT32 disp = ((INT32)d << 24) >> 24;
  5778. sh2.delay = sh2.pc;
  5779. sh2.pc = sh2.ea = sh2.pc + disp * 2 + 2;
  5780. sh2_icount--;
  5781. }
  5782. }
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788. static __inline__ void CLRMAC(void)
  5789. {
  5790. sh2.mach = 0;
  5791. sh2.macl = 0;
  5792. }
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798. static __inline__ void CLRT(void)
  5799. {
  5800. sh2.sr &= ~0x00000001;
  5801. }
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807. static __inline__ void CMPEQ(UINT32 m, UINT32 n)
  5808. {
  5809. if (sh2.r[n] == sh2.r[m])
  5810. sh2.sr |= 0x00000001;
  5811. else
  5812. sh2.sr &= ~0x00000001;
  5813. }
  5814.  
  5815.  
  5816.  
  5817.  
  5818.  
  5819. static __inline__ void CMPGE(UINT32 m, UINT32 n)
  5820. {
  5821. if ((INT32) sh2.r[n] >= (INT32) sh2.r[m])
  5822. sh2.sr |= 0x00000001;
  5823. else
  5824. sh2.sr &= ~0x00000001;
  5825. }
  5826.  
  5827.  
  5828.  
  5829.  
  5830.  
  5831. static __inline__ void CMPGT(UINT32 m, UINT32 n)
  5832. {
  5833. if ((INT32) sh2.r[n] > (INT32) sh2.r[m])
  5834. sh2.sr |= 0x00000001;
  5835. else
  5836. sh2.sr &= ~0x00000001;
  5837. }
  5838.  
  5839.  
  5840.  
  5841.  
  5842.  
  5843. static __inline__ void CMPHI(UINT32 m, UINT32 n)
  5844. {
  5845. if ((UINT32) sh2.r[n] > (UINT32) sh2.r[m])
  5846. sh2.sr |= 0x00000001;
  5847. else
  5848. sh2.sr &= ~0x00000001;
  5849. }
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855. static __inline__ void CMPHS(UINT32 m, UINT32 n)
  5856. {
  5857. if ((UINT32) sh2.r[n] >= (UINT32) sh2.r[m])
  5858. sh2.sr |= 0x00000001;
  5859. else
  5860. sh2.sr &= ~0x00000001;
  5861. }
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868. static __inline__ void CMPPL(UINT32 n)
  5869. {
  5870. if ((INT32) sh2.r[n] > 0)
  5871. sh2.sr |= 0x00000001;
  5872. else
  5873. sh2.sr &= ~0x00000001;
  5874. }
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880. static __inline__ void CMPPZ(UINT32 n)
  5881. {
  5882. if ((INT32) sh2.r[n] >= 0)
  5883. sh2.sr |= 0x00000001;
  5884. else
  5885. sh2.sr &= ~0x00000001;
  5886. }
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892. static __inline__ void CMPSTR(UINT32 m, UINT32 n)
  5893. {
  5894. UINT32 temp;
  5895. INT32 HH, HL, LH, LL;
  5896. temp = sh2.r[n] ^ sh2.r[m];
  5897. HH = (temp >> 24) & 0xff;
  5898. HL = (temp >> 16) & 0xff;
  5899. LH = (temp >> 8) & 0xff;
  5900. LL = temp & 0xff;
  5901. if (HH && HL && LH && LL)
  5902. sh2.sr &= ~0x00000001;
  5903. else
  5904. sh2.sr |= 0x00000001;
  5905. }
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912. static __inline__ void CMPIM(UINT32 i)
  5913. {
  5914. UINT32 imm = (UINT32)(INT32)(INT16)(INT8)i;
  5915.  
  5916. if (sh2.r[0] == imm)
  5917. sh2.sr |= 0x00000001;
  5918. else
  5919. sh2.sr &= ~0x00000001;
  5920. }
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926. static __inline__ void DIV0S(UINT32 m, UINT32 n)
  5927. {
  5928. if ((sh2.r[n] & 0x80000000) == 0)
  5929. sh2.sr &= ~0x00000100;
  5930. else
  5931. sh2.sr |= 0x00000100;
  5932. if ((sh2.r[m] & 0x80000000) == 0)
  5933. sh2.sr &= ~0x00000200;
  5934. else
  5935. sh2.sr |= 0x00000200;
  5936. if ((sh2.r[m] ^ sh2.r[n]) & 0x80000000)
  5937. sh2.sr |= 0x00000001;
  5938. else
  5939. sh2.sr &= ~0x00000001;
  5940. }
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946. static __inline__ void DIV0U(void)
  5947. {
  5948. sh2.sr &= ~(0x00000200 | 0x00000100 | 0x00000001);
  5949. }
  5950.  
  5951.  
  5952.  
  5953.  
  5954.  
  5955. static __inline__ void DIV1(UINT32 m, UINT32 n)
  5956. {
  5957. UINT32 tmp0;
  5958. UINT32 old_q;
  5959.  
  5960. old_q = sh2.sr & 0x00000100;
  5961. if (0x80000000 & sh2.r[n])
  5962. sh2.sr |= 0x00000100;
  5963. else
  5964. sh2.sr &= ~0x00000100;
  5965.  
  5966. sh2.r[n] = (sh2.r[n] << 1) | (sh2.sr & 0x00000001);
  5967.  
  5968. if (!old_q)
  5969. {
  5970. if (!(sh2.sr & 0x00000200))
  5971. {
  5972. tmp0 = sh2.r[n];
  5973. sh2.r[n] -= sh2.r[m];
  5974. if(!(sh2.sr & 0x00000100))
  5975. if(sh2.r[n] > tmp0)
  5976. sh2.sr |= 0x00000100;
  5977. else
  5978. sh2.sr &= ~0x00000100;
  5979. else
  5980. if(sh2.r[n] > tmp0)
  5981. sh2.sr &= ~0x00000100;
  5982. else
  5983. sh2.sr |= 0x00000100;
  5984. }
  5985. else
  5986. {
  5987. tmp0 = sh2.r[n];
  5988. sh2.r[n] += sh2.r[m];
  5989. if(!(sh2.sr & 0x00000100))
  5990. {
  5991. if(sh2.r[n] < tmp0)
  5992. sh2.sr &= ~0x00000100;
  5993. else
  5994. sh2.sr |= 0x00000100;
  5995. }
  5996. else
  5997. {
  5998. if(sh2.r[n] < tmp0)
  5999. sh2.sr |= 0x00000100;
  6000. else
  6001. sh2.sr &= ~0x00000100;
  6002. }
  6003. }
  6004. }
  6005. else
  6006. {
  6007. if (!(sh2.sr & 0x00000200))
  6008. {
  6009. tmp0 = sh2.r[n];
  6010. sh2.r[n] += sh2.r[m];
  6011. if(!(sh2.sr & 0x00000100))
  6012. if(sh2.r[n] < tmp0)
  6013. sh2.sr |= 0x00000100;
  6014. else
  6015. sh2.sr &= ~0x00000100;
  6016. else
  6017. if(sh2.r[n] < tmp0)
  6018. sh2.sr &= ~0x00000100;
  6019. else
  6020. sh2.sr |= 0x00000100;
  6021. }
  6022. else
  6023. {
  6024. tmp0 = sh2.r[n];
  6025. sh2.r[n] -= sh2.r[m];
  6026. if(!(sh2.sr & 0x00000100))
  6027. if(sh2.r[n] > tmp0)
  6028. sh2.sr &= ~0x00000100;
  6029. else
  6030. sh2.sr |= 0x00000100;
  6031. else
  6032. if(sh2.r[n] > tmp0)
  6033. sh2.sr |= 0x00000100;
  6034. else
  6035. sh2.sr &= ~0x00000100;
  6036. }
  6037. }
  6038.  
  6039. tmp0 = (sh2.sr & (0x00000100 | 0x00000200));
  6040. if((!tmp0) || (tmp0 == 0x300))
  6041. sh2.sr |= 0x00000001;
  6042. else
  6043. sh2.sr &= ~0x00000001;
  6044. }
  6045.  
  6046.  
  6047. static __inline__ void DMULS(UINT32 m, UINT32 n)
  6048. {
  6049. UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
  6050. UINT32 temp0, temp1, temp2, temp3;
  6051. INT32 tempm, tempn, fnLmL;
  6052.  
  6053. tempn = (INT32) sh2.r[n];
  6054. tempm = (INT32) sh2.r[m];
  6055. if (tempn < 0)
  6056. tempn = 0 - tempn;
  6057. if (tempm < 0)
  6058. tempm = 0 - tempm;
  6059. if ((INT32) (sh2.r[n] ^ sh2.r[m]) < 0)
  6060. fnLmL = -1;
  6061. else
  6062. fnLmL = 0;
  6063. temp1 = (UINT32) tempn;
  6064. temp2 = (UINT32) tempm;
  6065. RnL = temp1 & 0x0000ffff;
  6066. RnH = (temp1 >> 16) & 0x0000ffff;
  6067. RmL = temp2 & 0x0000ffff;
  6068. RmH = (temp2 >> 16) & 0x0000ffff;
  6069. temp0 = RmL * RnL;
  6070. temp1 = RmH * RnL;
  6071. temp2 = RmL * RnH;
  6072. temp3 = RmH * RnH;
  6073. Res2 = 0;
  6074. Res1 = temp1 + temp2;
  6075. if (Res1 < temp1)
  6076. Res2 += 0x00010000;
  6077. temp1 = (Res1 << 16) & 0xffff0000;
  6078. Res0 = temp0 + temp1;
  6079. if (Res0 < temp0)
  6080. Res2++;
  6081. Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3;
  6082. if (fnLmL < 0)
  6083. {
  6084. Res2 = ~Res2;
  6085. if (Res0 == 0)
  6086. Res2++;
  6087. else
  6088. Res0 = (~Res0) + 1;
  6089. }
  6090. sh2.mach = Res2;
  6091. sh2.macl = Res0;
  6092. sh2_icount--;
  6093. }
  6094.  
  6095.  
  6096. static __inline__ void DMULU(UINT32 m, UINT32 n)
  6097. {
  6098. UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
  6099. UINT32 temp0, temp1, temp2, temp3;
  6100.  
  6101. RnL = sh2.r[n] & 0x0000ffff;
  6102. RnH = (sh2.r[n] >> 16) & 0x0000ffff;
  6103. RmL = sh2.r[m] & 0x0000ffff;
  6104. RmH = (sh2.r[m] >> 16) & 0x0000ffff;
  6105. temp0 = RmL * RnL;
  6106. temp1 = RmH * RnL;
  6107. temp2 = RmL * RnH;
  6108. temp3 = RmH * RnH;
  6109. Res2 = 0;
  6110. Res1 = temp1 + temp2;
  6111. if (Res1 < temp1)
  6112. Res2 += 0x00010000;
  6113. temp1 = (Res1 << 16) & 0xffff0000;
  6114. Res0 = temp0 + temp1;
  6115. if (Res0 < temp0)
  6116. Res2++;
  6117. Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3;
  6118. sh2.mach = Res2;
  6119. sh2.macl = Res0;
  6120. sh2_icount--;
  6121. }
  6122.  
  6123.  
  6124. static __inline__ void DT(UINT32 n)
  6125. {
  6126. sh2.r[n]--;
  6127. if (sh2.r[n] == 0)
  6128. sh2.sr |= 0x00000001;
  6129. else
  6130. sh2.sr &= ~0x00000001;
  6131.  
  6132. {
  6133. UINT32 next_opcode = RW(sh2.ppc & 0x07ffffff);
  6134.  
  6135.  
  6136.  
  6137. if (next_opcode == 0x8bfd)
  6138. {
  6139. while (sh2.r[n] > 1 && sh2_icount > 4)
  6140. {
  6141. sh2.r[n]--;
  6142. sh2_icount -= 4;
  6143. }
  6144. }
  6145. }
  6146.  
  6147. }
  6148.  
  6149.  
  6150. static __inline__ void EXTSB(UINT32 m, UINT32 n)
  6151. {
  6152. sh2.r[n] = ((INT32)sh2.r[m] << 24) >> 24;
  6153. }
  6154.  
  6155.  
  6156. static __inline__ void EXTSW(UINT32 m, UINT32 n)
  6157. {
  6158. sh2.r[n] = ((INT32)sh2.r[m] << 16) >> 16;
  6159. }
  6160.  
  6161.  
  6162. static __inline__ void EXTUB(UINT32 m, UINT32 n)
  6163. {
  6164. sh2.r[n] = sh2.r[m] & 0x000000ff;
  6165. }
  6166.  
  6167.  
  6168. static __inline__ void EXTUW(UINT32 m, UINT32 n)
  6169. {
  6170. sh2.r[n] = sh2.r[m] & 0x0000ffff;
  6171. }
  6172.  
  6173.  
  6174. static __inline__ void JMP(UINT32 m)
  6175. {
  6176. sh2.delay = sh2.pc;
  6177. sh2.pc = sh2.ea = sh2.r[m];
  6178. }
  6179.  
  6180.  
  6181. static __inline__ void JSR(UINT32 m)
  6182. {
  6183. sh2.delay = sh2.pc;
  6184. sh2.pr = sh2.pc + 2;
  6185. sh2.pc = sh2.ea = sh2.r[m];
  6186. sh2_icount--;
  6187. }
  6188.  
  6189.  
  6190.  
  6191. static __inline__ void LDCSR(UINT32 m)
  6192. {
  6193. sh2.sr = sh2.r[m] & (0x00000200|0x00000100|0x000000f0|0x00000002|0x00000001);
  6194. sh2.test_irq = 1;
  6195. }
  6196.  
  6197.  
  6198. static __inline__ void LDCGBR(UINT32 m)
  6199. {
  6200. sh2.gbr = sh2.r[m];
  6201. }
  6202.  
  6203.  
  6204. static __inline__ void LDCVBR(UINT32 m)
  6205. {
  6206. sh2.vbr = sh2.r[m];
  6207. }
  6208.  
  6209.  
  6210. static __inline__ void LDCMSR(UINT32 m)
  6211. {
  6212. sh2.ea = sh2.r[m];
  6213. sh2.sr = RL( sh2.ea ) & (0x00000200|0x00000100|0x000000f0|0x00000002|0x00000001);
  6214. sh2.r[m] += 4;
  6215. sh2_icount -= 2;
  6216. sh2.test_irq = 1;
  6217. }
  6218.  
  6219.  
  6220. static __inline__ void LDCMGBR(UINT32 m)
  6221. {
  6222. sh2.ea = sh2.r[m];
  6223. sh2.gbr = RL( sh2.ea );
  6224. sh2.r[m] += 4;
  6225. sh2_icount -= 2;
  6226. }
  6227.  
  6228.  
  6229. static __inline__ void LDCMVBR(UINT32 m)
  6230. {
  6231. sh2.ea = sh2.r[m];
  6232. sh2.vbr = RL( sh2.ea );
  6233. sh2.r[m] += 4;
  6234. sh2_icount -= 2;
  6235. }
  6236.  
  6237.  
  6238. static __inline__ void LDSMACH(UINT32 m)
  6239. {
  6240. sh2.mach = sh2.r[m];
  6241. }
  6242.  
  6243.  
  6244. static __inline__ void LDSMACL(UINT32 m)
  6245. {
  6246. sh2.macl = sh2.r[m];
  6247. }
  6248.  
  6249.  
  6250. static __inline__ void LDSPR(UINT32 m)
  6251. {
  6252. sh2.pr = sh2.r[m];
  6253. }
  6254.  
  6255.  
  6256. static __inline__ void LDSMMACH(UINT32 m)
  6257. {
  6258. sh2.ea = sh2.r[m];
  6259. sh2.mach = RL( sh2.ea );
  6260. sh2.r[m] += 4;
  6261. }
  6262.  
  6263.  
  6264. static __inline__ void LDSMMACL(UINT32 m)
  6265. {
  6266. sh2.ea = sh2.r[m];
  6267. sh2.macl = RL( sh2.ea );
  6268. sh2.r[m] += 4;
  6269. }
  6270.  
  6271.  
  6272. static __inline__ void LDSMPR(UINT32 m)
  6273. {
  6274. sh2.ea = sh2.r[m];
  6275. sh2.pr = RL( sh2.ea );
  6276. sh2.r[m] += 4;
  6277. }
  6278.  
  6279.  
  6280. static __inline__ void MAC_L(UINT32 m, UINT32 n)
  6281. {
  6282. UINT32 RnL, RnH, RmL, RmH, Res0, Res1, Res2;
  6283. UINT32 temp0, temp1, temp2, temp3;
  6284. INT32 tempm, tempn, fnLmL;
  6285.  
  6286. tempn = (INT32) RL( sh2.r[n] );
  6287. sh2.r[n] += 4;
  6288. tempm = (INT32) RL( sh2.r[m] );
  6289. sh2.r[m] += 4;
  6290. if ((INT32) (tempn ^ tempm) < 0)
  6291. fnLmL = -1;
  6292. else
  6293. fnLmL = 0;
  6294. if (tempn < 0)
  6295. tempn = 0 - tempn;
  6296. if (tempm < 0)
  6297. tempm = 0 - tempm;
  6298. temp1 = (UINT32) tempn;
  6299. temp2 = (UINT32) tempm;
  6300. RnL = temp1 & 0x0000ffff;
  6301. RnH = (temp1 >> 16) & 0x0000ffff;
  6302. RmL = temp2 & 0x0000ffff;
  6303. RmH = (temp2 >> 16) & 0x0000ffff;
  6304. temp0 = RmL * RnL;
  6305. temp1 = RmH * RnL;
  6306. temp2 = RmL * RnH;
  6307. temp3 = RmH * RnH;
  6308. Res2 = 0;
  6309. Res1 = temp1 + temp2;
  6310. if (Res1 < temp1)
  6311. Res2 += 0x00010000;
  6312. temp1 = (Res1 << 16) & 0xffff0000;
  6313. Res0 = temp0 + temp1;
  6314. if (Res0 < temp0)
  6315. Res2++;
  6316. Res2 = Res2 + ((Res1 >> 16) & 0x0000ffff) + temp3;
  6317. if (fnLmL < 0)
  6318. {
  6319. Res2 = ~Res2;
  6320. if (Res0 == 0)
  6321. Res2++;
  6322. else
  6323. Res0 = (~Res0) + 1;
  6324. }
  6325. if (sh2.sr & 0x00000002)
  6326. {
  6327. Res0 = sh2.macl + Res0;
  6328. if (sh2.macl > Res0)
  6329. Res2++;
  6330. Res2 += (sh2.mach & 0x0000ffff);
  6331. if (((INT32) Res2 < 0) && (Res2 < 0xffff8000))
  6332. {
  6333. Res2 = 0x00008000;
  6334. Res0 = 0x00000000;
  6335. }
  6336. else if (((INT32) Res2 > 0) && (Res2 > 0x00007fff))
  6337. {
  6338. Res2 = 0x00007fff;
  6339. Res0 = 0xffffffff;
  6340. }
  6341. sh2.mach = Res2;
  6342. sh2.macl = Res0;
  6343. }
  6344. else
  6345. {
  6346. Res0 = sh2.macl + Res0;
  6347. if (sh2.macl > Res0)
  6348. Res2++;
  6349. Res2 += sh2.mach;
  6350. sh2.mach = Res2;
  6351. sh2.macl = Res0;
  6352. }
  6353. sh2_icount -= 2;
  6354. }
  6355.  
  6356.  
  6357. static __inline__ void MAC_W(UINT32 m, UINT32 n)
  6358. {
  6359. INT32 tempm, tempn, dest, src, ans;
  6360. UINT32 templ;
  6361.  
  6362. tempn = (INT32) RW( sh2.r[n] );
  6363. sh2.r[n] += 2;
  6364. tempm = (INT32) RW( sh2.r[m] );
  6365. sh2.r[m] += 2;
  6366. templ = sh2.macl;
  6367. tempm = ((INT32) (short) tempn * (INT32) (short) tempm);
  6368. if ((INT32) sh2.macl >= 0)
  6369. dest = 0;
  6370. else
  6371. dest = 1;
  6372. if ((INT32) tempm >= 0)
  6373. {
  6374. src = 0;
  6375. tempn = 0;
  6376. }
  6377. else
  6378. {
  6379. src = 1;
  6380. tempn = 0xffffffff;
  6381. }
  6382. src += dest;
  6383. sh2.macl += tempm;
  6384. if ((INT32) sh2.macl >= 0)
  6385. ans = 0;
  6386. else
  6387. ans = 1;
  6388. ans += dest;
  6389. if (sh2.sr & 0x00000002)
  6390. {
  6391. if (ans == 1)
  6392. {
  6393. if (src == 0)
  6394. sh2.macl = 0x7fffffff;
  6395. if (src == 2)
  6396. sh2.macl = 0x80000000;
  6397. }
  6398. }
  6399. else
  6400. {
  6401. sh2.mach += tempn;
  6402. if (templ > sh2.macl)
  6403. sh2.mach += 1;
  6404. }
  6405. sh2_icount -= 2;
  6406. }
  6407.  
  6408.  
  6409. static __inline__ void MOV(UINT32 m, UINT32 n)
  6410. {
  6411. sh2.r[n] = sh2.r[m];
  6412. }
  6413.  
  6414.  
  6415. static __inline__ void MOVBS(UINT32 m, UINT32 n)
  6416. {
  6417. sh2.ea = sh2.r[n];
  6418. WB( sh2.ea, sh2.r[m] & 0x000000ff);
  6419. }
  6420.  
  6421.  
  6422. static __inline__ void MOVWS(UINT32 m, UINT32 n)
  6423. {
  6424. sh2.ea = sh2.r[n];
  6425. WW( sh2.ea, sh2.r[m] & 0x0000ffff);
  6426. }
  6427.  
  6428.  
  6429. static __inline__ void MOVLS(UINT32 m, UINT32 n)
  6430. {
  6431. sh2.ea = sh2.r[n];
  6432. WL( sh2.ea, sh2.r[m] );
  6433. }
  6434.  
  6435.  
  6436. static __inline__ void MOVBL(UINT32 m, UINT32 n)
  6437. {
  6438. sh2.ea = sh2.r[m];
  6439. sh2.r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2.ea );
  6440. }
  6441.  
  6442.  
  6443. static __inline__ void MOVWL(UINT32 m, UINT32 n)
  6444. {
  6445. sh2.ea = sh2.r[m];
  6446. sh2.r[n] = (UINT32)(INT32)(INT16) RW( sh2.ea );
  6447. }
  6448.  
  6449.  
  6450. static __inline__ void MOVLL(UINT32 m, UINT32 n)
  6451. {
  6452. sh2.ea = sh2.r[m];
  6453. sh2.r[n] = RL( sh2.ea );
  6454. }
  6455.  
  6456.  
  6457. static __inline__ void MOVBM(UINT32 m, UINT32 n)
  6458. {
  6459.  
  6460. UINT32 data = sh2.r[m] & 0x000000ff;
  6461.  
  6462. sh2.r[n] -= 1;
  6463. WB( sh2.r[n], data );
  6464. }
  6465.  
  6466.  
  6467. static __inline__ void MOVWM(UINT32 m, UINT32 n)
  6468. {
  6469. UINT32 data = sh2.r[m] & 0x0000ffff;
  6470.  
  6471. sh2.r[n] -= 2;
  6472. WW( sh2.r[n], data );
  6473. }
  6474.  
  6475.  
  6476. static __inline__ void MOVLM(UINT32 m, UINT32 n)
  6477. {
  6478. UINT32 data = sh2.r[m];
  6479.  
  6480. sh2.r[n] -= 4;
  6481. WL( sh2.r[n], data );
  6482. }
  6483.  
  6484.  
  6485. static __inline__ void MOVBP(UINT32 m, UINT32 n)
  6486. {
  6487. sh2.r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2.r[m] );
  6488. if (n != m)
  6489. sh2.r[m] += 1;
  6490. }
  6491.  
  6492.  
  6493. static __inline__ void MOVWP(UINT32 m, UINT32 n)
  6494. {
  6495. sh2.r[n] = (UINT32)(INT32)(INT16) RW( sh2.r[m] );
  6496. if (n != m)
  6497. sh2.r[m] += 2;
  6498. }
  6499.  
  6500.  
  6501. static __inline__ void MOVLP(UINT32 m, UINT32 n)
  6502. {
  6503. sh2.r[n] = RL( sh2.r[m] );
  6504. if (n != m)
  6505. sh2.r[m] += 4;
  6506. }
  6507.  
  6508.  
  6509. static __inline__ void MOVBS0(UINT32 m, UINT32 n)
  6510. {
  6511. sh2.ea = sh2.r[n] + sh2.r[0];
  6512. WB( sh2.ea, sh2.r[m] & 0x000000ff );
  6513. }
  6514.  
  6515.  
  6516. static __inline__ void MOVWS0(UINT32 m, UINT32 n)
  6517. {
  6518. sh2.ea = sh2.r[n] + sh2.r[0];
  6519. WW( sh2.ea, sh2.r[m] & 0x0000ffff );
  6520. }
  6521.  
  6522.  
  6523. static __inline__ void MOVLS0(UINT32 m, UINT32 n)
  6524. {
  6525. sh2.ea = sh2.r[n] + sh2.r[0];
  6526. WL( sh2.ea, sh2.r[m] );
  6527. }
  6528.  
  6529.  
  6530. static __inline__ void MOVBL0(UINT32 m, UINT32 n)
  6531. {
  6532. sh2.ea = sh2.r[m] + sh2.r[0];
  6533. sh2.r[n] = (UINT32)(INT32)(INT16)(INT8) RB( sh2.ea );
  6534. }
  6535.  
  6536.  
  6537. static __inline__ void MOVWL0(UINT32 m, UINT32 n)
  6538. {
  6539. sh2.ea = sh2.r[m] + sh2.r[0];
  6540. sh2.r[n] = (UINT32)(INT32)(INT16) RW( sh2.ea );
  6541. }
  6542.  
  6543.  
  6544. static __inline__ void MOVLL0(UINT32 m, UINT32 n)
  6545. {
  6546. sh2.ea = sh2.r[m] + sh2.r[0];
  6547. sh2.r[n] = RL( sh2.ea );
  6548. }
  6549.  
  6550.  
  6551. static __inline__ void MOVI(UINT32 i, UINT32 n)
  6552. {
  6553. sh2.r[n] = (UINT32)(INT32)(INT16)(INT8) i;
  6554. }
  6555.  
  6556.  
  6557. static __inline__ void MOVWI(UINT32 d, UINT32 n)
  6558. {
  6559. UINT32 disp = d & 0xff;
  6560. sh2.ea = sh2.pc + disp * 2 + 2;
  6561. sh2.r[n] = (UINT32)(INT32)(INT16) RW( sh2.ea );
  6562. }
  6563.  
  6564.  
  6565. static __inline__ void MOVLI(UINT32 d, UINT32 n)
  6566. {
  6567. UINT32 disp = d & 0xff;
  6568. sh2.ea = ((sh2.pc + 2) & ~3) + disp * 4;
  6569. sh2.r[n] = RL( sh2.ea );
  6570. }
  6571.  
  6572.  
  6573. static __inline__ void MOVBLG(UINT32 d)
  6574. {
  6575. UINT32 disp = d & 0xff;
  6576. sh2.ea = sh2.gbr + disp;
  6577. sh2.r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2.ea );
  6578. }
  6579.  
  6580.  
  6581. static __inline__ void MOVWLG(UINT32 d)
  6582. {
  6583. UINT32 disp = d & 0xff;
  6584. sh2.ea = sh2.gbr + disp * 2;
  6585. sh2.r[0] = (INT32)(INT16) RW( sh2.ea );
  6586. }
  6587.  
  6588.  
  6589. static __inline__ void MOVLLG(UINT32 d)
  6590. {
  6591. UINT32 disp = d & 0xff;
  6592. sh2.ea = sh2.gbr + disp * 4;
  6593. sh2.r[0] = RL( sh2.ea );
  6594. }
  6595.  
  6596.  
  6597. static __inline__ void MOVBSG(UINT32 d)
  6598. {
  6599. UINT32 disp = d & 0xff;
  6600. sh2.ea = sh2.gbr + disp;
  6601. WB( sh2.ea, sh2.r[0] & 0x000000ff );
  6602. }
  6603.  
  6604.  
  6605. static __inline__ void MOVWSG(UINT32 d)
  6606. {
  6607. UINT32 disp = d & 0xff;
  6608. sh2.ea = sh2.gbr + disp * 2;
  6609. WW( sh2.ea, sh2.r[0] & 0x0000ffff );
  6610. }
  6611.  
  6612.  
  6613. static __inline__ void MOVLSG(UINT32 d)
  6614. {
  6615. UINT32 disp = d & 0xff;
  6616. sh2.ea = sh2.gbr + disp * 4;
  6617. WL( sh2.ea, sh2.r[0] );
  6618. }
  6619.  
  6620.  
  6621. static __inline__ void MOVBS4(UINT32 d, UINT32 n)
  6622. {
  6623. UINT32 disp = d & 0x0f;
  6624. sh2.ea = sh2.r[n] + disp;
  6625. WB( sh2.ea, sh2.r[0] & 0x000000ff );
  6626. }
  6627.  
  6628.  
  6629. static __inline__ void MOVWS4(UINT32 d, UINT32 n)
  6630. {
  6631. UINT32 disp = d & 0x0f;
  6632. sh2.ea = sh2.r[n] + disp * 2;
  6633. WW( sh2.ea, sh2.r[0] & 0x0000ffff );
  6634. }
  6635.  
  6636.  
  6637. static __inline__ void MOVLS4(UINT32 m, UINT32 d, UINT32 n)
  6638. {
  6639. UINT32 disp = d & 0x0f;
  6640. sh2.ea = sh2.r[n] + disp * 4;
  6641. WL( sh2.ea, sh2.r[m] );
  6642. }
  6643.  
  6644.  
  6645. static __inline__ void MOVBL4(UINT32 m, UINT32 d)
  6646. {
  6647. UINT32 disp = d & 0x0f;
  6648. sh2.ea = sh2.r[m] + disp;
  6649. sh2.r[0] = (UINT32)(INT32)(INT16)(INT8) RB( sh2.ea );
  6650. }
  6651.  
  6652.  
  6653. static __inline__ void MOVWL4(UINT32 m, UINT32 d)
  6654. {
  6655. UINT32 disp = d & 0x0f;
  6656. sh2.ea = sh2.r[m] + disp * 2;
  6657. sh2.r[0] = (UINT32)(INT32)(INT16) RW( sh2.ea );
  6658. }
  6659.  
  6660.  
  6661. static __inline__ void MOVLL4(UINT32 m, UINT32 d, UINT32 n)
  6662. {
  6663. UINT32 disp = d & 0x0f;
  6664. sh2.ea = sh2.r[m] + disp * 4;
  6665. sh2.r[n] = RL( sh2.ea );
  6666. }
  6667.  
  6668.  
  6669. static __inline__ void MOVA(UINT32 d)
  6670. {
  6671. UINT32 disp = d & 0xff;
  6672. sh2.ea = ((sh2.pc + 2) & ~3) + disp * 4;
  6673. sh2.r[0] = sh2.ea;
  6674. }
  6675.  
  6676.  
  6677. static __inline__ void MOVT(UINT32 n)
  6678. {
  6679. sh2.r[n] = sh2.sr & 0x00000001;
  6680. }
  6681.  
  6682.  
  6683. static __inline__ void MULL(UINT32 m, UINT32 n)
  6684. {
  6685. sh2.macl = sh2.r[n] * sh2.r[m];
  6686. sh2_icount--;
  6687. }
  6688.  
  6689.  
  6690. static __inline__ void MULS(UINT32 m, UINT32 n)
  6691. {
  6692. sh2.macl = (INT16) sh2.r[n] * (INT16) sh2.r[m];
  6693. }
  6694.  
  6695.  
  6696. static __inline__ void MULU(UINT32 m, UINT32 n)
  6697. {
  6698. sh2.macl = (UINT16) sh2.r[n] * (UINT16) sh2.r[m];
  6699. }
  6700.  
  6701.  
  6702. static __inline__ void NEG(UINT32 m, UINT32 n)
  6703. {
  6704. sh2.r[n] = 0 - sh2.r[m];
  6705. }
  6706.  
  6707.  
  6708. static __inline__ void NEGC(UINT32 m, UINT32 n)
  6709. {
  6710. UINT32 temp;
  6711.  
  6712. temp = sh2.r[m];
  6713. sh2.r[n] = -temp - (sh2.sr & 0x00000001);
  6714. if (temp || (sh2.sr & 0x00000001))
  6715. sh2.sr |= 0x00000001;
  6716. else
  6717. sh2.sr &= ~0x00000001;
  6718. }
  6719.  
  6720.  
  6721. static __inline__ void NOP(void)
  6722. {
  6723. }
  6724.  
  6725.  
  6726. static __inline__ void NOT(UINT32 m, UINT32 n)
  6727. {
  6728. sh2.r[n] = ~sh2.r[m];
  6729. }
  6730.  
  6731.  
  6732. static __inline__ void OR(UINT32 m, UINT32 n)
  6733. {
  6734. sh2.r[n] |= sh2.r[m];
  6735. }
  6736.  
  6737.  
  6738. static __inline__ void ORI(UINT32 i)
  6739. {
  6740. sh2.r[0] |= i;
  6741. sh2_icount -= 2;
  6742. }
  6743.  
  6744.  
  6745. static __inline__ void ORM(UINT32 i)
  6746. {
  6747. UINT32 temp;
  6748.  
  6749. sh2.ea = sh2.gbr + sh2.r[0];
  6750. temp = RB( sh2.ea );
  6751. temp |= i;
  6752. WB( sh2.ea, temp );
  6753. }
  6754.  
  6755.  
  6756. static __inline__ void ROTCL(UINT32 n)
  6757. {
  6758. UINT32 temp;
  6759.  
  6760. temp = (sh2.r[n] >> 31) & 0x00000001;
  6761. sh2.r[n] = (sh2.r[n] << 1) | (sh2.sr & 0x00000001);
  6762. sh2.sr = (sh2.sr & ~0x00000001) | temp;
  6763. }
  6764.  
  6765.  
  6766. static __inline__ void ROTCR(UINT32 n)
  6767. {
  6768. UINT32 temp;
  6769. temp = (sh2.sr & 0x00000001) << 31;
  6770. if (sh2.r[n] & 0x00000001)
  6771. sh2.sr |= 0x00000001;
  6772. else
  6773. sh2.sr &= ~0x00000001;
  6774. sh2.r[n] = (sh2.r[n] >> 1) | temp;
  6775. }
  6776.  
  6777.  
  6778. static __inline__ void ROTL(UINT32 n)
  6779. {
  6780. sh2.sr = (sh2.sr & ~0x00000001) | ((sh2.r[n] >> 31) & 0x00000001);
  6781. sh2.r[n] = (sh2.r[n] << 1) | (sh2.r[n] >> 31);
  6782. }
  6783.  
  6784.  
  6785. static __inline__ void ROTR(UINT32 n)
  6786. {
  6787. sh2.sr = (sh2.sr & ~0x00000001) | (sh2.r[n] & 0x00000001);
  6788. sh2.r[n] = (sh2.r[n] >> 1) | (sh2.r[n] << 31);
  6789. }
  6790.  
  6791.  
  6792. static __inline__ void RTE(void)
  6793. {
  6794. sh2.ea = sh2.r[15];
  6795. sh2.delay = sh2.pc;
  6796. sh2.pc = RL( sh2.ea );
  6797. sh2.r[15] += 4;
  6798. sh2.ea = sh2.r[15];
  6799. sh2.sr = RL( sh2.ea ) & (0x00000200|0x00000100|0x000000f0|0x00000002|0x00000001);
  6800. sh2.r[15] += 4;
  6801. sh2_icount -= 3;
  6802. sh2.test_irq = 1;
  6803. }
  6804.  
  6805.  
  6806. static __inline__ void RTS(void)
  6807. {
  6808. sh2.delay = sh2.pc;
  6809. sh2.pc = sh2.ea = sh2.pr;
  6810. sh2_icount--;
  6811. }
  6812.  
  6813.  
  6814. static __inline__ void SETT(void)
  6815. {
  6816. sh2.sr |= 0x00000001;
  6817. }
  6818.  
  6819.  
  6820. static __inline__ void SHAL(UINT32 n)
  6821. {
  6822. sh2.sr = (sh2.sr & ~0x00000001) | ((sh2.r[n] >> 31) & 0x00000001);
  6823. sh2.r[n] <<= 1;
  6824. }
  6825.  
  6826.  
  6827. static __inline__ void SHAR(UINT32 n)
  6828. {
  6829. sh2.sr = (sh2.sr & ~0x00000001) | (sh2.r[n] & 0x00000001);
  6830. sh2.r[n] = (UINT32)((INT32)sh2.r[n] >> 1);
  6831. }
  6832.  
  6833.  
  6834. static __inline__ void SHLL(UINT32 n)
  6835. {
  6836. sh2.sr = (sh2.sr & ~0x00000001) | ((sh2.r[n] >> 31) & 0x00000001);
  6837. sh2.r[n] <<= 1;
  6838. }
  6839.  
  6840.  
  6841. static __inline__ void SHLL2(UINT32 n)
  6842. {
  6843. sh2.r[n] <<= 2;
  6844. }
  6845.  
  6846.  
  6847. static __inline__ void SHLL8(UINT32 n)
  6848. {
  6849. sh2.r[n] <<= 8;
  6850. }
  6851.  
  6852.  
  6853. static __inline__ void SHLL16(UINT32 n)
  6854. {
  6855. sh2.r[n] <<= 16;
  6856. }
  6857.  
  6858.  
  6859. static __inline__ void SHLR(UINT32 n)
  6860. {
  6861. sh2.sr = (sh2.sr & ~0x00000001) | (sh2.r[n] & 0x00000001);
  6862. sh2.r[n] >>= 1;
  6863. }
  6864.  
  6865.  
  6866. static __inline__ void SHLR2(UINT32 n)
  6867. {
  6868. sh2.r[n] >>= 2;
  6869. }
  6870.  
  6871.  
  6872. static __inline__ void SHLR8(UINT32 n)
  6873. {
  6874. sh2.r[n] >>= 8;
  6875. }
  6876.  
  6877.  
  6878. static __inline__ void SHLR16(UINT32 n)
  6879. {
  6880. sh2.r[n] >>= 16;
  6881. }
  6882.  
  6883.  
  6884. static __inline__ void SLEEP(void)
  6885. {
  6886. sh2.pc -= 2;
  6887. sh2_icount -= 2;
  6888.  
  6889. }
  6890.  
  6891.  
  6892. static __inline__ void STCSR(UINT32 n)
  6893. {
  6894. sh2.r[n] = sh2.sr;
  6895. }
  6896.  
  6897.  
  6898. static __inline__ void STCGBR(UINT32 n)
  6899. {
  6900. sh2.r[n] = sh2.gbr;
  6901. }
  6902.  
  6903.  
  6904. static __inline__ void STCVBR(UINT32 n)
  6905. {
  6906. sh2.r[n] = sh2.vbr;
  6907. }
  6908.  
  6909.  
  6910. static __inline__ void STCMSR(UINT32 n)
  6911. {
  6912. sh2.r[n] -= 4;
  6913. sh2.ea = sh2.r[n];
  6914. WL( sh2.ea, sh2.sr );
  6915. sh2_icount--;
  6916. }
  6917.  
  6918.  
  6919. static __inline__ void STCMGBR(UINT32 n)
  6920. {
  6921. sh2.r[n] -= 4;
  6922. sh2.ea = sh2.r[n];
  6923. WL( sh2.ea, sh2.gbr );
  6924. sh2_icount--;
  6925. }
  6926.  
  6927.  
  6928. static __inline__ void STCMVBR(UINT32 n)
  6929. {
  6930. sh2.r[n] -= 4;
  6931. sh2.ea = sh2.r[n];
  6932. WL( sh2.ea, sh2.vbr );
  6933. sh2_icount--;
  6934. }
  6935.  
  6936.  
  6937. static __inline__ void STSMACH(UINT32 n)
  6938. {
  6939. sh2.r[n] = sh2.mach;
  6940. }
  6941.  
  6942.  
  6943. static __inline__ void STSMACL(UINT32 n)
  6944. {
  6945. sh2.r[n] = sh2.macl;
  6946. }
  6947.  
  6948.  
  6949. static __inline__ void STSPR(UINT32 n)
  6950. {
  6951. sh2.r[n] = sh2.pr;
  6952. }
  6953.  
  6954.  
  6955. static __inline__ void STSMMACH(UINT32 n)
  6956. {
  6957. sh2.r[n] -= 4;
  6958. sh2.ea = sh2.r[n];
  6959. WL( sh2.ea, sh2.mach );
  6960. }
  6961.  
  6962.  
  6963. static __inline__ void STSMMACL(UINT32 n)
  6964. {
  6965. sh2.r[n] -= 4;
  6966. sh2.ea = sh2.r[n];
  6967. WL( sh2.ea, sh2.macl );
  6968. }
  6969.  
  6970.  
  6971. static __inline__ void STSMPR(UINT32 n)
  6972. {
  6973. sh2.r[n] -= 4;
  6974. sh2.ea = sh2.r[n];
  6975. WL( sh2.ea, sh2.pr );
  6976. }
  6977.  
  6978.  
  6979. static __inline__ void SUB(UINT32 m, UINT32 n)
  6980. {
  6981. sh2.r[n] -= sh2.r[m];
  6982. }
  6983.  
  6984.  
  6985. static __inline__ void SUBC(UINT32 m, UINT32 n)
  6986. {
  6987. UINT32 tmp0, tmp1;
  6988.  
  6989. tmp1 = sh2.r[n] - sh2.r[m];
  6990. tmp0 = sh2.r[n];
  6991. sh2.r[n] = tmp1 - (sh2.sr & 0x00000001);
  6992. if (tmp0 < tmp1)
  6993. sh2.sr |= 0x00000001;
  6994. else
  6995. sh2.sr &= ~0x00000001;
  6996. if (tmp1 < sh2.r[n])
  6997. sh2.sr |= 0x00000001;
  6998. }
  6999.  
  7000.  
  7001. static __inline__ void SUBV(UINT32 m, UINT32 n)
  7002. {
  7003. INT32 dest, src, ans;
  7004.  
  7005. if ((INT32) sh2.r[n] >= 0)
  7006. dest = 0;
  7007. else
  7008. dest = 1;
  7009. if ((INT32) sh2.r[m] >= 0)
  7010. src = 0;
  7011. else
  7012. src = 1;
  7013. src += dest;
  7014. sh2.r[n] -= sh2.r[m];
  7015. if ((INT32) sh2.r[n] >= 0)
  7016. ans = 0;
  7017. else
  7018. ans = 1;
  7019. ans += dest;
  7020. if (src == 1)
  7021. {
  7022. if (ans == 1)
  7023. sh2.sr |= 0x00000001;
  7024. else
  7025. sh2.sr &= ~0x00000001;
  7026. }
  7027. else
  7028. sh2.sr &= ~0x00000001;
  7029. }
  7030.  
  7031.  
  7032. static __inline__ void SWAPB(UINT32 m, UINT32 n)
  7033. {
  7034. UINT32 temp0, temp1;
  7035.  
  7036. temp0 = sh2.r[m] & 0xffff0000;
  7037. temp1 = (sh2.r[m] & 0x000000ff) << 8;
  7038. sh2.r[n] = (sh2.r[m] >> 8) & 0x000000ff;
  7039. sh2.r[n] = sh2.r[n] | temp1 | temp0;
  7040. }
  7041.  
  7042.  
  7043. static __inline__ void SWAPW(UINT32 m, UINT32 n)
  7044. {
  7045. UINT32 temp;
  7046.  
  7047. temp = (sh2.r[m] >> 16) & 0x0000ffff;
  7048. sh2.r[n] = (sh2.r[m] << 16) | temp;
  7049. }
  7050.  
  7051.  
  7052. static __inline__ void TAS(UINT32 n)
  7053. {
  7054. UINT32 temp;
  7055. sh2.ea = sh2.r[n];
  7056.  
  7057. temp = RB( sh2.ea );
  7058. if (temp == 0)
  7059. sh2.sr |= 0x00000001;
  7060. else
  7061. sh2.sr &= ~0x00000001;
  7062. temp |= 0x80;
  7063.  
  7064. WB( sh2.ea, temp );
  7065. sh2_icount -= 3;
  7066. }
  7067.  
  7068.  
  7069. static __inline__ void TRAPA(UINT32 i)
  7070. {
  7071. UINT32 imm = i & 0xff;
  7072.  
  7073. sh2.ea = sh2.vbr + imm * 4;
  7074.  
  7075. sh2.r[15] -= 4;
  7076. WL( sh2.r[15], sh2.sr );
  7077. sh2.r[15] -= 4;
  7078. WL( sh2.r[15], sh2.pc );
  7079.  
  7080. sh2.pc = RL( sh2.ea );
  7081. do { if (active_address_space[0].readlookup[(((sh2.pc & 0x07ffffff) & active_address_space[0].addrmask) >> (32 - 18))] != opcode_entry) memory_set_opbase(sh2.pc & 0x07ffffff); } while (0);
  7082.  
  7083. sh2_icount -= 7;
  7084. }
  7085.  
  7086.  
  7087. static __inline__ void TST(UINT32 m, UINT32 n)
  7088. {
  7089. if ((sh2.r[n] & sh2.r[m]) == 0)
  7090. sh2.sr |= 0x00000001;
  7091. else
  7092. sh2.sr &= ~0x00000001;
  7093. }
  7094.  
  7095.  
  7096. static __inline__ void TSTI(UINT32 i)
  7097. {
  7098. UINT32 imm = i & 0xff;
  7099.  
  7100. if ((imm & sh2.r[0]) == 0)
  7101. sh2.sr |= 0x00000001;
  7102. else
  7103. sh2.sr &= ~0x00000001;
  7104. }
  7105.  
  7106.  
  7107. static __inline__ void TSTM(UINT32 i)
  7108. {
  7109. UINT32 imm = i & 0xff;
  7110.  
  7111. sh2.ea = sh2.gbr + sh2.r[0];
  7112. if ((imm & RB( sh2.ea )) == 0)
  7113. sh2.sr |= 0x00000001;
  7114. else
  7115. sh2.sr &= ~0x00000001;
  7116. sh2_icount -= 2;
  7117. }
  7118.  
  7119.  
  7120. static __inline__ void XOR(UINT32 m, UINT32 n)
  7121. {
  7122. sh2.r[n] ^= sh2.r[m];
  7123. }
  7124.  
  7125.  
  7126. static __inline__ void XORI(UINT32 i)
  7127. {
  7128. UINT32 imm = i & 0xff;
  7129. sh2.r[0] ^= imm;
  7130. }
  7131.  
  7132.  
  7133. static __inline__ void XORM(UINT32 i)
  7134. {
  7135. UINT32 imm = i & 0xff;
  7136. UINT32 temp;
  7137.  
  7138. sh2.ea = sh2.gbr + sh2.r[0];
  7139. temp = RB( sh2.ea );
  7140. temp ^= imm;
  7141. WB( sh2.ea, temp );
  7142. sh2_icount -= 2;
  7143. }
  7144.  
  7145.  
  7146. static __inline__ void XTRCT(UINT32 m, UINT32 n)
  7147. {
  7148. UINT32 temp;
  7149.  
  7150. temp = (sh2.r[m] << 16) & 0xffff0000;
  7151. sh2.r[n] = (sh2.r[n] >> 16) & 0x0000ffff;
  7152. sh2.r[n] |= temp;
  7153. }
  7154.  
  7155.  
  7156.  
  7157.  
  7158.  
  7159. static __inline__ void op0000(UINT16 opcode)
  7160. {
  7161. switch (opcode & 0x3F)
  7162. {
  7163. case 0x00: NOP(); break;
  7164. case 0x01: NOP(); break;
  7165. case 0x02: STCSR(((opcode>>8)&15)); break;
  7166. case 0x03: BSRF(((opcode>>8)&15)); break;
  7167. case 0x04: MOVBS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7168. case 0x05: MOVWS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7169. case 0x06: MOVLS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7170. case 0x07: MULL(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7171. case 0x08: CLRT(); break;
  7172. case 0x09: NOP(); break;
  7173. case 0x0a: STSMACH(((opcode>>8)&15)); break;
  7174. case 0x0b: RTS(); break;
  7175. case 0x0c: MOVBL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7176. case 0x0d: MOVWL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7177. case 0x0e: MOVLL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7178. case 0x0f: MAC_L(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7179.  
  7180. case 0x10: NOP(); break;
  7181. case 0x11: NOP(); break;
  7182. case 0x12: STCGBR(((opcode>>8)&15)); break;
  7183. case 0x13: NOP(); break;
  7184. case 0x14: MOVBS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7185. case 0x15: MOVWS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7186. case 0x16: MOVLS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7187. case 0x17: MULL(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7188. case 0x18: SETT(); break;
  7189. case 0x19: DIV0U(); break;
  7190. case 0x1a: STSMACL(((opcode>>8)&15)); break;
  7191. case 0x1b: SLEEP(); break;
  7192. case 0x1c: MOVBL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7193. case 0x1d: MOVWL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7194. case 0x1e: MOVLL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7195. case 0x1f: MAC_L(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7196.  
  7197. case 0x20: NOP(); break;
  7198. case 0x21: NOP(); break;
  7199. case 0x22: STCVBR(((opcode>>8)&15)); break;
  7200. case 0x23: BRAF(((opcode>>8)&15)); break;
  7201. case 0x24: MOVBS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7202. case 0x25: MOVWS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7203. case 0x26: MOVLS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7204. case 0x27: MULL(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7205. case 0x28: CLRMAC(); break;
  7206. case 0x29: MOVT(((opcode>>8)&15)); break;
  7207. case 0x2a: STSPR(((opcode>>8)&15)); break;
  7208. case 0x2b: RTE(); break;
  7209. case 0x2c: MOVBL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7210. case 0x2d: MOVWL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7211. case 0x2e: MOVLL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7212. case 0x2f: MAC_L(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7213.  
  7214. case 0x30: NOP(); break;
  7215. case 0x31: NOP(); break;
  7216. case 0x32: NOP(); break;
  7217. case 0x33: NOP(); break;
  7218. case 0x34: MOVBS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7219. case 0x35: MOVWS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7220. case 0x36: MOVLS0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7221. case 0x37: MULL(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7222. case 0x38: NOP(); break;
  7223. case 0x39: NOP(); break;
  7224. case 0x3c: MOVBL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7225. case 0x3d: MOVWL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7226. case 0x3e: MOVLL0(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7227. case 0x3f: MAC_L(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7228. case 0x3a: NOP(); break;
  7229. case 0x3b: NOP(); break;
  7230.  
  7231.  
  7232.  
  7233. }
  7234. }
  7235.  
  7236. static __inline__ void op0001(UINT16 opcode)
  7237. {
  7238. MOVLS4(((opcode>>4)&15), opcode & 0x0f, ((opcode>>8)&15));
  7239. }
  7240.  
  7241. static __inline__ void op0010(UINT16 opcode)
  7242. {
  7243. switch (opcode & 15)
  7244. {
  7245. case 0: MOVBS(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7246. case 1: MOVWS(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7247. case 2: MOVLS(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7248. case 3: NOP(); break;
  7249. case 4: MOVBM(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7250. case 5: MOVWM(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7251. case 6: MOVLM(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7252. case 7: DIV0S(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7253. case 8: TST(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7254. case 9: AND(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7255. case 10: XOR(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7256. case 11: OR(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7257. case 12: CMPSTR(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7258. case 13: XTRCT(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7259. case 14: MULU(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7260. case 15: MULS(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7261. }
  7262. }
  7263.  
  7264. static __inline__ void op0011(UINT16 opcode)
  7265. {
  7266. switch (opcode & 15)
  7267. {
  7268. case 0: CMPEQ(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7269. case 1: NOP(); break;
  7270. case 2: CMPHS(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7271. case 3: CMPGE(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7272. case 4: DIV1(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7273. case 5: DMULU(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7274. case 6: CMPHI(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7275. case 7: CMPGT(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7276. case 8: SUB(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7277. case 9: NOP(); break;
  7278. case 10: SUBC(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7279. case 11: SUBV(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7280. case 12: ADD(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7281. case 13: DMULS(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7282. case 14: ADDC(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7283. case 15: ADDV(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7284. }
  7285. }
  7286.  
  7287. static __inline__ void op0100(UINT16 opcode)
  7288. {
  7289. switch (opcode & 0x3F)
  7290. {
  7291. case 0x00: SHLL(((opcode>>8)&15)); break;
  7292. case 0x01: SHLR(((opcode>>8)&15)); break;
  7293. case 0x02: STSMMACH(((opcode>>8)&15)); break;
  7294. case 0x03: STCMSR(((opcode>>8)&15)); break;
  7295. case 0x04: ROTL(((opcode>>8)&15)); break;
  7296. case 0x05: ROTR(((opcode>>8)&15)); break;
  7297. case 0x06: LDSMMACH(((opcode>>8)&15)); break;
  7298. case 0x07: LDCMSR(((opcode>>8)&15)); break;
  7299. case 0x08: SHLL2(((opcode>>8)&15)); break;
  7300. case 0x09: SHLR2(((opcode>>8)&15)); break;
  7301. case 0x0a: LDSMACH(((opcode>>8)&15)); break;
  7302. case 0x0b: JSR(((opcode>>8)&15)); break;
  7303. case 0x0c: NOP(); break;
  7304. case 0x0d: NOP(); break;
  7305. case 0x0e: LDCSR(((opcode>>8)&15)); break;
  7306. case 0x0f: MAC_W(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7307.  
  7308. case 0x10: DT(((opcode>>8)&15)); break;
  7309. case 0x11: CMPPZ(((opcode>>8)&15)); break;
  7310. case 0x12: STSMMACL(((opcode>>8)&15)); break;
  7311. case 0x13: STCMGBR(((opcode>>8)&15)); break;
  7312. case 0x14: NOP(); break;
  7313. case 0x15: CMPPL(((opcode>>8)&15)); break;
  7314. case 0x16: LDSMMACL(((opcode>>8)&15)); break;
  7315. case 0x17: LDCMGBR(((opcode>>8)&15)); break;
  7316. case 0x18: SHLL8(((opcode>>8)&15)); break;
  7317. case 0x19: SHLR8(((opcode>>8)&15)); break;
  7318. case 0x1a: LDSMACL(((opcode>>8)&15)); break;
  7319. case 0x1b: TAS(((opcode>>8)&15)); break;
  7320. case 0x1c: NOP(); break;
  7321. case 0x1d: NOP(); break;
  7322. case 0x1e: LDCGBR(((opcode>>8)&15)); break;
  7323. case 0x1f: MAC_W(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7324.  
  7325. case 0x20: SHAL(((opcode>>8)&15)); break;
  7326. case 0x21: SHAR(((opcode>>8)&15)); break;
  7327. case 0x22: STSMPR(((opcode>>8)&15)); break;
  7328. case 0x23: STCMVBR(((opcode>>8)&15)); break;
  7329. case 0x24: ROTCL(((opcode>>8)&15)); break;
  7330. case 0x25: ROTCR(((opcode>>8)&15)); break;
  7331. case 0x26: LDSMPR(((opcode>>8)&15)); break;
  7332. case 0x27: LDCMVBR(((opcode>>8)&15)); break;
  7333. case 0x28: SHLL16(((opcode>>8)&15)); break;
  7334. case 0x29: SHLR16(((opcode>>8)&15)); break;
  7335. case 0x2a: LDSPR(((opcode>>8)&15)); break;
  7336. case 0x2b: JMP(((opcode>>8)&15)); break;
  7337. case 0x2c: NOP(); break;
  7338. case 0x2d: NOP(); break;
  7339. case 0x2e: LDCVBR(((opcode>>8)&15)); break;
  7340. case 0x2f: MAC_W(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7341.  
  7342. case 0x30: NOP(); break;
  7343. case 0x31: NOP(); break;
  7344. case 0x32: NOP(); break;
  7345. case 0x33: NOP(); break;
  7346. case 0x34: NOP(); break;
  7347. case 0x35: NOP(); break;
  7348. case 0x36: NOP(); break;
  7349. case 0x37: NOP(); break;
  7350. case 0x38: NOP(); break;
  7351. case 0x39: NOP(); break;
  7352. case 0x3a: NOP(); break;
  7353. case 0x3b: NOP(); break;
  7354. case 0x3c: NOP(); break;
  7355. case 0x3d: NOP(); break;
  7356. case 0x3e: NOP(); break;
  7357. case 0x3f: MAC_W(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7358.  
  7359. }
  7360. }
  7361.  
  7362. static __inline__ void op0101(UINT16 opcode)
  7363. {
  7364. MOVLL4(((opcode>>4)&15), opcode & 0x0f, ((opcode>>8)&15));
  7365. }
  7366.  
  7367. static __inline__ void op0110(UINT16 opcode)
  7368. {
  7369. switch (opcode & 15)
  7370. {
  7371. case 0: MOVBL(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7372. case 1: MOVWL(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7373. case 2: MOVLL(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7374. case 3: MOV(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7375. case 4: MOVBP(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7376. case 5: MOVWP(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7377. case 6: MOVLP(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7378. case 7: NOT(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7379. case 8: SWAPB(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7380. case 9: SWAPW(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7381. case 10: NEGC(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7382. case 11: NEG(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7383. case 12: EXTUB(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7384. case 13: EXTUW(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7385. case 14: EXTSB(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7386. case 15: EXTSW(((opcode>>4)&15), ((opcode>>8)&15)); break;
  7387. }
  7388. }
  7389.  
  7390. static __inline__ void op0111(UINT16 opcode)
  7391. {
  7392. ADDI(opcode & 0xff, ((opcode>>8)&15));
  7393. }
  7394.  
  7395. static __inline__ void op1000(UINT16 opcode)
  7396. {
  7397. switch ( opcode & (15<<8) )
  7398. {
  7399. case 0 << 8: MOVBS4(opcode & 0x0f, ((opcode>>4)&15)); break;
  7400. case 1 << 8: MOVWS4(opcode & 0x0f, ((opcode>>4)&15)); break;
  7401. case 2<< 8: NOP(); break;
  7402. case 3<< 8: NOP(); break;
  7403. case 4<< 8: MOVBL4(((opcode>>4)&15), opcode & 0x0f); break;
  7404. case 5<< 8: MOVWL4(((opcode>>4)&15), opcode & 0x0f); break;
  7405. case 6<< 8: NOP(); break;
  7406. case 7<< 8: NOP(); break;
  7407. case 8<< 8: CMPIM(opcode & 0xff); break;
  7408. case 9<< 8: BT(opcode & 0xff); break;
  7409. case 10<< 8: NOP(); break;
  7410. case 11<< 8: BF(opcode & 0xff); break;
  7411. case 12<< 8: NOP(); break;
  7412. case 13<< 8: BTS(opcode & 0xff); break;
  7413. case 14<< 8: NOP(); break;
  7414. case 15<< 8: BFS(opcode & 0xff); break;
  7415. }
  7416. }
  7417.  
  7418.  
  7419. static __inline__ void op1001(UINT16 opcode)
  7420. {
  7421. MOVWI(opcode & 0xff, ((opcode>>8)&15));
  7422. }
  7423.  
  7424. static __inline__ void op1010(UINT16 opcode)
  7425. {
  7426. BRA(opcode & 0xfff);
  7427. }
  7428.  
  7429. static __inline__ void op1011(UINT16 opcode)
  7430. {
  7431. BSR(opcode & 0xfff);
  7432. }
  7433.  
  7434. static __inline__ void op1100(UINT16 opcode)
  7435. {
  7436. switch (opcode & (15<<8))
  7437. {
  7438. case 0<<8: MOVBSG(opcode & 0xff); break;
  7439. case 1<<8: MOVWSG(opcode & 0xff); break;
  7440. case 2<<8: MOVLSG(opcode & 0xff); break;
  7441. case 3<<8: TRAPA(opcode & 0xff); break;
  7442. case 4<<8: MOVBLG(opcode & 0xff); break;
  7443. case 5<<8: MOVWLG(opcode & 0xff); break;
  7444. case 6<<8: MOVLLG(opcode & 0xff); break;
  7445. case 7<<8: MOVA(opcode & 0xff); break;
  7446. case 8<<8: TSTI(opcode & 0xff); break;
  7447. case 9<<8: ANDI(opcode & 0xff); break;
  7448. case 10<<8: XORI(opcode & 0xff); break;
  7449. case 11<<8: ORI(opcode & 0xff); break;
  7450. case 12<<8: TSTM(opcode & 0xff); break;
  7451. case 13<<8: ANDM(opcode & 0xff); break;
  7452. case 14<<8: XORM(opcode & 0xff); break;
  7453. case 15<<8: ORM(opcode & 0xff); break;
  7454. }
  7455. }
  7456.  
  7457. static __inline__ void op1101(UINT16 opcode)
  7458. {
  7459. MOVLI(opcode & 0xff, ((opcode>>8)&15));
  7460. }
  7461.  
  7462. static __inline__ void op1110(UINT16 opcode)
  7463. {
  7464. MOVI(opcode & 0xff, ((opcode>>8)&15));
  7465. }
  7466.  
  7467. static __inline__ void op1111(UINT16 opcode)
  7468. {
  7469. NOP();
  7470. }
  7471.  
  7472.  
  7473.  
  7474.  
  7475.  
  7476. static void sh2_reset(void)
  7477. {
  7478. void *tsave, *tsaved0, *tsaved1;
  7479. UINT32 *m;
  7480. int cpunum;
  7481. int save_is_slave;
  7482.  
  7483. void (*f)(UINT32 data);
  7484. int (*save_irqcallback)(int);
  7485.  
  7486. cpunum = sh2.cpu_number;
  7487. m = sh2.m;
  7488. tsave = sh2.timer;
  7489. tsaved0 = sh2.dma_timer[0];
  7490. tsaved1 = sh2.dma_timer[1];
  7491.  
  7492. f = sh2.ftcsr_read_callback;
  7493. save_irqcallback = sh2.irq_callback;
  7494. save_is_slave = sh2.is_slave;
  7495. memset(&sh2, 0, sizeof(SH2));
  7496. sh2.is_slave = save_is_slave;
  7497. sh2.ftcsr_read_callback = f;
  7498. sh2.irq_callback = save_irqcallback;
  7499.  
  7500. sh2.timer = tsave;
  7501. sh2.dma_timer[0] = tsaved0;
  7502. sh2.dma_timer[1] = tsaved1;
  7503. sh2.cpu_number = cpunum;
  7504. sh2.m = m;
  7505. memset(sh2.m, 0, 0x200);
  7506.  
  7507. sh2.pc = RL(0);
  7508. sh2.r[15] = RL(4);
  7509. sh2.sr = 0x000000f0;
  7510. do { if (active_address_space[0].readlookup[(((sh2.pc & 0x07ffffff) & active_address_space[0].addrmask) >> (32 - 18))] != opcode_entry) memory_set_opbase(sh2.pc & 0x07ffffff); } while (0);
  7511.  
  7512. sh2.internal_irq_level = -1;
  7513. }
  7514.  
  7515.  
  7516. static void sh2_exit(void)
  7517. {
  7518. if (sh2.m)
  7519. free(sh2.m);
  7520. sh2.m = ((void *)0);
  7521. }
  7522.  
  7523.  
  7524. static int sh2_execute(int cycles)
  7525. {
  7526. sh2_icount = cycles;
  7527.  
  7528. if (sh2.cpu_off)
  7529. return 0;
  7530.  
  7531. do
  7532. {
  7533. UINT32 opcode;
  7534.  
  7535. if (sh2.delay)
  7536. {
  7537. opcode = cpu_readop16((((UINT32)(sh2.delay & 0x07ffffff)) ^ 2));
  7538. do { if (active_address_space[0].readlookup[(((sh2.pc & 0x07ffffff) & active_address_space[0].addrmask) >> (32 - 18))] != opcode_entry) memory_set_opbase(sh2.pc & 0x07ffffff); } while (0);
  7539. sh2.pc -= 2;
  7540. }
  7541. else
  7542. opcode = cpu_readop16((((UINT32)(sh2.pc & 0x07ffffff)) ^ 2));
  7543.  
  7544. ;
  7545.  
  7546. sh2.delay = 0;
  7547. sh2.pc += 2;
  7548. sh2.ppc = sh2.pc;
  7549.  
  7550. switch (opcode & ( 15 << 12))
  7551. {
  7552. case 0<<12: op0000(opcode); break;
  7553. case 1<<12: op0001(opcode); break;
  7554. case 2<<12: op0010(opcode); break;
  7555. case 3<<12: op0011(opcode); break;
  7556. case 4<<12: op0100(opcode); break;
  7557. case 5<<12: op0101(opcode); break;
  7558. case 6<<12: op0110(opcode); break;
  7559. case 7<<12: op0111(opcode); break;
  7560. case 8<<12: op1000(opcode); break;
  7561. case 9<<12: op1001(opcode); break;
  7562. case 10<<12: op1010(opcode); break;
  7563. case 11<<12: op1011(opcode); break;
  7564. case 12<<12: op1100(opcode); break;
  7565. case 13<<12: op1101(opcode); break;
  7566. case 14<<12: op1110(opcode); break;
  7567. default: op1111(opcode); break;
  7568. }
  7569.  
  7570. if(sh2.test_irq && !sh2.delay)
  7571. {
  7572. do { int irq = -1; if (sh2.pending_irq & (1 << 0)) irq = 0; if (sh2.pending_irq & (1 << 1)) irq = 1; if (sh2.pending_irq & (1 << 2)) irq = 2; if (sh2.pending_irq & (1 << 3)) irq = 3; if (sh2.pending_irq & (1 << 4)) irq = 4; if (sh2.pending_irq & (1 << 5)) irq = 5; if (sh2.pending_irq & (1 << 6)) irq = 6; if (sh2.pending_irq & (1 << 7)) irq = 7; if (sh2.pending_irq & (1 << 8)) irq = 8; if (sh2.pending_irq & (1 << 9)) irq = 9; if (sh2.pending_irq & (1 << 10)) irq = 10; if (sh2.pending_irq & (1 << 11)) irq = 11; if (sh2.pending_irq & (1 << 12)) irq = 12; if (sh2.pending_irq & (1 << 13)) irq = 13; if (sh2.pending_irq & (1 << 14)) irq = 14; if (sh2.pending_irq & (1 << 15)) irq = 15; if ((sh2.internal_irq_level != -1) && (sh2.internal_irq_level > irq)) irq = sh2.internal_irq_level; if (irq >= 0) sh2_exception("mame_sh2_execute",irq); } while(0);
  7573. sh2.test_irq = 0;
  7574. }
  7575. sh2_icount--;
  7576. } while( sh2_icount > 0 );
  7577.  
  7578. return cycles - sh2_icount;
  7579. }
  7580.  
  7581.  
  7582. static void sh2_get_context(void *dst)
  7583. {
  7584. if( dst )
  7585. memcpy(dst, &sh2, sizeof(SH2));
  7586. }
  7587.  
  7588.  
  7589. static void sh2_set_context(void *src)
  7590. {
  7591. if( src )
  7592. memcpy(&sh2, src, sizeof(SH2));
  7593. }
  7594.  
  7595. static void sh2_timer_resync(void)
  7596. {
  7597. int divider = div_tab[(sh2.m[5] >> 8) & 3];
  7598. UINT32 cur_time = cpunum_gettotalcycles(sh2.cpu_number);
  7599.  
  7600. if(divider)
  7601. sh2.frc += (cur_time - sh2.frc_base) >> divider;
  7602. sh2.frc_base = cur_time;
  7603. }
  7604.  
  7605. static void sh2_timer_activate(void)
  7606. {
  7607. int max_delta = 0xfffff;
  7608. UINT16 frc;
  7609.  
  7610. mame_timer_adjust(sh2.timer, double_to_mame_time((1.0e30)), 0, double_to_mame_time(0));
  7611.  
  7612. frc = sh2.frc;
  7613. if(!(sh2.m[4] & OCFA)) {
  7614. UINT16 delta = sh2.ocra - frc;
  7615. if(delta < max_delta)
  7616. max_delta = delta;
  7617. }
  7618.  
  7619. if(!(sh2.m[4] & OCFB) && (sh2.ocra <= sh2.ocrb || !(sh2.m[4] & 0x010000))) {
  7620. UINT16 delta = sh2.ocrb - frc;
  7621. if(delta < max_delta)
  7622. max_delta = delta;
  7623. }
  7624.  
  7625. if(!(sh2.m[4] & OVF) && !(sh2.m[4] & 0x010000)) {
  7626. int delta = 0x10000 - frc;
  7627. if(delta < max_delta)
  7628. max_delta = delta;
  7629. }
  7630.  
  7631. if(max_delta != 0xfffff) {
  7632. int divider = div_tab[(sh2.m[5] >> 8) & 3];
  7633. if(divider) {
  7634. max_delta <<= divider;
  7635. sh2.frc_base = cpunum_gettotalcycles(sh2.cpu_number);
  7636. mame_timer_adjust(sh2.timer, double_to_mame_time(((double)(max_delta) * cycles_to_sec[sh2.cpu_number])), sh2.cpu_number, double_to_mame_time(0));
  7637. } else {
  7638. logerror("SH2.%d: Timer event in %d cycles of external clock", sh2.cpu_number, max_delta);
  7639. }
  7640. }
  7641. }
  7642.  
  7643. static void sh2_recalc_irq(void)
  7644. {
  7645. int irq = 0, vector = -1;
  7646. int level;
  7647.  
  7648.  
  7649. if((sh2.m[4]>>8) & sh2.m[4] & (ICF|OCFA|OCFB|OVF))
  7650. {
  7651. level = (sh2.m[0x18] >> 24) & 15;
  7652. if(level > irq)
  7653. {
  7654. int mask = (sh2.m[4]>>8) & sh2.m[4];
  7655. irq = level;
  7656. if(mask & ICF)
  7657. vector = (sh2.m[0x19] >> 8) & 0x7f;
  7658. else if(mask & (OCFA|OCFB))
  7659. vector = sh2.m[0x19] & 0x7f;
  7660. else
  7661. vector = (sh2.m[0x1a] >> 24) & 0x7f;
  7662. }
  7663. }
  7664.  
  7665.  
  7666. if((sh2.m[0x63] & 6) == 6) {
  7667. level = (sh2.m[0x38] >> 8) & 15;
  7668. if(level > irq) {
  7669. irq = level;
  7670. vector = (sh2.m[0x68] >> 24) & 0x7f;
  7671. }
  7672. }
  7673.  
  7674. if((sh2.m[0x67] & 6) == 6) {
  7675. level = (sh2.m[0x38] >> 8) & 15;
  7676. if(level > irq) {
  7677. irq = level;
  7678. vector = (sh2.m[0x6a] >> 24) & 0x7f;
  7679. }
  7680. }
  7681.  
  7682.  
  7683. sh2.internal_irq_level = irq;
  7684. sh2.internal_irq_vector = vector;
  7685. sh2.test_irq = 1;
  7686. }
  7687.  
  7688. static void sh2_timer_callback(int cpunum)
  7689. {
  7690. UINT16 frc;
  7691.  
  7692. cpuintrf_push_context(cpunum);
  7693. sh2_timer_resync();
  7694.  
  7695. frc = sh2.frc;
  7696.  
  7697. if(frc == sh2.ocrb)
  7698. sh2.m[4] |= OCFB;
  7699.  
  7700. if(frc == 0x0000)
  7701. sh2.m[4] |= OVF;
  7702.  
  7703. if(frc == sh2.ocra)
  7704. {
  7705. sh2.m[4] |= OCFA;
  7706.  
  7707. if(sh2.m[4] & 0x010000)
  7708. sh2.frc = 0;
  7709. }
  7710.  
  7711. sh2_recalc_irq();
  7712. sh2_timer_activate();
  7713.  
  7714. cpuintrf_pop_context();
  7715. }
  7716.  
  7717. static void sh2_dmac_callback(int dma)
  7718. {
  7719. int cpunum = dma >> 1;
  7720. dma &= 1;
  7721.  
  7722. cpuintrf_push_context(cpunum);
  7723. ;
  7724. sh2.m[0x63+4*dma] |= 2;
  7725. sh2.dma_timer_active[dma] = 0;
  7726. sh2_recalc_irq();
  7727. cpuintrf_pop_context();
  7728. }
  7729.  
  7730. static void sh2_dmac_check(int dma)
  7731. {
  7732. if(sh2.m[0x63+4*dma] & sh2.m[0x6c] & 1)
  7733. {
  7734. if(!sh2.dma_timer_active[dma] && !(sh2.m[0x63+4*dma] & 2))
  7735. {
  7736. int incs, incd, size;
  7737. UINT32 src, dst, count;
  7738. incd = (sh2.m[0x63+4*dma] >> 14) & 3;
  7739. incs = (sh2.m[0x63+4*dma] >> 12) & 3;
  7740. size = (sh2.m[0x63+4*dma] >> 10) & 3;
  7741. if(incd == 3 || incs == 3)
  7742. {
  7743. logerror("SH2: DMA: bad increment values (%d, %d, %d, %04x)\n", incd, incs, size, sh2.m[0x63+4*dma]);
  7744. return;
  7745. }
  7746. src = sh2.m[0x60+4*dma];
  7747. dst = sh2.m[0x61+4*dma];
  7748. count = sh2.m[0x62+4*dma];
  7749. if(!count)
  7750. count = 0x1000000;
  7751.  
  7752. ;
  7753.  
  7754. sh2.dma_timer_active[dma] = 1;
  7755. mame_timer_adjust(sh2.dma_timer[dma], double_to_mame_time(((double)(2*count+1) * cycles_to_sec[sh2.cpu_number])), (sh2.cpu_number<<1)|dma, double_to_mame_time(0));
  7756.  
  7757. src &= 0x07ffffff;
  7758. dst &= 0x07ffffff;
  7759.  
  7760. switch(size)
  7761. {
  7762. case 0:
  7763. for(;count > 0; count --)
  7764. {
  7765. if(incs == 2)
  7766. src --;
  7767. if(incd == 2)
  7768. dst --;
  7769. program_write_byte_32be(dst, program_read_byte_32be(src));
  7770. if(incs == 1)
  7771. src ++;
  7772. if(incd == 1)
  7773. dst ++;
  7774. }
  7775. break;
  7776. case 1:
  7777. src &= ~1;
  7778. dst &= ~1;
  7779. for(;count > 0; count --)
  7780. {
  7781. if(incs == 2)
  7782. src -= 2;
  7783. if(incd == 2)
  7784. dst -= 2;
  7785. program_write_word_32be(dst, program_read_word_32be(src));
  7786. if(incs == 1)
  7787. src += 2;
  7788. if(incd == 1)
  7789. dst += 2;
  7790. }
  7791. break;
  7792. case 2:
  7793. src &= ~3;
  7794. dst &= ~3;
  7795. for(;count > 0; count --)
  7796. {
  7797. if(incs == 2)
  7798. src -= 4;
  7799. if(incd == 2)
  7800. dst -= 4;
  7801. program_write_dword_32be(dst, program_read_dword_32be(src));
  7802. if(incs == 1)
  7803. src += 4;
  7804. if(incd == 1)
  7805. dst += 4;
  7806.  
  7807. }
  7808. break;
  7809. case 3:
  7810. src &= ~3;
  7811. dst &= ~3;
  7812. count &= ~3;
  7813. for(;count > 0; count -= 4)
  7814. {
  7815. if(incd == 2)
  7816. dst -= 16;
  7817. program_write_dword_32be(dst, program_read_dword_32be(src));
  7818. program_write_dword_32be(dst+4, program_read_dword_32be(src+4));
  7819. program_write_dword_32be(dst+8, program_read_dword_32be(src+8));
  7820. program_write_dword_32be(dst+12, program_read_dword_32be(src+12));
  7821. src += 16;
  7822. if(incd == 1)
  7823. dst += 16;
  7824. }
  7825. break;
  7826. }
  7827. }
  7828. }
  7829. else
  7830. {
  7831. if(sh2.dma_timer_active[dma])
  7832. {
  7833. logerror("SH2: DMA %d cancelled in-flight", dma);
  7834. mame_timer_adjust(sh2.dma_timer[dma], double_to_mame_time((1.0e30)), 0, double_to_mame_time(0));
  7835. sh2.dma_timer_active[dma] = 0;
  7836. }
  7837. }
  7838. }
  7839.  
  7840. void sh2_internal_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask)
  7841. {
  7842. UINT32 old = sh2.m[offset];
  7843. (*(sh2.m+offset) = (*(sh2.m+offset) & mem_mask) | (data & ~mem_mask));
  7844.  
  7845.  
  7846.  
  7847.  
  7848. switch( offset )
  7849. {
  7850.  
  7851. case 0x04:
  7852. if((mem_mask & 0x00ffffff) != 0xffffff)
  7853. sh2_timer_resync();
  7854. logerror("SH2.%d: TIER write %04x @ %04x\n", sh2.cpu_number, data >> 16, mem_mask>>16);
  7855. sh2.m[4] = (sh2.m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2.m[4] & (ICF|OCFA|OCFB|OVF));
  7856. (*(&sh2.frc) = (*(&sh2.frc) & mem_mask) | (data & ~mem_mask));
  7857. if((mem_mask & 0x00ffffff) != 0xffffff)
  7858. sh2_timer_activate();
  7859. sh2_recalc_irq();
  7860. break;
  7861. case 0x05:
  7862. logerror("SH2.%d: TCR write %08x @ %08x\n", sh2.cpu_number, data, mem_mask);
  7863. sh2_timer_resync();
  7864. if(sh2.m[5] & 0x10)
  7865. sh2.ocrb = (sh2.ocrb & (mem_mask >> 16)) | ((data & ~mem_mask) >> 16);
  7866. else
  7867. sh2.ocra = (sh2.ocra & (mem_mask >> 16)) | ((data & ~mem_mask) >> 16);
  7868. sh2_timer_activate();
  7869. break;
  7870.  
  7871. case 0x06:
  7872. break;
  7873.  
  7874.  
  7875. case 0x18:
  7876. case 0x19:
  7877. case 0x1a:
  7878. sh2_recalc_irq();
  7879. break;
  7880.  
  7881.  
  7882. case 0x1c:
  7883. break;
  7884.  
  7885.  
  7886. case 0x20:
  7887. break;
  7888.  
  7889.  
  7890. case 0x24:
  7891. break;
  7892.  
  7893.  
  7894. case 0x38:
  7895. break;
  7896. case 0x39:
  7897. break;
  7898.  
  7899.  
  7900. case 0x40:
  7901. break;
  7902. case 0x41:
  7903. {
  7904. INT32 a = sh2.m[0x41];
  7905. INT32 b = sh2.m[0x40];
  7906. ;
  7907. if (b)
  7908. {
  7909. sh2.m[0x45] = a / b;
  7910. sh2.m[0x44] = a % b;
  7911. }
  7912. else
  7913. {
  7914. sh2.m[0x42] |= 0x00010000;
  7915. sh2.m[0x45] = 0x7fffffff;
  7916. sh2.m[0x44] = 0x7fffffff;
  7917. sh2_recalc_irq();
  7918. }
  7919. break;
  7920. }
  7921. case 0x42:
  7922. sh2.m[0x42] = (sh2.m[0x42] & ~0x00001000) | (old & sh2.m[0x42] & 0x00010000);
  7923. sh2_recalc_irq();
  7924. break;
  7925. case 0x43:
  7926. sh2_recalc_irq();
  7927. break;
  7928. case 0x44:
  7929. break;
  7930. case 0x45:
  7931. {
  7932. INT64 a = sh2.m[0x45] | ((UINT64)(sh2.m[0x44]) << 32);
  7933. INT64 b = (INT32)sh2.m[0x40];
  7934. ;
  7935. if (b)
  7936. {
  7937. INT64 q = a / b;
  7938. if (q != (INT32)q)
  7939. {
  7940. sh2.m[0x42] |= 0x00010000;
  7941. sh2.m[0x45] = 0x7fffffff;
  7942. sh2.m[0x44] = 0x7fffffff;
  7943. sh2_recalc_irq();
  7944. }
  7945. else
  7946. {
  7947. sh2.m[0x45] = q;
  7948. sh2.m[0x44] = a % b;
  7949. }
  7950. }
  7951. else
  7952. {
  7953. sh2.m[0x42] |= 0x00010000;
  7954. sh2.m[0x45] = 0x7fffffff;
  7955. sh2.m[0x44] = 0x7fffffff;
  7956. sh2_recalc_irq();
  7957. }
  7958. break;
  7959. }
  7960.  
  7961.  
  7962. case 0x60:
  7963. case 0x61:
  7964. break;
  7965. case 0x62:
  7966. sh2.m[0x62] &= 0xffffff;
  7967. break;
  7968. case 0x63:
  7969. sh2.m[0x63] = (sh2.m[0x63] & ~2) | (old & sh2.m[0x63] & 2);
  7970. sh2_dmac_check(0);
  7971. break;
  7972. case 0x64:
  7973. case 0x65:
  7974. break;
  7975. case 0x66:
  7976. sh2.m[0x66] &= 0xffffff;
  7977. break;
  7978. case 0x67:
  7979. sh2.m[0x67] = (sh2.m[0x67] & ~2) | (old & sh2.m[0x67] & 2);
  7980. sh2_dmac_check(1);
  7981. break;
  7982. case 0x68:
  7983. case 0x6a:
  7984. sh2_recalc_irq();
  7985. break;
  7986. case 0x6c:
  7987. sh2.m[0x6c] = (sh2.m[0x6c] & ~6) | (old & sh2.m[0x6c] & 6);
  7988. sh2_dmac_check(0);
  7989. sh2_dmac_check(1);
  7990. break;
  7991.  
  7992.  
  7993. case 0x78:
  7994. case 0x79:
  7995. case 0x7a:
  7996. case 0x7b:
  7997. case 0x7c:
  7998. case 0x7d:
  7999. case 0x7e:
  8000. break;
  8001.  
  8002. default:
  8003. logerror("sh2_internal_w: Unmapped write %08x, %08x @ %08x\n", 0xfffffe00+offset*4, data, mem_mask);
  8004. break;
  8005. }
  8006. }
  8007.  
  8008. UINT32 sh2_internal_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask)
  8009. {
  8010.  
  8011. switch( offset )
  8012. {
  8013. case 0x04:
  8014. if ( mem_mask == 0xff00ffff )
  8015. if ( sh2.ftcsr_read_callback != ((void *)0) )
  8016. sh2.ftcsr_read_callback( (sh2.m[4] & 0xffff0000) | sh2.frc );
  8017. sh2_timer_resync();
  8018. return (sh2.m[4] & 0xffff0000) | sh2.frc;
  8019. case 0x05:
  8020. if(sh2.m[5] & 0x10)
  8021. return (sh2.ocrb << 16) | (sh2.m[5] & 0xffff);
  8022. else
  8023. return (sh2.ocra << 16) | (sh2.m[5] & 0xffff);
  8024. case 0x06:
  8025. return sh2.icr << 16;
  8026.  
  8027. case 0x38:
  8028. return (sh2.m[0x38] & 0x7fffffff) | (sh2.nmi_line_state == ASSERT_LINE ? 0 : 0x80000000);
  8029.  
  8030. case 0x78:
  8031. return sh2.is_slave ? 0x00008000 : 0;
  8032.  
  8033. case 0x41:
  8034. case 0x47:
  8035. return sh2.m[0x45];
  8036.  
  8037. case 0x46:
  8038. return sh2.m[0x44];
  8039. }
  8040. return sh2.m[offset];
  8041. }
  8042.  
  8043. void sh2_set_frt_input(int cpunum, int state)
  8044. {
  8045. if(state == PULSE_LINE)
  8046. {
  8047. sh2_set_frt_input(cpunum, ASSERT_LINE);
  8048. sh2_set_frt_input(cpunum, CLEAR_LINE);
  8049. return;
  8050. }
  8051.  
  8052. cpuintrf_push_context(cpunum);
  8053.  
  8054. if(sh2.frt_input == state) {
  8055. cpuintrf_pop_context();
  8056. return;
  8057. }
  8058.  
  8059. sh2.frt_input = state;
  8060.  
  8061. if(sh2.m[5] & 0x8000) {
  8062. if(state == CLEAR_LINE) {
  8063. cpuintrf_pop_context();
  8064. return;
  8065. }
  8066. } else {
  8067. if(state == ASSERT_LINE) {
  8068. cpuintrf_pop_context();
  8069. return;
  8070. }
  8071. }
  8072.  
  8073. sh2_timer_resync();
  8074. sh2.icr = sh2.frc;
  8075. sh2.m[4] |= ICF;
  8076. logerror("SH2.%d: ICF activated (%x)\n", sh2.cpu_number, sh2.pc & 0x07ffffff);
  8077. sh2_recalc_irq();
  8078. cpuintrf_pop_context();
  8079. }
  8080.  
  8081. static void set_irq_line(int irqline, int state)
  8082. {
  8083. if (irqline == INPUT_LINE_NMI)
  8084. {
  8085. if (sh2.nmi_line_state == state)
  8086. return;
  8087. sh2.nmi_line_state = state;
  8088.  
  8089. if( state == CLEAR_LINE )
  8090. ;
  8091. else
  8092. {
  8093. ;
  8094. sh2_exception("sh2_set_irq_line/nmi", 16);
  8095. }
  8096. }
  8097. else
  8098. {
  8099. if (sh2.irq_line_state[irqline] == state)
  8100. return;
  8101. sh2.irq_line_state[irqline] = state;
  8102.  
  8103. if( state == CLEAR_LINE )
  8104. {
  8105. ;
  8106. sh2.pending_irq &= ~(1 << irqline);
  8107. }
  8108. else
  8109. {
  8110. ;
  8111. sh2.pending_irq |= 1 << irqline;
  8112. if(sh2.delay)
  8113. sh2.test_irq = 1;
  8114. else
  8115. do { int irq = -1; if (sh2.pending_irq & (1 << 0)) irq = 0; if (sh2.pending_irq & (1 << 1)) irq = 1; if (sh2.pending_irq & (1 << 2)) irq = 2; if (sh2.pending_irq & (1 << 3)) irq = 3; if (sh2.pending_irq & (1 << 4)) irq = 4; if (sh2.pending_irq & (1 << 5)) irq = 5; if (sh2.pending_irq & (1 << 6)) irq = 6; if (sh2.pending_irq & (1 << 7)) irq = 7; if (sh2.pending_irq & (1 << 8)) irq = 8; if (sh2.pending_irq & (1 << 9)) irq = 9; if (sh2.pending_irq & (1 << 10)) irq = 10; if (sh2.pending_irq & (1 << 11)) irq = 11; if (sh2.pending_irq & (1 << 12)) irq = 12; if (sh2.pending_irq & (1 << 13)) irq = 13; if (sh2.pending_irq & (1 << 14)) irq = 14; if (sh2.pending_irq & (1 << 15)) irq = 15; if ((sh2.internal_irq_level != -1) && (sh2.internal_irq_level > irq)) irq = sh2.internal_irq_level; if (irq >= 0) sh2_exception("sh2_set_irq_line",irq); } while(0);
  8116. }
  8117. }
  8118. }
  8119.  
  8120. static offs_t sh2_dasm(char *buffer, offs_t pc)
  8121. {
  8122.  
  8123.  
  8124.  
  8125. sprintf( buffer, "$%02X", cpu_readop(pc) );
  8126. return 1;
  8127.  
  8128. }
  8129.  
  8130. static void sh2_init(int index, int clock, const void *config, int (*irqcallback)(int))
  8131. {
  8132. const struct sh2_config *conf = config;
  8133.  
  8134. sh2.timer = _mame_timer_alloc(sh2_timer_callback, "src/cpu/sh2/sh2.c", 2966, "sh2_timer_callback");
  8135. mame_timer_adjust(sh2.timer, double_to_mame_time((1.0e30)), 0, double_to_mame_time(0));
  8136.  
  8137. sh2.dma_timer[0] = _mame_timer_alloc(sh2_dmac_callback, "src/cpu/sh2/sh2.c", 2969, "sh2_dmac_callback");
  8138. mame_timer_adjust(sh2.dma_timer[0], double_to_mame_time((1.0e30)), 0, double_to_mame_time(0));
  8139.  
  8140. sh2.dma_timer[1] = _mame_timer_alloc(sh2_dmac_callback, "src/cpu/sh2/sh2.c", 2972, "sh2_dmac_callback");
  8141. mame_timer_adjust(sh2.dma_timer[1], double_to_mame_time((1.0e30)), 0, double_to_mame_time(0));
  8142.  
  8143. sh2.m = malloc(0x200);
  8144. if (!sh2.m)
  8145. {
  8146. logerror("SH2 failed to malloc FREGS\n");
  8147. raise( 6 );
  8148. }
  8149.  
  8150. if(conf)
  8151. sh2.is_slave = conf->is_slave;
  8152. else
  8153. sh2.is_slave = 0;
  8154.  
  8155. sh2.cpu_number = index;
  8156. sh2.irq_callback = irqcallback;
  8157.  
  8158. do { do { if (!(((sizeof(sh2.pc) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.pc), double)) || (sizeof(sh2.pc) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.pc), float)) || (sizeof(sh2.pc) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.pc), INT64)) || (sizeof(sh2.pc) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.pc), UINT64)) || (sizeof(sh2.pc) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.pc), INT32)) || (sizeof(sh2.pc) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.pc), UINT32)) || (sizeof(sh2.pc) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.pc), INT16)) || (sizeof(sh2.pc) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.pc), UINT16)) || (sizeof(sh2.pc) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.pc), INT8)) || (sizeof(sh2.pc) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.pc), UINT8)) || (sizeof(sh2.pc) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.pc), PAIR)) || (sizeof(sh2.pc) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.pc), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2990); } while (0); state_save_register_memory("sh2", index, "sh2.pc", &sh2.pc, sizeof(sh2.pc), 1); } while (0);
  8159. do { do { if (!(((sizeof(sh2.r[15]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[15]), double)) || (sizeof(sh2.r[15]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[15]), float)) || (sizeof(sh2.r[15]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[15]), INT64)) || (sizeof(sh2.r[15]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[15]), UINT64)) || (sizeof(sh2.r[15]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[15]), INT32)) || (sizeof(sh2.r[15]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[15]), UINT32)) || (sizeof(sh2.r[15]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[15]), INT16)) || (sizeof(sh2.r[15]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[15]), UINT16)) || (sizeof(sh2.r[15]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[15]), INT8)) || (sizeof(sh2.r[15]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[15]), UINT8)) || (sizeof(sh2.r[15]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[15]), PAIR)) || (sizeof(sh2.r[15]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[15]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2991); } while (0); state_save_register_memory("sh2", index, "sh2.r[15]", &sh2.r[15], sizeof(sh2.r[15]), 1); } while (0);
  8160. do { do { if (!(((sizeof(sh2.sr) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.sr), double)) || (sizeof(sh2.sr) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.sr), float)) || (sizeof(sh2.sr) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.sr), INT64)) || (sizeof(sh2.sr) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.sr), UINT64)) || (sizeof(sh2.sr) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.sr), INT32)) || (sizeof(sh2.sr) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.sr), UINT32)) || (sizeof(sh2.sr) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.sr), INT16)) || (sizeof(sh2.sr) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.sr), UINT16)) || (sizeof(sh2.sr) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.sr), INT8)) || (sizeof(sh2.sr) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.sr), UINT8)) || (sizeof(sh2.sr) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.sr), PAIR)) || (sizeof(sh2.sr) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.sr), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2992); } while (0); state_save_register_memory("sh2", index, "sh2.sr", &sh2.sr, sizeof(sh2.sr), 1); } while (0);
  8161. do { do { if (!(((sizeof(sh2.pr) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.pr), double)) || (sizeof(sh2.pr) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.pr), float)) || (sizeof(sh2.pr) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.pr), INT64)) || (sizeof(sh2.pr) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.pr), UINT64)) || (sizeof(sh2.pr) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.pr), INT32)) || (sizeof(sh2.pr) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.pr), UINT32)) || (sizeof(sh2.pr) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.pr), INT16)) || (sizeof(sh2.pr) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.pr), UINT16)) || (sizeof(sh2.pr) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.pr), INT8)) || (sizeof(sh2.pr) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.pr), UINT8)) || (sizeof(sh2.pr) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.pr), PAIR)) || (sizeof(sh2.pr) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.pr), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2993); } while (0); state_save_register_memory("sh2", index, "sh2.pr", &sh2.pr, sizeof(sh2.pr), 1); } while (0);
  8162. do { do { if (!(((sizeof(sh2.gbr) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.gbr), double)) || (sizeof(sh2.gbr) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.gbr), float)) || (sizeof(sh2.gbr) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.gbr), INT64)) || (sizeof(sh2.gbr) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.gbr), UINT64)) || (sizeof(sh2.gbr) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.gbr), INT32)) || (sizeof(sh2.gbr) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.gbr), UINT32)) || (sizeof(sh2.gbr) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.gbr), INT16)) || (sizeof(sh2.gbr) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.gbr), UINT16)) || (sizeof(sh2.gbr) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.gbr), INT8)) || (sizeof(sh2.gbr) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.gbr), UINT8)) || (sizeof(sh2.gbr) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.gbr), PAIR)) || (sizeof(sh2.gbr) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.gbr), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2994); } while (0); state_save_register_memory("sh2", index, "sh2.gbr", &sh2.gbr, sizeof(sh2.gbr), 1); } while (0);
  8163. do { do { if (!(((sizeof(sh2.vbr) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.vbr), double)) || (sizeof(sh2.vbr) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.vbr), float)) || (sizeof(sh2.vbr) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.vbr), INT64)) || (sizeof(sh2.vbr) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.vbr), UINT64)) || (sizeof(sh2.vbr) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.vbr), INT32)) || (sizeof(sh2.vbr) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.vbr), UINT32)) || (sizeof(sh2.vbr) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.vbr), INT16)) || (sizeof(sh2.vbr) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.vbr), UINT16)) || (sizeof(sh2.vbr) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.vbr), INT8)) || (sizeof(sh2.vbr) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.vbr), UINT8)) || (sizeof(sh2.vbr) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.vbr), PAIR)) || (sizeof(sh2.vbr) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.vbr), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2995); } while (0); state_save_register_memory("sh2", index, "sh2.vbr", &sh2.vbr, sizeof(sh2.vbr), 1); } while (0);
  8164. do { do { if (!(((sizeof(sh2.mach) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.mach), double)) || (sizeof(sh2.mach) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.mach), float)) || (sizeof(sh2.mach) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.mach), INT64)) || (sizeof(sh2.mach) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.mach), UINT64)) || (sizeof(sh2.mach) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.mach), INT32)) || (sizeof(sh2.mach) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.mach), UINT32)) || (sizeof(sh2.mach) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.mach), INT16)) || (sizeof(sh2.mach) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.mach), UINT16)) || (sizeof(sh2.mach) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.mach), INT8)) || (sizeof(sh2.mach) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.mach), UINT8)) || (sizeof(sh2.mach) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.mach), PAIR)) || (sizeof(sh2.mach) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.mach), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2996); } while (0); state_save_register_memory("sh2", index, "sh2.mach", &sh2.mach, sizeof(sh2.mach), 1); } while (0);
  8165. do { do { if (!(((sizeof(sh2.macl) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.macl), double)) || (sizeof(sh2.macl) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.macl), float)) || (sizeof(sh2.macl) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.macl), INT64)) || (sizeof(sh2.macl) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.macl), UINT64)) || (sizeof(sh2.macl) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.macl), INT32)) || (sizeof(sh2.macl) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.macl), UINT32)) || (sizeof(sh2.macl) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.macl), INT16)) || (sizeof(sh2.macl) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.macl), UINT16)) || (sizeof(sh2.macl) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.macl), INT8)) || (sizeof(sh2.macl) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.macl), UINT8)) || (sizeof(sh2.macl) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.macl), PAIR)) || (sizeof(sh2.macl) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.macl), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2997); } while (0); state_save_register_memory("sh2", index, "sh2.macl", &sh2.macl, sizeof(sh2.macl), 1); } while (0);
  8166. do { do { if (!(((sizeof(sh2.r[ 0]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), double)) || (sizeof(sh2.r[ 0]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), float)) || (sizeof(sh2.r[ 0]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), INT64)) || (sizeof(sh2.r[ 0]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), UINT64)) || (sizeof(sh2.r[ 0]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), INT32)) || (sizeof(sh2.r[ 0]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), UINT32)) || (sizeof(sh2.r[ 0]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), INT16)) || (sizeof(sh2.r[ 0]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), UINT16)) || (sizeof(sh2.r[ 0]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), INT8)) || (sizeof(sh2.r[ 0]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), UINT8)) || (sizeof(sh2.r[ 0]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), PAIR)) || (sizeof(sh2.r[ 0]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 0]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2998); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 0]", &sh2.r[ 0], sizeof(sh2.r[ 0]), 1); } while (0);
  8167. do { do { if (!(((sizeof(sh2.r[ 1]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), double)) || (sizeof(sh2.r[ 1]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), float)) || (sizeof(sh2.r[ 1]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), INT64)) || (sizeof(sh2.r[ 1]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), UINT64)) || (sizeof(sh2.r[ 1]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), INT32)) || (sizeof(sh2.r[ 1]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), UINT32)) || (sizeof(sh2.r[ 1]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), INT16)) || (sizeof(sh2.r[ 1]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), UINT16)) || (sizeof(sh2.r[ 1]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), INT8)) || (sizeof(sh2.r[ 1]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), UINT8)) || (sizeof(sh2.r[ 1]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), PAIR)) || (sizeof(sh2.r[ 1]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 1]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 2999); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 1]", &sh2.r[ 1], sizeof(sh2.r[ 1]), 1); } while (0);
  8168. do { do { if (!(((sizeof(sh2.r[ 2]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), double)) || (sizeof(sh2.r[ 2]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), float)) || (sizeof(sh2.r[ 2]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), INT64)) || (sizeof(sh2.r[ 2]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), UINT64)) || (sizeof(sh2.r[ 2]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), INT32)) || (sizeof(sh2.r[ 2]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), UINT32)) || (sizeof(sh2.r[ 2]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), INT16)) || (sizeof(sh2.r[ 2]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), UINT16)) || (sizeof(sh2.r[ 2]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), INT8)) || (sizeof(sh2.r[ 2]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), UINT8)) || (sizeof(sh2.r[ 2]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), PAIR)) || (sizeof(sh2.r[ 2]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 2]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3000); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 2]", &sh2.r[ 2], sizeof(sh2.r[ 2]), 1); } while (0);
  8169. do { do { if (!(((sizeof(sh2.r[ 3]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), double)) || (sizeof(sh2.r[ 3]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), float)) || (sizeof(sh2.r[ 3]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), INT64)) || (sizeof(sh2.r[ 3]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), UINT64)) || (sizeof(sh2.r[ 3]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), INT32)) || (sizeof(sh2.r[ 3]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), UINT32)) || (sizeof(sh2.r[ 3]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), INT16)) || (sizeof(sh2.r[ 3]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), UINT16)) || (sizeof(sh2.r[ 3]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), INT8)) || (sizeof(sh2.r[ 3]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), UINT8)) || (sizeof(sh2.r[ 3]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), PAIR)) || (sizeof(sh2.r[ 3]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 3]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3001); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 3]", &sh2.r[ 3], sizeof(sh2.r[ 3]), 1); } while (0);
  8170. do { do { if (!(((sizeof(sh2.r[ 4]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), double)) || (sizeof(sh2.r[ 4]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), float)) || (sizeof(sh2.r[ 4]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), INT64)) || (sizeof(sh2.r[ 4]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), UINT64)) || (sizeof(sh2.r[ 4]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), INT32)) || (sizeof(sh2.r[ 4]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), UINT32)) || (sizeof(sh2.r[ 4]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), INT16)) || (sizeof(sh2.r[ 4]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), UINT16)) || (sizeof(sh2.r[ 4]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), INT8)) || (sizeof(sh2.r[ 4]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), UINT8)) || (sizeof(sh2.r[ 4]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), PAIR)) || (sizeof(sh2.r[ 4]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 4]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3002); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 4]", &sh2.r[ 4], sizeof(sh2.r[ 4]), 1); } while (0);
  8171. do { do { if (!(((sizeof(sh2.r[ 5]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), double)) || (sizeof(sh2.r[ 5]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), float)) || (sizeof(sh2.r[ 5]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), INT64)) || (sizeof(sh2.r[ 5]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), UINT64)) || (sizeof(sh2.r[ 5]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), INT32)) || (sizeof(sh2.r[ 5]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), UINT32)) || (sizeof(sh2.r[ 5]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), INT16)) || (sizeof(sh2.r[ 5]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), UINT16)) || (sizeof(sh2.r[ 5]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), INT8)) || (sizeof(sh2.r[ 5]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), UINT8)) || (sizeof(sh2.r[ 5]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), PAIR)) || (sizeof(sh2.r[ 5]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 5]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3003); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 5]", &sh2.r[ 5], sizeof(sh2.r[ 5]), 1); } while (0);
  8172. do { do { if (!(((sizeof(sh2.r[ 6]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), double)) || (sizeof(sh2.r[ 6]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), float)) || (sizeof(sh2.r[ 6]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), INT64)) || (sizeof(sh2.r[ 6]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), UINT64)) || (sizeof(sh2.r[ 6]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), INT32)) || (sizeof(sh2.r[ 6]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), UINT32)) || (sizeof(sh2.r[ 6]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), INT16)) || (sizeof(sh2.r[ 6]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), UINT16)) || (sizeof(sh2.r[ 6]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), INT8)) || (sizeof(sh2.r[ 6]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), UINT8)) || (sizeof(sh2.r[ 6]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), PAIR)) || (sizeof(sh2.r[ 6]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 6]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3004); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 6]", &sh2.r[ 6], sizeof(sh2.r[ 6]), 1); } while (0);
  8173. do { do { if (!(((sizeof(sh2.r[ 7]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), double)) || (sizeof(sh2.r[ 7]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), float)) || (sizeof(sh2.r[ 7]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), INT64)) || (sizeof(sh2.r[ 7]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), UINT64)) || (sizeof(sh2.r[ 7]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), INT32)) || (sizeof(sh2.r[ 7]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), UINT32)) || (sizeof(sh2.r[ 7]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), INT16)) || (sizeof(sh2.r[ 7]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), UINT16)) || (sizeof(sh2.r[ 7]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), INT8)) || (sizeof(sh2.r[ 7]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), UINT8)) || (sizeof(sh2.r[ 7]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), PAIR)) || (sizeof(sh2.r[ 7]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 7]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3005); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 7]", &sh2.r[ 7], sizeof(sh2.r[ 7]), 1); } while (0);
  8174. do { do { if (!(((sizeof(sh2.r[ 8]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), double)) || (sizeof(sh2.r[ 8]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), float)) || (sizeof(sh2.r[ 8]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), INT64)) || (sizeof(sh2.r[ 8]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), UINT64)) || (sizeof(sh2.r[ 8]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), INT32)) || (sizeof(sh2.r[ 8]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), UINT32)) || (sizeof(sh2.r[ 8]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), INT16)) || (sizeof(sh2.r[ 8]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), UINT16)) || (sizeof(sh2.r[ 8]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), INT8)) || (sizeof(sh2.r[ 8]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), UINT8)) || (sizeof(sh2.r[ 8]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), PAIR)) || (sizeof(sh2.r[ 8]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 8]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3006); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 8]", &sh2.r[ 8], sizeof(sh2.r[ 8]), 1); } while (0);
  8175. do { do { if (!(((sizeof(sh2.r[ 9]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), double)) || (sizeof(sh2.r[ 9]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), float)) || (sizeof(sh2.r[ 9]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), INT64)) || (sizeof(sh2.r[ 9]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), UINT64)) || (sizeof(sh2.r[ 9]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), INT32)) || (sizeof(sh2.r[ 9]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), UINT32)) || (sizeof(sh2.r[ 9]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), INT16)) || (sizeof(sh2.r[ 9]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), UINT16)) || (sizeof(sh2.r[ 9]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), INT8)) || (sizeof(sh2.r[ 9]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), UINT8)) || (sizeof(sh2.r[ 9]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), PAIR)) || (sizeof(sh2.r[ 9]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[ 9]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3007); } while (0); state_save_register_memory("sh2", index, "sh2.r[ 9]", &sh2.r[ 9], sizeof(sh2.r[ 9]), 1); } while (0);
  8176. do { do { if (!(((sizeof(sh2.r[10]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[10]), double)) || (sizeof(sh2.r[10]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[10]), float)) || (sizeof(sh2.r[10]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[10]), INT64)) || (sizeof(sh2.r[10]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[10]), UINT64)) || (sizeof(sh2.r[10]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[10]), INT32)) || (sizeof(sh2.r[10]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[10]), UINT32)) || (sizeof(sh2.r[10]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[10]), INT16)) || (sizeof(sh2.r[10]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[10]), UINT16)) || (sizeof(sh2.r[10]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[10]), INT8)) || (sizeof(sh2.r[10]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[10]), UINT8)) || (sizeof(sh2.r[10]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[10]), PAIR)) || (sizeof(sh2.r[10]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[10]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3008); } while (0); state_save_register_memory("sh2", index, "sh2.r[10]", &sh2.r[10], sizeof(sh2.r[10]), 1); } while (0);
  8177. do { do { if (!(((sizeof(sh2.r[11]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[11]), double)) || (sizeof(sh2.r[11]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[11]), float)) || (sizeof(sh2.r[11]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[11]), INT64)) || (sizeof(sh2.r[11]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[11]), UINT64)) || (sizeof(sh2.r[11]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[11]), INT32)) || (sizeof(sh2.r[11]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[11]), UINT32)) || (sizeof(sh2.r[11]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[11]), INT16)) || (sizeof(sh2.r[11]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[11]), UINT16)) || (sizeof(sh2.r[11]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[11]), INT8)) || (sizeof(sh2.r[11]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[11]), UINT8)) || (sizeof(sh2.r[11]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[11]), PAIR)) || (sizeof(sh2.r[11]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[11]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3009); } while (0); state_save_register_memory("sh2", index, "sh2.r[11]", &sh2.r[11], sizeof(sh2.r[11]), 1); } while (0);
  8178. do { do { if (!(((sizeof(sh2.r[12]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[12]), double)) || (sizeof(sh2.r[12]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[12]), float)) || (sizeof(sh2.r[12]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[12]), INT64)) || (sizeof(sh2.r[12]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[12]), UINT64)) || (sizeof(sh2.r[12]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[12]), INT32)) || (sizeof(sh2.r[12]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[12]), UINT32)) || (sizeof(sh2.r[12]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[12]), INT16)) || (sizeof(sh2.r[12]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[12]), UINT16)) || (sizeof(sh2.r[12]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[12]), INT8)) || (sizeof(sh2.r[12]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[12]), UINT8)) || (sizeof(sh2.r[12]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[12]), PAIR)) || (sizeof(sh2.r[12]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[12]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3010); } while (0); state_save_register_memory("sh2", index, "sh2.r[12]", &sh2.r[12], sizeof(sh2.r[12]), 1); } while (0);
  8179. do { do { if (!(((sizeof(sh2.r[13]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[13]), double)) || (sizeof(sh2.r[13]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[13]), float)) || (sizeof(sh2.r[13]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[13]), INT64)) || (sizeof(sh2.r[13]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[13]), UINT64)) || (sizeof(sh2.r[13]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[13]), INT32)) || (sizeof(sh2.r[13]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[13]), UINT32)) || (sizeof(sh2.r[13]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[13]), INT16)) || (sizeof(sh2.r[13]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[13]), UINT16)) || (sizeof(sh2.r[13]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[13]), INT8)) || (sizeof(sh2.r[13]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[13]), UINT8)) || (sizeof(sh2.r[13]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[13]), PAIR)) || (sizeof(sh2.r[13]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[13]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3011); } while (0); state_save_register_memory("sh2", index, "sh2.r[13]", &sh2.r[13], sizeof(sh2.r[13]), 1); } while (0);
  8180. do { do { if (!(((sizeof(sh2.r[14]) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.r[14]), double)) || (sizeof(sh2.r[14]) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.r[14]), float)) || (sizeof(sh2.r[14]) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.r[14]), INT64)) || (sizeof(sh2.r[14]) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.r[14]), UINT64)) || (sizeof(sh2.r[14]) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.r[14]), INT32)) || (sizeof(sh2.r[14]) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.r[14]), UINT32)) || (sizeof(sh2.r[14]) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.r[14]), INT16)) || (sizeof(sh2.r[14]) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.r[14]), UINT16)) || (sizeof(sh2.r[14]) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.r[14]), INT8)) || (sizeof(sh2.r[14]) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.r[14]), UINT8)) || (sizeof(sh2.r[14]) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.r[14]), PAIR)) || (sizeof(sh2.r[14]) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.r[14]), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3012); } while (0); state_save_register_memory("sh2", index, "sh2.r[14]", &sh2.r[14], sizeof(sh2.r[14]), 1); } while (0);
  8181. do { do { if (!(((sizeof(sh2.ea) == sizeof(double) && __builtin_types_compatible_p(typeof(sh2.ea), double)) || (sizeof(sh2.ea) == sizeof(float) && __builtin_types_compatible_p(typeof(sh2.ea), float)) || (sizeof(sh2.ea) == sizeof(INT64) && __builtin_types_compatible_p(typeof(sh2.ea), INT64)) || (sizeof(sh2.ea) == sizeof(UINT64) && __builtin_types_compatible_p(typeof(sh2.ea), UINT64)) || (sizeof(sh2.ea) == sizeof(INT32) && __builtin_types_compatible_p(typeof(sh2.ea), INT32)) || (sizeof(sh2.ea) == sizeof(UINT32) && __builtin_types_compatible_p(typeof(sh2.ea), UINT32)) || (sizeof(sh2.ea) == sizeof(INT16) && __builtin_types_compatible_p(typeof(sh2.ea), INT16)) || (sizeof(sh2.ea) == sizeof(UINT16) && __builtin_types_compatible_p(typeof(sh2.ea), UINT16)) || (sizeof(sh2.ea) == sizeof(INT8) && __builtin_types_compatible_p(typeof(sh2.ea), INT8)) || (sizeof(sh2.ea) == sizeof(UINT8) && __builtin_types_compatible_p(typeof(sh2.ea), UINT8)) || (sizeof(sh2.ea) == sizeof(PAIR) && __builtin_types_compatible_p(typeof(sh2.ea), PAIR)) || (sizeof(sh2.ea) == sizeof(PAIR64) && __builtin_types_compatible_p(typeof(sh2.ea), PAIR64))))) fatalerror("Fatal error: %s (%s:%d)", "Invalid data type supplied for state saving.", "src/cpu/sh2/sh2.c", 3013); } while (0); state_save_register_memory("sh2", index, "sh2.ea", &sh2.ea, sizeof(sh2.ea), 1); } while (0);
  8182. }
  8183.  
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190. static void sh2_set_info(UINT32 state, union cpuinfo *info)
  8191. {
  8192. switch (state)
  8193. {
  8194.  
  8195. case CPUINFO_INT_INPUT_STATE + 0: set_irq_line(0, info->i); break;
  8196. case CPUINFO_INT_INPUT_STATE + 1: set_irq_line(1, info->i); break;
  8197. case CPUINFO_INT_INPUT_STATE + 2: set_irq_line(2, info->i); break;
  8198. case CPUINFO_INT_INPUT_STATE + 3: set_irq_line(3, info->i); break;
  8199. case CPUINFO_INT_INPUT_STATE + 4: set_irq_line(4, info->i); break;
  8200. case CPUINFO_INT_INPUT_STATE + 5: set_irq_line(5, info->i); break;
  8201. case CPUINFO_INT_INPUT_STATE + 6: set_irq_line(6, info->i); break;
  8202. case CPUINFO_INT_INPUT_STATE + 7: set_irq_line(7, info->i); break;
  8203. case CPUINFO_INT_INPUT_STATE + 8: set_irq_line(8, info->i); break;
  8204. case CPUINFO_INT_INPUT_STATE + 9: set_irq_line(9, info->i); break;
  8205. case CPUINFO_INT_INPUT_STATE + 10: set_irq_line(10, info->i); break;
  8206. case CPUINFO_INT_INPUT_STATE + 11: set_irq_line(11, info->i); break;
  8207. case CPUINFO_INT_INPUT_STATE + 12: set_irq_line(12, info->i); break;
  8208. case CPUINFO_INT_INPUT_STATE + 13: set_irq_line(13, info->i); break;
  8209. case CPUINFO_INT_INPUT_STATE + 14: set_irq_line(14, info->i); break;
  8210. case CPUINFO_INT_INPUT_STATE + 15: set_irq_line(15, info->i); break;
  8211. case CPUINFO_INT_INPUT_STATE + 16: set_irq_line(16, info->i); break;
  8212. case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: set_irq_line(INPUT_LINE_NMI, info->i); break;
  8213.  
  8214. case CPUINFO_INT_REGISTER + SH2_PC:
  8215. case CPUINFO_INT_PC: sh2.pc = info->i; sh2.delay = 0; break;
  8216. case CPUINFO_INT_SP: sh2.r[15] = info->i; break;
  8217. case CPUINFO_INT_REGISTER + SH2_PR: sh2.pr = info->i; break;
  8218. case CPUINFO_INT_REGISTER + SH2_SR: sh2.sr = info->i; do { int irq = -1; if (sh2.pending_irq & (1 << 0)) irq = 0; if (sh2.pending_irq & (1 << 1)) irq = 1; if (sh2.pending_irq & (1 << 2)) irq = 2; if (sh2.pending_irq & (1 << 3)) irq = 3; if (sh2.pending_irq & (1 << 4)) irq = 4; if (sh2.pending_irq & (1 << 5)) irq = 5; if (sh2.pending_irq & (1 << 6)) irq = 6; if (sh2.pending_irq & (1 << 7)) irq = 7; if (sh2.pending_irq & (1 << 8)) irq = 8; if (sh2.pending_irq & (1 << 9)) irq = 9; if (sh2.pending_irq & (1 << 10)) irq = 10; if (sh2.pending_irq & (1 << 11)) irq = 11; if (sh2.pending_irq & (1 << 12)) irq = 12; if (sh2.pending_irq & (1 << 13)) irq = 13; if (sh2.pending_irq & (1 << 14)) irq = 14; if (sh2.pending_irq & (1 << 15)) irq = 15; if ((sh2.internal_irq_level != -1) && (sh2.internal_irq_level > irq)) irq = sh2.internal_irq_level; if (irq >= 0) sh2_exception("sh2_set_reg",irq); } while(0); break;
  8219. case CPUINFO_INT_REGISTER + SH2_GBR: sh2.gbr = info->i; break;
  8220. case CPUINFO_INT_REGISTER + SH2_VBR: sh2.vbr = info->i; break;
  8221. case CPUINFO_INT_REGISTER + SH2_MACH: sh2.mach = info->i; break;
  8222. case CPUINFO_INT_REGISTER + SH2_MACL: sh2.macl = info->i; break;
  8223. case CPUINFO_INT_REGISTER + SH2_R0: sh2.r[ 0] = info->i; break;
  8224. case CPUINFO_INT_REGISTER + SH2_R1: sh2.r[ 1] = info->i; break;
  8225. case CPUINFO_INT_REGISTER + SH2_R2: sh2.r[ 2] = info->i; break;
  8226. case CPUINFO_INT_REGISTER + SH2_R3: sh2.r[ 3] = info->i; break;
  8227. case CPUINFO_INT_REGISTER + SH2_R4: sh2.r[ 4] = info->i; break;
  8228. case CPUINFO_INT_REGISTER + SH2_R5: sh2.r[ 5] = info->i; break;
  8229. case CPUINFO_INT_REGISTER + SH2_R6: sh2.r[ 6] = info->i; break;
  8230. case CPUINFO_INT_REGISTER + SH2_R7: sh2.r[ 7] = info->i; break;
  8231. case CPUINFO_INT_REGISTER + SH2_R8: sh2.r[ 8] = info->i; break;
  8232. case CPUINFO_INT_REGISTER + SH2_R9: sh2.r[ 9] = info->i; break;
  8233. case CPUINFO_INT_REGISTER + SH2_R10: sh2.r[10] = info->i; break;
  8234. case CPUINFO_INT_REGISTER + SH2_R11: sh2.r[11] = info->i; break;
  8235. case CPUINFO_INT_REGISTER + SH2_R12: sh2.r[12] = info->i; break;
  8236. case CPUINFO_INT_REGISTER + SH2_R13: sh2.r[13] = info->i; break;
  8237. case CPUINFO_INT_REGISTER + SH2_R14: sh2.r[14] = info->i; break;
  8238. case CPUINFO_INT_REGISTER + SH2_R15: sh2.r[15] = info->i; break;
  8239. case CPUINFO_INT_REGISTER + SH2_EA: sh2.ea = info->i; break;
  8240.  
  8241. case CPUINFO_INT_SH2_FRT_INPUT: sh2_set_frt_input(cpu_getactivecpu(), info->i); break;
  8242.  
  8243.  
  8244. case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK: sh2.ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
  8245. }
  8246. }
  8247.  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.  
  8253.  
  8254. void sh2_get_info(UINT32 state, union cpuinfo *info)
  8255. {
  8256. switch (state)
  8257. {
  8258.  
  8259. case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(sh2); break;
  8260. case CPUINFO_INT_INPUT_LINES: info->i = 16; break;
  8261. case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break;
  8262. case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_BE; break;
  8263. case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break;
  8264. case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break;
  8265. case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 2; break;
  8266. case CPUINFO_INT_MIN_CYCLES: info->i = 1; break;
  8267. case CPUINFO_INT_MAX_CYCLES: info->i = 4; break;
  8268.  
  8269. case CPUINFO_INT_DATABUS_WIDTH + 0: info->i = 32; break;
  8270. case CPUINFO_INT_ADDRBUS_WIDTH + 0: info->i = 32; break;
  8271. case CPUINFO_INT_ADDRBUS_SHIFT + 0: info->i = 0; break;
  8272. case CPUINFO_INT_DATABUS_WIDTH + 1: info->i = 0; break;
  8273. case CPUINFO_INT_ADDRBUS_WIDTH + 1: info->i = 0; break;
  8274. case CPUINFO_INT_ADDRBUS_SHIFT + 1: info->i = 0; break;
  8275. case CPUINFO_INT_DATABUS_WIDTH + 2: info->i = 0; break;
  8276. case CPUINFO_INT_ADDRBUS_WIDTH + 2: info->i = 0; break;
  8277. case CPUINFO_INT_ADDRBUS_SHIFT + 2: info->i = 0; break;
  8278.  
  8279. case CPUINFO_INT_INPUT_STATE + 0: info->i = sh2.irq_line_state[0]; break;
  8280. case CPUINFO_INT_INPUT_STATE + 1: info->i = sh2.irq_line_state[1]; break;
  8281. case CPUINFO_INT_INPUT_STATE + 2: info->i = sh2.irq_line_state[2]; break;
  8282. case CPUINFO_INT_INPUT_STATE + 3: info->i = sh2.irq_line_state[3]; break;
  8283. case CPUINFO_INT_INPUT_STATE + 4: info->i = sh2.irq_line_state[4]; break;
  8284. case CPUINFO_INT_INPUT_STATE + 5: info->i = sh2.irq_line_state[5]; break;
  8285. case CPUINFO_INT_INPUT_STATE + 6: info->i = sh2.irq_line_state[6]; break;
  8286. case CPUINFO_INT_INPUT_STATE + 7: info->i = sh2.irq_line_state[7]; break;
  8287. case CPUINFO_INT_INPUT_STATE + 8: info->i = sh2.irq_line_state[8]; break;
  8288. case CPUINFO_INT_INPUT_STATE + 9: info->i = sh2.irq_line_state[9]; break;
  8289. case CPUINFO_INT_INPUT_STATE + 10: info->i = sh2.irq_line_state[10]; break;
  8290. case CPUINFO_INT_INPUT_STATE + 11: info->i = sh2.irq_line_state[11]; break;
  8291. case CPUINFO_INT_INPUT_STATE + 12: info->i = sh2.irq_line_state[12]; break;
  8292. case CPUINFO_INT_INPUT_STATE + 13: info->i = sh2.irq_line_state[13]; break;
  8293. case CPUINFO_INT_INPUT_STATE + 14: info->i = sh2.irq_line_state[14]; break;
  8294. case CPUINFO_INT_INPUT_STATE + 15: info->i = sh2.irq_line_state[15]; break;
  8295. case CPUINFO_INT_INPUT_STATE + 16: info->i = sh2.irq_line_state[16]; break;
  8296. case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI: info->i = sh2.nmi_line_state; break;
  8297.  
  8298. case CPUINFO_INT_PREVIOUSPC: info->i = sh2.ppc; break;
  8299.  
  8300. case CPUINFO_INT_PC:
  8301. case CPUINFO_INT_REGISTER + SH2_PC: info->i = (sh2.delay) ? (sh2.delay & 0x07ffffff) : (sh2.pc & 0x07ffffff); break;
  8302. case CPUINFO_INT_SP: info->i = sh2.r[15]; break;
  8303. case CPUINFO_INT_REGISTER + SH2_PR: info->i = sh2.pr; break;
  8304. case CPUINFO_INT_REGISTER + SH2_SR: info->i = sh2.sr; break;
  8305. case CPUINFO_INT_REGISTER + SH2_GBR: info->i = sh2.gbr; break;
  8306. case CPUINFO_INT_REGISTER + SH2_VBR: info->i = sh2.vbr; break;
  8307. case CPUINFO_INT_REGISTER + SH2_MACH: info->i = sh2.mach; break;
  8308. case CPUINFO_INT_REGISTER + SH2_MACL: info->i = sh2.macl; break;
  8309. case CPUINFO_INT_REGISTER + SH2_R0: info->i = sh2.r[ 0]; break;
  8310. case CPUINFO_INT_REGISTER + SH2_R1: info->i = sh2.r[ 1]; break;
  8311. case CPUINFO_INT_REGISTER + SH2_R2: info->i = sh2.r[ 2]; break;
  8312. case CPUINFO_INT_REGISTER + SH2_R3: info->i = sh2.r[ 3]; break;
  8313. case CPUINFO_INT_REGISTER + SH2_R4: info->i = sh2.r[ 4]; break;
  8314. case CPUINFO_INT_REGISTER + SH2_R5: info->i = sh2.r[ 5]; break;
  8315. case CPUINFO_INT_REGISTER + SH2_R6: info->i = sh2.r[ 6]; break;
  8316. case CPUINFO_INT_REGISTER + SH2_R7: info->i = sh2.r[ 7]; break;
  8317. case CPUINFO_INT_REGISTER + SH2_R8: info->i = sh2.r[ 8]; break;
  8318. case CPUINFO_INT_REGISTER + SH2_R9: info->i = sh2.r[ 9]; break;
  8319. case CPUINFO_INT_REGISTER + SH2_R10: info->i = sh2.r[10]; break;
  8320. case CPUINFO_INT_REGISTER + SH2_R11: info->i = sh2.r[11]; break;
  8321. case CPUINFO_INT_REGISTER + SH2_R12: info->i = sh2.r[12]; break;
  8322. case CPUINFO_INT_REGISTER + SH2_R13: info->i = sh2.r[13]; break;
  8323. case CPUINFO_INT_REGISTER + SH2_R14: info->i = sh2.r[14]; break;
  8324. case CPUINFO_INT_REGISTER + SH2_R15: info->i = sh2.r[15]; break;
  8325. case CPUINFO_INT_REGISTER + SH2_EA: info->i = sh2.ea; break;
  8326.  
  8327.  
  8328. case CPUINFO_PTR_SET_INFO: info->setinfo = sh2_set_info; break;
  8329. case CPUINFO_PTR_GET_CONTEXT: info->getcontext = sh2_get_context; break;
  8330. case CPUINFO_PTR_SET_CONTEXT: info->setcontext = sh2_set_context; break;
  8331. case CPUINFO_PTR_INIT: info->init = sh2_init; break;
  8332. case CPUINFO_PTR_RESET: info->reset = sh2_reset; break;
  8333. case CPUINFO_PTR_EXIT: info->exit = sh2_exit; break;
  8334. case CPUINFO_PTR_EXECUTE: info->execute = sh2_execute; break;
  8335. case CPUINFO_PTR_BURN: info->burn = ((void *)0); break;
  8336. case CPUINFO_PTR_DISASSEMBLE: info->disassemble = sh2_dasm; break;
  8337. case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &sh2_icount; break;
  8338. case CPUINFO_PTR_REGISTER_LAYOUT: info->p = sh2_reg_layout; break;
  8339. case CPUINFO_PTR_WINDOW_LAYOUT: info->p = sh2_win_layout; break;
  8340.  
  8341.  
  8342. case CPUINFO_STR_NAME: strcpy(info->s = cpuintrf_temp_str(), "SH-2"); break;
  8343. case CPUINFO_STR_CORE_FAMILY: strcpy(info->s = cpuintrf_temp_str(), "Hitachi SH7600"); break;
  8344. case CPUINFO_STR_CORE_VERSION: strcpy(info->s = cpuintrf_temp_str(), "1.01"); break;
  8345. case CPUINFO_STR_CORE_FILE: strcpy(info->s = cpuintrf_temp_str(), "src/cpu/sh2/sh2.c"); break;
  8346. case CPUINFO_STR_CORE_CREDITS: strcpy(info->s = cpuintrf_temp_str(), "Copyright (c) 2000 Juergen Buchmueller, all rights reserved."); break;
  8347.  
  8348. case CPUINFO_STR_FLAGS:
  8349. sprintf(info->s = cpuintrf_temp_str(), "%c%c%d%c%c",
  8350. sh2.sr & 0x00000200 ? 'M':'.',
  8351. sh2.sr & 0x00000100 ? 'Q':'.',
  8352. (sh2.sr & 0x000000f0) >> 4,
  8353. sh2.sr & 0x00000002 ? 'S':'.',
  8354. sh2.sr & 0x00000001 ? 'T':'.');
  8355. break;
  8356.  
  8357. case CPUINFO_STR_REGISTER + SH2_PC: sprintf(info->s = cpuintrf_temp_str(), "PC :%08X", sh2.pc); break;
  8358. case CPUINFO_STR_REGISTER + SH2_SR: sprintf(info->s = cpuintrf_temp_str(), "SR :%08X", sh2.sr); break;
  8359. case CPUINFO_STR_REGISTER + SH2_PR: sprintf(info->s = cpuintrf_temp_str(), "PR :%08X", sh2.pr); break;
  8360. case CPUINFO_STR_REGISTER + SH2_GBR: sprintf(info->s = cpuintrf_temp_str(), "GBR :%08X", sh2.gbr); break;
  8361. case CPUINFO_STR_REGISTER + SH2_VBR: sprintf(info->s = cpuintrf_temp_str(), "VBR :%08X", sh2.vbr); break;
  8362. case CPUINFO_STR_REGISTER + SH2_MACH: sprintf(info->s = cpuintrf_temp_str(), "MACH:%08X", sh2.mach); break;
  8363. case CPUINFO_STR_REGISTER + SH2_MACL: sprintf(info->s = cpuintrf_temp_str(), "MACL:%08X", sh2.macl); break;
  8364. case CPUINFO_STR_REGISTER + SH2_R0: sprintf(info->s = cpuintrf_temp_str(), "R0 :%08X", sh2.r[ 0]); break;
  8365. case CPUINFO_STR_REGISTER + SH2_R1: sprintf(info->s = cpuintrf_temp_str(), "R1 :%08X", sh2.r[ 1]); break;
  8366. case CPUINFO_STR_REGISTER + SH2_R2: sprintf(info->s = cpuintrf_temp_str(), "R2 :%08X", sh2.r[ 2]); break;
  8367. case CPUINFO_STR_REGISTER + SH2_R3: sprintf(info->s = cpuintrf_temp_str(), "R3 :%08X", sh2.r[ 3]); break;
  8368. case CPUINFO_STR_REGISTER + SH2_R4: sprintf(info->s = cpuintrf_temp_str(), "R4 :%08X", sh2.r[ 4]); break;
  8369. case CPUINFO_STR_REGISTER + SH2_R5: sprintf(info->s = cpuintrf_temp_str(), "R5 :%08X", sh2.r[ 5]); break;
  8370. case CPUINFO_STR_REGISTER + SH2_R6: sprintf(info->s = cpuintrf_temp_str(), "R6 :%08X", sh2.r[ 6]); break;
  8371. case CPUINFO_STR_REGISTER + SH2_R7: sprintf(info->s = cpuintrf_temp_str(), "R7 :%08X", sh2.r[ 7]); break;
  8372. case CPUINFO_STR_REGISTER + SH2_R8: sprintf(info->s = cpuintrf_temp_str(), "R8 :%08X", sh2.r[ 8]); break;
  8373. case CPUINFO_STR_REGISTER + SH2_R9: sprintf(info->s = cpuintrf_temp_str(), "R9 :%08X", sh2.r[ 9]); break;
  8374. case CPUINFO_STR_REGISTER + SH2_R10: sprintf(info->s = cpuintrf_temp_str(), "R10 :%08X", sh2.r[10]); break;
  8375. case CPUINFO_STR_REGISTER + SH2_R11: sprintf(info->s = cpuintrf_temp_str(), "R11 :%08X", sh2.r[11]); break;
  8376. case CPUINFO_STR_REGISTER + SH2_R12: sprintf(info->s = cpuintrf_temp_str(), "R12 :%08X", sh2.r[12]); break;
  8377. case CPUINFO_STR_REGISTER + SH2_R13: sprintf(info->s = cpuintrf_temp_str(), "R13 :%08X", sh2.r[13]); break;
  8378. case CPUINFO_STR_REGISTER + SH2_R14: sprintf(info->s = cpuintrf_temp_str(), "R14 :%08X", sh2.r[14]); break;
  8379. case CPUINFO_STR_REGISTER + SH2_R15: sprintf(info->s = cpuintrf_temp_str(), "R15 :%08X", sh2.r[15]); break;
  8380. case CPUINFO_STR_REGISTER + SH2_EA: sprintf(info->s = cpuintrf_temp_str(), "EA :%08X", sh2.ea); break;
  8381.  
  8382. case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK: info->f = (genf*)sh2.ftcsr_read_callback; break;
  8383.  
  8384. }
  8385. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement