10 # 1 "src/mamecore.h" 1
17 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 1 3 4
18 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
19 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 1 3 4
20 # 267 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 3 4
21 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_config.h" 1 3 4
22 # 268 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 2 3 4
23 # 303 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 3 4
24 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/cdefs.h" 1 3 4
25 # 304 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 2 3 4
26 # 29 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
32 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
33 # 213 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4
34 typedef long unsigned int size_t;
35 # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
37 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 1 3 4
38 # 29 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 3 4
39 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
40 # 30 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4
41 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/kernel_types.h" 1 3 4
42 # 10 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/kernel_types.h" 3 4
43 typedef unsigned short __kernel_dev_t;
44 typedef unsigned long __kernel_ino_t;
45 typedef unsigned short __kernel_mode_t;
46 typedef unsigned short __kernel_nlink_t;
47 typedef long __kernel_off_t;
48 typedef int __kernel_pid_t;
49 typedef unsigned short __kernel_ipc_pid_t;
50 typedef unsigned short __kernel_uid_t;
51 typedef unsigned short __kernel_gid_t;
52 typedef unsigned int __kernel_size_t;
53 typedef int __kernel_ssize_t;
54 typedef int __kernel_ptrdiff_t;
55 typedef long __kernel_time_t;
56 typedef long __kernel_suseconds_t;
57 typedef long __kernel_clock_t;
58 typedef int __kernel_daddr_t;
59 typedef char * __kernel_caddr_t;
60 typedef unsigned short __kernel_uid16_t;
61 typedef unsigned short __kernel_gid16_t;
62 typedef unsigned int __kernel_uid32_t;
63 typedef unsigned int __kernel_gid32_t;
64 typedef unsigned short __kernel_old_uid_t;
65 typedef unsigned short __kernel_old_gid_t;
66 typedef long long __kernel_loff_t;
67 typedef __kernel_dev_t __kernel_old_dev_t;
76 # 31 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4
79 typedef unsigned char __u_char;
80 typedef unsigned short __u_short;
81 typedef unsigned int __u_int;
82 typedef unsigned long __u_long;
84 __extension__ typedef unsigned long long int __u_quad_t;
85 __extension__ typedef long long int __quad_t;
86 # 50 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 3 4
87 typedef signed char __int8_t;
88 typedef unsigned char __uint8_t;
89 typedef signed short int __int16_t;
90 typedef unsigned short int __uint16_t;
91 typedef signed int __int32_t;
92 typedef unsigned int __uint32_t;
94 __extension__ typedef signed long long int __int64_t;
95 __extension__ typedef unsigned long long int __uint64_t;
97 typedef __quad_t *__qaddr_t;
99 typedef __u_quad_t __dev_t;
100 typedef __u_int __uid_t;
101 typedef __u_int __gid_t;
102 typedef __u_long __ino_t;
103 typedef __u_int __mode_t;
104 typedef __u_int __nlink_t;
105 typedef long int __off_t;
106 typedef __quad_t __loff_t;
108 typedef long int __ssize_t;
109 typedef __u_long __rlim_t;
110 typedef __u_quad_t __rlim64_t;
111 typedef __u_int __id_t;
119 typedef int __daddr_t;
120 typedef char *__caddr_t;
121 typedef long int __time_t;
122 typedef unsigned int __useconds_t;
123 typedef long int __suseconds_t;
124 typedef long int __swblk_t;
126 typedef long int __clock_t;
129 typedef int __clockid_t;
132 typedef int __timer_t;
142 typedef __kernel_ipc_pid_t __ipc_pid_t;
146 typedef long int __blksize_t;
151 typedef long int __blkcnt_t;
152 typedef __quad_t __blkcnt64_t;
155 typedef __u_long __fsblkcnt_t;
156 typedef __u_quad_t __fsblkcnt64_t;
159 typedef __u_long __fsfilcnt_t;
160 typedef __u_quad_t __fsfilcnt64_t;
163 typedef __u_quad_t __ino64_t;
166 typedef __loff_t __off64_t;
169 typedef long int __t_scalar_t;
170 typedef unsigned long int __t_uscalar_t;
173 typedef int __intptr_t;
176 typedef unsigned int __socklen_t;
181 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 1 3 4
182 # 23 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 3 4
183 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sched.h" 1 3 4
184 # 68 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sched.h" 3 4
187 int __sched_priority;
189 # 24 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 2 3 4
192 struct _pthread_fastlock
201 typedef struct _pthread_descr_struct *_pthread_descr;
207 typedef struct __pthread_attr_s
211 struct __sched_param __schedparam;
224 struct _pthread_fastlock __c_lock;
225 _pthread_descr __c_waiting;
233 } pthread_condattr_t;
236 typedef unsigned int pthread_key_t;
246 _pthread_descr __m_owner;
248 struct _pthread_fastlock __m_lock;
256 } pthread_mutexattr_t;
260 typedef int pthread_once_t;
261 # 140 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 3 4
262 typedef unsigned long int pthread_t;
263 # 145 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4
264 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
274 typedef struct __STDIO_FILE_STRUCT FILE;
280 # 62 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
281 typedef struct __STDIO_FILE_STRUCT __FILE;
282 # 72 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
283 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 1 3 4
284 # 121 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
285 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 1 3 4
286 # 122 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 2 3 4
287 # 178 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
312 typedef __off64_t __offmax_t;
313 # 241 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
314 struct __STDIO_FILE_STRUCT {
315 unsigned short __modeflags;
323 unsigned char __ungot[2];
327 unsigned char *__bufstart;
328 unsigned char *__bufend;
329 unsigned char *__bufpos;
330 unsigned char *__bufread;
333 unsigned char *__bufgetc_u;
336 unsigned char *__bufputc_u;
342 struct __STDIO_FILE_STRUCT *__nextopen;
343 # 285 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
345 pthread_mutex_t __lock;
352 # 387 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
353 extern int __fgetc_unlocked(FILE *__stream);
354 extern int __fputc_unlocked(int __c, FILE *__stream);
355 # 406 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
356 extern FILE *__stdin;
357 # 465 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
358 extern FILE *__stdout;
359 # 73 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
363 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 1 3 4
364 # 43 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 3 4
365 typedef __builtin_va_list __gnuc_va_list;
366 # 77 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
373 typedef __STDIO_fpos64_t fpos_t;
376 # 131 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
377 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/stdio_lim.h" 1 3 4
378 # 132 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
392 extern int remove (__const char *__filename) ;
394 extern int rename (__const char *__old, __const char *__new) ;
399 # 160 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
400 extern FILE *tmpfile (void) __asm__ ("_" "tmpfile64");
401 # 171 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
402 extern char *tmpnam (char *__s) ;
408 extern char *tmpnam_r (char *__s) ;
409 # 189 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
410 extern char *tempnam (__const char *__dir, __const char *__pfx)
411 __attribute__ ((__malloc__));
420 extern int fclose (FILE *__stream);
425 extern int fflush (FILE *__stream);
427 # 214 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
428 extern int fflush_unlocked (FILE *__stream);
429 # 228 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
431 # 245 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
432 extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) __asm__ ("_" "fopen64");
434 extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("_" "freopen64");
443 # 266 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
444 extern FILE *fdopen (int __fd, __const char *__modes) ;
445 # 289 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
449 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ;
453 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
454 int __modes, size_t __n) ;
460 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
464 extern void setlinebuf (FILE *__stream) ;
473 extern int fprintf (FILE *__restrict __stream,
474 __const char *__restrict __format, ...);
479 extern int printf (__const char *__restrict __format, ...);
481 extern int sprintf (char *__restrict __s,
482 __const char *__restrict __format, ...) ;
488 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
489 __gnuc_va_list __arg);
494 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
496 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
497 __gnuc_va_list __arg) ;
503 extern int snprintf (char *__restrict __s, size_t __maxlen,
504 __const char *__restrict __format, ...)
505 __attribute__ ((__format__ (__printf__, 3, 4)));
507 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
508 __const char *__restrict __format, __gnuc_va_list __arg)
509 __attribute__ ((__format__ (__printf__, 3, 0)));
511 # 383 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
517 extern int fscanf (FILE *__restrict __stream,
518 __const char *__restrict __format, ...);
523 extern int scanf (__const char *__restrict __format, ...);
525 extern int sscanf (__const char *__restrict __s,
526 __const char *__restrict __format, ...) ;
528 # 425 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
534 extern int fgetc (FILE *__stream);
535 extern int getc (FILE *__stream);
541 extern int getchar (void);
543 # 449 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
544 extern int getc_unlocked (FILE *__stream);
545 extern int getchar_unlocked (void);
546 # 463 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
547 extern int fgetc_unlocked (FILE *__stream);
559 extern int fputc (int __c, FILE *__stream);
560 extern int putc (int __c, FILE *__stream);
566 extern int putchar (int __c);
568 # 496 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
569 extern int fputc_unlocked (int __c, FILE *__stream);
577 extern int putc_unlocked (int __c, FILE *__stream);
578 extern int putchar_unlocked (int __c);
579 # 515 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
580 extern int getw (FILE *__stream);
583 extern int putw (int __w, FILE *__stream);
592 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream);
599 extern char *gets (char *__s);
601 # 579 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
607 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
613 extern int puts (__const char *__s);
620 extern int ungetc (int __c, FILE *__stream);
627 extern size_t fread (void *__restrict __ptr, size_t __size,
628 size_t __n, FILE *__restrict __stream);
633 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
634 size_t __n, FILE *__restrict __s);
636 # 632 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
637 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
638 size_t __n, FILE *__restrict __stream);
639 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
640 size_t __n, FILE *__restrict __stream);
649 extern int fseek (FILE *__stream, long int __off, int __whence);
654 extern long int ftell (FILE *__stream);
659 extern void rewind (FILE *__stream);
661 # 676 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
662 extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("_" "fseeko64");
665 extern __off64_t ftello (FILE *__stream) __asm__ ("_" "ftello64");
674 # 701 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
675 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("_" "fgetpos64");
677 extern int fsetpos (FILE *__stream, __const fpos_t *__pos) __asm__ ("_" "fsetpos64");
685 # 719 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
688 extern void clearerr (FILE *__stream) ;
690 extern int feof (FILE *__stream) ;
692 extern int ferror (FILE *__stream) ;
697 extern void clearerr_unlocked (FILE *__stream) ;
698 extern int feof_unlocked (FILE *__stream) ;
699 extern int ferror_unlocked (FILE *__stream) ;
708 extern void perror (__const char *__s);
710 # 756 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
711 extern int fileno (FILE *__stream) ;
716 extern int fileno_unlocked (FILE *__stream) ;
717 # 771 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
718 extern FILE *popen (__const char *__command, __const char *__modes);
724 extern int pclose (FILE *__stream);
730 extern char *ctermid (char *__s) ;
731 # 811 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
732 extern void flockfile (FILE *__stream) ;
736 extern int ftrylockfile (FILE *__stream) ;
739 extern void funlockfile (FILE *__stream) ;
740 # 858 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
744 extern int __snprintf (char *__restrict __s, size_t __maxlen,
745 const char *__restrict __format, ...)
746 __attribute__ ((__format__ (__printf__, 3, 4)));
747 extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
748 const char *__restrict __format, __gnuc_va_list __arg)
749 __attribute__ ((__format__ (__printf__, 3, 0)));
750 # 18 "src/mamecore.h" 2
751 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 1 3 4
752 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
758 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
759 # 34 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 2 3 4
764 extern void *memcpy (void *__restrict __dest,
765 __const void *__restrict __src, size_t __n) ;
773 extern void *memmove (void *__dest, __const void *__src, size_t __n)
781 extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
789 extern void *memset (void *__s, int __c, size_t __n) ;
796 extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
797 __attribute__ ((__pure__));
800 extern void *memchr (__const void *__s, int __c, size_t __n)
801 __attribute__ ((__pure__));
803 # 89 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
806 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
809 extern char *strncpy (char *__restrict __dest,
810 __const char *__restrict __src, size_t __n) ;
813 extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
816 extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
820 extern int strcmp (__const char *__s1, __const char *__s2)
821 __attribute__ ((__pure__));
823 extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
824 __attribute__ ((__pure__));
827 extern int strcoll (__const char *__s1, __const char *__s2)
828 __attribute__ ((__pure__));
830 extern size_t strxfrm (char *__restrict __dest,
831 __const char *__restrict __src, size_t __n) ;
833 # 143 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
834 extern char *strdup (__const char *__s) __attribute__ ((__malloc__));
835 # 177 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
838 extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
840 extern char *strrchr (__const char *__s, int __c) __attribute__ ((__pure__));
852 extern size_t strcspn (__const char *__s, __const char *__reject)
853 __attribute__ ((__pure__));
856 extern size_t strspn (__const char *__s, __const char *__accept)
857 __attribute__ ((__pure__));
859 extern char *strpbrk (__const char *__s, __const char *__accept)
860 __attribute__ ((__pure__));
862 extern char *strstr (__const char *__haystack, __const char *__needle)
863 __attribute__ ((__pure__));
867 extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
873 extern char *__strtok_r (char *__restrict __s,
874 __const char *__restrict __delim,
875 char **__restrict __save_ptr) ;
877 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
878 char **__restrict __save_ptr) ;
879 # 245 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
882 extern size_t strlen (__const char *__s) __attribute__ ((__pure__));
884 # 258 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
887 extern char *strerror (int __errnum) ;
896 extern char *_glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) ;
897 extern int _susv3_strerror_r (int __errnum, char *__buf, size_t buflen) ;
898 # 282 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
899 extern char *strerror_r (int __errnum, char *__buf, size_t buflen) __asm__ ("_" "_glibc_strerror_r");
900 # 293 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
901 extern void __bzero (void *__s, size_t __n) ;
905 extern void bcopy (__const void *__src, void *__dest, size_t __n) ;
908 extern void bzero (void *__s, size_t __n) ;
911 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
912 __attribute__ ((__pure__));
915 extern char *index (__const char *__s, int __c) __attribute__ ((__pure__));
918 extern char *rindex (__const char *__s, int __c) __attribute__ ((__pure__));
922 extern int ffs (int __i) __attribute__ ((__const__));
923 # 327 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
924 extern int strcasecmp (__const char *__s1, __const char *__s2)
925 __attribute__ ((__pure__));
928 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
929 __attribute__ ((__pure__));
930 # 356 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
931 extern char *strsep (char **__restrict __stringp,
932 __const char *__restrict __delim) ;
933 # 390 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
934 extern size_t strlcat(char *__restrict dst, const char *__restrict src,
936 extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
941 # 19 "src/mamecore.h" 2
942 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 1 3 4
943 # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
944 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
945 # 36 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4
948 # 95 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
967 # 147 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
971 extern double atof (__const char *__nptr) __attribute__ ((__pure__));
974 extern int atoi (__const char *__nptr) __attribute__ ((__pure__));
976 extern long int atol (__const char *__nptr) __attribute__ ((__pure__));
982 __extension__ extern long long int atoll (__const char *__nptr)
983 __attribute__ ((__pure__));
990 extern double strtod (__const char *__restrict __nptr,
991 char **__restrict __endptr) ;
993 # 185 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
996 extern long int strtol (__const char *__restrict __nptr,
997 char **__restrict __endptr, int __base) ;
999 extern unsigned long int strtoul (__const char *__restrict __nptr,
1000 char **__restrict __endptr, int __base)
1007 extern long long int strtoq (__const char *__restrict __nptr,
1008 char **__restrict __endptr, int __base) ;
1011 extern unsigned long long int strtouq (__const char *__restrict __nptr,
1012 char **__restrict __endptr, int __base)
1020 extern long long int strtoll (__const char *__restrict __nptr,
1021 char **__restrict __endptr, int __base) ;
1024 extern unsigned long long int strtoull (__const char *__restrict __nptr,
1025 char **__restrict __endptr, int __base)
1028 # 309 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1029 extern char *l64a (long int __n) ;
1032 extern long int a64l (__const char *__s) __attribute__ ((__pure__));
1037 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 1 3 4
1038 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1045 typedef __u_char u_char;
1046 typedef __u_short u_short;
1047 typedef __u_int u_int;
1048 typedef __u_long u_long;
1049 typedef __quad_t quad_t;
1050 typedef __u_quad_t u_quad_t;
1051 typedef __fsid_t fsid_t;
1056 typedef __loff_t loff_t;
1062 typedef __ino64_t ino_t;
1063 # 61 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1064 typedef __dev_t dev_t;
1069 typedef __gid_t gid_t;
1074 typedef __mode_t mode_t;
1079 typedef __nlink_t nlink_t;
1084 typedef __uid_t uid_t;
1092 typedef __off64_t off_t;
1093 # 99 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1094 typedef __pid_t pid_t;
1099 typedef __id_t id_t;
1104 typedef __ssize_t ssize_t;
1110 typedef __daddr_t daddr_t;
1111 typedef __caddr_t caddr_t;
1117 typedef __key_t key_t;
1118 # 132 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1119 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4
1120 # 74 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1123 typedef __time_t time_t;
1127 # 92 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1128 typedef __clockid_t clockid_t;
1129 # 104 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1130 typedef __timer_t timer_t;
1131 # 133 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1132 # 146 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1133 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
1134 # 147 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1138 typedef unsigned long int ulong;
1139 typedef unsigned short int ushort;
1140 typedef unsigned int uint;
1141 # 190 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1142 typedef int int8_t __attribute__ ((__mode__ (__QI__)));
1143 typedef int int16_t __attribute__ ((__mode__ (__HI__)));
1144 typedef int int32_t __attribute__ ((__mode__ (__SI__)));
1145 typedef int int64_t __attribute__ ((__mode__ (__DI__)));
1148 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
1149 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
1150 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
1151 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
1153 typedef int register_t __attribute__ ((__mode__ (__word__)));
1154 # 212 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1155 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 1 3 4
1156 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 3 4
1157 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/endian.h" 1 3 4
1158 # 38 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 2 3 4
1159 # 213 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1162 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 1 3 4
1163 # 31 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4
1164 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/select.h" 1 3 4
1165 # 32 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1168 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sigset.h" 1 3 4
1169 # 23 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sigset.h" 3 4
1170 typedef int __sig_atomic_t;
1177 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
1179 # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1183 typedef __sigset_t sigset_t;
1188 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4
1189 # 118 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1195 # 44 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1197 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 1 3 4
1198 # 71 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 3 4
1202 __suseconds_t tv_usec;
1204 # 46 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1208 typedef long int __fd_mask;
1224 __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
1234 typedef __fd_mask fd_mask;
1235 # 89 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4
1243 extern int select (int __nfds, fd_set *__restrict __readfds,
1244 fd_set *__restrict __writefds,
1245 fd_set *__restrict __exceptfds,
1246 struct timeval *__restrict __timeout) ;
1247 # 112 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4
1249 # 216 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1252 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/sysmacros.h" 1 3 4
1253 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/sysmacros.h" 3 4
1255 static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
1258 static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
1261 static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
1262 unsigned int __minor)
1266 __extension__ static __inline unsigned int
1267 gnu_dev_major (unsigned long long int __dev)
1269 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
1272 __extension__ static __inline unsigned int
1273 gnu_dev_minor (unsigned long long int __dev)
1275 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
1278 __extension__ static __inline unsigned long long int
1279 gnu_dev_makedev (unsigned int __major, unsigned int __minor)
1281 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
1282 | (((unsigned long long int) (__minor & ~0xff)) << 12)
1283 | (((unsigned long long int) (__major & ~0xfff)) << 32));
1285 # 219 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1286 # 243 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1287 typedef __blkcnt64_t blkcnt_t;
1291 typedef __fsblkcnt64_t fsblkcnt_t;
1295 typedef __fsfilcnt64_t fsfilcnt_t;
1296 # 262 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1298 # 318 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4
1305 extern long int random (void) ;
1308 extern void srandom (unsigned int __seed) ;
1314 extern char *initstate (unsigned int __seed, char *__statebuf,
1315 size_t __statelen) ;
1319 extern char *setstate (char *__statebuf) ;
1338 extern int random_r (struct random_data *__restrict __buf,
1339 int32_t *__restrict __result) ;
1341 extern int srandom_r (unsigned int __seed, struct random_data *__buf) ;
1343 extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
1345 struct random_data *__restrict __buf) ;
1347 extern int setstate_r (char *__restrict __statebuf,
1348 struct random_data *__restrict __buf) ;
1355 extern int rand (void) ;
1357 extern void srand (unsigned int __seed) ;
1362 extern int rand_r (unsigned int *__seed) ;
1363 # 390 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1364 extern double drand48 (void) ;
1365 extern double erand48 (unsigned short int __xsubi[3]) ;
1369 extern long int lrand48 (void) ;
1370 extern long int nrand48 (unsigned short int __xsubi[3]) ;
1373 extern long int mrand48 (void) ;
1374 extern long int jrand48 (unsigned short int __xsubi[3]) ;
1377 extern void srand48 (long int __seedval) ;
1378 extern unsigned short int *seed48 (unsigned short int __seed16v[3]) ;
1379 extern void lcong48 (unsigned short int __param[7]) ;
1387 unsigned short int __x[3];
1388 unsigned short int __old_x[3];
1389 unsigned short int __c;
1390 unsigned short int __init;
1391 unsigned long long int __a;
1396 extern int drand48_r (struct drand48_data *__restrict __buffer,
1397 double *__restrict __result) ;
1398 extern int erand48_r (unsigned short int __xsubi[3],
1399 struct drand48_data *__restrict __buffer,
1400 double *__restrict __result) ;
1404 extern int lrand48_r (struct drand48_data *__restrict __buffer,
1405 long int *__restrict __result) ;
1406 extern int nrand48_r (unsigned short int __xsubi[3],
1407 struct drand48_data *__restrict __buffer,
1408 long int *__restrict __result) ;
1411 extern int mrand48_r (struct drand48_data *__restrict __buffer,
1412 long int *__restrict __result) ;
1413 extern int jrand48_r (unsigned short int __xsubi[3],
1414 struct drand48_data *__restrict __buffer,
1415 long int *__restrict __result) ;
1418 extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
1421 extern int seed48_r (unsigned short int __seed16v[3],
1422 struct drand48_data *__buffer) ;
1424 extern int lcong48_r (unsigned short int __param[7],
1425 struct drand48_data *__buffer) ;
1435 extern void *malloc (size_t __size) __attribute__ ((__malloc__));
1437 extern void *calloc (size_t __nmemb, size_t __size)
1438 __attribute__ ((__malloc__));
1446 extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__malloc__));
1448 extern void free (void *__ptr) ;
1453 extern void cfree (void *__ptr) ;
1457 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 1 3 4
1458 # 25 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 3 4
1459 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
1460 # 26 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 2 3 4
1468 extern void *alloca (size_t __size) ;
1475 # 484 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4
1480 extern void *valloc (size_t __size) __attribute__ ((__malloc__));
1481 # 497 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1484 extern void abort (void) __attribute__ ((__noreturn__));
1488 extern int atexit (void (*__func) (void)) ;
1494 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
1502 extern void exit (int __status) __attribute__ ((__noreturn__));
1504 # 529 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1507 extern char *getenv (__const char *__name) ;
1512 extern char *__secure_getenv (__const char *__name) ;
1518 extern int putenv (char *__string) ;
1524 extern int setenv (__const char *__name, __const char *__value, int __replace)
1528 extern int unsetenv (__const char *__name) ;
1529 # 568 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1530 extern int clearenv (void) ;
1531 # 577 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1532 extern char *mktemp (char *__template) ;
1533 # 591 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1534 extern int mkstemp (char *__template) __asm__ ("_" "mkstemp64");
1535 # 607 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1536 extern char *mkdtemp (char *__template) ;
1545 extern int system (__const char *__command);
1547 # 627 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1548 extern char *realpath (__const char *__restrict __name,
1549 char *__restrict __resolved) ;
1556 typedef int (*__compar_fn_t) (__const void *, __const void *);
1566 extern void *bsearch (__const void *__key, __const void *__base,
1567 size_t __nmemb, size_t __size, __compar_fn_t __compar);
1571 extern void qsort (void *__base, size_t __nmemb, size_t __size,
1572 __compar_fn_t __compar);
1576 extern int abs (int __x) __attribute__ ((__const__));
1577 extern long int labs (long int __x) __attribute__ ((__const__));
1590 extern div_t div (int __numer, int __denom)
1591 __attribute__ ((__const__));
1592 extern ldiv_t ldiv (long int __numer, long int __denom)
1593 __attribute__ ((__const__));
1595 # 714 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1596 extern int rpmatch (__const char *__response) ;
1597 # 775 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1598 extern int getloadavg (double __loadavg[], int __nelem) ;
1605 # 20 "src/mamecore.h" 2
1606 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 1 3 4
1607 # 32 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1609 # 41 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1612 _ISupper = (1 << (0)),
1613 _ISlower = (1 << (1)),
1614 _ISalpha = (1 << (2)),
1615 _ISdigit = (1 << (3)),
1616 _ISxdigit = (1 << (4)),
1617 _ISspace = (1 << (5)),
1618 _ISprint = (1 << (6)),
1619 _ISgraph = (1 << (7)),
1620 _ISblank = (1 << (8)),
1621 _IScntrl = (1 << (9)),
1622 _ISpunct = (1 << (10)),
1623 _ISalnum = (1 << (11))
1629 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_touplow.h" 1 3 4
1630 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_touplow.h" 3 4
1631 typedef __uint16_t __ctype_mask_t;
1635 typedef __int16_t __ctype_touplow_t;
1636 # 61 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 2 3 4
1637 # 103 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1638 extern const __ctype_mask_t *__C_ctype_b;
1639 extern const __ctype_touplow_t *__C_ctype_toupper;
1640 extern const __ctype_touplow_t *__C_ctype_tolower;
1641 # 123 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1642 extern const __ctype_mask_t *__ctype_b;
1643 extern const __ctype_touplow_t *__ctype_toupper;
1644 extern const __ctype_touplow_t *__ctype_tolower;
1645 # 143 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1646 extern int isxlower(int c) ;
1647 extern int isxupper(int c) ;
1648 # 155 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1655 extern int isalnum (int) ;
1656 extern int isalpha (int) ;
1657 extern int iscntrl (int) ;
1658 extern int isdigit (int) ;
1659 extern int islower (int) ;
1660 extern int isgraph (int) ;
1661 extern int isprint (int) ;
1662 extern int ispunct (int) ;
1663 extern int isspace (int) ;
1664 extern int isupper (int) ;
1665 extern int isxdigit (int) ;
1669 extern int tolower (int __c) ;
1672 extern int toupper (int __c) ;
1675 # 201 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1676 extern int isascii (int __c) ;
1680 extern int toascii (int __c) ;
1684 extern int _toupper (int) ;
1685 extern int _tolower (int) ;
1686 # 382 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1688 # 21 "src/mamecore.h" 2
1689 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/assert.h" 1 3 4
1690 # 36 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/assert.h" 3 4
1692 extern void __assert (const char *, const char *, int, const char *) ;
1694 # 22 "src/mamecore.h" 2
1695 # 1 "src/unix/osd_cpu.h" 1
1696 # 27 "src/unix/osd_cpu.h"
1697 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4
1698 # 30 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1707 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
1708 # 39 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 2 3 4
1712 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 1 3 4
1713 # 38 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 3 4
1714 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_clk_tck.h" 1 3 4
1715 # 39 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 2 3 4
1716 # 43 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 2 3 4
1717 # 58 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1720 typedef __clock_t clock_t;
1724 # 129 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1742 __const char *tm_zone;
1759 struct timespec it_interval;
1760 struct timespec it_value;
1765 # 180 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1769 extern clock_t clock (void) ;
1772 extern time_t time (time_t *__timer) ;
1776 extern double difftime (time_t __time1, time_t __time0)
1777 __attribute__ ((__const__));
1781 extern time_t mktime (struct tm *__tp) ;
1787 extern size_t strftime (char *__restrict __s, size_t __maxsize,
1788 __const char *__restrict __format,
1789 __const struct tm *__restrict __tp) ;
1791 # 243 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1795 extern struct tm *gmtime (__const time_t *__timer) ;
1799 extern struct tm *localtime (__const time_t *__timer) ;
1805 extern struct tm *gmtime_r (__const time_t *__restrict __timer,
1806 struct tm *__restrict __tp) ;
1810 extern struct tm *localtime_r (__const time_t *__restrict __timer,
1811 struct tm *__restrict __tp) ;
1817 extern char *asctime (__const struct tm *__tp) ;
1820 extern char *ctime (__const time_t *__timer) ;
1828 extern char *asctime_r (__const struct tm *__restrict __tp,
1829 char *__restrict __buf) ;
1832 extern char *ctime_r (__const time_t *__restrict __timer,
1833 char *__restrict __buf) ;
1834 # 299 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1835 extern char *tzname[2];
1839 extern void tzset (void) ;
1843 extern int daylight;
1844 extern long int timezone;
1850 extern int stime (__const time_t *__when) ;
1851 # 329 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1852 extern time_t timegm (struct tm *__tp) ;
1855 extern time_t timelocal (struct tm *__tp) ;
1858 extern int dysize (int __year) __attribute__ ((__const__));
1859 # 344 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1860 extern int nanosleep (__const struct timespec *__requested_time,
1861 struct timespec *__remaining);
1865 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) ;
1866 # 438 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1868 # 28 "src/unix/osd_cpu.h" 2
1869 # 44 "src/unix/osd_cpu.h"
1870 typedef signed char INT8;
1871 typedef signed short INT16;
1872 typedef signed int INT32;
1880 typedef signed long long INT64;
1883 typedef unsigned char UINT8;
1884 typedef unsigned short UINT16;
1885 typedef unsigned int UINT32;
1886 typedef unsigned long long UINT64;
1887 # 23 "src/mamecore.h" 2
1888 # 37 "src/mamecore.h"
1889 typedef UINT32 FPTR;
1894 typedef void genf(void);
1900 typedef struct _mame_display mame_display;
1901 typedef struct _game_driver game_driver;
1902 typedef struct _machine_config machine_config;
1903 typedef struct _rom_load_data rom_load_data;
1904 typedef struct _xml_data_node xml_data_node;
1905 typedef struct _performance_info performance_info;
1906 typedef struct _osd_file osd_file;
1910 typedef UINT32 pen_t;
1926 void (*plot)(struct _mame_bitmap *bitmap,int x,int y,pen_t pen);
1927 pen_t (*read)(struct _mame_bitmap *bitmap,int x,int y);
1928 void (*plot_box)(struct _mame_bitmap *bitmap,int x,int y,int width,int height,pen_t pen);
1930 typedef struct _mame_bitmap mame_bitmap;
1939 typedef struct _rectangle rectangle;
1940 # 98 "src/mamecore.h"
1944 struct { UINT8 l,h,h2,h3; } b;
1945 struct { UINT16 l,h; } w;
1952 # 118 "src/mamecore.h"
1956 struct { UINT8 l,h,h2,h3,h4,h5,h6,h7; } b;
1957 struct { UINT16 l,h,h2,h3; } w;
1958 struct { UINT32 l,h; } d;
1966 # 334 "src/mamecore.h"
1967 static __inline__ int mame_stricmp(const char *s1, const char *s2)
1971 int c1 = (__extension__ ({ int __res; if (sizeof (*s1++) > 1) { if (__builtin_constant_p (*s1++)) { int __c = (*s1++); __res = (((unsigned int)((__c) + 128)) < 384) ? ((__ctype_tolower))[__c] : __c; } else __res = tolower (*s1++); } else __res = ((__ctype_tolower))[(int) (*s1++)]; __res; }));
1972 int c2 = (__extension__ ({ int __res; if (sizeof (*s2++) > 1) { if (__builtin_constant_p (*s2++)) { int __c = (*s2++); __res = (((unsigned int)((__c) + 128)) < 384) ? ((__ctype_tolower))[__c] : __c; } else __res = tolower (*s2++); } else __res = ((__ctype_tolower))[(int) (*s2++)]; __res; }));
1973 if (c1 == 0 || c1 != c2)
1977 # 352 "src/mamecore.h"
1978 static __inline__ void sect_rect(rectangle *dst, const rectangle *src)
1980 if (src->min_x > dst->min_x) dst->min_x = src->min_x;
1981 if (src->max_x < dst->max_x) dst->max_x = src->max_x;
1982 if (src->min_y > dst->min_y) dst->min_y = src->min_y;
1983 if (src->max_y < dst->max_y) dst->max_y = src->max_y;
1988 static __inline__ float u2f(UINT32 v)
2000 static __inline__ UINT32 f2u(float f)
2012 static __inline__ float u2d(UINT64 v)
2024 static __inline__ UINT64 d2u(double d)
2033 # 422 "src/mamecore.h"
2034 static __inline__ UINT32 count_leading_zeros(UINT32 val)
2037 for (count = 0; (INT32)val >= 0; count++) val <<= 1;
2045 static __inline__ UINT32 count_leading_ones(UINT32 val)
2048 for (count = 0; (INT32)val < 0; count++) val <<= 1;
2056 static __inline__ INT32 fixed_mul_shift(INT32 val1, INT32 val2, UINT8 shift)
2058 return (INT32)(((INT64)val1 * (INT64)val2) >> shift);
2060 # 458 "src/mamecore.h"
2061 static __inline__ int bcd_adjust(int value)
2063 if ((value & 0xf) >= 0xa)
2064 value = value + 0x10 - 0xa;
2065 if ((value & 0xf0) >= 0xa0)
2066 value = value - 0xa0 + 0x100;
2071 static __inline__ int dec_2_bcd(int a)
2073 return (a % 10) | ((a / 10) << 4);
2077 static __inline__ int bcd_2_dec(int a)
2079 return (a & 0xf) + (a >> 4) * 10;
2081 # 487 "src/mamecore.h"
2082 static __inline__ int gregorian_is_leap_year(int year)
2084 return !(year % 100 ? year % 4 : year % 400);
2089 static __inline__ int gregorian_days_in_month(int month, int year)
2092 return gregorian_is_leap_year(year) ? 29 : 28;
2093 else if (month == 4 || month == 6 || month == 9 || month == 11)
2098 # 63 "src/driver.h" 2
2099 # 1 "src/osdepend.h" 1
2100 # 12 "src/osdepend.h"
2107 # 1 "src/inptport.h" 1
2108 # 12 "src/inptport.h"
2114 # 1 "src/memory.h" 1
2122 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
2123 # 151 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4
2124 typedef long int ptrdiff_t;
2125 # 325 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4
2126 typedef int wchar_t;
2127 # 19 "src/memory.h" 2
2129 typedef UINT32 offs_t;
2132 typedef UINT8 (*read8_handler) (__attribute__((__unused__)) offs_t offset);
2133 typedef void (*write8_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
2134 typedef UINT16 (*read16_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
2135 typedef void (*write16_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
2136 typedef UINT32 (*read32_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
2137 typedef void (*write32_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask);
2138 typedef UINT64 (*read64_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask);
2139 typedef void (*write64_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask);
2140 typedef offs_t (*opbase_handler) (__attribute__((__unused__)) offs_t address);
2143 struct _data_accessors
2145 UINT8 (*read_byte)(offs_t offset);
2146 UINT16 (*read_word)(offs_t offset);
2147 UINT32 (*read_dword)(offs_t offset);
2148 UINT64 (*read_qword)(offs_t offset);
2150 void (*write_byte)(offs_t offset, UINT8 data);
2151 void (*write_word)(offs_t offset, UINT16 data);
2152 void (*write_dword)(offs_t offset, UINT32 data);
2153 void (*write_qword)(offs_t offset, UINT64 data);
2155 typedef struct _data_accessors data_accessors;
2156 # 554 "src/memory.h"
2157 typedef struct _handler_data handler_data;
2160 union _read_handlers
2163 read8_handler handler8;
2164 read16_handler handler16;
2165 read32_handler handler32;
2166 read64_handler handler64;
2168 typedef union _read_handlers read_handlers;
2171 union _write_handlers
2174 write8_handler handler8;
2175 write16_handler handler16;
2176 write32_handler handler32;
2177 write64_handler handler64;
2179 typedef union _write_handlers write_handlers;
2189 const char * read_name;
2190 write_handlers write;
2191 const char * write_name;
2199 typedef struct _address_map address_map;
2202 struct _address_space
2206 UINT8 * writelookup;
2207 handler_data * readhandlers;
2208 handler_data * writehandlers;
2209 data_accessors * accessors;
2211 typedef struct _address_space address_space;
2212 # 619 "src/memory.h"
2213 typedef address_map *(*construct_map_t)(address_map *map);
2214 # 771 "src/memory.h"
2215 UINT8 program_read_byte_8(offs_t address);
2216 void program_write_byte_8(offs_t address, UINT8 data);
2218 UINT8 program_read_byte_16be(offs_t address);
2219 UINT16 program_read_word_16be(offs_t address);
2220 void program_write_byte_16be(offs_t address, UINT8 data);
2221 void program_write_word_16be(offs_t address, UINT16 data);
2223 UINT8 program_read_byte_16le(offs_t address);
2224 UINT16 program_read_word_16le(offs_t address);
2225 void program_write_byte_16le(offs_t address, UINT8 data);
2226 void program_write_word_16le(offs_t address, UINT16 data);
2228 UINT8 program_read_byte_32be(offs_t address);
2229 UINT16 program_read_word_32be(offs_t address);
2230 UINT32 program_read_dword_32be(offs_t address);
2231 void program_write_byte_32be(offs_t address, UINT8 data);
2232 void program_write_word_32be(offs_t address, UINT16 data);
2233 void program_write_dword_32be(offs_t address, UINT32 data);
2235 UINT8 program_read_byte_32le(offs_t address);
2236 UINT16 program_read_word_32le(offs_t address);
2237 UINT32 program_read_dword_32le(offs_t address);
2238 void program_write_byte_32le(offs_t address, UINT8 data);
2239 void program_write_word_32le(offs_t address, UINT16 data);
2240 void program_write_dword_32le(offs_t address, UINT32 data);
2242 UINT8 program_read_byte_64be(offs_t address);
2243 UINT16 program_read_word_64be(offs_t address);
2244 UINT32 program_read_dword_64be(offs_t address);
2245 UINT64 program_read_qword_64be(offs_t address);
2246 void program_write_byte_64be(offs_t address, UINT8 data);
2247 void program_write_word_64be(offs_t address, UINT16 data);
2248 void program_write_dword_64be(offs_t address, UINT32 data);
2249 void program_write_qword_64be(offs_t address, UINT64 data);
2251 UINT8 program_read_byte_64le(offs_t address);
2252 UINT16 program_read_word_64le(offs_t address);
2253 UINT32 program_read_dword_64le(offs_t address);
2254 UINT64 program_read_qword_64le(offs_t address);
2255 void program_write_byte_64le(offs_t address, UINT8 data);
2256 void program_write_word_64le(offs_t address, UINT16 data);
2257 void program_write_dword_64le(offs_t address, UINT32 data);
2258 void program_write_qword_64le(offs_t address, UINT64 data);
2261 UINT8 data_read_byte_8(offs_t address);
2262 void data_write_byte_8(offs_t address, UINT8 data);
2264 UINT8 data_read_byte_16be(offs_t address);
2265 UINT16 data_read_word_16be(offs_t address);
2266 void data_write_byte_16be(offs_t address, UINT8 data);
2267 void data_write_word_16be(offs_t address, UINT16 data);
2269 UINT8 data_read_byte_16le(offs_t address);
2270 UINT16 data_read_word_16le(offs_t address);
2271 void data_write_byte_16le(offs_t address, UINT8 data);
2272 void data_write_word_16le(offs_t address, UINT16 data);
2274 UINT8 data_read_byte_32be(offs_t address);
2275 UINT16 data_read_word_32be(offs_t address);
2276 UINT32 data_read_dword_32be(offs_t address);
2277 void data_write_byte_32be(offs_t address, UINT8 data);
2278 void data_write_word_32be(offs_t address, UINT16 data);
2279 void data_write_dword_32be(offs_t address, UINT32 data);
2281 UINT8 data_read_byte_32le(offs_t address);
2282 UINT16 data_read_word_32le(offs_t address);
2283 UINT32 data_read_dword_32le(offs_t address);
2284 void data_write_byte_32le(offs_t address, UINT8 data);
2285 void data_write_word_32le(offs_t address, UINT16 data);
2286 void data_write_dword_32le(offs_t address, UINT32 data);
2288 UINT8 data_read_byte_64be(offs_t address);
2289 UINT16 data_read_word_64be(offs_t address);
2290 UINT32 data_read_dword_64be(offs_t address);
2291 UINT64 data_read_qword_64be(offs_t address);
2292 void data_write_byte_64be(offs_t address, UINT8 data);
2293 void data_write_word_64be(offs_t address, UINT16 data);
2294 void data_write_dword_64be(offs_t address, UINT32 data);
2295 void data_write_qword_64be(offs_t address, UINT64 data);
2297 UINT8 data_read_byte_64le(offs_t address);
2298 UINT16 data_read_word_64le(offs_t address);
2299 UINT32 data_read_dword_64le(offs_t address);
2300 UINT64 data_read_qword_64le(offs_t address);
2301 void data_write_byte_64le(offs_t address, UINT8 data);
2302 void data_write_word_64le(offs_t address, UINT16 data);
2303 void data_write_dword_64le(offs_t address, UINT32 data);
2304 void data_write_qword_64le(offs_t address, UINT64 data);
2307 UINT8 io_read_byte_8(offs_t address);
2308 void io_write_byte_8(offs_t address, UINT8 data);
2310 UINT8 io_read_byte_16be(offs_t address);
2311 UINT16 io_read_word_16be(offs_t address);
2312 void io_write_byte_16be(offs_t address, UINT8 data);
2313 void io_write_word_16be(offs_t address, UINT16 data);
2315 UINT8 io_read_byte_16le(offs_t address);
2316 UINT16 io_read_word_16le(offs_t address);
2317 void io_write_byte_16le(offs_t address, UINT8 data);
2318 void io_write_word_16le(offs_t address, UINT16 data);
2320 UINT8 io_read_byte_32be(offs_t address);
2321 UINT16 io_read_word_32be(offs_t address);
2322 UINT32 io_read_dword_32be(offs_t address);
2323 void io_write_byte_32be(offs_t address, UINT8 data);
2324 void io_write_word_32be(offs_t address, UINT16 data);
2325 void io_write_dword_32be(offs_t address, UINT32 data);
2327 UINT8 io_read_byte_32le(offs_t address);
2328 UINT16 io_read_word_32le(offs_t address);
2329 UINT32 io_read_dword_32le(offs_t address);
2330 void io_write_byte_32le(offs_t address, UINT8 data);
2331 void io_write_word_32le(offs_t address, UINT16 data);
2332 void io_write_dword_32le(offs_t address, UINT32 data);
2334 UINT8 io_read_byte_64be(offs_t address);
2335 UINT16 io_read_word_64be(offs_t address);
2336 UINT32 io_read_dword_64be(offs_t address);
2337 UINT64 io_read_qword_64be(offs_t address);
2338 void io_write_byte_64be(offs_t address, UINT8 data);
2339 void io_write_word_64be(offs_t address, UINT16 data);
2340 void io_write_dword_64be(offs_t address, UINT32 data);
2341 void io_write_qword_64be(offs_t address, UINT64 data);
2343 UINT8 io_read_byte_64le(offs_t address);
2344 UINT16 io_read_word_64le(offs_t address);
2345 UINT32 io_read_dword_64le(offs_t address);
2346 UINT64 io_read_qword_64le(offs_t address);
2347 void io_write_byte_64le(offs_t address, UINT8 data);
2348 void io_write_word_64le(offs_t address, UINT16 data);
2349 void io_write_dword_64le(offs_t address, UINT32 data);
2350 void io_write_qword_64le(offs_t address, UINT64 data);
2351 # 917 "src/memory.h"
2352 int memory_init(void);
2353 void memory_exit(void);
2354 void memory_set_context(int activecpu);
2357 const address_map *memory_get_map(int cpunum, int spacenum);
2360 opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function);
2361 void memory_set_opbase(offs_t offset);
2364 void memory_set_decrypted_region(int cpunum, offs_t start, offs_t end, void *base);
2367 void * memory_get_read_ptr(int cpunum, int spacenum, offs_t offset);
2368 void * memory_get_write_ptr(int cpunum, int spacenum, offs_t offset);
2369 void * memory_get_op_ptr(int cpunum, offs_t offset, int arg);
2372 void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride);
2373 void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride);
2374 void memory_set_bank(int banknum, int entrynum);
2375 void memory_set_bankptr(int banknum, void *base);
2378 void memory_set_debugger_access(int debugger);
2381 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);
2382 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);
2383 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);
2384 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);
2385 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);
2386 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);
2387 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);
2388 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);
2389 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);
2390 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);
2392 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);
2393 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);
2394 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);
2395 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);
2396 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);
2397 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);
2398 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);
2399 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);
2400 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);
2401 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);
2404 void memory_dump(FILE *file);
2405 const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset);
2406 # 980 "src/memory.h"
2407 extern UINT8 opcode_entry;
2408 extern UINT8 * opcode_base;
2409 extern UINT8 * opcode_arg_base;
2410 extern offs_t opcode_mask;
2411 extern offs_t opcode_memory_min;
2412 extern offs_t opcode_memory_max;
2413 extern address_space active_address_space[];
2414 extern address_map * construct_map_0(address_map *map);
2415 # 1069 "src/memory.h"
2416 static __inline__ UINT8 program_read_byte (offs_t offset) { return (*active_address_space[0].accessors->read_byte)(offset); }
2417 static __inline__ UINT16 program_read_word (offs_t offset) { return (*active_address_space[0].accessors->read_word)(offset); }
2418 static __inline__ UINT32 program_read_dword(offs_t offset) { return (*active_address_space[0].accessors->read_dword)(offset); }
2419 static __inline__ UINT64 program_read_qword(offs_t offset) { return (*active_address_space[0].accessors->read_qword)(offset); }
2421 static __inline__ void program_write_byte (offs_t offset, UINT8 data) { (*active_address_space[0].accessors->write_byte)(offset, data); }
2422 static __inline__ void program_write_word (offs_t offset, UINT16 data) { (*active_address_space[0].accessors->write_word)(offset, data); }
2423 static __inline__ void program_write_dword(offs_t offset, UINT32 data) { (*active_address_space[0].accessors->write_dword)(offset, data); }
2424 static __inline__ void program_write_qword(offs_t offset, UINT64 data) { (*active_address_space[0].accessors->write_qword)(offset, data); }
2426 static __inline__ UINT8 data_read_byte (offs_t offset) { return (*active_address_space[1].accessors->read_byte)(offset); }
2427 static __inline__ UINT16 data_read_word (offs_t offset) { return (*active_address_space[1].accessors->read_word)(offset); }
2428 static __inline__ UINT32 data_read_dword(offs_t offset) { return (*active_address_space[1].accessors->read_dword)(offset); }
2429 static __inline__ UINT64 data_read_qword(offs_t offset) { return (*active_address_space[1].accessors->read_qword)(offset); }
2431 static __inline__ void data_write_byte (offs_t offset, UINT8 data) { (*active_address_space[1].accessors->write_byte)(offset, data); }
2432 static __inline__ void data_write_word (offs_t offset, UINT16 data) { (*active_address_space[1].accessors->write_word)(offset, data); }
2433 static __inline__ void data_write_dword(offs_t offset, UINT32 data) { (*active_address_space[1].accessors->write_dword)(offset, data); }
2434 static __inline__ void data_write_qword(offs_t offset, UINT64 data) { (*active_address_space[1].accessors->write_qword)(offset, data); }
2436 static __inline__ UINT8 io_read_byte (offs_t offset) { return (*active_address_space[2].accessors->read_byte)(offset); }
2437 static __inline__ UINT16 io_read_word (offs_t offset) { return (*active_address_space[2].accessors->read_word)(offset); }
2438 static __inline__ UINT32 io_read_dword(offs_t offset) { return (*active_address_space[2].accessors->read_dword)(offset); }
2439 static __inline__ UINT64 io_read_qword(offs_t offset) { return (*active_address_space[2].accessors->read_qword)(offset); }
2441 static __inline__ void io_write_byte (offs_t offset, UINT8 data) { (*active_address_space[2].accessors->write_byte)(offset, data); }
2442 static __inline__ void io_write_word (offs_t offset, UINT16 data) { (*active_address_space[2].accessors->write_word)(offset, data); }
2443 static __inline__ void io_write_dword(offs_t offset, UINT32 data) { (*active_address_space[2].accessors->write_dword)(offset, data); }
2444 static __inline__ void io_write_qword(offs_t offset, UINT64 data) { (*active_address_space[2].accessors->write_qword)(offset, data); }
2447 UINT8 cpu_readop_safe(offs_t offset);
2448 UINT16 cpu_readop16_safe(offs_t offset);
2449 UINT32 cpu_readop32_safe(offs_t offset);
2450 UINT64 cpu_readop64_safe(offs_t offset);
2451 UINT8 cpu_readop_arg_safe(offs_t offset);
2452 UINT16 cpu_readop_arg16_safe(offs_t offset);
2453 UINT32 cpu_readop_arg32_safe(offs_t offset);
2454 UINT64 cpu_readop_arg64_safe(offs_t offset);
2455 # 1121 "src/memory.h"
2456 static __inline__ void * cpu_opptr(offs_t A) { if ((0)) { memory_set_opbase(A); } return ((void *)&opcode_base[(A) & opcode_mask]); }
2457 static __inline__ UINT8 cpu_readop(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_base[(A) & opcode_mask]); }
2458 static __inline__ UINT16 cpu_readop16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_base[(A) & opcode_mask]); }
2459 static __inline__ UINT32 cpu_readop32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_base[(A) & opcode_mask]); }
2460 static __inline__ UINT64 cpu_readop64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_base[(A) & opcode_mask]); }
2461 static __inline__ UINT8 cpu_readop_arg(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_arg_base[(A) & opcode_mask]); }
2462 static __inline__ UINT16 cpu_readop_arg16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_arg_base[(A) & opcode_mask]); }
2463 static __inline__ UINT32 cpu_readop_arg32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_arg_base[(A) & opcode_mask]); }
2464 static __inline__ UINT64 cpu_readop_arg64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_arg_base[(A) & opcode_mask]); }
2465 # 18 "src/inptport.h" 2
2472 ANALOG_TYPE_NONE = 0,
2473 ANALOG_TYPE_ABSOLUTE = 1,
2474 ANALOG_TYPE_RELATIVE = 2
2768 MOUSECODE_1_BUTTON1,
2769 MOUSECODE_1_BUTTON2,
2770 MOUSECODE_1_BUTTON3,
2771 MOUSECODE_1_BUTTON4,
2772 MOUSECODE_1_BUTTON5,
2773 MOUSECODE_1_BUTTON6,
2774 MOUSECODE_2_BUTTON1,
2775 MOUSECODE_2_BUTTON2,
2776 MOUSECODE_2_BUTTON3,
2777 MOUSECODE_2_BUTTON4,
2778 MOUSECODE_2_BUTTON5,
2779 MOUSECODE_2_BUTTON6,
2780 MOUSECODE_3_BUTTON1,
2781 MOUSECODE_3_BUTTON2,
2782 MOUSECODE_3_BUTTON3,
2783 MOUSECODE_3_BUTTON4,
2784 MOUSECODE_3_BUTTON5,
2785 MOUSECODE_3_BUTTON6,
2786 MOUSECODE_4_BUTTON1,
2787 MOUSECODE_4_BUTTON2,
2788 MOUSECODE_4_BUTTON3,
2789 MOUSECODE_4_BUTTON4,
2790 MOUSECODE_4_BUTTON5,
2791 MOUSECODE_4_BUTTON6,
2792 MOUSECODE_5_BUTTON1,
2793 MOUSECODE_5_BUTTON2,
2794 MOUSECODE_5_BUTTON3,
2795 MOUSECODE_5_BUTTON4,
2796 MOUSECODE_5_BUTTON5,
2797 MOUSECODE_5_BUTTON6,
2798 MOUSECODE_6_BUTTON1,
2799 MOUSECODE_6_BUTTON2,
2800 MOUSECODE_6_BUTTON3,
2801 MOUSECODE_6_BUTTON4,
2802 MOUSECODE_6_BUTTON5,
2803 MOUSECODE_6_BUTTON6,
2804 MOUSECODE_7_BUTTON1,
2805 MOUSECODE_7_BUTTON2,
2806 MOUSECODE_7_BUTTON3,
2807 MOUSECODE_7_BUTTON4,
2808 MOUSECODE_7_BUTTON5,
2809 MOUSECODE_7_BUTTON6,
2810 MOUSECODE_8_BUTTON1,
2811 MOUSECODE_8_BUTTON2,
2812 MOUSECODE_8_BUTTON3,
2813 MOUSECODE_8_BUTTON4,
2814 MOUSECODE_8_BUTTON5,
2815 MOUSECODE_8_BUTTON6,
2822 JOYCODE_1_ANALOG_PEDAL1,
2823 JOYCODE_1_ANALOG_PEDAL2,
2824 JOYCODE_1_ANALOG_PEDAL3,
2828 JOYCODE_2_ANALOG_PEDAL1,
2829 JOYCODE_2_ANALOG_PEDAL2,
2830 JOYCODE_2_ANALOG_PEDAL3,
2834 JOYCODE_3_ANALOG_PEDAL1,
2835 JOYCODE_3_ANALOG_PEDAL2,
2836 JOYCODE_3_ANALOG_PEDAL3,
2840 JOYCODE_4_ANALOG_PEDAL1,
2841 JOYCODE_4_ANALOG_PEDAL2,
2842 JOYCODE_4_ANALOG_PEDAL3,
2846 JOYCODE_5_ANALOG_PEDAL1,
2847 JOYCODE_5_ANALOG_PEDAL2,
2848 JOYCODE_5_ANALOG_PEDAL3,
2852 JOYCODE_6_ANALOG_PEDAL1,
2853 JOYCODE_6_ANALOG_PEDAL2,
2854 JOYCODE_6_ANALOG_PEDAL3,
2858 JOYCODE_7_ANALOG_PEDAL1,
2859 JOYCODE_7_ANALOG_PEDAL2,
2860 JOYCODE_7_ANALOG_PEDAL3,
2864 JOYCODE_8_ANALOG_PEDAL1,
2865 JOYCODE_8_ANALOG_PEDAL2,
2866 JOYCODE_8_ANALOG_PEDAL3,
2885 MOUSECODE_1_ANALOG_X,
2886 MOUSECODE_1_ANALOG_Y,
2887 MOUSECODE_1_ANALOG_Z,
2888 MOUSECODE_2_ANALOG_X,
2889 MOUSECODE_2_ANALOG_Y,
2890 MOUSECODE_2_ANALOG_Z,
2891 MOUSECODE_3_ANALOG_X,
2892 MOUSECODE_3_ANALOG_Y,
2893 MOUSECODE_3_ANALOG_Z,
2894 MOUSECODE_4_ANALOG_X,
2895 MOUSECODE_4_ANALOG_Y,
2896 MOUSECODE_4_ANALOG_Z,
2897 MOUSECODE_5_ANALOG_X,
2898 MOUSECODE_5_ANALOG_Y,
2899 MOUSECODE_5_ANALOG_Z,
2900 MOUSECODE_6_ANALOG_X,
2901 MOUSECODE_6_ANALOG_Y,
2902 MOUSECODE_6_ANALOG_Z,
2903 MOUSECODE_7_ANALOG_X,
2904 MOUSECODE_7_ANALOG_Y,
2905 MOUSECODE_7_ANALOG_Z,
2906 MOUSECODE_8_ANALOG_X,
2907 MOUSECODE_8_ANALOG_Y,
2908 MOUSECODE_8_ANALOG_Z,
2916 CODE_OTHER_ANALOG_ABSOLUTE,
2917 CODE_OTHER_ANALOG_RELATIVE,
2923 typedef UINT32 input_code;
2924 typedef UINT32 os_code;
2929 input_code code[16];
2931 typedef struct _input_seq input_seq;
2934 struct _os_code_info
2938 input_code inputcode;
2940 typedef struct _os_code_info os_code_info;
2942 int code_init(void);
2943 void code_exit(void);
2945 INT32 code_analog_value(input_code code);
2946 int code_pressed(input_code code);
2947 int code_pressed_memory(input_code code);
2948 int code_pressed_memory_repeat(input_code code, int speed);
2949 input_code code_read_async(void);
2951 int code_analog_type(input_code code);
2952 const char *code_name(input_code code);
2953 input_code token_to_code(const char *token);
2954 void code_to_token(input_code code, char *token);
2957 void seq_set_0(input_seq *seq);
2958 void seq_set_1(input_seq *seq, input_code code);
2959 void seq_set_2(input_seq *seq, input_code code1, input_code code2);
2960 void seq_set_3(input_seq *seq, input_code code1, input_code code2, input_code code3);
2961 void seq_set_4(input_seq *seq, input_code code1, input_code code2, input_code code3, input_code code4);
2962 void seq_set_5(input_seq *seq, input_code code1, input_code code2, input_code code3, input_code code4, input_code code5);
2963 void seq_copy(input_seq *seqdst, const input_seq *seqsrc);
2964 int seq_cmp(const input_seq *seqa, const input_seq *seqb);
2965 void seq_name(const input_seq *seq, char *buffer, unsigned max);
2966 int seq_pressed(const input_seq *seq);
2967 INT32 seq_analog_value(const input_seq *seq, int *analogtype);
2968 void seq_read_async_start(int analog);
2969 int seq_read_async(input_seq *seq, int first);
2970 int string_to_seq(const char *string, input_seq *seq);
2971 void seq_to_string(const input_seq *seq, char *string, int maxlen);
2973 static __inline__ input_code seq_get_1(const input_seq *seq) { return seq->code[0]; }
2974 # 19 "src/inptport.h" 2
2975 # 41 "src/inptport.h"
2978 SEQ_TYPE_STANDARD = 0,
2979 SEQ_TYPE_INCREMENT = 1,
2980 SEQ_TYPE_DECREMENT = 2
2987 PORTCOND_ALWAYS = 0,
3021 IPT_DIPSWITCH_SETTING,
3029 IPT_CATEGORY_SETTING,
3039 IPT_JOYSTICKRIGHT_UP,
3040 IPT_JOYSTICKRIGHT_DOWN,
3041 IPT_JOYSTICKRIGHT_LEFT,
3042 IPT_JOYSTICKRIGHT_RIGHT,
3043 IPT_JOYSTICKLEFT_UP,
3044 IPT_JOYSTICKLEFT_DOWN,
3045 IPT_JOYSTICKLEFT_LEFT,
3046 IPT_JOYSTICKLEFT_RIGHT,
3119 IPT_MAHJONG_LAST_CHANCE,
3121 IPT_MAHJONG_DOUBLE_UP,
3122 IPT_MAHJONG_FLIP_FLOP,
3151 IPT_UI_ON_SCREEN_DISPLAY,
3154 IPT_UI_RESET_MACHINE,
3156 IPT_UI_FRAMESKIP_DEC,
3157 IPT_UI_FRAMESKIP_INC,
3161 IPT_UI_RECORD_MOVIE,
3162 IPT_UI_TOGGLE_CHEAT,
3176 IPT_UI_SHOW_PROFILER,
3178 IPT_UI_TOGGLE_DEBUG,
3182 IPT_UI_DELETE_CHEAT,
3186 IPT_UI_TOGGLE_CROSSHAIR,
3329 # 404 "src/inptport.h"
3330 typedef struct _input_port_init_params input_port_init_params;
3333 struct _input_port_default_entry
3340 input_seq defaultseq;
3341 input_seq defaultincseq;
3342 input_seq defaultdecseq;
3344 typedef struct _input_port_default_entry input_port_default_entry;
3347 struct _input_port_entry
3350 UINT32 default_value;
3408 # 490 "src/inptport.h"
3410 typedef struct _input_port_entry input_port_entry;
3411 # 656 "src/inptport.h"
3412 extern const char *input_port_default_strings[];
3413 # 668 "src/inptport.h"
3414 int input_port_init(void (*construct_ipt)(input_port_init_params *));
3416 void input_port_load(int config_type, xml_data_node *parentnode);
3417 void input_port_save(int config_type, xml_data_node *parentnode);
3419 input_port_entry *input_port_initialize(input_port_init_params *params, UINT32 type, const char *tag, UINT32 mask);
3420 input_port_entry *input_port_allocate(void (*construct_ipt)(input_port_init_params *), input_port_entry *memory);
3422 input_port_default_entry *get_input_port_list(void);
3423 const input_port_default_entry *get_input_port_list_defaults(void);
3425 int input_port_active(const input_port_entry *in);
3426 int port_type_is_analog(int type);
3427 int port_type_in_use(int type);
3428 int port_type_to_group(int type, int player);
3429 int port_tag_to_index(const char *tag);
3430 read8_handler port_tag_to_handler8(const char *tag);
3431 read16_handler port_tag_to_handler16(const char *tag);
3432 read32_handler port_tag_to_handler32(const char *tag);
3433 const char *input_port_name(const input_port_entry *in);
3434 input_seq *input_port_seq(input_port_entry *in, int seqtype);
3435 input_seq *input_port_default_seq(int type, int player, int seqtype);
3436 int input_port_condition(const input_port_entry *in);
3438 const char *port_type_to_token(int type, int player);
3439 int token_to_port_type(const char *string, int *player);
3441 int input_port_type_pressed(int type, int player);
3442 int input_ui_pressed(int code);
3443 int input_ui_pressed_repeat(int code, int speed);
3445 void input_port_update_defaults(void);
3446 void input_port_vblank_start(void);
3447 void input_port_vblank_end(void);
3449 void input_port_set_digital_value(int port, UINT32 value, UINT32 mask);
3451 UINT32 readinputport(int port);
3452 UINT32 readinputportbytag(const char *tag);
3453 UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue);
3455 UINT8 input_port_0_r(__attribute__((__unused__)) offs_t offset);
3456 UINT8 input_port_1_r(__attribute__((__unused__)) offs_t offset);
3457 UINT8 input_port_2_r(__attribute__((__unused__)) offs_t offset);
3458 UINT8 input_port_3_r(__attribute__((__unused__)) offs_t offset);
3459 UINT8 input_port_4_r(__attribute__((__unused__)) offs_t offset);
3460 UINT8 input_port_5_r(__attribute__((__unused__)) offs_t offset);
3461 UINT8 input_port_6_r(__attribute__((__unused__)) offs_t offset);
3462 UINT8 input_port_7_r(__attribute__((__unused__)) offs_t offset);
3463 UINT8 input_port_8_r(__attribute__((__unused__)) offs_t offset);
3464 UINT8 input_port_9_r(__attribute__((__unused__)) offs_t offset);
3465 UINT8 input_port_10_r(__attribute__((__unused__)) offs_t offset);
3466 UINT8 input_port_11_r(__attribute__((__unused__)) offs_t offset);
3467 UINT8 input_port_12_r(__attribute__((__unused__)) offs_t offset);
3468 UINT8 input_port_13_r(__attribute__((__unused__)) offs_t offset);
3469 UINT8 input_port_14_r(__attribute__((__unused__)) offs_t offset);
3470 UINT8 input_port_15_r(__attribute__((__unused__)) offs_t offset);
3471 UINT8 input_port_16_r(__attribute__((__unused__)) offs_t offset);
3472 UINT8 input_port_17_r(__attribute__((__unused__)) offs_t offset);
3473 UINT8 input_port_18_r(__attribute__((__unused__)) offs_t offset);
3474 UINT8 input_port_19_r(__attribute__((__unused__)) offs_t offset);
3475 UINT8 input_port_20_r(__attribute__((__unused__)) offs_t offset);
3476 UINT8 input_port_21_r(__attribute__((__unused__)) offs_t offset);
3477 UINT8 input_port_22_r(__attribute__((__unused__)) offs_t offset);
3478 UINT8 input_port_23_r(__attribute__((__unused__)) offs_t offset);
3479 UINT8 input_port_24_r(__attribute__((__unused__)) offs_t offset);
3480 UINT8 input_port_25_r(__attribute__((__unused__)) offs_t offset);
3481 UINT8 input_port_26_r(__attribute__((__unused__)) offs_t offset);
3482 UINT8 input_port_27_r(__attribute__((__unused__)) offs_t offset);
3483 UINT8 input_port_28_r(__attribute__((__unused__)) offs_t offset);
3484 UINT8 input_port_29_r(__attribute__((__unused__)) offs_t offset);
3486 UINT16 input_port_0_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3487 UINT16 input_port_1_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3488 UINT16 input_port_2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3489 UINT16 input_port_3_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3490 UINT16 input_port_4_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3491 UINT16 input_port_5_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3492 UINT16 input_port_6_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3493 UINT16 input_port_7_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3494 UINT16 input_port_8_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3495 UINT16 input_port_9_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3496 UINT16 input_port_10_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3497 UINT16 input_port_11_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3498 UINT16 input_port_12_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3499 UINT16 input_port_13_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3500 UINT16 input_port_14_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3501 UINT16 input_port_15_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3502 UINT16 input_port_16_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3503 UINT16 input_port_17_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3504 UINT16 input_port_18_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3505 UINT16 input_port_19_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3506 UINT16 input_port_20_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3507 UINT16 input_port_21_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3508 UINT16 input_port_22_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3509 UINT16 input_port_23_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3510 UINT16 input_port_24_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3511 UINT16 input_port_25_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3512 UINT16 input_port_26_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3513 UINT16 input_port_27_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3514 UINT16 input_port_28_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3515 UINT16 input_port_29_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3517 UINT32 input_port_0_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3518 UINT32 input_port_1_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3519 UINT32 input_port_2_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3520 UINT32 input_port_3_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3521 UINT32 input_port_4_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3522 UINT32 input_port_5_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3523 UINT32 input_port_6_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3524 UINT32 input_port_7_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3525 UINT32 input_port_8_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3526 UINT32 input_port_9_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3527 UINT32 input_port_10_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3528 UINT32 input_port_11_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3529 UINT32 input_port_12_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3530 UINT32 input_port_13_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3531 UINT32 input_port_14_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3532 UINT32 input_port_15_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3533 UINT32 input_port_16_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3534 UINT32 input_port_17_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3535 UINT32 input_port_18_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3536 UINT32 input_port_19_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3537 UINT32 input_port_20_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3538 UINT32 input_port_21_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3539 UINT32 input_port_22_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3540 UINT32 input_port_23_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3541 UINT32 input_port_24_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3542 UINT32 input_port_25_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3543 UINT32 input_port_26_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3544 UINT32 input_port_27_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3545 UINT32 input_port_28_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3546 UINT32 input_port_29_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3547 # 19 "src/osdepend.h" 2
3550 void osd_exit(void);
3551 # 35 "src/osdepend.h"
3552 struct _osd_create_params
3555 int aspect_x, aspect_y;
3559 int video_attributes;
3561 typedef struct _osd_create_params osd_create_params;
3562 # 72 "src/osdepend.h"
3563 int osd_create_display(const osd_create_params *params, UINT32 *rgb_components);
3564 void osd_close_display(void);
3565 # 86 "src/osdepend.h"
3566 int osd_skip_this_frame(void);
3567 # 102 "src/osdepend.h"
3568 void osd_update_video_and_audio(struct _mame_display *display);
3576 mame_bitmap *osd_override_snapshot(mame_bitmap *bitmap, rectangle *bounds);
3583 const char *osd_get_fps_text(const performance_info *performance);
3584 # 147 "src/osdepend.h"
3585 int osd_start_audio_stream(int stereo);
3586 int osd_update_audio_stream(INT16 *buffer);
3587 void osd_stop_audio_stream(void);
3588 # 158 "src/osdepend.h"
3589 void osd_set_mastervolume(int attenuation);
3590 int osd_get_mastervolume(void);
3592 void osd_sound_enable(int enable);
3593 # 174 "src/osdepend.h"
3594 const os_code_info *osd_get_code_list(void);
3601 INT32 osd_get_code_value(os_code oscode);
3602 # 192 "src/osdepend.h"
3603 int osd_readkey_unicode(int flush);
3604 # 203 "src/osdepend.h"
3605 void osd_customize_inputport_list(input_port_default_entry *defaults);
3610 int osd_joystick_needs_calibration(void);
3612 void osd_joystick_start_calibration(void);
3615 const char *osd_joystick_calibrate_next(void);
3617 void osd_joystick_calibrate(void);
3619 void osd_joystick_end_calibration(void);
3620 # 228 "src/osdepend.h"
3627 typedef struct _inp_header inp_header;
3643 FILEERR_OUT_OF_MEMORY,
3645 FILEERR_ACCESS_DENIED,
3646 FILEERR_ALREADY_OPEN,
3647 FILEERR_TOO_MANY_FILES
3652 int osd_get_path_count(int pathtype);
3655 int osd_get_path_info(int pathtype, int pathindex, const char *filename);
3658 osd_file *osd_fopen(int pathtype, int pathindex, const char *filename, const char *mode, osd_file_error *error);
3661 int osd_fseek(osd_file *file, INT64 offset, int whence);
3664 UINT64 osd_ftell(osd_file *file);
3667 int osd_feof(osd_file *file);
3670 UINT32 osd_fread(osd_file *file, void *buffer, UINT32 length);
3673 UINT32 osd_fwrite(osd_file *file, const void *buffer, UINT32 length);
3676 void osd_fclose(osd_file *file);
3677 # 293 "src/osdepend.h"
3678 typedef INT64 cycles_t;
3681 cycles_t osd_cycles(void);
3684 cycles_t osd_cycles_per_second(void);
3689 cycles_t osd_profiling_ticks(void);
3690 # 315 "src/osdepend.h"
3691 void *osd_alloc_executable(size_t size);
3692 void osd_free_executable(void *ptr);
3697 int osd_display_loading_rom_message(const char *name,rom_load_data *romdata);
3703 void osd_pause(int paused);
3706 int osd_is_bad_read_ptr(const void *ptr, size_t size);
3709 void osd_die(const char *text,...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn));
3710 # 342 "src/osdepend.h"
3711 void logerror(const char *text,...) __attribute__((format(printf, 1, 2)));
3712 # 64 "src/driver.h" 2
3714 # 1 "src/debug/mamedbg.h" 1
3715 # 16 "src/debug/mamedbg.h"
3720 # 1 "src/fileio.h" 1
3727 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 1 3 4
3728 # 105 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 3 4
3729 typedef __gnuc_va_list va_list;
3730 # 18 "src/fileio.h" 2
3740 CHDERR_NO_INTERFACE,
3741 CHDERR_OUT_OF_MEMORY,
3742 CHDERR_INVALID_FILE,
3743 CHDERR_INVALID_PARAMETER,
3744 CHDERR_INVALID_DATA,
3745 CHDERR_FILE_NOT_FOUND,
3746 CHDERR_REQUIRES_PARENT,
3747 CHDERR_FILE_NOT_WRITEABLE,
3751 CHDERR_INVALID_PARENT,
3752 CHDERR_HUNK_OUT_OF_RANGE,
3753 CHDERR_DECOMPRESSION_ERROR,
3754 CHDERR_COMPRESSION_ERROR,
3755 CHDERR_CANT_CREATE_FILE,
3757 CHDERR_NOT_SUPPORTED,
3758 CHDERR_METADATA_NOT_FOUND,
3759 CHDERR_INVALID_METADATA_SIZE,
3760 CHDERR_UNSUPPORTED_VERSION
3771 UINT64 logicalbytes;
3774 UINT8 parentmd5[16];
3776 UINT8 parentsha1[20];
3778 UINT32 obsolete_cylinders;
3779 UINT32 obsolete_sectors;
3780 UINT32 obsolete_heads;
3781 UINT32 obsolete_hunksize;
3783 typedef struct _chd_header chd_header;
3786 typedef struct _chd_file chd_file;
3787 typedef struct _chd_exfile chd_exfile;
3788 typedef struct _chd_interface_file chd_interface_file;
3791 struct _chd_interface
3793 chd_interface_file *(*open)(const char *filename, const char *mode);
3794 void (*close)(chd_interface_file *file);
3795 UINT32 (*read)(chd_interface_file *file, UINT64 offset, UINT32 count, void *buffer);
3796 UINT32 (*write)(chd_interface_file *file, UINT64 offset, UINT32 count, const void *buffer);
3797 UINT64 (*length)(chd_interface_file *file);
3799 typedef struct _chd_interface chd_interface;
3801 void chd_set_interface(chd_interface *new_interface);
3802 void chd_save_interface(chd_interface *interface_save);
3804 int chd_create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 compression, chd_file *parent);
3805 chd_file *chd_open(const char *filename, int writeable, chd_file *parent);
3806 void chd_close(chd_file *chd);
3807 void chd_close_all(void);
3809 UINT32 chd_get_metadata(chd_file *chd, UINT32 *metatag, UINT32 metaindex, void *outputbuf, UINT32 outputlen);
3810 int chd_set_metadata(chd_file *chd, UINT32 metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen);
3812 UINT32 chd_read(chd_file *chd, UINT32 hunknum, UINT32 hunkcount, void *buffer);
3813 UINT32 chd_write(chd_file *chd, UINT32 hunknum, UINT32 hunkcount, const void *buffer);
3815 int chd_get_last_error(void);
3816 const chd_header *chd_get_header(chd_file *chd);
3817 int chd_set_header(const char *filename, const chd_header *header);
3819 int chd_compress(chd_file *chd, const char *rawfile, UINT32 offset, void (*progress)(const char *, ...));
3820 int chd_verify(chd_file *chd, void (*progress)(const char *, ...), UINT8 actualmd5[16], UINT8 actualsha1[20]);
3822 chd_exfile *chd_start_compress_ex(chd_file *chd);
3823 int chd_compress_ex(chd_exfile *chdex, const char *rawfile, UINT64 offset, UINT32 inpsecsize, UINT32 srcperhunk, UINT32 hunks_to_read, UINT32 hunksecsize, void (*progress)(const char *, ...));
3824 int chd_end_compress_ex(chd_exfile *chdex, void (*progress)(const char *, ...));
3825 # 21 "src/fileio.h" 2
3834 FILETYPE_IMAGE_DIFF,
3839 FILETYPE_HIGHSCORE_DB,
3844 FILETYPE_SCREENSHOT,
3862 typedef struct _mame_file mame_file;
3864 extern chd_interface mame_chd_interface;
3866 int mame_faccess(const char *filename, int filetype);
3867 mame_file *mame_fopen(const char *gamename, const char *filename, int filetype, int openforwrite);
3868 mame_file *mame_fopen_error(const char *gamename, const char *filename, int filetype, int openforwrite, osd_file_error *error);
3869 mame_file *mame_fopen_rom(const char *gamename, const char *filename, const char *exphash);
3870 UINT32 mame_fread(mame_file *file, void *buffer, UINT32 length);
3871 UINT32 mame_fwrite(mame_file *file, const void *buffer, UINT32 length);
3872 UINT32 mame_fread_swap(mame_file *file, void *buffer, UINT32 length);
3873 UINT32 mame_fwrite_swap(mame_file *file, const void *buffer, UINT32 length);
3875 int mame_fseek(mame_file *file, INT64 offset, int whence);
3876 void mame_fclose(mame_file *file);
3877 int mame_fchecksum(const char *gamename, const char *filename, unsigned int *length, char *hash);
3878 UINT64 mame_fsize(mame_file *file);
3879 const char *mame_fhash(mame_file *file);
3880 int mame_fgetc(mame_file *file);
3881 int mame_ungetc(int c, mame_file *file);
3882 char *mame_fgets(char *s, int n, mame_file *file);
3883 int mame_feof(mame_file *file);
3884 UINT64 mame_ftell(mame_file *file);
3886 int mame_fputs(mame_file *f, const char *s);
3887 int mame_vfprintf(mame_file *f, const char *fmt, va_list va);
3888 int mame_fprintf(mame_file *f, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
3890 # 1 "src/drawgfx.h" 1
3891 # 12 "src/drawgfx.h"
3897 # 1 "src/palette.h" 1
3898 # 73 "src/palette.h"
3900 # 83 "src/palette.h"
3901 typedef UINT32 rgb_t;
3902 # 119 "src/palette.h"
3903 extern UINT32 direct_rgb_components[3];
3904 extern UINT16 *palette_shadow_table;
3906 extern UINT8 *paletteram;
3907 extern UINT8 *paletteram_2;
3908 extern UINT16 *paletteram16;
3909 extern UINT16 *paletteram16_2;
3910 extern UINT32 *paletteram32;
3918 int palette_start(void);
3919 int palette_init(void);
3920 int palette_get_total_colors_with_ui(void);
3922 void palette_update_display(mame_display *display);
3924 void palette_set_color(pen_t pen, UINT8 r, UINT8 g, UINT8 b);
3925 void palette_get_color(pen_t pen, UINT8 *r, UINT8 *g, UINT8 *b);
3926 void palette_set_colors(pen_t color_base, const UINT8 *colors, int color_count);
3928 void palette_set_brightness(pen_t pen, double bright);
3929 void palette_set_shadow_factor(double factor);
3930 void palette_set_highlight_factor(double factor);
3931 # 167 "src/palette.h"
3932 void palette_set_shadow_mode(int mode);
3933 void palette_set_shadow_factor32(double factor);
3934 void palette_set_highlight_factor32(double factor);
3935 void palette_set_shadow_dRGB32(int mode, int dr, int dg, int db, int noclip);
3936 void palette_set_highlight_method(int method);
3938 void palette_set_global_gamma(double _gamma);
3939 double palette_get_global_gamma(void);
3941 void palette_set_global_brightness(double brightness);
3942 void palette_set_global_brightness_adjust(double adjustment);
3943 double palette_get_global_brightness(void);
3945 pen_t get_black_pen(void);
3946 pen_t get_white_pen(void);
3952 UINT8 paletteram_r(__attribute__((__unused__)) offs_t offset);
3953 UINT8 paletteram_2_r(__attribute__((__unused__)) offs_t offset);
3954 UINT16 paletteram16_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3955 UINT16 paletteram16_2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3956 UINT32 paletteram32_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3958 void paletteram_BBGGGRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3959 void paletteram_RRRGGGBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3960 void paletteram_BBBGGGRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3961 void paletteram_IIBBGGRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3962 void paletteram_BBGGRRII_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3970 void paletteram_xxxxBBBBGGGGRRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3971 void paletteram_xxxxBBBBGGGGRRRR_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3972 void paletteram_xxxxBBBBGGGGRRRR_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3973 void paletteram_xxxxBBBBGGGGRRRR_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3974 void paletteram16_xxxxBBBBGGGGRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3975 void paletteram_xxxxBBBBRRRRGGGG_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3976 void paletteram_xxxxBBBBRRRRGGGG_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3977 void paletteram_xxxxBBBBRRRRGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3978 void paletteram_xxxxBBBBRRRRGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3979 void paletteram16_xxxxBBBBRRRRGGGG_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3980 void paletteram_xxxxRRRRBBBBGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3981 void paletteram_xxxxRRRRBBBBGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3982 void paletteram_xxxxRRRRGGGGBBBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3983 void paletteram_xxxxRRRRGGGGBBBB_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3984 void paletteram16_xxxxRRRRGGGGBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3985 void paletteram_RRRRGGGGBBBBxxxx_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3986 void paletteram_RRRRGGGGBBBBxxxx_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3987 void paletteram_RRRRGGGGBBBBxxxx_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3988 void paletteram16_RRRRGGGGBBBBxxxx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3989 void paletteram_BBBBGGGGRRRRxxxx_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3990 void paletteram_BBBBGGGGRRRRxxxx_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3991 void paletteram_BBBBGGGGRRRRxxxx_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3992 void paletteram16_BBBBGGGGRRRRxxxx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3993 void paletteram_xBBBBBGGGGGRRRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3994 void paletteram_xBBBBBGGGGGRRRRR_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3995 void paletteram_xBBBBBGGGGGRRRRR_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3996 void paletteram_xBBBBBGGGGGRRRRR_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3997 void paletteram16_xBBBBBGGGGGRRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3998 void paletteram_xBBBBBRRRRRGGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3999 void paletteram_xBBBBBRRRRRGGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
4000 void paletteram_xRRRRRGGGGGBBBBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
4001 void paletteram16_xRRRRRGGGGGBBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4002 void paletteram16_xGGGGGRRRRRBBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4003 void paletteram16_xGGGGGBBBBBRRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4004 void paletteram_RRRRRGGGGGBBBBBx_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
4005 void paletteram16_RRRRRGGGGGBBBBBx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4006 void paletteram16_IIIIRRRRGGGGBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4007 void paletteram16_RRRRGGGGBBBBIIII_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4008 void paletteram16_xrgb_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4009 void paletteram16_xbgr_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4010 void paletteram16_RRRRGGGGBBBBRGBx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4011 # 254 "src/palette.h"
4012 void palette_init_black_and_white(UINT16 *colortable, const UINT8 *color_prom);
4013 void palette_init_RRRR_GGGG_BBBB(UINT16 *colortable, const UINT8 *color_prom);
4014 # 18 "src/drawgfx.h" 2
4015 # 33 "src/drawgfx.h"
4018 UINT16 width,height;
4021 UINT32 planeoffset[8];
4022 UINT32 xoffset[256];
4023 UINT32 yoffset[256];
4024 UINT32 charincrement;
4026 typedef struct _gfx_layout gfx_layout;
4027 # 61 "src/drawgfx.h"
4030 UINT16 width,height;
4032 UINT32 total_elements;
4033 UINT16 color_granularity;
4035 UINT32 total_colors;
4048 typedef struct _gfx_element gfx_element;
4060 const gfx_layout *gfxlayout;
4061 UINT16 color_codes_start;
4062 UINT16 total_color_codes;
4064 typedef struct _gfx_decode gfx_decode;
4069 const UINT8 *alphas;
4070 const UINT8 *alphad;
4071 UINT8 alpha[0x101][0x100];
4073 typedef struct _alpha_cache alpha_cache;
4075 extern struct _alpha_cache drawgfx_alpha_cache;
4080 TRANSPARENCY_NONE_RAW,
4082 TRANSPARENCY_PEN_RAW,
4084 TRANSPARENCY_PENS_RAW,
4086 TRANSPARENCY_PEN_TABLE,
4087 TRANSPARENCY_PEN_TABLE_RAW,
4089 TRANSPARENCY_BLEND_RAW,
4090 TRANSPARENCY_ALPHAONE,
4092 TRANSPARENCY_ALPHARANGE,
4098 extern UINT8 gfx_alpharange_table[256];
4101 extern UINT8 gfx_drawmode_table[256];
4111 extern int pdrawgfx_shadow_lowpri;
4119 void decodechar(gfx_element *gfx,int num,const unsigned char *src,const gfx_layout *gl);
4120 gfx_element *allocgfx(const gfx_layout *gl);
4121 void decodegfx(gfx_element *gfx, const UINT8 *src, UINT32 first, UINT32 count);
4122 void set_pixel_functions(mame_bitmap *bitmap);
4123 void freegfx(gfx_element *gfx);
4124 void drawgfx(mame_bitmap *dest,const gfx_element *gfx,
4125 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4126 const rectangle *clip,int transparency,int transparent_color);
4127 void pdrawgfx(mame_bitmap *dest,const gfx_element *gfx,
4128 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4129 const rectangle *clip,int transparency,int transparent_color,
4130 UINT32 priority_mask);
4131 void mdrawgfx(mame_bitmap *dest,const gfx_element *gfx,
4132 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4133 const rectangle *clip,int transparency,int transparent_color,
4134 UINT32 priority_mask);
4135 void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
4136 const rectangle *clip,int transparency,int transparent_color);
4137 void copybitmap_remap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
4138 const rectangle *clip,int transparency,int transparent_color);
4139 void copyscrollbitmap(mame_bitmap *dest,mame_bitmap *src,
4140 int rows,const int *rowscroll,int cols,const int *colscroll,
4141 const rectangle *clip,int transparency,int transparent_color);
4142 void copyscrollbitmap_remap(mame_bitmap *dest,mame_bitmap *src,
4143 int rows,const int *rowscroll,int cols,const int *colscroll,
4144 const rectangle *clip,int transparency,int transparent_color);
4145 void draw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,pen_t *pens,int transparent_pen);
4146 void draw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,pen_t *pens,int transparent_pen);
4147 void pdraw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,pen_t *pens,int transparent_pen,int pri);
4148 void pdraw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,pen_t *pens,int transparent_pen,int pri);
4149 void extract_scanline8(mame_bitmap *bitmap,int x,int y,int length,UINT8 *dst);
4150 void extract_scanline16(mame_bitmap *bitmap,int x,int y,int length,UINT16 *dst);
4154 extern int alpha_active;
4155 void alpha_init(void);
4156 static __inline__ void alpha_set_level(int level) {
4159 drawgfx_alpha_cache.alphas = drawgfx_alpha_cache.alpha[level+1];
4160 drawgfx_alpha_cache.alphad = drawgfx_alpha_cache.alpha[255-level];
4163 static __inline__ UINT32 alpha_blend16( UINT32 d, UINT32 s )
4165 const UINT8 *alphas = drawgfx_alpha_cache.alphas;
4166 const UINT8 *alphad = drawgfx_alpha_cache.alphad;
4167 return (alphas[s & 0x1f] | (alphas[(s>>5) & 0x1f] << 5) | (alphas[(s>>10) & 0x1f] << 10))
4168 + (alphad[d & 0x1f] | (alphad[(d>>5) & 0x1f] << 5) | (alphad[(d>>10) & 0x1f] << 10));
4172 static __inline__ UINT32 alpha_blend32( UINT32 d, UINT32 s )
4174 const UINT8 *alphas = drawgfx_alpha_cache.alphas;
4175 const UINT8 *alphad = drawgfx_alpha_cache.alphad;
4176 return (alphas[s & 0xff] | (alphas[(s>>8) & 0xff] << 8) | (alphas[(s>>16) & 0xff] << 16))
4177 + (alphad[d & 0xff] | (alphad[(d>>8) & 0xff] << 8) | (alphad[(d>>16) & 0xff] << 16));
4180 static __inline__ UINT32 alpha_blend_r16( UINT32 d, UINT32 s, UINT8 level )
4182 const UINT8 *alphas = drawgfx_alpha_cache.alpha[level];
4183 const UINT8 *alphad = drawgfx_alpha_cache.alpha[255 - level];
4184 return (alphas[s & 0x1f] | (alphas[(s>>5) & 0x1f] << 5) | (alphas[(s>>10) & 0x1f] << 10))
4185 + (alphad[d & 0x1f] | (alphad[(d>>5) & 0x1f] << 5) | (alphad[(d>>10) & 0x1f] << 10));
4189 static __inline__ UINT32 alpha_blend_r32( UINT32 d, UINT32 s, UINT8 level )
4191 const UINT8 *alphas = drawgfx_alpha_cache.alpha[level];
4192 const UINT8 *alphad = drawgfx_alpha_cache.alpha[255 - level];
4193 return (alphas[s & 0xff] | (alphas[(s>>8) & 0xff] << 8) | (alphas[(s>>16) & 0xff] << 16))
4194 + (alphad[d & 0xff] | (alphad[(d>>8) & 0xff] << 8) | (alphad[(d>>16) & 0xff] << 16));
4196 # 258 "src/drawgfx.h"
4197 void copyrozbitmap(mame_bitmap *dest,mame_bitmap *src,
4198 UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound,
4199 const rectangle *clip,int transparency,int transparent_color,UINT32 priority);
4201 void fillbitmap(mame_bitmap *dest,pen_t pen,const rectangle *clip);
4202 void drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
4203 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4204 const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley);
4205 void pdrawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
4206 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4207 const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley,
4208 UINT32 priority_mask);
4209 void mdrawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
4210 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4211 const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley,
4212 UINT32 priority_mask);
4214 void drawgfx_toggle_crosshair(void);
4215 void draw_crosshair(mame_bitmap *bitmap,int x,int y,const rectangle *clip,int player);
4224 extern char build_version[];
4233 typedef struct _region_info region_info;
4236 struct _running_machine
4241 const game_driver * gamedrv;
4244 const machine_config * drv;
4247 region_info memory_region[32];
4250 int rom_load_warnings;
4256 gfx_element * gfx[32];
4259 mame_bitmap * scrbitmap;
4262 rectangle visible_area;
4263 rectangle absolute_visible_area;
4274 UINT16 * game_colortable;
4277 pen_t * remapped_colortable;
4292 input_port_entry * input_ports;
4295 input_port_entry * input_ports_default;
4307 mame_bitmap * debug_bitmap;
4313 pen_t * debug_remapped_colortable;
4316 gfx_element * debugger_font;
4322 typedef struct _running_machine running_machine;
4324 struct _global_options
4327 mame_file * playback;
4328 mame_file * language_file;
4333 int skip_disclaimer;
4348 float vector_flicker;
4349 float vector_intensity;
4357 const char * savegame;
4365 const char *controller;
4368 typedef struct _global_options global_options;
4370 struct _mame_display
4373 UINT32 changed_flags;
4376 mame_bitmap * game_bitmap;
4377 rectangle game_bitmap_update;
4378 const rgb_t * game_palette;
4379 UINT32 game_palette_entries;
4380 UINT32 * game_palette_dirty;
4381 rectangle game_visible_area;
4382 float game_refresh_rate;
4383 void * vector_dirty_pixels;
4386 mame_bitmap * debug_bitmap;
4387 const rgb_t * debug_palette;
4388 UINT32 debug_palette_entries;
4395 struct _performance_info
4397 double game_speed_percent;
4398 double frames_per_second;
4399 int vector_updates_last_second;
4400 int partial_updates_this_frame;
4403 extern global_options options;
4404 extern running_machine *Machine;
4406 int run_game(int game);
4409 void expand_machine_driver(void (*constructor)(machine_config *), machine_config *output);
4412 void mame_pause(int pause);
4415 int mame_is_paused(void);
4422 void set_visible_area(int min_x, int max_x, int min_y, int max_y);
4425 void set_refresh_rate(float fps);
4428 void schedule_full_refresh(void);
4431 void reset_partial_updates(void);
4434 void force_partial_update(int scanline);
4437 void draw_screen(void);
4440 void update_video_and_audio(void);
4444 int updatescreen(void);
4451 int mame_highscore_enabled(void);
4454 void set_led_status(int num, int on);
4457 const performance_info *mame_get_performance_info(void);
4460 int mame_find_cpu_index(const char *tag);
4463 int mame_validitychecks(void);
4464 # 17 "src/debug/mamedbg.h" 2
4469 extern int mame_debug;
4470 # 66 "src/driver.h" 2
4472 # 1 "src/common.h" 1
4483 const char* hash_function_name(unsigned int function);
4486 int hash_data_has_checksum(const char* d, unsigned int function);
4492 int hash_data_extract_binary_checksum(const char* d, unsigned int function, unsigned char* checksum);
4493 int hash_data_extract_printable_checksum(const char* d, unsigned int function, char* checksum);
4500 int hash_data_insert_binary_checksum(char* d, unsigned int function, const unsigned char* checksum);
4501 int hash_data_insert_printable_checksum(char* d, unsigned int function, const char* checksum);
4504 int hash_data_has_info(const char* d, unsigned int info);
4508 int hash_data_is_equal(const char* d1, const char* d2, unsigned int functions);
4512 void hash_data_print(const char* d, unsigned int functions, char* buffer);
4515 void hash_data_copy(char* dst, const char* src);
4518 void hash_data_clear(char* dst);
4521 unsigned int hash_data_used_functions(const char* d);
4525 void hash_compute(char* dst, const unsigned char* data, unsigned long length, unsigned int functions);
4528 int hash_verify_string(const char *hash);
4529 # 18 "src/common.h" 2
4530 # 1 "src/xmlfile.h" 1
4531 # 12 "src/xmlfile.h"
4533 # 28 "src/xmlfile.h"
4534 struct _xml_attribute_node
4536 struct _xml_attribute_node *next;
4540 typedef struct _xml_attribute_node xml_attribute_node;
4543 struct _xml_data_node
4545 struct _xml_data_node *next;
4546 struct _xml_data_node *parent;
4547 struct _xml_data_node *child;
4550 xml_attribute_node *attribute;
4556 struct XML_ParserStruct;
4558 struct _xml_custom_parse
4560 void (*init)(struct XML_ParserStruct *parser);
4561 size_t (*read)(void *param, void *buffer, size_t length);
4562 int (*eof)(void *param);
4564 int trim_whitespace;
4566 const char *error_message;
4570 xml_data_node **curnode;
4572 typedef struct _xml_custom_parse xml_custom_parse;
4573 # 76 "src/xmlfile.h"
4574 xml_data_node *xml_file_create(void);
4575 xml_data_node *xml_file_read(mame_file *file);
4576 xml_data_node *xml_file_read_custom(xml_custom_parse *parse_info);
4577 void xml_file_write(xml_data_node *node, mame_file *file);
4578 void xml_file_free(xml_data_node *node);
4580 int xml_count_children(xml_data_node *node);
4581 xml_data_node *xml_get_sibling(xml_data_node *node, const char *name);
4582 xml_data_node *xml_find_matching_sibling(xml_data_node *node, const char *name, const char *attribute, const char *matchval);
4583 xml_attribute_node *xml_get_attribute(xml_data_node *node, const char *attribute);
4584 const char *xml_get_attribute_string(xml_data_node *node, const char *attribute, const char *defvalue);
4585 int xml_get_attribute_int(xml_data_node *node, const char *attribute, int defvalue);
4586 float xml_get_attribute_float(xml_data_node *node, const char *attribute, float defvalue);
4588 xml_data_node *xml_add_child(xml_data_node *node, const char *name, const char *value);
4589 xml_data_node *xml_get_or_add_child(xml_data_node *node, const char *name, const char *value);
4590 xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, const char *value);
4591 xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, int value);
4592 xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *name, float value);
4593 void xml_delete_node(xml_data_node *node);
4594 # 19 "src/common.h" 2
4602 const char *_hashdata;
4604 typedef struct _rom_entry rom_entry;
4611 const char *_description;
4613 typedef struct _bios_entry bios_entry;
4616 struct _rom_load_data
4627 UINT32 regionlength;
4629 char errorbuf[4096];
4630 UINT8 tempbuf[65536];
4635 REGION_INVALID = 0x80,
4672 # 356 "src/common.h"
4673 extern unsigned int dispensed_tickets;
4674 extern unsigned int coin_count[8];
4675 extern unsigned int coinlockedout[8];
4676 # 368 "src/common.h"
4677 void showdisclaimer(void);
4681 UINT8 *memory_region(int num);
4682 size_t memory_region_length(int num);
4686 int new_memory_region(int num, size_t length, UINT32 flags);
4687 void free_memory_region(int num);
4690 void counters_load(int config_type, xml_data_node *parentnode);
4691 void counters_save(int config_type, xml_data_node *parentnode);
4692 void coin_counter_reset(void);
4693 void coin_counter_w(int num,int on);
4694 void coin_lockout_w(int num,int on);
4695 void coin_lockout_global_w(int on);
4698 extern size_t generic_nvram_size;
4699 extern UINT8 *generic_nvram;
4700 extern UINT16 *generic_nvram16;
4701 extern UINT32 *generic_nvram32;
4702 void nvram_handler_generic_0fill(mame_file *file, int read_or_write);
4703 void nvram_handler_generic_1fill(mame_file *file, int read_or_write);
4704 void nvram_handler_generic_randfill(mame_file *file, int read_or_write);
4707 mame_bitmap *bitmap_alloc(int width,int height);
4708 mame_bitmap *bitmap_alloc_depth(int width,int height,int depth);
4709 void bitmap_free(mame_bitmap *bitmap);
4712 void begin_resource_tracking(void);
4713 void end_resource_tracking(void);
4714 static __inline__ int get_resource_tag(void)
4716 extern int resource_tracking_tag;
4717 return resource_tracking_tag;
4721 void *auto_malloc(size_t size) __attribute__((malloc));
4722 char *auto_strdup(const char *str) __attribute__((malloc));
4723 mame_bitmap *auto_bitmap_alloc(int width,int height);
4724 mame_bitmap *auto_bitmap_alloc_depth(int width,int height,int depth);
4725 # 425 "src/common.h"
4726 void save_screen_snapshot_as(mame_file *fp, mame_bitmap *bitmap);
4727 void save_screen_snapshot(mame_bitmap *bitmap);
4730 void record_movie_toggle(void);
4731 void record_movie_stop(void);
4732 void record_movie_frame(mame_bitmap *bitmap);
4735 chd_file *get_disk_handle(int diskindex);
4738 int rom_load(const rom_entry *romp);
4739 const rom_entry *rom_first_region(const game_driver *drv);
4740 const rom_entry *rom_next_region(const rom_entry *romp);
4741 const rom_entry *rom_first_file(const rom_entry *romp);
4742 const rom_entry *rom_next_file(const rom_entry *romp);
4743 const rom_entry *rom_first_chunk(const rom_entry *romp);
4744 const rom_entry *rom_next_chunk(const rom_entry *romp);
4745 # 68 "src/driver.h" 2
4748 # 1 "src/cpuintrf.h" 1
4749 # 12 "src/cpuintrf.h"
4761 typedef INT64 subseconds_t;
4762 typedef INT32 seconds_t;
4767 subseconds_t subseconds;
4769 typedef struct _mame_time mame_time;
4771 extern mame_time time_zero;
4772 extern mame_time time_never;
4774 extern subseconds_t subseconds_per_cycle[];
4775 extern UINT32 cycles_per_second[];
4777 extern double cycles_to_sec[];
4778 extern double sec_to_cycles[];
4780 typedef struct _mame_timer mame_timer;
4788 void timer_init(void);
4789 void timer_free(void);
4790 int timer_count_anonymous(void);
4792 mame_time mame_timer_next_fire_time(void);
4793 void mame_timer_set_global_time(mame_time newbase);
4794 mame_timer *_mame_timer_alloc(void (*callback)(int), const char *file, int line, const char *func);
4795 mame_timer *_mame_timer_alloc_ptr(void (*callback)(void *), void *param, const char *file, int line, const char *func);
4796 void mame_timer_adjust(mame_timer *which, mame_time duration, int param, mame_time period);
4797 void mame_timer_adjust_ptr(mame_timer *which, mame_time duration, mame_time period);
4798 void _mame_timer_pulse(mame_time period, int param, void (*callback)(int), const char *file, int line, const char *func);
4799 void _mame_timer_pulse_ptr(mame_time period, void *param, void (*callback)(void *), const char *file, int line, const char *func);
4800 void _mame_timer_set(mame_time duration, int param, void (*callback)(int), const char *file, int line, const char *func);
4801 void _mame_timer_set_ptr(mame_time duration, void *param, void (*callback)(void *), const char *file, int line, const char *func);
4802 void mame_timer_reset(mame_timer *which, mame_time duration);
4803 int mame_timer_enable(mame_timer *which, int enable);
4804 mame_time mame_timer_timeelapsed(mame_timer *which);
4805 mame_time mame_timer_timeleft(mame_timer *which);
4806 mame_time mame_timer_get_time(void);
4807 mame_time mame_timer_starttime(mame_timer *which);
4808 mame_time mame_timer_firetime(mame_timer *which);
4810 static __inline__ mame_time make_mame_time(seconds_t _secs, subseconds_t _subsecs)
4813 result.seconds = _secs;
4814 result.subseconds = _subsecs;
4823 static __inline__ double mame_time_to_double(mame_time _time)
4825 return (double)_time.seconds + ((double)(_time.subseconds) * (1.0 / (double)((subseconds_t)1000000000 * (subseconds_t)1000000000)));
4833 static __inline__ mame_time double_to_mame_time(double _time)
4838 if (_time >= (1.0e30))
4842 abstime.seconds = (INT64)_time;
4845 _time -= (double)abstime.seconds;
4846 abstime.subseconds = ((subseconds_t)((_time) * (double)((subseconds_t)1000000000 * (subseconds_t)1000000000)));
4855 static __inline__ mame_time add_mame_times(mame_time _time1, mame_time _time2)
4860 if (_time1.seconds >= ((seconds_t)1000000000) || _time2.seconds >= ((seconds_t)1000000000))
4864 result.subseconds = _time1.subseconds + _time2.subseconds;
4865 result.seconds = _time1.seconds + _time2.seconds;
4868 if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000))
4870 result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4881 static __inline__ mame_time add_subseconds_to_mame_time(mame_time _time1, subseconds_t _subseconds)
4886 if (_time1.seconds >= ((seconds_t)1000000000))
4890 result.subseconds = _time1.subseconds + _subseconds;
4891 result.seconds = _time1.seconds;
4894 if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000))
4896 result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4907 static __inline__ mame_time sub_mame_times(mame_time _time1, mame_time _time2)
4912 if (_time1.seconds >= ((seconds_t)1000000000))
4916 result.subseconds = _time1.subseconds - _time2.subseconds;
4917 result.seconds = _time1.seconds - _time2.seconds;
4920 if (result.subseconds < 0)
4922 result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4933 static __inline__ mame_time sub_subseconds_from_mame_time(mame_time _time1, subseconds_t _subseconds)
4938 if (_time1.seconds >= ((seconds_t)1000000000))
4942 result.subseconds = _time1.subseconds - _subseconds;
4943 result.seconds = _time1.seconds;
4946 if (result.subseconds < 0)
4948 result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4959 static __inline__ int compare_mame_times(mame_time _time1, mame_time _time2)
4961 if (_time1.seconds > _time2.seconds)
4963 if (_time1.seconds < _time2.seconds)
4965 if (_time1.subseconds > _time2.subseconds)
4967 if (_time1.subseconds < _time2.subseconds)
4971 # 20 "src/cpuintrf.h" 2
4972 # 29 "src/cpuintrf.h"
5116 # 189 "src/cpuintrf.h"
5119 # 200 "src/cpuintrf.h"
5129 INTERNAL_CLEAR_LINE = 100 + CLEAR_LINE,
5130 INTERNAL_ASSERT_LINE = 100 + ASSERT_LINE,
5133 MAX_INPUT_LINES = 32+3,
5134 INPUT_LINE_IRQ0 = 0,
5135 INPUT_LINE_IRQ1 = 1,
5136 INPUT_LINE_IRQ2 = 2,
5137 INPUT_LINE_IRQ3 = 3,
5138 INPUT_LINE_IRQ4 = 4,
5139 INPUT_LINE_IRQ5 = 5,
5140 INPUT_LINE_IRQ6 = 6,
5141 INPUT_LINE_IRQ7 = 7,
5142 INPUT_LINE_IRQ8 = 8,
5143 INPUT_LINE_IRQ9 = 9,
5144 INPUT_LINE_NMI = MAX_INPUT_LINES - 3,
5147 INPUT_LINE_RESET = MAX_INPUT_LINES - 2,
5148 INPUT_LINE_HALT = MAX_INPUT_LINES - 1,
5151 MAX_OUTPUT_LINES = 32
5153 # 242 "src/cpuintrf.h"
5163 CPUINFO_INT_FIRST = 0x00000,
5165 CPUINFO_INT_CONTEXT_SIZE = CPUINFO_INT_FIRST,
5166 CPUINFO_INT_INPUT_LINES,
5167 CPUINFO_INT_OUTPUT_LINES,
5168 CPUINFO_INT_DEFAULT_IRQ_VECTOR,
5169 CPUINFO_INT_ENDIANNESS,
5170 CPUINFO_INT_CLOCK_DIVIDER,
5171 CPUINFO_INT_MIN_INSTRUCTION_BYTES,
5172 CPUINFO_INT_MAX_INSTRUCTION_BYTES,
5173 CPUINFO_INT_MIN_CYCLES,
5174 CPUINFO_INT_MAX_CYCLES,
5176 CPUINFO_INT_DATABUS_WIDTH,
5177 CPUINFO_INT_DATABUS_WIDTH_LAST = CPUINFO_INT_DATABUS_WIDTH + 3 - 1,
5178 CPUINFO_INT_ADDRBUS_WIDTH,
5179 CPUINFO_INT_ADDRBUS_WIDTH_LAST = CPUINFO_INT_ADDRBUS_WIDTH + 3 - 1,
5180 CPUINFO_INT_ADDRBUS_SHIFT,
5181 CPUINFO_INT_ADDRBUS_SHIFT_LAST = CPUINFO_INT_ADDRBUS_SHIFT + 3 - 1,
5182 CPUINFO_INT_LOGADDR_WIDTH,
5183 CPUINFO_INT_LOGADDR_WIDTH_LAST = CPUINFO_INT_LOGADDR_WIDTH + 3 - 1,
5184 CPUINFO_INT_PAGE_SHIFT,
5185 CPUINFO_INT_PAGE_SHIFT_LAST = CPUINFO_INT_PAGE_SHIFT + 3 - 1,
5189 CPUINFO_INT_PREVIOUSPC,
5190 CPUINFO_INT_INPUT_STATE,
5191 CPUINFO_INT_INPUT_STATE_LAST = CPUINFO_INT_INPUT_STATE + MAX_INPUT_LINES - 1,
5192 CPUINFO_INT_OUTPUT_STATE,
5193 CPUINFO_INT_OUTPUT_STATE_LAST = CPUINFO_INT_OUTPUT_STATE + MAX_OUTPUT_LINES - 1,
5194 CPUINFO_INT_REGISTER,
5195 CPUINFO_INT_REGISTER_LAST = CPUINFO_INT_REGISTER + MAX_REGS - 1,
5197 CPUINFO_INT_CPU_SPECIFIC = 0x08000,
5200 CPUINFO_PTR_FIRST = 0x10000,
5202 CPUINFO_PTR_SET_INFO = CPUINFO_PTR_FIRST,
5203 CPUINFO_PTR_GET_CONTEXT,
5204 CPUINFO_PTR_SET_CONTEXT,
5208 CPUINFO_PTR_EXECUTE,
5210 CPUINFO_PTR_DISASSEMBLE,
5211 CPUINFO_PTR_DISASSEMBLE_NEW,
5212 CPUINFO_PTR_TRANSLATE,
5216 CPUINFO_PTR_DEBUG_SETUP_COMMANDS,
5217 CPUINFO_PTR_IRQ_CALLBACK,
5218 CPUINFO_PTR_INSTRUCTION_COUNTER,
5219 CPUINFO_PTR_REGISTER_LAYOUT,
5220 CPUINFO_PTR_WINDOW_LAYOUT,
5221 CPUINFO_PTR_INTERNAL_MEMORY_MAP,
5222 CPUINFO_PTR_INTERNAL_MEMORY_MAP_LAST = CPUINFO_PTR_INTERNAL_MEMORY_MAP + 3 - 1,
5223 CPUINFO_PTR_DEBUG_REGISTER_LIST,
5225 CPUINFO_PTR_CPU_SPECIFIC = 0x18000,
5228 CPUINFO_STR_FIRST = 0x20000,
5230 CPUINFO_STR_NAME = CPUINFO_STR_FIRST,
5231 CPUINFO_STR_CORE_FAMILY,
5232 CPUINFO_STR_CORE_VERSION,
5233 CPUINFO_STR_CORE_FILE,
5234 CPUINFO_STR_CORE_CREDITS,
5236 CPUINFO_STR_REGISTER,
5237 CPUINFO_STR_REGISTER_LAST = CPUINFO_STR_REGISTER + MAX_REGS - 1,
5239 CPUINFO_STR_CPU_SPECIFIC = 0x28000
5250 void (*setinfo)(UINT32 state, union cpuinfo *info);
5251 void (*getcontext)(void *context);
5252 void (*setcontext)(void *context);
5254 void (*reset)(void *param);
5256 int (*execute)(int cycles);
5257 void (*burn)(int cycles);
5258 offs_t (*disassemble)(char *buffer, offs_t pc);
5259 offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5260 int (*irqcallback)(int state);
5261 int (*translate)(int space, offs_t *address);
5262 int (*read)(int space, UINT32 offset, int size, UINT64 *value);
5263 int (*write)(int space, UINT32 offset, int size, UINT64 value);
5264 int (*readop)(UINT32 offset, int size, UINT64 *value);
5265 void (*setup_commands)(void);
5267 construct_map_t internal_map;
5277 REG_PREVIOUSPC = CPUINFO_INT_PREVIOUSPC - CPUINFO_INT_REGISTER,
5281 REG_PC = CPUINFO_INT_PC - CPUINFO_INT_REGISTER,
5285 REG_SP = CPUINFO_INT_SP - CPUINFO_INT_REGISTER
5295 # 402 "src/cpuintrf.h"
5296 struct _cpu_interface
5299 void (*get_info)(UINT32 state, union cpuinfo *info);
5300 void (*set_info)(UINT32 state, union cpuinfo *info);
5301 void (*get_context)(void *buffer);
5302 void (*set_context)(void *buffer);
5304 void (*reset)(void *param);
5306 int (*execute)(int cycles);
5307 void (*burn)(int cycles);
5308 offs_t (*disassemble)(char *buffer, offs_t pc);
5309 offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5310 int (*translate)(int space, offs_t *address);
5313 size_t context_size;
5317 typedef struct _cpu_interface cpu_interface;
5318 # 434 "src/cpuintrf.h"
5319 int cpuintrf_init(void);
5322 int cpuintrf_init_cpu(int cpunum, int cputype);
5325 void cpuintrf_exit_cpu(int cpunum);
5328 void cpuintrf_push_context(int cpunum);
5331 void cpuintrf_pop_context(void);
5334 char *cpuintrf_temp_str(void);
5337 void cpuintrf_set_dasm_override(offs_t (*dasm_override)(int cpunum, char *buffer, offs_t pc));
5338 # 463 "src/cpuintrf.h"
5339 INT64 activecpu_get_info_int(UINT32 state);
5340 void *activecpu_get_info_ptr(UINT32 state);
5341 genf *activecpu_get_info_fct(UINT32 state);
5342 const char *activecpu_get_info_string(UINT32 state);
5345 void activecpu_set_info_int(UINT32 state, INT64 data);
5346 void activecpu_set_info_ptr(UINT32 state, void *data);
5347 void activecpu_set_info_fct(UINT32 state, genf *data);
5350 void activecpu_adjust_icount(int delta);
5353 int activecpu_get_icount(void);
5356 void activecpu_reset_banking(void);
5359 void activecpu_set_input_line(int irqline, int state);
5362 offs_t activecpu_get_physical_pc_byte(void);
5365 void activecpu_set_opbase(offs_t val);
5368 offs_t activecpu_dasm(char *buffer, offs_t pc);
5369 offs_t activecpu_dasm_new(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5372 const char *activecpu_flags(void);
5375 const char *activecpu_dump_state(void);
5376 # 542 "src/cpuintrf.h"
5377 INT64 cpunum_get_info_int(int cpunum, UINT32 state);
5378 void *cpunum_get_info_ptr(int cpunum, UINT32 state);
5379 genf *cpunum_get_info_fct(int cpunum, UINT32 state);
5380 const char *cpunum_get_info_string(int cpunum, UINT32 state);
5383 void cpunum_set_info_int(int cpunum, UINT32 state, INT64 data);
5384 void cpunum_set_info_ptr(int cpunum, UINT32 state, void *data);
5385 void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data);
5388 int cpunum_execute(int cpunum, int cycles);
5391 void cpunum_reset(int cpunum, void *param, int (*irqack)(int));
5394 UINT8 cpunum_read_byte(int cpunum, offs_t address);
5397 void cpunum_write_byte(int cpunum, offs_t address, UINT8 data);
5401 void *cpunum_get_context_ptr(int cpunum);
5404 offs_t cpunum_get_physical_pc_byte(int cpunum);
5407 void cpunum_set_opbase(int cpunum, offs_t val);
5410 offs_t cpunum_dasm(int cpunum, char *buffer, offs_t pc);
5411 offs_t cpunum_dasm_new(int cpunum, char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5414 const char *cpunum_dump_state(int cpunum);
5415 # 622 "src/cpuintrf.h"
5416 INT64 cputype_get_info_int(int cputype, UINT32 state);
5417 void *cputype_get_info_ptr(int cputype, UINT32 state);
5418 genf *cputype_get_info_fct(int cputype, UINT32 state);
5419 const char *cputype_get_info_string(int cputype, UINT32 state);
5420 # 660 "src/cpuintrf.h"
5421 void cpu_dump_states(void);
5422 # 682 "src/cpuintrf.h"
5423 static __inline__ const cpu_interface *cputype_get_interface(int cputype)
5425 extern cpu_interface cpuintrf[];
5426 return &cpuintrf[cputype];
5431 static __inline__ int cpu_getactivecpu(void)
5433 extern int activecpu;
5439 static __inline__ int cpu_getexecutingcpu(void)
5441 extern int executingcpu;
5442 return executingcpu;
5447 static __inline__ int cpu_gettotalcpu(void)
5449 extern int totalcpu;
5452 # 71 "src/driver.h" 2
5453 # 1 "src/cpuexec.h" 1
5454 # 12 "src/cpuexec.h"
5456 # 29 "src/cpuexec.h"
5462 construct_map_t construct_map[3][2];
5463 void (*vblank_interrupt)(void);
5464 int vblank_interrupts_per_frame;
5465 void (*timed_interrupt)(void);
5466 double timed_interrupt_period;
5470 typedef struct _cpu_config cpu_config;
5471 # 52 "src/cpuexec.h"
5476 CPU_DISABLE = 0x0001
5478 # 69 "src/cpuexec.h"
5485 void cpu_exit(void);
5488 void cpu_pause(int pause);
5491 void machine_reset(void);
5492 # 92 "src/cpuexec.h"
5497 LOADSAVE_SAVE_AND_EXIT,
5499 LOADSAVE_LOAD_POSTRESET
5501 void cpu_loadsave_schedule(int type, char id);
5502 void cpu_loadsave_schedule_file(int type, const char *name);
5503 void cpu_loadsave_reset(void);
5504 void cpu_loadsave_warn(const char *msg);
5505 # 114 "src/cpuexec.h"
5506 void watchdog_reset_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5507 UINT8 watchdog_reset_r(__attribute__((__unused__)) offs_t offset);
5510 void watchdog_reset16_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5511 UINT16 watchdog_reset16_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5514 void watchdog_reset32_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask);
5515 UINT32 watchdog_reset32_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
5519 void watchdog_enable(int enable);
5520 # 138 "src/cpuexec.h"
5523 SUSPEND_REASON_HALT = 0x0001,
5524 SUSPEND_REASON_RESET = 0x0002,
5525 SUSPEND_REASON_SPIN = 0x0004,
5526 SUSPEND_REASON_TRIGGER = 0x0008,
5527 SUSPEND_REASON_DISABLE = 0x0010,
5528 SUSPEND_ANY_REASON = ~0
5532 void cpunum_suspend(int cpunum, int reason, int eatcycles);
5535 void cpunum_resume(int cpunum, int reason);
5538 int cpunum_is_suspended(int cpunum, int reason);
5541 void activecpu_abort_timeslice(void);
5544 mame_time cpunum_get_localtime(int cpunum);
5549 int cpunum_get_clock(int cpunum);
5552 void cpunum_set_clock(int cpunum, int clock);
5555 double cpunum_get_clockscale(int cpunum);
5558 void cpunum_set_clockscale(int cpunum, double clockscale);
5561 void cpu_boost_interleave(double timeslice_time, double boost_duration);
5562 # 189 "src/cpuexec.h"
5563 int cycles_currently_ran(void);
5566 int cycles_left_to_run(void);
5569 UINT32 activecpu_gettotalcycles(void);
5570 UINT64 activecpu_gettotalcycles64(void);
5573 UINT32 cpunum_gettotalcycles(int cpunum);
5574 UINT64 cpunum_gettotalcycles64(int cpunum);
5577 int activecpu_geticount(void);
5580 void activecpu_eat_cycles(int cycles);
5583 int cpu_scalebyfcount(int value);
5584 # 220 "src/cpuexec.h"
5585 void cpu_compute_scanline_timing(void);
5588 int cpu_getcurrentframe(void);
5591 int cpu_getscanline(void);
5594 mame_time cpu_getscanlinetime_mt(int scanline);
5595 double cpu_getscanlinetime(int scanline);
5598 mame_time cpu_getscanlineperiod_mt(void);
5599 double cpu_getscanlineperiod(void);
5602 int cpu_gethorzbeampos(void);
5605 int cpu_getvblank(void);
5606 # 251 "src/cpuexec.h"
5607 void cpu_trigger(int trigger);
5610 void cpu_triggertime(double duration, int trigger);
5613 void cpu_triggerint(int cpunum);
5616 void cpu_spinuntil_trigger(int trigger);
5619 void cpunum_spinuntil_trigger( int cpunum, int trigger );
5622 void cpu_yielduntil_trigger(int trigger);
5625 void cpu_spinuntil_int(void);
5628 void cpu_yielduntil_int(void);
5631 void cpu_spin(void);
5634 void cpu_yield(void);
5637 void cpu_spinuntil_time(double duration);
5640 void cpu_yielduntil_time(double duration);
5641 # 299 "src/cpuexec.h"
5642 int cpu_getiloops(void);
5643 # 72 "src/driver.h" 2
5644 # 1 "src/cpuint.h" 1
5648 int cpuint_init(void);
5650 void cpuint_reset_cpu(int cpunum);
5652 extern int (*cpu_irq_callbacks[])(int);
5654 void cpunum_set_input_line(int cpunum, int line, int state);
5657 void cpunum_set_input_line_vector(int cpunum, int irqline, int vector);
5660 void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector);
5663 void cpu_set_irq_callback(int cpunum, int (*callback)(int irqline));
5665 void nmi_line_pulse(void);
5666 void nmi_line_assert(void);
5668 void irq0_line_hold(void);
5669 void irq0_line_pulse(void);
5670 void irq0_line_assert(void);
5672 void irq1_line_hold(void);
5673 void irq1_line_pulse(void);
5674 void irq1_line_assert(void);
5676 void irq2_line_hold(void);
5677 void irq2_line_pulse(void);
5678 void irq2_line_assert(void);
5680 void irq3_line_hold(void);
5681 void irq3_line_pulse(void);
5682 void irq3_line_assert(void);
5684 void irq4_line_hold(void);
5685 void irq4_line_pulse(void);
5686 void irq4_line_assert(void);
5688 void irq5_line_hold(void);
5689 void irq5_line_pulse(void);
5690 void irq5_line_assert(void);
5692 void irq6_line_hold(void);
5693 void irq6_line_pulse(void);
5694 void irq6_line_assert(void);
5696 void irq7_line_hold(void);
5697 void irq7_line_pulse(void);
5698 void irq7_line_assert(void);
5699 # 118 "src/cpuint.h"
5700 void cpu_interrupt_enable(int cpu,int enabled);
5701 void interrupt_enable_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5702 void interrupt_vector_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5703 UINT8 interrupt_enable_r(__attribute__((__unused__)) offs_t offset);
5704 # 73 "src/driver.h" 2
5705 # 1 "src/sndintrf.h" 1
5706 # 12 "src/sndintrf.h"
5712 # 1 "src/streams.h" 1
5713 # 15 "src/streams.h"
5714 typedef INT32 stream_sample_t;
5715 typedef struct _sound_stream sound_stream;
5717 typedef void (*stream_callback)(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
5719 int streams_init(void);
5720 void streams_set_tag(void *streamtag);
5721 void streams_frame_update(void);
5724 sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_callback callback);
5725 void stream_set_input(sound_stream *stream, int index, sound_stream *input_stream, int output_index, float gain);
5726 void stream_update(sound_stream *stream, int min_interval);
5727 stream_sample_t *stream_consume_output(sound_stream *stream, int output, int samples);
5730 sound_stream *stream_find_by_tag(void *streamtag, int streamindex);
5731 int stream_get_inputs(sound_stream *stream);
5732 int stream_get_outputs(sound_stream *stream);
5733 void stream_set_input_gain(sound_stream *stream, int input, float gain);
5734 void stream_set_output_gain(sound_stream *stream, int output, float gain);
5735 void stream_set_sample_rate(sound_stream *stream, int sample_rate);
5736 # 18 "src/sndintrf.h" 2
5737 # 27 "src/sndintrf.h"
5815 # 115 "src/sndintrf.h"
5816 SOUND_FILTER_VOLUME,
5818 SOUND_FILTER_LOWPASS,
5822 # 130 "src/sndintrf.h"
5832 SNDINFO_INT_FIRST = 0x00000,
5834 SNDINFO_INT_CORE_SPECIFIC = 0x08000,
5837 SNDINFO_PTR_FIRST = 0x10000,
5839 SNDINFO_PTR_SET_INFO = SNDINFO_PTR_FIRST,
5844 SNDINFO_PTR_CORE_SPECIFIC = 0x18000,
5847 SNDINFO_STR_FIRST = 0x20000,
5849 SNDINFO_STR_NAME = SNDINFO_STR_FIRST,
5850 SNDINFO_STR_CORE_FAMILY,
5851 SNDINFO_STR_CORE_VERSION,
5852 SNDINFO_STR_CORE_FILE,
5853 SNDINFO_STR_CORE_CREDITS,
5855 SNDINFO_STR_CORE_SPECIFIC = 0x28000
5866 void (*set_info)(void *token, UINT32 state, union sndinfo *info);
5867 void * (*start)(int index, int clock, const void *config);
5868 void (*stop)(void *token);
5869 void (*reset)(void *token);
5871 # 187 "src/sndintrf.h"
5872 struct _sound_interface
5875 void (*get_info)(void *token, UINT32 state, union sndinfo *info);
5876 void (*set_info)(void *token, UINT32 state, union sndinfo *info);
5877 void * (*start)(int index, int clock, const void *config);
5878 void (*stop)(void *token);
5879 void (*reset)(void *token);
5881 typedef struct _sound_interface sound_interface;
5882 # 208 "src/sndintrf.h"
5889 typedef struct _sound_route sound_route;
5892 struct _sound_config
5899 sound_route route[MAX_ROUTES];
5901 typedef struct _sound_config sound_config;
5904 struct _speaker_config
5909 typedef struct _speaker_config speaker_config;
5910 # 245 "src/sndintrf.h"
5911 INT64 sndnum_get_info_int(int sndnum, UINT32 state);
5912 void *sndnum_get_info_ptr(int sndnum, UINT32 state);
5913 genf *sndnum_get_info_fct(int sndnum, UINT32 state);
5914 const char *sndnum_get_info_string(int sndnum, UINT32 state);
5917 void sndnum_set_info_int(int sndnum, UINT32 state, INT64 data);
5918 void sndnum_set_info_ptr(int sndnum, UINT32 state, void *data);
5919 void sndnum_set_info_fct(int sndnum, UINT32 state, genf *data);
5920 # 262 "src/sndintrf.h"
5921 int sndnum_clock(int sndnum);
5922 void *sndnum_token(int sndnum);
5923 # 274 "src/sndintrf.h"
5924 INT64 sndti_get_info_int(int sndtype, int sndindex, UINT32 state);
5925 void *sndti_get_info_ptr(int sndtype, int sndindex, UINT32 state);
5926 genf *sndti_get_info_fct(int sndtype, int sndindex, UINT32 state);
5927 const char *sndti_get_info_string(int sndtype, int sndindex, UINT32 state);
5930 void sndti_set_info_int(int sndtype, int sndindex, UINT32 state, INT64 data);
5931 void sndti_set_info_ptr(int sndtype, int sndindex, UINT32 state, void *data);
5932 void sndti_set_info_fct(int sndtype, int sndindex, UINT32 state, genf *data);
5933 # 291 "src/sndintrf.h"
5934 int sndti_clock(int sndtype, int sndindex);
5935 void *sndti_token(int sndtype, int sndindex);
5936 # 303 "src/sndintrf.h"
5937 INT64 sndtype_get_info_int(int sndtype, UINT32 state);
5938 void *sndtype_get_info_ptr(int sndtype, UINT32 state);
5939 genf *sndtype_get_info_fct(int sndtype, UINT32 state);
5940 const char *sndtype_get_info_string(int sndtype, UINT32 state);
5941 # 322 "src/sndintrf.h"
5942 void sndintrf_init(void);
5943 int sound_init(void);
5944 void sound_exit(void);
5945 void sound_reset(void);
5946 void sound_frame_update(void);
5947 void sound_register_token(void *token);
5948 int sound_scalebufferpos(int value);
5950 void sndintrf_load(int config_type, xml_data_node *parentnode);
5951 void sndintrf_save(int config_type, xml_data_node *parentnode);
5952 # 341 "src/sndintrf.h"
5953 int sndti_to_sndnum(int type, int index);
5956 void sound_global_enable(int enable);
5959 void sndti_reset(int type, int index);
5962 void sndti_set_output_gain(int type, int index, int output, float gain);
5965 int sound_get_user_gain_count(void);
5966 void sound_set_user_gain(int index, float gain);
5967 float sound_get_user_gain(int index);
5968 float sound_get_default_gain(int index);
5969 const char *sound_get_user_gain_name(int index);
5970 # 368 "src/sndintrf.h"
5971 UINT8 soundlatch_r(__attribute__((__unused__)) offs_t offset);
5972 UINT8 soundlatch2_r(__attribute__((__unused__)) offs_t offset);
5973 UINT8 soundlatch3_r(__attribute__((__unused__)) offs_t offset);
5974 UINT8 soundlatch4_r(__attribute__((__unused__)) offs_t offset);
5975 UINT16 soundlatch_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5976 UINT16 soundlatch2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5977 UINT16 soundlatch3_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5978 UINT16 soundlatch4_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5980 void soundlatch_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5981 void soundlatch2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5982 void soundlatch3_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5983 void soundlatch4_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5984 void soundlatch_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5985 void soundlatch2_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5986 void soundlatch3_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5987 void soundlatch4_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5989 void soundlatch_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5990 void soundlatch2_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5991 void soundlatch3_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5992 void soundlatch4_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5998 void soundlatch_setclearedvalue(int value);
5999 # 74 "src/driver.h" 2
6002 # 1 "src/usrintrf.h" 1
6003 # 12 "src/usrintrf.h"
6005 # 25 "src/usrintrf.h"
6034 PAUSE_SINGLE_STEP = 2
6036 # 69 "src/usrintrf.h"
6037 typedef UINT32 (*ui_menu_handler)(UINT32 state);
6039 struct _ui_menu_item
6042 const char *subtext;
6045 typedef struct _ui_menu_item ui_menu_item;
6048 struct _memcard_interface
6053 void (*eject)(void);
6055 typedef struct _memcard_interface memcard_interface;
6056 # 97 "src/usrintrf.h"
6057 extern memcard_interface memcard_intf;
6058 # 110 "src/usrintrf.h"
6063 int ui_update_and_render(mame_bitmap *bitmap);
6066 int ui_is_dirty(void);
6069 void ui_set_visible_area(int xmin, int ymin, int xmax, int ymax);
6072 int ui_get_line_height(void);
6075 int ui_get_char_width(UINT16 ch);
6076 int ui_get_string_width(const char *s);
6079 void ui_get_bounds(int *width, int *height);
6082 void ui_draw_text(const char *buf, int x, int y);
6085 void ui_draw_text_full(const char *buf, int x, int y, int wrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, int *totalwidth, int *totalheight);
6088 void ui_draw_message_window(const char *text);
6091 void ui_draw_menu(const ui_menu_item *items, int numitems, int selected);
6094 int ui_menu_generic_keys(int *selected, int num_items);
6097 void ui_menu_stack_reset(void);
6098 UINT32 ui_menu_stack_push(ui_menu_handler new_handler, UINT32 new_state);
6099 UINT32 ui_menu_stack_pop(void);
6102 void ui_popup(const char *text, ...) __attribute__((format(printf, 1, 2)));
6103 void ui_popup_time(int seconds, const char *text, ...) __attribute__((format(printf, 2, 3)));
6106 int ui_display_decoding(mame_bitmap *bitmap, int percent);
6107 int ui_display_copyright(mame_bitmap *bitmap);
6108 int ui_display_game_warnings(mame_bitmap *bitmap);
6109 int ui_display_game_info(mame_bitmap *bitmap);
6112 void ui_show_fps_temp(double seconds);
6115 void ui_set_show_fps(int show);
6116 int ui_get_show_fps(void);
6119 void ui_set_show_profiler(int show);
6120 int ui_get_show_profiler(void);
6123 int ui_is_setup_active(void);
6126 int ui_is_onscrd_active(void);
6129 void ui_display_fps(void);
6130 # 77 "src/driver.h" 2
6138 extern int he_did_cheat;
6140 void cheat_init(void);
6141 void cheat_exit(void);
6143 int cheat_menu(int selection);
6144 void cheat_periodic(void);
6146 void cheat_display_watches(void);
6147 # 78 "src/driver.h" 2
6148 # 1 "src/tilemap.h" 1
6149 # 12 "src/tilemap.h"
6155 typedef struct _tilemap tilemap;
6156 # 53 "src/tilemap.h"
6165 const UINT8 *pen_data;
6166 const pen_t *pal_data;
6175 typedef struct _tile_data tile_data;
6177 extern tile_data tile_info;
6178 # 108 "src/tilemap.h"
6179 extern mame_bitmap *priority_bitmap;
6182 int tilemap_init( void );
6183 void tilemap_exit( void );
6185 tilemap *tilemap_create(
6186 void (*tile_get_info)( int memory_offset ),
6187 UINT32 (*get_memory_offset)( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ),
6189 int tile_width, int tile_height,
6190 int num_cols, int num_rows );
6192 void tilemap_set_transparent_pen( tilemap *tmap, int pen );
6193 void tilemap_set_transmask( tilemap *tmap, int which, UINT32 fgmask, UINT32 bgmask );
6194 void tilemap_set_depth( tilemap *tmap, int tile_depth, int tile_granularity );
6196 void tilemap_mark_tile_dirty( tilemap *tmap, int memory_offset );
6197 void tilemap_mark_all_tiles_dirty( tilemap *tmap );
6198 void tilemap_mark_gfxdata_dirty( tilemap *tmap, UINT8 *dirty_array );
6200 void tilemap_set_scroll_rows( tilemap *tmap, int scroll_rows );
6201 void tilemap_set_scrolldx( tilemap *tmap, int dx, int dx_if_flipped );
6202 void tilemap_set_scrollx( tilemap *tmap, int row, int value );
6203 int tilemap_get_scrolldx( tilemap *tmap );
6205 void tilemap_set_scroll_cols( tilemap *tmap, int scroll_cols );
6206 void tilemap_set_scrolldy( tilemap *tmap, int dy, int dy_if_flipped );
6207 void tilemap_set_scrolly( tilemap *tmap, int col, int value );
6208 int tilemap_get_scrolldy( tilemap *tmap );
6210 void tilemap_set_palette_offset( tilemap *tmap, int offset );
6211 void tilemap_set_user_data( tilemap *tmap, void *user_data );
6215 void tilemap_set_flip( tilemap *tmap, int attributes );
6216 void tilemap_set_enable( tilemap *tmap, int enable );
6218 void tilemap_draw( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority );
6219 void tilemap_draw_primask( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority, UINT32 priority_mask );
6221 void tilemap_draw_roz(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
6222 UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
6224 UINT32 flags, UINT32 priority );
6226 void tilemap_draw_roz_primask(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
6227 UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
6229 UINT32 flags, UINT32 priority, UINT32 priority_mask );
6230 # 170 "src/tilemap.h"
6231 mame_bitmap *tilemap_get_pixmap( tilemap * tmap );
6232 mame_bitmap *tilemap_get_transparency_bitmap( tilemap * tmap );
6233 UINT8 *tilemap_get_transparency_data( tilemap * tmap );
6237 UINT32 tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6238 UINT32 tilemap_scan_cols_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6239 UINT32 tilemap_scan_cols_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6240 UINT32 tilemap_scan_cols_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6242 UINT32 tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6243 UINT32 tilemap_scan_rows_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6244 UINT32 tilemap_scan_rows_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6245 UINT32 tilemap_scan_rows_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6248 UINT32 tilemap_count( void );
6249 void tilemap_nb_size( UINT32 number, UINT32 *width, UINT32 *height );
6250 void tilemap_nb_draw( mame_bitmap *dest, UINT32 number, UINT32 scrollx, UINT32 scrolly );
6251 # 79 "src/driver.h" 2
6252 # 1 "src/profiler.h" 1
6253 # 12 "src/profiler.h"
6275 PROFILER_COPYBITMAP,
6276 PROFILER_TILEMAP_DRAW,
6277 PROFILER_TILEMAP_DRAW_ROZ,
6278 PROFILER_TILEMAP_UPDATE,
6283 PROFILER_TIMER_CALLBACK,
6299 # 75 "src/profiler.h"
6300 void profiler__mark(int type);
6303 void profiler_start(void);
6304 void profiler_stop(void);
6305 const char *profiler_get_text(void);
6306 # 80 "src/driver.h" 2
6307 # 309 "src/driver.h"
6308 cpu_config *machine_add_cpu(machine_config *machine, const char *tag, int type, int cpuclock);
6309 cpu_config *machine_find_cpu(machine_config *machine, const char *tag);
6310 void machine_remove_cpu(machine_config *machine, const char *tag);
6312 speaker_config *machine_add_speaker(machine_config *machine, const char *tag, float x, float y, float z);
6313 speaker_config *machine_find_speaker(machine_config *machine, const char *tag);
6314 void machine_remove_speaker(machine_config *machine, const char *tag);
6316 sound_config *machine_add_sound(machine_config *machine, const char *tag, int type, int clock);
6317 sound_config *machine_find_sound(machine_config *machine, const char *tag);
6318 void machine_remove_sound(machine_config *machine, const char *tag);
6319 # 337 "src/driver.h"
6320 struct _machine_config
6323 float frames_per_second;
6324 int vblank_duration;
6325 UINT32 cpu_slices_per_frame;
6326 INT32 watchdog_vblank_count;
6327 double watchdog_time;
6329 void (*machine_init)(void);
6330 void (*machine_stop)(void);
6331 void (*nvram_handler)(mame_file *file, int read_or_write);
6333 UINT32 video_attributes;
6334 UINT32 aspect_x, aspect_y;
6335 int screen_width,screen_height;
6336 rectangle default_visible_area;
6337 const gfx_decode *gfxdecodeinfo;
6338 UINT32 total_colors;
6339 UINT32 color_table_len;
6341 void (*init_palette)(UINT16 *colortable,const UINT8 *color_prom);
6342 int (*video_start)(void);
6343 void (*video_stop)(void);
6344 void (*video_eof)(void);
6348 void (*video_update)(int screen, mame_bitmap *bitmap,const rectangle *cliprect);
6351 sound_config sound[32];
6352 speaker_config speaker[4];
6354 # 452 "src/driver.h"
6357 const char *source_file;
6358 const struct _game_driver *clone_of;
6361 const bios_entry *bios;
6363 const char *description;
6365 const char *manufacturer;
6366 void (*drv)(machine_config *);
6367 void (*construct_ipt)(input_port_init_params *param);
6368 void (*driver_init)(void);
6372 const rom_entry *rom;
6380 # 574 "src/driver.h"
6381 extern const game_driver *drivers[];
6382 # 95 "src/memory.c" 2
6388 void state_save_free(void);
6389 void state_save_allow_registration(int allowed);
6390 int state_save_registration_allowed(void);
6393 int state_save_get_reg_count(void);
6395 void state_save_register_UINT8 (const char *module, int instance,
6396 const char *name, UINT8 *val, unsigned size);
6397 void state_save_register_INT8 (const char *module, int instance,
6398 const char *name, INT8 *val, unsigned size);
6399 void state_save_register_UINT16(const char *module, int instance,
6400 const char *name, UINT16 *val, unsigned size);
6401 void state_save_register_INT16 (const char *module, int instance,
6402 const char *name, INT16 *val, unsigned size);
6403 void state_save_register_UINT32(const char *module, int instance,
6404 const char *name, UINT32 *val, unsigned size);
6405 void state_save_register_INT32 (const char *module, int instance,
6406 const char *name, INT32 *val, unsigned size);
6407 void state_save_register_UINT64(const char *module, int instance,
6408 const char *name, UINT64 *val, unsigned size);
6409 void state_save_register_INT64 (const char *module, int instance,
6410 const char *name, INT64 *val, unsigned size);
6411 void state_save_register_double(const char *module, int instance,
6412 const char *name, double *val, unsigned size);
6413 void state_save_register_float (const char *module, int instance,
6414 const char *name, float *val, unsigned size);
6415 void state_save_register_int (const char *module, int instance,
6416 const char *name, int *val);
6418 void state_save_register_func_presave(void (*func)(void));
6419 void state_save_register_func_postload(void (*func)(void));
6421 void state_save_register_func_presave_int(void (*func)(int), int param);
6422 void state_save_register_func_postload_int(void (*func)(int), int param);
6424 void state_save_register_func_presave_ptr(void (*func)(void *), void *param);
6425 void state_save_register_func_postload_ptr(void (*func)(void *), void *param);
6429 int state_save_save_begin(mame_file *file);
6430 int state_save_load_begin(mame_file *file);
6432 void state_save_push_tag(int tag);
6433 void state_save_pop_tag(void);
6435 void state_save_save_continue(void);
6436 void state_save_load_continue(void);
6438 void state_save_save_finish(void);
6439 void state_save_load_finish(void);
6442 void state_save_dump_registry(void);
6445 int state_save_check_file(mame_file *file, const char *gamename, int validate_signature, void ( *errormsg)(const char *fmt, ...));
6446 # 97 "src/memory.c" 2
6447 # 1 "src/debug/debugcpu.h" 1
6448 # 15 "src/debug/debugcpu.h"
6449 # 1 "src/debug/express.h" 1
6450 # 84 "src/debug/express.h"
6451 struct register_info
6453 UINT64 (*getter)(UINT32);
6454 void (*setter)(UINT32, UINT64);
6458 struct function_info
6462 UINT64 (*execute)(UINT32, UINT32, UINT64 *);
6479 struct register_info reg;
6480 struct function_info func;
6481 struct generic_info gen;
6486 struct symbol_table;
6489 struct parsed_expression;
6492 typedef UINT32 EXPRERR;
6493 # 134 "src/debug/express.h"
6494 UINT64 external_read_memory(int space, UINT32 offset, int size);
6495 void external_write_memory(int space, UINT32 offset, int size, UINT64 value);
6496 # 144 "src/debug/express.h"
6497 EXPRERR expression_evaluate(const char *expression, const struct symbol_table *table, UINT64 *result);
6498 EXPRERR expression_parse(const char *expression, const struct symbol_table *table, struct parsed_expression **result);
6499 EXPRERR expression_execute(struct parsed_expression *expr, UINT64 *result);
6500 void expression_free(struct parsed_expression *expr);
6501 const char * expression_original_string(struct parsed_expression *expr);
6502 const char * exprerr_to_string(EXPRERR error);
6505 struct symbol_table * symtable_alloc(struct symbol_table *parent);
6506 int symtable_add(struct symbol_table *table, const char *name, const struct symbol_entry *entry);
6507 int symtable_add_register(struct symbol_table *table, const char *name, UINT32 ref, UINT64 (*getter)(UINT32), void (*setter)(UINT32, UINT64));
6508 int symtable_add_function(struct symbol_table *table, const char *name, UINT32 ref, UINT16 minparams, UINT16 maxparams, UINT64 (*execute)(UINT32, UINT32, UINT64 *));
6509 int symtable_add_value(struct symbol_table *table, const char *name, UINT64 value);
6510 const struct symbol_entry * symtable_find(const struct symbol_table *table, const char *name);
6511 void symtable_free(struct symbol_table *table);
6512 # 16 "src/debug/debugcpu.h" 2
6513 # 28 "src/debug/debugcpu.h"
6516 EXECUTION_STATE_STOPPED,
6517 EXECUTION_STATE_RUNNING,
6518 EXECUTION_STATE_NEXT_CPU,
6519 EXECUTION_STATE_STEP_INTO,
6520 EXECUTION_STATE_STEP_OVER,
6521 EXECUTION_STATE_STEP_OUT
6523 # 54 "src/debug/debugcpu.h"
6524 typedef void (*debug_hook_read_ptr)(int spacenum, int size, offs_t address);
6525 typedef void (*debug_hook_write_ptr)(int spacenum, int size, offs_t address, UINT64 data);
6529 struct debug_trace_info
6536 offs_t trace_over_target;
6542 struct _debug_space_info
6546 UINT8 addr2byte_lshift;
6547 UINT8 addr2byte_rshift;
6550 offs_t physaddrmask;
6552 offs_t physbytemask;
6554 struct watchpoint *first_wp;
6556 typedef struct _debug_space_info debug_space_info;
6559 struct _debug_hotspot_entry
6566 typedef struct _debug_hotspot_entry debug_hotspot_entry;
6569 struct debug_cpu_info
6575 offs_t temp_breakpoint_pc;
6576 int read_watchpoints;
6577 int write_watchpoints;
6578 struct symbol_table *symtable;
6579 struct debug_trace_info trace;
6580 struct breakpoint *first_bp;
6581 debug_space_info space[3];
6582 debug_hotspot_entry *hotspots;
6584 int hotspot_threshhold;
6585 int (*translate)(int space, offs_t *address);
6586 int (*read)(int space, UINT32 offset, int size, UINT64 *value);
6587 int (*write)(int space, UINT32 offset, int size, UINT64 value);
6588 int (*readop)(UINT32 offset, int size, UINT64 *value);
6597 struct parsed_expression *condition;
6599 struct breakpoint *next;
6610 struct parsed_expression *condition;
6612 struct watchpoint *next;
6621 extern FILE *debug_source_file;
6622 extern struct symbol_table *global_symtable;
6623 # 161 "src/debug/debugcpu.h"
6624 void debug_cpu_init(void);
6625 void debug_cpu_exit(void);
6628 const struct debug_cpu_info *debug_get_cpu_info(int cpunum);
6629 void debug_halt_on_next_instruction(void);
6630 void debug_refresh_display(void);
6631 int debug_get_execution_state(void);
6632 UINT32 debug_get_execution_counter(void);
6633 void debug_trace_printf(int cpunum, const char *fmt, ...);
6634 void debug_source_script(const char *file);
6635 void debug_flush_traces(void);
6638 void debug_vblank_hook(void);
6639 void debug_interrupt_hook(int cpunum, int irqline);
6640 void debug_get_memory_hooks(int cpunum, debug_hook_read_ptr *read, debug_hook_write_ptr *write);
6643 void debug_cpu_single_step(int numsteps);
6644 void debug_cpu_single_step_over(int numsteps);
6645 void debug_cpu_single_step_out(void);
6646 void debug_cpu_go(offs_t targetpc);
6647 void debug_cpu_go_vblank(void);
6648 void debug_cpu_go_interrupt(int irqline);
6649 void debug_cpu_go_milliseconds(UINT64 milliseconds);
6650 void debug_cpu_next_cpu(void);
6651 void debug_cpu_ignore_cpu(int cpunum, int ignore);
6654 void debug_cpu_trace(int cpunum, FILE *file, int trace_over, const char *action);
6657 void debug_check_breakpoints(int cpunum, offs_t pc);
6658 struct breakpoint * debug_breakpoint_first(int cpunum);
6659 int debug_breakpoint_set(int cpunum, offs_t address, struct parsed_expression *condition, const char *action);
6660 int debug_breakpoint_clear(int bpnum);
6661 int debug_breakpoint_enable(int bpnum, int enable);
6664 struct watchpoint * debug_watchpoint_first(int cpunum, int spacenum);
6665 int debug_watchpoint_set(int cpunum, int spacenum, int type, offs_t address, offs_t length, struct parsed_expression *condition, const char *action);
6666 int debug_watchpoint_clear(int wpnum);
6667 int debug_watchpoint_enable(int wpnum, int enable);
6670 int debug_hotspot_track(int cpunum, int numspots, int threshhold);
6673 UINT8 debug_read_byte(int spacenum, offs_t address);
6674 UINT16 debug_read_word(int spacenum, offs_t address);
6675 UINT32 debug_read_dword(int spacenum, offs_t address);
6676 UINT64 debug_read_qword(int spacenum, offs_t address);
6677 void debug_write_byte(int spacenum, offs_t address, UINT8 data);
6678 void debug_write_word(int spacenum, offs_t address, UINT16 data);
6679 void debug_write_dword(int spacenum, offs_t address, UINT32 data);
6680 void debug_write_qword(int spacenum, offs_t address, UINT64 data);
6681 UINT64 debug_read_opcode(UINT32 offset, int size, int arg);
6682 # 98 "src/memory.c" 2
6683 # 173 "src/memory.c"
6684 struct _memory_block
6692 typedef struct _memory_block memory_block;
6708 typedef struct _bank_data bank_data;
6714 write_handlers write;
6716 typedef union _rwhandlers rwhandlers;
6718 struct _handler_data
6728 struct _subtable_data
6730 UINT8 checksum_valid;
6734 typedef struct _subtable_data subtable_data;
6739 UINT8 subtable_alloc;
6740 subtable_data subtable[64];
6741 handler_data handlers[((256-64))];
6743 typedef struct _table_data table_data;
6745 struct _addrspace_data
6757 data_accessors * accessors;
6759 address_map * adjmap;
6761 typedef struct _addrspace_data addrspace_data;
6765 opbase_handler opbase;
6775 addrspace_data space[3];
6777 typedef struct _cpu_data cpu_data;
6784 UINT8 * opcode_base;
6785 UINT8 * opcode_arg_base;
6787 offs_t opcode_memory_min;
6788 offs_t opcode_memory_max;
6791 address_space active_address_space[3];
6793 static UINT8 * bank_ptr[72];
6794 static UINT8 * bankd_ptr[72];
6795 static void * shared_ptr[256];
6797 static memory_block memory_block_list[1024];
6798 static int memory_block_count = 0;
6800 static int cur_context;
6802 static opbase_handler opbasefunc;
6804 static int debugger_access;
6806 static cpu_data cpudata[8];
6807 static bank_data bankdata[72];
6814 static data_accessors memory_accessors[3][4][2] =
6819 { program_read_byte_8, ((void *)0), ((void *)0), ((void *)0), program_write_byte_8, ((void *)0), ((void *)0), ((void *)0) },
6820 { program_read_byte_8, ((void *)0), ((void *)0), ((void *)0), program_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }
6823 { program_read_byte_16le, program_read_word_16le, ((void *)0), ((void *)0), program_write_byte_16le, program_write_word_16le, ((void *)0), ((void *)0) },
6824 { program_read_byte_16be, program_read_word_16be, ((void *)0), ((void *)0), program_write_byte_16be, program_write_word_16be, ((void *)0), ((void *)0) }
6827 { program_read_byte_32le, program_read_word_32le, program_read_dword_32le, ((void *)0), program_write_byte_32le, program_write_word_32le, program_write_dword_32le, ((void *)0) },
6828 { program_read_byte_32be, program_read_word_32be, program_read_dword_32be, ((void *)0), program_write_byte_32be, program_write_word_32be, program_write_dword_32be, ((void *)0) }
6831 { program_read_byte_64le, program_read_word_64le, program_read_dword_64le, program_read_qword_64le, program_write_byte_64le, program_write_word_64le, program_write_dword_64le, program_write_qword_64le },
6832 { program_read_byte_64be, program_read_word_64be, program_read_dword_64be, program_read_qword_64be, program_write_byte_64be, program_write_word_64be, program_write_dword_64be, program_write_qword_64be }
6839 { data_read_byte_8, ((void *)0), ((void *)0), ((void *)0), data_write_byte_8, ((void *)0), ((void *)0), ((void *)0) },
6840 { data_read_byte_8, ((void *)0), ((void *)0), ((void *)0), data_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }
6843 { data_read_byte_16le, data_read_word_16le, ((void *)0), ((void *)0), data_write_byte_16le, data_write_word_16le, ((void *)0), ((void *)0) },
6844 { data_read_byte_16be, data_read_word_16be, ((void *)0), ((void *)0), data_write_byte_16be, data_write_word_16be, ((void *)0), ((void *)0) }
6847 { data_read_byte_32le, data_read_word_32le, data_read_dword_32le, ((void *)0), data_write_byte_32le, data_write_word_32le, data_write_dword_32le, ((void *)0) },
6848 { data_read_byte_32be, data_read_word_32be, data_read_dword_32be, ((void *)0), data_write_byte_32be, data_write_word_32be, data_write_dword_32be, ((void *)0) }
6851 { data_read_byte_64le, data_read_word_64le, data_read_dword_64le, data_read_qword_64le, data_write_byte_64le, data_write_word_64le, data_write_dword_64le, data_write_qword_64le },
6852 { data_read_byte_64be, data_read_word_64be, data_read_dword_64be, data_read_qword_64be, data_write_byte_64be, data_write_word_64be, data_write_dword_64be, data_write_qword_64be }
6859 { io_read_byte_8, ((void *)0), ((void *)0), ((void *)0), io_write_byte_8, ((void *)0), ((void *)0), ((void *)0) },
6860 { io_read_byte_8, ((void *)0), ((void *)0), ((void *)0), io_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }
6863 { io_read_byte_16le, io_read_word_16le, ((void *)0), ((void *)0), io_write_byte_16le, io_write_word_16le, ((void *)0), ((void *)0) },
6864 { io_read_byte_16be, io_read_word_16be, ((void *)0), ((void *)0), io_write_byte_16be, io_write_word_16be, ((void *)0), ((void *)0) }
6867 { io_read_byte_32le, io_read_word_32le, io_read_dword_32le, ((void *)0), io_write_byte_32le, io_write_word_32le, io_write_dword_32le, ((void *)0) },
6868 { io_read_byte_32be, io_read_word_32be, io_read_dword_32be, ((void *)0), io_write_byte_32be, io_write_word_32be, io_write_dword_32be, ((void *)0) }
6871 { io_read_byte_64le, io_read_word_64le, io_read_dword_64le, io_read_qword_64le, io_write_byte_64le, io_write_word_64le, io_write_dword_64le, io_write_qword_64le },
6872 { io_read_byte_64be, io_read_word_64be, io_read_dword_64be, io_read_qword_64be, io_write_byte_64be, io_write_word_64be, io_write_dword_64be, io_write_qword_64be }
6883 static int init_cpudata(void);
6884 static int init_addrspace(UINT8 cpunum, UINT8 spacenum);
6885 static int preflight_memory(void);
6886 static int populate_memory(void);
6887 static void install_mem_handler(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name);
6888 static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked);
6889 static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask);
6890 static void populate_table_range(addrspace_data *space, int iswrite, offs_t start, offs_t stop, UINT8 handler);
6891 static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler);
6892 static UINT8 allocate_subtable(table_data *tabledata);
6893 static void reallocate_subtable(table_data *tabledata, UINT8 subentry);
6894 static int merge_subtables(table_data *tabledata);
6895 static void release_subtable(table_data *tabledata, UINT8 subentry);
6896 static UINT8 *open_subtable(table_data *tabledata, offs_t l1index);
6897 static void close_subtable(table_data *tabledata, offs_t l1index);
6898 static int allocate_memory(void);
6899 static void *allocate_memory_block(int cpunum, int spacenum, offs_t start, offs_t end, void *memory);
6900 static void register_for_save(int cpunum, int spacenum, offs_t start, void *base, size_t numbytes);
6901 static address_map *assign_intersecting_blocks(addrspace_data *space, offs_t start, offs_t end, UINT8 *base);
6902 static int find_memory(void);
6903 static void *memory_find_base(int cpunum, int spacenum, int readwrite, offs_t offset);
6904 static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which);
6906 static void mem_dump(void)
6912 file = fopen("memdump.log", "w");
6927 int memory_init(void)
6933 memset(shared_ptr, 0, sizeof(shared_ptr));
6934 memset(bank_ptr, 0, sizeof(bank_ptr));
6935 memset(bankd_ptr, 0, sizeof(bankd_ptr));
6938 memset(memory_block_list, 0, sizeof(memory_block_list));
6939 memory_block_count = 0;
6942 if (!init_cpudata())
6946 if (!preflight_memory())
6950 if (!populate_memory())
6954 if (!allocate_memory())
6971 void memory_exit(void)
6973 int cpunum, spacenum;
6976 for (cpunum = 0; cpunum < 8; cpunum++)
6977 for (spacenum = 0; spacenum < 3; spacenum++)
6979 if (cpudata[cpunum].space[spacenum].read.table)
6980 free(cpudata[cpunum].space[spacenum].read.table);
6981 if (cpudata[cpunum].space[spacenum].write.table)
6982 free(cpudata[cpunum].space[spacenum].write.table);
6991 void memory_set_context(int activecpu)
6994 if (cur_context != -1)
6996 cpudata[cur_context].op_ram = opcode_arg_base;
6997 cpudata[cur_context].op_rom = opcode_base;
6998 cpudata[cur_context].op_mask = opcode_mask;
6999 cpudata[cur_context].op_mem_min = opcode_memory_min;
7000 cpudata[cur_context].op_mem_max = opcode_memory_max;
7001 cpudata[cur_context].opcode_entry = opcode_entry;
7003 cur_context = activecpu;
7005 opcode_arg_base = cpudata[activecpu].op_ram;
7006 opcode_base = cpudata[activecpu].op_rom;
7007 opcode_mask = cpudata[activecpu].op_mask;
7008 opcode_memory_min = cpudata[activecpu].op_mem_min;
7009 opcode_memory_max = cpudata[activecpu].op_mem_max;
7010 opcode_entry = cpudata[activecpu].opcode_entry;
7013 active_address_space[0].addrmask = cpudata[activecpu].space[0].mask;
7014 active_address_space[0].readlookup = cpudata[activecpu].space[0].read.table;
7015 active_address_space[0].writelookup = cpudata[activecpu].space[0].write.table;
7016 active_address_space[0].readhandlers = cpudata[activecpu].space[0].read.handlers;
7017 active_address_space[0].writehandlers = cpudata[activecpu].space[0].write.handlers;
7018 active_address_space[0].accessors = cpudata[activecpu].space[0].accessors;
7021 if (cpudata[activecpu].spacemask & (1 << 1))
7023 active_address_space[1].addrmask = cpudata[activecpu].space[1].mask;
7024 active_address_space[1].readlookup = cpudata[activecpu].space[1].read.table;
7025 active_address_space[1].writelookup = cpudata[activecpu].space[1].write.table;
7026 active_address_space[1].readhandlers = cpudata[activecpu].space[1].read.handlers;
7027 active_address_space[1].writehandlers = cpudata[activecpu].space[1].write.handlers;
7028 active_address_space[1].accessors = cpudata[activecpu].space[1].accessors;
7032 if (cpudata[activecpu].spacemask & (1 << 2))
7034 active_address_space[2].addrmask = cpudata[activecpu].space[2].mask;
7035 active_address_space[2].readlookup = cpudata[activecpu].space[2].read.table;
7036 active_address_space[2].writelookup = cpudata[activecpu].space[2].write.table;
7037 active_address_space[2].readhandlers = cpudata[activecpu].space[2].read.handlers;
7038 active_address_space[2].writehandlers = cpudata[activecpu].space[2].write.handlers;
7039 active_address_space[2].accessors = cpudata[activecpu].space[2].accessors;
7042 opbasefunc = cpudata[activecpu].opbase;
7043 # 542 "src/memory.c"
7052 const address_map *memory_get_map(int cpunum, int spacenum)
7054 return cpudata[cpunum].space[spacenum].map;
7063 opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function)
7065 opbase_handler old = cpudata[cpunum].opbase;
7066 cpudata[cpunum].opbase = function;
7067 if (cpunum == cpu_getactivecpu())
7068 opbasefunc = function;
7077 void memory_set_opbase(offs_t pc)
7079 address_space *space = &active_address_space[0];
7081 UINT8 *base = ((void *)0), *based = ((void *)0);
7082 handler_data *handlers;
7088 pc = (*opbasefunc)(pc);
7094 pc &= space->addrmask;
7095 entry = space->readlookup[((pc) >> (32 - 18))];
7096 if (entry >= (256-64))
7097 entry = space->readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((pc) & ((1 << (32 - 18)) - 1)))];
7098 opcode_entry = entry;
7101 if (entry < 1 || entry >= 68)
7104 for (entry = 1; entry < 72; entry++)
7106 bank_data *bdata = &bankdata[entry];
7107 if (bdata->used && bdata->cpunum == cur_context && bdata->spacenum == 0 &&
7108 bdata->base < pc && bdata->end > pc)
7115 logerror("cpu #%d (PC=%08X): warning - op-code execute on mapped I/O\n",
7116 cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))));
7122 base = bank_ptr[entry];
7123 based = bankd_ptr[entry];
7128 handlers = &active_address_space[0].readhandlers[entry];
7129 opcode_mask = handlers->mask;
7130 opcode_arg_base = base - (handlers->offset & opcode_mask);
7131 opcode_base = based - (handlers->offset & opcode_mask);
7132 opcode_memory_min = handlers->offset;
7133 opcode_memory_max = handlers->top;
7142 void memory_set_decrypted_region(int cpunum, offs_t start, offs_t end, void *base)
7144 int banknum, found = 0;
7147 for (banknum = 0; banknum < 72; banknum++)
7149 bank_data *bdata = &bankdata[banknum];
7150 if (bdata->used && bdata->cpunum == cpunum && bdata->spacenum == 0 && bdata->read)
7152 if (bdata->base >= start && bdata->end <= end)
7154 bankd_ptr[banknum] = (UINT8 *)base + bdata->base - start;
7158 if (cpunum == cur_context && opcode_entry == banknum)
7159 memory_set_opbase(activecpu_get_physical_pc_byte());
7161 else if (bdata->base < end && bdata->end > start)
7162 osd_die("memory_set_decrypted_region found straddled region %08X-%08X for CPU %d\n", start, end, cpunum);
7167 osd_die("memory_set_decrypted_region unable to find matching region %08X-%08X for CPU %d\n", start, end, cpunum);
7169 # 675 "src/memory.c"
7170 void *memory_get_read_ptr(int cpunum, int spacenum, offs_t offset)
7172 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7176 offset &= space->mask;
7177 entry = space->read.table[((offset) >> (32 - 18))];
7178 if (entry >= (256-64))
7179 entry = space->read.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
7184 offset = (offset - space->read.handlers[entry].offset) & space->read.handlers[entry].mask;
7185 return &bank_ptr[entry][offset];
7187 # 700 "src/memory.c"
7188 void *memory_get_write_ptr(int cpunum, int spacenum, offs_t offset)
7190 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7194 offset &= space->mask;
7195 entry = space->write.table[((offset) >> (32 - 18))];
7196 if (entry >= (256-64))
7197 entry = space->write.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
7202 offset = (offset - space->write.handlers[entry].offset) & space->write.handlers[entry].mask;
7203 return &bank_ptr[entry][offset];
7205 # 725 "src/memory.c"
7206 void *memory_get_op_ptr(int cpunum, offs_t offset, int arg)
7208 addrspace_data *space = &cpudata[cpunum].space[0];
7209 void *ptr = ((void *)0);
7213 if (cpudata[cpunum].opbase)
7216 UINT8 *saved_opcode_base = opcode_base;
7217 UINT8 *saved_opcode_arg_base = opcode_arg_base;
7218 offs_t saved_opcode_mask = opcode_mask;
7219 offs_t saved_opcode_memory_min = opcode_memory_min;
7220 offs_t saved_opcode_memory_max = opcode_memory_max;
7221 UINT8 saved_opcode_entry = opcode_entry;
7224 offs_t new_offset = (*cpudata[cpunum].opbase)(offset);
7227 if (new_offset == ~0)
7228 ptr = arg ? &opcode_arg_base[offset] : &opcode_base[offset];
7232 offset = new_offset;
7235 opcode_base = saved_opcode_base;
7236 opcode_arg_base = saved_opcode_arg_base;
7237 opcode_mask = saved_opcode_mask;
7238 opcode_memory_min = saved_opcode_memory_min;
7239 opcode_memory_max = saved_opcode_memory_max;
7240 opcode_entry = saved_opcode_entry;
7248 offset &= space->mask;
7249 entry = space->read.table[((offset) >> (32 - 18))];
7250 if (entry >= (256-64))
7251 entry = space->read.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
7258 offset = (offset - space->read.handlers[entry].offset) & space->read.handlers[entry].mask;
7259 return (!arg && bankd_ptr[entry]) ? &bankd_ptr[entry][offset] : &bank_ptr[entry][offset];
7268 void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride)
7273 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7274 osd_die("memory_configure_bank called with invalid bank %d\n", banknum);
7275 if (bankdata[banknum].dynamic)
7276 osd_die("memory_configure_bank called with dynamic bank %d\n", banknum);
7277 if (startentry < 0 || startentry + numentries > 64)
7278 osd_die("memory_configure_bank called with out-of-range entries %d-%d\n", startentry, startentry + numentries - 1);
7281 for (entrynum = startentry; entrynum < startentry + numentries; entrynum++)
7282 bankdata[banknum].entry[entrynum] = (UINT8 *)base + (entrynum - startentry) * stride;
7284 # 811 "src/memory.c"
7285 void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride)
7290 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7291 osd_die("memory_configure_bank called with invalid bank %d\n", banknum);
7292 if (bankdata[banknum].dynamic)
7293 osd_die("memory_configure_bank called with dynamic bank %d\n", banknum);
7294 if (startentry < 0 || startentry + numentries > 64)
7295 osd_die("memory_configure_bank called with out-of-range entries %d-%d\n", startentry, startentry + numentries - 1);
7298 for (entrynum = startentry; entrynum < startentry + numentries; entrynum++)
7299 bankdata[banknum].entryd[entrynum] = (UINT8 *)base + (entrynum - startentry) * stride;
7308 void memory_set_bank(int banknum, int entrynum)
7311 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7312 osd_die("memory_set_bank called with invalid bank %d\n", banknum);
7313 if (bankdata[banknum].dynamic)
7314 osd_die("memory_set_bank called with dynamic bank %d\n", banknum);
7315 if (entrynum < 0 || entrynum > 64)
7316 osd_die("memory_set_bank called with out-of-range entry %d\n", entrynum);
7317 if (!bankdata[banknum].entry[entrynum])
7318 osd_die("memory_set_bank called for bank %d with invalid bank entry %d\n", banknum, entrynum);
7321 bankdata[banknum].curentry = entrynum;
7322 bank_ptr[banknum] = bankdata[banknum].entry[entrynum];
7323 bankd_ptr[banknum] = bankdata[banknum].entryd[entrynum];
7326 if (opcode_entry == banknum && cpu_getactivecpu() >= 0)
7328 opcode_entry = 0xff;
7329 memory_set_opbase(activecpu_get_physical_pc_byte());
7339 void memory_set_bankptr(int banknum, void *base)
7342 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7343 osd_die("memory_set_bankptr called with invalid bank %d\n", banknum);
7344 if (bankdata[banknum].dynamic)
7345 osd_die("memory_set_bankptr called with dynamic bank %d\n", banknum);
7348 bank_ptr[banknum] = base;
7351 if (opcode_entry == banknum && cpu_getactivecpu() >= 0)
7353 opcode_entry = 0xff;
7354 memory_set_opbase(activecpu_get_physical_pc_byte());
7363 void memory_set_debugger_access(int debugger)
7365 debugger_access = debugger;
7374 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)
7376 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7377 if ((handler < 0) || (handler >= 72))
7378 osd_die("fatal: can only use static banks with memory_install_read_handler()\n");
7379 install_mem_handler(space, 0, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7381 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7384 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)
7386 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7387 install_mem_handler(space, 0, 8, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7389 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7392 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)
7394 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7395 install_mem_handler(space, 0, 16, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7397 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7400 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)
7402 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7403 install_mem_handler(space, 0, 32, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7405 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7408 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)
7410 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7411 install_mem_handler(space, 0, 64, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7413 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7422 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)
7424 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7425 if ((handler < 0) || (handler >= 72))
7426 osd_die("fatal: can only use static banks with memory_install_write_handler()\n");
7427 install_mem_handler(space, 1, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7429 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7432 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)
7434 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7435 install_mem_handler(space, 1, 8, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7437 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7440 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)
7442 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7443 install_mem_handler(space, 1, 16, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7445 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7448 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)
7450 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7451 install_mem_handler(space, 1, 32, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7453 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7456 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)
7458 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7459 install_mem_handler(space, 1, 64, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7461 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7463 # 997 "src/memory.c"
7464 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)
7466 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7467 if ((handler < 0) || (handler >= 72))
7468 osd_die("fatal: can only use static banks with memory_install_read_matchmask_handler()\n");
7469 install_mem_handler(space, 0, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7471 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7474 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)
7476 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7477 install_mem_handler(space, 0, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7479 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7482 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)
7484 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7485 install_mem_handler(space, 0, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7487 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7490 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)
7492 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7493 install_mem_handler(space, 0, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7495 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7498 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)
7500 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7501 install_mem_handler(space, 0, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7503 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7505 # 1046 "src/memory.c"
7506 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)
7508 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7509 if ((handler < 0) || (handler >= 72))
7510 osd_die("fatal: can only use static banks with memory_install_write_matchmask_handler()\n");
7511 install_mem_handler(space, 1, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7513 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7516 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)
7518 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7519 install_mem_handler(space, 1, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7521 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7524 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)
7526 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7527 install_mem_handler(space, 1, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7529 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7532 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)
7534 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7535 install_mem_handler(space, 1, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7537 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7540 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)
7542 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7543 install_mem_handler(space, 1, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7545 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7553 address_map *construct_map_0(address_map *map)
7565 static int init_cpudata(void)
7567 int cpunum, spacenum;
7570 memset(&cpudata, 0, sizeof(cpudata));
7573 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
7576 cpudata[cpunum].op_ram = cpudata[cpunum].op_rom = memory_region(REGION_CPU1 + cpunum);
7577 cpudata[cpunum].op_mem_max = memory_region_length(REGION_CPU1 + cpunum);
7578 cpudata[cpunum].op_mem_min = 0;
7579 cpudata[cpunum].opcode_entry = 71;
7580 cpudata[cpunum].opbase = ((void *)0);
7583 cpudata[cpunum].spacemask = 0;
7584 for (spacenum = 0; spacenum < 3; spacenum++)
7585 if (!init_addrspace(cpunum, spacenum))
7587 cpudata[cpunum].op_mask = cpudata[cpunum].space[0].mask;
7598 static __inline__ void adjust_addresses(addrspace_data *space, int ismatchmask, offs_t *start, offs_t *end, offs_t *mask, offs_t *mirror)
7601 if (!*mask) *mask = space->rawmask;
7605 *start &= ~*mirror & space->rawmask;
7606 *end &= ~*mirror & space->rawmask;
7609 *mask = (((space)->ashift < 0) ? ((*mask) << -(space)->ashift) : ((*mask) >> (space)->ashift));
7610 *start = (((space)->ashift < 0) ? ((*start) << -(space)->ashift) : ((*start) >> (space)->ashift));
7611 *end = ismatchmask ? (((space)->ashift < 0) ? ((*end) << -(space)->ashift) : ((*end) >> (space)->ashift)) : (((space)->ashift < 0) ? (((*end) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((*end) >> (space)->ashift));
7612 *mirror = (((space)->ashift < 0) ? ((*mirror) << -(space)->ashift) : ((*mirror) >> (space)->ashift));
7621 static int init_addrspace(UINT8 cpunum, UINT8 spacenum)
7623 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7624 int cputype = Machine->drv->cpu[cpunum].cpu_type;
7625 int abits = cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_WIDTH + (spacenum));
7626 int dbits = cputype_get_info_int(cputype, CPUINFO_INT_DATABUS_WIDTH + (spacenum));
7627 int accessorindex = (dbits == 8) ? 0 : (dbits == 16) ? 1 : (dbits == 32) ? 2 : 3;
7628 construct_map_t internal_map = (construct_map_t)cputype_get_info_fct(cputype, CPUINFO_PTR_INTERNAL_MEMORY_MAP + spacenum);
7632 space->cpunum = cpunum;
7633 space->spacenum = spacenum;
7634 space->ashift = cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_SHIFT + (spacenum));
7635 space->abits = abits - space->ashift;
7636 space->dbits = dbits;
7637 space->rawmask = 0xffffffffUL >> (32 - abits);
7638 space->mask = (((space)->ashift < 0) ? (((space->rawmask) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((space->rawmask) >> (space)->ashift));
7639 space->accessors = &memory_accessors[spacenum][accessorindex][cputype_get_info_int(cputype, CPUINFO_INT_ENDIANNESS) == CPU_IS_LE ? 0 : 1];
7640 space->map = ((void *)0);
7641 space->adjmap = ((void *)0);
7644 if (space->abits == 0)
7646 cpudata[cpunum].spacemask |= 1 << spacenum;
7649 if (internal_map || Machine->drv->cpu[cpunum].construct_map[spacenum][0] || Machine->drv->cpu[cpunum].construct_map[spacenum][1])
7652 address_map *map = auto_malloc(sizeof(space->map[0]) * 256 * 4);
7653 memset(map, 0, sizeof(space->map[0]) * 256 * 4);
7657 space->adjmap = &map[256 * 2];
7661 map = (*internal_map)(map);
7664 if (Machine->drv->cpu[cpunum].construct_map[spacenum][0])
7665 map = (*Machine->drv->cpu[cpunum].construct_map[spacenum][0])(map);
7666 if (Machine->drv->cpu[cpunum].construct_map[spacenum][1])
7667 map = (*Machine->drv->cpu[cpunum].construct_map[spacenum][1])(map);
7670 if (spacenum == 0 && memory_region(REGION_CPU1 + cpunum))
7671 for (map = space->map; !(((map)->flags & 0x04) != 0); map++)
7672 if (!(((map)->flags & 0x01) != 0) && ((FPTR)(map->read.handler) == 69) && !map->region)
7674 map->region = REGION_CPU1 + cpunum;
7675 map->region_offs = (((space)->ashift < 0) ? ((map->start) << -(space)->ashift) : ((map->start) >> (space)->ashift));
7679 for (map = space->map; !(((map)->flags & 0x04) != 0); map++)
7681 map->memory = memory_region(map->region) + map->region_offs;
7684 memcpy(space->adjmap, space->map, sizeof(space->map[0]) * 256 * 2);
7685 for (map = space->adjmap; !(((map)->flags & 0x04) != 0); map++)
7686 if (!(((map)->flags & 0x01) != 0))
7687 adjust_addresses(space, (((map)->flags & 0x02) != 0), &map->start, &map->end, &map->mask, &map->mirror);
7690 for (map = space->adjmap; !(((map)->flags & 0x04) != 0); map++)
7691 if (map->region && map->share == 0 && !map->base)
7693 UINT8 *base = memory_region(map->region);
7694 offs_t length = memory_region_length(map->region);
7698 osd_die("Error: CPU %d space %d memory map entry %X-%X references non-existant region %d", cpunum, spacenum, map->start, map->end, map->region);
7699 if (map->region_offs + (map->end - map->start + 1) > length)
7700 osd_die("Error: CPU %d space %d memory map entry %X-%X extends beyond region %d size (%X)", cpunum, spacenum, map->start, map->end, map->region, length);
7705 memset(space->read.handlers, 0, sizeof(space->read.handlers));
7706 memset(space->write.handlers, 0, sizeof(space->write.handlers));
7707 for (entrynum = 0; entrynum < ((256-64)); entrynum++)
7709 space->read.handlers[entrynum].handler.generic = get_static_handler(dbits, 0, spacenum, entrynum);
7710 space->read.handlers[entrynum].mask = space->mask;
7711 space->write.handlers[entrynum].handler.generic = get_static_handler(dbits, 1, spacenum, entrynum);
7712 space->write.handlers[entrynum].mask = space->mask;
7716 space->read.table = malloc(1 << 18);
7717 space->write.table = malloc(1 << 18);
7718 if (!space->read.table)
7719 osd_die("cpu #%d couldn't allocate read table\n", cpunum);
7720 if (!space->write.table)
7721 osd_die("cpu #%d couldn't allocate write table\n", cpunum);
7724 memset(space->read.table, 71, 1 << 18);
7725 memset(space->write.table, 71, 1 << 18);
7735 static int preflight_memory(void)
7737 int cpunum, spacenum, entrynum;
7740 memset(&bankdata, 0, sizeof(bankdata));
7743 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
7744 for (spacenum = 0; spacenum < 3; spacenum++)
7745 if (cpudata[cpunum].spacemask & (1 << spacenum))
7747 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7748 const address_map *map;
7751 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
7754 if ((((map)->flags & 0x01) != 0))
7756 UINT32 flags = ((map)->start);
7760 if (flags & 0x00000001)
7762 val = (flags & (0x0f << 8)) >> 8;
7763 if (val != spacenum)
7765 osd_die("cpu #%d has address space %d handlers in place of address space %d handlers!\n", cpunum, val, spacenum);
7771 if (flags & 0x00000004)
7773 val = (flags & (0x07 << 18)) >> 18;
7774 val = (val + 1) * 8;
7775 if (val != space->dbits)
7777 osd_die("cpu #%d uses wrong %d-bit handlers for address space %d (should be %d-bit)!\n", cpunum, val, spacenum, space->dbits);
7783 if (flags & 0x00000002)
7785 space->rawmask = 0xffffffffUL >> (32 - ((flags & (0x3f << 12)) >> 12));
7786 space->mask = (((space)->ashift < 0) ? (((space->rawmask) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((space->rawmask) >> (space)->ashift));
7790 if (flags & 0x00000008)
7791 space->unmap = ((flags & (1 << 21)) == 0) ? (UINT64)0 : (UINT64)-1;
7800 if (((FPTR)(map->read.handler) >= 1 && (FPTR)(map->read.handler) <= (68 - 1)))
7801 bank = ((FPTR)(map->read.handler));
7802 else if (((FPTR)(map->write.handler) >= 1 && (FPTR)(map->write.handler) <= (68 - 1)))
7803 bank = ((FPTR)(map->write.handler));
7806 if (bank >= 1 && bank <= 32)
7808 bank_data *bdata = &bankdata[bank];
7812 state_save_register_UINT8("memory", bank, "bank.entry", &bdata->curentry, 1);
7816 bdata->cpunum = cpunum;
7817 bdata->spacenum = spacenum;
7818 if (bank == ((FPTR)(map->read.handler)))
7820 if (bank == ((FPTR)(map->write.handler)))
7822 bdata->base = map->start;
7823 bdata->end = map->end;
7824 bdata->curentry = 64;
7830 for (entrynum = 0; entrynum < ((256-64)); entrynum++)
7832 space->read.handlers[entrynum].mask &= space->mask;
7833 space->write.handlers[entrynum].mask &= space->mask;
7846 static int populate_memory(void)
7848 int cpunum, spacenum;
7851 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
7852 for (spacenum = 0; spacenum < 3; spacenum++)
7853 if (cpudata[cpunum].spacemask & (1 << spacenum))
7855 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7856 const address_map *map;
7862 for (map = space->map; !(((map)->flags & 0x04) != 0); map++) ;
7865 for (map--; map >= space->map; map--)
7866 if (!(((map)->flags & 0x01) != 0))
7868 int ismatchmask = ((map->flags & 0x02) != 0);
7869 int isfixed = (map->memory != ((void *)0)) || (map->share != 0);
7870 if (map->read.handler)
7871 install_mem_handler(space, 0, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->read.handler, isfixed, map->read_name);
7872 if (map->write.handler)
7873 install_mem_handler(space, 1, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->write.handler, isfixed, map->write_name);
7887 static void install_mem_handler(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name)
7889 offs_t lmirrorbit[18], lmirrorbits, hmirrorbit[(32 - 18)], hmirrorbits, lmirrorcount, hmirrorcount;
7890 table_data *tabledata = iswrite ? &space->write : &space->read;
7891 UINT8 idx, prev_entry = 0;
7892 int cur_index, prev_index = 0;
7893 offs_t original_mask = mask;
7897 if (space->dbits != databits)
7898 osd_die("fatal: install_mem_handler called with a %d-bit handler for a %d-bit address space\n", databits, space->dbits);
7900 osd_die("fatal: install_mem_handler called with start greater than end\n");
7903 if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1)))
7905 bank_data *bdata = &bankdata[((FPTR)(handler))];
7912 bdata->cpunum = space->cpunum;
7913 bdata->spacenum = space->spacenum;
7914 bdata->base = start;
7916 bdata->curentry = 64;
7919 if (state_save_registration_allowed())
7920 state_save_register_UINT8("memory", ((FPTR)(handler)), "bank.entry", &bdata->curentry, 1);
7927 adjust_addresses(space, ismatchmask, &start, &end, &mask, &mirror);
7930 if (((FPTR)(handler) == 69))
7931 handler = iswrite ? (genf *)71 : (genf *)((read8_handler)68);
7934 if (((FPTR)(handler) == 68))
7936 handler = (genf *)assign_dynamic_bank(space->cpunum, space->spacenum, start, end, mirror, isfixed, original_mask != 0);
7937 if (!bank_ptr[((FPTR)(handler))])
7938 bank_ptr[((FPTR)(handler))] = memory_find_base(space->cpunum, space->spacenum, iswrite, start);
7942 if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1)))
7944 bank_data *bdata = &bankdata[((FPTR)(handler))];
7954 hmirrorbits = lmirrorbits = 0;
7955 for (i = 0; i < (32 - 18); i++)
7956 if (mirror & (1 << i))
7957 lmirrorbit[lmirrorbits++] = 1 << i;
7958 for (i = (32 - 18); i < 32; i++)
7959 if (mirror & (1 << i))
7960 hmirrorbit[hmirrorbits++] = 1 << i;
7963 idx = get_handler_index(tabledata->handlers, handler, handler_name, start, end, mask);
7966 for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++)
7969 offs_t hmirrorbase = 0;
7970 for (i = 0; i < hmirrorbits; i++)
7971 if (hmirrorcount & (1 << i))
7972 hmirrorbase |= hmirrorbit[i];
7977 cur_index = ((start + hmirrorbase) >> (32 - 18));
7978 if (cur_index == ((end + hmirrorbase) >> (32 - 18)))
7980 if (hmirrorcount != 0 && prev_entry == tabledata->table[cur_index])
7985 if (tabledata->table[cur_index] >= (256-64))
7986 release_subtable(tabledata, tabledata->table[cur_index]);
7989 if (tabledata->table[prev_index] >= (256-64))
7990 reallocate_subtable(tabledata, tabledata->table[prev_index]);
7993 tabledata->table[cur_index] = tabledata->table[prev_index];
7996 prev_index = cur_index;
7997 prev_entry = tabledata->table[cur_index];
8001 for (lmirrorcount = 0; lmirrorcount < (1 << lmirrorbits); lmirrorcount++)
8004 offs_t lmirrorbase = hmirrorbase;
8005 for (i = 0; i < lmirrorbits; i++)
8006 if (lmirrorcount & (1 << i))
8007 lmirrorbase |= lmirrorbit[i];
8011 populate_table_range(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx);
8013 populate_table_match(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx);
8018 if (space->cpunum == cur_context)
8019 memory_set_context(cur_context);
8028 static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked)
8033 for (bank = 66; bank >= 1; bank--)
8034 if (!bankdata[bank].used || (bankdata[bank].dynamic && bankdata[bank].cpunum == cpunum && bankdata[bank].spacenum == spacenum && bankdata[bank].base == start))
8036 bankdata[bank].used = 1;
8037 bankdata[bank].dynamic = 1;
8038 bankdata[bank].cpunum = cpunum;
8039 bankdata[bank].spacenum = spacenum;
8040 bankdata[bank].base = start;
8041 bankdata[bank].end = end;
8043 return ((genf *)(bank));
8047 osd_die("cpu #%d: ran out of banks for RAM/ROM regions!\n", cpunum);
8057 static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask)
8064 if (((FPTR)(handler) < 72))
8067 if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1)))
8069 table[i].offset = start;
8071 table[i].mask = mask;
8072 table[i].name = handler_name;
8078 for (i = 72; i < (256-64); i++)
8080 if (table[i].handler.generic == ((void *)0))
8082 table[i].handler.generic = handler;
8083 table[i].offset = start;
8085 table[i].mask = mask;
8086 table[i].name = handler_name;
8089 if (table[i].handler.generic == handler && table[i].offset == start && table[i].mask == mask)
8101 static void populate_table_range(addrspace_data *space, int iswrite, offs_t start, offs_t stop, UINT8 handler)
8103 table_data *tabledata = iswrite ? &space->write : &space->read;
8104 offs_t l2mask = (1 << (32 - 18)) - 1;
8105 offs_t l1start = start >> (32 - 18);
8106 offs_t l2start = start & l2mask;
8107 offs_t l1stop = stop >> (32 - 18);
8108 offs_t l2stop = stop & l2mask;
8118 UINT8 *subtable = open_subtable(tabledata, l1start);
8121 if (l1start == l1stop)
8123 memset(&subtable[l2start], handler, l2stop - l2start + 1);
8124 close_subtable(tabledata, l1start);
8129 memset(&subtable[l2start], handler, (1 << (32 - 18)) - l2start);
8130 close_subtable(tabledata, l1start);
8131 if (l1start != (offs_t)~0) l1start++;
8135 if (l2stop != l2mask)
8137 UINT8 *subtable = open_subtable(tabledata, l1stop);
8140 memset(&subtable[0], handler, l2stop + 1);
8141 close_subtable(tabledata, l1stop);
8144 if (l1start == l1stop)
8146 if (l1stop != 0) l1stop--;
8150 for (l1index = l1start; l1index <= l1stop; l1index++)
8153 if (tabledata->table[l1index] >= (256-64))
8154 release_subtable(tabledata, tabledata->table[l1index]);
8155 tabledata->table[l1index] = handler;
8165 static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler)
8167 table_data *tabledata = iswrite ? &space->write : &space->read;
8168 int lowermask, lowermatch;
8169 int uppermask, uppermatch;
8170 int l1index, l2index;
8173 matchval &= matchmask;
8176 lowermask = matchmask & ((1<<(32 - 18))-1);
8177 lowermatch = matchval & ((1<<(32 - 18))-1);
8180 uppermask = matchmask >> (32 - 18);
8181 uppermatch = matchval >> (32 - 18);
8187 for (l1index = 0; l1index <= (space->mask >> (32 - 18)); l1index++)
8188 if ((l1index & uppermatch) == uppermask)
8191 if (tabledata->table[l1index] >= (256-64))
8192 release_subtable(tabledata, tabledata->table[l1index]);
8193 tabledata->table[l1index] = handler;
8201 for (l1index = 0; l1index <= (space->mask >> (32 - 18)); l1index++)
8202 if ((l1index & uppermatch) == uppermask)
8204 UINT8 *subtable = open_subtable(tabledata, l1index);
8207 for (l2index = 0; l2index < (1 << (32 - 18)); l2index++)
8208 if ((l2index & lowermask) == lowermatch)
8209 subtable[l2index] = handler;
8210 close_subtable(tabledata, l1index);
8221 static UINT8 allocate_subtable(table_data *tabledata)
8229 for (subindex = 0; subindex < 64; subindex++)
8230 if (tabledata->subtable[subindex].usecount == 0)
8233 if (subindex >= tabledata->subtable_alloc)
8235 tabledata->subtable_alloc += 8;
8236 tabledata->table = realloc(tabledata->table, (1 << 18) + (tabledata->subtable_alloc << (32 - 18)));
8237 if (!tabledata->table)
8238 osd_die("error: ran out of memory allocating memory subtable\n");
8242 tabledata->subtable[subindex].usecount++;
8243 return subindex + (256-64);
8247 if (!merge_subtables(tabledata))
8248 osd_die("Ran out of subtables!\n");
8261 static void reallocate_subtable(table_data *tabledata, UINT8 subentry)
8263 UINT8 subindex = subentry - (256-64);
8266 if (tabledata->subtable[subindex].usecount <= 0)
8267 osd_die("Called reallocate_subtable on a table with a usecount of 0\n");
8270 tabledata->subtable[subindex].usecount++;
8279 static int merge_subtables(table_data *tabledata)
8287 for (subindex = 0; subindex < 64; subindex++)
8288 if (!tabledata->subtable[subindex].checksum_valid && tabledata->subtable[subindex].usecount != 0)
8290 UINT32 *subtable = (UINT32 *)(&(tabledata)->table[(1 << 18) + (((subindex + (256-64)) - (256-64)) << (32 - 18))]);
8291 UINT32 checksum = 0;
8295 for (l2index = 0; l2index < (1 << (32 - 18))/4; l2index++)
8296 checksum += subtable[l2index];
8297 tabledata->subtable[subindex].checksum = checksum;
8298 tabledata->subtable[subindex].checksum_valid = 1;
8302 for (subindex = 0; subindex < 64; subindex++)
8303 if (tabledata->subtable[subindex].usecount != 0)
8305 UINT8 *subtable = (&(tabledata)->table[(1 << 18) + (((subindex + (256-64)) - (256-64)) << (32 - 18))]);
8306 UINT32 checksum = tabledata->subtable[subindex].checksum;
8309 for (sumindex = subindex + 1; sumindex < 64; sumindex++)
8310 if (tabledata->subtable[sumindex].usecount != 0 &&
8311 tabledata->subtable[sumindex].checksum == checksum &&
8312 !memcmp(subtable, (&(tabledata)->table[(1 << 18) + (((sumindex + (256-64)) - (256-64)) << (32 - 18))]), 1 << (32 - 18)))
8319 for (l1index = 0; l1index <= (0xffffffffUL >> (32 - 18)); l1index++)
8320 if (tabledata->table[l1index] == sumindex + (256-64))
8322 release_subtable(tabledata, sumindex + (256-64));
8323 reallocate_subtable(tabledata, subindex + (256-64));
8324 tabledata->table[l1index] = subindex + (256-64);
8339 static void release_subtable(table_data *tabledata, UINT8 subentry)
8341 UINT8 subindex = subentry - (256-64);
8344 if (tabledata->subtable[subindex].usecount <= 0)
8345 osd_die("Called release_subtable on a table with a usecount of 0\n");
8348 tabledata->subtable[subindex].usecount--;
8349 if (tabledata->subtable[subindex].usecount == 0)
8350 tabledata->subtable[subindex].checksum = 0;
8359 static UINT8 *open_subtable(table_data *tabledata, offs_t l1index)
8361 UINT8 subentry = tabledata->table[l1index];
8364 if (subentry < (256-64))
8366 UINT8 newentry = allocate_subtable(tabledata);
8367 memset((&(tabledata)->table[(1 << 18) + (((newentry) - (256-64)) << (32 - 18))]), subentry, 1 << (32 - 18));
8368 tabledata->table[l1index] = newentry;
8369 tabledata->subtable[newentry - (256-64)].checksum = (subentry + (subentry << 8) + (subentry << 16) + (subentry << 24)) * ((1 << (32 - 18))/4);
8370 subentry = newentry;
8374 else if (tabledata->subtable[subentry - (256-64)].usecount > 1)
8376 UINT8 newentry = allocate_subtable(tabledata);
8377 memcpy((&(tabledata)->table[(1 << 18) + (((newentry) - (256-64)) << (32 - 18))]), (&(tabledata)->table[(1 << 18) + (((subentry) - (256-64)) << (32 - 18))]), 1 << (32 - 18));
8378 release_subtable(tabledata, subentry);
8379 tabledata->table[l1index] = newentry;
8380 tabledata->subtable[newentry - (256-64)].checksum = tabledata->subtable[subentry - (256-64)].checksum;
8381 subentry = newentry;
8385 tabledata->subtable[subentry - (256-64)].checksum_valid = 0;
8388 return (&(tabledata)->table[(1 << 18) + (((subentry) - (256-64)) << (32 - 18))]);
8396 static void close_subtable(table_data *tabledata, offs_t l1index)
8407 static int amentry_needs_backing_store(int cpunum, int spacenum, const address_map *map)
8411 if ((((map)->flags & 0x01) != 0))
8416 handler = (int)map->write.handler;
8417 if (handler >= 0 && handler < 72)
8426 handler = (int)map->read.handler;
8427 if (handler >= 0 && handler < 72)
8430 (handler < 1 || handler > 1 + 66 - 1) &&
8431 (handler != 69 || spacenum != 0 || map->start >= memory_region_length(REGION_CPU1 + cpunum)) &&
8446 static int allocate_memory(void)
8448 int cpunum, spacenum;
8451 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
8452 for (spacenum = 0; spacenum < 3; spacenum++)
8453 if (cpudata[cpunum].spacemask & (1 << spacenum))
8455 addrspace_data *space = &cpudata[cpunum].space[spacenum];
8456 address_map *map, *unassigned = ((void *)0);
8457 int start_count = memory_block_count;
8462 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8463 if (!(((map)->flags & 0x01) != 0) && map->memory)
8465 if (!(((map)->flags & 0x02) != 0))
8466 allocate_memory_block(cpunum, spacenum, map->start, map->end, map->memory);
8468 allocate_memory_block(cpunum, spacenum, map->start, map->start + map->mask, map->memory);
8472 for (i = start_count; i < memory_block_count; i++)
8473 unassigned = assign_intersecting_blocks(space, memory_block_list[i].start, memory_block_list[i].end, memory_block_list[i].data);
8477 unassigned = assign_intersecting_blocks(space, ~0, 0, ((void *)0));
8482 offs_t curstart, curend;
8487 curstart = unassigned->start / 65536;
8488 if (!(((unassigned)->flags & 0x02) != 0))
8489 curend = unassigned->end / 65536;
8491 curend = (unassigned->start + unassigned->mask) / 65536;
8499 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8500 if (!(((map)->flags & 0x01) != 0) && !map->memory && map != unassigned && amentry_needs_backing_store(cpunum, spacenum, map))
8502 offs_t blockstart, blockend;
8505 blockstart = map->start / 65536;
8506 if (!(((map)->flags & 0x02) != 0))
8507 blockend = map->end / 65536;
8509 blockend = (map->start + map->mask) / 65536;
8512 if (blockstart <= curend + 1 && blockend >= curstart - 1)
8514 if (blockstart < curstart)
8515 curstart = blockstart, changed = 1;
8516 if (blockend > curend)
8517 curend = blockend, changed = 1;
8523 curstart = curstart * 65536;
8524 curend = curend * 65536 + (65536 - 1);
8525 block = allocate_memory_block(cpunum, spacenum, curstart, curend, ((void *)0));
8528 unassigned = assign_intersecting_blocks(space, curstart, curend, block);
8541 static void *allocate_memory_block(int cpunum, int spacenum, offs_t start, offs_t end, void *memory)
8543 memory_block *block = &memory_block_list[memory_block_count];
8544 int allocatemem = (memory == ((void *)0));
8551 memory = auto_malloc(end - start + 1);
8552 memset(memory, 0, end - start + 1);
8556 register_for_save(cpunum, spacenum, start, memory, end - start + 1);
8559 block->cpunum = cpunum;
8560 block->spacenum = spacenum;
8561 block->isallocated = allocatemem;
8562 block->start = start;
8564 block->data = memory;
8565 memory_block_count++;
8575 static void register_for_save(int cpunum, int spacenum, offs_t start, void *base, size_t numbytes)
8579 sprintf(name, "%d.%08x-%08x", spacenum, start, (int)(start + numbytes - 1));
8580 switch (cpudata[cpunum].space[spacenum].dbits)
8583 state_save_register_UINT8 ("memory", cpunum, name, base, numbytes);
8586 state_save_register_UINT16("memory", cpunum, name, base, numbytes/2);
8589 state_save_register_UINT32("memory", cpunum, name, base, numbytes/4);
8592 state_save_register_UINT64("memory", cpunum, name, base, numbytes/8);
8603 static address_map *assign_intersecting_blocks(addrspace_data *space, offs_t start, offs_t end, UINT8 *base)
8605 address_map *map, *unassigned = ((void *)0);
8608 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8609 if (!(((map)->flags & 0x01) != 0))
8615 if (map->share && shared_ptr[map->share])
8617 map->memory = shared_ptr[map->share];
8624 if (!(((map)->flags & 0x02) != 0))
8626 if (map->start >= start && map->end <= end)
8628 map->memory = base + (map->start - start);
8634 if (map->start >= start && map->start + map->mask <= end)
8636 map->memory = base + (map->start - start);
8644 if (map->memory && map->share && !shared_ptr[map->share])
8645 shared_ptr[map->share] = map->memory;
8648 if (!map->memory && !unassigned && amentry_needs_backing_store(space->cpunum, space->spacenum, map))
8660 static void reattach_banks(void)
8665 for (banknum = 1; banknum <= 66; banknum++)
8666 if (bankdata[banknum].used && !bankdata[banknum].dynamic)
8669 if (bankdata[banknum].curentry != 64)
8670 bank_ptr[banknum] = bankdata[banknum].entry[bankdata[banknum].curentry];
8680 static int find_memory(void)
8682 int cpunum, spacenum, banknum;
8685 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
8686 for (spacenum = 0; spacenum < 3; spacenum++)
8687 if (cpudata[cpunum].spacemask & (1 << spacenum))
8689 addrspace_data *space = &cpudata[cpunum].space[spacenum];
8690 const address_map *map;
8693 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8694 if (!(((map)->flags & 0x01) != 0))
8697 if (map->base) *map->base = map->memory;
8700 if (!(((map)->flags & 0x02) != 0))
8701 *map->size = map->end - map->start + 1;
8703 *map->size = map->mask + 1;
8709 for (banknum = 1; banknum <= 66; banknum++)
8710 if (bankdata[banknum].used)
8715 for (map = cpudata[bankdata[banknum].cpunum].space[bankdata[banknum].spacenum].adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8716 if (!(((map)->flags & 0x01) != 0) && map->start == bankdata[banknum].base)
8718 bank_ptr[banknum] = map->memory;
8724 if (!bankdata[banknum].dynamic && bankdata[banknum].curentry != 64)
8725 bank_ptr[banknum] = bankdata[banknum].entry[bankdata[banknum].curentry];
8729 state_save_register_func_postload(reattach_banks);
8733 # 2281 "src/memory.c"
8734 static void *memory_find_base(int cpunum, int spacenum, int readwrite, offs_t offset)
8736 addrspace_data *space = &cpudata[cpunum].space[spacenum];
8738 memory_block *block;
8744 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8745 if (!(((map)->flags & 0x01) != 0))
8747 offs_t maskoffs = offset & map->mask;
8748 if (!(((map)->flags & 0x02) != 0))
8750 if (maskoffs >= map->start && maskoffs <= map->end)
8753 return (UINT8 *)map->memory + (maskoffs - map->start);
8758 if ((maskoffs & map->end) == map->start)
8761 return (UINT8 *)map->memory + (maskoffs - map->start);
8767 for (blocknum = 0, block = memory_block_list; blocknum < memory_block_count; blocknum++, block++)
8768 if (block->cpunum == cpunum && block->spacenum == spacenum && block->start <= offset && block->end > offset)
8771 return block->data + offset - block->start;
8777 # 2695 "src/memory.c"
8778 UINT8 program_read_byte_8(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler8)(address); } while (0); return 0; }
8779 void program_write_byte_8(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler8)(address, data)); ; return; } while (0);}
8781 UINT8 program_read_byte_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 1)]; } while (0); else { int shift = 8 * (~address & 1); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8782 UINT16 program_read_word_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8783 void program_write_byte_16be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 1)] = data); ; return; } while (0); else { int shift = 8 * (~address & 1); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8784 void program_write_word_16be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8786 UINT8 program_read_byte_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 1); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8787 UINT16 program_read_word_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8788 void program_write_byte_16le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 1); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8789 void program_write_word_16le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8791 UINT8 program_read_byte_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 3)]; } while (0); else { int shift = 8 * (~address & 3); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8792 UINT16 program_read_word_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 2)]; } while (0); else { int shift = 8 * (~address & 2); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8793 UINT32 program_read_dword_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8794 void program_write_byte_32be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 3)] = data); ; return; } while (0); else { int shift = 8 * (~address & 3); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8795 void program_write_word_32be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 2)] = data); ; return; } while (0); else { int shift = 8 * (~address & 2); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8796 void program_write_dword_32be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8798 UINT8 program_read_byte_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 3); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8799 UINT16 program_read_word_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 2); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8800 UINT32 program_read_dword_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8801 void program_write_byte_32le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 3); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8802 void program_write_word_32le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 2); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8803 void program_write_dword_32le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8805 UINT8 program_read_byte_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 7)]; } while (0); else { int shift = 8 * (~address & 7); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8806 UINT16 program_read_word_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 6)]; } while (0); else { int shift = 8 * (~address & 6); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8807 UINT32 program_read_dword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][((address) ^ 4)]; } while (0); else { int shift = 8 * (~address & 4); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8808 UINT64 program_read_qword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8809 void program_write_byte_64be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 7)] = data); ; return; } while (0); else { int shift = 8 * (~address & 7); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8810 void program_write_word_64be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 6)] = data); ; return; } while (0); else { int shift = 8 * (~address & 6); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8811 void program_write_dword_64be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][((address) ^ 4)] = data); ; return; } while (0); else { int shift = 8 * (~address & 4); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8812 void program_write_qword_64be(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8814 UINT8 program_read_byte_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 7); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8815 UINT16 program_read_word_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 6); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8816 UINT32 program_read_dword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 4); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8817 UINT64 program_read_qword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8818 void program_write_byte_64le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 7); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8819 void program_write_word_64le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 6); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8820 void program_write_dword_64le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 4); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8821 void program_write_qword_64le(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8828 UINT8 data_read_byte_8(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler8)(address); } while (0); return 0; }
8829 void data_write_byte_8(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler8)(address, data)); ; return; } while (0);}
8831 UINT8 data_read_byte_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 1)]; } while (0); else { int shift = 8 * (~address & 1); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8832 UINT16 data_read_word_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8833 void data_write_byte_16be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 1)] = data); ; return; } while (0); else { int shift = 8 * (~address & 1); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8834 void data_write_word_16be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8836 UINT8 data_read_byte_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 1); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8837 UINT16 data_read_word_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8838 void data_write_byte_16le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 1); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8839 void data_write_word_16le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8841 UINT8 data_read_byte_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 3)]; } while (0); else { int shift = 8 * (~address & 3); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8842 UINT16 data_read_word_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 2)]; } while (0); else { int shift = 8 * (~address & 2); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8843 UINT32 data_read_dword_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8844 void data_write_byte_32be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 3)] = data); ; return; } while (0); else { int shift = 8 * (~address & 3); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8845 void data_write_word_32be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 2)] = data); ; return; } while (0); else { int shift = 8 * (~address & 2); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8846 void data_write_dword_32be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8848 UINT8 data_read_byte_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 3); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8849 UINT16 data_read_word_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 2); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8850 UINT32 data_read_dword_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8851 void data_write_byte_32le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 3); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8852 void data_write_word_32le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 2); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8853 void data_write_dword_32le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8855 UINT8 data_read_byte_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 7)]; } while (0); else { int shift = 8 * (~address & 7); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8856 UINT16 data_read_word_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 6)]; } while (0); else { int shift = 8 * (~address & 6); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8857 UINT32 data_read_dword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][((address) ^ 4)]; } while (0); else { int shift = 8 * (~address & 4); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8858 UINT64 data_read_qword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8859 void data_write_byte_64be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 7)] = data); ; return; } while (0); else { int shift = 8 * (~address & 7); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8860 void data_write_word_64be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 6)] = data); ; return; } while (0); else { int shift = 8 * (~address & 6); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8861 void data_write_dword_64be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][((address) ^ 4)] = data); ; return; } while (0); else { int shift = 8 * (~address & 4); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8862 void data_write_qword_64be(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8864 UINT8 data_read_byte_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 7); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8865 UINT16 data_read_word_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 6); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8866 UINT32 data_read_dword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 4); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8867 UINT64 data_read_qword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8868 void data_write_byte_64le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 7); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8869 void data_write_word_64le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 6); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8870 void data_write_dword_64le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 4); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8871 void data_write_qword_64le(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8878 UINT8 io_read_byte_8(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler8)(address); } while (0); return 0; }
8879 void io_write_byte_8(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler8)(address, data)); ; return; } while (0);}
8881 UINT8 io_read_byte_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 1)]; } while (0); else { int shift = 8 * (~address & 1); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8882 UINT16 io_read_word_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8883 void io_write_byte_16be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 1)] = data); ; return; } while (0); else { int shift = 8 * (~address & 1); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8884 void io_write_word_16be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8886 UINT8 io_read_byte_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 1); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8887 UINT16 io_read_word_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8888 void io_write_byte_16le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 1); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8889 void io_write_word_16le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8891 UINT8 io_read_byte_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 3)]; } while (0); else { int shift = 8 * (~address & 3); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8892 UINT16 io_read_word_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 2)]; } while (0); else { int shift = 8 * (~address & 2); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8893 UINT32 io_read_dword_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8894 void io_write_byte_32be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 3)] = data); ; return; } while (0); else { int shift = 8 * (~address & 3); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8895 void io_write_word_32be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 2)] = data); ; return; } while (0); else { int shift = 8 * (~address & 2); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8896 void io_write_dword_32be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8898 UINT8 io_read_byte_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 3); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8899 UINT16 io_read_word_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 2); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8900 UINT32 io_read_dword_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8901 void io_write_byte_32le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 3); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8902 void io_write_word_32le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 2); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8903 void io_write_dword_32le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8905 UINT8 io_read_byte_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 7)]; } while (0); else { int shift = 8 * (~address & 7); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8906 UINT16 io_read_word_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 6)]; } while (0); else { int shift = 8 * (~address & 6); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8907 UINT32 io_read_dword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][((address) ^ 4)]; } while (0); else { int shift = 8 * (~address & 4); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8908 UINT64 io_read_qword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8909 void io_write_byte_64be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 7)] = data); ; return; } while (0); else { int shift = 8 * (~address & 7); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8910 void io_write_word_64be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 6)] = data); ; return; } while (0); else { int shift = 8 * (~address & 6); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8911 void io_write_dword_64be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][((address) ^ 4)] = data); ; return; } while (0); else { int shift = 8 * (~address & 4); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8912 void io_write_qword_64be(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8914 UINT8 io_read_byte_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 7); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8915 UINT16 io_read_word_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 6); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8916 UINT32 io_read_dword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 4); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8917 UINT64 io_read_qword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8918 void io_write_byte_64le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 7); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8919 void io_write_word_64le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 6); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8920 void io_write_dword_64le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 4); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8921 void io_write_qword_64le(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8928 UINT8 cpu_readop_safe(offs_t offset)
8930 activecpu_set_opbase(offset);
8931 return (opcode_base[(offset) & opcode_mask]);
8934 UINT16 cpu_readop16_safe(offs_t offset)
8936 activecpu_set_opbase(offset);
8937 return (*(UINT16 *)&opcode_base[(offset) & opcode_mask]);
8940 UINT32 cpu_readop32_safe(offs_t offset)
8942 activecpu_set_opbase(offset);
8943 return (*(UINT32 *)&opcode_base[(offset) & opcode_mask]);
8946 UINT64 cpu_readop64_safe(offs_t offset)
8948 activecpu_set_opbase(offset);
8949 return (*(UINT64 *)&opcode_base[(offset) & opcode_mask]);
8952 UINT8 cpu_readop_arg_safe(offs_t offset)
8954 activecpu_set_opbase(offset);
8955 return (opcode_arg_base[(offset) & opcode_mask]);
8958 UINT16 cpu_readop_arg16_safe(offs_t offset)
8960 activecpu_set_opbase(offset);
8961 return (*(UINT16 *)&opcode_arg_base[(offset) & opcode_mask]);
8964 UINT32 cpu_readop_arg32_safe(offs_t offset)
8966 activecpu_set_opbase(offset);
8967 return (*(UINT32 *)&opcode_arg_base[(offset) & opcode_mask]);
8970 UINT64 cpu_readop_arg64_safe(offs_t offset)
8972 activecpu_set_opbase(offset);
8973 return (*(UINT64 *)&opcode_arg_base[(offset) & opcode_mask]);
8981 static UINT8 mrh8_unmap_program(__attribute__((__unused__)) offs_t offset)
8983 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte read from %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)));
8984 return cpudata[cpu_getactivecpu()].space[0].unmap;
8986 static UINT16 mrh16_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask)
8988 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word read from %08X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), mem_mask ^ 0xffff);
8989 return cpudata[cpu_getactivecpu()].space[0].unmap;
8991 static UINT32 mrh32_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask)
8993 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword read from %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), mem_mask ^ 0xffffffff);
8994 return cpudata[cpu_getactivecpu()].space[0].unmap;
8996 static UINT64 mrh64_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask)
8998 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
8999 return cpudata[cpu_getactivecpu()].space[0].unmap;
9002 static void mwh8_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data)
9004 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte write to %08X = %02X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), data);
9006 static void mwh16_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask)
9008 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), data, mem_mask ^ 0xffff);
9010 static void mwh32_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask)
9012 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), data, mem_mask ^ 0xffffffff);
9014 static void mwh64_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask)
9016 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9019 static UINT8 mrh8_unmap_data(__attribute__((__unused__)) offs_t offset)
9021 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte read from %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)));
9022 return cpudata[cpu_getactivecpu()].space[1].unmap;
9024 static UINT16 mrh16_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask)
9026 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word read from %08X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), mem_mask ^ 0xffff);
9027 return cpudata[cpu_getactivecpu()].space[1].unmap;
9029 static UINT32 mrh32_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask)
9031 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword read from %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), mem_mask ^ 0xffffffff);
9032 return cpudata[cpu_getactivecpu()].space[1].unmap;
9034 static UINT64 mrh64_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask)
9036 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9037 return cpudata[cpu_getactivecpu()].space[1].unmap;
9040 static void mwh8_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data)
9042 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte write to %08X = %02X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), data);
9044 static void mwh16_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask)
9046 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), data, mem_mask ^ 0xffff);
9048 static void mwh32_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask)
9050 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), data, mem_mask ^ 0xffffffff);
9052 static void mwh64_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask)
9054 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9057 static UINT8 mrh8_unmap_io(__attribute__((__unused__)) offs_t offset)
9059 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte read from %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)));
9060 return cpudata[cpu_getactivecpu()].space[2].unmap;
9062 static UINT16 mrh16_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask)
9064 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word read from %08X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), mem_mask ^ 0xffff);
9065 return cpudata[cpu_getactivecpu()].space[2].unmap;
9067 static UINT32 mrh32_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask)
9069 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword read from %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), mem_mask ^ 0xffffffff);
9070 return cpudata[cpu_getactivecpu()].space[2].unmap;
9072 static UINT64 mrh64_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask)
9074 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword read from %08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9075 return cpudata[cpu_getactivecpu()].space[2].unmap;
9078 static void mwh8_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data)
9080 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte write to %08X = %02X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), data);
9082 static void mwh16_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask)
9084 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word write to %08X = %04X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), data, mem_mask ^ 0xffff);
9086 static void mwh32_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask)
9088 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), data, mem_mask ^ 0xffffffff);
9090 static void mwh64_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask)
9092 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9100 static UINT8 mrh8_nop_program(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9101 static UINT16 mrh16_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9102 static UINT32 mrh32_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9103 static UINT64 mrh64_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9105 static UINT8 mrh8_nop_data(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9106 static UINT16 mrh16_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9107 static UINT32 mrh32_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9108 static UINT64 mrh64_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9110 static UINT8 mrh8_nop_io(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9111 static UINT16 mrh16_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9112 static UINT32 mrh32_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9113 static UINT64 mrh64_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9115 static void mwh8_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data) { }
9116 static void mwh16_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask) { }
9117 static void mwh32_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask) { }
9118 static void mwh64_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask) { }
9126 static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which)
9135 } static_handler_list[] =
9137 { 8, 71, 0, (genf *)mrh8_unmap_program, (genf *)mwh8_unmap_program },
9138 { 8, 71, 1, (genf *)mrh8_unmap_data, (genf *)mwh8_unmap_data },
9139 { 8, 71, 2, (genf *)mrh8_unmap_io, (genf *)mwh8_unmap_io },
9140 { 8, 70, 0, (genf *)mrh8_nop_program, (genf *)mwh8_nop },
9141 { 8, 70, 1, (genf *)mrh8_nop_data, (genf *)mwh8_nop },
9142 { 8, 70, 2, (genf *)mrh8_nop_io, (genf *)mwh8_nop },
9144 { 16, 71, 0, (genf *)mrh16_unmap_program,(genf *)mwh16_unmap_program },
9145 { 16, 71, 1, (genf *)mrh16_unmap_data, (genf *)mwh16_unmap_data },
9146 { 16, 71, 2, (genf *)mrh16_unmap_io, (genf *)mwh16_unmap_io },
9147 { 16, 70, 0, (genf *)mrh16_nop_program, (genf *)mwh16_nop },
9148 { 16, 70, 1, (genf *)mrh16_nop_data, (genf *)mwh16_nop },
9149 { 16, 70, 2, (genf *)mrh16_nop_io, (genf *)mwh16_nop },
9151 { 32, 71, 0, (genf *)mrh32_unmap_program,(genf *)mwh32_unmap_program },
9152 { 32, 71, 1, (genf *)mrh32_unmap_data, (genf *)mwh32_unmap_data },
9153 { 32, 71, 2, (genf *)mrh32_unmap_io, (genf *)mwh32_unmap_io },
9154 { 32, 70, 0, (genf *)mrh32_nop_program, (genf *)mwh32_nop },
9155 { 32, 70, 1, (genf *)mrh32_nop_data, (genf *)mwh32_nop },
9156 { 32, 70, 2, (genf *)mrh32_nop_io, (genf *)mwh32_nop },
9158 { 64, 71, 0, (genf *)mrh64_unmap_program,(genf *)mwh64_unmap_program },
9159 { 64, 71, 1, (genf *)mrh64_unmap_data, (genf *)mwh64_unmap_data },
9160 { 64, 71, 2, (genf *)mrh64_unmap_io, (genf *)mwh64_unmap_io },
9161 { 64, 70, 0, (genf *)mrh64_nop_program, (genf *)mwh64_nop },
9162 { 64, 70, 1, (genf *)mrh64_nop_data, (genf *)mwh64_nop },
9163 { 64, 70, 2, (genf *)mrh64_nop_io, (genf *)mwh64_nop },
9167 for (tablenum = 0; tablenum < sizeof(static_handler_list) / sizeof(static_handler_list[0]); tablenum++)
9168 if (static_handler_list[tablenum].databits == databits && static_handler_list[tablenum].handlernum == which)
9169 if (static_handler_list[tablenum].spacenum == 0xff || static_handler_list[tablenum].spacenum == spacenum)
9170 return readorwrite ? static_handler_list[tablenum].write : static_handler_list[tablenum].read;
9180 static const char *handler_to_string(const table_data *table, UINT8 entry)
9182 static const char *strings[] =
9184 "invalid", "bank 1", "bank 2", "bank 3",
9185 "bank 4", "bank 5", "bank 6", "bank 7",
9186 "bank 8", "bank 9", "bank 10", "bank 11",
9187 "bank 12", "bank 13", "bank 14", "bank 15",
9188 "bank 16", "bank 17", "bank 18", "bank 19",
9189 "bank 20", "bank 21", "bank 22", "bank 23",
9190 "bank 24", "bank 25", "bank 26", "bank 27",
9191 "bank 28", "bank 29", "bank 30", "bank 31",
9192 "bank 32", "ram[33]", "ram[34]", "ram[35]",
9193 "ram[36]", "ram[37]", "ram[38]", "ram[39]",
9194 "ram[40]", "ram[41]", "ram[42]", "ram[43]",
9195 "ram[44]", "ram[45]", "ram[46]", "ram[47]",
9196 "ram[48]", "ram[49]", "ram[50]", "ram[51]",
9197 "ram[52]", "ram[53]", "ram[54]", "ram[55]",
9198 "ram[56]", "ram[57]", "ram[58]", "ram[59]",
9199 "ram[60]", "ram[61]", "ram[62]", "ram[63]",
9200 "ram[64]", "ram[65]", "ram[66]", "ram[67]",
9201 "ram[68]", "rom", "nop", "unmapped"
9206 return strings[entry];
9208 return table->handlers[entry].name ? table->handlers[entry].name : "???";
9211 static void dump_map(FILE *file, const addrspace_data *space, const table_data *table)
9213 int l1count = 1 << 18;
9214 int l2count = 1 << (32 - 18);
9215 UINT8 lastentry = 71;
9216 int entrymatches = 0;
9220 fprintf(file, " Address bits = %d\n", space->abits);
9221 fprintf(file, " Data bits = %d\n", space->dbits);
9222 fprintf(file, " L1 bits = %d\n", 18);
9223 fprintf(file, " L2 bits = %d\n", (32 - 18));
9224 fprintf(file, " Address mask = %X\n", space->mask);
9225 fprintf(file, "\n");
9228 for (i = 0; i < l1count; i++)
9230 UINT8 entry = table->table[i];
9233 if (entry < (256-64) && entry == lastentry)
9240 if (lastentry < (256-64) && lastentry != 71)
9241 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9242 (i - entrymatches) << (32 - 18),
9243 (i << (32 - 18)) - 1,
9245 handler_to_string(table, lastentry),
9246 table->handlers[lastentry].offset);
9253 if (entry >= (256-64))
9255 UINT8 lastentry2 = 71;
9256 int entry2matches = 0;
9260 for (j = 0; j < l2count; j++)
9262 UINT8 entry2 = table->table[(1 << 18) + (entry << (32 - 18)) + j];
9265 if (entry2 < (256-64) && entry2 == lastentry2)
9272 if (lastentry2 < (256-64) && lastentry2 != 71)
9273 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9274 ((i << (32 - 18)) | (j - entry2matches)),
9275 ((i << (32 - 18)) | j) - 1,
9277 handler_to_string(table, lastentry2),
9278 table->handlers[lastentry2].offset);
9281 lastentry2 = entry2;
9286 if (lastentry2 < (256-64) && lastentry2 != 71)
9287 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9288 ((i << (32 - 18)) | (j - entry2matches)),
9289 ((i << (32 - 18)) | j) - 1,
9291 handler_to_string(table, lastentry2),
9292 table->handlers[lastentry2].offset);
9297 if (lastentry < (256-64) && lastentry != 71)
9298 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9299 (i - entrymatches) << (32 - 18),
9300 (i << (32 - 18)) - 1,
9302 handler_to_string(table, lastentry),
9303 table->handlers[lastentry].offset);
9306 void memory_dump(FILE *file)
9308 int cpunum, spacenum;
9315 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
9316 for (spacenum = 0; spacenum < 3; spacenum++)
9317 if (cpudata[cpunum].space[spacenum].abits)
9319 fprintf(file, "\n\n"
9320 "=========================================\n"
9321 "CPU %d address space %d read handler dump\n"
9322 "=========================================\n", cpunum, spacenum);
9323 dump_map(file, &cpudata[cpunum].space[spacenum], &cpudata[cpunum].space[spacenum].read);
9325 fprintf(file, "\n\n"
9326 "==========================================\n"
9327 "CPU %d address space %d write handler dump\n"
9328 "==========================================\n", cpunum, spacenum);
9329 dump_map(file, &cpudata[cpunum].space[spacenum], &cpudata[cpunum].space[spacenum].write);
9339 const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset)
9341 addrspace_data *space = &cpudata[cpunum].space[spacenum];
9342 const table_data *table = read0_or_write1 ? &space->write : &space->read;
9346 offset &= space->mask;
9347 entry = table->table[((offset) >> (32 - 18))];
9348 if (entry >= (256-64))
9349 entry = table->table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
9352 return handler_to_string(table, entry);