# 1 "src/memory.c" # 1 "" # 1 "" # 1 "src/memory.c" # 94 "src/memory.c" # 1 "src/driver.h" 1 # 12 "src/driver.h" # 62 "src/driver.h" # 1 "src/mamecore.h" 1 # 12 "src/mamecore.h" # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 1 3 4 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 1 3 4 # 267 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_config.h" 1 3 4 # 268 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 2 3 4 # 303 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/cdefs.h" 1 3 4 # 304 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 2 3 4 # 29 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 213 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4 typedef long unsigned int size_t; # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 1 3 4 # 29 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 30 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/kernel_types.h" 1 3 4 # 10 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/kernel_types.h" 3 4 typedef unsigned short __kernel_dev_t; typedef unsigned long __kernel_ino_t; typedef unsigned short __kernel_mode_t; typedef unsigned short __kernel_nlink_t; typedef long __kernel_off_t; typedef int __kernel_pid_t; typedef unsigned short __kernel_ipc_pid_t; typedef unsigned short __kernel_uid_t; typedef unsigned short __kernel_gid_t; typedef unsigned int __kernel_size_t; typedef int __kernel_ssize_t; typedef int __kernel_ptrdiff_t; typedef long __kernel_time_t; typedef long __kernel_suseconds_t; typedef long __kernel_clock_t; typedef int __kernel_daddr_t; typedef char * __kernel_caddr_t; typedef unsigned short __kernel_uid16_t; typedef unsigned short __kernel_gid16_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; typedef long long __kernel_loff_t; typedef __kernel_dev_t __kernel_old_dev_t; typedef struct { int __val[2]; } __kernel_fsid_t; # 31 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short __u_short; typedef unsigned int __u_int; typedef unsigned long __u_long; __extension__ typedef unsigned long long int __u_quad_t; __extension__ typedef long long int __quad_t; # 50 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 3 4 typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; typedef __quad_t *__qaddr_t; typedef __u_quad_t __dev_t; typedef __u_int __uid_t; typedef __u_int __gid_t; typedef __u_long __ino_t; typedef __u_int __mode_t; typedef __u_int __nlink_t; typedef long int __off_t; typedef __quad_t __loff_t; typedef int __pid_t; typedef long int __ssize_t; typedef __u_long __rlim_t; typedef __u_quad_t __rlim64_t; typedef __u_int __id_t; typedef struct { int __val[2]; } __fsid_t; typedef int __daddr_t; typedef char *__caddr_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef long int __swblk_t; typedef long int __clock_t; typedef int __clockid_t; typedef int __timer_t; typedef int __key_t; typedef __kernel_ipc_pid_t __ipc_pid_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef __quad_t __blkcnt64_t; typedef __u_long __fsblkcnt_t; typedef __u_quad_t __fsblkcnt64_t; typedef __u_long __fsfilcnt_t; typedef __u_quad_t __fsfilcnt64_t; typedef __u_quad_t __ino64_t; typedef __loff_t __off64_t; typedef long int __t_scalar_t; typedef unsigned long int __t_uscalar_t; typedef int __intptr_t; typedef unsigned int __socklen_t; # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 1 3 4 # 23 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sched.h" 1 3 4 # 68 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sched.h" 3 4 struct __sched_param { int __sched_priority; }; # 24 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 2 3 4 struct _pthread_fastlock { long int __status; int __spinlock; }; typedef struct _pthread_descr_struct *_pthread_descr; typedef struct __pthread_attr_s { int __detachstate; int __schedpolicy; struct __sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; size_t __stacksize; } pthread_attr_t; typedef struct { struct _pthread_fastlock __c_lock; _pthread_descr __c_waiting; } pthread_cond_t; typedef struct { int __dummy; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef struct { int __m_reserved; int __m_count; _pthread_descr __m_owner; int __m_kind; struct _pthread_fastlock __m_lock; } pthread_mutex_t; typedef struct { int __mutexkind; } pthread_mutexattr_t; typedef int pthread_once_t; # 140 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 3 4 typedef unsigned long int pthread_t; # 145 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4 typedef struct __STDIO_FILE_STRUCT FILE; # 62 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 typedef struct __STDIO_FILE_STRUCT __FILE; # 72 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 1 3 4 # 121 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 1 3 4 # 122 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 2 3 4 # 178 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4 typedef struct { __off_t __pos; } __STDIO_fpos_t; typedef struct { __off64_t __pos; } __STDIO_fpos64_t; typedef __off64_t __offmax_t; # 241 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4 struct __STDIO_FILE_STRUCT { unsigned short __modeflags; unsigned char __ungot[2]; int __filedes; unsigned char *__bufstart; unsigned char *__bufend; unsigned char *__bufpos; unsigned char *__bufread; unsigned char *__bufgetc_u; unsigned char *__bufputc_u; struct __STDIO_FILE_STRUCT *__nextopen; # 285 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4 int __user_locking; pthread_mutex_t __lock; }; # 387 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4 extern int __fgetc_unlocked(FILE *__stream); extern int __fputc_unlocked(int __c, FILE *__stream); # 406 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4 extern FILE *__stdin; # 465 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4 extern FILE *__stdout; # 73 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 1 3 4 # 43 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 77 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4 typedef __STDIO_fpos64_t fpos_t; # 131 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/stdio_lim.h" 1 3 4 # 132 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4 extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; extern int remove (__const char *__filename) ; extern int rename (__const char *__old, __const char *__new) ; # 160 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern FILE *tmpfile (void) __asm__ ("_" "tmpfile64"); # 171 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern char *tmpnam (char *__s) ; extern char *tmpnam_r (char *__s) ; # 189 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern char *tempnam (__const char *__dir, __const char *__pfx) __attribute__ ((__malloc__)); extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 214 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 228 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 # 245 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) __asm__ ("_" "fopen64"); extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("_" "freopen64"); # 266 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern FILE *fdopen (int __fd, __const char *__modes) ; # 289 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ; extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) ; extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) ; extern void setlinebuf (FILE *__stream) ; extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int printf (__const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) ; extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) ; extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 3, 0))); # 383 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int scanf (__const char *__restrict __format, ...); extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) ; # 425 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); # 449 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 463 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 496 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); # 515 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream); extern char *gets (char *__s); # 579 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); extern int puts (__const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); # 632 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream); extern void rewind (FILE *__stream); # 676 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("_" "fseeko64"); extern __off64_t ftello (FILE *__stream) __asm__ ("_" "ftello64"); # 701 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("_" "fgetpos64"); extern int fsetpos (FILE *__stream, __const fpos_t *__pos) __asm__ ("_" "fsetpos64"); # 719 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern void clearerr (FILE *__stream) ; extern int feof (FILE *__stream) ; extern int ferror (FILE *__stream) ; extern void clearerr_unlocked (FILE *__stream) ; extern int feof_unlocked (FILE *__stream) ; extern int ferror_unlocked (FILE *__stream) ; extern void perror (__const char *__s); # 756 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int fileno (FILE *__stream) ; extern int fileno_unlocked (FILE *__stream) ; # 771 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern FILE *popen (__const char *__command, __const char *__modes); extern int pclose (FILE *__stream); extern char *ctermid (char *__s) ; # 811 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern void flockfile (FILE *__stream) ; extern int ftrylockfile (FILE *__stream) ; extern void funlockfile (FILE *__stream) ; # 858 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4 extern int __snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern int __vsnprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 3, 0))); # 18 "src/mamecore.h" 2 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 1 3 4 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 34 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 2 3 4 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) ; extern void *memmove (void *__dest, __const void *__src, size_t __n) ; extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) ; extern void *memset (void *__s, int __c, size_t __n) ; extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__pure__)); extern void *memchr (__const void *__s, int __c, size_t __n) __attribute__ ((__pure__)); # 89 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) ; extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) ; extern char *strcat (char *__restrict __dest, __const char *__restrict __src) ; extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) ; extern int strcmp (__const char *__s1, __const char *__s2) __attribute__ ((__pure__)); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__pure__)); extern int strcoll (__const char *__s1, __const char *__s2) __attribute__ ((__pure__)); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) ; # 143 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern char *strdup (__const char *__s) __attribute__ ((__malloc__)); # 177 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__)); extern char *strrchr (__const char *__s, int __c) __attribute__ ((__pure__)); extern size_t strcspn (__const char *__s, __const char *__reject) __attribute__ ((__pure__)); extern size_t strspn (__const char *__s, __const char *__accept) __attribute__ ((__pure__)); extern char *strpbrk (__const char *__s, __const char *__accept) __attribute__ ((__pure__)); extern char *strstr (__const char *__haystack, __const char *__needle) __attribute__ ((__pure__)); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) ; extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) ; extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) ; # 245 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern size_t strlen (__const char *__s) __attribute__ ((__pure__)); # 258 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern char *strerror (int __errnum) ; extern char *_glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) ; extern int _susv3_strerror_r (int __errnum, char *__buf, size_t buflen) ; # 282 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern char *strerror_r (int __errnum, char *__buf, size_t buflen) __asm__ ("_" "_glibc_strerror_r"); # 293 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern void __bzero (void *__s, size_t __n) ; extern void bcopy (__const void *__src, void *__dest, size_t __n) ; extern void bzero (void *__s, size_t __n) ; extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__pure__)); extern char *index (__const char *__s, int __c) __attribute__ ((__pure__)); extern char *rindex (__const char *__s, int __c) __attribute__ ((__pure__)); extern int ffs (int __i) __attribute__ ((__const__)); # 327 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__pure__)); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__pure__)); # 356 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) ; # 390 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4 extern size_t strlcat(char *__restrict dst, const char *__restrict src, size_t n) ; extern size_t strlcpy(char *__restrict dst, const char *__restrict src, size_t n) ; # 19 "src/mamecore.h" 2 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 1 3 4 # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 36 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4 # 95 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; # 147 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern double atof (__const char *__nptr) __attribute__ ((__pure__)); extern int atoi (__const char *__nptr) __attribute__ ((__pure__)); extern long int atol (__const char *__nptr) __attribute__ ((__pure__)); __extension__ extern long long int atoll (__const char *__nptr) __attribute__ ((__pure__)); extern double strtod (__const char *__restrict __nptr, char **__restrict __endptr) ; # 185 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern long int strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern long long int strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern unsigned long long int strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern long long int strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; __extension__ extern unsigned long long int strtoull (__const char *__restrict __nptr, char **__restrict __endptr, int __base) ; # 309 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern char *l64a (long int __n) ; extern long int a64l (__const char *__s) __attribute__ ((__pure__)); # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 1 3 4 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino64_t ino_t; # 61 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; typedef __off64_t off_t; # 99 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 typedef __pid_t pid_t; typedef __id_t id_t; typedef __ssize_t ssize_t; typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 132 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4 # 74 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 typedef __time_t time_t; # 92 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 typedef __clockid_t clockid_t; # 104 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 typedef __timer_t timer_t; # 133 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4 # 146 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 147 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 190 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 typedef int int8_t __attribute__ ((__mode__ (__QI__))); typedef int int16_t __attribute__ ((__mode__ (__HI__))); typedef int int32_t __attribute__ ((__mode__ (__SI__))); typedef int int64_t __attribute__ ((__mode__ (__DI__))); typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); typedef int register_t __attribute__ ((__mode__ (__word__))); # 212 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 1 3 4 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/endian.h" 1 3 4 # 38 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 2 3 4 # 213 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 1 3 4 # 31 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/select.h" 1 3 4 # 32 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sigset.h" 1 3 4 # 23 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sigset.h" 3 4 typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4 typedef __sigset_t sigset_t; # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4 # 118 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 struct timespec { __time_t tv_sec; long int tv_nsec; }; # 44 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 1 3 4 # 71 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 46 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4 typedef long int __fd_mask; typedef struct { __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 89 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout) ; # 112 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4 # 216 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/sysmacros.h" 1 3 4 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/sysmacros.h" 3 4 __extension__ static __inline unsigned int gnu_dev_major (unsigned long long int __dev) ; __extension__ static __inline unsigned int gnu_dev_minor (unsigned long long int __dev) ; __extension__ static __inline unsigned long long int gnu_dev_makedev (unsigned int __major, unsigned int __minor) ; __extension__ static __inline unsigned int gnu_dev_major (unsigned long long int __dev) { return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); } __extension__ static __inline unsigned int gnu_dev_minor (unsigned long long int __dev) { return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); } __extension__ static __inline unsigned long long int gnu_dev_makedev (unsigned int __major, unsigned int __minor) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32)); } # 219 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4 # 243 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 typedef __blkcnt64_t blkcnt_t; typedef __fsblkcnt64_t fsblkcnt_t; typedef __fsfilcnt64_t fsfilcnt_t; # 262 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4 # 318 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4 extern long int random (void) ; extern void srandom (unsigned int __seed) ; extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) ; extern char *setstate (char *__statebuf) ; struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) ; extern int srandom_r (unsigned int __seed, struct random_data *__buf) ; extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) ; extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) ; extern int rand (void) ; extern void srand (unsigned int __seed) ; extern int rand_r (unsigned int *__seed) ; # 390 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern double drand48 (void) ; extern double erand48 (unsigned short int __xsubi[3]) ; extern long int lrand48 (void) ; extern long int nrand48 (unsigned short int __xsubi[3]) ; extern long int mrand48 (void) ; extern long int jrand48 (unsigned short int __xsubi[3]) ; extern void srand48 (long int __seedval) ; extern unsigned short int *seed48 (unsigned short int __seed16v[3]) ; extern void lcong48 (unsigned short int __param[7]) ; struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) ; extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) ; extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) ; extern int srand48_r (long int __seedval, struct drand48_data *__buffer) ; extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) ; extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) ; extern void *malloc (size_t __size) __attribute__ ((__malloc__)); extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__malloc__)); extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__malloc__)); extern void free (void *__ptr) ; extern void cfree (void *__ptr) ; # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 1 3 4 # 25 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 26 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 2 3 4 extern void *alloca (size_t __size) ; # 484 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4 extern void *valloc (size_t __size) __attribute__ ((__malloc__)); # 497 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern void abort (void) __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) ; extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) ; extern void exit (int __status) __attribute__ ((__noreturn__)); # 529 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern char *getenv (__const char *__name) ; extern char *__secure_getenv (__const char *__name) ; extern int putenv (char *__string) ; extern int setenv (__const char *__name, __const char *__value, int __replace) ; extern int unsetenv (__const char *__name) ; # 568 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern int clearenv (void) ; # 577 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern char *mktemp (char *__template) ; # 591 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern int mkstemp (char *__template) __asm__ ("_" "mkstemp64"); # 607 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern char *mkdtemp (char *__template) ; extern int system (__const char *__command); # 627 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern char *realpath (__const char *__restrict __name, char *__restrict __resolved) ; typedef int (*__compar_fn_t) (__const void *, __const void *); extern void *bsearch (__const void *__key, __const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar); extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar); extern int abs (int __x) __attribute__ ((__const__)); extern long int labs (long int __x) __attribute__ ((__const__)); extern div_t div (int __numer, int __denom) __attribute__ ((__const__)); extern ldiv_t ldiv (long int __numer, long int __denom) __attribute__ ((__const__)); # 714 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern int rpmatch (__const char *__response) ; # 775 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4 extern int getloadavg (double __loadavg[], int __nelem) ; # 20 "src/mamecore.h" 2 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 1 3 4 # 32 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 # 41 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 enum { _ISupper = (1 << (0)), _ISlower = (1 << (1)), _ISalpha = (1 << (2)), _ISdigit = (1 << (3)), _ISxdigit = (1 << (4)), _ISspace = (1 << (5)), _ISprint = (1 << (6)), _ISgraph = (1 << (7)), _ISblank = (1 << (8)), _IScntrl = (1 << (9)), _ISpunct = (1 << (10)), _ISalnum = (1 << (11)) }; # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_touplow.h" 1 3 4 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_touplow.h" 3 4 typedef __uint16_t __ctype_mask_t; typedef __int16_t __ctype_touplow_t; # 61 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 2 3 4 # 103 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 extern const __ctype_mask_t *__C_ctype_b; extern const __ctype_touplow_t *__C_ctype_toupper; extern const __ctype_touplow_t *__C_ctype_tolower; # 123 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 extern const __ctype_mask_t *__ctype_b; extern const __ctype_touplow_t *__ctype_toupper; extern const __ctype_touplow_t *__ctype_tolower; # 143 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 extern int isxlower(int c) ; extern int isxupper(int c) ; # 155 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 extern int isalnum (int) ; extern int isalpha (int) ; extern int iscntrl (int) ; extern int isdigit (int) ; extern int islower (int) ; extern int isgraph (int) ; extern int isprint (int) ; extern int ispunct (int) ; extern int isspace (int) ; extern int isupper (int) ; extern int isxdigit (int) ; extern int tolower (int __c) ; extern int toupper (int __c) ; # 201 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 extern int isascii (int __c) ; extern int toascii (int __c) ; extern int _toupper (int) ; extern int _tolower (int) ; # 382 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4 # 21 "src/mamecore.h" 2 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/assert.h" 1 3 4 # 36 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/assert.h" 3 4 extern void __assert (const char *, const char *, int, const char *) ; # 22 "src/mamecore.h" 2 # 1 "src/unix/osd_cpu.h" 1 # 27 "src/unix/osd_cpu.h" # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4 # 30 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 39 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 2 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 1 3 4 # 38 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 3 4 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_clk_tck.h" 1 3 4 # 39 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 2 3 4 # 43 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 2 3 4 # 58 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 typedef __clock_t clock_t; # 129 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; __const char *tm_zone; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; struct sigevent; # 180 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 extern clock_t clock (void) ; extern time_t time (time_t *__timer) ; extern double difftime (time_t __time1, time_t __time0) __attribute__ ((__const__)); extern time_t mktime (struct tm *__tp) ; extern size_t strftime (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) ; # 243 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 extern struct tm *gmtime (__const time_t *__timer) ; extern struct tm *localtime (__const time_t *__timer) ; extern struct tm *gmtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) ; extern struct tm *localtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) ; extern char *asctime (__const struct tm *__tp) ; extern char *ctime (__const time_t *__timer) ; extern char *asctime_r (__const struct tm *__restrict __tp, char *__restrict __buf) ; extern char *ctime_r (__const time_t *__restrict __timer, char *__restrict __buf) ; # 299 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 extern char *tzname[2]; extern void tzset (void) ; extern int daylight; extern long int timezone; extern int stime (__const time_t *__when) ; # 329 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 extern time_t timegm (struct tm *__tp) ; extern time_t timelocal (struct tm *__tp) ; extern int dysize (int __year) __attribute__ ((__const__)); # 344 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 extern int nanosleep (__const struct timespec *__requested_time, struct timespec *__remaining); extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) ; # 438 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4 # 28 "src/unix/osd_cpu.h" 2 # 44 "src/unix/osd_cpu.h" typedef signed char INT8; typedef signed short INT16; typedef signed int INT32; typedef signed long long INT64; typedef unsigned char UINT8; typedef unsigned short UINT16; typedef unsigned int UINT32; typedef unsigned long long UINT64; # 23 "src/mamecore.h" 2 # 37 "src/mamecore.h" typedef UINT32 FPTR; typedef void genf(void); typedef struct _mame_display mame_display; typedef struct _game_driver game_driver; typedef struct _machine_config machine_config; typedef struct _rom_load_data rom_load_data; typedef struct _xml_data_node xml_data_node; typedef struct _performance_info performance_info; typedef struct _osd_file osd_file; typedef UINT32 pen_t; struct _mame_bitmap { int width,height; int depth; void **line; void *base; int rowpixels; int rowbytes; void (*plot)(struct _mame_bitmap *bitmap,int x,int y,pen_t pen); pen_t (*read)(struct _mame_bitmap *bitmap,int x,int y); void (*plot_box)(struct _mame_bitmap *bitmap,int x,int y,int width,int height,pen_t pen); }; typedef struct _mame_bitmap mame_bitmap; struct _rectangle { int min_x,max_x; int min_y,max_y; }; typedef struct _rectangle rectangle; # 98 "src/mamecore.h" typedef union { struct { UINT8 l,h,h2,h3; } b; struct { UINT16 l,h; } w; UINT32 d; } PAIR; # 118 "src/mamecore.h" typedef union { struct { UINT8 l,h,h2,h3,h4,h5,h6,h7; } b; struct { UINT16 l,h,h2,h3; } w; struct { UINT32 l,h; } d; UINT64 lw; } PAIR64; # 334 "src/mamecore.h" static __inline__ int mame_stricmp(const char *s1, const char *s2) { for (;;) { 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; })); 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; })); if (c1 == 0 || c1 != c2) return c1 - c2; } } # 352 "src/mamecore.h" static __inline__ void sect_rect(rectangle *dst, const rectangle *src) { if (src->min_x > dst->min_x) dst->min_x = src->min_x; if (src->max_x < dst->max_x) dst->max_x = src->max_x; if (src->min_y > dst->min_y) dst->min_y = src->min_y; if (src->max_y < dst->max_y) dst->max_y = src->max_y; } static __inline__ float u2f(UINT32 v) { union { float ff; UINT32 vv; } u; u.vv = v; return u.ff; } static __inline__ UINT32 f2u(float f) { union { float ff; UINT32 vv; } u; u.ff = f; return u.vv; } static __inline__ float u2d(UINT64 v) { union { double dd; UINT64 vv; } u; u.vv = v; return u.dd; } static __inline__ UINT64 d2u(double d) { union { double dd; UINT64 vv; } u; u.dd = d; return u.vv; } # 422 "src/mamecore.h" static __inline__ UINT32 count_leading_zeros(UINT32 val) { UINT32 count; for (count = 0; (INT32)val >= 0; count++) val <<= 1; return count; } static __inline__ UINT32 count_leading_ones(UINT32 val) { UINT32 count; for (count = 0; (INT32)val < 0; count++) val <<= 1; return count; } static __inline__ INT32 fixed_mul_shift(INT32 val1, INT32 val2, UINT8 shift) { return (INT32)(((INT64)val1 * (INT64)val2) >> shift); } # 458 "src/mamecore.h" static __inline__ int bcd_adjust(int value) { if ((value & 0xf) >= 0xa) value = value + 0x10 - 0xa; if ((value & 0xf0) >= 0xa0) value = value - 0xa0 + 0x100; return value; } static __inline__ int dec_2_bcd(int a) { return (a % 10) | ((a / 10) << 4); } static __inline__ int bcd_2_dec(int a) { return (a & 0xf) + (a >> 4) * 10; } # 487 "src/mamecore.h" static __inline__ int gregorian_is_leap_year(int year) { return !(year % 100 ? year % 4 : year % 400); } static __inline__ int gregorian_days_in_month(int month, int year) { if (month == 2) return gregorian_is_leap_year(year) ? 29 : 28; else if (month == 4 || month == 6 || month == 9 || month == 11) return 30; else return 31; } # 63 "src/driver.h" 2 # 1 "src/osdepend.h" 1 # 12 "src/osdepend.h" # 1 "src/inptport.h" 1 # 12 "src/inptport.h" # 1 "src/memory.h" 1 # 12 "src/memory.h" # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4 # 151 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4 typedef long int ptrdiff_t; # 325 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4 typedef int wchar_t; # 19 "src/memory.h" 2 # 54 "src/memory.h" typedef UINT32 offs_t; typedef UINT8 (*read8_handler) (__attribute__((__unused__)) offs_t offset); typedef void (*write8_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); typedef UINT16 (*read16_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); typedef void (*write16_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); typedef UINT32 (*read32_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); typedef void (*write32_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask); typedef UINT64 (*read64_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask); typedef void (*write64_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask); typedef offs_t (*opbase_handler) (__attribute__((__unused__)) offs_t address); struct _data_accessors { UINT8 (*read_byte)(offs_t offset); UINT16 (*read_word)(offs_t offset); UINT32 (*read_dword)(offs_t offset); UINT64 (*read_qword)(offs_t offset); void (*write_byte)(offs_t offset, UINT8 data); void (*write_word)(offs_t offset, UINT16 data); void (*write_dword)(offs_t offset, UINT32 data); void (*write_qword)(offs_t offset, UINT64 data); }; typedef struct _data_accessors data_accessors; # 554 "src/memory.h" typedef struct _handler_data handler_data; union _read_handlers { genf * handler; read8_handler handler8; read16_handler handler16; read32_handler handler32; read64_handler handler64; }; typedef union _read_handlers read_handlers; union _write_handlers { genf * handler; write8_handler handler8; write16_handler handler16; write32_handler handler32; write64_handler handler64; }; typedef union _write_handlers write_handlers; struct _address_map { UINT32 flags; offs_t start, end; offs_t mirror; offs_t mask; read_handlers read; const char * read_name; write_handlers write; const char * write_name; void * memory; UINT32 share; void ** base; size_t * size; UINT32 region; offs_t region_offs; }; typedef struct _address_map address_map; struct _address_space { offs_t addrmask; UINT8 * readlookup; UINT8 * writelookup; handler_data * readhandlers; handler_data * writehandlers; data_accessors * accessors; }; typedef struct _address_space address_space; # 619 "src/memory.h" typedef address_map *(*construct_map_t)(address_map *map); # 771 "src/memory.h" UINT8 program_read_byte_8(offs_t address); void program_write_byte_8(offs_t address, UINT8 data); UINT8 program_read_byte_16be(offs_t address); UINT16 program_read_word_16be(offs_t address); void program_write_byte_16be(offs_t address, UINT8 data); void program_write_word_16be(offs_t address, UINT16 data); UINT8 program_read_byte_16le(offs_t address); UINT16 program_read_word_16le(offs_t address); void program_write_byte_16le(offs_t address, UINT8 data); void program_write_word_16le(offs_t address, UINT16 data); UINT8 program_read_byte_32be(offs_t address); UINT16 program_read_word_32be(offs_t address); UINT32 program_read_dword_32be(offs_t address); void program_write_byte_32be(offs_t address, UINT8 data); void program_write_word_32be(offs_t address, UINT16 data); void program_write_dword_32be(offs_t address, UINT32 data); UINT8 program_read_byte_32le(offs_t address); UINT16 program_read_word_32le(offs_t address); UINT32 program_read_dword_32le(offs_t address); void program_write_byte_32le(offs_t address, UINT8 data); void program_write_word_32le(offs_t address, UINT16 data); void program_write_dword_32le(offs_t address, UINT32 data); UINT8 program_read_byte_64be(offs_t address); UINT16 program_read_word_64be(offs_t address); UINT32 program_read_dword_64be(offs_t address); UINT64 program_read_qword_64be(offs_t address); void program_write_byte_64be(offs_t address, UINT8 data); void program_write_word_64be(offs_t address, UINT16 data); void program_write_dword_64be(offs_t address, UINT32 data); void program_write_qword_64be(offs_t address, UINT64 data); UINT8 program_read_byte_64le(offs_t address); UINT16 program_read_word_64le(offs_t address); UINT32 program_read_dword_64le(offs_t address); UINT64 program_read_qword_64le(offs_t address); void program_write_byte_64le(offs_t address, UINT8 data); void program_write_word_64le(offs_t address, UINT16 data); void program_write_dword_64le(offs_t address, UINT32 data); void program_write_qword_64le(offs_t address, UINT64 data); UINT8 data_read_byte_8(offs_t address); void data_write_byte_8(offs_t address, UINT8 data); UINT8 data_read_byte_16be(offs_t address); UINT16 data_read_word_16be(offs_t address); void data_write_byte_16be(offs_t address, UINT8 data); void data_write_word_16be(offs_t address, UINT16 data); UINT8 data_read_byte_16le(offs_t address); UINT16 data_read_word_16le(offs_t address); void data_write_byte_16le(offs_t address, UINT8 data); void data_write_word_16le(offs_t address, UINT16 data); UINT8 data_read_byte_32be(offs_t address); UINT16 data_read_word_32be(offs_t address); UINT32 data_read_dword_32be(offs_t address); void data_write_byte_32be(offs_t address, UINT8 data); void data_write_word_32be(offs_t address, UINT16 data); void data_write_dword_32be(offs_t address, UINT32 data); UINT8 data_read_byte_32le(offs_t address); UINT16 data_read_word_32le(offs_t address); UINT32 data_read_dword_32le(offs_t address); void data_write_byte_32le(offs_t address, UINT8 data); void data_write_word_32le(offs_t address, UINT16 data); void data_write_dword_32le(offs_t address, UINT32 data); UINT8 data_read_byte_64be(offs_t address); UINT16 data_read_word_64be(offs_t address); UINT32 data_read_dword_64be(offs_t address); UINT64 data_read_qword_64be(offs_t address); void data_write_byte_64be(offs_t address, UINT8 data); void data_write_word_64be(offs_t address, UINT16 data); void data_write_dword_64be(offs_t address, UINT32 data); void data_write_qword_64be(offs_t address, UINT64 data); UINT8 data_read_byte_64le(offs_t address); UINT16 data_read_word_64le(offs_t address); UINT32 data_read_dword_64le(offs_t address); UINT64 data_read_qword_64le(offs_t address); void data_write_byte_64le(offs_t address, UINT8 data); void data_write_word_64le(offs_t address, UINT16 data); void data_write_dword_64le(offs_t address, UINT32 data); void data_write_qword_64le(offs_t address, UINT64 data); UINT8 io_read_byte_8(offs_t address); void io_write_byte_8(offs_t address, UINT8 data); UINT8 io_read_byte_16be(offs_t address); UINT16 io_read_word_16be(offs_t address); void io_write_byte_16be(offs_t address, UINT8 data); void io_write_word_16be(offs_t address, UINT16 data); UINT8 io_read_byte_16le(offs_t address); UINT16 io_read_word_16le(offs_t address); void io_write_byte_16le(offs_t address, UINT8 data); void io_write_word_16le(offs_t address, UINT16 data); UINT8 io_read_byte_32be(offs_t address); UINT16 io_read_word_32be(offs_t address); UINT32 io_read_dword_32be(offs_t address); void io_write_byte_32be(offs_t address, UINT8 data); void io_write_word_32be(offs_t address, UINT16 data); void io_write_dword_32be(offs_t address, UINT32 data); UINT8 io_read_byte_32le(offs_t address); UINT16 io_read_word_32le(offs_t address); UINT32 io_read_dword_32le(offs_t address); void io_write_byte_32le(offs_t address, UINT8 data); void io_write_word_32le(offs_t address, UINT16 data); void io_write_dword_32le(offs_t address, UINT32 data); UINT8 io_read_byte_64be(offs_t address); UINT16 io_read_word_64be(offs_t address); UINT32 io_read_dword_64be(offs_t address); UINT64 io_read_qword_64be(offs_t address); void io_write_byte_64be(offs_t address, UINT8 data); void io_write_word_64be(offs_t address, UINT16 data); void io_write_dword_64be(offs_t address, UINT32 data); void io_write_qword_64be(offs_t address, UINT64 data); UINT8 io_read_byte_64le(offs_t address); UINT16 io_read_word_64le(offs_t address); UINT32 io_read_dword_64le(offs_t address); UINT64 io_read_qword_64le(offs_t address); void io_write_byte_64le(offs_t address, UINT8 data); void io_write_word_64le(offs_t address, UINT16 data); void io_write_dword_64le(offs_t address, UINT32 data); void io_write_qword_64le(offs_t address, UINT64 data); # 917 "src/memory.h" int memory_init(void); void memory_exit(void); void memory_set_context(int activecpu); const address_map *memory_get_map(int cpunum, int spacenum); opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function); void memory_set_opbase(offs_t offset); void memory_set_decrypted_region(int cpunum, offs_t start, offs_t end, void *base); void * memory_get_read_ptr(int cpunum, int spacenum, offs_t offset); void * memory_get_write_ptr(int cpunum, int spacenum, offs_t offset); void * memory_get_op_ptr(int cpunum, offs_t offset, int arg); void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride); void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride); void memory_set_bank(int banknum, int entrynum); void memory_set_bankptr(int banknum, void *base); void memory_set_debugger_access(int debugger); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); void memory_dump(FILE *file); const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset); # 980 "src/memory.h" extern UINT8 opcode_entry; extern UINT8 * opcode_base; extern UINT8 * opcode_arg_base; extern offs_t opcode_mask; extern offs_t opcode_memory_min; extern offs_t opcode_memory_max; extern address_space active_address_space[]; extern address_map * construct_map_0(address_map *map); # 1069 "src/memory.h" static __inline__ UINT8 program_read_byte (offs_t offset) { return (*active_address_space[0].accessors->read_byte)(offset); } static __inline__ UINT16 program_read_word (offs_t offset) { return (*active_address_space[0].accessors->read_word)(offset); } static __inline__ UINT32 program_read_dword(offs_t offset) { return (*active_address_space[0].accessors->read_dword)(offset); } static __inline__ UINT64 program_read_qword(offs_t offset) { return (*active_address_space[0].accessors->read_qword)(offset); } static __inline__ void program_write_byte (offs_t offset, UINT8 data) { (*active_address_space[0].accessors->write_byte)(offset, data); } static __inline__ void program_write_word (offs_t offset, UINT16 data) { (*active_address_space[0].accessors->write_word)(offset, data); } static __inline__ void program_write_dword(offs_t offset, UINT32 data) { (*active_address_space[0].accessors->write_dword)(offset, data); } static __inline__ void program_write_qword(offs_t offset, UINT64 data) { (*active_address_space[0].accessors->write_qword)(offset, data); } static __inline__ UINT8 data_read_byte (offs_t offset) { return (*active_address_space[1].accessors->read_byte)(offset); } static __inline__ UINT16 data_read_word (offs_t offset) { return (*active_address_space[1].accessors->read_word)(offset); } static __inline__ UINT32 data_read_dword(offs_t offset) { return (*active_address_space[1].accessors->read_dword)(offset); } static __inline__ UINT64 data_read_qword(offs_t offset) { return (*active_address_space[1].accessors->read_qword)(offset); } static __inline__ void data_write_byte (offs_t offset, UINT8 data) { (*active_address_space[1].accessors->write_byte)(offset, data); } static __inline__ void data_write_word (offs_t offset, UINT16 data) { (*active_address_space[1].accessors->write_word)(offset, data); } static __inline__ void data_write_dword(offs_t offset, UINT32 data) { (*active_address_space[1].accessors->write_dword)(offset, data); } static __inline__ void data_write_qword(offs_t offset, UINT64 data) { (*active_address_space[1].accessors->write_qword)(offset, data); } static __inline__ UINT8 io_read_byte (offs_t offset) { return (*active_address_space[2].accessors->read_byte)(offset); } static __inline__ UINT16 io_read_word (offs_t offset) { return (*active_address_space[2].accessors->read_word)(offset); } static __inline__ UINT32 io_read_dword(offs_t offset) { return (*active_address_space[2].accessors->read_dword)(offset); } static __inline__ UINT64 io_read_qword(offs_t offset) { return (*active_address_space[2].accessors->read_qword)(offset); } static __inline__ void io_write_byte (offs_t offset, UINT8 data) { (*active_address_space[2].accessors->write_byte)(offset, data); } static __inline__ void io_write_word (offs_t offset, UINT16 data) { (*active_address_space[2].accessors->write_word)(offset, data); } static __inline__ void io_write_dword(offs_t offset, UINT32 data) { (*active_address_space[2].accessors->write_dword)(offset, data); } static __inline__ void io_write_qword(offs_t offset, UINT64 data) { (*active_address_space[2].accessors->write_qword)(offset, data); } UINT8 cpu_readop_safe(offs_t offset); UINT16 cpu_readop16_safe(offs_t offset); UINT32 cpu_readop32_safe(offs_t offset); UINT64 cpu_readop64_safe(offs_t offset); UINT8 cpu_readop_arg_safe(offs_t offset); UINT16 cpu_readop_arg16_safe(offs_t offset); UINT32 cpu_readop_arg32_safe(offs_t offset); UINT64 cpu_readop_arg64_safe(offs_t offset); # 1121 "src/memory.h" static __inline__ void * cpu_opptr(offs_t A) { if ((0)) { memory_set_opbase(A); } return ((void *)&opcode_base[(A) & opcode_mask]); } static __inline__ UINT8 cpu_readop(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_base[(A) & opcode_mask]); } static __inline__ UINT16 cpu_readop16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_base[(A) & opcode_mask]); } static __inline__ UINT32 cpu_readop32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_base[(A) & opcode_mask]); } static __inline__ UINT64 cpu_readop64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_base[(A) & opcode_mask]); } static __inline__ UINT8 cpu_readop_arg(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_arg_base[(A) & opcode_mask]); } static __inline__ UINT16 cpu_readop_arg16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_arg_base[(A) & opcode_mask]); } static __inline__ UINT32 cpu_readop_arg32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_arg_base[(A) & opcode_mask]); } static __inline__ UINT64 cpu_readop_arg64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_arg_base[(A) & opcode_mask]); } # 18 "src/inptport.h" 2 # 1 "src/input.h" 1 # 12 "src/input.h" # 35 "src/input.h" enum { ANALOG_TYPE_NONE = 0, ANALOG_TYPE_ABSOLUTE = 1, ANALOG_TYPE_RELATIVE = 2 }; enum { KEYCODE_A, KEYCODE_B, KEYCODE_C, KEYCODE_D, KEYCODE_E, KEYCODE_F, KEYCODE_G, KEYCODE_H, KEYCODE_I, KEYCODE_J, KEYCODE_K, KEYCODE_L, KEYCODE_M, KEYCODE_N, KEYCODE_O, KEYCODE_P, KEYCODE_Q, KEYCODE_R, KEYCODE_S, KEYCODE_T, KEYCODE_U, KEYCODE_V, KEYCODE_W, KEYCODE_X, KEYCODE_Y, KEYCODE_Z, KEYCODE_0, KEYCODE_1, KEYCODE_2, KEYCODE_3, KEYCODE_4, KEYCODE_5, KEYCODE_6, KEYCODE_7, KEYCODE_8, KEYCODE_9, KEYCODE_F1, KEYCODE_F2, KEYCODE_F3, KEYCODE_F4, KEYCODE_F5, KEYCODE_F6, KEYCODE_F7, KEYCODE_F8, KEYCODE_F9, KEYCODE_F10, KEYCODE_F11, KEYCODE_F12, KEYCODE_F13, KEYCODE_F14, KEYCODE_F15, KEYCODE_ESC, KEYCODE_TILDE, KEYCODE_MINUS, KEYCODE_EQUALS, KEYCODE_BACKSPACE, KEYCODE_TAB, KEYCODE_OPENBRACE, KEYCODE_CLOSEBRACE, KEYCODE_ENTER, KEYCODE_COLON, KEYCODE_QUOTE, KEYCODE_BACKSLASH, KEYCODE_BACKSLASH2, KEYCODE_COMMA, KEYCODE_STOP, KEYCODE_SLASH, KEYCODE_SPACE, KEYCODE_INSERT, KEYCODE_DEL, KEYCODE_HOME, KEYCODE_END, KEYCODE_PGUP, KEYCODE_PGDN, KEYCODE_LEFT, KEYCODE_RIGHT, KEYCODE_UP, KEYCODE_DOWN, KEYCODE_0_PAD, KEYCODE_1_PAD, KEYCODE_2_PAD, KEYCODE_3_PAD, KEYCODE_4_PAD, KEYCODE_5_PAD, KEYCODE_6_PAD, KEYCODE_7_PAD, KEYCODE_8_PAD, KEYCODE_9_PAD, KEYCODE_SLASH_PAD, KEYCODE_ASTERISK, KEYCODE_MINUS_PAD, KEYCODE_PLUS_PAD, KEYCODE_DEL_PAD, KEYCODE_ENTER_PAD, KEYCODE_PRTSCR, KEYCODE_PAUSE, KEYCODE_LSHIFT, KEYCODE_RSHIFT, KEYCODE_LCONTROL, KEYCODE_RCONTROL, KEYCODE_LALT, KEYCODE_RALT, KEYCODE_SCRLOCK, KEYCODE_NUMLOCK, KEYCODE_CAPSLOCK, KEYCODE_LWIN, KEYCODE_RWIN, KEYCODE_MENU, JOYCODE_1_LEFT, JOYCODE_1_RIGHT, JOYCODE_1_UP, JOYCODE_1_DOWN, JOYCODE_1_BUTTON1, JOYCODE_1_BUTTON2, JOYCODE_1_BUTTON3, JOYCODE_1_BUTTON4, JOYCODE_1_BUTTON5, JOYCODE_1_BUTTON6, JOYCODE_1_BUTTON7, JOYCODE_1_BUTTON8, JOYCODE_1_BUTTON9, JOYCODE_1_BUTTON10, JOYCODE_1_BUTTON11, JOYCODE_1_BUTTON12, JOYCODE_1_BUTTON13, JOYCODE_1_BUTTON14, JOYCODE_1_BUTTON15, JOYCODE_1_BUTTON16, JOYCODE_1_START, JOYCODE_1_SELECT, JOYCODE_2_LEFT, JOYCODE_2_RIGHT, JOYCODE_2_UP, JOYCODE_2_DOWN, JOYCODE_2_BUTTON1, JOYCODE_2_BUTTON2, JOYCODE_2_BUTTON3, JOYCODE_2_BUTTON4, JOYCODE_2_BUTTON5, JOYCODE_2_BUTTON6, JOYCODE_2_BUTTON7, JOYCODE_2_BUTTON8, JOYCODE_2_BUTTON9, JOYCODE_2_BUTTON10, JOYCODE_2_BUTTON11, JOYCODE_2_BUTTON12, JOYCODE_2_BUTTON13, JOYCODE_2_BUTTON14, JOYCODE_2_BUTTON15, JOYCODE_2_BUTTON16, JOYCODE_2_START, JOYCODE_2_SELECT, JOYCODE_3_LEFT, JOYCODE_3_RIGHT, JOYCODE_3_UP, JOYCODE_3_DOWN, JOYCODE_3_BUTTON1, JOYCODE_3_BUTTON2, JOYCODE_3_BUTTON3, JOYCODE_3_BUTTON4, JOYCODE_3_BUTTON5, JOYCODE_3_BUTTON6, JOYCODE_3_BUTTON7, JOYCODE_3_BUTTON8, JOYCODE_3_BUTTON9, JOYCODE_3_BUTTON10, JOYCODE_3_BUTTON11, JOYCODE_3_BUTTON12, JOYCODE_3_BUTTON13, JOYCODE_3_BUTTON14, JOYCODE_3_BUTTON15, JOYCODE_3_BUTTON16, JOYCODE_3_START, JOYCODE_3_SELECT, JOYCODE_4_LEFT, JOYCODE_4_RIGHT, JOYCODE_4_UP, JOYCODE_4_DOWN, JOYCODE_4_BUTTON1, JOYCODE_4_BUTTON2, JOYCODE_4_BUTTON3, JOYCODE_4_BUTTON4, JOYCODE_4_BUTTON5, JOYCODE_4_BUTTON6, JOYCODE_4_BUTTON7, JOYCODE_4_BUTTON8, JOYCODE_4_BUTTON9, JOYCODE_4_BUTTON10, JOYCODE_4_BUTTON11, JOYCODE_4_BUTTON12, JOYCODE_4_BUTTON13, JOYCODE_4_BUTTON14, JOYCODE_4_BUTTON15, JOYCODE_4_BUTTON16, JOYCODE_4_START, JOYCODE_4_SELECT, JOYCODE_5_LEFT, JOYCODE_5_RIGHT, JOYCODE_5_UP, JOYCODE_5_DOWN, JOYCODE_5_BUTTON1, JOYCODE_5_BUTTON2, JOYCODE_5_BUTTON3, JOYCODE_5_BUTTON4, JOYCODE_5_BUTTON5, JOYCODE_5_BUTTON6, JOYCODE_5_BUTTON7, JOYCODE_5_BUTTON8, JOYCODE_5_BUTTON9, JOYCODE_5_BUTTON10, JOYCODE_5_BUTTON11, JOYCODE_5_BUTTON12, JOYCODE_5_BUTTON13, JOYCODE_5_BUTTON14, JOYCODE_5_BUTTON15, JOYCODE_5_BUTTON16, JOYCODE_5_START, JOYCODE_5_SELECT, JOYCODE_6_LEFT, JOYCODE_6_RIGHT, JOYCODE_6_UP, JOYCODE_6_DOWN, JOYCODE_6_BUTTON1, JOYCODE_6_BUTTON2, JOYCODE_6_BUTTON3, JOYCODE_6_BUTTON4, JOYCODE_6_BUTTON5, JOYCODE_6_BUTTON6, JOYCODE_6_BUTTON7, JOYCODE_6_BUTTON8, JOYCODE_6_BUTTON9, JOYCODE_6_BUTTON10, JOYCODE_6_BUTTON11, JOYCODE_6_BUTTON12, JOYCODE_6_BUTTON13, JOYCODE_6_BUTTON14, JOYCODE_6_BUTTON15, JOYCODE_6_BUTTON16, JOYCODE_6_START, JOYCODE_6_SELECT, JOYCODE_7_LEFT, JOYCODE_7_RIGHT, JOYCODE_7_UP, JOYCODE_7_DOWN, JOYCODE_7_BUTTON1, JOYCODE_7_BUTTON2, JOYCODE_7_BUTTON3, JOYCODE_7_BUTTON4, JOYCODE_7_BUTTON5, JOYCODE_7_BUTTON6, JOYCODE_7_BUTTON7, JOYCODE_7_BUTTON8, JOYCODE_7_BUTTON9, JOYCODE_7_BUTTON10, JOYCODE_7_BUTTON11, JOYCODE_7_BUTTON12, JOYCODE_7_BUTTON13, JOYCODE_7_BUTTON14, JOYCODE_7_BUTTON15, JOYCODE_7_BUTTON16, JOYCODE_7_START, JOYCODE_7_SELECT, JOYCODE_8_LEFT, JOYCODE_8_RIGHT, JOYCODE_8_UP, JOYCODE_8_DOWN, JOYCODE_8_BUTTON1, JOYCODE_8_BUTTON2, JOYCODE_8_BUTTON3, JOYCODE_8_BUTTON4, JOYCODE_8_BUTTON5, JOYCODE_8_BUTTON6, JOYCODE_8_BUTTON7, JOYCODE_8_BUTTON8, JOYCODE_8_BUTTON9, JOYCODE_8_BUTTON10, JOYCODE_8_BUTTON11, JOYCODE_8_BUTTON12, JOYCODE_8_BUTTON13, JOYCODE_8_BUTTON14, JOYCODE_8_BUTTON15, JOYCODE_8_BUTTON16, JOYCODE_8_START, JOYCODE_8_SELECT, MOUSECODE_1_BUTTON1, MOUSECODE_1_BUTTON2, MOUSECODE_1_BUTTON3, MOUSECODE_1_BUTTON4, MOUSECODE_1_BUTTON5, MOUSECODE_1_BUTTON6, MOUSECODE_2_BUTTON1, MOUSECODE_2_BUTTON2, MOUSECODE_2_BUTTON3, MOUSECODE_2_BUTTON4, MOUSECODE_2_BUTTON5, MOUSECODE_2_BUTTON6, MOUSECODE_3_BUTTON1, MOUSECODE_3_BUTTON2, MOUSECODE_3_BUTTON3, MOUSECODE_3_BUTTON4, MOUSECODE_3_BUTTON5, MOUSECODE_3_BUTTON6, MOUSECODE_4_BUTTON1, MOUSECODE_4_BUTTON2, MOUSECODE_4_BUTTON3, MOUSECODE_4_BUTTON4, MOUSECODE_4_BUTTON5, MOUSECODE_4_BUTTON6, MOUSECODE_5_BUTTON1, MOUSECODE_5_BUTTON2, MOUSECODE_5_BUTTON3, MOUSECODE_5_BUTTON4, MOUSECODE_5_BUTTON5, MOUSECODE_5_BUTTON6, MOUSECODE_6_BUTTON1, MOUSECODE_6_BUTTON2, MOUSECODE_6_BUTTON3, MOUSECODE_6_BUTTON4, MOUSECODE_6_BUTTON5, MOUSECODE_6_BUTTON6, MOUSECODE_7_BUTTON1, MOUSECODE_7_BUTTON2, MOUSECODE_7_BUTTON3, MOUSECODE_7_BUTTON4, MOUSECODE_7_BUTTON5, MOUSECODE_7_BUTTON6, MOUSECODE_8_BUTTON1, MOUSECODE_8_BUTTON2, MOUSECODE_8_BUTTON3, MOUSECODE_8_BUTTON4, MOUSECODE_8_BUTTON5, MOUSECODE_8_BUTTON6, JOYCODE_1_ANALOG_X, JOYCODE_1_ANALOG_Y, JOYCODE_1_ANALOG_Z, JOYCODE_1_ANALOG_PEDAL1, JOYCODE_1_ANALOG_PEDAL2, JOYCODE_1_ANALOG_PEDAL3, JOYCODE_2_ANALOG_X, JOYCODE_2_ANALOG_Y, JOYCODE_2_ANALOG_Z, JOYCODE_2_ANALOG_PEDAL1, JOYCODE_2_ANALOG_PEDAL2, JOYCODE_2_ANALOG_PEDAL3, JOYCODE_3_ANALOG_X, JOYCODE_3_ANALOG_Y, JOYCODE_3_ANALOG_Z, JOYCODE_3_ANALOG_PEDAL1, JOYCODE_3_ANALOG_PEDAL2, JOYCODE_3_ANALOG_PEDAL3, JOYCODE_4_ANALOG_X, JOYCODE_4_ANALOG_Y, JOYCODE_4_ANALOG_Z, JOYCODE_4_ANALOG_PEDAL1, JOYCODE_4_ANALOG_PEDAL2, JOYCODE_4_ANALOG_PEDAL3, JOYCODE_5_ANALOG_X, JOYCODE_5_ANALOG_Y, JOYCODE_5_ANALOG_Z, JOYCODE_5_ANALOG_PEDAL1, JOYCODE_5_ANALOG_PEDAL2, JOYCODE_5_ANALOG_PEDAL3, JOYCODE_6_ANALOG_X, JOYCODE_6_ANALOG_Y, JOYCODE_6_ANALOG_Z, JOYCODE_6_ANALOG_PEDAL1, JOYCODE_6_ANALOG_PEDAL2, JOYCODE_6_ANALOG_PEDAL3, JOYCODE_7_ANALOG_X, JOYCODE_7_ANALOG_Y, JOYCODE_7_ANALOG_Z, JOYCODE_7_ANALOG_PEDAL1, JOYCODE_7_ANALOG_PEDAL2, JOYCODE_7_ANALOG_PEDAL3, JOYCODE_8_ANALOG_X, JOYCODE_8_ANALOG_Y, JOYCODE_8_ANALOG_Z, JOYCODE_8_ANALOG_PEDAL1, JOYCODE_8_ANALOG_PEDAL2, JOYCODE_8_ANALOG_PEDAL3, GUNCODE_1_ANALOG_X, GUNCODE_1_ANALOG_Y, GUNCODE_2_ANALOG_X, GUNCODE_2_ANALOG_Y, GUNCODE_3_ANALOG_X, GUNCODE_3_ANALOG_Y, GUNCODE_4_ANALOG_X, GUNCODE_4_ANALOG_Y, GUNCODE_5_ANALOG_X, GUNCODE_5_ANALOG_Y, GUNCODE_6_ANALOG_X, GUNCODE_6_ANALOG_Y, GUNCODE_7_ANALOG_X, GUNCODE_7_ANALOG_Y, GUNCODE_8_ANALOG_X, GUNCODE_8_ANALOG_Y, MOUSECODE_1_ANALOG_X, MOUSECODE_1_ANALOG_Y, MOUSECODE_1_ANALOG_Z, MOUSECODE_2_ANALOG_X, MOUSECODE_2_ANALOG_Y, MOUSECODE_2_ANALOG_Z, MOUSECODE_3_ANALOG_X, MOUSECODE_3_ANALOG_Y, MOUSECODE_3_ANALOG_Z, MOUSECODE_4_ANALOG_X, MOUSECODE_4_ANALOG_Y, MOUSECODE_4_ANALOG_Z, MOUSECODE_5_ANALOG_X, MOUSECODE_5_ANALOG_Y, MOUSECODE_5_ANALOG_Z, MOUSECODE_6_ANALOG_X, MOUSECODE_6_ANALOG_Y, MOUSECODE_6_ANALOG_Z, MOUSECODE_7_ANALOG_X, MOUSECODE_7_ANALOG_Y, MOUSECODE_7_ANALOG_Z, MOUSECODE_8_ANALOG_X, MOUSECODE_8_ANALOG_Y, MOUSECODE_8_ANALOG_Z, __code_max, CODE_NONE = 0x8000, CODE_OTHER_DIGITAL, CODE_OTHER_ANALOG_ABSOLUTE, CODE_OTHER_ANALOG_RELATIVE, CODE_DEFAULT, CODE_NOT, CODE_OR }; # 496 "src/input.h" typedef UINT32 input_code; typedef UINT32 os_code; struct _input_seq { input_code code[16]; }; typedef struct _input_seq input_seq; struct _os_code_info { char * name; os_code oscode; input_code inputcode; }; typedef struct _os_code_info os_code_info; # 541 "src/input.h" int code_init(void); void code_exit(void); INT32 code_analog_value(input_code code); int code_pressed(input_code code); int code_pressed_memory(input_code code); int code_pressed_memory_repeat(input_code code, int speed); input_code code_read_async(void); int code_analog_type(input_code code); const char *code_name(input_code code); input_code token_to_code(const char *token); void code_to_token(input_code code, char *token); void seq_set_0(input_seq *seq); void seq_set_1(input_seq *seq, input_code code); void seq_set_2(input_seq *seq, input_code code1, input_code code2); void seq_set_3(input_seq *seq, input_code code1, input_code code2, input_code code3); void seq_set_4(input_seq *seq, input_code code1, input_code code2, input_code code3, input_code code4); void seq_set_5(input_seq *seq, input_code code1, input_code code2, input_code code3, input_code code4, input_code code5); void seq_copy(input_seq *seqdst, const input_seq *seqsrc); int seq_cmp(const input_seq *seqa, const input_seq *seqb); void seq_name(const input_seq *seq, char *buffer, unsigned max); int seq_pressed(const input_seq *seq); INT32 seq_analog_value(const input_seq *seq, int *analogtype); void seq_read_async_start(int analog); int seq_read_async(input_seq *seq, int first); int string_to_seq(const char *string, input_seq *seq); void seq_to_string(const input_seq *seq, char *string, int maxlen); static __inline__ input_code seq_get_1(const input_seq *seq) { return seq->code[0]; } # 19 "src/inptport.h" 2 # 41 "src/inptport.h" enum { SEQ_TYPE_STANDARD = 0, SEQ_TYPE_INCREMENT = 1, SEQ_TYPE_DECREMENT = 2 }; enum { PORTCOND_ALWAYS = 0, PORTCOND_EQUALS, PORTCOND_NOTEQUALS }; enum { IPG_UI = 0, IPG_PLAYER1, IPG_PLAYER2, IPG_PLAYER3, IPG_PLAYER4, IPG_PLAYER5, IPG_PLAYER6, IPG_PLAYER7, IPG_PLAYER8, IPG_OTHER, IPG_TOTAL_GROUPS, IPG_INVALID }; enum { IPT_INVALID = 0, IPT_UNUSED, IPT_END, IPT_UNKNOWN, IPT_PORT, IPT_DIPSWITCH_NAME, IPT_DIPSWITCH_SETTING, IPT_VBLANK, IPT_KEYBOARD, IPT_CONFIG_NAME, IPT_CONFIG_SETTING, IPT_START, IPT_SELECT, IPT_CATEGORY_NAME, IPT_CATEGORY_SETTING, IPT_JOYSTICK_UP, IPT_JOYSTICK_DOWN, IPT_JOYSTICK_LEFT, IPT_JOYSTICK_RIGHT, IPT_JOYSTICKRIGHT_UP, IPT_JOYSTICKRIGHT_DOWN, IPT_JOYSTICKRIGHT_LEFT, IPT_JOYSTICKRIGHT_RIGHT, IPT_JOYSTICKLEFT_UP, IPT_JOYSTICKLEFT_DOWN, IPT_JOYSTICKLEFT_LEFT, IPT_JOYSTICKLEFT_RIGHT, IPT_BUTTON1, IPT_BUTTON2, IPT_BUTTON3, IPT_BUTTON4, IPT_BUTTON5, IPT_BUTTON6, IPT_BUTTON7, IPT_BUTTON8, IPT_BUTTON9, IPT_BUTTON10, IPT_START1, IPT_START2, IPT_START3, IPT_START4, IPT_START5, IPT_START6, IPT_START7, IPT_START8, IPT_COIN1, IPT_COIN2, IPT_COIN3, IPT_COIN4, IPT_COIN5, IPT_COIN6, IPT_COIN7, IPT_COIN8, IPT_BILL1, IPT_SERVICE1, IPT_SERVICE2, IPT_SERVICE3, IPT_SERVICE4, IPT_SERVICE, IPT_TILT, IPT_INTERLOCK, IPT_VOLUME_UP, IPT_VOLUME_DOWN, IPT_MAHJONG_A, IPT_MAHJONG_B, IPT_MAHJONG_C, IPT_MAHJONG_D, IPT_MAHJONG_E, IPT_MAHJONG_F, IPT_MAHJONG_G, IPT_MAHJONG_H, IPT_MAHJONG_I, IPT_MAHJONG_J, IPT_MAHJONG_K, IPT_MAHJONG_L, IPT_MAHJONG_M, IPT_MAHJONG_N, IPT_MAHJONG_O, IPT_MAHJONG_P, IPT_MAHJONG_Q, IPT_MAHJONG_KAN, IPT_MAHJONG_PON, IPT_MAHJONG_CHI, IPT_MAHJONG_REACH, IPT_MAHJONG_RON, IPT_MAHJONG_BET, IPT_MAHJONG_LAST_CHANCE, IPT_MAHJONG_SCORE, IPT_MAHJONG_DOUBLE_UP, IPT_MAHJONG_FLIP_FLOP, IPT_MAHJONG_BIG, IPT_MAHJONG_SMALL, IPT_PADDLE, IPT_PADDLE_V, IPT_AD_STICK_X, IPT_AD_STICK_Y, IPT_AD_STICK_Z, IPT_LIGHTGUN_X, IPT_LIGHTGUN_Y, IPT_PEDAL, IPT_PEDAL2, IPT_PEDAL3, IPT_DIAL, IPT_DIAL_V, IPT_TRACKBALL_X, IPT_TRACKBALL_Y, IPT_MOUSE_X, IPT_MOUSE_Y, IPT_ADJUSTER, IPT_UI_CONFIGURE, IPT_UI_ON_SCREEN_DISPLAY, IPT_UI_DEBUG_BREAK, IPT_UI_PAUSE, IPT_UI_RESET_MACHINE, IPT_UI_SHOW_GFX, IPT_UI_FRAMESKIP_DEC, IPT_UI_FRAMESKIP_INC, IPT_UI_THROTTLE, IPT_UI_SHOW_FPS, IPT_UI_SNAPSHOT, IPT_UI_RECORD_MOVIE, IPT_UI_TOGGLE_CHEAT, IPT_UI_UP, IPT_UI_DOWN, IPT_UI_LEFT, IPT_UI_RIGHT, IPT_UI_HOME, IPT_UI_END, IPT_UI_SELECT, IPT_UI_CANCEL, IPT_UI_CLEAR, IPT_UI_PAN_UP, IPT_UI_PAN_DOWN, IPT_UI_PAN_LEFT, IPT_UI_PAN_RIGHT, IPT_UI_SHOW_PROFILER, IPT_UI_TOGGLE_UI, IPT_UI_TOGGLE_DEBUG, IPT_UI_SAVE_STATE, IPT_UI_LOAD_STATE, IPT_UI_ADD_CHEAT, IPT_UI_DELETE_CHEAT, IPT_UI_SAVE_CHEAT, IPT_UI_WATCH_VALUE, IPT_UI_EDIT_CHEAT, IPT_UI_TOGGLE_CROSSHAIR, IPT_OSD_1, IPT_OSD_2, IPT_OSD_3, IPT_OSD_4, IPT_OSD_5, IPT_OSD_6, IPT_OSD_7, IPT_OSD_8, IPT_OSD_9, IPT_OSD_10, IPT_OSD_11, IPT_OSD_12, IPT_OSD_13, IPT_OSD_14, IPT_OSD_15, IPT_OSD_16, IPT_OTHER, IPT_SPECIAL, __ipt_max }; enum { STR_Off = 0, STR_On, STR_No, STR_Yes, STR_Lives, STR_Bonus_Life, STR_Difficulty, STR_Demo_Sounds, STR_Coinage, STR_Coin_A, STR_Coin_B, STR_9C_1C, STR_8C_1C, STR_7C_1C, STR_6C_1C, STR_5C_1C, STR_4C_1C, STR_3C_1C, STR_8C_3C, STR_4C_2C, STR_2C_1C, STR_5C_3C, STR_3C_2C, STR_4C_3C, STR_4C_4C, STR_3C_3C, STR_2C_2C, STR_1C_1C, STR_4C_5C, STR_3C_4C, STR_2C_3C, STR_4C_7C, STR_2C_4C, STR_1C_2C, STR_2C_5C, STR_2C_6C, STR_1C_3C, STR_2C_7C, STR_2C_8C, STR_1C_4C, STR_1C_5C, STR_1C_6C, STR_1C_7C, STR_1C_8C, STR_1C_9C, STR_Free_Play, STR_Cabinet, STR_Upright, STR_Cocktail, STR_Flip_Screen, STR_Service_Mode, STR_Pause, STR_Test, STR_Tilt, STR_Version, STR_Region, STR_International, STR_Japan, STR_USA, STR_Europe, STR_Asia, STR_World, STR_Hispanic, STR_Language, STR_English, STR_Japanese, STR_German, STR_French, STR_Italian, STR_Spanish, STR_Very_Easy, STR_Easiest, STR_Easier, STR_Easy, STR_Normal, STR_Medium, STR_Hard, STR_Harder, STR_Hardest, STR_Very_Hard, STR_Very_Low, STR_Low, STR_High, STR_Higher, STR_Highest, STR_Very_High, STR_Players, STR_Controls, STR_Dual, STR_Single, STR_Game_Time, STR_Continue_Price, STR_Controller, STR_Light_Gun, STR_Joystick, STR_Trackball, STR_Continues, STR_Allow_Continue, STR_Level_Select, STR_Infinite, STR_Stereo, STR_Mono, STR_Unused, STR_Unknown, STR_Standard, STR_Reverse, STR_Alternate, STR_None, STR_TOTAL }; # 404 "src/inptport.h" typedef struct _input_port_init_params input_port_init_params; struct _input_port_default_entry { UINT32 type; UINT8 group; UINT8 player; const char *token; const char *name; input_seq defaultseq; input_seq defaultincseq; input_seq defaultdecseq; }; typedef struct _input_port_default_entry input_port_default_entry; struct _input_port_entry { UINT32 mask; UINT32 default_value; UINT32 type; UINT8 unused; UINT8 cocktail; UINT8 player; UINT8 toggle; UINT8 impulse; UINT8 four_way; const char *name; input_seq seq; UINT16 category; struct { INT32 min; INT32 max; INT32 sensitivity; INT32 delta; INT32 centerdelta; UINT8 reverse; UINT8 reset; input_seq incseq; input_seq decseq; } analog; struct { const char *tag; } start; struct { const char *tag; UINT8 portnum; UINT8 condition; UINT32 mask; UINT32 value; } condition; # 490 "src/inptport.h" }; typedef struct _input_port_entry input_port_entry; # 656 "src/inptport.h" extern const char *input_port_default_strings[]; # 668 "src/inptport.h" int input_port_init(void (*construct_ipt)(input_port_init_params *)); void input_port_load(int config_type, xml_data_node *parentnode); void input_port_save(int config_type, xml_data_node *parentnode); input_port_entry *input_port_initialize(input_port_init_params *params, UINT32 type, const char *tag, UINT32 mask); input_port_entry *input_port_allocate(void (*construct_ipt)(input_port_init_params *), input_port_entry *memory); input_port_default_entry *get_input_port_list(void); const input_port_default_entry *get_input_port_list_defaults(void); int input_port_active(const input_port_entry *in); int port_type_is_analog(int type); int port_type_in_use(int type); int port_type_to_group(int type, int player); int port_tag_to_index(const char *tag); read8_handler port_tag_to_handler8(const char *tag); read16_handler port_tag_to_handler16(const char *tag); read32_handler port_tag_to_handler32(const char *tag); const char *input_port_name(const input_port_entry *in); input_seq *input_port_seq(input_port_entry *in, int seqtype); input_seq *input_port_default_seq(int type, int player, int seqtype); int input_port_condition(const input_port_entry *in); const char *port_type_to_token(int type, int player); int token_to_port_type(const char *string, int *player); int input_port_type_pressed(int type, int player); int input_ui_pressed(int code); int input_ui_pressed_repeat(int code, int speed); void input_port_update_defaults(void); void input_port_vblank_start(void); void input_port_vblank_end(void); void input_port_set_digital_value(int port, UINT32 value, UINT32 mask); UINT32 readinputport(int port); UINT32 readinputportbytag(const char *tag); UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue); UINT8 input_port_0_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_1_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_2_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_3_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_4_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_5_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_6_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_7_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_8_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_9_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_10_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_11_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_12_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_13_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_14_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_15_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_16_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_17_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_18_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_19_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_20_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_21_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_22_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_23_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_24_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_25_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_26_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_27_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_28_r(__attribute__((__unused__)) offs_t offset); UINT8 input_port_29_r(__attribute__((__unused__)) offs_t offset); UINT16 input_port_0_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_1_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_3_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_4_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_5_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_6_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_7_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_8_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_9_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_10_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_11_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_12_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_13_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_14_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_15_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_16_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_17_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_18_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_19_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_20_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_21_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_22_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_23_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_24_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_25_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_26_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_27_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_28_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 input_port_29_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT32 input_port_0_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_1_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_2_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_3_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_4_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_5_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_6_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_7_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_8_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_9_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_10_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_11_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_12_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_13_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_14_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_15_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_16_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_17_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_18_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_19_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_20_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_21_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_22_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_23_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_24_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_25_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_26_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_27_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_28_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); UINT32 input_port_29_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); # 19 "src/osdepend.h" 2 int osd_init(void); void osd_exit(void); # 35 "src/osdepend.h" struct _osd_create_params { int width, height; int aspect_x, aspect_y; int depth; int colors; float fps; int video_attributes; }; typedef struct _osd_create_params osd_create_params; # 72 "src/osdepend.h" int osd_create_display(const osd_create_params *params, UINT32 *rgb_components); void osd_close_display(void); # 86 "src/osdepend.h" int osd_skip_this_frame(void); # 102 "src/osdepend.h" void osd_update_video_and_audio(struct _mame_display *display); mame_bitmap *osd_override_snapshot(mame_bitmap *bitmap, rectangle *bounds); const char *osd_get_fps_text(const performance_info *performance); # 147 "src/osdepend.h" int osd_start_audio_stream(int stereo); int osd_update_audio_stream(INT16 *buffer); void osd_stop_audio_stream(void); # 158 "src/osdepend.h" void osd_set_mastervolume(int attenuation); int osd_get_mastervolume(void); void osd_sound_enable(int enable); # 174 "src/osdepend.h" const os_code_info *osd_get_code_list(void); INT32 osd_get_code_value(os_code oscode); # 192 "src/osdepend.h" int osd_readkey_unicode(int flush); # 203 "src/osdepend.h" void osd_customize_inputport_list(input_port_default_entry *defaults); int osd_joystick_needs_calibration(void); void osd_joystick_start_calibration(void); const char *osd_joystick_calibrate_next(void); void osd_joystick_calibrate(void); void osd_joystick_end_calibration(void); # 228 "src/osdepend.h" struct _inp_header { char name[9]; char version[3]; char reserved[20]; }; typedef struct _inp_header inp_header; enum { PATH_NOT_FOUND, PATH_IS_FILE, PATH_IS_DIRECTORY }; typedef enum { FILEERR_SUCCESS, FILEERR_FAILURE, FILEERR_OUT_OF_MEMORY, FILEERR_NOT_FOUND, FILEERR_ACCESS_DENIED, FILEERR_ALREADY_OPEN, FILEERR_TOO_MANY_FILES } osd_file_error; int osd_get_path_count(int pathtype); int osd_get_path_info(int pathtype, int pathindex, const char *filename); osd_file *osd_fopen(int pathtype, int pathindex, const char *filename, const char *mode, osd_file_error *error); int osd_fseek(osd_file *file, INT64 offset, int whence); UINT64 osd_ftell(osd_file *file); int osd_feof(osd_file *file); UINT32 osd_fread(osd_file *file, void *buffer, UINT32 length); UINT32 osd_fwrite(osd_file *file, const void *buffer, UINT32 length); void osd_fclose(osd_file *file); # 293 "src/osdepend.h" typedef INT64 cycles_t; cycles_t osd_cycles(void); cycles_t osd_cycles_per_second(void); cycles_t osd_profiling_ticks(void); # 315 "src/osdepend.h" void *osd_alloc_executable(size_t size); void osd_free_executable(void *ptr); int osd_display_loading_rom_message(const char *name,rom_load_data *romdata); void osd_pause(int paused); int osd_is_bad_read_ptr(const void *ptr, size_t size); void osd_die(const char *text,...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn)); # 342 "src/osdepend.h" void logerror(const char *text,...) __attribute__((format(printf, 1, 2))); # 64 "src/driver.h" 2 # 1 "src/debug/mamedbg.h" 1 # 16 "src/debug/mamedbg.h" # 1 "src/mame.h" 1 # 12 "src/mame.h" # 22 "src/mame.h" # 1 "src/fileio.h" 1 # 12 "src/fileio.h" # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 1 3 4 # 105 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 3 4 typedef __gnuc_va_list va_list; # 18 "src/fileio.h" 2 # 1 "src/chd.h" 1 # 10 "src/chd.h" # 113 "src/chd.h" enum { CHDERR_NONE, CHDERR_NO_INTERFACE, CHDERR_OUT_OF_MEMORY, CHDERR_INVALID_FILE, CHDERR_INVALID_PARAMETER, CHDERR_INVALID_DATA, CHDERR_FILE_NOT_FOUND, CHDERR_REQUIRES_PARENT, CHDERR_FILE_NOT_WRITEABLE, CHDERR_READ_ERROR, CHDERR_WRITE_ERROR, CHDERR_CODEC_ERROR, CHDERR_INVALID_PARENT, CHDERR_HUNK_OUT_OF_RANGE, CHDERR_DECOMPRESSION_ERROR, CHDERR_COMPRESSION_ERROR, CHDERR_CANT_CREATE_FILE, CHDERR_CANT_VERIFY, CHDERR_NOT_SUPPORTED, CHDERR_METADATA_NOT_FOUND, CHDERR_INVALID_METADATA_SIZE, CHDERR_UNSUPPORTED_VERSION }; # 147 "src/chd.h" struct _chd_header { UINT32 length; UINT32 version; UINT32 flags; UINT32 compression; UINT32 hunkbytes; UINT32 totalhunks; UINT64 logicalbytes; UINT64 metaoffset; UINT8 md5[16]; UINT8 parentmd5[16]; UINT8 sha1[20]; UINT8 parentsha1[20]; UINT32 obsolete_cylinders; UINT32 obsolete_sectors; UINT32 obsolete_heads; UINT32 obsolete_hunksize; }; typedef struct _chd_header chd_header; typedef struct _chd_file chd_file; typedef struct _chd_exfile chd_exfile; typedef struct _chd_interface_file chd_interface_file; struct _chd_interface { chd_interface_file *(*open)(const char *filename, const char *mode); void (*close)(chd_interface_file *file); UINT32 (*read)(chd_interface_file *file, UINT64 offset, UINT32 count, void *buffer); UINT32 (*write)(chd_interface_file *file, UINT64 offset, UINT32 count, const void *buffer); UINT64 (*length)(chd_interface_file *file); }; typedef struct _chd_interface chd_interface; # 193 "src/chd.h" void chd_set_interface(chd_interface *new_interface); void chd_save_interface(chd_interface *interface_save); int chd_create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 compression, chd_file *parent); chd_file *chd_open(const char *filename, int writeable, chd_file *parent); void chd_close(chd_file *chd); void chd_close_all(void); UINT32 chd_get_metadata(chd_file *chd, UINT32 *metatag, UINT32 metaindex, void *outputbuf, UINT32 outputlen); int chd_set_metadata(chd_file *chd, UINT32 metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen); UINT32 chd_read(chd_file *chd, UINT32 hunknum, UINT32 hunkcount, void *buffer); UINT32 chd_write(chd_file *chd, UINT32 hunknum, UINT32 hunkcount, const void *buffer); int chd_get_last_error(void); const chd_header *chd_get_header(chd_file *chd); int chd_set_header(const char *filename, const chd_header *header); int chd_compress(chd_file *chd, const char *rawfile, UINT32 offset, void (*progress)(const char *, ...)); int chd_verify(chd_file *chd, void (*progress)(const char *, ...), UINT8 actualmd5[16], UINT8 actualsha1[20]); chd_exfile *chd_start_compress_ex(chd_file *chd); 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 *, ...)); int chd_end_compress_ex(chd_exfile *chdex, void (*progress)(const char *, ...)); # 21 "src/fileio.h" 2 enum { FILETYPE_RAW = 0, FILETYPE_ROM, FILETYPE_IMAGE, FILETYPE_IMAGE_DIFF, FILETYPE_SAMPLE, FILETYPE_ARTWORK, FILETYPE_NVRAM, FILETYPE_HIGHSCORE, FILETYPE_HIGHSCORE_DB, FILETYPE_CONFIG, FILETYPE_INPUTLOG, FILETYPE_STATE, FILETYPE_MEMCARD, FILETYPE_SCREENSHOT, FILETYPE_MOVIE, FILETYPE_HISTORY, FILETYPE_CHEAT, FILETYPE_LANGUAGE, FILETYPE_CTRLR, FILETYPE_INI, FILETYPE_end }; typedef struct _mame_file mame_file; extern chd_interface mame_chd_interface; int mame_faccess(const char *filename, int filetype); mame_file *mame_fopen(const char *gamename, const char *filename, int filetype, int openforwrite); mame_file *mame_fopen_error(const char *gamename, const char *filename, int filetype, int openforwrite, osd_file_error *error); mame_file *mame_fopen_rom(const char *gamename, const char *filename, const char *exphash); UINT32 mame_fread(mame_file *file, void *buffer, UINT32 length); UINT32 mame_fwrite(mame_file *file, const void *buffer, UINT32 length); UINT32 mame_fread_swap(mame_file *file, void *buffer, UINT32 length); UINT32 mame_fwrite_swap(mame_file *file, const void *buffer, UINT32 length); # 80 "src/fileio.h" int mame_fseek(mame_file *file, INT64 offset, int whence); void mame_fclose(mame_file *file); int mame_fchecksum(const char *gamename, const char *filename, unsigned int *length, char *hash); UINT64 mame_fsize(mame_file *file); const char *mame_fhash(mame_file *file); int mame_fgetc(mame_file *file); int mame_ungetc(int c, mame_file *file); char *mame_fgets(char *s, int n, mame_file *file); int mame_feof(mame_file *file); UINT64 mame_ftell(mame_file *file); int mame_fputs(mame_file *f, const char *s); int mame_vfprintf(mame_file *f, const char *fmt, va_list va); int mame_fprintf(mame_file *f, const char *fmt, ...) __attribute__((format(printf, 2, 3))); # 23 "src/mame.h" 2 # 1 "src/drawgfx.h" 1 # 12 "src/drawgfx.h" # 1 "src/palette.h" 1 # 73 "src/palette.h" # 83 "src/palette.h" typedef UINT32 rgb_t; # 119 "src/palette.h" extern UINT32 direct_rgb_components[3]; extern UINT16 *palette_shadow_table; extern UINT8 *paletteram; extern UINT8 *paletteram_2; extern UINT16 *paletteram16; extern UINT16 *paletteram16_2; extern UINT32 *paletteram32; int palette_start(void); int palette_init(void); int palette_get_total_colors_with_ui(void); void palette_update_display(mame_display *display); void palette_set_color(pen_t pen, UINT8 r, UINT8 g, UINT8 b); void palette_get_color(pen_t pen, UINT8 *r, UINT8 *g, UINT8 *b); void palette_set_colors(pen_t color_base, const UINT8 *colors, int color_count); void palette_set_brightness(pen_t pen, double bright); void palette_set_shadow_factor(double factor); void palette_set_highlight_factor(double factor); # 167 "src/palette.h" void palette_set_shadow_mode(int mode); void palette_set_shadow_factor32(double factor); void palette_set_highlight_factor32(double factor); void palette_set_shadow_dRGB32(int mode, int dr, int dg, int db, int noclip); void palette_set_highlight_method(int method); void palette_set_global_gamma(double _gamma); double palette_get_global_gamma(void); void palette_set_global_brightness(double brightness); void palette_set_global_brightness_adjust(double adjustment); double palette_get_global_brightness(void); pen_t get_black_pen(void); pen_t get_white_pen(void); UINT8 paletteram_r(__attribute__((__unused__)) offs_t offset); UINT8 paletteram_2_r(__attribute__((__unused__)) offs_t offset); UINT16 paletteram16_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 paletteram16_2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT32 paletteram32_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); void paletteram_BBGGGRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_RRRGGGBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_BBBGGGRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_IIBBGGRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_BBGGRRII_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxBBBBGGGGRRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxBBBBGGGGRRRR_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxBBBBGGGGRRRR_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxBBBBGGGGRRRR_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_xxxxBBBBGGGGRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram_xxxxBBBBRRRRGGGG_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxBBBBRRRRGGGG_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxBBBBRRRRGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxBBBBRRRRGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_xxxxBBBBRRRRGGGG_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram_xxxxRRRRBBBBGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxRRRRBBBBGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxRRRRGGGGBBBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xxxxRRRRGGGGBBBB_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_xxxxRRRRGGGGBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram_RRRRGGGGBBBBxxxx_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_RRRRGGGGBBBBxxxx_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_RRRRGGGGBBBBxxxx_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_RRRRGGGGBBBBxxxx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram_BBBBGGGGRRRRxxxx_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_BBBBGGGGRRRRxxxx_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_BBBBGGGGRRRRxxxx_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_BBBBGGGGRRRRxxxx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram_xBBBBBGGGGGRRRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xBBBBBGGGGGRRRRR_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xBBBBBGGGGGRRRRR_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xBBBBBGGGGGRRRRR_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_xBBBBBGGGGGRRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram_xBBBBBRRRRRGGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xBBBBBRRRRRGGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram_xRRRRRGGGGGBBBBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_xRRRRRGGGGGBBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram16_xGGGGGRRRRRBBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram16_xGGGGGBBBBBRRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram_RRRRRGGGGGBBBBBx_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void paletteram16_RRRRRGGGGGBBBBBx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram16_IIIIRRRRGGGGBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram16_RRRRGGGGBBBBIIII_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram16_xrgb_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram16_xbgr_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void paletteram16_RRRRGGGGBBBBRGBx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); # 254 "src/palette.h" void palette_init_black_and_white(UINT16 *colortable, const UINT8 *color_prom); void palette_init_RRRR_GGGG_BBBB(UINT16 *colortable, const UINT8 *color_prom); # 18 "src/drawgfx.h" 2 # 33 "src/drawgfx.h" struct _gfx_layout { UINT16 width,height; UINT32 total; UINT16 planes; UINT32 planeoffset[8]; UINT32 xoffset[256]; UINT32 yoffset[256]; UINT32 charincrement; }; typedef struct _gfx_layout gfx_layout; # 61 "src/drawgfx.h" struct _gfx_element { UINT16 width,height; UINT32 total_elements; UINT16 color_granularity; UINT32 total_colors; pen_t *colortable; UINT32 *pen_usage; UINT8 *gfxdata; UINT32 line_modulo; UINT32 char_modulo; UINT32 flags; gfx_layout layout; }; typedef struct _gfx_element gfx_element; struct _gfx_decode { int memory_region; UINT32 start; const gfx_layout *gfxlayout; UINT16 color_codes_start; UINT16 total_color_codes; }; typedef struct _gfx_decode gfx_decode; struct _alpha_cache { const UINT8 *alphas; const UINT8 *alphad; UINT8 alpha[0x101][0x100]; }; typedef struct _alpha_cache alpha_cache; extern struct _alpha_cache drawgfx_alpha_cache; enum { TRANSPARENCY_NONE, TRANSPARENCY_NONE_RAW, TRANSPARENCY_PEN, TRANSPARENCY_PEN_RAW, TRANSPARENCY_PENS, TRANSPARENCY_PENS_RAW, TRANSPARENCY_COLOR, TRANSPARENCY_PEN_TABLE, TRANSPARENCY_PEN_TABLE_RAW, TRANSPARENCY_BLEND, TRANSPARENCY_BLEND_RAW, TRANSPARENCY_ALPHAONE, TRANSPARENCY_ALPHA, TRANSPARENCY_ALPHARANGE, TRANSPARENCY_MODES }; extern UINT8 gfx_alpharange_table[256]; extern UINT8 gfx_drawmode_table[256]; enum { DRAWMODE_NONE, DRAWMODE_SOURCE, DRAWMODE_SHADOW }; extern int pdrawgfx_shadow_lowpri; void decodechar(gfx_element *gfx,int num,const unsigned char *src,const gfx_layout *gl); gfx_element *allocgfx(const gfx_layout *gl); void decodegfx(gfx_element *gfx, const UINT8 *src, UINT32 first, UINT32 count); void set_pixel_functions(mame_bitmap *bitmap); void freegfx(gfx_element *gfx); void drawgfx(mame_bitmap *dest,const gfx_element *gfx, unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color); void pdrawgfx(mame_bitmap *dest,const gfx_element *gfx, unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color, UINT32 priority_mask); void mdrawgfx(mame_bitmap *dest,const gfx_element *gfx, unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color, UINT32 priority_mask); void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color); void copybitmap_remap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color); void copyscrollbitmap(mame_bitmap *dest,mame_bitmap *src, int rows,const int *rowscroll,int cols,const int *colscroll, const rectangle *clip,int transparency,int transparent_color); void copyscrollbitmap_remap(mame_bitmap *dest,mame_bitmap *src, int rows,const int *rowscroll,int cols,const int *colscroll, const rectangle *clip,int transparency,int transparent_color); void draw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,pen_t *pens,int transparent_pen); void draw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,pen_t *pens,int transparent_pen); void pdraw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,pen_t *pens,int transparent_pen,int pri); void pdraw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,pen_t *pens,int transparent_pen,int pri); void extract_scanline8(mame_bitmap *bitmap,int x,int y,int length,UINT8 *dst); void extract_scanline16(mame_bitmap *bitmap,int x,int y,int length,UINT16 *dst); extern int alpha_active; void alpha_init(void); static __inline__ void alpha_set_level(int level) { if(level == 0) level = -1; drawgfx_alpha_cache.alphas = drawgfx_alpha_cache.alpha[level+1]; drawgfx_alpha_cache.alphad = drawgfx_alpha_cache.alpha[255-level]; } static __inline__ UINT32 alpha_blend16( UINT32 d, UINT32 s ) { const UINT8 *alphas = drawgfx_alpha_cache.alphas; const UINT8 *alphad = drawgfx_alpha_cache.alphad; return (alphas[s & 0x1f] | (alphas[(s>>5) & 0x1f] << 5) | (alphas[(s>>10) & 0x1f] << 10)) + (alphad[d & 0x1f] | (alphad[(d>>5) & 0x1f] << 5) | (alphad[(d>>10) & 0x1f] << 10)); } static __inline__ UINT32 alpha_blend32( UINT32 d, UINT32 s ) { const UINT8 *alphas = drawgfx_alpha_cache.alphas; const UINT8 *alphad = drawgfx_alpha_cache.alphad; return (alphas[s & 0xff] | (alphas[(s>>8) & 0xff] << 8) | (alphas[(s>>16) & 0xff] << 16)) + (alphad[d & 0xff] | (alphad[(d>>8) & 0xff] << 8) | (alphad[(d>>16) & 0xff] << 16)); } static __inline__ UINT32 alpha_blend_r16( UINT32 d, UINT32 s, UINT8 level ) { const UINT8 *alphas = drawgfx_alpha_cache.alpha[level]; const UINT8 *alphad = drawgfx_alpha_cache.alpha[255 - level]; return (alphas[s & 0x1f] | (alphas[(s>>5) & 0x1f] << 5) | (alphas[(s>>10) & 0x1f] << 10)) + (alphad[d & 0x1f] | (alphad[(d>>5) & 0x1f] << 5) | (alphad[(d>>10) & 0x1f] << 10)); } static __inline__ UINT32 alpha_blend_r32( UINT32 d, UINT32 s, UINT8 level ) { const UINT8 *alphas = drawgfx_alpha_cache.alpha[level]; const UINT8 *alphad = drawgfx_alpha_cache.alpha[255 - level]; return (alphas[s & 0xff] | (alphas[(s>>8) & 0xff] << 8) | (alphas[(s>>16) & 0xff] << 16)) + (alphad[d & 0xff] | (alphad[(d>>8) & 0xff] << 8) | (alphad[(d>>16) & 0xff] << 16)); } # 258 "src/drawgfx.h" void copyrozbitmap(mame_bitmap *dest,mame_bitmap *src, UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound, const rectangle *clip,int transparency,int transparent_color,UINT32 priority); void fillbitmap(mame_bitmap *dest,pen_t pen,const rectangle *clip); void drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx, unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley); void pdrawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx, unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley, UINT32 priority_mask); void mdrawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx, unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy, const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley, UINT32 priority_mask); void drawgfx_toggle_crosshair(void); void draw_crosshair(mame_bitmap *bitmap,int x,int y,const rectangle *clip,int player); # 24 "src/mame.h" 2 extern char build_version[]; # 70 "src/mame.h" struct _region_info { UINT8 * base; size_t length; UINT32 type; UINT32 flags; }; typedef struct _region_info region_info; struct _running_machine { const game_driver * gamedrv; const machine_config * drv; region_info memory_region[32]; int rom_load_warnings; gfx_element * gfx[32]; mame_bitmap * scrbitmap; rectangle visible_area; rectangle absolute_visible_area; float refresh_rate; pen_t * pens; UINT16 * game_colortable; pen_t * remapped_colortable; int color_depth; int sample_rate; input_port_entry * input_ports; input_port_entry * input_ports_default; int ui_orientation; mame_bitmap * debug_bitmap; pen_t * debug_pens; pen_t * debug_remapped_colortable; gfx_element * debugger_font; }; typedef struct _running_machine running_machine; # 197 "src/mame.h" struct _global_options { mame_file * record; mame_file * playback; mame_file * language_file; int mame_debug; int cheat; int gui_host; int skip_disclaimer; int skip_gameinfo; int skip_warnings; int samplerate; int use_samples; float brightness; float pause_bright; float gamma; int vector_width; int vector_height; int ui_orientation; int beam; float vector_flicker; float vector_intensity; int translucency; int antialias; int use_artwork; int artwork_res; int artwork_crop; const char * savegame; int auto_save; char * bios; int debug_width; int debug_height; int debug_depth; const char *controller; # 249 "src/mame.h" }; typedef struct _global_options global_options; # 279 "src/mame.h" struct _mame_display { UINT32 changed_flags; mame_bitmap * game_bitmap; rectangle game_bitmap_update; const rgb_t * game_palette; UINT32 game_palette_entries; UINT32 * game_palette_dirty; rectangle game_visible_area; float game_refresh_rate; void * vector_dirty_pixels; mame_bitmap * debug_bitmap; const rgb_t * debug_palette; UINT32 debug_palette_entries; UINT8 debug_focus; UINT8 led_state; }; # 313 "src/mame.h" struct _performance_info { double game_speed_percent; double frames_per_second; int vector_updates_last_second; int partial_updates_this_frame; }; # 330 "src/mame.h" extern global_options options; extern running_machine *Machine; # 344 "src/mame.h" int run_game(int game); void expand_machine_driver(void (*constructor)(machine_config *), machine_config *output); void mame_pause(int pause); int mame_is_paused(void); void set_visible_area(int min_x, int max_x, int min_y, int max_y); void set_refresh_rate(float fps); void schedule_full_refresh(void); void reset_partial_updates(void); void force_partial_update(int scanline); void draw_screen(void); void update_video_and_audio(void); int updatescreen(void); int mame_highscore_enabled(void); void set_led_status(int num, int on); const performance_info *mame_get_performance_info(void); int mame_find_cpu_index(const char *tag); int mame_validitychecks(void); # 17 "src/debug/mamedbg.h" 2 extern int mame_debug; # 66 "src/driver.h" 2 # 1 "src/common.h" 1 # 12 "src/common.h" # 1 "src/hash.h" 1 # 12 "src/hash.h" # 31 "src/hash.h" const char* hash_function_name(unsigned int function); int hash_data_has_checksum(const char* d, unsigned int function); int hash_data_extract_binary_checksum(const char* d, unsigned int function, unsigned char* checksum); int hash_data_extract_printable_checksum(const char* d, unsigned int function, char* checksum); int hash_data_insert_binary_checksum(char* d, unsigned int function, const unsigned char* checksum); int hash_data_insert_printable_checksum(char* d, unsigned int function, const char* checksum); int hash_data_has_info(const char* d, unsigned int info); int hash_data_is_equal(const char* d1, const char* d2, unsigned int functions); void hash_data_print(const char* d, unsigned int functions, char* buffer); void hash_data_copy(char* dst, const char* src); void hash_data_clear(char* dst); unsigned int hash_data_used_functions(const char* d); void hash_compute(char* dst, const unsigned char* data, unsigned long length, unsigned int functions); int hash_verify_string(const char *hash); # 18 "src/common.h" 2 # 1 "src/xmlfile.h" 1 # 12 "src/xmlfile.h" # 28 "src/xmlfile.h" struct _xml_attribute_node { struct _xml_attribute_node *next; const char *name; const char *value; }; typedef struct _xml_attribute_node xml_attribute_node; struct _xml_data_node { struct _xml_data_node *next; struct _xml_data_node *parent; struct _xml_data_node *child; const char *name; const char *value; xml_attribute_node *attribute; }; struct XML_ParserStruct; struct _xml_custom_parse { void (*init)(struct XML_ParserStruct *parser); size_t (*read)(void *param, void *buffer, size_t length); int (*eof)(void *param); void *param; int trim_whitespace; const char *error_message; int error_line; int error_column; xml_data_node **curnode; }; typedef struct _xml_custom_parse xml_custom_parse; # 76 "src/xmlfile.h" xml_data_node *xml_file_create(void); xml_data_node *xml_file_read(mame_file *file); xml_data_node *xml_file_read_custom(xml_custom_parse *parse_info); void xml_file_write(xml_data_node *node, mame_file *file); void xml_file_free(xml_data_node *node); int xml_count_children(xml_data_node *node); xml_data_node *xml_get_sibling(xml_data_node *node, const char *name); xml_data_node *xml_find_matching_sibling(xml_data_node *node, const char *name, const char *attribute, const char *matchval); xml_attribute_node *xml_get_attribute(xml_data_node *node, const char *attribute); const char *xml_get_attribute_string(xml_data_node *node, const char *attribute, const char *defvalue); int xml_get_attribute_int(xml_data_node *node, const char *attribute, int defvalue); float xml_get_attribute_float(xml_data_node *node, const char *attribute, float defvalue); xml_data_node *xml_add_child(xml_data_node *node, const char *name, const char *value); xml_data_node *xml_get_or_add_child(xml_data_node *node, const char *name, const char *value); xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, const char *value); xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, int value); xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *name, float value); void xml_delete_node(xml_data_node *node); # 19 "src/common.h" 2 # 29 "src/common.h" struct _rom_entry { const char *_name; UINT32 _offset; UINT32 _length; UINT32 _flags; const char *_hashdata; }; typedef struct _rom_entry rom_entry; struct _bios_entry { int value; const char *_name; const char *_description; }; typedef struct _bios_entry bios_entry; struct _rom_load_data { int warnings; int errors; int romsloaded; int romstotal; void * file; UINT8 * regionbase; UINT32 regionlength; char errorbuf[4096]; UINT8 tempbuf[65536]; }; # 75 "src/common.h" enum { REGION_INVALID = 0x80, REGION_CPU1, REGION_CPU2, REGION_CPU3, REGION_CPU4, REGION_CPU5, REGION_CPU6, REGION_CPU7, REGION_CPU8, REGION_GFX1, REGION_GFX2, REGION_GFX3, REGION_GFX4, REGION_GFX5, REGION_GFX6, REGION_GFX7, REGION_GFX8, REGION_PROMS, REGION_SOUND1, REGION_SOUND2, REGION_SOUND3, REGION_SOUND4, REGION_SOUND5, REGION_SOUND6, REGION_SOUND7, REGION_SOUND8, REGION_USER1, REGION_USER2, REGION_USER3, REGION_USER4, REGION_USER5, REGION_USER6, REGION_USER7, REGION_USER8, REGION_DISKS, REGION_MAX }; # 356 "src/common.h" extern unsigned int dispensed_tickets; extern unsigned int coin_count[8]; extern unsigned int coinlockedout[8]; # 368 "src/common.h" void showdisclaimer(void); UINT8 *memory_region(int num); size_t memory_region_length(int num); int new_memory_region(int num, size_t length, UINT32 flags); void free_memory_region(int num); void counters_load(int config_type, xml_data_node *parentnode); void counters_save(int config_type, xml_data_node *parentnode); void coin_counter_reset(void); void coin_counter_w(int num,int on); void coin_lockout_w(int num,int on); void coin_lockout_global_w(int on); extern size_t generic_nvram_size; extern UINT8 *generic_nvram; extern UINT16 *generic_nvram16; extern UINT32 *generic_nvram32; void nvram_handler_generic_0fill(mame_file *file, int read_or_write); void nvram_handler_generic_1fill(mame_file *file, int read_or_write); void nvram_handler_generic_randfill(mame_file *file, int read_or_write); mame_bitmap *bitmap_alloc(int width,int height); mame_bitmap *bitmap_alloc_depth(int width,int height,int depth); void bitmap_free(mame_bitmap *bitmap); void begin_resource_tracking(void); void end_resource_tracking(void); static __inline__ int get_resource_tag(void) { extern int resource_tracking_tag; return resource_tracking_tag; } void *auto_malloc(size_t size) __attribute__((malloc)); char *auto_strdup(const char *str) __attribute__((malloc)); mame_bitmap *auto_bitmap_alloc(int width,int height); mame_bitmap *auto_bitmap_alloc_depth(int width,int height,int depth); # 425 "src/common.h" void save_screen_snapshot_as(mame_file *fp, mame_bitmap *bitmap); void save_screen_snapshot(mame_bitmap *bitmap); void record_movie_toggle(void); void record_movie_stop(void); void record_movie_frame(mame_bitmap *bitmap); chd_file *get_disk_handle(int diskindex); int rom_load(const rom_entry *romp); const rom_entry *rom_first_region(const game_driver *drv); const rom_entry *rom_next_region(const rom_entry *romp); const rom_entry *rom_first_file(const rom_entry *romp); const rom_entry *rom_next_file(const rom_entry *romp); const rom_entry *rom_first_chunk(const rom_entry *romp); const rom_entry *rom_next_chunk(const rom_entry *romp); # 68 "src/driver.h" 2 # 1 "src/cpuintrf.h" 1 # 12 "src/cpuintrf.h" # 1 "src/timer.h" 1 # 13 "src/timer.h" # 30 "src/timer.h" typedef INT64 subseconds_t; typedef INT32 seconds_t; struct _mame_time { seconds_t seconds; subseconds_t subseconds; }; typedef struct _mame_time mame_time; extern mame_time time_zero; extern mame_time time_never; extern subseconds_t subseconds_per_cycle[]; extern UINT32 cycles_per_second[]; # 55 "src/timer.h" extern double cycles_to_sec[]; extern double sec_to_cycles[]; # 74 "src/timer.h" typedef struct _mame_timer mame_timer; void timer_init(void); void timer_free(void); int timer_count_anonymous(void); mame_time mame_timer_next_fire_time(void); void mame_timer_set_global_time(mame_time newbase); mame_timer *_mame_timer_alloc(void (*callback)(int), const char *file, int line, const char *func); mame_timer *_mame_timer_alloc_ptr(void (*callback)(void *), void *param, const char *file, int line, const char *func); void mame_timer_adjust(mame_timer *which, mame_time duration, int param, mame_time period); void mame_timer_adjust_ptr(mame_timer *which, mame_time duration, mame_time period); void _mame_timer_pulse(mame_time period, int param, void (*callback)(int), const char *file, int line, const char *func); void _mame_timer_pulse_ptr(mame_time period, void *param, void (*callback)(void *), const char *file, int line, const char *func); void _mame_timer_set(mame_time duration, int param, void (*callback)(int), const char *file, int line, const char *func); void _mame_timer_set_ptr(mame_time duration, void *param, void (*callback)(void *), const char *file, int line, const char *func); void mame_timer_reset(mame_timer *which, mame_time duration); int mame_timer_enable(mame_timer *which, int enable); mame_time mame_timer_timeelapsed(mame_timer *which); mame_time mame_timer_timeleft(mame_timer *which); mame_time mame_timer_get_time(void); mame_time mame_timer_starttime(mame_timer *which); mame_time mame_timer_firetime(mame_timer *which); # 145 "src/timer.h" static __inline__ mame_time make_mame_time(seconds_t _secs, subseconds_t _subsecs) { mame_time result; result.seconds = _secs; result.subseconds = _subsecs; return result; } static __inline__ double mame_time_to_double(mame_time _time) { return (double)_time.seconds + ((double)(_time.subseconds) * (1.0 / (double)((subseconds_t)1000000000 * (subseconds_t)1000000000))); } static __inline__ mame_time double_to_mame_time(double _time) { mame_time abstime; if (_time >= (1.0e30)) return time_never; abstime.seconds = (INT64)_time; _time -= (double)abstime.seconds; abstime.subseconds = ((subseconds_t)((_time) * (double)((subseconds_t)1000000000 * (subseconds_t)1000000000))); return abstime; } static __inline__ mame_time add_mame_times(mame_time _time1, mame_time _time2) { mame_time result; if (_time1.seconds >= ((seconds_t)1000000000) || _time2.seconds >= ((seconds_t)1000000000)) return time_never; result.subseconds = _time1.subseconds + _time2.subseconds; result.seconds = _time1.seconds + _time2.seconds; if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000)) { result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000); result.seconds++; } return result; } static __inline__ mame_time add_subseconds_to_mame_time(mame_time _time1, subseconds_t _subseconds) { mame_time result; if (_time1.seconds >= ((seconds_t)1000000000)) return time_never; result.subseconds = _time1.subseconds + _subseconds; result.seconds = _time1.seconds; if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000)) { result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000); result.seconds++; } return result; } static __inline__ mame_time sub_mame_times(mame_time _time1, mame_time _time2) { mame_time result; if (_time1.seconds >= ((seconds_t)1000000000)) return time_never; result.subseconds = _time1.subseconds - _time2.subseconds; result.seconds = _time1.seconds - _time2.seconds; if (result.subseconds < 0) { result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000); result.seconds--; } return result; } static __inline__ mame_time sub_subseconds_from_mame_time(mame_time _time1, subseconds_t _subseconds) { mame_time result; if (_time1.seconds >= ((seconds_t)1000000000)) return time_never; result.subseconds = _time1.subseconds - _subseconds; result.seconds = _time1.seconds; if (result.subseconds < 0) { result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000); result.seconds--; } return result; } static __inline__ int compare_mame_times(mame_time _time1, mame_time _time2) { if (_time1.seconds > _time2.seconds) return 1; if (_time1.seconds < _time2.seconds) return -1; if (_time1.subseconds > _time2.subseconds) return 1; if (_time1.subseconds < _time2.subseconds) return -1; return 0; } # 20 "src/cpuintrf.h" 2 # 29 "src/cpuintrf.h" enum { CPU_DUMMY, CPU_Z80, CPU_Z180, CPU_8080, CPU_8085A, CPU_M6502, CPU_M65C02, CPU_M65SC02, CPU_M65CE02, CPU_M6509, CPU_M6510, CPU_M6510T, CPU_M7501, CPU_M8502, CPU_N2A03, CPU_DECO16, CPU_M4510, CPU_H6280, CPU_I86, CPU_I88, CPU_I186, CPU_I188, CPU_I286, CPU_V20, CPU_V30, CPU_V33, CPU_V60, CPU_V70, CPU_I8035, CPU_I8039, CPU_I8048, CPU_N7751, CPU_I8X41, CPU_I8051, CPU_I8052, CPU_I8751, CPU_I8752, CPU_M6800, CPU_M6801, CPU_M6802, CPU_M6803, CPU_M6808, CPU_HD63701, CPU_NSC8105, CPU_M6805, CPU_M68705, CPU_HD63705, CPU_HD6309, CPU_M6809, CPU_M6809E, CPU_KONAMI, CPU_M68000, CPU_M68008, CPU_M68010, CPU_M68EC020, CPU_M68020, CPU_M68040, CPU_T11, CPU_S2650, CPU_TMS34010, CPU_TMS34020, CPU_TI990_10, CPU_TMS9900, CPU_TMS9940, CPU_TMS9980, CPU_TMS9985, CPU_TMS9989, CPU_TMS9995, CPU_TMS99100, CPU_TMS99105A, CPU_TMS99110A, CPU_Z8000, CPU_TMS32010, CPU_TMS32025, CPU_TMS32026, CPU_TMS32031, CPU_CCPU, CPU_ADSP2100, CPU_ADSP2101, CPU_ADSP2104, CPU_ADSP2105, CPU_ADSP2115, CPU_ADSP2181, CPU_PSXCPU, CPU_ASAP, CPU_UPD7810, CPU_UPD7807, CPU_JAGUARGPU, CPU_JAGUARDSP, CPU_R3000BE, CPU_R3000LE, CPU_R4600BE, CPU_R4600LE, CPU_R4700BE, CPU_R4700LE, CPU_R5000BE, CPU_R5000LE, CPU_QED5271BE, CPU_QED5271LE, CPU_RM7000BE, CPU_RM7000LE, CPU_ARM, CPU_ARM7, CPU_SH2, CPU_DSP32C, CPU_PIC16C54, CPU_PIC16C55, CPU_PIC16C56, CPU_PIC16C57, CPU_PIC16C58, CPU_G65816, CPU_SPC700, CPU_E116T, CPU_E116XT, CPU_E116XS, CPU_E116XSR, CPU_E132N, CPU_E132T, CPU_E132XN, CPU_E132XT, CPU_E132XS, CPU_E132XSR, CPU_GMS30C2116, CPU_GMS30C2132, CPU_GMS30C2216, CPU_GMS30C2232, CPU_I386, CPU_I486, CPU_PENTIUM, CPU_MEDIAGX, CPU_I960, CPU_H83002, CPU_V810, CPU_M37710, CPU_PPC403, CPU_PPC602, CPU_PPC603, CPU_SE3208, CPU_MC68HC11, CPU_ADSP21062, CPU_DSP56156, # 189 "src/cpuintrf.h" CPU_COUNT }; # 200 "src/cpuintrf.h" enum { CLEAR_LINE = 0, ASSERT_LINE, HOLD_LINE, PULSE_LINE, INTERNAL_CLEAR_LINE = 100 + CLEAR_LINE, INTERNAL_ASSERT_LINE = 100 + ASSERT_LINE, MAX_INPUT_LINES = 32+3, INPUT_LINE_IRQ0 = 0, INPUT_LINE_IRQ1 = 1, INPUT_LINE_IRQ2 = 2, INPUT_LINE_IRQ3 = 3, INPUT_LINE_IRQ4 = 4, INPUT_LINE_IRQ5 = 5, INPUT_LINE_IRQ6 = 6, INPUT_LINE_IRQ7 = 7, INPUT_LINE_IRQ8 = 8, INPUT_LINE_IRQ9 = 9, INPUT_LINE_NMI = MAX_INPUT_LINES - 3, INPUT_LINE_RESET = MAX_INPUT_LINES - 2, INPUT_LINE_HALT = MAX_INPUT_LINES - 1, MAX_OUTPUT_LINES = 32 }; # 242 "src/cpuintrf.h" enum { MAX_REGS = 256 }; enum { CPUINFO_INT_FIRST = 0x00000, CPUINFO_INT_CONTEXT_SIZE = CPUINFO_INT_FIRST, CPUINFO_INT_INPUT_LINES, CPUINFO_INT_OUTPUT_LINES, CPUINFO_INT_DEFAULT_IRQ_VECTOR, CPUINFO_INT_ENDIANNESS, CPUINFO_INT_CLOCK_DIVIDER, CPUINFO_INT_MIN_INSTRUCTION_BYTES, CPUINFO_INT_MAX_INSTRUCTION_BYTES, CPUINFO_INT_MIN_CYCLES, CPUINFO_INT_MAX_CYCLES, CPUINFO_INT_DATABUS_WIDTH, CPUINFO_INT_DATABUS_WIDTH_LAST = CPUINFO_INT_DATABUS_WIDTH + 3 - 1, CPUINFO_INT_ADDRBUS_WIDTH, CPUINFO_INT_ADDRBUS_WIDTH_LAST = CPUINFO_INT_ADDRBUS_WIDTH + 3 - 1, CPUINFO_INT_ADDRBUS_SHIFT, CPUINFO_INT_ADDRBUS_SHIFT_LAST = CPUINFO_INT_ADDRBUS_SHIFT + 3 - 1, CPUINFO_INT_LOGADDR_WIDTH, CPUINFO_INT_LOGADDR_WIDTH_LAST = CPUINFO_INT_LOGADDR_WIDTH + 3 - 1, CPUINFO_INT_PAGE_SHIFT, CPUINFO_INT_PAGE_SHIFT_LAST = CPUINFO_INT_PAGE_SHIFT + 3 - 1, CPUINFO_INT_SP, CPUINFO_INT_PC, CPUINFO_INT_PREVIOUSPC, CPUINFO_INT_INPUT_STATE, CPUINFO_INT_INPUT_STATE_LAST = CPUINFO_INT_INPUT_STATE + MAX_INPUT_LINES - 1, CPUINFO_INT_OUTPUT_STATE, CPUINFO_INT_OUTPUT_STATE_LAST = CPUINFO_INT_OUTPUT_STATE + MAX_OUTPUT_LINES - 1, CPUINFO_INT_REGISTER, CPUINFO_INT_REGISTER_LAST = CPUINFO_INT_REGISTER + MAX_REGS - 1, CPUINFO_INT_CPU_SPECIFIC = 0x08000, CPUINFO_PTR_FIRST = 0x10000, CPUINFO_PTR_SET_INFO = CPUINFO_PTR_FIRST, CPUINFO_PTR_GET_CONTEXT, CPUINFO_PTR_SET_CONTEXT, CPUINFO_PTR_INIT, CPUINFO_PTR_RESET, CPUINFO_PTR_EXIT, CPUINFO_PTR_EXECUTE, CPUINFO_PTR_BURN, CPUINFO_PTR_DISASSEMBLE, CPUINFO_PTR_DISASSEMBLE_NEW, CPUINFO_PTR_TRANSLATE, CPUINFO_PTR_READ, CPUINFO_PTR_WRITE, CPUINFO_PTR_READOP, CPUINFO_PTR_DEBUG_SETUP_COMMANDS, CPUINFO_PTR_IRQ_CALLBACK, CPUINFO_PTR_INSTRUCTION_COUNTER, CPUINFO_PTR_REGISTER_LAYOUT, CPUINFO_PTR_WINDOW_LAYOUT, CPUINFO_PTR_INTERNAL_MEMORY_MAP, CPUINFO_PTR_INTERNAL_MEMORY_MAP_LAST = CPUINFO_PTR_INTERNAL_MEMORY_MAP + 3 - 1, CPUINFO_PTR_DEBUG_REGISTER_LIST, CPUINFO_PTR_CPU_SPECIFIC = 0x18000, CPUINFO_STR_FIRST = 0x20000, CPUINFO_STR_NAME = CPUINFO_STR_FIRST, CPUINFO_STR_CORE_FAMILY, CPUINFO_STR_CORE_VERSION, CPUINFO_STR_CORE_FILE, CPUINFO_STR_CORE_CREDITS, CPUINFO_STR_FLAGS, CPUINFO_STR_REGISTER, CPUINFO_STR_REGISTER_LAST = CPUINFO_STR_REGISTER + MAX_REGS - 1, CPUINFO_STR_CPU_SPECIFIC = 0x28000 }; union cpuinfo { INT64 i; void * p; genf * f; char * s; void (*setinfo)(UINT32 state, union cpuinfo *info); void (*getcontext)(void *context); void (*setcontext)(void *context); void (*init)(void); void (*reset)(void *param); void (*exit)(void); int (*execute)(int cycles); void (*burn)(int cycles); offs_t (*disassemble)(char *buffer, offs_t pc); offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes); int (*irqcallback)(int state); int (*translate)(int space, offs_t *address); int (*read)(int space, UINT32 offset, int size, UINT64 *value); int (*write)(int space, UINT32 offset, int size, UINT64 value); int (*readop)(UINT32 offset, int size, UINT64 *value); void (*setup_commands)(void); int * icount; construct_map_t internal_map; }; enum { REG_PREVIOUSPC = CPUINFO_INT_PREVIOUSPC - CPUINFO_INT_REGISTER, REG_PC = CPUINFO_INT_PC - CPUINFO_INT_REGISTER, REG_SP = CPUINFO_INT_SP - CPUINFO_INT_REGISTER }; enum { CPU_IS_LE = 0, CPU_IS_BE }; # 402 "src/cpuintrf.h" struct _cpu_interface { void (*get_info)(UINT32 state, union cpuinfo *info); void (*set_info)(UINT32 state, union cpuinfo *info); void (*get_context)(void *buffer); void (*set_context)(void *buffer); void (*init)(void); void (*reset)(void *param); void (*exit)(void); int (*execute)(int cycles); void (*burn)(int cycles); offs_t (*disassemble)(char *buffer, offs_t pc); offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes); int (*translate)(int space, offs_t *address); size_t context_size; INT8 address_shift; int * icount; }; typedef struct _cpu_interface cpu_interface; # 434 "src/cpuintrf.h" int cpuintrf_init(void); int cpuintrf_init_cpu(int cpunum, int cputype); void cpuintrf_exit_cpu(int cpunum); void cpuintrf_push_context(int cpunum); void cpuintrf_pop_context(void); char *cpuintrf_temp_str(void); void cpuintrf_set_dasm_override(offs_t (*dasm_override)(int cpunum, char *buffer, offs_t pc)); # 463 "src/cpuintrf.h" INT64 activecpu_get_info_int(UINT32 state); void *activecpu_get_info_ptr(UINT32 state); genf *activecpu_get_info_fct(UINT32 state); const char *activecpu_get_info_string(UINT32 state); void activecpu_set_info_int(UINT32 state, INT64 data); void activecpu_set_info_ptr(UINT32 state, void *data); void activecpu_set_info_fct(UINT32 state, genf *data); void activecpu_adjust_icount(int delta); int activecpu_get_icount(void); void activecpu_reset_banking(void); void activecpu_set_input_line(int irqline, int state); offs_t activecpu_get_physical_pc_byte(void); void activecpu_set_opbase(offs_t val); offs_t activecpu_dasm(char *buffer, offs_t pc); offs_t activecpu_dasm_new(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes); const char *activecpu_flags(void); const char *activecpu_dump_state(void); # 542 "src/cpuintrf.h" INT64 cpunum_get_info_int(int cpunum, UINT32 state); void *cpunum_get_info_ptr(int cpunum, UINT32 state); genf *cpunum_get_info_fct(int cpunum, UINT32 state); const char *cpunum_get_info_string(int cpunum, UINT32 state); void cpunum_set_info_int(int cpunum, UINT32 state, INT64 data); void cpunum_set_info_ptr(int cpunum, UINT32 state, void *data); void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data); int cpunum_execute(int cpunum, int cycles); void cpunum_reset(int cpunum, void *param, int (*irqack)(int)); UINT8 cpunum_read_byte(int cpunum, offs_t address); void cpunum_write_byte(int cpunum, offs_t address, UINT8 data); void *cpunum_get_context_ptr(int cpunum); offs_t cpunum_get_physical_pc_byte(int cpunum); void cpunum_set_opbase(int cpunum, offs_t val); offs_t cpunum_dasm(int cpunum, char *buffer, offs_t pc); offs_t cpunum_dasm_new(int cpunum, char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes); const char *cpunum_dump_state(int cpunum); # 622 "src/cpuintrf.h" INT64 cputype_get_info_int(int cputype, UINT32 state); void *cputype_get_info_ptr(int cputype, UINT32 state); genf *cputype_get_info_fct(int cputype, UINT32 state); const char *cputype_get_info_string(int cputype, UINT32 state); # 660 "src/cpuintrf.h" void cpu_dump_states(void); # 682 "src/cpuintrf.h" static __inline__ const cpu_interface *cputype_get_interface(int cputype) { extern cpu_interface cpuintrf[]; return &cpuintrf[cputype]; } static __inline__ int cpu_getactivecpu(void) { extern int activecpu; return activecpu; } static __inline__ int cpu_getexecutingcpu(void) { extern int executingcpu; return executingcpu; } static __inline__ int cpu_gettotalcpu(void) { extern int totalcpu; return totalcpu; } # 71 "src/driver.h" 2 # 1 "src/cpuexec.h" 1 # 12 "src/cpuexec.h" # 29 "src/cpuexec.h" struct _cpu_config { int cpu_type; int cpu_flags; int cpu_clock; construct_map_t construct_map[3][2]; void (*vblank_interrupt)(void); int vblank_interrupts_per_frame; void (*timed_interrupt)(void); double timed_interrupt_period; void * reset_param; const char *tag; }; typedef struct _cpu_config cpu_config; # 52 "src/cpuexec.h" enum { CPU_DISABLE = 0x0001 }; # 69 "src/cpuexec.h" int cpu_init(void); void cpu_run(void); void cpu_exit(void); void cpu_pause(int pause); void machine_reset(void); # 92 "src/cpuexec.h" enum { LOADSAVE_NONE, LOADSAVE_SAVE, LOADSAVE_SAVE_AND_EXIT, LOADSAVE_LOAD, LOADSAVE_LOAD_POSTRESET }; void cpu_loadsave_schedule(int type, char id); void cpu_loadsave_schedule_file(int type, const char *name); void cpu_loadsave_reset(void); void cpu_loadsave_warn(const char *msg); # 114 "src/cpuexec.h" void watchdog_reset_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); UINT8 watchdog_reset_r(__attribute__((__unused__)) offs_t offset); void watchdog_reset16_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); UINT16 watchdog_reset16_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); void watchdog_reset32_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask); UINT32 watchdog_reset32_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask); void watchdog_enable(int enable); # 138 "src/cpuexec.h" enum { SUSPEND_REASON_HALT = 0x0001, SUSPEND_REASON_RESET = 0x0002, SUSPEND_REASON_SPIN = 0x0004, SUSPEND_REASON_TRIGGER = 0x0008, SUSPEND_REASON_DISABLE = 0x0010, SUSPEND_ANY_REASON = ~0 }; void cpunum_suspend(int cpunum, int reason, int eatcycles); void cpunum_resume(int cpunum, int reason); int cpunum_is_suspended(int cpunum, int reason); void activecpu_abort_timeslice(void); mame_time cpunum_get_localtime(int cpunum); int cpunum_get_clock(int cpunum); void cpunum_set_clock(int cpunum, int clock); double cpunum_get_clockscale(int cpunum); void cpunum_set_clockscale(int cpunum, double clockscale); void cpu_boost_interleave(double timeslice_time, double boost_duration); # 189 "src/cpuexec.h" int cycles_currently_ran(void); int cycles_left_to_run(void); UINT32 activecpu_gettotalcycles(void); UINT64 activecpu_gettotalcycles64(void); UINT32 cpunum_gettotalcycles(int cpunum); UINT64 cpunum_gettotalcycles64(int cpunum); int activecpu_geticount(void); void activecpu_eat_cycles(int cycles); int cpu_scalebyfcount(int value); # 220 "src/cpuexec.h" void cpu_compute_scanline_timing(void); int cpu_getcurrentframe(void); int cpu_getscanline(void); mame_time cpu_getscanlinetime_mt(int scanline); double cpu_getscanlinetime(int scanline); mame_time cpu_getscanlineperiod_mt(void); double cpu_getscanlineperiod(void); int cpu_gethorzbeampos(void); int cpu_getvblank(void); # 251 "src/cpuexec.h" void cpu_trigger(int trigger); void cpu_triggertime(double duration, int trigger); void cpu_triggerint(int cpunum); void cpu_spinuntil_trigger(int trigger); void cpunum_spinuntil_trigger( int cpunum, int trigger ); void cpu_yielduntil_trigger(int trigger); void cpu_spinuntil_int(void); void cpu_yielduntil_int(void); void cpu_spin(void); void cpu_yield(void); void cpu_spinuntil_time(double duration); void cpu_yielduntil_time(double duration); # 299 "src/cpuexec.h" int cpu_getiloops(void); # 72 "src/driver.h" 2 # 1 "src/cpuint.h" 1 # 12 "src/cpuint.h" # 28 "src/cpuint.h" int cpuint_init(void); void cpuint_reset_cpu(int cpunum); extern int (*cpu_irq_callbacks[])(int); # 49 "src/cpuint.h" void cpunum_set_input_line(int cpunum, int line, int state); void cpunum_set_input_line_vector(int cpunum, int irqline, int vector); void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector); void cpu_set_irq_callback(int cpunum, int (*callback)(int irqline)); # 68 "src/cpuint.h" void nmi_line_pulse(void); void nmi_line_assert(void); void irq0_line_hold(void); void irq0_line_pulse(void); void irq0_line_assert(void); void irq1_line_hold(void); void irq1_line_pulse(void); void irq1_line_assert(void); void irq2_line_hold(void); void irq2_line_pulse(void); void irq2_line_assert(void); void irq3_line_hold(void); void irq3_line_pulse(void); void irq3_line_assert(void); void irq4_line_hold(void); void irq4_line_pulse(void); void irq4_line_assert(void); void irq5_line_hold(void); void irq5_line_pulse(void); void irq5_line_assert(void); void irq6_line_hold(void); void irq6_line_pulse(void); void irq6_line_assert(void); void irq7_line_hold(void); void irq7_line_pulse(void); void irq7_line_assert(void); # 118 "src/cpuint.h" void cpu_interrupt_enable(int cpu,int enabled); void interrupt_enable_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void interrupt_vector_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); UINT8 interrupt_enable_r(__attribute__((__unused__)) offs_t offset); # 73 "src/driver.h" 2 # 1 "src/sndintrf.h" 1 # 12 "src/sndintrf.h" # 1 "src/streams.h" 1 # 15 "src/streams.h" typedef INT32 stream_sample_t; typedef struct _sound_stream sound_stream; typedef void (*stream_callback)(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); int streams_init(void); void streams_set_tag(void *streamtag); void streams_frame_update(void); sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_callback callback); void stream_set_input(sound_stream *stream, int index, sound_stream *input_stream, int output_index, float gain); void stream_update(sound_stream *stream, int min_interval); stream_sample_t *stream_consume_output(sound_stream *stream, int output, int samples); sound_stream *stream_find_by_tag(void *streamtag, int streamindex); int stream_get_inputs(sound_stream *stream); int stream_get_outputs(sound_stream *stream); void stream_set_input_gain(sound_stream *stream, int input, float gain); void stream_set_output_gain(sound_stream *stream, int output, float gain); void stream_set_sample_rate(sound_stream *stream, int sample_rate); # 18 "src/sndintrf.h" 2 # 27 "src/sndintrf.h" enum { SOUND_DUMMY, SOUND_CUSTOM, SOUND_SAMPLES, SOUND_DAC, SOUND_DMADAC, SOUND_DISCRETE, SOUND_AY8910, SOUND_YM2203, SOUND_YM2151, SOUND_YM2608, SOUND_YM2610, SOUND_YM2610B, SOUND_YM2612, SOUND_YM3438, SOUND_YM2413, SOUND_YM3812, SOUND_YM3526, SOUND_YMZ280B, SOUND_Y8950, SOUND_SN76477, SOUND_SN76496, SOUND_POKEY, SOUND_NES, SOUND_ASTROCADE, SOUND_NAMCO, SOUND_NAMCO_15XX, SOUND_NAMCO_CUS30, SOUND_NAMCO_52XX, SOUND_NAMCO_54XX, SOUND_NAMCO_63701X, SOUND_NAMCONA, SOUND_TMS36XX, SOUND_TMS5110, SOUND_TMS5220, SOUND_VLM5030, SOUND_OKIM6295, SOUND_MSM5205, SOUND_MSM5232, SOUND_UPD7759, SOUND_HC55516, SOUND_K005289, SOUND_K007232, SOUND_K051649, SOUND_K053260, SOUND_K054539, SOUND_SEGAPCM, SOUND_RF5C68, SOUND_CEM3394, SOUND_C140, SOUND_QSOUND, SOUND_SAA1099, SOUND_IREMGA20, SOUND_ES5505, SOUND_ES5506, SOUND_BSMT2000, SOUND_YMF262, SOUND_YMF278B, SOUND_GAELCO_CG1V, SOUND_GAELCO_GAE1, SOUND_X1_010, SOUND_MULTIPCM, SOUND_C6280, SOUND_TIA, SOUND_SP0250, SOUND_SCSP, SOUND_PSXSPU, SOUND_YMF271, SOUND_CDDA, SOUND_ICS2115, SOUND_ST0016, SOUND_C352, SOUND_VRENDER0, SOUND_VOTRAX, SOUND_ES8712, SOUND_RF5C400, # 115 "src/sndintrf.h" SOUND_FILTER_VOLUME, SOUND_FILTER_RC, SOUND_FILTER_LOWPASS, SOUND_COUNT }; # 130 "src/sndintrf.h" enum { MAX_ROUTES = 16 }; enum { SNDINFO_INT_FIRST = 0x00000, SNDINFO_INT_CORE_SPECIFIC = 0x08000, SNDINFO_PTR_FIRST = 0x10000, SNDINFO_PTR_SET_INFO = SNDINFO_PTR_FIRST, SNDINFO_PTR_START, SNDINFO_PTR_STOP, SNDINFO_PTR_RESET, SNDINFO_PTR_CORE_SPECIFIC = 0x18000, SNDINFO_STR_FIRST = 0x20000, SNDINFO_STR_NAME = SNDINFO_STR_FIRST, SNDINFO_STR_CORE_FAMILY, SNDINFO_STR_CORE_VERSION, SNDINFO_STR_CORE_FILE, SNDINFO_STR_CORE_CREDITS, SNDINFO_STR_CORE_SPECIFIC = 0x28000 }; union sndinfo { INT64 i; void * p; genf * f; const char *s; void (*set_info)(void *token, UINT32 state, union sndinfo *info); void * (*start)(int index, int clock, const void *config); void (*stop)(void *token); void (*reset)(void *token); }; # 187 "src/sndintrf.h" struct _sound_interface { void (*get_info)(void *token, UINT32 state, union sndinfo *info); void (*set_info)(void *token, UINT32 state, union sndinfo *info); void * (*start)(int index, int clock, const void *config); void (*stop)(void *token); void (*reset)(void *token); }; typedef struct _sound_interface sound_interface; # 208 "src/sndintrf.h" struct _sound_route { int output; const char *target; float gain; }; typedef struct _sound_route sound_route; struct _sound_config { int sound_type; int clock; const void *config; const char *tag; int routes; sound_route route[MAX_ROUTES]; }; typedef struct _sound_config sound_config; struct _speaker_config { const char *tag; float x, y, z; }; typedef struct _speaker_config speaker_config; # 245 "src/sndintrf.h" INT64 sndnum_get_info_int(int sndnum, UINT32 state); void *sndnum_get_info_ptr(int sndnum, UINT32 state); genf *sndnum_get_info_fct(int sndnum, UINT32 state); const char *sndnum_get_info_string(int sndnum, UINT32 state); void sndnum_set_info_int(int sndnum, UINT32 state, INT64 data); void sndnum_set_info_ptr(int sndnum, UINT32 state, void *data); void sndnum_set_info_fct(int sndnum, UINT32 state, genf *data); # 262 "src/sndintrf.h" int sndnum_clock(int sndnum); void *sndnum_token(int sndnum); # 274 "src/sndintrf.h" INT64 sndti_get_info_int(int sndtype, int sndindex, UINT32 state); void *sndti_get_info_ptr(int sndtype, int sndindex, UINT32 state); genf *sndti_get_info_fct(int sndtype, int sndindex, UINT32 state); const char *sndti_get_info_string(int sndtype, int sndindex, UINT32 state); void sndti_set_info_int(int sndtype, int sndindex, UINT32 state, INT64 data); void sndti_set_info_ptr(int sndtype, int sndindex, UINT32 state, void *data); void sndti_set_info_fct(int sndtype, int sndindex, UINT32 state, genf *data); # 291 "src/sndintrf.h" int sndti_clock(int sndtype, int sndindex); void *sndti_token(int sndtype, int sndindex); # 303 "src/sndintrf.h" INT64 sndtype_get_info_int(int sndtype, UINT32 state); void *sndtype_get_info_ptr(int sndtype, UINT32 state); genf *sndtype_get_info_fct(int sndtype, UINT32 state); const char *sndtype_get_info_string(int sndtype, UINT32 state); # 322 "src/sndintrf.h" void sndintrf_init(void); int sound_init(void); void sound_exit(void); void sound_reset(void); void sound_frame_update(void); void sound_register_token(void *token); int sound_scalebufferpos(int value); void sndintrf_load(int config_type, xml_data_node *parentnode); void sndintrf_save(int config_type, xml_data_node *parentnode); # 341 "src/sndintrf.h" int sndti_to_sndnum(int type, int index); void sound_global_enable(int enable); void sndti_reset(int type, int index); void sndti_set_output_gain(int type, int index, int output, float gain); int sound_get_user_gain_count(void); void sound_set_user_gain(int index, float gain); float sound_get_user_gain(int index); float sound_get_default_gain(int index); const char *sound_get_user_gain_name(int index); # 368 "src/sndintrf.h" UINT8 soundlatch_r(__attribute__((__unused__)) offs_t offset); UINT8 soundlatch2_r(__attribute__((__unused__)) offs_t offset); UINT8 soundlatch3_r(__attribute__((__unused__)) offs_t offset); UINT8 soundlatch4_r(__attribute__((__unused__)) offs_t offset); UINT16 soundlatch_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 soundlatch2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 soundlatch3_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); UINT16 soundlatch4_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask); void soundlatch_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch3_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch4_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void soundlatch2_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void soundlatch3_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void soundlatch4_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask); void soundlatch_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch2_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch3_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch4_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data); void soundlatch_setclearedvalue(int value); # 74 "src/driver.h" 2 # 1 "src/usrintrf.h" 1 # 12 "src/usrintrf.h" # 25 "src/usrintrf.h" enum { JUSTIFY_LEFT = 0, JUSTIFY_CENTER, JUSTIFY_RIGHT }; enum { WRAP_NEVER, WRAP_TRUNCATE, WRAP_WORD }; enum { DRAW_NONE, DRAW_NORMAL, DRAW_OPAQUE }; enum { PAUSE_OFF = 0, PAUSE_ON = 1, PAUSE_SINGLE_STEP = 2 }; # 69 "src/usrintrf.h" typedef UINT32 (*ui_menu_handler)(UINT32 state); struct _ui_menu_item { const char *text; const char *subtext; UINT32 flags; }; typedef struct _ui_menu_item ui_menu_item; struct _memcard_interface { int (*create)(int); int (*load)(int); void (*save)(void); void (*eject)(void); }; typedef struct _memcard_interface memcard_interface; # 97 "src/usrintrf.h" extern memcard_interface memcard_intf; # 110 "src/usrintrf.h" int ui_init(void); void ui_exit(void); int ui_update_and_render(mame_bitmap *bitmap); int ui_is_dirty(void); void ui_set_visible_area(int xmin, int ymin, int xmax, int ymax); int ui_get_line_height(void); int ui_get_char_width(UINT16 ch); int ui_get_string_width(const char *s); void ui_get_bounds(int *width, int *height); void ui_draw_text(const char *buf, int x, int y); 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); void ui_draw_message_window(const char *text); void ui_draw_menu(const ui_menu_item *items, int numitems, int selected); int ui_menu_generic_keys(int *selected, int num_items); void ui_menu_stack_reset(void); UINT32 ui_menu_stack_push(ui_menu_handler new_handler, UINT32 new_state); UINT32 ui_menu_stack_pop(void); void ui_popup(const char *text, ...) __attribute__((format(printf, 1, 2))); void ui_popup_time(int seconds, const char *text, ...) __attribute__((format(printf, 2, 3))); int ui_display_decoding(mame_bitmap *bitmap, int percent); int ui_display_copyright(mame_bitmap *bitmap); int ui_display_game_warnings(mame_bitmap *bitmap); int ui_display_game_info(mame_bitmap *bitmap); void ui_show_fps_temp(double seconds); void ui_set_show_fps(int show); int ui_get_show_fps(void); void ui_set_show_profiler(int show); int ui_get_show_profiler(void); int ui_is_setup_active(void); int ui_is_onscrd_active(void); void ui_display_fps(void); # 77 "src/driver.h" 2 # 1 "src/cheat.h" 1 # 12 "src/cheat.h" extern int he_did_cheat; void cheat_init(void); void cheat_exit(void); int cheat_menu(int selection); void cheat_periodic(void); void cheat_display_watches(void); # 78 "src/driver.h" 2 # 1 "src/tilemap.h" 1 # 12 "src/tilemap.h" typedef struct _tilemap tilemap; # 53 "src/tilemap.h" struct _tile_data { const UINT8 *pen_data; const pen_t *pal_data; UINT32 flags; int skip; UINT32 tile_number; UINT32 pen_usage; UINT32 priority; UINT8 *mask_data; void *user_data; }; typedef struct _tile_data tile_data; extern tile_data tile_info; # 108 "src/tilemap.h" extern mame_bitmap *priority_bitmap; int tilemap_init( void ); void tilemap_exit( void ); tilemap *tilemap_create( void (*tile_get_info)( int memory_offset ), UINT32 (*get_memory_offset)( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ), int type, int tile_width, int tile_height, int num_cols, int num_rows ); void tilemap_set_transparent_pen( tilemap *tmap, int pen ); void tilemap_set_transmask( tilemap *tmap, int which, UINT32 fgmask, UINT32 bgmask ); void tilemap_set_depth( tilemap *tmap, int tile_depth, int tile_granularity ); void tilemap_mark_tile_dirty( tilemap *tmap, int memory_offset ); void tilemap_mark_all_tiles_dirty( tilemap *tmap ); void tilemap_mark_gfxdata_dirty( tilemap *tmap, UINT8 *dirty_array ); void tilemap_set_scroll_rows( tilemap *tmap, int scroll_rows ); void tilemap_set_scrolldx( tilemap *tmap, int dx, int dx_if_flipped ); void tilemap_set_scrollx( tilemap *tmap, int row, int value ); int tilemap_get_scrolldx( tilemap *tmap ); void tilemap_set_scroll_cols( tilemap *tmap, int scroll_cols ); void tilemap_set_scrolldy( tilemap *tmap, int dy, int dy_if_flipped ); void tilemap_set_scrolly( tilemap *tmap, int col, int value ); int tilemap_get_scrolldy( tilemap *tmap ); void tilemap_set_palette_offset( tilemap *tmap, int offset ); void tilemap_set_user_data( tilemap *tmap, void *user_data ); void tilemap_set_flip( tilemap *tmap, int attributes ); void tilemap_set_enable( tilemap *tmap, int enable ); void tilemap_draw( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority ); void tilemap_draw_primask( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority, UINT32 priority_mask ); void tilemap_draw_roz(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap, UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy, int wraparound, UINT32 flags, UINT32 priority ); void tilemap_draw_roz_primask(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap, UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy, int wraparound, UINT32 flags, UINT32 priority, UINT32 priority_mask ); # 170 "src/tilemap.h" mame_bitmap *tilemap_get_pixmap( tilemap * tmap ); mame_bitmap *tilemap_get_transparency_bitmap( tilemap * tmap ); UINT8 *tilemap_get_transparency_data( tilemap * tmap ); UINT32 tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_scan_cols_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_scan_cols_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_scan_cols_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_scan_rows_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_scan_rows_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_scan_rows_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ); UINT32 tilemap_count( void ); void tilemap_nb_size( UINT32 number, UINT32 *width, UINT32 *height ); void tilemap_nb_draw( mame_bitmap *dest, UINT32 number, UINT32 scrollx, UINT32 scrolly ); # 79 "src/driver.h" 2 # 1 "src/profiler.h" 1 # 12 "src/profiler.h" enum { PROFILER_END = -1, PROFILER_CPU1 = 0, PROFILER_CPU2, PROFILER_CPU3, PROFILER_CPU4, PROFILER_CPU5, PROFILER_CPU6, PROFILER_CPU7, PROFILER_CPU8, PROFILER_MEMREAD, PROFILER_MEMWRITE, PROFILER_VIDEO, PROFILER_DRAWGFX, PROFILER_COPYBITMAP, PROFILER_TILEMAP_DRAW, PROFILER_TILEMAP_DRAW_ROZ, PROFILER_TILEMAP_UPDATE, PROFILER_ARTWORK, PROFILER_BLIT, PROFILER_SOUND, PROFILER_MIXER, PROFILER_TIMER_CALLBACK, PROFILER_HISCORE, PROFILER_INPUT, PROFILER_EXTRA, PROFILER_USER1, PROFILER_USER2, PROFILER_USER3, PROFILER_USER4, PROFILER_PROFILER, PROFILER_IDLE, PROFILER_TOTAL }; # 75 "src/profiler.h" void profiler__mark(int type); void profiler_start(void); void profiler_stop(void); const char *profiler_get_text(void); # 80 "src/driver.h" 2 # 309 "src/driver.h" cpu_config *machine_add_cpu(machine_config *machine, const char *tag, int type, int cpuclock); cpu_config *machine_find_cpu(machine_config *machine, const char *tag); void machine_remove_cpu(machine_config *machine, const char *tag); speaker_config *machine_add_speaker(machine_config *machine, const char *tag, float x, float y, float z); speaker_config *machine_find_speaker(machine_config *machine, const char *tag); void machine_remove_speaker(machine_config *machine, const char *tag); sound_config *machine_add_sound(machine_config *machine, const char *tag, int type, int clock); sound_config *machine_find_sound(machine_config *machine, const char *tag); void machine_remove_sound(machine_config *machine, const char *tag); # 337 "src/driver.h" struct _machine_config { cpu_config cpu[8]; float frames_per_second; int vblank_duration; UINT32 cpu_slices_per_frame; INT32 watchdog_vblank_count; double watchdog_time; void (*machine_init)(void); void (*machine_stop)(void); void (*nvram_handler)(mame_file *file, int read_or_write); UINT32 video_attributes; UINT32 aspect_x, aspect_y; int screen_width,screen_height; rectangle default_visible_area; const gfx_decode *gfxdecodeinfo; UINT32 total_colors; UINT32 color_table_len; void (*init_palette)(UINT16 *colortable,const UINT8 *color_prom); int (*video_start)(void); void (*video_stop)(void); void (*video_eof)(void); void (*video_update)(int screen, mame_bitmap *bitmap,const rectangle *cliprect); sound_config sound[32]; speaker_config speaker[4]; }; # 452 "src/driver.h" struct _game_driver { const char *source_file; const struct _game_driver *clone_of; const char *name; const bios_entry *bios; const char *description; const char *year; const char *manufacturer; void (*drv)(machine_config *); void (*construct_ipt)(input_port_init_params *param); void (*driver_init)(void); const rom_entry *rom; UINT32 flags; }; # 574 "src/driver.h" extern const game_driver *drivers[]; # 95 "src/memory.c" 2 # 1 "src/state.h" 1 # 12 "src/state.h" # 21 "src/state.h" void state_save_free(void); void state_save_allow_registration(int allowed); int state_save_registration_allowed(void); int state_save_get_reg_count(void); void state_save_register_UINT8 (const char *module, int instance, const char *name, UINT8 *val, unsigned size); void state_save_register_INT8 (const char *module, int instance, const char *name, INT8 *val, unsigned size); void state_save_register_UINT16(const char *module, int instance, const char *name, UINT16 *val, unsigned size); void state_save_register_INT16 (const char *module, int instance, const char *name, INT16 *val, unsigned size); void state_save_register_UINT32(const char *module, int instance, const char *name, UINT32 *val, unsigned size); void state_save_register_INT32 (const char *module, int instance, const char *name, INT32 *val, unsigned size); void state_save_register_UINT64(const char *module, int instance, const char *name, UINT64 *val, unsigned size); void state_save_register_INT64 (const char *module, int instance, const char *name, INT64 *val, unsigned size); void state_save_register_double(const char *module, int instance, const char *name, double *val, unsigned size); void state_save_register_float (const char *module, int instance, const char *name, float *val, unsigned size); void state_save_register_int (const char *module, int instance, const char *name, int *val); void state_save_register_func_presave(void (*func)(void)); void state_save_register_func_postload(void (*func)(void)); void state_save_register_func_presave_int(void (*func)(int), int param); void state_save_register_func_postload_int(void (*func)(int), int param); void state_save_register_func_presave_ptr(void (*func)(void *), void *param); void state_save_register_func_postload_ptr(void (*func)(void *), void *param); int state_save_save_begin(mame_file *file); int state_save_load_begin(mame_file *file); void state_save_push_tag(int tag); void state_save_pop_tag(void); void state_save_save_continue(void); void state_save_load_continue(void); void state_save_save_finish(void); void state_save_load_finish(void); void state_save_dump_registry(void); int state_save_check_file(mame_file *file, const char *gamename, int validate_signature, void ( *errormsg)(const char *fmt, ...)); # 97 "src/memory.c" 2 # 1 "src/debug/debugcpu.h" 1 # 15 "src/debug/debugcpu.h" # 1 "src/debug/express.h" 1 # 84 "src/debug/express.h" struct register_info { UINT64 (*getter)(UINT32); void (*setter)(UINT32, UINT64); }; struct function_info { UINT16 minparams; UINT16 maxparams; UINT64 (*execute)(UINT32, UINT32, UINT64 *); }; struct generic_info { void * ptr; UINT64 value; }; struct symbol_entry { UINT32 ref; UINT32 type; union { struct register_info reg; struct function_info func; struct generic_info gen; } info; }; struct symbol_table; struct parsed_expression; typedef UINT32 EXPRERR; # 134 "src/debug/express.h" UINT64 external_read_memory(int space, UINT32 offset, int size); void external_write_memory(int space, UINT32 offset, int size, UINT64 value); # 144 "src/debug/express.h" EXPRERR expression_evaluate(const char *expression, const struct symbol_table *table, UINT64 *result); EXPRERR expression_parse(const char *expression, const struct symbol_table *table, struct parsed_expression **result); EXPRERR expression_execute(struct parsed_expression *expr, UINT64 *result); void expression_free(struct parsed_expression *expr); const char * expression_original_string(struct parsed_expression *expr); const char * exprerr_to_string(EXPRERR error); struct symbol_table * symtable_alloc(struct symbol_table *parent); int symtable_add(struct symbol_table *table, const char *name, const struct symbol_entry *entry); int symtable_add_register(struct symbol_table *table, const char *name, UINT32 ref, UINT64 (*getter)(UINT32), void (*setter)(UINT32, UINT64)); int symtable_add_function(struct symbol_table *table, const char *name, UINT32 ref, UINT16 minparams, UINT16 maxparams, UINT64 (*execute)(UINT32, UINT32, UINT64 *)); int symtable_add_value(struct symbol_table *table, const char *name, UINT64 value); const struct symbol_entry * symtable_find(const struct symbol_table *table, const char *name); void symtable_free(struct symbol_table *table); # 16 "src/debug/debugcpu.h" 2 # 28 "src/debug/debugcpu.h" enum { EXECUTION_STATE_STOPPED, EXECUTION_STATE_RUNNING, EXECUTION_STATE_NEXT_CPU, EXECUTION_STATE_STEP_INTO, EXECUTION_STATE_STEP_OVER, EXECUTION_STATE_STEP_OUT }; # 54 "src/debug/debugcpu.h" typedef void (*debug_hook_read_ptr)(int spacenum, int size, offs_t address); typedef void (*debug_hook_write_ptr)(int spacenum, int size, offs_t address, UINT64 data); struct debug_trace_info { FILE * file; char * action; offs_t history[64]; int loops; int nextdex; offs_t trace_over_target; }; struct _debug_space_info { UINT8 databytes; UINT8 pageshift; UINT8 addr2byte_lshift; UINT8 addr2byte_rshift; UINT8 physchars; UINT8 logchars; offs_t physaddrmask; offs_t logaddrmask; offs_t physbytemask; offs_t logbytemask; struct watchpoint *first_wp; }; typedef struct _debug_space_info debug_space_info; struct _debug_hotspot_entry { offs_t access; offs_t pc; int spacenum; UINT32 count; }; typedef struct _debug_hotspot_entry debug_hotspot_entry; struct debug_cpu_info { UINT8 valid; UINT8 endianness; UINT8 opwidth; UINT8 ignoring; offs_t temp_breakpoint_pc; int read_watchpoints; int write_watchpoints; struct symbol_table *symtable; struct debug_trace_info trace; struct breakpoint *first_bp; debug_space_info space[3]; debug_hotspot_entry *hotspots; int hotspot_count; int hotspot_threshhold; int (*translate)(int space, offs_t *address); int (*read)(int space, UINT32 offset, int size, UINT64 *value); int (*write)(int space, UINT32 offset, int size, UINT64 value); int (*readop)(UINT32 offset, int size, UINT64 *value); }; struct breakpoint { int index; UINT8 enabled; offs_t address; struct parsed_expression *condition; char * action; struct breakpoint *next; }; struct watchpoint { int index; UINT8 enabled; UINT8 type; offs_t address; offs_t length; struct parsed_expression *condition; char * action; struct watchpoint *next; }; extern FILE *debug_source_file; extern struct symbol_table *global_symtable; # 161 "src/debug/debugcpu.h" void debug_cpu_init(void); void debug_cpu_exit(void); const struct debug_cpu_info *debug_get_cpu_info(int cpunum); void debug_halt_on_next_instruction(void); void debug_refresh_display(void); int debug_get_execution_state(void); UINT32 debug_get_execution_counter(void); void debug_trace_printf(int cpunum, const char *fmt, ...); void debug_source_script(const char *file); void debug_flush_traces(void); void debug_vblank_hook(void); void debug_interrupt_hook(int cpunum, int irqline); void debug_get_memory_hooks(int cpunum, debug_hook_read_ptr *read, debug_hook_write_ptr *write); void debug_cpu_single_step(int numsteps); void debug_cpu_single_step_over(int numsteps); void debug_cpu_single_step_out(void); void debug_cpu_go(offs_t targetpc); void debug_cpu_go_vblank(void); void debug_cpu_go_interrupt(int irqline); void debug_cpu_go_milliseconds(UINT64 milliseconds); void debug_cpu_next_cpu(void); void debug_cpu_ignore_cpu(int cpunum, int ignore); void debug_cpu_trace(int cpunum, FILE *file, int trace_over, const char *action); void debug_check_breakpoints(int cpunum, offs_t pc); struct breakpoint * debug_breakpoint_first(int cpunum); int debug_breakpoint_set(int cpunum, offs_t address, struct parsed_expression *condition, const char *action); int debug_breakpoint_clear(int bpnum); int debug_breakpoint_enable(int bpnum, int enable); struct watchpoint * debug_watchpoint_first(int cpunum, int spacenum); int debug_watchpoint_set(int cpunum, int spacenum, int type, offs_t address, offs_t length, struct parsed_expression *condition, const char *action); int debug_watchpoint_clear(int wpnum); int debug_watchpoint_enable(int wpnum, int enable); int debug_hotspot_track(int cpunum, int numspots, int threshhold); UINT8 debug_read_byte(int spacenum, offs_t address); UINT16 debug_read_word(int spacenum, offs_t address); UINT32 debug_read_dword(int spacenum, offs_t address); UINT64 debug_read_qword(int spacenum, offs_t address); void debug_write_byte(int spacenum, offs_t address, UINT8 data); void debug_write_word(int spacenum, offs_t address, UINT16 data); void debug_write_dword(int spacenum, offs_t address, UINT32 data); void debug_write_qword(int spacenum, offs_t address, UINT64 data); UINT64 debug_read_opcode(UINT32 offset, int size, int arg); # 98 "src/memory.c" 2 # 173 "src/memory.c" struct _memory_block { UINT8 cpunum; UINT8 spacenum; UINT8 isallocated; offs_t start, end; UINT8 * data; }; typedef struct _memory_block memory_block; struct _bank_data { UINT8 used; UINT8 dynamic; UINT8 cpunum; UINT8 spacenum; UINT8 read; UINT8 write; offs_t base; offs_t end; UINT8 curentry; void * entry[64]; void * entryd[64]; }; typedef struct _bank_data bank_data; union _rwhandlers { genf * generic; read_handlers read; write_handlers write; }; typedef union _rwhandlers rwhandlers; struct _handler_data { rwhandlers handler; offs_t offset; offs_t top; offs_t mask; const char * name; }; struct _subtable_data { UINT8 checksum_valid; UINT32 checksum; UINT32 usecount; }; typedef struct _subtable_data subtable_data; struct _table_data { UINT8 * table; UINT8 subtable_alloc; subtable_data subtable[64]; handler_data handlers[((256-64))]; }; typedef struct _table_data table_data; struct _addrspace_data { UINT8 cpunum; UINT8 spacenum; INT8 ashift; UINT8 abits; UINT8 dbits; offs_t rawmask; offs_t mask; UINT64 unmap; table_data read; table_data write; data_accessors * accessors; address_map * map; address_map * adjmap; }; typedef struct _addrspace_data addrspace_data; struct _cpu_data { opbase_handler opbase; void * op_ram; void * op_rom; offs_t op_mask; offs_t op_mem_min; offs_t op_mem_max; UINT8 opcode_entry; UINT8 spacemask; addrspace_data space[3]; }; typedef struct _cpu_data cpu_data; UINT8 * opcode_base; UINT8 * opcode_arg_base; offs_t opcode_mask; offs_t opcode_memory_min; offs_t opcode_memory_max; UINT8 opcode_entry; address_space active_address_space[3]; static UINT8 * bank_ptr[72]; static UINT8 * bankd_ptr[72]; static void * shared_ptr[256]; static memory_block memory_block_list[1024]; static int memory_block_count = 0; static int cur_context; static opbase_handler opbasefunc; static int debugger_access; static cpu_data cpudata[8]; static bank_data bankdata[72]; static data_accessors memory_accessors[3][4][2] = { { { { program_read_byte_8, ((void *)0), ((void *)0), ((void *)0), program_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }, { program_read_byte_8, ((void *)0), ((void *)0), ((void *)0), program_write_byte_8, ((void *)0), ((void *)0), ((void *)0) } }, { { program_read_byte_16le, program_read_word_16le, ((void *)0), ((void *)0), program_write_byte_16le, program_write_word_16le, ((void *)0), ((void *)0) }, { program_read_byte_16be, program_read_word_16be, ((void *)0), ((void *)0), program_write_byte_16be, program_write_word_16be, ((void *)0), ((void *)0) } }, { { 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) }, { 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) } }, { { 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 }, { 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 } } }, { { { data_read_byte_8, ((void *)0), ((void *)0), ((void *)0), data_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }, { data_read_byte_8, ((void *)0), ((void *)0), ((void *)0), data_write_byte_8, ((void *)0), ((void *)0), ((void *)0) } }, { { data_read_byte_16le, data_read_word_16le, ((void *)0), ((void *)0), data_write_byte_16le, data_write_word_16le, ((void *)0), ((void *)0) }, { data_read_byte_16be, data_read_word_16be, ((void *)0), ((void *)0), data_write_byte_16be, data_write_word_16be, ((void *)0), ((void *)0) } }, { { 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) }, { 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) } }, { { 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 }, { 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 } } }, { { { io_read_byte_8, ((void *)0), ((void *)0), ((void *)0), io_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }, { io_read_byte_8, ((void *)0), ((void *)0), ((void *)0), io_write_byte_8, ((void *)0), ((void *)0), ((void *)0) } }, { { io_read_byte_16le, io_read_word_16le, ((void *)0), ((void *)0), io_write_byte_16le, io_write_word_16le, ((void *)0), ((void *)0) }, { io_read_byte_16be, io_read_word_16be, ((void *)0), ((void *)0), io_write_byte_16be, io_write_word_16be, ((void *)0), ((void *)0) } }, { { 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) }, { 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) } }, { { 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 }, { 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 } } }, }; static int init_cpudata(void); static int init_addrspace(UINT8 cpunum, UINT8 spacenum); static int preflight_memory(void); static int populate_memory(void); 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); static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked); static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask); static void populate_table_range(addrspace_data *space, int iswrite, offs_t start, offs_t stop, UINT8 handler); static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler); static UINT8 allocate_subtable(table_data *tabledata); static void reallocate_subtable(table_data *tabledata, UINT8 subentry); static int merge_subtables(table_data *tabledata); static void release_subtable(table_data *tabledata, UINT8 subentry); static UINT8 *open_subtable(table_data *tabledata, offs_t l1index); static void close_subtable(table_data *tabledata, offs_t l1index); static int allocate_memory(void); static void *allocate_memory_block(int cpunum, int spacenum, offs_t start, offs_t end, void *memory); static void register_for_save(int cpunum, int spacenum, offs_t start, void *base, size_t numbytes); static address_map *assign_intersecting_blocks(addrspace_data *space, offs_t start, offs_t end, UINT8 *base); static int find_memory(void); static void *memory_find_base(int cpunum, int spacenum, int readwrite, offs_t offset); static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which); static void mem_dump(void) { FILE *file; if ((0)) { file = fopen("memdump.log", "w"); if (file) { memory_dump(file); fclose(file); } } } int memory_init(void) { cur_context = -1; memset(shared_ptr, 0, sizeof(shared_ptr)); memset(bank_ptr, 0, sizeof(bank_ptr)); memset(bankd_ptr, 0, sizeof(bankd_ptr)); memset(memory_block_list, 0, sizeof(memory_block_list)); memory_block_count = 0; if (!init_cpudata()) return 0; if (!preflight_memory()) return 0; if (!populate_memory()) return 0; if (!allocate_memory()) return 0; if (!find_memory()) return 0; mem_dump(); return 1; } void memory_exit(void) { int cpunum, spacenum; for (cpunum = 0; cpunum < 8; cpunum++) for (spacenum = 0; spacenum < 3; spacenum++) { if (cpudata[cpunum].space[spacenum].read.table) free(cpudata[cpunum].space[spacenum].read.table); if (cpudata[cpunum].space[spacenum].write.table) free(cpudata[cpunum].space[spacenum].write.table); } } void memory_set_context(int activecpu) { if (cur_context != -1) { cpudata[cur_context].op_ram = opcode_arg_base; cpudata[cur_context].op_rom = opcode_base; cpudata[cur_context].op_mask = opcode_mask; cpudata[cur_context].op_mem_min = opcode_memory_min; cpudata[cur_context].op_mem_max = opcode_memory_max; cpudata[cur_context].opcode_entry = opcode_entry; } cur_context = activecpu; opcode_arg_base = cpudata[activecpu].op_ram; opcode_base = cpudata[activecpu].op_rom; opcode_mask = cpudata[activecpu].op_mask; opcode_memory_min = cpudata[activecpu].op_mem_min; opcode_memory_max = cpudata[activecpu].op_mem_max; opcode_entry = cpudata[activecpu].opcode_entry; active_address_space[0].addrmask = cpudata[activecpu].space[0].mask; active_address_space[0].readlookup = cpudata[activecpu].space[0].read.table; active_address_space[0].writelookup = cpudata[activecpu].space[0].write.table; active_address_space[0].readhandlers = cpudata[activecpu].space[0].read.handlers; active_address_space[0].writehandlers = cpudata[activecpu].space[0].write.handlers; active_address_space[0].accessors = cpudata[activecpu].space[0].accessors; if (cpudata[activecpu].spacemask & (1 << 1)) { active_address_space[1].addrmask = cpudata[activecpu].space[1].mask; active_address_space[1].readlookup = cpudata[activecpu].space[1].read.table; active_address_space[1].writelookup = cpudata[activecpu].space[1].write.table; active_address_space[1].readhandlers = cpudata[activecpu].space[1].read.handlers; active_address_space[1].writehandlers = cpudata[activecpu].space[1].write.handlers; active_address_space[1].accessors = cpudata[activecpu].space[1].accessors; } if (cpudata[activecpu].spacemask & (1 << 2)) { active_address_space[2].addrmask = cpudata[activecpu].space[2].mask; active_address_space[2].readlookup = cpudata[activecpu].space[2].read.table; active_address_space[2].writelookup = cpudata[activecpu].space[2].write.table; active_address_space[2].readhandlers = cpudata[activecpu].space[2].read.handlers; active_address_space[2].writehandlers = cpudata[activecpu].space[2].write.handlers; active_address_space[2].accessors = cpudata[activecpu].space[2].accessors; } opbasefunc = cpudata[activecpu].opbase; # 542 "src/memory.c" } const address_map *memory_get_map(int cpunum, int spacenum) { return cpudata[cpunum].space[spacenum].map; } opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function) { opbase_handler old = cpudata[cpunum].opbase; cpudata[cpunum].opbase = function; if (cpunum == cpu_getactivecpu()) opbasefunc = function; return old; } void memory_set_opbase(offs_t pc) { address_space *space = &active_address_space[0]; UINT8 *base = ((void *)0), *based = ((void *)0); handler_data *handlers; UINT8 entry; if (opbasefunc) { pc = (*opbasefunc)(pc); if (pc == ~0) return; } pc &= space->addrmask; entry = space->readlookup[((pc) >> (32 - 18))]; if (entry >= (256-64)) entry = space->readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((pc) & ((1 << (32 - 18)) - 1)))]; opcode_entry = entry; if (entry < 1 || entry >= 68) { for (entry = 1; entry < 72; entry++) { bank_data *bdata = &bankdata[entry]; if (bdata->used && bdata->cpunum == cur_context && bdata->spacenum == 0 && bdata->base < pc && bdata->end > pc) break; } if (entry == 72) { logerror("cpu #%d (PC=%08X): warning - op-code execute on mapped I/O\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC)))); return; } } base = bank_ptr[entry]; based = bankd_ptr[entry]; if (!based) based = base; handlers = &active_address_space[0].readhandlers[entry]; opcode_mask = handlers->mask; opcode_arg_base = base - (handlers->offset & opcode_mask); opcode_base = based - (handlers->offset & opcode_mask); opcode_memory_min = handlers->offset; opcode_memory_max = handlers->top; } void memory_set_decrypted_region(int cpunum, offs_t start, offs_t end, void *base) { int banknum, found = 0; for (banknum = 0; banknum < 72; banknum++) { bank_data *bdata = &bankdata[banknum]; if (bdata->used && bdata->cpunum == cpunum && bdata->spacenum == 0 && bdata->read) { if (bdata->base >= start && bdata->end <= end) { bankd_ptr[banknum] = (UINT8 *)base + bdata->base - start; found = 1; if (cpunum == cur_context && opcode_entry == banknum) memory_set_opbase(activecpu_get_physical_pc_byte()); } else if (bdata->base < end && bdata->end > start) osd_die("memory_set_decrypted_region found straddled region %08X-%08X for CPU %d\n", start, end, cpunum); } } if (!found) osd_die("memory_set_decrypted_region unable to find matching region %08X-%08X for CPU %d\n", start, end, cpunum); } # 675 "src/memory.c" void *memory_get_read_ptr(int cpunum, int spacenum, offs_t offset) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; UINT8 entry; offset &= space->mask; entry = space->read.table[((offset) >> (32 - 18))]; if (entry >= (256-64)) entry = space->read.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))]; if (entry >= 68) return ((void *)0); offset = (offset - space->read.handlers[entry].offset) & space->read.handlers[entry].mask; return &bank_ptr[entry][offset]; } # 700 "src/memory.c" void *memory_get_write_ptr(int cpunum, int spacenum, offs_t offset) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; UINT8 entry; offset &= space->mask; entry = space->write.table[((offset) >> (32 - 18))]; if (entry >= (256-64)) entry = space->write.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))]; if (entry >= 68) return ((void *)0); offset = (offset - space->write.handlers[entry].offset) & space->write.handlers[entry].mask; return &bank_ptr[entry][offset]; } # 725 "src/memory.c" void *memory_get_op_ptr(int cpunum, offs_t offset, int arg) { addrspace_data *space = &cpudata[cpunum].space[0]; void *ptr = ((void *)0); UINT8 entry; if (cpudata[cpunum].opbase) { UINT8 *saved_opcode_base = opcode_base; UINT8 *saved_opcode_arg_base = opcode_arg_base; offs_t saved_opcode_mask = opcode_mask; offs_t saved_opcode_memory_min = opcode_memory_min; offs_t saved_opcode_memory_max = opcode_memory_max; UINT8 saved_opcode_entry = opcode_entry; offs_t new_offset = (*cpudata[cpunum].opbase)(offset); if (new_offset == ~0) ptr = arg ? &opcode_arg_base[offset] : &opcode_base[offset]; else offset = new_offset; opcode_base = saved_opcode_base; opcode_arg_base = saved_opcode_arg_base; opcode_mask = saved_opcode_mask; opcode_memory_min = saved_opcode_memory_min; opcode_memory_max = saved_opcode_memory_max; opcode_entry = saved_opcode_entry; if (ptr) return ptr; } offset &= space->mask; entry = space->read.table[((offset) >> (32 - 18))]; if (entry >= (256-64)) entry = space->read.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))]; if (entry >= 68) return ((void *)0); offset = (offset - space->read.handlers[entry].offset) & space->read.handlers[entry].mask; return (!arg && bankd_ptr[entry]) ? &bankd_ptr[entry][offset] : &bank_ptr[entry][offset]; } void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride) { int entrynum; if (banknum < 1 || banknum > 32 || !bankdata[banknum].used) osd_die("memory_configure_bank called with invalid bank %d\n", banknum); if (bankdata[banknum].dynamic) osd_die("memory_configure_bank called with dynamic bank %d\n", banknum); if (startentry < 0 || startentry + numentries > 64) osd_die("memory_configure_bank called with out-of-range entries %d-%d\n", startentry, startentry + numentries - 1); for (entrynum = startentry; entrynum < startentry + numentries; entrynum++) bankdata[banknum].entry[entrynum] = (UINT8 *)base + (entrynum - startentry) * stride; } # 811 "src/memory.c" void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride) { int entrynum; if (banknum < 1 || banknum > 32 || !bankdata[banknum].used) osd_die("memory_configure_bank called with invalid bank %d\n", banknum); if (bankdata[banknum].dynamic) osd_die("memory_configure_bank called with dynamic bank %d\n", banknum); if (startentry < 0 || startentry + numentries > 64) osd_die("memory_configure_bank called with out-of-range entries %d-%d\n", startentry, startentry + numentries - 1); for (entrynum = startentry; entrynum < startentry + numentries; entrynum++) bankdata[banknum].entryd[entrynum] = (UINT8 *)base + (entrynum - startentry) * stride; } void memory_set_bank(int banknum, int entrynum) { if (banknum < 1 || banknum > 32 || !bankdata[banknum].used) osd_die("memory_set_bank called with invalid bank %d\n", banknum); if (bankdata[banknum].dynamic) osd_die("memory_set_bank called with dynamic bank %d\n", banknum); if (entrynum < 0 || entrynum > 64) osd_die("memory_set_bank called with out-of-range entry %d\n", entrynum); if (!bankdata[banknum].entry[entrynum]) osd_die("memory_set_bank called for bank %d with invalid bank entry %d\n", banknum, entrynum); bankdata[banknum].curentry = entrynum; bank_ptr[banknum] = bankdata[banknum].entry[entrynum]; bankd_ptr[banknum] = bankdata[banknum].entryd[entrynum]; if (opcode_entry == banknum && cpu_getactivecpu() >= 0) { opcode_entry = 0xff; memory_set_opbase(activecpu_get_physical_pc_byte()); } } void memory_set_bankptr(int banknum, void *base) { if (banknum < 1 || banknum > 32 || !bankdata[banknum].used) osd_die("memory_set_bankptr called with invalid bank %d\n", banknum); if (bankdata[banknum].dynamic) osd_die("memory_set_bankptr called with dynamic bank %d\n", banknum); bank_ptr[banknum] = base; if (opcode_entry == banknum && cpu_getactivecpu() >= 0) { opcode_entry = 0xff; memory_set_opbase(activecpu_get_physical_pc_byte()); } } void memory_set_debugger_access(int debugger) { debugger_access = debugger; } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; if ((handler < 0) || (handler >= 72)) osd_die("fatal: can only use static banks with memory_install_read_handler()\n"); install_mem_handler(space, 0, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 8, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 16, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 32, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 64, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; if ((handler < 0) || (handler >= 72)) osd_die("fatal: can only use static banks with memory_install_write_handler()\n"); install_mem_handler(space, 1, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 8, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 16, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 32, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 64, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift))); } # 997 "src/memory.c" 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; if ((handler < 0) || (handler >= 72)) osd_die("fatal: can only use static banks with memory_install_read_matchmask_handler()\n"); install_mem_handler(space, 0, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 0, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } # 1046 "src/memory.c" 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; if ((handler < 0) || (handler >= 72)) osd_die("fatal: can only use static banks with memory_install_write_matchmask_handler()\n"); install_mem_handler(space, 1, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } 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) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; install_mem_handler(space, 1, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name); mem_dump(); return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift))); } address_map *construct_map_0(address_map *map) { map->flags = 0x04; return map; } static int init_cpudata(void) { int cpunum, spacenum; memset(&cpudata, 0, sizeof(cpudata)); for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { cpudata[cpunum].op_ram = cpudata[cpunum].op_rom = memory_region(REGION_CPU1 + cpunum); cpudata[cpunum].op_mem_max = memory_region_length(REGION_CPU1 + cpunum); cpudata[cpunum].op_mem_min = 0; cpudata[cpunum].opcode_entry = 71; cpudata[cpunum].opbase = ((void *)0); cpudata[cpunum].spacemask = 0; for (spacenum = 0; spacenum < 3; spacenum++) if (!init_addrspace(cpunum, spacenum)) return 0; cpudata[cpunum].op_mask = cpudata[cpunum].space[0].mask; } return 1; } static __inline__ void adjust_addresses(addrspace_data *space, int ismatchmask, offs_t *start, offs_t *end, offs_t *mask, offs_t *mirror) { if (!*mask) *mask = space->rawmask; *mask &= ~*mirror; *start &= ~*mirror & space->rawmask; *end &= ~*mirror & space->rawmask; *mask = (((space)->ashift < 0) ? ((*mask) << -(space)->ashift) : ((*mask) >> (space)->ashift)); *start = (((space)->ashift < 0) ? ((*start) << -(space)->ashift) : ((*start) >> (space)->ashift)); *end = ismatchmask ? (((space)->ashift < 0) ? ((*end) << -(space)->ashift) : ((*end) >> (space)->ashift)) : (((space)->ashift < 0) ? (((*end) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((*end) >> (space)->ashift)); *mirror = (((space)->ashift < 0) ? ((*mirror) << -(space)->ashift) : ((*mirror) >> (space)->ashift)); } static int init_addrspace(UINT8 cpunum, UINT8 spacenum) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; int cputype = Machine->drv->cpu[cpunum].cpu_type; int abits = cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_WIDTH + (spacenum)); int dbits = cputype_get_info_int(cputype, CPUINFO_INT_DATABUS_WIDTH + (spacenum)); int accessorindex = (dbits == 8) ? 0 : (dbits == 16) ? 1 : (dbits == 32) ? 2 : 3; construct_map_t internal_map = (construct_map_t)cputype_get_info_fct(cputype, CPUINFO_PTR_INTERNAL_MEMORY_MAP + spacenum); int entrynum; space->cpunum = cpunum; space->spacenum = spacenum; space->ashift = cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_SHIFT + (spacenum)); space->abits = abits - space->ashift; space->dbits = dbits; space->rawmask = 0xffffffffUL >> (32 - abits); space->mask = (((space)->ashift < 0) ? (((space->rawmask) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((space->rawmask) >> (space)->ashift)); space->accessors = &memory_accessors[spacenum][accessorindex][cputype_get_info_int(cputype, CPUINFO_INT_ENDIANNESS) == CPU_IS_LE ? 0 : 1]; space->map = ((void *)0); space->adjmap = ((void *)0); if (space->abits == 0) return 1; cpudata[cpunum].spacemask |= 1 << spacenum; if (internal_map || Machine->drv->cpu[cpunum].construct_map[spacenum][0] || Machine->drv->cpu[cpunum].construct_map[spacenum][1]) { address_map *map = auto_malloc(sizeof(space->map[0]) * 256 * 4); memset(map, 0, sizeof(space->map[0]) * 256 * 4); space->map = map; space->adjmap = &map[256 * 2]; if (internal_map) map = (*internal_map)(map); if (Machine->drv->cpu[cpunum].construct_map[spacenum][0]) map = (*Machine->drv->cpu[cpunum].construct_map[spacenum][0])(map); if (Machine->drv->cpu[cpunum].construct_map[spacenum][1]) map = (*Machine->drv->cpu[cpunum].construct_map[spacenum][1])(map); if (spacenum == 0 && memory_region(REGION_CPU1 + cpunum)) for (map = space->map; !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0) && ((FPTR)(map->read.handler) == 69) && !map->region) { map->region = REGION_CPU1 + cpunum; map->region_offs = (((space)->ashift < 0) ? ((map->start) << -(space)->ashift) : ((map->start) >> (space)->ashift)); } for (map = space->map; !(((map)->flags & 0x04) != 0); map++) if (map->region) map->memory = memory_region(map->region) + map->region_offs; memcpy(space->adjmap, space->map, sizeof(space->map[0]) * 256 * 2); for (map = space->adjmap; !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0)) adjust_addresses(space, (((map)->flags & 0x02) != 0), &map->start, &map->end, &map->mask, &map->mirror); for (map = space->adjmap; !(((map)->flags & 0x04) != 0); map++) if (map->region && map->share == 0 && !map->base) { UINT8 *base = memory_region(map->region); offs_t length = memory_region_length(map->region); if (!base) 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); if (map->region_offs + (map->end - map->start + 1) > length) 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); } } memset(space->read.handlers, 0, sizeof(space->read.handlers)); memset(space->write.handlers, 0, sizeof(space->write.handlers)); for (entrynum = 0; entrynum < ((256-64)); entrynum++) { space->read.handlers[entrynum].handler.generic = get_static_handler(dbits, 0, spacenum, entrynum); space->read.handlers[entrynum].mask = space->mask; space->write.handlers[entrynum].handler.generic = get_static_handler(dbits, 1, spacenum, entrynum); space->write.handlers[entrynum].mask = space->mask; } space->read.table = malloc(1 << 18); space->write.table = malloc(1 << 18); if (!space->read.table) osd_die("cpu #%d couldn't allocate read table\n", cpunum); if (!space->write.table) osd_die("cpu #%d couldn't allocate write table\n", cpunum); memset(space->read.table, 71, 1 << 18); memset(space->write.table, 71, 1 << 18); return 1; } static int preflight_memory(void) { int cpunum, spacenum, entrynum; memset(&bankdata, 0, sizeof(bankdata)); for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) for (spacenum = 0; spacenum < 3; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; const address_map *map; for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++) { if ((((map)->flags & 0x01) != 0)) { UINT32 flags = ((map)->start); UINT32 val; if (flags & 0x00000001) { val = (flags & (0x0f << 8)) >> 8; if (val != spacenum) { osd_die("cpu #%d has address space %d handlers in place of address space %d handlers!\n", cpunum, val, spacenum); return -1; } } if (flags & 0x00000004) { val = (flags & (0x07 << 18)) >> 18; val = (val + 1) * 8; if (val != space->dbits) { osd_die("cpu #%d uses wrong %d-bit handlers for address space %d (should be %d-bit)!\n", cpunum, val, spacenum, space->dbits); return -1; } } if (flags & 0x00000002) { space->rawmask = 0xffffffffUL >> (32 - ((flags & (0x3f << 12)) >> 12)); space->mask = (((space)->ashift < 0) ? (((space->rawmask) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((space->rawmask) >> (space)->ashift)); } if (flags & 0x00000008) space->unmap = ((flags & (1 << 21)) == 0) ? (UINT64)0 : (UINT64)-1; } else { int bank = -1; if (((FPTR)(map->read.handler) >= 1 && (FPTR)(map->read.handler) <= (68 - 1))) bank = ((FPTR)(map->read.handler)); else if (((FPTR)(map->write.handler) >= 1 && (FPTR)(map->write.handler) <= (68 - 1))) bank = ((FPTR)(map->write.handler)); if (bank >= 1 && bank <= 32) { bank_data *bdata = &bankdata[bank]; if (!bdata->used) state_save_register_UINT8("memory", bank, "bank.entry", &bdata->curentry, 1); bdata->used = 1; bdata->dynamic = 0; bdata->cpunum = cpunum; bdata->spacenum = spacenum; if (bank == ((FPTR)(map->read.handler))) bdata->read = 1; if (bank == ((FPTR)(map->write.handler))) bdata->write = 1; bdata->base = map->start; bdata->end = map->end; bdata->curentry = 64; } } } for (entrynum = 0; entrynum < ((256-64)); entrynum++) { space->read.handlers[entrynum].mask &= space->mask; space->write.handlers[entrynum].mask &= space->mask; } } return 1; } static int populate_memory(void) { int cpunum, spacenum; for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) for (spacenum = 0; spacenum < 3; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; const address_map *map; if (space->map) { for (map = space->map; !(((map)->flags & 0x04) != 0); map++) ; for (map--; map >= space->map; map--) if (!(((map)->flags & 0x01) != 0)) { int ismatchmask = ((map->flags & 0x02) != 0); int isfixed = (map->memory != ((void *)0)) || (map->share != 0); if (map->read.handler) install_mem_handler(space, 0, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->read.handler, isfixed, map->read_name); if (map->write.handler) install_mem_handler(space, 1, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->write.handler, isfixed, map->write_name); } } } return 1; } 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) { offs_t lmirrorbit[18], lmirrorbits, hmirrorbit[(32 - 18)], hmirrorbits, lmirrorcount, hmirrorcount; table_data *tabledata = iswrite ? &space->write : &space->read; UINT8 idx, prev_entry = 0; int cur_index, prev_index = 0; offs_t original_mask = mask; int i; if (space->dbits != databits) osd_die("fatal: install_mem_handler called with a %d-bit handler for a %d-bit address space\n", databits, space->dbits); if (start > end) osd_die("fatal: install_mem_handler called with start greater than end\n"); if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1))) { bank_data *bdata = &bankdata[((FPTR)(handler))]; if (!bdata->used) { bdata->used = 1; bdata->dynamic = 0; bdata->cpunum = space->cpunum; bdata->spacenum = space->spacenum; bdata->base = start; bdata->end = end; bdata->curentry = 64; if (state_save_registration_allowed()) state_save_register_UINT8("memory", ((FPTR)(handler)), "bank.entry", &bdata->curentry, 1); ; } } adjust_addresses(space, ismatchmask, &start, &end, &mask, &mirror); if (((FPTR)(handler) == 69)) handler = iswrite ? (genf *)71 : (genf *)((read8_handler)68); if (((FPTR)(handler) == 68)) { handler = (genf *)assign_dynamic_bank(space->cpunum, space->spacenum, start, end, mirror, isfixed, original_mask != 0); if (!bank_ptr[((FPTR)(handler))]) bank_ptr[((FPTR)(handler))] = memory_find_base(space->cpunum, space->spacenum, iswrite, start); } if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1))) { bank_data *bdata = &bankdata[((FPTR)(handler))]; if (!iswrite) bdata->read = 1; else bdata->write = 1; } hmirrorbits = lmirrorbits = 0; for (i = 0; i < (32 - 18); i++) if (mirror & (1 << i)) lmirrorbit[lmirrorbits++] = 1 << i; for (i = (32 - 18); i < 32; i++) if (mirror & (1 << i)) hmirrorbit[hmirrorbits++] = 1 << i; idx = get_handler_index(tabledata->handlers, handler, handler_name, start, end, mask); for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++) { offs_t hmirrorbase = 0; for (i = 0; i < hmirrorbits; i++) if (hmirrorcount & (1 << i)) hmirrorbase |= hmirrorbit[i]; cur_index = ((start + hmirrorbase) >> (32 - 18)); if (cur_index == ((end + hmirrorbase) >> (32 - 18))) { if (hmirrorcount != 0 && prev_entry == tabledata->table[cur_index]) { ; if (tabledata->table[cur_index] >= (256-64)) release_subtable(tabledata, tabledata->table[cur_index]); if (tabledata->table[prev_index] >= (256-64)) reallocate_subtable(tabledata, tabledata->table[prev_index]); tabledata->table[cur_index] = tabledata->table[prev_index]; continue; } prev_index = cur_index; prev_entry = tabledata->table[cur_index]; } for (lmirrorcount = 0; lmirrorcount < (1 << lmirrorbits); lmirrorcount++) { offs_t lmirrorbase = hmirrorbase; for (i = 0; i < lmirrorbits; i++) if (lmirrorcount & (1 << i)) lmirrorbase |= lmirrorbit[i]; if (!ismatchmask) populate_table_range(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx); else populate_table_match(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx); } } if (space->cpunum == cur_context) memory_set_context(cur_context); } static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked) { int bank; for (bank = 66; bank >= 1; bank--) if (!bankdata[bank].used || (bankdata[bank].dynamic && bankdata[bank].cpunum == cpunum && bankdata[bank].spacenum == spacenum && bankdata[bank].base == start)) { bankdata[bank].used = 1; bankdata[bank].dynamic = 1; bankdata[bank].cpunum = cpunum; bankdata[bank].spacenum = spacenum; bankdata[bank].base = start; bankdata[bank].end = end; ; return ((genf *)(bank)); } osd_die("cpu #%d: ran out of banks for RAM/ROM regions!\n", cpunum); return ((void *)0); } static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask) { int i; start &= mask; if (((FPTR)(handler) < 72)) { i = (FPTR)handler; if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1))) { table[i].offset = start; table[i].top = end; table[i].mask = mask; table[i].name = handler_name; } return i; } for (i = 72; i < (256-64); i++) { if (table[i].handler.generic == ((void *)0)) { table[i].handler.generic = handler; table[i].offset = start; table[i].top = end; table[i].mask = mask; table[i].name = handler_name; return i; } if (table[i].handler.generic == handler && table[i].offset == start && table[i].mask == mask) return i; } return 0; } static void populate_table_range(addrspace_data *space, int iswrite, offs_t start, offs_t stop, UINT8 handler) { table_data *tabledata = iswrite ? &space->write : &space->read; offs_t l2mask = (1 << (32 - 18)) - 1; offs_t l1start = start >> (32 - 18); offs_t l2start = start & l2mask; offs_t l1stop = stop >> (32 - 18); offs_t l2stop = stop & l2mask; offs_t l1index; if (start > stop) return; if (l2start != 0) { UINT8 *subtable = open_subtable(tabledata, l1start); if (l1start == l1stop) { memset(&subtable[l2start], handler, l2stop - l2start + 1); close_subtable(tabledata, l1start); return; } memset(&subtable[l2start], handler, (1 << (32 - 18)) - l2start); close_subtable(tabledata, l1start); if (l1start != (offs_t)~0) l1start++; } if (l2stop != l2mask) { UINT8 *subtable = open_subtable(tabledata, l1stop); memset(&subtable[0], handler, l2stop + 1); close_subtable(tabledata, l1stop); if (l1start == l1stop) return; if (l1stop != 0) l1stop--; } for (l1index = l1start; l1index <= l1stop; l1index++) { if (tabledata->table[l1index] >= (256-64)) release_subtable(tabledata, tabledata->table[l1index]); tabledata->table[l1index] = handler; } } static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler) { table_data *tabledata = iswrite ? &space->write : &space->read; int lowermask, lowermatch; int uppermask, uppermatch; int l1index, l2index; matchval &= matchmask; lowermask = matchmask & ((1<<(32 - 18))-1); lowermatch = matchval & ((1<<(32 - 18))-1); uppermask = matchmask >> (32 - 18); uppermatch = matchval >> (32 - 18); if (lowermask == 0) { for (l1index = 0; l1index <= (space->mask >> (32 - 18)); l1index++) if ((l1index & uppermatch) == uppermask) { if (tabledata->table[l1index] >= (256-64)) release_subtable(tabledata, tabledata->table[l1index]); tabledata->table[l1index] = handler; } } else { for (l1index = 0; l1index <= (space->mask >> (32 - 18)); l1index++) if ((l1index & uppermatch) == uppermask) { UINT8 *subtable = open_subtable(tabledata, l1index); for (l2index = 0; l2index < (1 << (32 - 18)); l2index++) if ((l2index & lowermask) == lowermatch) subtable[l2index] = handler; close_subtable(tabledata, l1index); } } } static UINT8 allocate_subtable(table_data *tabledata) { while (1) { UINT8 subindex; for (subindex = 0; subindex < 64; subindex++) if (tabledata->subtable[subindex].usecount == 0) { if (subindex >= tabledata->subtable_alloc) { tabledata->subtable_alloc += 8; tabledata->table = realloc(tabledata->table, (1 << 18) + (tabledata->subtable_alloc << (32 - 18))); if (!tabledata->table) osd_die("error: ran out of memory allocating memory subtable\n"); } tabledata->subtable[subindex].usecount++; return subindex + (256-64); } if (!merge_subtables(tabledata)) osd_die("Ran out of subtables!\n"); } return 0; } static void reallocate_subtable(table_data *tabledata, UINT8 subentry) { UINT8 subindex = subentry - (256-64); if (tabledata->subtable[subindex].usecount <= 0) osd_die("Called reallocate_subtable on a table with a usecount of 0\n"); tabledata->subtable[subindex].usecount++; } static int merge_subtables(table_data *tabledata) { int merged = 0; UINT8 subindex; ; for (subindex = 0; subindex < 64; subindex++) if (!tabledata->subtable[subindex].checksum_valid && tabledata->subtable[subindex].usecount != 0) { UINT32 *subtable = (UINT32 *)(&(tabledata)->table[(1 << 18) + (((subindex + (256-64)) - (256-64)) << (32 - 18))]); UINT32 checksum = 0; int l2index; for (l2index = 0; l2index < (1 << (32 - 18))/4; l2index++) checksum += subtable[l2index]; tabledata->subtable[subindex].checksum = checksum; tabledata->subtable[subindex].checksum_valid = 1; } for (subindex = 0; subindex < 64; subindex++) if (tabledata->subtable[subindex].usecount != 0) { UINT8 *subtable = (&(tabledata)->table[(1 << 18) + (((subindex + (256-64)) - (256-64)) << (32 - 18))]); UINT32 checksum = tabledata->subtable[subindex].checksum; UINT8 sumindex; for (sumindex = subindex + 1; sumindex < 64; sumindex++) if (tabledata->subtable[sumindex].usecount != 0 && tabledata->subtable[sumindex].checksum == checksum && !memcmp(subtable, (&(tabledata)->table[(1 << 18) + (((sumindex + (256-64)) - (256-64)) << (32 - 18))]), 1 << (32 - 18))) { int l1index; ; for (l1index = 0; l1index <= (0xffffffffUL >> (32 - 18)); l1index++) if (tabledata->table[l1index] == sumindex + (256-64)) { release_subtable(tabledata, sumindex + (256-64)); reallocate_subtable(tabledata, subindex + (256-64)); tabledata->table[l1index] = subindex + (256-64); merged++; } } } return merged; } static void release_subtable(table_data *tabledata, UINT8 subentry) { UINT8 subindex = subentry - (256-64); if (tabledata->subtable[subindex].usecount <= 0) osd_die("Called release_subtable on a table with a usecount of 0\n"); tabledata->subtable[subindex].usecount--; if (tabledata->subtable[subindex].usecount == 0) tabledata->subtable[subindex].checksum = 0; } static UINT8 *open_subtable(table_data *tabledata, offs_t l1index) { UINT8 subentry = tabledata->table[l1index]; if (subentry < (256-64)) { UINT8 newentry = allocate_subtable(tabledata); memset((&(tabledata)->table[(1 << 18) + (((newentry) - (256-64)) << (32 - 18))]), subentry, 1 << (32 - 18)); tabledata->table[l1index] = newentry; tabledata->subtable[newentry - (256-64)].checksum = (subentry + (subentry << 8) + (subentry << 16) + (subentry << 24)) * ((1 << (32 - 18))/4); subentry = newentry; } else if (tabledata->subtable[subentry - (256-64)].usecount > 1) { UINT8 newentry = allocate_subtable(tabledata); memcpy((&(tabledata)->table[(1 << 18) + (((newentry) - (256-64)) << (32 - 18))]), (&(tabledata)->table[(1 << 18) + (((subentry) - (256-64)) << (32 - 18))]), 1 << (32 - 18)); release_subtable(tabledata, subentry); tabledata->table[l1index] = newentry; tabledata->subtable[newentry - (256-64)].checksum = tabledata->subtable[subentry - (256-64)].checksum; subentry = newentry; } tabledata->subtable[subentry - (256-64)].checksum_valid = 0; return (&(tabledata)->table[(1 << 18) + (((subentry) - (256-64)) << (32 - 18))]); } static void close_subtable(table_data *tabledata, offs_t l1index) { } static int amentry_needs_backing_store(int cpunum, int spacenum, const address_map *map) { int handler; if ((((map)->flags & 0x01) != 0)) return 0; if (map->base) return 1; handler = (int)map->write.handler; if (handler >= 0 && handler < 72) { if (handler != 0 && handler != 69 && handler != 70 && handler != 71) return 1; } handler = (int)map->read.handler; if (handler >= 0 && handler < 72) { if (handler != 0 && (handler < 1 || handler > 1 + 66 - 1) && (handler != 69 || spacenum != 0 || map->start >= memory_region_length(REGION_CPU1 + cpunum)) && handler != 70 && handler != 71) return 1; } return 0; } static int allocate_memory(void) { int cpunum, spacenum; for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) for (spacenum = 0; spacenum < 3; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; address_map *map, *unassigned = ((void *)0); int start_count = memory_block_count; int i; for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0) && map->memory) { if (!(((map)->flags & 0x02) != 0)) allocate_memory_block(cpunum, spacenum, map->start, map->end, map->memory); else allocate_memory_block(cpunum, spacenum, map->start, map->start + map->mask, map->memory); } for (i = start_count; i < memory_block_count; i++) unassigned = assign_intersecting_blocks(space, memory_block_list[i].start, memory_block_list[i].end, memory_block_list[i].data); if (!unassigned) unassigned = assign_intersecting_blocks(space, ~0, 0, ((void *)0)); while (unassigned) { offs_t curstart, curend; int changed; void *block; curstart = unassigned->start / 65536; if (!(((unassigned)->flags & 0x02) != 0)) curend = unassigned->end / 65536; else curend = (unassigned->start + unassigned->mask) / 65536; do { changed = 0; for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0) && !map->memory && map != unassigned && amentry_needs_backing_store(cpunum, spacenum, map)) { offs_t blockstart, blockend; blockstart = map->start / 65536; if (!(((map)->flags & 0x02) != 0)) blockend = map->end / 65536; else blockend = (map->start + map->mask) / 65536; if (blockstart <= curend + 1 && blockend >= curstart - 1) { if (blockstart < curstart) curstart = blockstart, changed = 1; if (blockend > curend) curend = blockend, changed = 1; } } } while (changed); curstart = curstart * 65536; curend = curend * 65536 + (65536 - 1); block = allocate_memory_block(cpunum, spacenum, curstart, curend, ((void *)0)); unassigned = assign_intersecting_blocks(space, curstart, curend, block); } } return 1; } static void *allocate_memory_block(int cpunum, int spacenum, offs_t start, offs_t end, void *memory) { memory_block *block = &memory_block_list[memory_block_count]; int allocatemem = (memory == ((void *)0)); ; if (allocatemem) { memory = auto_malloc(end - start + 1); memset(memory, 0, end - start + 1); } register_for_save(cpunum, spacenum, start, memory, end - start + 1); block->cpunum = cpunum; block->spacenum = spacenum; block->isallocated = allocatemem; block->start = start; block->end = end; block->data = memory; memory_block_count++; return memory; } static void register_for_save(int cpunum, int spacenum, offs_t start, void *base, size_t numbytes) { char name[256]; sprintf(name, "%d.%08x-%08x", spacenum, start, (int)(start + numbytes - 1)); switch (cpudata[cpunum].space[spacenum].dbits) { case 8: state_save_register_UINT8 ("memory", cpunum, name, base, numbytes); break; case 16: state_save_register_UINT16("memory", cpunum, name, base, numbytes/2); break; case 32: state_save_register_UINT32("memory", cpunum, name, base, numbytes/4); break; case 64: state_save_register_UINT64("memory", cpunum, name, base, numbytes/8); break; } } static address_map *assign_intersecting_blocks(addrspace_data *space, offs_t start, offs_t end, UINT8 *base) { address_map *map, *unassigned = ((void *)0); for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0)) { if (!map->memory) { if (map->share && shared_ptr[map->share]) { map->memory = shared_ptr[map->share]; ; } else { if (!(((map)->flags & 0x02) != 0)) { if (map->start >= start && map->end <= end) { map->memory = base + (map->start - start); ; } } else { if (map->start >= start && map->start + map->mask <= end) { map->memory = base + (map->start - start); ; } } } } if (map->memory && map->share && !shared_ptr[map->share]) shared_ptr[map->share] = map->memory; if (!map->memory && !unassigned && amentry_needs_backing_store(space->cpunum, space->spacenum, map)) unassigned = map; } return unassigned; } static void reattach_banks(void) { int banknum; for (banknum = 1; banknum <= 66; banknum++) if (bankdata[banknum].used && !bankdata[banknum].dynamic) { if (bankdata[banknum].curentry != 64) bank_ptr[banknum] = bankdata[banknum].entry[bankdata[banknum].curentry]; } } static int find_memory(void) { int cpunum, spacenum, banknum; for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) for (spacenum = 0; spacenum < 3; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; const address_map *map; for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0)) { if (map->base) *map->base = map->memory; if (map->size) { if (!(((map)->flags & 0x02) != 0)) *map->size = map->end - map->start + 1; else *map->size = map->mask + 1; } } } for (banknum = 1; banknum <= 66; banknum++) if (bankdata[banknum].used) { address_map *map; for (map = cpudata[bankdata[banknum].cpunum].space[bankdata[banknum].spacenum].adjmap; map && !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0) && map->start == bankdata[banknum].base) { bank_ptr[banknum] = map->memory; ; break; } if (!bankdata[banknum].dynamic && bankdata[banknum].curentry != 64) bank_ptr[banknum] = bankdata[banknum].entry[bankdata[banknum].curentry]; } state_save_register_func_postload(reattach_banks); return 1; } # 2281 "src/memory.c" static void *memory_find_base(int cpunum, int spacenum, int readwrite, offs_t offset) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; address_map *map; memory_block *block; int blocknum; ; for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++) if (!(((map)->flags & 0x01) != 0)) { offs_t maskoffs = offset & map->mask; if (!(((map)->flags & 0x02) != 0)) { if (maskoffs >= map->start && maskoffs <= map->end) { ; return (UINT8 *)map->memory + (maskoffs - map->start); } } else { if ((maskoffs & map->end) == map->start) { ; return (UINT8 *)map->memory + (maskoffs - map->start); } } } for (blocknum = 0, block = memory_block_list; blocknum < memory_block_count; blocknum++, block++) if (block->cpunum == cpunum && block->spacenum == spacenum && block->start <= offset && block->end > offset) { ; return block->data + offset - block->start; } ; return ((void *)0); } # 2695 "src/memory.c" 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; } 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);} 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; } 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; } 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); } } 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);} 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; } 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; } 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); } } 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);} 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; } 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; } 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; } 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); } } 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); } } 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);} 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; } 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; } 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; } 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); } } 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); } } 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);} 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; } 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; } 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; } 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; } 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); } } 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); } } 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); } } 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);} 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; } 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; } 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; } 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; } 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); } } 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); } } 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); } } 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);} 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; } 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);} 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; } 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; } 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); } } 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);} 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; } 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; } 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); } } 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);} 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; } 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; } 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; } 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); } } 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); } } 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);} 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; } 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; } 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; } 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); } } 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); } } 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);} 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; } 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; } 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; } 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; } 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); } } 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); } } 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); } } 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);} 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; } 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; } 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; } 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; } 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); } } 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); } } 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); } } 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);} 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; } 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);} 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; } 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; } 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); } } 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);} 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; } 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; } 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); } } 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);} 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; } 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; } 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; } 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); } } 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); } } 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);} 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; } 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; } 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; } 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); } } 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); } } 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);} 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; } 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; } 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; } 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; } 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); } } 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); } } 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); } } 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);} 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; } 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; } 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; } 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; } 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); } } 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); } } 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); } } 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);} UINT8 cpu_readop_safe(offs_t offset) { activecpu_set_opbase(offset); return (opcode_base[(offset) & opcode_mask]); } UINT16 cpu_readop16_safe(offs_t offset) { activecpu_set_opbase(offset); return (*(UINT16 *)&opcode_base[(offset) & opcode_mask]); } UINT32 cpu_readop32_safe(offs_t offset) { activecpu_set_opbase(offset); return (*(UINT32 *)&opcode_base[(offset) & opcode_mask]); } UINT64 cpu_readop64_safe(offs_t offset) { activecpu_set_opbase(offset); return (*(UINT64 *)&opcode_base[(offset) & opcode_mask]); } UINT8 cpu_readop_arg_safe(offs_t offset) { activecpu_set_opbase(offset); return (opcode_arg_base[(offset) & opcode_mask]); } UINT16 cpu_readop_arg16_safe(offs_t offset) { activecpu_set_opbase(offset); return (*(UINT16 *)&opcode_arg_base[(offset) & opcode_mask]); } UINT32 cpu_readop_arg32_safe(offs_t offset) { activecpu_set_opbase(offset); return (*(UINT32 *)&opcode_arg_base[(offset) & opcode_mask]); } UINT64 cpu_readop_arg64_safe(offs_t offset) { activecpu_set_opbase(offset); return (*(UINT64 *)&opcode_arg_base[(offset) & opcode_mask]); } static UINT8 mrh8_unmap_program(__attribute__((__unused__)) offs_t offset) { 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))); return cpudata[cpu_getactivecpu()].space[0].unmap; } static UINT16 mrh16_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[0].unmap; } static UINT32 mrh32_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[0].unmap; } static UINT64 mrh64_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[0].unmap; } static void mwh8_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data) { 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); } static void mwh16_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask) { 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); } static void mwh32_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask) { 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); } static void mwh64_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask) { 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); } static UINT8 mrh8_unmap_data(__attribute__((__unused__)) offs_t offset) { 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))); return cpudata[cpu_getactivecpu()].space[1].unmap; } static UINT16 mrh16_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[1].unmap; } static UINT32 mrh32_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[1].unmap; } static UINT64 mrh64_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[1].unmap; } static void mwh8_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data) { 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); } static void mwh16_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask) { 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); } static void mwh32_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask) { 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); } static void mwh64_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask) { 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); } static UINT8 mrh8_unmap_io(__attribute__((__unused__)) offs_t offset) { 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))); return cpudata[cpu_getactivecpu()].space[2].unmap; } static UINT16 mrh16_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[2].unmap; } static UINT32 mrh32_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[2].unmap; } static UINT64 mrh64_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { 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); return cpudata[cpu_getactivecpu()].space[2].unmap; } static void mwh8_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data) { 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); } static void mwh16_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask) { 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); } static void mwh32_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask) { 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); } static void mwh64_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask) { 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); } static UINT8 mrh8_nop_program(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[0].unmap; } static UINT16 mrh16_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; } static UINT32 mrh32_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; } static UINT64 mrh64_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; } static UINT8 mrh8_nop_data(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[1].unmap; } static UINT16 mrh16_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; } static UINT32 mrh32_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; } static UINT64 mrh64_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; } static UINT8 mrh8_nop_io(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[2].unmap; } static UINT16 mrh16_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; } static UINT32 mrh32_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; } static UINT64 mrh64_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; } static void mwh8_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data) { } static void mwh16_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask) { } static void mwh32_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask) { } static void mwh64_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask) { } static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which) { static const struct { UINT8 databits; UINT8 handlernum; UINT8 spacenum; genf * read; genf * write; } static_handler_list[] = { { 8, 71, 0, (genf *)mrh8_unmap_program, (genf *)mwh8_unmap_program }, { 8, 71, 1, (genf *)mrh8_unmap_data, (genf *)mwh8_unmap_data }, { 8, 71, 2, (genf *)mrh8_unmap_io, (genf *)mwh8_unmap_io }, { 8, 70, 0, (genf *)mrh8_nop_program, (genf *)mwh8_nop }, { 8, 70, 1, (genf *)mrh8_nop_data, (genf *)mwh8_nop }, { 8, 70, 2, (genf *)mrh8_nop_io, (genf *)mwh8_nop }, { 16, 71, 0, (genf *)mrh16_unmap_program,(genf *)mwh16_unmap_program }, { 16, 71, 1, (genf *)mrh16_unmap_data, (genf *)mwh16_unmap_data }, { 16, 71, 2, (genf *)mrh16_unmap_io, (genf *)mwh16_unmap_io }, { 16, 70, 0, (genf *)mrh16_nop_program, (genf *)mwh16_nop }, { 16, 70, 1, (genf *)mrh16_nop_data, (genf *)mwh16_nop }, { 16, 70, 2, (genf *)mrh16_nop_io, (genf *)mwh16_nop }, { 32, 71, 0, (genf *)mrh32_unmap_program,(genf *)mwh32_unmap_program }, { 32, 71, 1, (genf *)mrh32_unmap_data, (genf *)mwh32_unmap_data }, { 32, 71, 2, (genf *)mrh32_unmap_io, (genf *)mwh32_unmap_io }, { 32, 70, 0, (genf *)mrh32_nop_program, (genf *)mwh32_nop }, { 32, 70, 1, (genf *)mrh32_nop_data, (genf *)mwh32_nop }, { 32, 70, 2, (genf *)mrh32_nop_io, (genf *)mwh32_nop }, { 64, 71, 0, (genf *)mrh64_unmap_program,(genf *)mwh64_unmap_program }, { 64, 71, 1, (genf *)mrh64_unmap_data, (genf *)mwh64_unmap_data }, { 64, 71, 2, (genf *)mrh64_unmap_io, (genf *)mwh64_unmap_io }, { 64, 70, 0, (genf *)mrh64_nop_program, (genf *)mwh64_nop }, { 64, 70, 1, (genf *)mrh64_nop_data, (genf *)mwh64_nop }, { 64, 70, 2, (genf *)mrh64_nop_io, (genf *)mwh64_nop }, }; int tablenum; for (tablenum = 0; tablenum < sizeof(static_handler_list) / sizeof(static_handler_list[0]); tablenum++) if (static_handler_list[tablenum].databits == databits && static_handler_list[tablenum].handlernum == which) if (static_handler_list[tablenum].spacenum == 0xff || static_handler_list[tablenum].spacenum == spacenum) return readorwrite ? static_handler_list[tablenum].write : static_handler_list[tablenum].read; return ((void *)0); } static const char *handler_to_string(const table_data *table, UINT8 entry) { static const char *strings[] = { "invalid", "bank 1", "bank 2", "bank 3", "bank 4", "bank 5", "bank 6", "bank 7", "bank 8", "bank 9", "bank 10", "bank 11", "bank 12", "bank 13", "bank 14", "bank 15", "bank 16", "bank 17", "bank 18", "bank 19", "bank 20", "bank 21", "bank 22", "bank 23", "bank 24", "bank 25", "bank 26", "bank 27", "bank 28", "bank 29", "bank 30", "bank 31", "bank 32", "ram[33]", "ram[34]", "ram[35]", "ram[36]", "ram[37]", "ram[38]", "ram[39]", "ram[40]", "ram[41]", "ram[42]", "ram[43]", "ram[44]", "ram[45]", "ram[46]", "ram[47]", "ram[48]", "ram[49]", "ram[50]", "ram[51]", "ram[52]", "ram[53]", "ram[54]", "ram[55]", "ram[56]", "ram[57]", "ram[58]", "ram[59]", "ram[60]", "ram[61]", "ram[62]", "ram[63]", "ram[64]", "ram[65]", "ram[66]", "ram[67]", "ram[68]", "rom", "nop", "unmapped" }; if (entry < 72) return strings[entry]; else return table->handlers[entry].name ? table->handlers[entry].name : "???"; } static void dump_map(FILE *file, const addrspace_data *space, const table_data *table) { int l1count = 1 << 18; int l2count = 1 << (32 - 18); UINT8 lastentry = 71; int entrymatches = 0; int i, j; fprintf(file, " Address bits = %d\n", space->abits); fprintf(file, " Data bits = %d\n", space->dbits); fprintf(file, " L1 bits = %d\n", 18); fprintf(file, " L2 bits = %d\n", (32 - 18)); fprintf(file, " Address mask = %X\n", space->mask); fprintf(file, "\n"); for (i = 0; i < l1count; i++) { UINT8 entry = table->table[i]; if (entry < (256-64) && entry == lastentry) { entrymatches++; continue; } if (lastentry < (256-64) && lastentry != 71) fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n", (i - entrymatches) << (32 - 18), (i << (32 - 18)) - 1, lastentry, handler_to_string(table, lastentry), table->handlers[lastentry].offset); lastentry = entry; entrymatches = 1; if (entry >= (256-64)) { UINT8 lastentry2 = 71; int entry2matches = 0; entry -= (256-64); for (j = 0; j < l2count; j++) { UINT8 entry2 = table->table[(1 << 18) + (entry << (32 - 18)) + j]; if (entry2 < (256-64) && entry2 == lastentry2) { entry2matches++; continue; } if (lastentry2 < (256-64) && lastentry2 != 71) fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n", ((i << (32 - 18)) | (j - entry2matches)), ((i << (32 - 18)) | j) - 1, lastentry2, handler_to_string(table, lastentry2), table->handlers[lastentry2].offset); lastentry2 = entry2; entry2matches = 1; } if (lastentry2 < (256-64) && lastentry2 != 71) fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n", ((i << (32 - 18)) | (j - entry2matches)), ((i << (32 - 18)) | j) - 1, lastentry2, handler_to_string(table, lastentry2), table->handlers[lastentry2].offset); } } if (lastentry < (256-64) && lastentry != 71) fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n", (i - entrymatches) << (32 - 18), (i << (32 - 18)) - 1, lastentry, handler_to_string(table, lastentry), table->handlers[lastentry].offset); } void memory_dump(FILE *file) { int cpunum, spacenum; if (!file) return; for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) for (spacenum = 0; spacenum < 3; spacenum++) if (cpudata[cpunum].space[spacenum].abits) { fprintf(file, "\n\n" "=========================================\n" "CPU %d address space %d read handler dump\n" "=========================================\n", cpunum, spacenum); dump_map(file, &cpudata[cpunum].space[spacenum], &cpudata[cpunum].space[spacenum].read); fprintf(file, "\n\n" "==========================================\n" "CPU %d address space %d write handler dump\n" "==========================================\n", cpunum, spacenum); dump_map(file, &cpudata[cpunum].space[spacenum], &cpudata[cpunum].space[spacenum].write); } } const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; const table_data *table = read0_or_write1 ? &space->write : &space->read; UINT8 entry; offset &= space->mask; entry = table->table[((offset) >> (32 - 18))]; if (entry >= (256-64)) entry = table->table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))]; return handler_to_string(table, entry); }