]> git.wh0rd.org - ICEs.git/blob - bfin-asm-math/memory.i.1
more
[ICEs.git] / bfin-asm-math / memory.i.1
1 # 1 "src/memory.c"
2 # 1 "<built-in>"
3 # 1 "<command line>"
4 # 1 "src/memory.c"
5 # 94 "src/memory.c"
6 # 1 "src/driver.h" 1
7 # 12 "src/driver.h"
8
9 # 62 "src/driver.h"
10 # 1 "src/mamecore.h" 1
11 # 12 "src/mamecore.h"
12
13
14
15
16
17 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 1 3 4
18 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
19 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 1 3 4
20 # 267 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 3 4
21 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_config.h" 1 3 4
22 # 268 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 2 3 4
23 # 303 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 3 4
24 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/cdefs.h" 1 3 4
25 # 304 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/features.h" 2 3 4
26 # 29 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
27
28
29
30
31
32 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
33 # 213 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4
34 typedef long unsigned int size_t;
35 # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
36
37 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 1 3 4
38 # 29 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 3 4
39 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
40 # 30 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4
41 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/kernel_types.h" 1 3 4
42 # 10 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/kernel_types.h" 3 4
43 typedef unsigned short __kernel_dev_t;
44 typedef unsigned long __kernel_ino_t;
45 typedef unsigned short __kernel_mode_t;
46 typedef unsigned short __kernel_nlink_t;
47 typedef long __kernel_off_t;
48 typedef int __kernel_pid_t;
49 typedef unsigned short __kernel_ipc_pid_t;
50 typedef unsigned short __kernel_uid_t;
51 typedef unsigned short __kernel_gid_t;
52 typedef unsigned int __kernel_size_t;
53 typedef int __kernel_ssize_t;
54 typedef int __kernel_ptrdiff_t;
55 typedef long __kernel_time_t;
56 typedef long __kernel_suseconds_t;
57 typedef long __kernel_clock_t;
58 typedef int __kernel_daddr_t;
59 typedef char * __kernel_caddr_t;
60 typedef unsigned short __kernel_uid16_t;
61 typedef unsigned short __kernel_gid16_t;
62 typedef unsigned int __kernel_uid32_t;
63 typedef unsigned int __kernel_gid32_t;
64 typedef unsigned short __kernel_old_uid_t;
65 typedef unsigned short __kernel_old_gid_t;
66 typedef long long __kernel_loff_t;
67 typedef __kernel_dev_t __kernel_old_dev_t;
68
69 typedef struct {
70
71
72
73 int __val[2];
74
75 } __kernel_fsid_t;
76 # 31 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4
77
78
79 typedef unsigned char __u_char;
80 typedef unsigned short __u_short;
81 typedef unsigned int __u_int;
82 typedef unsigned long __u_long;
83
84 __extension__ typedef unsigned long long int __u_quad_t;
85 __extension__ typedef long long int __quad_t;
86 # 50 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 3 4
87 typedef signed char __int8_t;
88 typedef unsigned char __uint8_t;
89 typedef signed short int __int16_t;
90 typedef unsigned short int __uint16_t;
91 typedef signed int __int32_t;
92 typedef unsigned int __uint32_t;
93
94 __extension__ typedef signed long long int __int64_t;
95 __extension__ typedef unsigned long long int __uint64_t;
96
97 typedef __quad_t *__qaddr_t;
98
99 typedef __u_quad_t __dev_t;
100 typedef __u_int __uid_t;
101 typedef __u_int __gid_t;
102 typedef __u_long __ino_t;
103 typedef __u_int __mode_t;
104 typedef __u_int __nlink_t;
105 typedef long int __off_t;
106 typedef __quad_t __loff_t;
107 typedef int __pid_t;
108 typedef long int __ssize_t;
109 typedef __u_long __rlim_t;
110 typedef __u_quad_t __rlim64_t;
111 typedef __u_int __id_t;
112
113 typedef struct
114 {
115 int __val[2];
116 } __fsid_t;
117
118
119 typedef int __daddr_t;
120 typedef char *__caddr_t;
121 typedef long int __time_t;
122 typedef unsigned int __useconds_t;
123 typedef long int __suseconds_t;
124 typedef long int __swblk_t;
125
126 typedef long int __clock_t;
127
128
129 typedef int __clockid_t;
130
131
132 typedef int __timer_t;
133
134
135
136
137
138
139 typedef int __key_t;
140
141
142 typedef __kernel_ipc_pid_t __ipc_pid_t;
143
144
145
146 typedef long int __blksize_t;
147
148
149
150
151 typedef long int __blkcnt_t;
152 typedef __quad_t __blkcnt64_t;
153
154
155 typedef __u_long __fsblkcnt_t;
156 typedef __u_quad_t __fsblkcnt64_t;
157
158
159 typedef __u_long __fsfilcnt_t;
160 typedef __u_quad_t __fsfilcnt64_t;
161
162
163 typedef __u_quad_t __ino64_t;
164
165
166 typedef __loff_t __off64_t;
167
168
169 typedef long int __t_scalar_t;
170 typedef unsigned long int __t_uscalar_t;
171
172
173 typedef int __intptr_t;
174
175
176 typedef unsigned int __socklen_t;
177
178
179
180
181 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 1 3 4
182 # 23 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 3 4
183 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sched.h" 1 3 4
184 # 68 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sched.h" 3 4
185 struct __sched_param
186 {
187 int __sched_priority;
188 };
189 # 24 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 2 3 4
190
191
192 struct _pthread_fastlock
193 {
194 long int __status;
195 int __spinlock;
196
197 };
198
199
200
201 typedef struct _pthread_descr_struct *_pthread_descr;
202
203
204
205
206
207 typedef struct __pthread_attr_s
208 {
209 int __detachstate;
210 int __schedpolicy;
211 struct __sched_param __schedparam;
212 int __inheritsched;
213 int __scope;
214 size_t __guardsize;
215 int __stackaddr_set;
216 void *__stackaddr;
217 size_t __stacksize;
218 } pthread_attr_t;
219
220
221
222 typedef struct
223 {
224 struct _pthread_fastlock __c_lock;
225 _pthread_descr __c_waiting;
226 } pthread_cond_t;
227
228
229
230 typedef struct
231 {
232 int __dummy;
233 } pthread_condattr_t;
234
235
236 typedef unsigned int pthread_key_t;
237
238
239
240
241
242 typedef struct
243 {
244 int __m_reserved;
245 int __m_count;
246 _pthread_descr __m_owner;
247 int __m_kind;
248 struct _pthread_fastlock __m_lock;
249 } pthread_mutex_t;
250
251
252
253 typedef struct
254 {
255 int __mutexkind;
256 } pthread_mutexattr_t;
257
258
259
260 typedef int pthread_once_t;
261 # 140 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 3 4
262 typedef unsigned long int pthread_t;
263 # 145 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/types.h" 2 3 4
264 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
265
266
267
268
269
270
271
272
273
274 typedef struct __STDIO_FILE_STRUCT FILE;
275
276
277
278
279
280 # 62 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
281 typedef struct __STDIO_FILE_STRUCT __FILE;
282 # 72 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
283 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 1 3 4
284 # 121 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
285 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/pthreadtypes.h" 1 3 4
286 # 122 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 2 3 4
287 # 178 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
288 typedef struct {
289 __off_t __pos;
290
291
292
293
294
295
296 } __STDIO_fpos_t;
297
298
299 typedef struct {
300 __off64_t __pos;
301
302
303
304
305
306
307 } __STDIO_fpos64_t;
308
309
310
311
312 typedef __off64_t __offmax_t;
313 # 241 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
314 struct __STDIO_FILE_STRUCT {
315 unsigned short __modeflags;
316
317
318
319
320
321
322
323 unsigned char __ungot[2];
324
325 int __filedes;
326
327 unsigned char *__bufstart;
328 unsigned char *__bufend;
329 unsigned char *__bufpos;
330 unsigned char *__bufread;
331
332
333 unsigned char *__bufgetc_u;
334
335
336 unsigned char *__bufputc_u;
337
338
339
340
341
342 struct __STDIO_FILE_STRUCT *__nextopen;
343 # 285 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
344 int __user_locking;
345 pthread_mutex_t __lock;
346
347
348
349
350
351 };
352 # 387 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
353 extern int __fgetc_unlocked(FILE *__stream);
354 extern int __fputc_unlocked(int __c, FILE *__stream);
355 # 406 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
356 extern FILE *__stdin;
357 # 465 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_stdio.h" 3 4
358 extern FILE *__stdout;
359 # 73 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
360
361
362
363 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 1 3 4
364 # 43 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 3 4
365 typedef __builtin_va_list __gnuc_va_list;
366 # 77 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
367
368
369
370
371
372
373 typedef __STDIO_fpos64_t fpos_t;
374
375
376 # 131 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
377 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/stdio_lim.h" 1 3 4
378 # 132 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 2 3 4
379
380
381
382 extern FILE *stdin;
383 extern FILE *stdout;
384 extern FILE *stderr;
385
386
387
388
389
390
391
392 extern int remove (__const char *__filename) ;
393
394 extern int rename (__const char *__old, __const char *__new) ;
395
396
397
398
399 # 160 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
400 extern FILE *tmpfile (void) __asm__ ("_" "tmpfile64");
401 # 171 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
402 extern char *tmpnam (char *__s) ;
403
404
405
406
407
408 extern char *tmpnam_r (char *__s) ;
409 # 189 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
410 extern char *tempnam (__const char *__dir, __const char *__pfx)
411 __attribute__ ((__malloc__));
412
413
414
415
416
417
418
419
420 extern int fclose (FILE *__stream);
421
422
423
424
425 extern int fflush (FILE *__stream);
426
427 # 214 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
428 extern int fflush_unlocked (FILE *__stream);
429 # 228 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
430
431 # 245 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
432 extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) __asm__ ("_" "fopen64");
433
434 extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("_" "freopen64");
435
436
437
438
439
440
441
442
443 # 266 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
444 extern FILE *fdopen (int __fd, __const char *__modes) ;
445 # 289 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
446
447
448
449 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ;
450
451
452
453 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
454 int __modes, size_t __n) ;
455
456
457
458
459
460 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
461 size_t __size) ;
462
463
464 extern void setlinebuf (FILE *__stream) ;
465
466
467
468
469
470
471
472
473 extern int fprintf (FILE *__restrict __stream,
474 __const char *__restrict __format, ...);
475
476
477
478
479 extern int printf (__const char *__restrict __format, ...);
480
481 extern int sprintf (char *__restrict __s,
482 __const char *__restrict __format, ...) ;
483
484
485
486
487
488 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
489 __gnuc_va_list __arg);
490
491
492
493
494 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
495
496 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
497 __gnuc_va_list __arg) ;
498
499
500
501
502
503 extern int snprintf (char *__restrict __s, size_t __maxlen,
504 __const char *__restrict __format, ...)
505 __attribute__ ((__format__ (__printf__, 3, 4)));
506
507 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
508 __const char *__restrict __format, __gnuc_va_list __arg)
509 __attribute__ ((__format__ (__printf__, 3, 0)));
510
511 # 383 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
512
513
514
515
516
517 extern int fscanf (FILE *__restrict __stream,
518 __const char *__restrict __format, ...);
519
520
521
522
523 extern int scanf (__const char *__restrict __format, ...);
524
525 extern int sscanf (__const char *__restrict __s,
526 __const char *__restrict __format, ...) ;
527
528 # 425 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
529
530
531
532
533
534 extern int fgetc (FILE *__stream);
535 extern int getc (FILE *__stream);
536
537
538
539
540
541 extern int getchar (void);
542
543 # 449 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
544 extern int getc_unlocked (FILE *__stream);
545 extern int getchar_unlocked (void);
546 # 463 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
547 extern int fgetc_unlocked (FILE *__stream);
548
549
550
551
552
553
554
555
556
557
558
559 extern int fputc (int __c, FILE *__stream);
560 extern int putc (int __c, FILE *__stream);
561
562
563
564
565
566 extern int putchar (int __c);
567
568 # 496 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
569 extern int fputc_unlocked (int __c, FILE *__stream);
570
571
572
573
574
575
576
577 extern int putc_unlocked (int __c, FILE *__stream);
578 extern int putchar_unlocked (int __c);
579 # 515 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
580 extern int getw (FILE *__stream);
581
582
583 extern int putw (int __w, FILE *__stream);
584
585
586
587
588
589
590
591
592 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream);
593
594
595
596
597
598
599 extern char *gets (char *__s);
600
601 # 579 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
602
603
604
605
606
607 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
608
609
610
611
612
613 extern int puts (__const char *__s);
614
615
616
617
618
619
620 extern int ungetc (int __c, FILE *__stream);
621
622
623
624
625
626
627 extern size_t fread (void *__restrict __ptr, size_t __size,
628 size_t __n, FILE *__restrict __stream);
629
630
631
632
633 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
634 size_t __n, FILE *__restrict __s);
635
636 # 632 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
637 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
638 size_t __n, FILE *__restrict __stream);
639 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
640 size_t __n, FILE *__restrict __stream);
641
642
643
644
645
646
647
648
649 extern int fseek (FILE *__stream, long int __off, int __whence);
650
651
652
653
654 extern long int ftell (FILE *__stream);
655
656
657
658
659 extern void rewind (FILE *__stream);
660
661 # 676 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
662 extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("_" "fseeko64");
663
664
665 extern __off64_t ftello (FILE *__stream) __asm__ ("_" "ftello64");
666
667
668
669
670
671
672
673
674 # 701 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
675 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("_" "fgetpos64");
676
677 extern int fsetpos (FILE *__stream, __const fpos_t *__pos) __asm__ ("_" "fsetpos64");
678
679
680
681
682
683
684
685 # 719 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
686
687
688 extern void clearerr (FILE *__stream) ;
689
690 extern int feof (FILE *__stream) ;
691
692 extern int ferror (FILE *__stream) ;
693
694
695
696
697 extern void clearerr_unlocked (FILE *__stream) ;
698 extern int feof_unlocked (FILE *__stream) ;
699 extern int ferror_unlocked (FILE *__stream) ;
700
701
702
703
704
705
706
707
708 extern void perror (__const char *__s);
709
710 # 756 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
711 extern int fileno (FILE *__stream) ;
712
713
714
715
716 extern int fileno_unlocked (FILE *__stream) ;
717 # 771 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
718 extern FILE *popen (__const char *__command, __const char *__modes);
719
720
721
722
723
724 extern int pclose (FILE *__stream);
725
726
727
728
729
730 extern char *ctermid (char *__s) ;
731 # 811 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
732 extern void flockfile (FILE *__stream) ;
733
734
735
736 extern int ftrylockfile (FILE *__stream) ;
737
738
739 extern void funlockfile (FILE *__stream) ;
740 # 858 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdio.h" 3 4
741
742
743
744 extern int __snprintf (char *__restrict __s, size_t __maxlen,
745 const char *__restrict __format, ...)
746 __attribute__ ((__format__ (__printf__, 3, 4)));
747 extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
748 const char *__restrict __format, __gnuc_va_list __arg)
749 __attribute__ ((__format__ (__printf__, 3, 0)));
750 # 18 "src/mamecore.h" 2
751 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 1 3 4
752 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
753
754
755
756
757
758 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
759 # 34 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 2 3 4
760
761
762
763
764 extern void *memcpy (void *__restrict __dest,
765 __const void *__restrict __src, size_t __n) ;
766
767
768
769
770
771
772
773 extern void *memmove (void *__dest, __const void *__src, size_t __n)
774 ;
775
776
777
778
779
780
781 extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
782 int __c, size_t __n)
783 ;
784
785
786
787
788
789 extern void *memset (void *__s, int __c, size_t __n) ;
790
791
792
793
794
795
796 extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
797 __attribute__ ((__pure__));
798
799
800 extern void *memchr (__const void *__s, int __c, size_t __n)
801 __attribute__ ((__pure__));
802
803 # 89 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
804
805
806 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
807 ;
808
809 extern char *strncpy (char *__restrict __dest,
810 __const char *__restrict __src, size_t __n) ;
811
812
813 extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
814 ;
815
816 extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
817 size_t __n) ;
818
819
820 extern int strcmp (__const char *__s1, __const char *__s2)
821 __attribute__ ((__pure__));
822
823 extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
824 __attribute__ ((__pure__));
825
826
827 extern int strcoll (__const char *__s1, __const char *__s2)
828 __attribute__ ((__pure__));
829
830 extern size_t strxfrm (char *__restrict __dest,
831 __const char *__restrict __src, size_t __n) ;
832
833 # 143 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
834 extern char *strdup (__const char *__s) __attribute__ ((__malloc__));
835 # 177 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
836
837
838 extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));
839
840 extern char *strrchr (__const char *__s, int __c) __attribute__ ((__pure__));
841
842
843
844
845
846
847
848
849
850
851
852 extern size_t strcspn (__const char *__s, __const char *__reject)
853 __attribute__ ((__pure__));
854
855
856 extern size_t strspn (__const char *__s, __const char *__accept)
857 __attribute__ ((__pure__));
858
859 extern char *strpbrk (__const char *__s, __const char *__accept)
860 __attribute__ ((__pure__));
861
862 extern char *strstr (__const char *__haystack, __const char *__needle)
863 __attribute__ ((__pure__));
864
865
866
867 extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
868 ;
869
870
871
872
873 extern char *__strtok_r (char *__restrict __s,
874 __const char *__restrict __delim,
875 char **__restrict __save_ptr) ;
876
877 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
878 char **__restrict __save_ptr) ;
879 # 245 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
880
881
882 extern size_t strlen (__const char *__s) __attribute__ ((__pure__));
883
884 # 258 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
885
886
887 extern char *strerror (int __errnum) ;
888
889
890
891
892
893
894
895
896 extern char *_glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) ;
897 extern int _susv3_strerror_r (int __errnum, char *__buf, size_t buflen) ;
898 # 282 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
899 extern char *strerror_r (int __errnum, char *__buf, size_t buflen) __asm__ ("_" "_glibc_strerror_r");
900 # 293 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
901 extern void __bzero (void *__s, size_t __n) ;
902
903
904
905 extern void bcopy (__const void *__src, void *__dest, size_t __n) ;
906
907
908 extern void bzero (void *__s, size_t __n) ;
909
910
911 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
912 __attribute__ ((__pure__));
913
914
915 extern char *index (__const char *__s, int __c) __attribute__ ((__pure__));
916
917
918 extern char *rindex (__const char *__s, int __c) __attribute__ ((__pure__));
919
920
921
922 extern int ffs (int __i) __attribute__ ((__const__));
923 # 327 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
924 extern int strcasecmp (__const char *__s1, __const char *__s2)
925 __attribute__ ((__pure__));
926
927
928 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
929 __attribute__ ((__pure__));
930 # 356 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
931 extern char *strsep (char **__restrict __stringp,
932 __const char *__restrict __delim) ;
933 # 390 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/string.h" 3 4
934 extern size_t strlcat(char *__restrict dst, const char *__restrict src,
935 size_t n) ;
936 extern size_t strlcpy(char *__restrict dst, const char *__restrict src,
937 size_t n) ;
938
939
940
941 # 19 "src/mamecore.h" 2
942 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 1 3 4
943 # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
944 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
945 # 36 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4
946
947
948 # 95 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
949
950
951 typedef struct
952 {
953 int quot;
954 int rem;
955 } div_t;
956
957
958
959 typedef struct
960 {
961 long int quot;
962 long int rem;
963 } ldiv_t;
964
965
966
967 # 147 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
968
969
970
971 extern double atof (__const char *__nptr) __attribute__ ((__pure__));
972
973
974 extern int atoi (__const char *__nptr) __attribute__ ((__pure__));
975
976 extern long int atol (__const char *__nptr) __attribute__ ((__pure__));
977
978
979
980
981
982 __extension__ extern long long int atoll (__const char *__nptr)
983 __attribute__ ((__pure__));
984
985
986
987
988
989
990 extern double strtod (__const char *__restrict __nptr,
991 char **__restrict __endptr) ;
992
993 # 185 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
994
995
996 extern long int strtol (__const char *__restrict __nptr,
997 char **__restrict __endptr, int __base) ;
998
999 extern unsigned long int strtoul (__const char *__restrict __nptr,
1000 char **__restrict __endptr, int __base)
1001 ;
1002
1003
1004
1005
1006 __extension__
1007 extern long long int strtoq (__const char *__restrict __nptr,
1008 char **__restrict __endptr, int __base) ;
1009
1010 __extension__
1011 extern unsigned long long int strtouq (__const char *__restrict __nptr,
1012 char **__restrict __endptr, int __base)
1013 ;
1014
1015
1016
1017
1018
1019 __extension__
1020 extern long long int strtoll (__const char *__restrict __nptr,
1021 char **__restrict __endptr, int __base) ;
1022
1023 __extension__
1024 extern unsigned long long int strtoull (__const char *__restrict __nptr,
1025 char **__restrict __endptr, int __base)
1026 ;
1027
1028 # 309 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1029 extern char *l64a (long int __n) ;
1030
1031
1032 extern long int a64l (__const char *__s) __attribute__ ((__pure__));
1033
1034
1035
1036
1037 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 1 3 4
1038 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1039
1040
1041
1042
1043
1044
1045 typedef __u_char u_char;
1046 typedef __u_short u_short;
1047 typedef __u_int u_int;
1048 typedef __u_long u_long;
1049 typedef __quad_t quad_t;
1050 typedef __u_quad_t u_quad_t;
1051 typedef __fsid_t fsid_t;
1052
1053
1054
1055
1056 typedef __loff_t loff_t;
1057
1058
1059
1060
1061
1062 typedef __ino64_t ino_t;
1063 # 61 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1064 typedef __dev_t dev_t;
1065
1066
1067
1068
1069 typedef __gid_t gid_t;
1070
1071
1072
1073
1074 typedef __mode_t mode_t;
1075
1076
1077
1078
1079 typedef __nlink_t nlink_t;
1080
1081
1082
1083
1084 typedef __uid_t uid_t;
1085
1086
1087
1088
1089
1090
1091
1092 typedef __off64_t off_t;
1093 # 99 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1094 typedef __pid_t pid_t;
1095
1096
1097
1098
1099 typedef __id_t id_t;
1100
1101
1102
1103
1104 typedef __ssize_t ssize_t;
1105
1106
1107
1108
1109
1110 typedef __daddr_t daddr_t;
1111 typedef __caddr_t caddr_t;
1112
1113
1114
1115
1116
1117 typedef __key_t key_t;
1118 # 132 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1119 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4
1120 # 74 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1121
1122
1123 typedef __time_t time_t;
1124
1125
1126
1127 # 92 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1128 typedef __clockid_t clockid_t;
1129 # 104 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1130 typedef __timer_t timer_t;
1131 # 133 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1132 # 146 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1133 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
1134 # 147 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1135
1136
1137
1138 typedef unsigned long int ulong;
1139 typedef unsigned short int ushort;
1140 typedef unsigned int uint;
1141 # 190 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1142 typedef int int8_t __attribute__ ((__mode__ (__QI__)));
1143 typedef int int16_t __attribute__ ((__mode__ (__HI__)));
1144 typedef int int32_t __attribute__ ((__mode__ (__SI__)));
1145 typedef int int64_t __attribute__ ((__mode__ (__DI__)));
1146
1147
1148 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
1149 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
1150 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
1151 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
1152
1153 typedef int register_t __attribute__ ((__mode__ (__word__)));
1154 # 212 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1155 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 1 3 4
1156 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 3 4
1157 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/endian.h" 1 3 4
1158 # 38 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/endian.h" 2 3 4
1159 # 213 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1160
1161
1162 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 1 3 4
1163 # 31 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4
1164 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/select.h" 1 3 4
1165 # 32 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1166
1167
1168 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sigset.h" 1 3 4
1169 # 23 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/sigset.h" 3 4
1170 typedef int __sig_atomic_t;
1171
1172
1173
1174
1175 typedef struct
1176 {
1177 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
1178 } __sigset_t;
1179 # 35 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1180
1181
1182
1183 typedef __sigset_t sigset_t;
1184
1185
1186
1187
1188 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4
1189 # 118 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1190 struct timespec
1191 {
1192 __time_t tv_sec;
1193 long int tv_nsec;
1194 };
1195 # 44 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1196
1197 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 1 3 4
1198 # 71 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 3 4
1199 struct timeval
1200 {
1201 __time_t tv_sec;
1202 __suseconds_t tv_usec;
1203 };
1204 # 46 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 2 3 4
1205
1206
1207
1208 typedef long int __fd_mask;
1209
1210
1211
1212
1213
1214
1215
1216 typedef struct
1217 {
1218
1219
1220
1221
1222
1223
1224 __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
1225
1226
1227 } fd_set;
1228
1229
1230
1231
1232
1233
1234 typedef __fd_mask fd_mask;
1235 # 89 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4
1236
1237
1238
1239
1240
1241
1242
1243 extern int select (int __nfds, fd_set *__restrict __readfds,
1244 fd_set *__restrict __writefds,
1245 fd_set *__restrict __exceptfds,
1246 struct timeval *__restrict __timeout) ;
1247 # 112 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/select.h" 3 4
1248
1249 # 216 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1250
1251
1252 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/sysmacros.h" 1 3 4
1253 # 28 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/sysmacros.h" 3 4
1254 __extension__
1255 static __inline unsigned int gnu_dev_major (unsigned long long int __dev)
1256 ;
1257 __extension__
1258 static __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
1259 ;
1260 __extension__
1261 static __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
1262 unsigned int __minor)
1263 ;
1264
1265
1266 __extension__ static __inline unsigned int
1267 gnu_dev_major (unsigned long long int __dev)
1268 {
1269 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
1270 }
1271
1272 __extension__ static __inline unsigned int
1273 gnu_dev_minor (unsigned long long int __dev)
1274 {
1275 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
1276 }
1277
1278 __extension__ static __inline unsigned long long int
1279 gnu_dev_makedev (unsigned int __major, unsigned int __minor)
1280 {
1281 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
1282 | (((unsigned long long int) (__minor & ~0xff)) << 12)
1283 | (((unsigned long long int) (__major & ~0xfff)) << 32));
1284 }
1285 # 219 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 2 3 4
1286 # 243 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1287 typedef __blkcnt64_t blkcnt_t;
1288
1289
1290
1291 typedef __fsblkcnt64_t fsblkcnt_t;
1292
1293
1294
1295 typedef __fsfilcnt64_t fsfilcnt_t;
1296 # 262 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/sys/types.h" 3 4
1297
1298 # 318 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4
1299
1300
1301
1302
1303
1304
1305 extern long int random (void) ;
1306
1307
1308 extern void srandom (unsigned int __seed) ;
1309
1310
1311
1312
1313
1314 extern char *initstate (unsigned int __seed, char *__statebuf,
1315 size_t __statelen) ;
1316
1317
1318
1319 extern char *setstate (char *__statebuf) ;
1320
1321
1322
1323
1324
1325
1326
1327 struct random_data
1328 {
1329 int32_t *fptr;
1330 int32_t *rptr;
1331 int32_t *state;
1332 int rand_type;
1333 int rand_deg;
1334 int rand_sep;
1335 int32_t *end_ptr;
1336 };
1337
1338 extern int random_r (struct random_data *__restrict __buf,
1339 int32_t *__restrict __result) ;
1340
1341 extern int srandom_r (unsigned int __seed, struct random_data *__buf) ;
1342
1343 extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
1344 size_t __statelen,
1345 struct random_data *__restrict __buf) ;
1346
1347 extern int setstate_r (char *__restrict __statebuf,
1348 struct random_data *__restrict __buf) ;
1349
1350
1351
1352
1353
1354
1355 extern int rand (void) ;
1356
1357 extern void srand (unsigned int __seed) ;
1358
1359
1360
1361
1362 extern int rand_r (unsigned int *__seed) ;
1363 # 390 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1364 extern double drand48 (void) ;
1365 extern double erand48 (unsigned short int __xsubi[3]) ;
1366
1367
1368
1369 extern long int lrand48 (void) ;
1370 extern long int nrand48 (unsigned short int __xsubi[3]) ;
1371
1372
1373 extern long int mrand48 (void) ;
1374 extern long int jrand48 (unsigned short int __xsubi[3]) ;
1375
1376
1377 extern void srand48 (long int __seedval) ;
1378 extern unsigned short int *seed48 (unsigned short int __seed16v[3]) ;
1379 extern void lcong48 (unsigned short int __param[7]) ;
1380
1381
1382
1383
1384
1385 struct drand48_data
1386 {
1387 unsigned short int __x[3];
1388 unsigned short int __old_x[3];
1389 unsigned short int __c;
1390 unsigned short int __init;
1391 unsigned long long int __a;
1392 };
1393
1394
1395
1396 extern int drand48_r (struct drand48_data *__restrict __buffer,
1397 double *__restrict __result) ;
1398 extern int erand48_r (unsigned short int __xsubi[3],
1399 struct drand48_data *__restrict __buffer,
1400 double *__restrict __result) ;
1401
1402
1403
1404 extern int lrand48_r (struct drand48_data *__restrict __buffer,
1405 long int *__restrict __result) ;
1406 extern int nrand48_r (unsigned short int __xsubi[3],
1407 struct drand48_data *__restrict __buffer,
1408 long int *__restrict __result) ;
1409
1410
1411 extern int mrand48_r (struct drand48_data *__restrict __buffer,
1412 long int *__restrict __result) ;
1413 extern int jrand48_r (unsigned short int __xsubi[3],
1414 struct drand48_data *__restrict __buffer,
1415 long int *__restrict __result) ;
1416
1417
1418 extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
1419 ;
1420
1421 extern int seed48_r (unsigned short int __seed16v[3],
1422 struct drand48_data *__buffer) ;
1423
1424 extern int lcong48_r (unsigned short int __param[7],
1425 struct drand48_data *__buffer) ;
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435 extern void *malloc (size_t __size) __attribute__ ((__malloc__));
1436
1437 extern void *calloc (size_t __nmemb, size_t __size)
1438 __attribute__ ((__malloc__));
1439
1440
1441
1442
1443
1444
1445
1446 extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__malloc__));
1447
1448 extern void free (void *__ptr) ;
1449
1450
1451
1452
1453 extern void cfree (void *__ptr) ;
1454
1455
1456
1457 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 1 3 4
1458 # 25 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 3 4
1459 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
1460 # 26 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/alloca.h" 2 3 4
1461
1462
1463
1464
1465
1466
1467
1468 extern void *alloca (size_t __size) ;
1469
1470
1471
1472
1473
1474
1475 # 484 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 2 3 4
1476
1477
1478
1479
1480 extern void *valloc (size_t __size) __attribute__ ((__malloc__));
1481 # 497 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1482
1483
1484 extern void abort (void) __attribute__ ((__noreturn__));
1485
1486
1487
1488 extern int atexit (void (*__func) (void)) ;
1489
1490
1491
1492
1493
1494 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
1495 ;
1496
1497
1498
1499
1500
1501
1502 extern void exit (int __status) __attribute__ ((__noreturn__));
1503
1504 # 529 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1505
1506
1507 extern char *getenv (__const char *__name) ;
1508
1509
1510
1511
1512 extern char *__secure_getenv (__const char *__name) ;
1513
1514
1515
1516
1517
1518 extern int putenv (char *__string) ;
1519
1520
1521
1522
1523
1524 extern int setenv (__const char *__name, __const char *__value, int __replace)
1525 ;
1526
1527
1528 extern int unsetenv (__const char *__name) ;
1529 # 568 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1530 extern int clearenv (void) ;
1531 # 577 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1532 extern char *mktemp (char *__template) ;
1533 # 591 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1534 extern int mkstemp (char *__template) __asm__ ("_" "mkstemp64");
1535 # 607 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1536 extern char *mkdtemp (char *__template) ;
1537
1538
1539
1540
1541
1542
1543
1544
1545 extern int system (__const char *__command);
1546
1547 # 627 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1548 extern char *realpath (__const char *__restrict __name,
1549 char *__restrict __resolved) ;
1550
1551
1552
1553
1554
1555
1556 typedef int (*__compar_fn_t) (__const void *, __const void *);
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566 extern void *bsearch (__const void *__key, __const void *__base,
1567 size_t __nmemb, size_t __size, __compar_fn_t __compar);
1568
1569
1570
1571 extern void qsort (void *__base, size_t __nmemb, size_t __size,
1572 __compar_fn_t __compar);
1573
1574
1575
1576 extern int abs (int __x) __attribute__ ((__const__));
1577 extern long int labs (long int __x) __attribute__ ((__const__));
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590 extern div_t div (int __numer, int __denom)
1591 __attribute__ ((__const__));
1592 extern ldiv_t ldiv (long int __numer, long int __denom)
1593 __attribute__ ((__const__));
1594
1595 # 714 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1596 extern int rpmatch (__const char *__response) ;
1597 # 775 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/stdlib.h" 3 4
1598 extern int getloadavg (double __loadavg[], int __nelem) ;
1599
1600
1601
1602
1603
1604
1605 # 20 "src/mamecore.h" 2
1606 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 1 3 4
1607 # 32 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1608
1609 # 41 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1610 enum
1611 {
1612 _ISupper = (1 << (0)),
1613 _ISlower = (1 << (1)),
1614 _ISalpha = (1 << (2)),
1615 _ISdigit = (1 << (3)),
1616 _ISxdigit = (1 << (4)),
1617 _ISspace = (1 << (5)),
1618 _ISprint = (1 << (6)),
1619 _ISgraph = (1 << (7)),
1620 _ISblank = (1 << (8)),
1621 _IScntrl = (1 << (9)),
1622 _ISpunct = (1 << (10)),
1623 _ISalnum = (1 << (11))
1624 };
1625
1626
1627
1628
1629 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_touplow.h" 1 3 4
1630 # 37 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_touplow.h" 3 4
1631 typedef __uint16_t __ctype_mask_t;
1632
1633
1634
1635 typedef __int16_t __ctype_touplow_t;
1636 # 61 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 2 3 4
1637 # 103 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1638 extern const __ctype_mask_t *__C_ctype_b;
1639 extern const __ctype_touplow_t *__C_ctype_toupper;
1640 extern const __ctype_touplow_t *__C_ctype_tolower;
1641 # 123 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1642 extern const __ctype_mask_t *__ctype_b;
1643 extern const __ctype_touplow_t *__ctype_toupper;
1644 extern const __ctype_touplow_t *__ctype_tolower;
1645 # 143 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1646 extern int isxlower(int c) ;
1647 extern int isxupper(int c) ;
1648 # 155 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1649
1650
1651
1652
1653
1654
1655 extern int isalnum (int) ;
1656 extern int isalpha (int) ;
1657 extern int iscntrl (int) ;
1658 extern int isdigit (int) ;
1659 extern int islower (int) ;
1660 extern int isgraph (int) ;
1661 extern int isprint (int) ;
1662 extern int ispunct (int) ;
1663 extern int isspace (int) ;
1664 extern int isupper (int) ;
1665 extern int isxdigit (int) ;
1666
1667
1668
1669 extern int tolower (int __c) ;
1670
1671
1672 extern int toupper (int __c) ;
1673
1674
1675 # 201 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1676 extern int isascii (int __c) ;
1677
1678
1679
1680 extern int toascii (int __c) ;
1681
1682
1683
1684 extern int _toupper (int) ;
1685 extern int _tolower (int) ;
1686 # 382 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/ctype.h" 3 4
1687
1688 # 21 "src/mamecore.h" 2
1689 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/assert.h" 1 3 4
1690 # 36 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/assert.h" 3 4
1691
1692 extern void __assert (const char *, const char *, int, const char *) ;
1693
1694 # 22 "src/mamecore.h" 2
1695 # 1 "src/unix/osd_cpu.h" 1
1696 # 27 "src/unix/osd_cpu.h"
1697 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 1 3 4
1698 # 30 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1699
1700
1701
1702
1703
1704
1705
1706
1707 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
1708 # 39 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 2 3 4
1709
1710
1711
1712 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 1 3 4
1713 # 38 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 3 4
1714 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/uClibc_clk_tck.h" 1 3 4
1715 # 39 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/bits/time.h" 2 3 4
1716 # 43 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 2 3 4
1717 # 58 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1718
1719
1720 typedef __clock_t clock_t;
1721
1722
1723
1724 # 129 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1725
1726
1727 struct tm
1728 {
1729 int tm_sec;
1730 int tm_min;
1731 int tm_hour;
1732 int tm_mday;
1733 int tm_mon;
1734 int tm_year;
1735 int tm_wday;
1736 int tm_yday;
1737 int tm_isdst;
1738
1739
1740
1741 long int tm_gmtoff;
1742 __const char *tm_zone;
1743
1744
1745
1746
1747
1748 };
1749
1750
1751
1752
1753
1754
1755
1756
1757 struct itimerspec
1758 {
1759 struct timespec it_interval;
1760 struct timespec it_value;
1761 };
1762
1763
1764 struct sigevent;
1765 # 180 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1766
1767
1768
1769 extern clock_t clock (void) ;
1770
1771
1772 extern time_t time (time_t *__timer) ;
1773
1774
1775
1776 extern double difftime (time_t __time1, time_t __time0)
1777 __attribute__ ((__const__));
1778
1779
1780
1781 extern time_t mktime (struct tm *__tp) ;
1782
1783
1784
1785
1786
1787 extern size_t strftime (char *__restrict __s, size_t __maxsize,
1788 __const char *__restrict __format,
1789 __const struct tm *__restrict __tp) ;
1790
1791 # 243 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1792
1793
1794
1795 extern struct tm *gmtime (__const time_t *__timer) ;
1796
1797
1798
1799 extern struct tm *localtime (__const time_t *__timer) ;
1800
1801
1802
1803
1804
1805 extern struct tm *gmtime_r (__const time_t *__restrict __timer,
1806 struct tm *__restrict __tp) ;
1807
1808
1809
1810 extern struct tm *localtime_r (__const time_t *__restrict __timer,
1811 struct tm *__restrict __tp) ;
1812
1813
1814
1815
1816
1817 extern char *asctime (__const struct tm *__tp) ;
1818
1819
1820 extern char *ctime (__const time_t *__timer) ;
1821
1822
1823
1824
1825
1826
1827
1828 extern char *asctime_r (__const struct tm *__restrict __tp,
1829 char *__restrict __buf) ;
1830
1831
1832 extern char *ctime_r (__const time_t *__restrict __timer,
1833 char *__restrict __buf) ;
1834 # 299 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1835 extern char *tzname[2];
1836
1837
1838
1839 extern void tzset (void) ;
1840
1841
1842
1843 extern int daylight;
1844 extern long int timezone;
1845
1846
1847
1848
1849
1850 extern int stime (__const time_t *__when) ;
1851 # 329 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1852 extern time_t timegm (struct tm *__tp) ;
1853
1854
1855 extern time_t timelocal (struct tm *__tp) ;
1856
1857
1858 extern int dysize (int __year) __attribute__ ((__const__));
1859 # 344 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1860 extern int nanosleep (__const struct timespec *__requested_time,
1861 struct timespec *__remaining);
1862
1863
1864
1865 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) ;
1866 # 438 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/bfin-uclinux/runtime/usr/include/time.h" 3 4
1867
1868 # 28 "src/unix/osd_cpu.h" 2
1869 # 44 "src/unix/osd_cpu.h"
1870 typedef signed char INT8;
1871 typedef signed short INT16;
1872 typedef signed int INT32;
1873
1874
1875
1876
1877
1878
1879
1880 typedef signed long long INT64;
1881
1882
1883 typedef unsigned char UINT8;
1884 typedef unsigned short UINT16;
1885 typedef unsigned int UINT32;
1886 typedef unsigned long long UINT64;
1887 # 23 "src/mamecore.h" 2
1888 # 37 "src/mamecore.h"
1889 typedef UINT32 FPTR;
1890
1891
1892
1893
1894 typedef void genf(void);
1895
1896
1897
1898
1899
1900 typedef struct _mame_display mame_display;
1901 typedef struct _game_driver game_driver;
1902 typedef struct _machine_config machine_config;
1903 typedef struct _rom_load_data rom_load_data;
1904 typedef struct _xml_data_node xml_data_node;
1905 typedef struct _performance_info performance_info;
1906 typedef struct _osd_file osd_file;
1907
1908
1909
1910 typedef UINT32 pen_t;
1911
1912
1913
1914 struct _mame_bitmap
1915 {
1916 int width,height;
1917 int depth;
1918 void **line;
1919
1920
1921 void *base;
1922 int rowpixels;
1923 int rowbytes;
1924
1925
1926 void (*plot)(struct _mame_bitmap *bitmap,int x,int y,pen_t pen);
1927 pen_t (*read)(struct _mame_bitmap *bitmap,int x,int y);
1928 void (*plot_box)(struct _mame_bitmap *bitmap,int x,int y,int width,int height,pen_t pen);
1929 };
1930 typedef struct _mame_bitmap mame_bitmap;
1931
1932
1933
1934 struct _rectangle
1935 {
1936 int min_x,max_x;
1937 int min_y,max_y;
1938 };
1939 typedef struct _rectangle rectangle;
1940 # 98 "src/mamecore.h"
1941 typedef union
1942 {
1943
1944 struct { UINT8 l,h,h2,h3; } b;
1945 struct { UINT16 l,h; } w;
1946
1947
1948
1949
1950 UINT32 d;
1951 } PAIR;
1952 # 118 "src/mamecore.h"
1953 typedef union
1954 {
1955
1956 struct { UINT8 l,h,h2,h3,h4,h5,h6,h7; } b;
1957 struct { UINT16 l,h,h2,h3; } w;
1958 struct { UINT32 l,h; } d;
1959
1960
1961
1962
1963
1964 UINT64 lw;
1965 } PAIR64;
1966 # 334 "src/mamecore.h"
1967 static __inline__ int mame_stricmp(const char *s1, const char *s2)
1968 {
1969 for (;;)
1970 {
1971 int c1 = (__extension__ ({ int __res; if (sizeof (*s1++) > 1) { if (__builtin_constant_p (*s1++)) { int __c = (*s1++); __res = (((unsigned int)((__c) + 128)) < 384) ? ((__ctype_tolower))[__c] : __c; } else __res = tolower (*s1++); } else __res = ((__ctype_tolower))[(int) (*s1++)]; __res; }));
1972 int c2 = (__extension__ ({ int __res; if (sizeof (*s2++) > 1) { if (__builtin_constant_p (*s2++)) { int __c = (*s2++); __res = (((unsigned int)((__c) + 128)) < 384) ? ((__ctype_tolower))[__c] : __c; } else __res = tolower (*s2++); } else __res = ((__ctype_tolower))[(int) (*s2++)]; __res; }));
1973 if (c1 == 0 || c1 != c2)
1974 return c1 - c2;
1975 }
1976 }
1977 # 352 "src/mamecore.h"
1978 static __inline__ void sect_rect(rectangle *dst, const rectangle *src)
1979 {
1980 if (src->min_x > dst->min_x) dst->min_x = src->min_x;
1981 if (src->max_x < dst->max_x) dst->max_x = src->max_x;
1982 if (src->min_y > dst->min_y) dst->min_y = src->min_y;
1983 if (src->max_y < dst->max_y) dst->max_y = src->max_y;
1984 }
1985
1986
1987
1988 static __inline__ float u2f(UINT32 v)
1989 {
1990 union {
1991 float ff;
1992 UINT32 vv;
1993 } u;
1994 u.vv = v;
1995 return u.ff;
1996 }
1997
1998
1999
2000 static __inline__ UINT32 f2u(float f)
2001 {
2002 union {
2003 float ff;
2004 UINT32 vv;
2005 } u;
2006 u.ff = f;
2007 return u.vv;
2008 }
2009
2010
2011
2012 static __inline__ float u2d(UINT64 v)
2013 {
2014 union {
2015 double dd;
2016 UINT64 vv;
2017 } u;
2018 u.vv = v;
2019 return u.dd;
2020 }
2021
2022
2023
2024 static __inline__ UINT64 d2u(double d)
2025 {
2026 union {
2027 double dd;
2028 UINT64 vv;
2029 } u;
2030 u.dd = d;
2031 return u.vv;
2032 }
2033 # 422 "src/mamecore.h"
2034 static __inline__ UINT32 count_leading_zeros(UINT32 val)
2035 {
2036 UINT32 count;
2037 for (count = 0; (INT32)val >= 0; count++) val <<= 1;
2038 return count;
2039 }
2040
2041
2042
2043
2044
2045 static __inline__ UINT32 count_leading_ones(UINT32 val)
2046 {
2047 UINT32 count;
2048 for (count = 0; (INT32)val < 0; count++) val <<= 1;
2049 return count;
2050 }
2051
2052
2053
2054
2055
2056 static __inline__ INT32 fixed_mul_shift(INT32 val1, INT32 val2, UINT8 shift)
2057 {
2058 return (INT32)(((INT64)val1 * (INT64)val2) >> shift);
2059 }
2060 # 458 "src/mamecore.h"
2061 static __inline__ int bcd_adjust(int value)
2062 {
2063 if ((value & 0xf) >= 0xa)
2064 value = value + 0x10 - 0xa;
2065 if ((value & 0xf0) >= 0xa0)
2066 value = value - 0xa0 + 0x100;
2067 return value;
2068 }
2069
2070
2071 static __inline__ int dec_2_bcd(int a)
2072 {
2073 return (a % 10) | ((a / 10) << 4);
2074 }
2075
2076
2077 static __inline__ int bcd_2_dec(int a)
2078 {
2079 return (a & 0xf) + (a >> 4) * 10;
2080 }
2081 # 487 "src/mamecore.h"
2082 static __inline__ int gregorian_is_leap_year(int year)
2083 {
2084 return !(year % 100 ? year % 4 : year % 400);
2085 }
2086
2087
2088
2089 static __inline__ int gregorian_days_in_month(int month, int year)
2090 {
2091 if (month == 2)
2092 return gregorian_is_leap_year(year) ? 29 : 28;
2093 else if (month == 4 || month == 6 || month == 9 || month == 11)
2094 return 30;
2095 else
2096 return 31;
2097 }
2098 # 63 "src/driver.h" 2
2099 # 1 "src/osdepend.h" 1
2100 # 12 "src/osdepend.h"
2101
2102
2103
2104
2105
2106
2107 # 1 "src/inptport.h" 1
2108 # 12 "src/inptport.h"
2109
2110
2111
2112
2113
2114 # 1 "src/memory.h" 1
2115 # 12 "src/memory.h"
2116
2117
2118
2119
2120
2121
2122 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 1 3 4
2123 # 151 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4
2124 typedef long int ptrdiff_t;
2125 # 325 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stddef.h" 3 4
2126 typedef int wchar_t;
2127 # 19 "src/memory.h" 2
2128 # 54 "src/memory.h"
2129 typedef UINT32 offs_t;
2130
2131
2132 typedef UINT8 (*read8_handler) (__attribute__((__unused__)) offs_t offset);
2133 typedef void (*write8_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
2134 typedef UINT16 (*read16_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
2135 typedef void (*write16_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
2136 typedef UINT32 (*read32_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
2137 typedef void (*write32_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask);
2138 typedef UINT64 (*read64_handler) (__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask);
2139 typedef void (*write64_handler)(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask);
2140 typedef offs_t (*opbase_handler) (__attribute__((__unused__)) offs_t address);
2141
2142
2143 struct _data_accessors
2144 {
2145 UINT8 (*read_byte)(offs_t offset);
2146 UINT16 (*read_word)(offs_t offset);
2147 UINT32 (*read_dword)(offs_t offset);
2148 UINT64 (*read_qword)(offs_t offset);
2149
2150 void (*write_byte)(offs_t offset, UINT8 data);
2151 void (*write_word)(offs_t offset, UINT16 data);
2152 void (*write_dword)(offs_t offset, UINT32 data);
2153 void (*write_qword)(offs_t offset, UINT64 data);
2154 };
2155 typedef struct _data_accessors data_accessors;
2156 # 554 "src/memory.h"
2157 typedef struct _handler_data handler_data;
2158
2159
2160 union _read_handlers
2161 {
2162 genf * handler;
2163 read8_handler handler8;
2164 read16_handler handler16;
2165 read32_handler handler32;
2166 read64_handler handler64;
2167 };
2168 typedef union _read_handlers read_handlers;
2169
2170
2171 union _write_handlers
2172 {
2173 genf * handler;
2174 write8_handler handler8;
2175 write16_handler handler16;
2176 write32_handler handler32;
2177 write64_handler handler64;
2178 };
2179 typedef union _write_handlers write_handlers;
2180
2181
2182 struct _address_map
2183 {
2184 UINT32 flags;
2185 offs_t start, end;
2186 offs_t mirror;
2187 offs_t mask;
2188 read_handlers read;
2189 const char * read_name;
2190 write_handlers write;
2191 const char * write_name;
2192 void * memory;
2193 UINT32 share;
2194 void ** base;
2195 size_t * size;
2196 UINT32 region;
2197 offs_t region_offs;
2198 };
2199 typedef struct _address_map address_map;
2200
2201
2202 struct _address_space
2203 {
2204 offs_t addrmask;
2205 UINT8 * readlookup;
2206 UINT8 * writelookup;
2207 handler_data * readhandlers;
2208 handler_data * writehandlers;
2209 data_accessors * accessors;
2210 };
2211 typedef struct _address_space address_space;
2212 # 619 "src/memory.h"
2213 typedef address_map *(*construct_map_t)(address_map *map);
2214 # 771 "src/memory.h"
2215 UINT8 program_read_byte_8(offs_t address);
2216 void program_write_byte_8(offs_t address, UINT8 data);
2217
2218 UINT8 program_read_byte_16be(offs_t address);
2219 UINT16 program_read_word_16be(offs_t address);
2220 void program_write_byte_16be(offs_t address, UINT8 data);
2221 void program_write_word_16be(offs_t address, UINT16 data);
2222
2223 UINT8 program_read_byte_16le(offs_t address);
2224 UINT16 program_read_word_16le(offs_t address);
2225 void program_write_byte_16le(offs_t address, UINT8 data);
2226 void program_write_word_16le(offs_t address, UINT16 data);
2227
2228 UINT8 program_read_byte_32be(offs_t address);
2229 UINT16 program_read_word_32be(offs_t address);
2230 UINT32 program_read_dword_32be(offs_t address);
2231 void program_write_byte_32be(offs_t address, UINT8 data);
2232 void program_write_word_32be(offs_t address, UINT16 data);
2233 void program_write_dword_32be(offs_t address, UINT32 data);
2234
2235 UINT8 program_read_byte_32le(offs_t address);
2236 UINT16 program_read_word_32le(offs_t address);
2237 UINT32 program_read_dword_32le(offs_t address);
2238 void program_write_byte_32le(offs_t address, UINT8 data);
2239 void program_write_word_32le(offs_t address, UINT16 data);
2240 void program_write_dword_32le(offs_t address, UINT32 data);
2241
2242 UINT8 program_read_byte_64be(offs_t address);
2243 UINT16 program_read_word_64be(offs_t address);
2244 UINT32 program_read_dword_64be(offs_t address);
2245 UINT64 program_read_qword_64be(offs_t address);
2246 void program_write_byte_64be(offs_t address, UINT8 data);
2247 void program_write_word_64be(offs_t address, UINT16 data);
2248 void program_write_dword_64be(offs_t address, UINT32 data);
2249 void program_write_qword_64be(offs_t address, UINT64 data);
2250
2251 UINT8 program_read_byte_64le(offs_t address);
2252 UINT16 program_read_word_64le(offs_t address);
2253 UINT32 program_read_dword_64le(offs_t address);
2254 UINT64 program_read_qword_64le(offs_t address);
2255 void program_write_byte_64le(offs_t address, UINT8 data);
2256 void program_write_word_64le(offs_t address, UINT16 data);
2257 void program_write_dword_64le(offs_t address, UINT32 data);
2258 void program_write_qword_64le(offs_t address, UINT64 data);
2259
2260
2261 UINT8 data_read_byte_8(offs_t address);
2262 void data_write_byte_8(offs_t address, UINT8 data);
2263
2264 UINT8 data_read_byte_16be(offs_t address);
2265 UINT16 data_read_word_16be(offs_t address);
2266 void data_write_byte_16be(offs_t address, UINT8 data);
2267 void data_write_word_16be(offs_t address, UINT16 data);
2268
2269 UINT8 data_read_byte_16le(offs_t address);
2270 UINT16 data_read_word_16le(offs_t address);
2271 void data_write_byte_16le(offs_t address, UINT8 data);
2272 void data_write_word_16le(offs_t address, UINT16 data);
2273
2274 UINT8 data_read_byte_32be(offs_t address);
2275 UINT16 data_read_word_32be(offs_t address);
2276 UINT32 data_read_dword_32be(offs_t address);
2277 void data_write_byte_32be(offs_t address, UINT8 data);
2278 void data_write_word_32be(offs_t address, UINT16 data);
2279 void data_write_dword_32be(offs_t address, UINT32 data);
2280
2281 UINT8 data_read_byte_32le(offs_t address);
2282 UINT16 data_read_word_32le(offs_t address);
2283 UINT32 data_read_dword_32le(offs_t address);
2284 void data_write_byte_32le(offs_t address, UINT8 data);
2285 void data_write_word_32le(offs_t address, UINT16 data);
2286 void data_write_dword_32le(offs_t address, UINT32 data);
2287
2288 UINT8 data_read_byte_64be(offs_t address);
2289 UINT16 data_read_word_64be(offs_t address);
2290 UINT32 data_read_dword_64be(offs_t address);
2291 UINT64 data_read_qword_64be(offs_t address);
2292 void data_write_byte_64be(offs_t address, UINT8 data);
2293 void data_write_word_64be(offs_t address, UINT16 data);
2294 void data_write_dword_64be(offs_t address, UINT32 data);
2295 void data_write_qword_64be(offs_t address, UINT64 data);
2296
2297 UINT8 data_read_byte_64le(offs_t address);
2298 UINT16 data_read_word_64le(offs_t address);
2299 UINT32 data_read_dword_64le(offs_t address);
2300 UINT64 data_read_qword_64le(offs_t address);
2301 void data_write_byte_64le(offs_t address, UINT8 data);
2302 void data_write_word_64le(offs_t address, UINT16 data);
2303 void data_write_dword_64le(offs_t address, UINT32 data);
2304 void data_write_qword_64le(offs_t address, UINT64 data);
2305
2306
2307 UINT8 io_read_byte_8(offs_t address);
2308 void io_write_byte_8(offs_t address, UINT8 data);
2309
2310 UINT8 io_read_byte_16be(offs_t address);
2311 UINT16 io_read_word_16be(offs_t address);
2312 void io_write_byte_16be(offs_t address, UINT8 data);
2313 void io_write_word_16be(offs_t address, UINT16 data);
2314
2315 UINT8 io_read_byte_16le(offs_t address);
2316 UINT16 io_read_word_16le(offs_t address);
2317 void io_write_byte_16le(offs_t address, UINT8 data);
2318 void io_write_word_16le(offs_t address, UINT16 data);
2319
2320 UINT8 io_read_byte_32be(offs_t address);
2321 UINT16 io_read_word_32be(offs_t address);
2322 UINT32 io_read_dword_32be(offs_t address);
2323 void io_write_byte_32be(offs_t address, UINT8 data);
2324 void io_write_word_32be(offs_t address, UINT16 data);
2325 void io_write_dword_32be(offs_t address, UINT32 data);
2326
2327 UINT8 io_read_byte_32le(offs_t address);
2328 UINT16 io_read_word_32le(offs_t address);
2329 UINT32 io_read_dword_32le(offs_t address);
2330 void io_write_byte_32le(offs_t address, UINT8 data);
2331 void io_write_word_32le(offs_t address, UINT16 data);
2332 void io_write_dword_32le(offs_t address, UINT32 data);
2333
2334 UINT8 io_read_byte_64be(offs_t address);
2335 UINT16 io_read_word_64be(offs_t address);
2336 UINT32 io_read_dword_64be(offs_t address);
2337 UINT64 io_read_qword_64be(offs_t address);
2338 void io_write_byte_64be(offs_t address, UINT8 data);
2339 void io_write_word_64be(offs_t address, UINT16 data);
2340 void io_write_dword_64be(offs_t address, UINT32 data);
2341 void io_write_qword_64be(offs_t address, UINT64 data);
2342
2343 UINT8 io_read_byte_64le(offs_t address);
2344 UINT16 io_read_word_64le(offs_t address);
2345 UINT32 io_read_dword_64le(offs_t address);
2346 UINT64 io_read_qword_64le(offs_t address);
2347 void io_write_byte_64le(offs_t address, UINT8 data);
2348 void io_write_word_64le(offs_t address, UINT16 data);
2349 void io_write_dword_64le(offs_t address, UINT32 data);
2350 void io_write_qword_64le(offs_t address, UINT64 data);
2351 # 917 "src/memory.h"
2352 int memory_init(void);
2353 void memory_exit(void);
2354 void memory_set_context(int activecpu);
2355
2356
2357 const address_map *memory_get_map(int cpunum, int spacenum);
2358
2359
2360 opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function);
2361 void memory_set_opbase(offs_t offset);
2362
2363
2364 void memory_set_decrypted_region(int cpunum, offs_t start, offs_t end, void *base);
2365
2366
2367 void * memory_get_read_ptr(int cpunum, int spacenum, offs_t offset);
2368 void * memory_get_write_ptr(int cpunum, int spacenum, offs_t offset);
2369 void * memory_get_op_ptr(int cpunum, offs_t offset, int arg);
2370
2371
2372 void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride);
2373 void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride);
2374 void memory_set_bank(int banknum, int entrynum);
2375 void memory_set_bankptr(int banknum, void *base);
2376
2377
2378 void memory_set_debugger_access(int debugger);
2379
2380
2381 void * _memory_install_read_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, int handler, const char *handler_name);
2382 UINT8 * _memory_install_read8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name);
2383 UINT16 * _memory_install_read16_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name);
2384 UINT32 * _memory_install_read32_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name);
2385 UINT64 * _memory_install_read64_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name);
2386 void * _memory_install_write_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, int handler, const char *handler_name);
2387 UINT8 * _memory_install_write8_handler (int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name);
2388 UINT16 * _memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name);
2389 UINT32 * _memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name);
2390 UINT64 * _memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name);
2391
2392 void * _memory_install_read_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, int handler, const char *handler_name);
2393 UINT8 * _memory_install_read8_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name);
2394 UINT16 * _memory_install_read16_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name);
2395 UINT32 * _memory_install_read32_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name);
2396 UINT64 * _memory_install_read64_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name);
2397 void * _memory_install_write_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, int handler, const char *handler_name);
2398 UINT8 * _memory_install_write8_matchmask_handler (int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name);
2399 UINT16 * _memory_install_write16_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name);
2400 UINT32 * _memory_install_write32_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name);
2401 UINT64 * _memory_install_write64_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name);
2402
2403
2404 void memory_dump(FILE *file);
2405 const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset);
2406 # 980 "src/memory.h"
2407 extern UINT8 opcode_entry;
2408 extern UINT8 * opcode_base;
2409 extern UINT8 * opcode_arg_base;
2410 extern offs_t opcode_mask;
2411 extern offs_t opcode_memory_min;
2412 extern offs_t opcode_memory_max;
2413 extern address_space active_address_space[];
2414 extern address_map * construct_map_0(address_map *map);
2415 # 1069 "src/memory.h"
2416 static __inline__ UINT8 program_read_byte (offs_t offset) { return (*active_address_space[0].accessors->read_byte)(offset); }
2417 static __inline__ UINT16 program_read_word (offs_t offset) { return (*active_address_space[0].accessors->read_word)(offset); }
2418 static __inline__ UINT32 program_read_dword(offs_t offset) { return (*active_address_space[0].accessors->read_dword)(offset); }
2419 static __inline__ UINT64 program_read_qword(offs_t offset) { return (*active_address_space[0].accessors->read_qword)(offset); }
2420
2421 static __inline__ void program_write_byte (offs_t offset, UINT8 data) { (*active_address_space[0].accessors->write_byte)(offset, data); }
2422 static __inline__ void program_write_word (offs_t offset, UINT16 data) { (*active_address_space[0].accessors->write_word)(offset, data); }
2423 static __inline__ void program_write_dword(offs_t offset, UINT32 data) { (*active_address_space[0].accessors->write_dword)(offset, data); }
2424 static __inline__ void program_write_qword(offs_t offset, UINT64 data) { (*active_address_space[0].accessors->write_qword)(offset, data); }
2425
2426 static __inline__ UINT8 data_read_byte (offs_t offset) { return (*active_address_space[1].accessors->read_byte)(offset); }
2427 static __inline__ UINT16 data_read_word (offs_t offset) { return (*active_address_space[1].accessors->read_word)(offset); }
2428 static __inline__ UINT32 data_read_dword(offs_t offset) { return (*active_address_space[1].accessors->read_dword)(offset); }
2429 static __inline__ UINT64 data_read_qword(offs_t offset) { return (*active_address_space[1].accessors->read_qword)(offset); }
2430
2431 static __inline__ void data_write_byte (offs_t offset, UINT8 data) { (*active_address_space[1].accessors->write_byte)(offset, data); }
2432 static __inline__ void data_write_word (offs_t offset, UINT16 data) { (*active_address_space[1].accessors->write_word)(offset, data); }
2433 static __inline__ void data_write_dword(offs_t offset, UINT32 data) { (*active_address_space[1].accessors->write_dword)(offset, data); }
2434 static __inline__ void data_write_qword(offs_t offset, UINT64 data) { (*active_address_space[1].accessors->write_qword)(offset, data); }
2435
2436 static __inline__ UINT8 io_read_byte (offs_t offset) { return (*active_address_space[2].accessors->read_byte)(offset); }
2437 static __inline__ UINT16 io_read_word (offs_t offset) { return (*active_address_space[2].accessors->read_word)(offset); }
2438 static __inline__ UINT32 io_read_dword(offs_t offset) { return (*active_address_space[2].accessors->read_dword)(offset); }
2439 static __inline__ UINT64 io_read_qword(offs_t offset) { return (*active_address_space[2].accessors->read_qword)(offset); }
2440
2441 static __inline__ void io_write_byte (offs_t offset, UINT8 data) { (*active_address_space[2].accessors->write_byte)(offset, data); }
2442 static __inline__ void io_write_word (offs_t offset, UINT16 data) { (*active_address_space[2].accessors->write_word)(offset, data); }
2443 static __inline__ void io_write_dword(offs_t offset, UINT32 data) { (*active_address_space[2].accessors->write_dword)(offset, data); }
2444 static __inline__ void io_write_qword(offs_t offset, UINT64 data) { (*active_address_space[2].accessors->write_qword)(offset, data); }
2445
2446
2447 UINT8 cpu_readop_safe(offs_t offset);
2448 UINT16 cpu_readop16_safe(offs_t offset);
2449 UINT32 cpu_readop32_safe(offs_t offset);
2450 UINT64 cpu_readop64_safe(offs_t offset);
2451 UINT8 cpu_readop_arg_safe(offs_t offset);
2452 UINT16 cpu_readop_arg16_safe(offs_t offset);
2453 UINT32 cpu_readop_arg32_safe(offs_t offset);
2454 UINT64 cpu_readop_arg64_safe(offs_t offset);
2455 # 1121 "src/memory.h"
2456 static __inline__ void * cpu_opptr(offs_t A) { if ((0)) { memory_set_opbase(A); } return ((void *)&opcode_base[(A) & opcode_mask]); }
2457 static __inline__ UINT8 cpu_readop(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_base[(A) & opcode_mask]); }
2458 static __inline__ UINT16 cpu_readop16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_base[(A) & opcode_mask]); }
2459 static __inline__ UINT32 cpu_readop32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_base[(A) & opcode_mask]); }
2460 static __inline__ UINT64 cpu_readop64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_base[(A) & opcode_mask]); }
2461 static __inline__ UINT8 cpu_readop_arg(offs_t A) { if ((0)) { memory_set_opbase(A); } return (opcode_arg_base[(A) & opcode_mask]); }
2462 static __inline__ UINT16 cpu_readop_arg16(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT16 *)&opcode_arg_base[(A) & opcode_mask]); }
2463 static __inline__ UINT32 cpu_readop_arg32(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT32 *)&opcode_arg_base[(A) & opcode_mask]); }
2464 static __inline__ UINT64 cpu_readop_arg64(offs_t A) { if ((0)) { memory_set_opbase(A); } return (*(UINT64 *)&opcode_arg_base[(A) & opcode_mask]); }
2465 # 18 "src/inptport.h" 2
2466 # 1 "src/input.h" 1
2467 # 12 "src/input.h"
2468
2469 # 35 "src/input.h"
2470 enum
2471 {
2472 ANALOG_TYPE_NONE = 0,
2473 ANALOG_TYPE_ABSOLUTE = 1,
2474 ANALOG_TYPE_RELATIVE = 2
2475 };
2476
2477 enum
2478 {
2479
2480 KEYCODE_A,
2481 KEYCODE_B,
2482 KEYCODE_C,
2483 KEYCODE_D,
2484 KEYCODE_E,
2485 KEYCODE_F,
2486 KEYCODE_G,
2487 KEYCODE_H,
2488 KEYCODE_I,
2489 KEYCODE_J,
2490 KEYCODE_K,
2491 KEYCODE_L,
2492 KEYCODE_M,
2493 KEYCODE_N,
2494 KEYCODE_O,
2495 KEYCODE_P,
2496 KEYCODE_Q,
2497 KEYCODE_R,
2498 KEYCODE_S,
2499 KEYCODE_T,
2500 KEYCODE_U,
2501 KEYCODE_V,
2502 KEYCODE_W,
2503 KEYCODE_X,
2504 KEYCODE_Y,
2505 KEYCODE_Z,
2506 KEYCODE_0,
2507 KEYCODE_1,
2508 KEYCODE_2,
2509 KEYCODE_3,
2510 KEYCODE_4,
2511 KEYCODE_5,
2512 KEYCODE_6,
2513 KEYCODE_7,
2514 KEYCODE_8,
2515 KEYCODE_9,
2516 KEYCODE_F1,
2517 KEYCODE_F2,
2518 KEYCODE_F3,
2519 KEYCODE_F4,
2520 KEYCODE_F5,
2521 KEYCODE_F6,
2522 KEYCODE_F7,
2523 KEYCODE_F8,
2524 KEYCODE_F9,
2525 KEYCODE_F10,
2526 KEYCODE_F11,
2527 KEYCODE_F12,
2528 KEYCODE_F13,
2529 KEYCODE_F14,
2530 KEYCODE_F15,
2531 KEYCODE_ESC,
2532 KEYCODE_TILDE,
2533 KEYCODE_MINUS,
2534 KEYCODE_EQUALS,
2535 KEYCODE_BACKSPACE,
2536 KEYCODE_TAB,
2537 KEYCODE_OPENBRACE,
2538 KEYCODE_CLOSEBRACE,
2539 KEYCODE_ENTER,
2540 KEYCODE_COLON,
2541 KEYCODE_QUOTE,
2542 KEYCODE_BACKSLASH,
2543 KEYCODE_BACKSLASH2,
2544 KEYCODE_COMMA,
2545 KEYCODE_STOP,
2546 KEYCODE_SLASH,
2547 KEYCODE_SPACE,
2548 KEYCODE_INSERT,
2549 KEYCODE_DEL,
2550 KEYCODE_HOME,
2551 KEYCODE_END,
2552 KEYCODE_PGUP,
2553 KEYCODE_PGDN,
2554 KEYCODE_LEFT,
2555 KEYCODE_RIGHT,
2556 KEYCODE_UP,
2557 KEYCODE_DOWN,
2558 KEYCODE_0_PAD,
2559 KEYCODE_1_PAD,
2560 KEYCODE_2_PAD,
2561 KEYCODE_3_PAD,
2562 KEYCODE_4_PAD,
2563 KEYCODE_5_PAD,
2564 KEYCODE_6_PAD,
2565 KEYCODE_7_PAD,
2566 KEYCODE_8_PAD,
2567 KEYCODE_9_PAD,
2568 KEYCODE_SLASH_PAD,
2569 KEYCODE_ASTERISK,
2570 KEYCODE_MINUS_PAD,
2571 KEYCODE_PLUS_PAD,
2572 KEYCODE_DEL_PAD,
2573 KEYCODE_ENTER_PAD,
2574 KEYCODE_PRTSCR,
2575 KEYCODE_PAUSE,
2576 KEYCODE_LSHIFT,
2577 KEYCODE_RSHIFT,
2578 KEYCODE_LCONTROL,
2579 KEYCODE_RCONTROL,
2580 KEYCODE_LALT,
2581 KEYCODE_RALT,
2582 KEYCODE_SCRLOCK,
2583 KEYCODE_NUMLOCK,
2584 KEYCODE_CAPSLOCK,
2585 KEYCODE_LWIN,
2586 KEYCODE_RWIN,
2587 KEYCODE_MENU,
2588
2589
2590 JOYCODE_1_LEFT,
2591 JOYCODE_1_RIGHT,
2592 JOYCODE_1_UP,
2593 JOYCODE_1_DOWN,
2594 JOYCODE_1_BUTTON1,
2595 JOYCODE_1_BUTTON2,
2596 JOYCODE_1_BUTTON3,
2597 JOYCODE_1_BUTTON4,
2598 JOYCODE_1_BUTTON5,
2599 JOYCODE_1_BUTTON6,
2600 JOYCODE_1_BUTTON7,
2601 JOYCODE_1_BUTTON8,
2602 JOYCODE_1_BUTTON9,
2603 JOYCODE_1_BUTTON10,
2604 JOYCODE_1_BUTTON11,
2605 JOYCODE_1_BUTTON12,
2606 JOYCODE_1_BUTTON13,
2607 JOYCODE_1_BUTTON14,
2608 JOYCODE_1_BUTTON15,
2609 JOYCODE_1_BUTTON16,
2610 JOYCODE_1_START,
2611 JOYCODE_1_SELECT,
2612 JOYCODE_2_LEFT,
2613 JOYCODE_2_RIGHT,
2614 JOYCODE_2_UP,
2615 JOYCODE_2_DOWN,
2616 JOYCODE_2_BUTTON1,
2617 JOYCODE_2_BUTTON2,
2618 JOYCODE_2_BUTTON3,
2619 JOYCODE_2_BUTTON4,
2620 JOYCODE_2_BUTTON5,
2621 JOYCODE_2_BUTTON6,
2622 JOYCODE_2_BUTTON7,
2623 JOYCODE_2_BUTTON8,
2624 JOYCODE_2_BUTTON9,
2625 JOYCODE_2_BUTTON10,
2626 JOYCODE_2_BUTTON11,
2627 JOYCODE_2_BUTTON12,
2628 JOYCODE_2_BUTTON13,
2629 JOYCODE_2_BUTTON14,
2630 JOYCODE_2_BUTTON15,
2631 JOYCODE_2_BUTTON16,
2632 JOYCODE_2_START,
2633 JOYCODE_2_SELECT,
2634 JOYCODE_3_LEFT,
2635 JOYCODE_3_RIGHT,
2636 JOYCODE_3_UP,
2637 JOYCODE_3_DOWN,
2638 JOYCODE_3_BUTTON1,
2639 JOYCODE_3_BUTTON2,
2640 JOYCODE_3_BUTTON3,
2641 JOYCODE_3_BUTTON4,
2642 JOYCODE_3_BUTTON5,
2643 JOYCODE_3_BUTTON6,
2644 JOYCODE_3_BUTTON7,
2645 JOYCODE_3_BUTTON8,
2646 JOYCODE_3_BUTTON9,
2647 JOYCODE_3_BUTTON10,
2648 JOYCODE_3_BUTTON11,
2649 JOYCODE_3_BUTTON12,
2650 JOYCODE_3_BUTTON13,
2651 JOYCODE_3_BUTTON14,
2652 JOYCODE_3_BUTTON15,
2653 JOYCODE_3_BUTTON16,
2654 JOYCODE_3_START,
2655 JOYCODE_3_SELECT,
2656 JOYCODE_4_LEFT,
2657 JOYCODE_4_RIGHT,
2658 JOYCODE_4_UP,
2659 JOYCODE_4_DOWN,
2660 JOYCODE_4_BUTTON1,
2661 JOYCODE_4_BUTTON2,
2662 JOYCODE_4_BUTTON3,
2663 JOYCODE_4_BUTTON4,
2664 JOYCODE_4_BUTTON5,
2665 JOYCODE_4_BUTTON6,
2666 JOYCODE_4_BUTTON7,
2667 JOYCODE_4_BUTTON8,
2668 JOYCODE_4_BUTTON9,
2669 JOYCODE_4_BUTTON10,
2670 JOYCODE_4_BUTTON11,
2671 JOYCODE_4_BUTTON12,
2672 JOYCODE_4_BUTTON13,
2673 JOYCODE_4_BUTTON14,
2674 JOYCODE_4_BUTTON15,
2675 JOYCODE_4_BUTTON16,
2676 JOYCODE_4_START,
2677 JOYCODE_4_SELECT,
2678 JOYCODE_5_LEFT,
2679 JOYCODE_5_RIGHT,
2680 JOYCODE_5_UP,
2681 JOYCODE_5_DOWN,
2682 JOYCODE_5_BUTTON1,
2683 JOYCODE_5_BUTTON2,
2684 JOYCODE_5_BUTTON3,
2685 JOYCODE_5_BUTTON4,
2686 JOYCODE_5_BUTTON5,
2687 JOYCODE_5_BUTTON6,
2688 JOYCODE_5_BUTTON7,
2689 JOYCODE_5_BUTTON8,
2690 JOYCODE_5_BUTTON9,
2691 JOYCODE_5_BUTTON10,
2692 JOYCODE_5_BUTTON11,
2693 JOYCODE_5_BUTTON12,
2694 JOYCODE_5_BUTTON13,
2695 JOYCODE_5_BUTTON14,
2696 JOYCODE_5_BUTTON15,
2697 JOYCODE_5_BUTTON16,
2698 JOYCODE_5_START,
2699 JOYCODE_5_SELECT,
2700 JOYCODE_6_LEFT,
2701 JOYCODE_6_RIGHT,
2702 JOYCODE_6_UP,
2703 JOYCODE_6_DOWN,
2704 JOYCODE_6_BUTTON1,
2705 JOYCODE_6_BUTTON2,
2706 JOYCODE_6_BUTTON3,
2707 JOYCODE_6_BUTTON4,
2708 JOYCODE_6_BUTTON5,
2709 JOYCODE_6_BUTTON6,
2710 JOYCODE_6_BUTTON7,
2711 JOYCODE_6_BUTTON8,
2712 JOYCODE_6_BUTTON9,
2713 JOYCODE_6_BUTTON10,
2714 JOYCODE_6_BUTTON11,
2715 JOYCODE_6_BUTTON12,
2716 JOYCODE_6_BUTTON13,
2717 JOYCODE_6_BUTTON14,
2718 JOYCODE_6_BUTTON15,
2719 JOYCODE_6_BUTTON16,
2720 JOYCODE_6_START,
2721 JOYCODE_6_SELECT,
2722 JOYCODE_7_LEFT,
2723 JOYCODE_7_RIGHT,
2724 JOYCODE_7_UP,
2725 JOYCODE_7_DOWN,
2726 JOYCODE_7_BUTTON1,
2727 JOYCODE_7_BUTTON2,
2728 JOYCODE_7_BUTTON3,
2729 JOYCODE_7_BUTTON4,
2730 JOYCODE_7_BUTTON5,
2731 JOYCODE_7_BUTTON6,
2732 JOYCODE_7_BUTTON7,
2733 JOYCODE_7_BUTTON8,
2734 JOYCODE_7_BUTTON9,
2735 JOYCODE_7_BUTTON10,
2736 JOYCODE_7_BUTTON11,
2737 JOYCODE_7_BUTTON12,
2738 JOYCODE_7_BUTTON13,
2739 JOYCODE_7_BUTTON14,
2740 JOYCODE_7_BUTTON15,
2741 JOYCODE_7_BUTTON16,
2742 JOYCODE_7_START,
2743 JOYCODE_7_SELECT,
2744 JOYCODE_8_LEFT,
2745 JOYCODE_8_RIGHT,
2746 JOYCODE_8_UP,
2747 JOYCODE_8_DOWN,
2748 JOYCODE_8_BUTTON1,
2749 JOYCODE_8_BUTTON2,
2750 JOYCODE_8_BUTTON3,
2751 JOYCODE_8_BUTTON4,
2752 JOYCODE_8_BUTTON5,
2753 JOYCODE_8_BUTTON6,
2754 JOYCODE_8_BUTTON7,
2755 JOYCODE_8_BUTTON8,
2756 JOYCODE_8_BUTTON9,
2757 JOYCODE_8_BUTTON10,
2758 JOYCODE_8_BUTTON11,
2759 JOYCODE_8_BUTTON12,
2760 JOYCODE_8_BUTTON13,
2761 JOYCODE_8_BUTTON14,
2762 JOYCODE_8_BUTTON15,
2763 JOYCODE_8_BUTTON16,
2764 JOYCODE_8_START,
2765 JOYCODE_8_SELECT,
2766
2767
2768 MOUSECODE_1_BUTTON1,
2769 MOUSECODE_1_BUTTON2,
2770 MOUSECODE_1_BUTTON3,
2771 MOUSECODE_1_BUTTON4,
2772 MOUSECODE_1_BUTTON5,
2773 MOUSECODE_1_BUTTON6,
2774 MOUSECODE_2_BUTTON1,
2775 MOUSECODE_2_BUTTON2,
2776 MOUSECODE_2_BUTTON3,
2777 MOUSECODE_2_BUTTON4,
2778 MOUSECODE_2_BUTTON5,
2779 MOUSECODE_2_BUTTON6,
2780 MOUSECODE_3_BUTTON1,
2781 MOUSECODE_3_BUTTON2,
2782 MOUSECODE_3_BUTTON3,
2783 MOUSECODE_3_BUTTON4,
2784 MOUSECODE_3_BUTTON5,
2785 MOUSECODE_3_BUTTON6,
2786 MOUSECODE_4_BUTTON1,
2787 MOUSECODE_4_BUTTON2,
2788 MOUSECODE_4_BUTTON3,
2789 MOUSECODE_4_BUTTON4,
2790 MOUSECODE_4_BUTTON5,
2791 MOUSECODE_4_BUTTON6,
2792 MOUSECODE_5_BUTTON1,
2793 MOUSECODE_5_BUTTON2,
2794 MOUSECODE_5_BUTTON3,
2795 MOUSECODE_5_BUTTON4,
2796 MOUSECODE_5_BUTTON5,
2797 MOUSECODE_5_BUTTON6,
2798 MOUSECODE_6_BUTTON1,
2799 MOUSECODE_6_BUTTON2,
2800 MOUSECODE_6_BUTTON3,
2801 MOUSECODE_6_BUTTON4,
2802 MOUSECODE_6_BUTTON5,
2803 MOUSECODE_6_BUTTON6,
2804 MOUSECODE_7_BUTTON1,
2805 MOUSECODE_7_BUTTON2,
2806 MOUSECODE_7_BUTTON3,
2807 MOUSECODE_7_BUTTON4,
2808 MOUSECODE_7_BUTTON5,
2809 MOUSECODE_7_BUTTON6,
2810 MOUSECODE_8_BUTTON1,
2811 MOUSECODE_8_BUTTON2,
2812 MOUSECODE_8_BUTTON3,
2813 MOUSECODE_8_BUTTON4,
2814 MOUSECODE_8_BUTTON5,
2815 MOUSECODE_8_BUTTON6,
2816
2817
2818
2819 JOYCODE_1_ANALOG_X,
2820 JOYCODE_1_ANALOG_Y,
2821 JOYCODE_1_ANALOG_Z,
2822 JOYCODE_1_ANALOG_PEDAL1,
2823 JOYCODE_1_ANALOG_PEDAL2,
2824 JOYCODE_1_ANALOG_PEDAL3,
2825 JOYCODE_2_ANALOG_X,
2826 JOYCODE_2_ANALOG_Y,
2827 JOYCODE_2_ANALOG_Z,
2828 JOYCODE_2_ANALOG_PEDAL1,
2829 JOYCODE_2_ANALOG_PEDAL2,
2830 JOYCODE_2_ANALOG_PEDAL3,
2831 JOYCODE_3_ANALOG_X,
2832 JOYCODE_3_ANALOG_Y,
2833 JOYCODE_3_ANALOG_Z,
2834 JOYCODE_3_ANALOG_PEDAL1,
2835 JOYCODE_3_ANALOG_PEDAL2,
2836 JOYCODE_3_ANALOG_PEDAL3,
2837 JOYCODE_4_ANALOG_X,
2838 JOYCODE_4_ANALOG_Y,
2839 JOYCODE_4_ANALOG_Z,
2840 JOYCODE_4_ANALOG_PEDAL1,
2841 JOYCODE_4_ANALOG_PEDAL2,
2842 JOYCODE_4_ANALOG_PEDAL3,
2843 JOYCODE_5_ANALOG_X,
2844 JOYCODE_5_ANALOG_Y,
2845 JOYCODE_5_ANALOG_Z,
2846 JOYCODE_5_ANALOG_PEDAL1,
2847 JOYCODE_5_ANALOG_PEDAL2,
2848 JOYCODE_5_ANALOG_PEDAL3,
2849 JOYCODE_6_ANALOG_X,
2850 JOYCODE_6_ANALOG_Y,
2851 JOYCODE_6_ANALOG_Z,
2852 JOYCODE_6_ANALOG_PEDAL1,
2853 JOYCODE_6_ANALOG_PEDAL2,
2854 JOYCODE_6_ANALOG_PEDAL3,
2855 JOYCODE_7_ANALOG_X,
2856 JOYCODE_7_ANALOG_Y,
2857 JOYCODE_7_ANALOG_Z,
2858 JOYCODE_7_ANALOG_PEDAL1,
2859 JOYCODE_7_ANALOG_PEDAL2,
2860 JOYCODE_7_ANALOG_PEDAL3,
2861 JOYCODE_8_ANALOG_X,
2862 JOYCODE_8_ANALOG_Y,
2863 JOYCODE_8_ANALOG_Z,
2864 JOYCODE_8_ANALOG_PEDAL1,
2865 JOYCODE_8_ANALOG_PEDAL2,
2866 JOYCODE_8_ANALOG_PEDAL3,
2867 GUNCODE_1_ANALOG_X,
2868 GUNCODE_1_ANALOG_Y,
2869 GUNCODE_2_ANALOG_X,
2870 GUNCODE_2_ANALOG_Y,
2871 GUNCODE_3_ANALOG_X,
2872 GUNCODE_3_ANALOG_Y,
2873 GUNCODE_4_ANALOG_X,
2874 GUNCODE_4_ANALOG_Y,
2875 GUNCODE_5_ANALOG_X,
2876 GUNCODE_5_ANALOG_Y,
2877 GUNCODE_6_ANALOG_X,
2878 GUNCODE_6_ANALOG_Y,
2879 GUNCODE_7_ANALOG_X,
2880 GUNCODE_7_ANALOG_Y,
2881 GUNCODE_8_ANALOG_X,
2882 GUNCODE_8_ANALOG_Y,
2883
2884
2885 MOUSECODE_1_ANALOG_X,
2886 MOUSECODE_1_ANALOG_Y,
2887 MOUSECODE_1_ANALOG_Z,
2888 MOUSECODE_2_ANALOG_X,
2889 MOUSECODE_2_ANALOG_Y,
2890 MOUSECODE_2_ANALOG_Z,
2891 MOUSECODE_3_ANALOG_X,
2892 MOUSECODE_3_ANALOG_Y,
2893 MOUSECODE_3_ANALOG_Z,
2894 MOUSECODE_4_ANALOG_X,
2895 MOUSECODE_4_ANALOG_Y,
2896 MOUSECODE_4_ANALOG_Z,
2897 MOUSECODE_5_ANALOG_X,
2898 MOUSECODE_5_ANALOG_Y,
2899 MOUSECODE_5_ANALOG_Z,
2900 MOUSECODE_6_ANALOG_X,
2901 MOUSECODE_6_ANALOG_Y,
2902 MOUSECODE_6_ANALOG_Z,
2903 MOUSECODE_7_ANALOG_X,
2904 MOUSECODE_7_ANALOG_Y,
2905 MOUSECODE_7_ANALOG_Z,
2906 MOUSECODE_8_ANALOG_X,
2907 MOUSECODE_8_ANALOG_Y,
2908 MOUSECODE_8_ANALOG_Z,
2909
2910
2911 __code_max,
2912
2913
2914 CODE_NONE = 0x8000,
2915 CODE_OTHER_DIGITAL,
2916 CODE_OTHER_ANALOG_ABSOLUTE,
2917 CODE_OTHER_ANALOG_RELATIVE,
2918 CODE_DEFAULT,
2919 CODE_NOT,
2920 CODE_OR
2921 };
2922 # 496 "src/input.h"
2923 typedef UINT32 input_code;
2924 typedef UINT32 os_code;
2925
2926
2927 struct _input_seq
2928 {
2929 input_code code[16];
2930 };
2931 typedef struct _input_seq input_seq;
2932
2933
2934 struct _os_code_info
2935 {
2936 char * name;
2937 os_code oscode;
2938 input_code inputcode;
2939 };
2940 typedef struct _os_code_info os_code_info;
2941 # 541 "src/input.h"
2942 int code_init(void);
2943 void code_exit(void);
2944
2945 INT32 code_analog_value(input_code code);
2946 int code_pressed(input_code code);
2947 int code_pressed_memory(input_code code);
2948 int code_pressed_memory_repeat(input_code code, int speed);
2949 input_code code_read_async(void);
2950
2951 int code_analog_type(input_code code);
2952 const char *code_name(input_code code);
2953 input_code token_to_code(const char *token);
2954 void code_to_token(input_code code, char *token);
2955
2956
2957 void seq_set_0(input_seq *seq);
2958 void seq_set_1(input_seq *seq, input_code code);
2959 void seq_set_2(input_seq *seq, input_code code1, input_code code2);
2960 void seq_set_3(input_seq *seq, input_code code1, input_code code2, input_code code3);
2961 void seq_set_4(input_seq *seq, input_code code1, input_code code2, input_code code3, input_code code4);
2962 void seq_set_5(input_seq *seq, input_code code1, input_code code2, input_code code3, input_code code4, input_code code5);
2963 void seq_copy(input_seq *seqdst, const input_seq *seqsrc);
2964 int seq_cmp(const input_seq *seqa, const input_seq *seqb);
2965 void seq_name(const input_seq *seq, char *buffer, unsigned max);
2966 int seq_pressed(const input_seq *seq);
2967 INT32 seq_analog_value(const input_seq *seq, int *analogtype);
2968 void seq_read_async_start(int analog);
2969 int seq_read_async(input_seq *seq, int first);
2970 int string_to_seq(const char *string, input_seq *seq);
2971 void seq_to_string(const input_seq *seq, char *string, int maxlen);
2972
2973 static __inline__ input_code seq_get_1(const input_seq *seq) { return seq->code[0]; }
2974 # 19 "src/inptport.h" 2
2975 # 41 "src/inptport.h"
2976 enum
2977 {
2978 SEQ_TYPE_STANDARD = 0,
2979 SEQ_TYPE_INCREMENT = 1,
2980 SEQ_TYPE_DECREMENT = 2
2981 };
2982
2983
2984
2985 enum
2986 {
2987 PORTCOND_ALWAYS = 0,
2988 PORTCOND_EQUALS,
2989 PORTCOND_NOTEQUALS
2990 };
2991
2992
2993
2994 enum
2995 {
2996 IPG_UI = 0,
2997 IPG_PLAYER1,
2998 IPG_PLAYER2,
2999 IPG_PLAYER3,
3000 IPG_PLAYER4,
3001 IPG_PLAYER5,
3002 IPG_PLAYER6,
3003 IPG_PLAYER7,
3004 IPG_PLAYER8,
3005 IPG_OTHER,
3006 IPG_TOTAL_GROUPS,
3007 IPG_INVALID
3008 };
3009
3010
3011
3012 enum
3013 {
3014
3015 IPT_INVALID = 0,
3016 IPT_UNUSED,
3017 IPT_END,
3018 IPT_UNKNOWN,
3019 IPT_PORT,
3020 IPT_DIPSWITCH_NAME,
3021 IPT_DIPSWITCH_SETTING,
3022 IPT_VBLANK,
3023 IPT_KEYBOARD,
3024 IPT_CONFIG_NAME,
3025 IPT_CONFIG_SETTING,
3026 IPT_START,
3027 IPT_SELECT,
3028 IPT_CATEGORY_NAME,
3029 IPT_CATEGORY_SETTING,
3030
3031
3032
3033 IPT_JOYSTICK_UP,
3034 IPT_JOYSTICK_DOWN,
3035 IPT_JOYSTICK_LEFT,
3036 IPT_JOYSTICK_RIGHT,
3037
3038
3039 IPT_JOYSTICKRIGHT_UP,
3040 IPT_JOYSTICKRIGHT_DOWN,
3041 IPT_JOYSTICKRIGHT_LEFT,
3042 IPT_JOYSTICKRIGHT_RIGHT,
3043 IPT_JOYSTICKLEFT_UP,
3044 IPT_JOYSTICKLEFT_DOWN,
3045 IPT_JOYSTICKLEFT_LEFT,
3046 IPT_JOYSTICKLEFT_RIGHT,
3047
3048
3049
3050 IPT_BUTTON1,
3051 IPT_BUTTON2,
3052 IPT_BUTTON3,
3053 IPT_BUTTON4,
3054 IPT_BUTTON5,
3055 IPT_BUTTON6,
3056 IPT_BUTTON7,
3057 IPT_BUTTON8,
3058 IPT_BUTTON9,
3059 IPT_BUTTON10,
3060
3061
3062 IPT_START1,
3063 IPT_START2,
3064 IPT_START3,
3065 IPT_START4,
3066 IPT_START5,
3067 IPT_START6,
3068 IPT_START7,
3069 IPT_START8,
3070
3071
3072 IPT_COIN1,
3073 IPT_COIN2,
3074 IPT_COIN3,
3075 IPT_COIN4,
3076 IPT_COIN5,
3077 IPT_COIN6,
3078 IPT_COIN7,
3079 IPT_COIN8,
3080 IPT_BILL1,
3081
3082
3083 IPT_SERVICE1,
3084 IPT_SERVICE2,
3085 IPT_SERVICE3,
3086 IPT_SERVICE4,
3087
3088
3089 IPT_SERVICE,
3090 IPT_TILT,
3091 IPT_INTERLOCK,
3092 IPT_VOLUME_UP,
3093 IPT_VOLUME_DOWN,
3094
3095
3096 IPT_MAHJONG_A,
3097 IPT_MAHJONG_B,
3098 IPT_MAHJONG_C,
3099 IPT_MAHJONG_D,
3100 IPT_MAHJONG_E,
3101 IPT_MAHJONG_F,
3102 IPT_MAHJONG_G,
3103 IPT_MAHJONG_H,
3104 IPT_MAHJONG_I,
3105 IPT_MAHJONG_J,
3106 IPT_MAHJONG_K,
3107 IPT_MAHJONG_L,
3108 IPT_MAHJONG_M,
3109 IPT_MAHJONG_N,
3110 IPT_MAHJONG_O,
3111 IPT_MAHJONG_P,
3112 IPT_MAHJONG_Q,
3113 IPT_MAHJONG_KAN,
3114 IPT_MAHJONG_PON,
3115 IPT_MAHJONG_CHI,
3116 IPT_MAHJONG_REACH,
3117 IPT_MAHJONG_RON,
3118 IPT_MAHJONG_BET,
3119 IPT_MAHJONG_LAST_CHANCE,
3120 IPT_MAHJONG_SCORE,
3121 IPT_MAHJONG_DOUBLE_UP,
3122 IPT_MAHJONG_FLIP_FLOP,
3123 IPT_MAHJONG_BIG,
3124 IPT_MAHJONG_SMALL,
3125
3126
3127
3128 IPT_PADDLE,
3129 IPT_PADDLE_V,
3130 IPT_AD_STICK_X,
3131 IPT_AD_STICK_Y,
3132 IPT_AD_STICK_Z,
3133 IPT_LIGHTGUN_X,
3134 IPT_LIGHTGUN_Y,
3135 IPT_PEDAL,
3136 IPT_PEDAL2,
3137 IPT_PEDAL3,
3138 IPT_DIAL,
3139 IPT_DIAL_V,
3140 IPT_TRACKBALL_X,
3141 IPT_TRACKBALL_Y,
3142 IPT_MOUSE_X,
3143 IPT_MOUSE_Y,
3144
3145
3146
3147 IPT_ADJUSTER,
3148
3149
3150 IPT_UI_CONFIGURE,
3151 IPT_UI_ON_SCREEN_DISPLAY,
3152 IPT_UI_DEBUG_BREAK,
3153 IPT_UI_PAUSE,
3154 IPT_UI_RESET_MACHINE,
3155 IPT_UI_SHOW_GFX,
3156 IPT_UI_FRAMESKIP_DEC,
3157 IPT_UI_FRAMESKIP_INC,
3158 IPT_UI_THROTTLE,
3159 IPT_UI_SHOW_FPS,
3160 IPT_UI_SNAPSHOT,
3161 IPT_UI_RECORD_MOVIE,
3162 IPT_UI_TOGGLE_CHEAT,
3163 IPT_UI_UP,
3164 IPT_UI_DOWN,
3165 IPT_UI_LEFT,
3166 IPT_UI_RIGHT,
3167 IPT_UI_HOME,
3168 IPT_UI_END,
3169 IPT_UI_SELECT,
3170 IPT_UI_CANCEL,
3171 IPT_UI_CLEAR,
3172 IPT_UI_PAN_UP,
3173 IPT_UI_PAN_DOWN,
3174 IPT_UI_PAN_LEFT,
3175 IPT_UI_PAN_RIGHT,
3176 IPT_UI_SHOW_PROFILER,
3177 IPT_UI_TOGGLE_UI,
3178 IPT_UI_TOGGLE_DEBUG,
3179 IPT_UI_SAVE_STATE,
3180 IPT_UI_LOAD_STATE,
3181 IPT_UI_ADD_CHEAT,
3182 IPT_UI_DELETE_CHEAT,
3183 IPT_UI_SAVE_CHEAT,
3184 IPT_UI_WATCH_VALUE,
3185 IPT_UI_EDIT_CHEAT,
3186 IPT_UI_TOGGLE_CROSSHAIR,
3187
3188
3189 IPT_OSD_1,
3190 IPT_OSD_2,
3191 IPT_OSD_3,
3192 IPT_OSD_4,
3193 IPT_OSD_5,
3194 IPT_OSD_6,
3195 IPT_OSD_7,
3196 IPT_OSD_8,
3197 IPT_OSD_9,
3198 IPT_OSD_10,
3199 IPT_OSD_11,
3200 IPT_OSD_12,
3201 IPT_OSD_13,
3202 IPT_OSD_14,
3203 IPT_OSD_15,
3204 IPT_OSD_16,
3205
3206
3207 IPT_OTHER,
3208
3209
3210 IPT_SPECIAL,
3211
3212 __ipt_max
3213 };
3214
3215
3216
3217 enum
3218 {
3219 STR_Off = 0,
3220 STR_On,
3221 STR_No,
3222 STR_Yes,
3223 STR_Lives,
3224 STR_Bonus_Life,
3225 STR_Difficulty,
3226 STR_Demo_Sounds,
3227 STR_Coinage,
3228 STR_Coin_A,
3229 STR_Coin_B,
3230 STR_9C_1C,
3231 STR_8C_1C,
3232 STR_7C_1C,
3233 STR_6C_1C,
3234 STR_5C_1C,
3235 STR_4C_1C,
3236 STR_3C_1C,
3237 STR_8C_3C,
3238 STR_4C_2C,
3239 STR_2C_1C,
3240 STR_5C_3C,
3241 STR_3C_2C,
3242 STR_4C_3C,
3243 STR_4C_4C,
3244 STR_3C_3C,
3245 STR_2C_2C,
3246 STR_1C_1C,
3247 STR_4C_5C,
3248 STR_3C_4C,
3249 STR_2C_3C,
3250 STR_4C_7C,
3251 STR_2C_4C,
3252 STR_1C_2C,
3253 STR_2C_5C,
3254 STR_2C_6C,
3255 STR_1C_3C,
3256 STR_2C_7C,
3257 STR_2C_8C,
3258 STR_1C_4C,
3259 STR_1C_5C,
3260 STR_1C_6C,
3261 STR_1C_7C,
3262 STR_1C_8C,
3263 STR_1C_9C,
3264 STR_Free_Play,
3265 STR_Cabinet,
3266 STR_Upright,
3267 STR_Cocktail,
3268 STR_Flip_Screen,
3269 STR_Service_Mode,
3270 STR_Pause,
3271 STR_Test,
3272 STR_Tilt,
3273 STR_Version,
3274 STR_Region,
3275 STR_International,
3276 STR_Japan,
3277 STR_USA,
3278 STR_Europe,
3279 STR_Asia,
3280 STR_World,
3281 STR_Hispanic,
3282 STR_Language,
3283 STR_English,
3284 STR_Japanese,
3285 STR_German,
3286 STR_French,
3287 STR_Italian,
3288 STR_Spanish,
3289 STR_Very_Easy,
3290 STR_Easiest,
3291 STR_Easier,
3292 STR_Easy,
3293 STR_Normal,
3294 STR_Medium,
3295 STR_Hard,
3296 STR_Harder,
3297 STR_Hardest,
3298 STR_Very_Hard,
3299 STR_Very_Low,
3300 STR_Low,
3301 STR_High,
3302 STR_Higher,
3303 STR_Highest,
3304 STR_Very_High,
3305 STR_Players,
3306 STR_Controls,
3307 STR_Dual,
3308 STR_Single,
3309 STR_Game_Time,
3310 STR_Continue_Price,
3311 STR_Controller,
3312 STR_Light_Gun,
3313 STR_Joystick,
3314 STR_Trackball,
3315 STR_Continues,
3316 STR_Allow_Continue,
3317 STR_Level_Select,
3318 STR_Infinite,
3319 STR_Stereo,
3320 STR_Mono,
3321 STR_Unused,
3322 STR_Unknown,
3323 STR_Standard,
3324 STR_Reverse,
3325 STR_Alternate,
3326 STR_None,
3327 STR_TOTAL
3328 };
3329 # 404 "src/inptport.h"
3330 typedef struct _input_port_init_params input_port_init_params;
3331
3332
3333 struct _input_port_default_entry
3334 {
3335 UINT32 type;
3336 UINT8 group;
3337 UINT8 player;
3338 const char *token;
3339 const char *name;
3340 input_seq defaultseq;
3341 input_seq defaultincseq;
3342 input_seq defaultdecseq;
3343 };
3344 typedef struct _input_port_default_entry input_port_default_entry;
3345
3346
3347 struct _input_port_entry
3348 {
3349 UINT32 mask;
3350 UINT32 default_value;
3351
3352 UINT32 type;
3353 UINT8 unused;
3354
3355
3356
3357 UINT8 cocktail;
3358 UINT8 player;
3359
3360 UINT8 toggle;
3361
3362
3363 UINT8 impulse;
3364
3365
3366
3367
3368
3369
3370 UINT8 four_way;
3371
3372
3373
3374
3375 const char *name;
3376 input_seq seq;
3377 UINT16 category;
3378
3379
3380 struct
3381 {
3382 INT32 min;
3383 INT32 max;
3384 INT32 sensitivity;
3385 INT32 delta;
3386 INT32 centerdelta;
3387 UINT8 reverse;
3388 UINT8 reset;
3389 input_seq incseq;
3390 input_seq decseq;
3391 } analog;
3392
3393
3394 struct
3395 {
3396 const char *tag;
3397 } start;
3398
3399
3400 struct
3401 {
3402 const char *tag;
3403 UINT8 portnum;
3404 UINT8 condition;
3405 UINT32 mask;
3406 UINT32 value;
3407 } condition;
3408 # 490 "src/inptport.h"
3409 };
3410 typedef struct _input_port_entry input_port_entry;
3411 # 656 "src/inptport.h"
3412 extern const char *input_port_default_strings[];
3413 # 668 "src/inptport.h"
3414 int input_port_init(void (*construct_ipt)(input_port_init_params *));
3415
3416 void input_port_load(int config_type, xml_data_node *parentnode);
3417 void input_port_save(int config_type, xml_data_node *parentnode);
3418
3419 input_port_entry *input_port_initialize(input_port_init_params *params, UINT32 type, const char *tag, UINT32 mask);
3420 input_port_entry *input_port_allocate(void (*construct_ipt)(input_port_init_params *), input_port_entry *memory);
3421
3422 input_port_default_entry *get_input_port_list(void);
3423 const input_port_default_entry *get_input_port_list_defaults(void);
3424
3425 int input_port_active(const input_port_entry *in);
3426 int port_type_is_analog(int type);
3427 int port_type_in_use(int type);
3428 int port_type_to_group(int type, int player);
3429 int port_tag_to_index(const char *tag);
3430 read8_handler port_tag_to_handler8(const char *tag);
3431 read16_handler port_tag_to_handler16(const char *tag);
3432 read32_handler port_tag_to_handler32(const char *tag);
3433 const char *input_port_name(const input_port_entry *in);
3434 input_seq *input_port_seq(input_port_entry *in, int seqtype);
3435 input_seq *input_port_default_seq(int type, int player, int seqtype);
3436 int input_port_condition(const input_port_entry *in);
3437
3438 const char *port_type_to_token(int type, int player);
3439 int token_to_port_type(const char *string, int *player);
3440
3441 int input_port_type_pressed(int type, int player);
3442 int input_ui_pressed(int code);
3443 int input_ui_pressed_repeat(int code, int speed);
3444
3445 void input_port_update_defaults(void);
3446 void input_port_vblank_start(void);
3447 void input_port_vblank_end(void);
3448
3449 void input_port_set_digital_value(int port, UINT32 value, UINT32 mask);
3450
3451 UINT32 readinputport(int port);
3452 UINT32 readinputportbytag(const char *tag);
3453 UINT32 readinputportbytag_safe(const char *tag, UINT32 defvalue);
3454
3455 UINT8 input_port_0_r(__attribute__((__unused__)) offs_t offset);
3456 UINT8 input_port_1_r(__attribute__((__unused__)) offs_t offset);
3457 UINT8 input_port_2_r(__attribute__((__unused__)) offs_t offset);
3458 UINT8 input_port_3_r(__attribute__((__unused__)) offs_t offset);
3459 UINT8 input_port_4_r(__attribute__((__unused__)) offs_t offset);
3460 UINT8 input_port_5_r(__attribute__((__unused__)) offs_t offset);
3461 UINT8 input_port_6_r(__attribute__((__unused__)) offs_t offset);
3462 UINT8 input_port_7_r(__attribute__((__unused__)) offs_t offset);
3463 UINT8 input_port_8_r(__attribute__((__unused__)) offs_t offset);
3464 UINT8 input_port_9_r(__attribute__((__unused__)) offs_t offset);
3465 UINT8 input_port_10_r(__attribute__((__unused__)) offs_t offset);
3466 UINT8 input_port_11_r(__attribute__((__unused__)) offs_t offset);
3467 UINT8 input_port_12_r(__attribute__((__unused__)) offs_t offset);
3468 UINT8 input_port_13_r(__attribute__((__unused__)) offs_t offset);
3469 UINT8 input_port_14_r(__attribute__((__unused__)) offs_t offset);
3470 UINT8 input_port_15_r(__attribute__((__unused__)) offs_t offset);
3471 UINT8 input_port_16_r(__attribute__((__unused__)) offs_t offset);
3472 UINT8 input_port_17_r(__attribute__((__unused__)) offs_t offset);
3473 UINT8 input_port_18_r(__attribute__((__unused__)) offs_t offset);
3474 UINT8 input_port_19_r(__attribute__((__unused__)) offs_t offset);
3475 UINT8 input_port_20_r(__attribute__((__unused__)) offs_t offset);
3476 UINT8 input_port_21_r(__attribute__((__unused__)) offs_t offset);
3477 UINT8 input_port_22_r(__attribute__((__unused__)) offs_t offset);
3478 UINT8 input_port_23_r(__attribute__((__unused__)) offs_t offset);
3479 UINT8 input_port_24_r(__attribute__((__unused__)) offs_t offset);
3480 UINT8 input_port_25_r(__attribute__((__unused__)) offs_t offset);
3481 UINT8 input_port_26_r(__attribute__((__unused__)) offs_t offset);
3482 UINT8 input_port_27_r(__attribute__((__unused__)) offs_t offset);
3483 UINT8 input_port_28_r(__attribute__((__unused__)) offs_t offset);
3484 UINT8 input_port_29_r(__attribute__((__unused__)) offs_t offset);
3485
3486 UINT16 input_port_0_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3487 UINT16 input_port_1_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3488 UINT16 input_port_2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3489 UINT16 input_port_3_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3490 UINT16 input_port_4_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3491 UINT16 input_port_5_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3492 UINT16 input_port_6_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3493 UINT16 input_port_7_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3494 UINT16 input_port_8_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3495 UINT16 input_port_9_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3496 UINT16 input_port_10_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3497 UINT16 input_port_11_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3498 UINT16 input_port_12_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3499 UINT16 input_port_13_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3500 UINT16 input_port_14_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3501 UINT16 input_port_15_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3502 UINT16 input_port_16_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3503 UINT16 input_port_17_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3504 UINT16 input_port_18_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3505 UINT16 input_port_19_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3506 UINT16 input_port_20_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3507 UINT16 input_port_21_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3508 UINT16 input_port_22_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3509 UINT16 input_port_23_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3510 UINT16 input_port_24_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3511 UINT16 input_port_25_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3512 UINT16 input_port_26_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3513 UINT16 input_port_27_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3514 UINT16 input_port_28_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3515 UINT16 input_port_29_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3516
3517 UINT32 input_port_0_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3518 UINT32 input_port_1_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3519 UINT32 input_port_2_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3520 UINT32 input_port_3_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3521 UINT32 input_port_4_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3522 UINT32 input_port_5_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3523 UINT32 input_port_6_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3524 UINT32 input_port_7_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3525 UINT32 input_port_8_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3526 UINT32 input_port_9_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3527 UINT32 input_port_10_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3528 UINT32 input_port_11_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3529 UINT32 input_port_12_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3530 UINT32 input_port_13_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3531 UINT32 input_port_14_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3532 UINT32 input_port_15_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3533 UINT32 input_port_16_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3534 UINT32 input_port_17_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3535 UINT32 input_port_18_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3536 UINT32 input_port_19_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3537 UINT32 input_port_20_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3538 UINT32 input_port_21_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3539 UINT32 input_port_22_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3540 UINT32 input_port_23_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3541 UINT32 input_port_24_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3542 UINT32 input_port_25_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3543 UINT32 input_port_26_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3544 UINT32 input_port_27_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3545 UINT32 input_port_28_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3546 UINT32 input_port_29_dword_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3547 # 19 "src/osdepend.h" 2
3548
3549 int osd_init(void);
3550 void osd_exit(void);
3551 # 35 "src/osdepend.h"
3552 struct _osd_create_params
3553 {
3554 int width, height;
3555 int aspect_x, aspect_y;
3556 int depth;
3557 int colors;
3558 float fps;
3559 int video_attributes;
3560 };
3561 typedef struct _osd_create_params osd_create_params;
3562 # 72 "src/osdepend.h"
3563 int osd_create_display(const osd_create_params *params, UINT32 *rgb_components);
3564 void osd_close_display(void);
3565 # 86 "src/osdepend.h"
3566 int osd_skip_this_frame(void);
3567 # 102 "src/osdepend.h"
3568 void osd_update_video_and_audio(struct _mame_display *display);
3569
3570
3571
3572
3573
3574
3575
3576 mame_bitmap *osd_override_snapshot(mame_bitmap *bitmap, rectangle *bounds);
3577
3578
3579
3580
3581
3582
3583 const char *osd_get_fps_text(const performance_info *performance);
3584 # 147 "src/osdepend.h"
3585 int osd_start_audio_stream(int stereo);
3586 int osd_update_audio_stream(INT16 *buffer);
3587 void osd_stop_audio_stream(void);
3588 # 158 "src/osdepend.h"
3589 void osd_set_mastervolume(int attenuation);
3590 int osd_get_mastervolume(void);
3591
3592 void osd_sound_enable(int enable);
3593 # 174 "src/osdepend.h"
3594 const os_code_info *osd_get_code_list(void);
3595
3596
3597
3598
3599
3600
3601 INT32 osd_get_code_value(os_code oscode);
3602 # 192 "src/osdepend.h"
3603 int osd_readkey_unicode(int flush);
3604 # 203 "src/osdepend.h"
3605 void osd_customize_inputport_list(input_port_default_entry *defaults);
3606
3607
3608
3609
3610 int osd_joystick_needs_calibration(void);
3611
3612 void osd_joystick_start_calibration(void);
3613
3614
3615 const char *osd_joystick_calibrate_next(void);
3616
3617 void osd_joystick_calibrate(void);
3618
3619 void osd_joystick_end_calibration(void);
3620 # 228 "src/osdepend.h"
3621 struct _inp_header
3622 {
3623 char name[9];
3624 char version[3];
3625 char reserved[20];
3626 };
3627 typedef struct _inp_header inp_header;
3628
3629
3630
3631 enum
3632 {
3633 PATH_NOT_FOUND,
3634 PATH_IS_FILE,
3635 PATH_IS_DIRECTORY
3636 };
3637
3638
3639 typedef enum
3640 {
3641 FILEERR_SUCCESS,
3642 FILEERR_FAILURE,
3643 FILEERR_OUT_OF_MEMORY,
3644 FILEERR_NOT_FOUND,
3645 FILEERR_ACCESS_DENIED,
3646 FILEERR_ALREADY_OPEN,
3647 FILEERR_TOO_MANY_FILES
3648 } osd_file_error;
3649
3650
3651
3652 int osd_get_path_count(int pathtype);
3653
3654
3655 int osd_get_path_info(int pathtype, int pathindex, const char *filename);
3656
3657
3658 osd_file *osd_fopen(int pathtype, int pathindex, const char *filename, const char *mode, osd_file_error *error);
3659
3660
3661 int osd_fseek(osd_file *file, INT64 offset, int whence);
3662
3663
3664 UINT64 osd_ftell(osd_file *file);
3665
3666
3667 int osd_feof(osd_file *file);
3668
3669
3670 UINT32 osd_fread(osd_file *file, void *buffer, UINT32 length);
3671
3672
3673 UINT32 osd_fwrite(osd_file *file, const void *buffer, UINT32 length);
3674
3675
3676 void osd_fclose(osd_file *file);
3677 # 293 "src/osdepend.h"
3678 typedef INT64 cycles_t;
3679
3680
3681 cycles_t osd_cycles(void);
3682
3683
3684 cycles_t osd_cycles_per_second(void);
3685
3686
3687
3688
3689 cycles_t osd_profiling_ticks(void);
3690 # 315 "src/osdepend.h"
3691 void *osd_alloc_executable(size_t size);
3692 void osd_free_executable(void *ptr);
3693
3694
3695
3696
3697 int osd_display_loading_rom_message(const char *name,rom_load_data *romdata);
3698
3699
3700
3701
3702
3703 void osd_pause(int paused);
3704
3705
3706 int osd_is_bad_read_ptr(const void *ptr, size_t size);
3707
3708
3709 void osd_die(const char *text,...) __attribute__((format(printf, 1, 2))) __attribute__((noreturn));
3710 # 342 "src/osdepend.h"
3711 void logerror(const char *text,...) __attribute__((format(printf, 1, 2)));
3712 # 64 "src/driver.h" 2
3713
3714 # 1 "src/debug/mamedbg.h" 1
3715 # 16 "src/debug/mamedbg.h"
3716 # 1 "src/mame.h" 1
3717 # 12 "src/mame.h"
3718
3719 # 22 "src/mame.h"
3720 # 1 "src/fileio.h" 1
3721 # 12 "src/fileio.h"
3722
3723
3724
3725
3726
3727 # 1 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 1 3 4
3728 # 105 "/usr/local/src/blackfin/toolchains/20060914/out-uclinux/lib/gcc/bfin-uclinux/3.4.6/include/stdarg.h" 3 4
3729 typedef __gnuc_va_list va_list;
3730 # 18 "src/fileio.h" 2
3731
3732
3733 # 1 "src/chd.h" 1
3734 # 10 "src/chd.h"
3735
3736 # 113 "src/chd.h"
3737 enum
3738 {
3739 CHDERR_NONE,
3740 CHDERR_NO_INTERFACE,
3741 CHDERR_OUT_OF_MEMORY,
3742 CHDERR_INVALID_FILE,
3743 CHDERR_INVALID_PARAMETER,
3744 CHDERR_INVALID_DATA,
3745 CHDERR_FILE_NOT_FOUND,
3746 CHDERR_REQUIRES_PARENT,
3747 CHDERR_FILE_NOT_WRITEABLE,
3748 CHDERR_READ_ERROR,
3749 CHDERR_WRITE_ERROR,
3750 CHDERR_CODEC_ERROR,
3751 CHDERR_INVALID_PARENT,
3752 CHDERR_HUNK_OUT_OF_RANGE,
3753 CHDERR_DECOMPRESSION_ERROR,
3754 CHDERR_COMPRESSION_ERROR,
3755 CHDERR_CANT_CREATE_FILE,
3756 CHDERR_CANT_VERIFY,
3757 CHDERR_NOT_SUPPORTED,
3758 CHDERR_METADATA_NOT_FOUND,
3759 CHDERR_INVALID_METADATA_SIZE,
3760 CHDERR_UNSUPPORTED_VERSION
3761 };
3762 # 147 "src/chd.h"
3763 struct _chd_header
3764 {
3765 UINT32 length;
3766 UINT32 version;
3767 UINT32 flags;
3768 UINT32 compression;
3769 UINT32 hunkbytes;
3770 UINT32 totalhunks;
3771 UINT64 logicalbytes;
3772 UINT64 metaoffset;
3773 UINT8 md5[16];
3774 UINT8 parentmd5[16];
3775 UINT8 sha1[20];
3776 UINT8 parentsha1[20];
3777
3778 UINT32 obsolete_cylinders;
3779 UINT32 obsolete_sectors;
3780 UINT32 obsolete_heads;
3781 UINT32 obsolete_hunksize;
3782 };
3783 typedef struct _chd_header chd_header;
3784
3785
3786 typedef struct _chd_file chd_file;
3787 typedef struct _chd_exfile chd_exfile;
3788 typedef struct _chd_interface_file chd_interface_file;
3789
3790
3791 struct _chd_interface
3792 {
3793 chd_interface_file *(*open)(const char *filename, const char *mode);
3794 void (*close)(chd_interface_file *file);
3795 UINT32 (*read)(chd_interface_file *file, UINT64 offset, UINT32 count, void *buffer);
3796 UINT32 (*write)(chd_interface_file *file, UINT64 offset, UINT32 count, const void *buffer);
3797 UINT64 (*length)(chd_interface_file *file);
3798 };
3799 typedef struct _chd_interface chd_interface;
3800 # 193 "src/chd.h"
3801 void chd_set_interface(chd_interface *new_interface);
3802 void chd_save_interface(chd_interface *interface_save);
3803
3804 int chd_create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 compression, chd_file *parent);
3805 chd_file *chd_open(const char *filename, int writeable, chd_file *parent);
3806 void chd_close(chd_file *chd);
3807 void chd_close_all(void);
3808
3809 UINT32 chd_get_metadata(chd_file *chd, UINT32 *metatag, UINT32 metaindex, void *outputbuf, UINT32 outputlen);
3810 int chd_set_metadata(chd_file *chd, UINT32 metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen);
3811
3812 UINT32 chd_read(chd_file *chd, UINT32 hunknum, UINT32 hunkcount, void *buffer);
3813 UINT32 chd_write(chd_file *chd, UINT32 hunknum, UINT32 hunkcount, const void *buffer);
3814
3815 int chd_get_last_error(void);
3816 const chd_header *chd_get_header(chd_file *chd);
3817 int chd_set_header(const char *filename, const chd_header *header);
3818
3819 int chd_compress(chd_file *chd, const char *rawfile, UINT32 offset, void (*progress)(const char *, ...));
3820 int chd_verify(chd_file *chd, void (*progress)(const char *, ...), UINT8 actualmd5[16], UINT8 actualsha1[20]);
3821
3822 chd_exfile *chd_start_compress_ex(chd_file *chd);
3823 int chd_compress_ex(chd_exfile *chdex, const char *rawfile, UINT64 offset, UINT32 inpsecsize, UINT32 srcperhunk, UINT32 hunks_to_read, UINT32 hunksecsize, void (*progress)(const char *, ...));
3824 int chd_end_compress_ex(chd_exfile *chdex, void (*progress)(const char *, ...));
3825 # 21 "src/fileio.h" 2
3826
3827
3828
3829 enum
3830 {
3831 FILETYPE_RAW = 0,
3832 FILETYPE_ROM,
3833 FILETYPE_IMAGE,
3834 FILETYPE_IMAGE_DIFF,
3835 FILETYPE_SAMPLE,
3836 FILETYPE_ARTWORK,
3837 FILETYPE_NVRAM,
3838 FILETYPE_HIGHSCORE,
3839 FILETYPE_HIGHSCORE_DB,
3840 FILETYPE_CONFIG,
3841 FILETYPE_INPUTLOG,
3842 FILETYPE_STATE,
3843 FILETYPE_MEMCARD,
3844 FILETYPE_SCREENSHOT,
3845 FILETYPE_MOVIE,
3846 FILETYPE_HISTORY,
3847 FILETYPE_CHEAT,
3848 FILETYPE_LANGUAGE,
3849 FILETYPE_CTRLR,
3850 FILETYPE_INI,
3851
3852
3853
3854 FILETYPE_end
3855 };
3856
3857
3858
3859
3860
3861
3862 typedef struct _mame_file mame_file;
3863
3864 extern chd_interface mame_chd_interface;
3865
3866 int mame_faccess(const char *filename, int filetype);
3867 mame_file *mame_fopen(const char *gamename, const char *filename, int filetype, int openforwrite);
3868 mame_file *mame_fopen_error(const char *gamename, const char *filename, int filetype, int openforwrite, osd_file_error *error);
3869 mame_file *mame_fopen_rom(const char *gamename, const char *filename, const char *exphash);
3870 UINT32 mame_fread(mame_file *file, void *buffer, UINT32 length);
3871 UINT32 mame_fwrite(mame_file *file, const void *buffer, UINT32 length);
3872 UINT32 mame_fread_swap(mame_file *file, void *buffer, UINT32 length);
3873 UINT32 mame_fwrite_swap(mame_file *file, const void *buffer, UINT32 length);
3874 # 80 "src/fileio.h"
3875 int mame_fseek(mame_file *file, INT64 offset, int whence);
3876 void mame_fclose(mame_file *file);
3877 int mame_fchecksum(const char *gamename, const char *filename, unsigned int *length, char *hash);
3878 UINT64 mame_fsize(mame_file *file);
3879 const char *mame_fhash(mame_file *file);
3880 int mame_fgetc(mame_file *file);
3881 int mame_ungetc(int c, mame_file *file);
3882 char *mame_fgets(char *s, int n, mame_file *file);
3883 int mame_feof(mame_file *file);
3884 UINT64 mame_ftell(mame_file *file);
3885
3886 int mame_fputs(mame_file *f, const char *s);
3887 int mame_vfprintf(mame_file *f, const char *fmt, va_list va);
3888 int mame_fprintf(mame_file *f, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
3889 # 23 "src/mame.h" 2
3890 # 1 "src/drawgfx.h" 1
3891 # 12 "src/drawgfx.h"
3892
3893
3894
3895
3896
3897 # 1 "src/palette.h" 1
3898 # 73 "src/palette.h"
3899
3900 # 83 "src/palette.h"
3901 typedef UINT32 rgb_t;
3902 # 119 "src/palette.h"
3903 extern UINT32 direct_rgb_components[3];
3904 extern UINT16 *palette_shadow_table;
3905
3906 extern UINT8 *paletteram;
3907 extern UINT8 *paletteram_2;
3908 extern UINT16 *paletteram16;
3909 extern UINT16 *paletteram16_2;
3910 extern UINT32 *paletteram32;
3911
3912
3913
3914
3915
3916
3917
3918 int palette_start(void);
3919 int palette_init(void);
3920 int palette_get_total_colors_with_ui(void);
3921
3922 void palette_update_display(mame_display *display);
3923
3924 void palette_set_color(pen_t pen, UINT8 r, UINT8 g, UINT8 b);
3925 void palette_get_color(pen_t pen, UINT8 *r, UINT8 *g, UINT8 *b);
3926 void palette_set_colors(pen_t color_base, const UINT8 *colors, int color_count);
3927
3928 void palette_set_brightness(pen_t pen, double bright);
3929 void palette_set_shadow_factor(double factor);
3930 void palette_set_highlight_factor(double factor);
3931 # 167 "src/palette.h"
3932 void palette_set_shadow_mode(int mode);
3933 void palette_set_shadow_factor32(double factor);
3934 void palette_set_highlight_factor32(double factor);
3935 void palette_set_shadow_dRGB32(int mode, int dr, int dg, int db, int noclip);
3936 void palette_set_highlight_method(int method);
3937
3938 void palette_set_global_gamma(double _gamma);
3939 double palette_get_global_gamma(void);
3940
3941 void palette_set_global_brightness(double brightness);
3942 void palette_set_global_brightness_adjust(double adjustment);
3943 double palette_get_global_brightness(void);
3944
3945 pen_t get_black_pen(void);
3946 pen_t get_white_pen(void);
3947
3948
3949
3950
3951
3952 UINT8 paletteram_r(__attribute__((__unused__)) offs_t offset);
3953 UINT8 paletteram_2_r(__attribute__((__unused__)) offs_t offset);
3954 UINT16 paletteram16_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3955 UINT16 paletteram16_2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
3956 UINT32 paletteram32_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
3957
3958 void paletteram_BBGGGRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3959 void paletteram_RRRGGGBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3960 void paletteram_BBBGGGRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3961 void paletteram_IIBBGGRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3962 void paletteram_BBGGRRII_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3963
3964
3965
3966
3967
3968
3969
3970 void paletteram_xxxxBBBBGGGGRRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3971 void paletteram_xxxxBBBBGGGGRRRR_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3972 void paletteram_xxxxBBBBGGGGRRRR_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3973 void paletteram_xxxxBBBBGGGGRRRR_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3974 void paletteram16_xxxxBBBBGGGGRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3975 void paletteram_xxxxBBBBRRRRGGGG_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3976 void paletteram_xxxxBBBBRRRRGGGG_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3977 void paletteram_xxxxBBBBRRRRGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3978 void paletteram_xxxxBBBBRRRRGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3979 void paletteram16_xxxxBBBBRRRRGGGG_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3980 void paletteram_xxxxRRRRBBBBGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3981 void paletteram_xxxxRRRRBBBBGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3982 void paletteram_xxxxRRRRGGGGBBBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3983 void paletteram_xxxxRRRRGGGGBBBB_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3984 void paletteram16_xxxxRRRRGGGGBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3985 void paletteram_RRRRGGGGBBBBxxxx_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3986 void paletteram_RRRRGGGGBBBBxxxx_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3987 void paletteram_RRRRGGGGBBBBxxxx_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3988 void paletteram16_RRRRGGGGBBBBxxxx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3989 void paletteram_BBBBGGGGRRRRxxxx_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3990 void paletteram_BBBBGGGGRRRRxxxx_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3991 void paletteram_BBBBGGGGRRRRxxxx_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3992 void paletteram16_BBBBGGGGRRRRxxxx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3993 void paletteram_xBBBBBGGGGGRRRRR_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3994 void paletteram_xBBBBBGGGGGRRRRR_swap_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3995 void paletteram_xBBBBBGGGGGRRRRR_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3996 void paletteram_xBBBBBGGGGGRRRRR_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3997 void paletteram16_xBBBBBGGGGGRRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
3998 void paletteram_xBBBBBRRRRRGGGGG_split1_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
3999 void paletteram_xBBBBBRRRRRGGGGG_split2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
4000 void paletteram_xRRRRRGGGGGBBBBB_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
4001 void paletteram16_xRRRRRGGGGGBBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4002 void paletteram16_xGGGGGRRRRRBBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4003 void paletteram16_xGGGGGBBBBBRRRRR_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4004 void paletteram_RRRRRGGGGGBBBBBx_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
4005 void paletteram16_RRRRRGGGGGBBBBBx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4006 void paletteram16_IIIIRRRRGGGGBBBB_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4007 void paletteram16_RRRRGGGGBBBBIIII_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4008 void paletteram16_xrgb_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4009 void paletteram16_xbgr_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4010 void paletteram16_RRRRGGGGBBBBRGBx_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
4011 # 254 "src/palette.h"
4012 void palette_init_black_and_white(UINT16 *colortable, const UINT8 *color_prom);
4013 void palette_init_RRRR_GGGG_BBBB(UINT16 *colortable, const UINT8 *color_prom);
4014 # 18 "src/drawgfx.h" 2
4015 # 33 "src/drawgfx.h"
4016 struct _gfx_layout
4017 {
4018 UINT16 width,height;
4019 UINT32 total;
4020 UINT16 planes;
4021 UINT32 planeoffset[8];
4022 UINT32 xoffset[256];
4023 UINT32 yoffset[256];
4024 UINT32 charincrement;
4025 };
4026 typedef struct _gfx_layout gfx_layout;
4027 # 61 "src/drawgfx.h"
4028 struct _gfx_element
4029 {
4030 UINT16 width,height;
4031
4032 UINT32 total_elements;
4033 UINT16 color_granularity;
4034
4035 UINT32 total_colors;
4036 pen_t *colortable;
4037 UINT32 *pen_usage;
4038
4039
4040
4041
4042 UINT8 *gfxdata;
4043 UINT32 line_modulo;
4044 UINT32 char_modulo;
4045 UINT32 flags;
4046 gfx_layout layout;
4047 };
4048 typedef struct _gfx_element gfx_element;
4049
4050
4051
4052
4053
4054
4055 struct _gfx_decode
4056 {
4057 int memory_region;
4058
4059 UINT32 start;
4060 const gfx_layout *gfxlayout;
4061 UINT16 color_codes_start;
4062 UINT16 total_color_codes;
4063 };
4064 typedef struct _gfx_decode gfx_decode;
4065
4066
4067 struct _alpha_cache
4068 {
4069 const UINT8 *alphas;
4070 const UINT8 *alphad;
4071 UINT8 alpha[0x101][0x100];
4072 };
4073 typedef struct _alpha_cache alpha_cache;
4074
4075 extern struct _alpha_cache drawgfx_alpha_cache;
4076
4077 enum
4078 {
4079 TRANSPARENCY_NONE,
4080 TRANSPARENCY_NONE_RAW,
4081 TRANSPARENCY_PEN,
4082 TRANSPARENCY_PEN_RAW,
4083 TRANSPARENCY_PENS,
4084 TRANSPARENCY_PENS_RAW,
4085 TRANSPARENCY_COLOR,
4086 TRANSPARENCY_PEN_TABLE,
4087 TRANSPARENCY_PEN_TABLE_RAW,
4088 TRANSPARENCY_BLEND,
4089 TRANSPARENCY_BLEND_RAW,
4090 TRANSPARENCY_ALPHAONE,
4091 TRANSPARENCY_ALPHA,
4092 TRANSPARENCY_ALPHARANGE,
4093
4094 TRANSPARENCY_MODES
4095 };
4096
4097
4098 extern UINT8 gfx_alpharange_table[256];
4099
4100
4101 extern UINT8 gfx_drawmode_table[256];
4102 enum
4103 {
4104 DRAWMODE_NONE,
4105 DRAWMODE_SOURCE,
4106 DRAWMODE_SHADOW
4107 };
4108
4109
4110
4111 extern int pdrawgfx_shadow_lowpri;
4112
4113
4114
4115
4116
4117
4118
4119 void decodechar(gfx_element *gfx,int num,const unsigned char *src,const gfx_layout *gl);
4120 gfx_element *allocgfx(const gfx_layout *gl);
4121 void decodegfx(gfx_element *gfx, const UINT8 *src, UINT32 first, UINT32 count);
4122 void set_pixel_functions(mame_bitmap *bitmap);
4123 void freegfx(gfx_element *gfx);
4124 void drawgfx(mame_bitmap *dest,const gfx_element *gfx,
4125 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4126 const rectangle *clip,int transparency,int transparent_color);
4127 void pdrawgfx(mame_bitmap *dest,const gfx_element *gfx,
4128 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4129 const rectangle *clip,int transparency,int transparent_color,
4130 UINT32 priority_mask);
4131 void mdrawgfx(mame_bitmap *dest,const gfx_element *gfx,
4132 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4133 const rectangle *clip,int transparency,int transparent_color,
4134 UINT32 priority_mask);
4135 void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
4136 const rectangle *clip,int transparency,int transparent_color);
4137 void copybitmap_remap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy,
4138 const rectangle *clip,int transparency,int transparent_color);
4139 void copyscrollbitmap(mame_bitmap *dest,mame_bitmap *src,
4140 int rows,const int *rowscroll,int cols,const int *colscroll,
4141 const rectangle *clip,int transparency,int transparent_color);
4142 void copyscrollbitmap_remap(mame_bitmap *dest,mame_bitmap *src,
4143 int rows,const int *rowscroll,int cols,const int *colscroll,
4144 const rectangle *clip,int transparency,int transparent_color);
4145 void draw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,pen_t *pens,int transparent_pen);
4146 void draw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,pen_t *pens,int transparent_pen);
4147 void pdraw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,pen_t *pens,int transparent_pen,int pri);
4148 void pdraw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,pen_t *pens,int transparent_pen,int pri);
4149 void extract_scanline8(mame_bitmap *bitmap,int x,int y,int length,UINT8 *dst);
4150 void extract_scanline16(mame_bitmap *bitmap,int x,int y,int length,UINT16 *dst);
4151
4152
4153
4154 extern int alpha_active;
4155 void alpha_init(void);
4156 static __inline__ void alpha_set_level(int level) {
4157 if(level == 0)
4158 level = -1;
4159 drawgfx_alpha_cache.alphas = drawgfx_alpha_cache.alpha[level+1];
4160 drawgfx_alpha_cache.alphad = drawgfx_alpha_cache.alpha[255-level];
4161 }
4162
4163 static __inline__ UINT32 alpha_blend16( UINT32 d, UINT32 s )
4164 {
4165 const UINT8 *alphas = drawgfx_alpha_cache.alphas;
4166 const UINT8 *alphad = drawgfx_alpha_cache.alphad;
4167 return (alphas[s & 0x1f] | (alphas[(s>>5) & 0x1f] << 5) | (alphas[(s>>10) & 0x1f] << 10))
4168 + (alphad[d & 0x1f] | (alphad[(d>>5) & 0x1f] << 5) | (alphad[(d>>10) & 0x1f] << 10));
4169 }
4170
4171
4172 static __inline__ UINT32 alpha_blend32( UINT32 d, UINT32 s )
4173 {
4174 const UINT8 *alphas = drawgfx_alpha_cache.alphas;
4175 const UINT8 *alphad = drawgfx_alpha_cache.alphad;
4176 return (alphas[s & 0xff] | (alphas[(s>>8) & 0xff] << 8) | (alphas[(s>>16) & 0xff] << 16))
4177 + (alphad[d & 0xff] | (alphad[(d>>8) & 0xff] << 8) | (alphad[(d>>16) & 0xff] << 16));
4178 }
4179
4180 static __inline__ UINT32 alpha_blend_r16( UINT32 d, UINT32 s, UINT8 level )
4181 {
4182 const UINT8 *alphas = drawgfx_alpha_cache.alpha[level];
4183 const UINT8 *alphad = drawgfx_alpha_cache.alpha[255 - level];
4184 return (alphas[s & 0x1f] | (alphas[(s>>5) & 0x1f] << 5) | (alphas[(s>>10) & 0x1f] << 10))
4185 + (alphad[d & 0x1f] | (alphad[(d>>5) & 0x1f] << 5) | (alphad[(d>>10) & 0x1f] << 10));
4186 }
4187
4188
4189 static __inline__ UINT32 alpha_blend_r32( UINT32 d, UINT32 s, UINT8 level )
4190 {
4191 const UINT8 *alphas = drawgfx_alpha_cache.alpha[level];
4192 const UINT8 *alphad = drawgfx_alpha_cache.alpha[255 - level];
4193 return (alphas[s & 0xff] | (alphas[(s>>8) & 0xff] << 8) | (alphas[(s>>16) & 0xff] << 16))
4194 + (alphad[d & 0xff] | (alphad[(d>>8) & 0xff] << 8) | (alphad[(d>>16) & 0xff] << 16));
4195 }
4196 # 258 "src/drawgfx.h"
4197 void copyrozbitmap(mame_bitmap *dest,mame_bitmap *src,
4198 UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,int wraparound,
4199 const rectangle *clip,int transparency,int transparent_color,UINT32 priority);
4200
4201 void fillbitmap(mame_bitmap *dest,pen_t pen,const rectangle *clip);
4202 void drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
4203 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4204 const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley);
4205 void pdrawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
4206 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4207 const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley,
4208 UINT32 priority_mask);
4209 void mdrawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
4210 unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
4211 const rectangle *clip,int transparency,int transparent_color,int scalex,int scaley,
4212 UINT32 priority_mask);
4213
4214 void drawgfx_toggle_crosshair(void);
4215 void draw_crosshair(mame_bitmap *bitmap,int x,int y,const rectangle *clip,int player);
4216 # 24 "src/mame.h" 2
4217
4218
4219
4220
4221
4222
4223
4224 extern char build_version[];
4225 # 70 "src/mame.h"
4226 struct _region_info
4227 {
4228 UINT8 * base;
4229 size_t length;
4230 UINT32 type;
4231 UINT32 flags;
4232 };
4233 typedef struct _region_info region_info;
4234
4235
4236 struct _running_machine
4237 {
4238
4239
4240
4241 const game_driver * gamedrv;
4242
4243
4244 const machine_config * drv;
4245
4246
4247 region_info memory_region[32];
4248
4249
4250 int rom_load_warnings;
4251
4252
4253
4254
4255
4256 gfx_element * gfx[32];
4257
4258
4259 mame_bitmap * scrbitmap;
4260
4261
4262 rectangle visible_area;
4263 rectangle absolute_visible_area;
4264
4265
4266 float refresh_rate;
4267
4268
4269
4270
4271 pen_t * pens;
4272
4273
4274 UINT16 * game_colortable;
4275
4276
4277 pen_t * remapped_colortable;
4278
4279
4280 int color_depth;
4281
4282
4283
4284
4285
4286 int sample_rate;
4287
4288
4289
4290
4291
4292 input_port_entry * input_ports;
4293
4294
4295 input_port_entry * input_ports_default;
4296
4297
4298
4299
4300
4301 int ui_orientation;
4302
4303
4304
4305
4306
4307 mame_bitmap * debug_bitmap;
4308
4309
4310 pen_t * debug_pens;
4311
4312
4313 pen_t * debug_remapped_colortable;
4314
4315
4316 gfx_element * debugger_font;
4317
4318
4319
4320
4321 };
4322 typedef struct _running_machine running_machine;
4323 # 197 "src/mame.h"
4324 struct _global_options
4325 {
4326 mame_file * record;
4327 mame_file * playback;
4328 mame_file * language_file;
4329
4330 int mame_debug;
4331 int cheat;
4332 int gui_host;
4333 int skip_disclaimer;
4334 int skip_gameinfo;
4335 int skip_warnings;
4336
4337 int samplerate;
4338 int use_samples;
4339
4340 float brightness;
4341 float pause_bright;
4342 float gamma;
4343 int vector_width;
4344 int vector_height;
4345 int ui_orientation;
4346
4347 int beam;
4348 float vector_flicker;
4349 float vector_intensity;
4350 int translucency;
4351 int antialias;
4352
4353 int use_artwork;
4354 int artwork_res;
4355 int artwork_crop;
4356
4357 const char * savegame;
4358 int auto_save;
4359 char * bios;
4360
4361 int debug_width;
4362 int debug_height;
4363 int debug_depth;
4364
4365 const char *controller;
4366 # 249 "src/mame.h"
4367 };
4368 typedef struct _global_options global_options;
4369 # 279 "src/mame.h"
4370 struct _mame_display
4371 {
4372
4373 UINT32 changed_flags;
4374
4375
4376 mame_bitmap * game_bitmap;
4377 rectangle game_bitmap_update;
4378 const rgb_t * game_palette;
4379 UINT32 game_palette_entries;
4380 UINT32 * game_palette_dirty;
4381 rectangle game_visible_area;
4382 float game_refresh_rate;
4383 void * vector_dirty_pixels;
4384
4385
4386 mame_bitmap * debug_bitmap;
4387 const rgb_t * debug_palette;
4388 UINT32 debug_palette_entries;
4389 UINT8 debug_focus;
4390
4391
4392 UINT8 led_state;
4393 };
4394 # 313 "src/mame.h"
4395 struct _performance_info
4396 {
4397 double game_speed_percent;
4398 double frames_per_second;
4399 int vector_updates_last_second;
4400 int partial_updates_this_frame;
4401 };
4402 # 330 "src/mame.h"
4403 extern global_options options;
4404 extern running_machine *Machine;
4405 # 344 "src/mame.h"
4406 int run_game(int game);
4407
4408
4409 void expand_machine_driver(void (*constructor)(machine_config *), machine_config *output);
4410
4411
4412 void mame_pause(int pause);
4413
4414
4415 int mame_is_paused(void);
4416
4417
4418
4419
4420
4421
4422 void set_visible_area(int min_x, int max_x, int min_y, int max_y);
4423
4424
4425 void set_refresh_rate(float fps);
4426
4427
4428 void schedule_full_refresh(void);
4429
4430
4431 void reset_partial_updates(void);
4432
4433
4434 void force_partial_update(int scanline);
4435
4436
4437 void draw_screen(void);
4438
4439
4440 void update_video_and_audio(void);
4441
4442
4443
4444 int updatescreen(void);
4445
4446
4447
4448
4449
4450
4451 int mame_highscore_enabled(void);
4452
4453
4454 void set_led_status(int num, int on);
4455
4456
4457 const performance_info *mame_get_performance_info(void);
4458
4459
4460 int mame_find_cpu_index(const char *tag);
4461
4462
4463 int mame_validitychecks(void);
4464 # 17 "src/debug/mamedbg.h" 2
4465
4466
4467
4468
4469 extern int mame_debug;
4470 # 66 "src/driver.h" 2
4471
4472 # 1 "src/common.h" 1
4473 # 12 "src/common.h"
4474
4475
4476
4477
4478
4479 # 1 "src/hash.h" 1
4480 # 12 "src/hash.h"
4481
4482 # 31 "src/hash.h"
4483 const char* hash_function_name(unsigned int function);
4484
4485
4486 int hash_data_has_checksum(const char* d, unsigned int function);
4487
4488
4489
4490
4491
4492 int hash_data_extract_binary_checksum(const char* d, unsigned int function, unsigned char* checksum);
4493 int hash_data_extract_printable_checksum(const char* d, unsigned int function, char* checksum);
4494
4495
4496
4497
4498
4499
4500 int hash_data_insert_binary_checksum(char* d, unsigned int function, const unsigned char* checksum);
4501 int hash_data_insert_printable_checksum(char* d, unsigned int function, const char* checksum);
4502
4503
4504 int hash_data_has_info(const char* d, unsigned int info);
4505
4506
4507
4508 int hash_data_is_equal(const char* d1, const char* d2, unsigned int functions);
4509
4510
4511
4512 void hash_data_print(const char* d, unsigned int functions, char* buffer);
4513
4514
4515 void hash_data_copy(char* dst, const char* src);
4516
4517
4518 void hash_data_clear(char* dst);
4519
4520
4521 unsigned int hash_data_used_functions(const char* d);
4522
4523
4524
4525 void hash_compute(char* dst, const unsigned char* data, unsigned long length, unsigned int functions);
4526
4527
4528 int hash_verify_string(const char *hash);
4529 # 18 "src/common.h" 2
4530 # 1 "src/xmlfile.h" 1
4531 # 12 "src/xmlfile.h"
4532
4533 # 28 "src/xmlfile.h"
4534 struct _xml_attribute_node
4535 {
4536 struct _xml_attribute_node *next;
4537 const char *name;
4538 const char *value;
4539 };
4540 typedef struct _xml_attribute_node xml_attribute_node;
4541
4542
4543 struct _xml_data_node
4544 {
4545 struct _xml_data_node *next;
4546 struct _xml_data_node *parent;
4547 struct _xml_data_node *child;
4548 const char *name;
4549 const char *value;
4550 xml_attribute_node *attribute;
4551 };
4552
4553
4554
4555
4556 struct XML_ParserStruct;
4557
4558 struct _xml_custom_parse
4559 {
4560 void (*init)(struct XML_ParserStruct *parser);
4561 size_t (*read)(void *param, void *buffer, size_t length);
4562 int (*eof)(void *param);
4563 void *param;
4564 int trim_whitespace;
4565
4566 const char *error_message;
4567 int error_line;
4568 int error_column;
4569
4570 xml_data_node **curnode;
4571 };
4572 typedef struct _xml_custom_parse xml_custom_parse;
4573 # 76 "src/xmlfile.h"
4574 xml_data_node *xml_file_create(void);
4575 xml_data_node *xml_file_read(mame_file *file);
4576 xml_data_node *xml_file_read_custom(xml_custom_parse *parse_info);
4577 void xml_file_write(xml_data_node *node, mame_file *file);
4578 void xml_file_free(xml_data_node *node);
4579
4580 int xml_count_children(xml_data_node *node);
4581 xml_data_node *xml_get_sibling(xml_data_node *node, const char *name);
4582 xml_data_node *xml_find_matching_sibling(xml_data_node *node, const char *name, const char *attribute, const char *matchval);
4583 xml_attribute_node *xml_get_attribute(xml_data_node *node, const char *attribute);
4584 const char *xml_get_attribute_string(xml_data_node *node, const char *attribute, const char *defvalue);
4585 int xml_get_attribute_int(xml_data_node *node, const char *attribute, int defvalue);
4586 float xml_get_attribute_float(xml_data_node *node, const char *attribute, float defvalue);
4587
4588 xml_data_node *xml_add_child(xml_data_node *node, const char *name, const char *value);
4589 xml_data_node *xml_get_or_add_child(xml_data_node *node, const char *name, const char *value);
4590 xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, const char *value);
4591 xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, int value);
4592 xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *name, float value);
4593 void xml_delete_node(xml_data_node *node);
4594 # 19 "src/common.h" 2
4595 # 29 "src/common.h"
4596 struct _rom_entry
4597 {
4598 const char *_name;
4599 UINT32 _offset;
4600 UINT32 _length;
4601 UINT32 _flags;
4602 const char *_hashdata;
4603 };
4604 typedef struct _rom_entry rom_entry;
4605
4606
4607 struct _bios_entry
4608 {
4609 int value;
4610 const char *_name;
4611 const char *_description;
4612 };
4613 typedef struct _bios_entry bios_entry;
4614
4615
4616 struct _rom_load_data
4617 {
4618 int warnings;
4619 int errors;
4620
4621 int romsloaded;
4622 int romstotal;
4623
4624 void * file;
4625
4626 UINT8 * regionbase;
4627 UINT32 regionlength;
4628
4629 char errorbuf[4096];
4630 UINT8 tempbuf[65536];
4631 };
4632 # 75 "src/common.h"
4633 enum
4634 {
4635 REGION_INVALID = 0x80,
4636 REGION_CPU1,
4637 REGION_CPU2,
4638 REGION_CPU3,
4639 REGION_CPU4,
4640 REGION_CPU5,
4641 REGION_CPU6,
4642 REGION_CPU7,
4643 REGION_CPU8,
4644 REGION_GFX1,
4645 REGION_GFX2,
4646 REGION_GFX3,
4647 REGION_GFX4,
4648 REGION_GFX5,
4649 REGION_GFX6,
4650 REGION_GFX7,
4651 REGION_GFX8,
4652 REGION_PROMS,
4653 REGION_SOUND1,
4654 REGION_SOUND2,
4655 REGION_SOUND3,
4656 REGION_SOUND4,
4657 REGION_SOUND5,
4658 REGION_SOUND6,
4659 REGION_SOUND7,
4660 REGION_SOUND8,
4661 REGION_USER1,
4662 REGION_USER2,
4663 REGION_USER3,
4664 REGION_USER4,
4665 REGION_USER5,
4666 REGION_USER6,
4667 REGION_USER7,
4668 REGION_USER8,
4669 REGION_DISKS,
4670 REGION_MAX
4671 };
4672 # 356 "src/common.h"
4673 extern unsigned int dispensed_tickets;
4674 extern unsigned int coin_count[8];
4675 extern unsigned int coinlockedout[8];
4676 # 368 "src/common.h"
4677 void showdisclaimer(void);
4678
4679
4680
4681 UINT8 *memory_region(int num);
4682 size_t memory_region_length(int num);
4683
4684
4685
4686 int new_memory_region(int num, size_t length, UINT32 flags);
4687 void free_memory_region(int num);
4688
4689
4690 void counters_load(int config_type, xml_data_node *parentnode);
4691 void counters_save(int config_type, xml_data_node *parentnode);
4692 void coin_counter_reset(void);
4693 void coin_counter_w(int num,int on);
4694 void coin_lockout_w(int num,int on);
4695 void coin_lockout_global_w(int on);
4696
4697
4698 extern size_t generic_nvram_size;
4699 extern UINT8 *generic_nvram;
4700 extern UINT16 *generic_nvram16;
4701 extern UINT32 *generic_nvram32;
4702 void nvram_handler_generic_0fill(mame_file *file, int read_or_write);
4703 void nvram_handler_generic_1fill(mame_file *file, int read_or_write);
4704 void nvram_handler_generic_randfill(mame_file *file, int read_or_write);
4705
4706
4707 mame_bitmap *bitmap_alloc(int width,int height);
4708 mame_bitmap *bitmap_alloc_depth(int width,int height,int depth);
4709 void bitmap_free(mame_bitmap *bitmap);
4710
4711
4712 void begin_resource_tracking(void);
4713 void end_resource_tracking(void);
4714 static __inline__ int get_resource_tag(void)
4715 {
4716 extern int resource_tracking_tag;
4717 return resource_tracking_tag;
4718 }
4719
4720
4721 void *auto_malloc(size_t size) __attribute__((malloc));
4722 char *auto_strdup(const char *str) __attribute__((malloc));
4723 mame_bitmap *auto_bitmap_alloc(int width,int height);
4724 mame_bitmap *auto_bitmap_alloc_depth(int width,int height,int depth);
4725 # 425 "src/common.h"
4726 void save_screen_snapshot_as(mame_file *fp, mame_bitmap *bitmap);
4727 void save_screen_snapshot(mame_bitmap *bitmap);
4728
4729
4730 void record_movie_toggle(void);
4731 void record_movie_stop(void);
4732 void record_movie_frame(mame_bitmap *bitmap);
4733
4734
4735 chd_file *get_disk_handle(int diskindex);
4736
4737
4738 int rom_load(const rom_entry *romp);
4739 const rom_entry *rom_first_region(const game_driver *drv);
4740 const rom_entry *rom_next_region(const rom_entry *romp);
4741 const rom_entry *rom_first_file(const rom_entry *romp);
4742 const rom_entry *rom_next_file(const rom_entry *romp);
4743 const rom_entry *rom_first_chunk(const rom_entry *romp);
4744 const rom_entry *rom_next_chunk(const rom_entry *romp);
4745 # 68 "src/driver.h" 2
4746
4747
4748 # 1 "src/cpuintrf.h" 1
4749 # 12 "src/cpuintrf.h"
4750
4751
4752
4753
4754
4755
4756
4757 # 1 "src/timer.h" 1
4758 # 13 "src/timer.h"
4759
4760 # 30 "src/timer.h"
4761 typedef INT64 subseconds_t;
4762 typedef INT32 seconds_t;
4763
4764 struct _mame_time
4765 {
4766 seconds_t seconds;
4767 subseconds_t subseconds;
4768 };
4769 typedef struct _mame_time mame_time;
4770
4771 extern mame_time time_zero;
4772 extern mame_time time_never;
4773
4774 extern subseconds_t subseconds_per_cycle[];
4775 extern UINT32 cycles_per_second[];
4776 # 55 "src/timer.h"
4777 extern double cycles_to_sec[];
4778 extern double sec_to_cycles[];
4779 # 74 "src/timer.h"
4780 typedef struct _mame_timer mame_timer;
4781
4782
4783
4784
4785
4786
4787
4788 void timer_init(void);
4789 void timer_free(void);
4790 int timer_count_anonymous(void);
4791
4792 mame_time mame_timer_next_fire_time(void);
4793 void mame_timer_set_global_time(mame_time newbase);
4794 mame_timer *_mame_timer_alloc(void (*callback)(int), const char *file, int line, const char *func);
4795 mame_timer *_mame_timer_alloc_ptr(void (*callback)(void *), void *param, const char *file, int line, const char *func);
4796 void mame_timer_adjust(mame_timer *which, mame_time duration, int param, mame_time period);
4797 void mame_timer_adjust_ptr(mame_timer *which, mame_time duration, mame_time period);
4798 void _mame_timer_pulse(mame_time period, int param, void (*callback)(int), const char *file, int line, const char *func);
4799 void _mame_timer_pulse_ptr(mame_time period, void *param, void (*callback)(void *), const char *file, int line, const char *func);
4800 void _mame_timer_set(mame_time duration, int param, void (*callback)(int), const char *file, int line, const char *func);
4801 void _mame_timer_set_ptr(mame_time duration, void *param, void (*callback)(void *), const char *file, int line, const char *func);
4802 void mame_timer_reset(mame_timer *which, mame_time duration);
4803 int mame_timer_enable(mame_timer *which, int enable);
4804 mame_time mame_timer_timeelapsed(mame_timer *which);
4805 mame_time mame_timer_timeleft(mame_timer *which);
4806 mame_time mame_timer_get_time(void);
4807 mame_time mame_timer_starttime(mame_timer *which);
4808 mame_time mame_timer_firetime(mame_timer *which);
4809 # 145 "src/timer.h"
4810 static __inline__ mame_time make_mame_time(seconds_t _secs, subseconds_t _subsecs)
4811 {
4812 mame_time result;
4813 result.seconds = _secs;
4814 result.subseconds = _subsecs;
4815 return result;
4816 }
4817
4818
4819
4820
4821
4822
4823 static __inline__ double mame_time_to_double(mame_time _time)
4824 {
4825 return (double)_time.seconds + ((double)(_time.subseconds) * (1.0 / (double)((subseconds_t)1000000000 * (subseconds_t)1000000000)));
4826 }
4827
4828
4829
4830
4831
4832
4833 static __inline__ mame_time double_to_mame_time(double _time)
4834 {
4835 mame_time abstime;
4836
4837
4838 if (_time >= (1.0e30))
4839 return time_never;
4840
4841
4842 abstime.seconds = (INT64)_time;
4843
4844
4845 _time -= (double)abstime.seconds;
4846 abstime.subseconds = ((subseconds_t)((_time) * (double)((subseconds_t)1000000000 * (subseconds_t)1000000000)));
4847 return abstime;
4848 }
4849
4850
4851
4852
4853
4854
4855 static __inline__ mame_time add_mame_times(mame_time _time1, mame_time _time2)
4856 {
4857 mame_time result;
4858
4859
4860 if (_time1.seconds >= ((seconds_t)1000000000) || _time2.seconds >= ((seconds_t)1000000000))
4861 return time_never;
4862
4863
4864 result.subseconds = _time1.subseconds + _time2.subseconds;
4865 result.seconds = _time1.seconds + _time2.seconds;
4866
4867
4868 if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000))
4869 {
4870 result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4871 result.seconds++;
4872 }
4873 return result;
4874 }
4875
4876
4877
4878
4879
4880
4881 static __inline__ mame_time add_subseconds_to_mame_time(mame_time _time1, subseconds_t _subseconds)
4882 {
4883 mame_time result;
4884
4885
4886 if (_time1.seconds >= ((seconds_t)1000000000))
4887 return time_never;
4888
4889
4890 result.subseconds = _time1.subseconds + _subseconds;
4891 result.seconds = _time1.seconds;
4892
4893
4894 if (result.subseconds >= ((subseconds_t)1000000000 * (subseconds_t)1000000000))
4895 {
4896 result.subseconds -= ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4897 result.seconds++;
4898 }
4899 return result;
4900 }
4901
4902
4903
4904
4905
4906
4907 static __inline__ mame_time sub_mame_times(mame_time _time1, mame_time _time2)
4908 {
4909 mame_time result;
4910
4911
4912 if (_time1.seconds >= ((seconds_t)1000000000))
4913 return time_never;
4914
4915
4916 result.subseconds = _time1.subseconds - _time2.subseconds;
4917 result.seconds = _time1.seconds - _time2.seconds;
4918
4919
4920 if (result.subseconds < 0)
4921 {
4922 result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4923 result.seconds--;
4924 }
4925 return result;
4926 }
4927
4928
4929
4930
4931
4932
4933 static __inline__ mame_time sub_subseconds_from_mame_time(mame_time _time1, subseconds_t _subseconds)
4934 {
4935 mame_time result;
4936
4937
4938 if (_time1.seconds >= ((seconds_t)1000000000))
4939 return time_never;
4940
4941
4942 result.subseconds = _time1.subseconds - _subseconds;
4943 result.seconds = _time1.seconds;
4944
4945
4946 if (result.subseconds < 0)
4947 {
4948 result.subseconds += ((subseconds_t)1000000000 * (subseconds_t)1000000000);
4949 result.seconds--;
4950 }
4951 return result;
4952 }
4953
4954
4955
4956
4957
4958
4959 static __inline__ int compare_mame_times(mame_time _time1, mame_time _time2)
4960 {
4961 if (_time1.seconds > _time2.seconds)
4962 return 1;
4963 if (_time1.seconds < _time2.seconds)
4964 return -1;
4965 if (_time1.subseconds > _time2.subseconds)
4966 return 1;
4967 if (_time1.subseconds < _time2.subseconds)
4968 return -1;
4969 return 0;
4970 }
4971 # 20 "src/cpuintrf.h" 2
4972 # 29 "src/cpuintrf.h"
4973 enum
4974 {
4975 CPU_DUMMY,
4976 CPU_Z80,
4977 CPU_Z180,
4978 CPU_8080,
4979 CPU_8085A,
4980 CPU_M6502,
4981 CPU_M65C02,
4982 CPU_M65SC02,
4983 CPU_M65CE02,
4984 CPU_M6509,
4985 CPU_M6510,
4986 CPU_M6510T,
4987 CPU_M7501,
4988 CPU_M8502,
4989 CPU_N2A03,
4990 CPU_DECO16,
4991 CPU_M4510,
4992 CPU_H6280,
4993 CPU_I86,
4994 CPU_I88,
4995 CPU_I186,
4996 CPU_I188,
4997 CPU_I286,
4998 CPU_V20,
4999 CPU_V30,
5000 CPU_V33,
5001 CPU_V60,
5002 CPU_V70,
5003 CPU_I8035,
5004 CPU_I8039,
5005 CPU_I8048,
5006 CPU_N7751,
5007 CPU_I8X41,
5008 CPU_I8051,
5009 CPU_I8052,
5010 CPU_I8751,
5011 CPU_I8752,
5012 CPU_M6800,
5013 CPU_M6801,
5014 CPU_M6802,
5015 CPU_M6803,
5016 CPU_M6808,
5017 CPU_HD63701,
5018 CPU_NSC8105,
5019 CPU_M6805,
5020 CPU_M68705,
5021 CPU_HD63705,
5022 CPU_HD6309,
5023 CPU_M6809,
5024 CPU_M6809E,
5025 CPU_KONAMI,
5026 CPU_M68000,
5027 CPU_M68008,
5028 CPU_M68010,
5029 CPU_M68EC020,
5030 CPU_M68020,
5031 CPU_M68040,
5032 CPU_T11,
5033 CPU_S2650,
5034 CPU_TMS34010,
5035 CPU_TMS34020,
5036 CPU_TI990_10,
5037 CPU_TMS9900,
5038 CPU_TMS9940,
5039 CPU_TMS9980,
5040 CPU_TMS9985,
5041 CPU_TMS9989,
5042 CPU_TMS9995,
5043 CPU_TMS99100,
5044 CPU_TMS99105A,
5045 CPU_TMS99110A,
5046 CPU_Z8000,
5047 CPU_TMS32010,
5048 CPU_TMS32025,
5049 CPU_TMS32026,
5050 CPU_TMS32031,
5051 CPU_CCPU,
5052 CPU_ADSP2100,
5053 CPU_ADSP2101,
5054 CPU_ADSP2104,
5055 CPU_ADSP2105,
5056 CPU_ADSP2115,
5057 CPU_ADSP2181,
5058 CPU_PSXCPU,
5059 CPU_ASAP,
5060 CPU_UPD7810,
5061 CPU_UPD7807,
5062 CPU_JAGUARGPU,
5063 CPU_JAGUARDSP,
5064 CPU_R3000BE,
5065 CPU_R3000LE,
5066 CPU_R4600BE,
5067 CPU_R4600LE,
5068 CPU_R4700BE,
5069 CPU_R4700LE,
5070 CPU_R5000BE,
5071 CPU_R5000LE,
5072 CPU_QED5271BE,
5073 CPU_QED5271LE,
5074 CPU_RM7000BE,
5075 CPU_RM7000LE,
5076 CPU_ARM,
5077 CPU_ARM7,
5078 CPU_SH2,
5079 CPU_DSP32C,
5080 CPU_PIC16C54,
5081 CPU_PIC16C55,
5082 CPU_PIC16C56,
5083 CPU_PIC16C57,
5084 CPU_PIC16C58,
5085 CPU_G65816,
5086 CPU_SPC700,
5087 CPU_E116T,
5088 CPU_E116XT,
5089 CPU_E116XS,
5090 CPU_E116XSR,
5091 CPU_E132N,
5092 CPU_E132T,
5093 CPU_E132XN,
5094 CPU_E132XT,
5095 CPU_E132XS,
5096 CPU_E132XSR,
5097 CPU_GMS30C2116,
5098 CPU_GMS30C2132,
5099 CPU_GMS30C2216,
5100 CPU_GMS30C2232,
5101 CPU_I386,
5102 CPU_I486,
5103 CPU_PENTIUM,
5104 CPU_MEDIAGX,
5105 CPU_I960,
5106 CPU_H83002,
5107 CPU_V810,
5108 CPU_M37710,
5109 CPU_PPC403,
5110 CPU_PPC602,
5111 CPU_PPC603,
5112 CPU_SE3208,
5113 CPU_MC68HC11,
5114 CPU_ADSP21062,
5115 CPU_DSP56156,
5116 # 189 "src/cpuintrf.h"
5117 CPU_COUNT
5118 };
5119 # 200 "src/cpuintrf.h"
5120 enum
5121 {
5122
5123 CLEAR_LINE = 0,
5124 ASSERT_LINE,
5125 HOLD_LINE,
5126 PULSE_LINE,
5127
5128
5129 INTERNAL_CLEAR_LINE = 100 + CLEAR_LINE,
5130 INTERNAL_ASSERT_LINE = 100 + ASSERT_LINE,
5131
5132
5133 MAX_INPUT_LINES = 32+3,
5134 INPUT_LINE_IRQ0 = 0,
5135 INPUT_LINE_IRQ1 = 1,
5136 INPUT_LINE_IRQ2 = 2,
5137 INPUT_LINE_IRQ3 = 3,
5138 INPUT_LINE_IRQ4 = 4,
5139 INPUT_LINE_IRQ5 = 5,
5140 INPUT_LINE_IRQ6 = 6,
5141 INPUT_LINE_IRQ7 = 7,
5142 INPUT_LINE_IRQ8 = 8,
5143 INPUT_LINE_IRQ9 = 9,
5144 INPUT_LINE_NMI = MAX_INPUT_LINES - 3,
5145
5146
5147 INPUT_LINE_RESET = MAX_INPUT_LINES - 2,
5148 INPUT_LINE_HALT = MAX_INPUT_LINES - 1,
5149
5150
5151 MAX_OUTPUT_LINES = 32
5152 };
5153 # 242 "src/cpuintrf.h"
5154 enum
5155 {
5156 MAX_REGS = 256
5157 };
5158
5159
5160 enum
5161 {
5162
5163 CPUINFO_INT_FIRST = 0x00000,
5164
5165 CPUINFO_INT_CONTEXT_SIZE = CPUINFO_INT_FIRST,
5166 CPUINFO_INT_INPUT_LINES,
5167 CPUINFO_INT_OUTPUT_LINES,
5168 CPUINFO_INT_DEFAULT_IRQ_VECTOR,
5169 CPUINFO_INT_ENDIANNESS,
5170 CPUINFO_INT_CLOCK_DIVIDER,
5171 CPUINFO_INT_MIN_INSTRUCTION_BYTES,
5172 CPUINFO_INT_MAX_INSTRUCTION_BYTES,
5173 CPUINFO_INT_MIN_CYCLES,
5174 CPUINFO_INT_MAX_CYCLES,
5175
5176 CPUINFO_INT_DATABUS_WIDTH,
5177 CPUINFO_INT_DATABUS_WIDTH_LAST = CPUINFO_INT_DATABUS_WIDTH + 3 - 1,
5178 CPUINFO_INT_ADDRBUS_WIDTH,
5179 CPUINFO_INT_ADDRBUS_WIDTH_LAST = CPUINFO_INT_ADDRBUS_WIDTH + 3 - 1,
5180 CPUINFO_INT_ADDRBUS_SHIFT,
5181 CPUINFO_INT_ADDRBUS_SHIFT_LAST = CPUINFO_INT_ADDRBUS_SHIFT + 3 - 1,
5182 CPUINFO_INT_LOGADDR_WIDTH,
5183 CPUINFO_INT_LOGADDR_WIDTH_LAST = CPUINFO_INT_LOGADDR_WIDTH + 3 - 1,
5184 CPUINFO_INT_PAGE_SHIFT,
5185 CPUINFO_INT_PAGE_SHIFT_LAST = CPUINFO_INT_PAGE_SHIFT + 3 - 1,
5186
5187 CPUINFO_INT_SP,
5188 CPUINFO_INT_PC,
5189 CPUINFO_INT_PREVIOUSPC,
5190 CPUINFO_INT_INPUT_STATE,
5191 CPUINFO_INT_INPUT_STATE_LAST = CPUINFO_INT_INPUT_STATE + MAX_INPUT_LINES - 1,
5192 CPUINFO_INT_OUTPUT_STATE,
5193 CPUINFO_INT_OUTPUT_STATE_LAST = CPUINFO_INT_OUTPUT_STATE + MAX_OUTPUT_LINES - 1,
5194 CPUINFO_INT_REGISTER,
5195 CPUINFO_INT_REGISTER_LAST = CPUINFO_INT_REGISTER + MAX_REGS - 1,
5196
5197 CPUINFO_INT_CPU_SPECIFIC = 0x08000,
5198
5199
5200 CPUINFO_PTR_FIRST = 0x10000,
5201
5202 CPUINFO_PTR_SET_INFO = CPUINFO_PTR_FIRST,
5203 CPUINFO_PTR_GET_CONTEXT,
5204 CPUINFO_PTR_SET_CONTEXT,
5205 CPUINFO_PTR_INIT,
5206 CPUINFO_PTR_RESET,
5207 CPUINFO_PTR_EXIT,
5208 CPUINFO_PTR_EXECUTE,
5209 CPUINFO_PTR_BURN,
5210 CPUINFO_PTR_DISASSEMBLE,
5211 CPUINFO_PTR_DISASSEMBLE_NEW,
5212 CPUINFO_PTR_TRANSLATE,
5213 CPUINFO_PTR_READ,
5214 CPUINFO_PTR_WRITE,
5215 CPUINFO_PTR_READOP,
5216 CPUINFO_PTR_DEBUG_SETUP_COMMANDS,
5217 CPUINFO_PTR_IRQ_CALLBACK,
5218 CPUINFO_PTR_INSTRUCTION_COUNTER,
5219 CPUINFO_PTR_REGISTER_LAYOUT,
5220 CPUINFO_PTR_WINDOW_LAYOUT,
5221 CPUINFO_PTR_INTERNAL_MEMORY_MAP,
5222 CPUINFO_PTR_INTERNAL_MEMORY_MAP_LAST = CPUINFO_PTR_INTERNAL_MEMORY_MAP + 3 - 1,
5223 CPUINFO_PTR_DEBUG_REGISTER_LIST,
5224
5225 CPUINFO_PTR_CPU_SPECIFIC = 0x18000,
5226
5227
5228 CPUINFO_STR_FIRST = 0x20000,
5229
5230 CPUINFO_STR_NAME = CPUINFO_STR_FIRST,
5231 CPUINFO_STR_CORE_FAMILY,
5232 CPUINFO_STR_CORE_VERSION,
5233 CPUINFO_STR_CORE_FILE,
5234 CPUINFO_STR_CORE_CREDITS,
5235 CPUINFO_STR_FLAGS,
5236 CPUINFO_STR_REGISTER,
5237 CPUINFO_STR_REGISTER_LAST = CPUINFO_STR_REGISTER + MAX_REGS - 1,
5238
5239 CPUINFO_STR_CPU_SPECIFIC = 0x28000
5240 };
5241
5242
5243 union cpuinfo
5244 {
5245 INT64 i;
5246 void * p;
5247 genf * f;
5248 char * s;
5249
5250 void (*setinfo)(UINT32 state, union cpuinfo *info);
5251 void (*getcontext)(void *context);
5252 void (*setcontext)(void *context);
5253 void (*init)(void);
5254 void (*reset)(void *param);
5255 void (*exit)(void);
5256 int (*execute)(int cycles);
5257 void (*burn)(int cycles);
5258 offs_t (*disassemble)(char *buffer, offs_t pc);
5259 offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5260 int (*irqcallback)(int state);
5261 int (*translate)(int space, offs_t *address);
5262 int (*read)(int space, UINT32 offset, int size, UINT64 *value);
5263 int (*write)(int space, UINT32 offset, int size, UINT64 value);
5264 int (*readop)(UINT32 offset, int size, UINT64 *value);
5265 void (*setup_commands)(void);
5266 int * icount;
5267 construct_map_t internal_map;
5268 };
5269
5270
5271
5272 enum
5273 {
5274
5275
5276
5277 REG_PREVIOUSPC = CPUINFO_INT_PREVIOUSPC - CPUINFO_INT_REGISTER,
5278
5279
5280
5281 REG_PC = CPUINFO_INT_PC - CPUINFO_INT_REGISTER,
5282
5283
5284
5285 REG_SP = CPUINFO_INT_SP - CPUINFO_INT_REGISTER
5286 };
5287
5288
5289
5290 enum
5291 {
5292 CPU_IS_LE = 0,
5293 CPU_IS_BE
5294 };
5295 # 402 "src/cpuintrf.h"
5296 struct _cpu_interface
5297 {
5298
5299 void (*get_info)(UINT32 state, union cpuinfo *info);
5300 void (*set_info)(UINT32 state, union cpuinfo *info);
5301 void (*get_context)(void *buffer);
5302 void (*set_context)(void *buffer);
5303 void (*init)(void);
5304 void (*reset)(void *param);
5305 void (*exit)(void);
5306 int (*execute)(int cycles);
5307 void (*burn)(int cycles);
5308 offs_t (*disassemble)(char *buffer, offs_t pc);
5309 offs_t (*disassemble_new)(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5310 int (*translate)(int space, offs_t *address);
5311
5312
5313 size_t context_size;
5314 INT8 address_shift;
5315 int * icount;
5316 };
5317 typedef struct _cpu_interface cpu_interface;
5318 # 434 "src/cpuintrf.h"
5319 int cpuintrf_init(void);
5320
5321
5322 int cpuintrf_init_cpu(int cpunum, int cputype);
5323
5324
5325 void cpuintrf_exit_cpu(int cpunum);
5326
5327
5328 void cpuintrf_push_context(int cpunum);
5329
5330
5331 void cpuintrf_pop_context(void);
5332
5333
5334 char *cpuintrf_temp_str(void);
5335
5336
5337 void cpuintrf_set_dasm_override(offs_t (*dasm_override)(int cpunum, char *buffer, offs_t pc));
5338 # 463 "src/cpuintrf.h"
5339 INT64 activecpu_get_info_int(UINT32 state);
5340 void *activecpu_get_info_ptr(UINT32 state);
5341 genf *activecpu_get_info_fct(UINT32 state);
5342 const char *activecpu_get_info_string(UINT32 state);
5343
5344
5345 void activecpu_set_info_int(UINT32 state, INT64 data);
5346 void activecpu_set_info_ptr(UINT32 state, void *data);
5347 void activecpu_set_info_fct(UINT32 state, genf *data);
5348
5349
5350 void activecpu_adjust_icount(int delta);
5351
5352
5353 int activecpu_get_icount(void);
5354
5355
5356 void activecpu_reset_banking(void);
5357
5358
5359 void activecpu_set_input_line(int irqline, int state);
5360
5361
5362 offs_t activecpu_get_physical_pc_byte(void);
5363
5364
5365 void activecpu_set_opbase(offs_t val);
5366
5367
5368 offs_t activecpu_dasm(char *buffer, offs_t pc);
5369 offs_t activecpu_dasm_new(char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5370
5371
5372 const char *activecpu_flags(void);
5373
5374
5375 const char *activecpu_dump_state(void);
5376 # 542 "src/cpuintrf.h"
5377 INT64 cpunum_get_info_int(int cpunum, UINT32 state);
5378 void *cpunum_get_info_ptr(int cpunum, UINT32 state);
5379 genf *cpunum_get_info_fct(int cpunum, UINT32 state);
5380 const char *cpunum_get_info_string(int cpunum, UINT32 state);
5381
5382
5383 void cpunum_set_info_int(int cpunum, UINT32 state, INT64 data);
5384 void cpunum_set_info_ptr(int cpunum, UINT32 state, void *data);
5385 void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data);
5386
5387
5388 int cpunum_execute(int cpunum, int cycles);
5389
5390
5391 void cpunum_reset(int cpunum, void *param, int (*irqack)(int));
5392
5393
5394 UINT8 cpunum_read_byte(int cpunum, offs_t address);
5395
5396
5397 void cpunum_write_byte(int cpunum, offs_t address, UINT8 data);
5398
5399
5400
5401 void *cpunum_get_context_ptr(int cpunum);
5402
5403
5404 offs_t cpunum_get_physical_pc_byte(int cpunum);
5405
5406
5407 void cpunum_set_opbase(int cpunum, offs_t val);
5408
5409
5410 offs_t cpunum_dasm(int cpunum, char *buffer, offs_t pc);
5411 offs_t cpunum_dasm_new(int cpunum, char *buffer, offs_t pc, UINT8 *oprom, UINT8 *opram, int bytes);
5412
5413
5414 const char *cpunum_dump_state(int cpunum);
5415 # 622 "src/cpuintrf.h"
5416 INT64 cputype_get_info_int(int cputype, UINT32 state);
5417 void *cputype_get_info_ptr(int cputype, UINT32 state);
5418 genf *cputype_get_info_fct(int cputype, UINT32 state);
5419 const char *cputype_get_info_string(int cputype, UINT32 state);
5420 # 660 "src/cpuintrf.h"
5421 void cpu_dump_states(void);
5422 # 682 "src/cpuintrf.h"
5423 static __inline__ const cpu_interface *cputype_get_interface(int cputype)
5424 {
5425 extern cpu_interface cpuintrf[];
5426 return &cpuintrf[cputype];
5427 }
5428
5429
5430
5431 static __inline__ int cpu_getactivecpu(void)
5432 {
5433 extern int activecpu;
5434 return activecpu;
5435 }
5436
5437
5438
5439 static __inline__ int cpu_getexecutingcpu(void)
5440 {
5441 extern int executingcpu;
5442 return executingcpu;
5443 }
5444
5445
5446
5447 static __inline__ int cpu_gettotalcpu(void)
5448 {
5449 extern int totalcpu;
5450 return totalcpu;
5451 }
5452 # 71 "src/driver.h" 2
5453 # 1 "src/cpuexec.h" 1
5454 # 12 "src/cpuexec.h"
5455
5456 # 29 "src/cpuexec.h"
5457 struct _cpu_config
5458 {
5459 int cpu_type;
5460 int cpu_flags;
5461 int cpu_clock;
5462 construct_map_t construct_map[3][2];
5463 void (*vblank_interrupt)(void);
5464 int vblank_interrupts_per_frame;
5465 void (*timed_interrupt)(void);
5466 double timed_interrupt_period;
5467 void * reset_param;
5468 const char *tag;
5469 };
5470 typedef struct _cpu_config cpu_config;
5471 # 52 "src/cpuexec.h"
5472 enum
5473 {
5474
5475
5476 CPU_DISABLE = 0x0001
5477 };
5478 # 69 "src/cpuexec.h"
5479 int cpu_init(void);
5480
5481
5482 void cpu_run(void);
5483
5484
5485 void cpu_exit(void);
5486
5487
5488 void cpu_pause(int pause);
5489
5490
5491 void machine_reset(void);
5492 # 92 "src/cpuexec.h"
5493 enum
5494 {
5495 LOADSAVE_NONE,
5496 LOADSAVE_SAVE,
5497 LOADSAVE_SAVE_AND_EXIT,
5498 LOADSAVE_LOAD,
5499 LOADSAVE_LOAD_POSTRESET
5500 };
5501 void cpu_loadsave_schedule(int type, char id);
5502 void cpu_loadsave_schedule_file(int type, const char *name);
5503 void cpu_loadsave_reset(void);
5504 void cpu_loadsave_warn(const char *msg);
5505 # 114 "src/cpuexec.h"
5506 void watchdog_reset_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5507 UINT8 watchdog_reset_r(__attribute__((__unused__)) offs_t offset);
5508
5509
5510 void watchdog_reset16_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5511 UINT16 watchdog_reset16_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5512
5513
5514 void watchdog_reset32_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask);
5515 UINT32 watchdog_reset32_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask);
5516
5517
5518
5519 void watchdog_enable(int enable);
5520 # 138 "src/cpuexec.h"
5521 enum
5522 {
5523 SUSPEND_REASON_HALT = 0x0001,
5524 SUSPEND_REASON_RESET = 0x0002,
5525 SUSPEND_REASON_SPIN = 0x0004,
5526 SUSPEND_REASON_TRIGGER = 0x0008,
5527 SUSPEND_REASON_DISABLE = 0x0010,
5528 SUSPEND_ANY_REASON = ~0
5529 };
5530
5531
5532 void cpunum_suspend(int cpunum, int reason, int eatcycles);
5533
5534
5535 void cpunum_resume(int cpunum, int reason);
5536
5537
5538 int cpunum_is_suspended(int cpunum, int reason);
5539
5540
5541 void activecpu_abort_timeslice(void);
5542
5543
5544 mame_time cpunum_get_localtime(int cpunum);
5545
5546
5547
5548
5549 int cpunum_get_clock(int cpunum);
5550
5551
5552 void cpunum_set_clock(int cpunum, int clock);
5553
5554
5555 double cpunum_get_clockscale(int cpunum);
5556
5557
5558 void cpunum_set_clockscale(int cpunum, double clockscale);
5559
5560
5561 void cpu_boost_interleave(double timeslice_time, double boost_duration);
5562 # 189 "src/cpuexec.h"
5563 int cycles_currently_ran(void);
5564
5565
5566 int cycles_left_to_run(void);
5567
5568
5569 UINT32 activecpu_gettotalcycles(void);
5570 UINT64 activecpu_gettotalcycles64(void);
5571
5572
5573 UINT32 cpunum_gettotalcycles(int cpunum);
5574 UINT64 cpunum_gettotalcycles64(int cpunum);
5575
5576
5577 int activecpu_geticount(void);
5578
5579
5580 void activecpu_eat_cycles(int cycles);
5581
5582
5583 int cpu_scalebyfcount(int value);
5584 # 220 "src/cpuexec.h"
5585 void cpu_compute_scanline_timing(void);
5586
5587
5588 int cpu_getcurrentframe(void);
5589
5590
5591 int cpu_getscanline(void);
5592
5593
5594 mame_time cpu_getscanlinetime_mt(int scanline);
5595 double cpu_getscanlinetime(int scanline);
5596
5597
5598 mame_time cpu_getscanlineperiod_mt(void);
5599 double cpu_getscanlineperiod(void);
5600
5601
5602 int cpu_gethorzbeampos(void);
5603
5604
5605 int cpu_getvblank(void);
5606 # 251 "src/cpuexec.h"
5607 void cpu_trigger(int trigger);
5608
5609
5610 void cpu_triggertime(double duration, int trigger);
5611
5612
5613 void cpu_triggerint(int cpunum);
5614
5615
5616 void cpu_spinuntil_trigger(int trigger);
5617
5618
5619 void cpunum_spinuntil_trigger( int cpunum, int trigger );
5620
5621
5622 void cpu_yielduntil_trigger(int trigger);
5623
5624
5625 void cpu_spinuntil_int(void);
5626
5627
5628 void cpu_yielduntil_int(void);
5629
5630
5631 void cpu_spin(void);
5632
5633
5634 void cpu_yield(void);
5635
5636
5637 void cpu_spinuntil_time(double duration);
5638
5639
5640 void cpu_yielduntil_time(double duration);
5641 # 299 "src/cpuexec.h"
5642 int cpu_getiloops(void);
5643 # 72 "src/driver.h" 2
5644 # 1 "src/cpuint.h" 1
5645 # 12 "src/cpuint.h"
5646
5647 # 28 "src/cpuint.h"
5648 int cpuint_init(void);
5649
5650 void cpuint_reset_cpu(int cpunum);
5651
5652 extern int (*cpu_irq_callbacks[])(int);
5653 # 49 "src/cpuint.h"
5654 void cpunum_set_input_line(int cpunum, int line, int state);
5655
5656
5657 void cpunum_set_input_line_vector(int cpunum, int irqline, int vector);
5658
5659
5660 void cpunum_set_input_line_and_vector(int cpunum, int line, int state, int vector);
5661
5662
5663 void cpu_set_irq_callback(int cpunum, int (*callback)(int irqline));
5664 # 68 "src/cpuint.h"
5665 void nmi_line_pulse(void);
5666 void nmi_line_assert(void);
5667
5668 void irq0_line_hold(void);
5669 void irq0_line_pulse(void);
5670 void irq0_line_assert(void);
5671
5672 void irq1_line_hold(void);
5673 void irq1_line_pulse(void);
5674 void irq1_line_assert(void);
5675
5676 void irq2_line_hold(void);
5677 void irq2_line_pulse(void);
5678 void irq2_line_assert(void);
5679
5680 void irq3_line_hold(void);
5681 void irq3_line_pulse(void);
5682 void irq3_line_assert(void);
5683
5684 void irq4_line_hold(void);
5685 void irq4_line_pulse(void);
5686 void irq4_line_assert(void);
5687
5688 void irq5_line_hold(void);
5689 void irq5_line_pulse(void);
5690 void irq5_line_assert(void);
5691
5692 void irq6_line_hold(void);
5693 void irq6_line_pulse(void);
5694 void irq6_line_assert(void);
5695
5696 void irq7_line_hold(void);
5697 void irq7_line_pulse(void);
5698 void irq7_line_assert(void);
5699 # 118 "src/cpuint.h"
5700 void cpu_interrupt_enable(int cpu,int enabled);
5701 void interrupt_enable_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5702 void interrupt_vector_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5703 UINT8 interrupt_enable_r(__attribute__((__unused__)) offs_t offset);
5704 # 73 "src/driver.h" 2
5705 # 1 "src/sndintrf.h" 1
5706 # 12 "src/sndintrf.h"
5707
5708
5709
5710
5711
5712 # 1 "src/streams.h" 1
5713 # 15 "src/streams.h"
5714 typedef INT32 stream_sample_t;
5715 typedef struct _sound_stream sound_stream;
5716
5717 typedef void (*stream_callback)(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
5718
5719 int streams_init(void);
5720 void streams_set_tag(void *streamtag);
5721 void streams_frame_update(void);
5722
5723
5724 sound_stream *stream_create(int inputs, int outputs, int sample_rate, void *param, stream_callback callback);
5725 void stream_set_input(sound_stream *stream, int index, sound_stream *input_stream, int output_index, float gain);
5726 void stream_update(sound_stream *stream, int min_interval);
5727 stream_sample_t *stream_consume_output(sound_stream *stream, int output, int samples);
5728
5729
5730 sound_stream *stream_find_by_tag(void *streamtag, int streamindex);
5731 int stream_get_inputs(sound_stream *stream);
5732 int stream_get_outputs(sound_stream *stream);
5733 void stream_set_input_gain(sound_stream *stream, int input, float gain);
5734 void stream_set_output_gain(sound_stream *stream, int output, float gain);
5735 void stream_set_sample_rate(sound_stream *stream, int sample_rate);
5736 # 18 "src/sndintrf.h" 2
5737 # 27 "src/sndintrf.h"
5738 enum
5739 {
5740 SOUND_DUMMY,
5741 SOUND_CUSTOM,
5742 SOUND_SAMPLES,
5743 SOUND_DAC,
5744 SOUND_DMADAC,
5745 SOUND_DISCRETE,
5746 SOUND_AY8910,
5747 SOUND_YM2203,
5748 SOUND_YM2151,
5749 SOUND_YM2608,
5750 SOUND_YM2610,
5751 SOUND_YM2610B,
5752 SOUND_YM2612,
5753 SOUND_YM3438,
5754 SOUND_YM2413,
5755 SOUND_YM3812,
5756 SOUND_YM3526,
5757 SOUND_YMZ280B,
5758 SOUND_Y8950,
5759 SOUND_SN76477,
5760 SOUND_SN76496,
5761 SOUND_POKEY,
5762 SOUND_NES,
5763 SOUND_ASTROCADE,
5764 SOUND_NAMCO,
5765 SOUND_NAMCO_15XX,
5766 SOUND_NAMCO_CUS30,
5767 SOUND_NAMCO_52XX,
5768 SOUND_NAMCO_54XX,
5769 SOUND_NAMCO_63701X,
5770 SOUND_NAMCONA,
5771 SOUND_TMS36XX,
5772 SOUND_TMS5110,
5773 SOUND_TMS5220,
5774 SOUND_VLM5030,
5775 SOUND_OKIM6295,
5776 SOUND_MSM5205,
5777 SOUND_MSM5232,
5778 SOUND_UPD7759,
5779 SOUND_HC55516,
5780 SOUND_K005289,
5781 SOUND_K007232,
5782 SOUND_K051649,
5783 SOUND_K053260,
5784 SOUND_K054539,
5785 SOUND_SEGAPCM,
5786 SOUND_RF5C68,
5787 SOUND_CEM3394,
5788 SOUND_C140,
5789 SOUND_QSOUND,
5790 SOUND_SAA1099,
5791 SOUND_IREMGA20,
5792 SOUND_ES5505,
5793 SOUND_ES5506,
5794 SOUND_BSMT2000,
5795 SOUND_YMF262,
5796 SOUND_YMF278B,
5797 SOUND_GAELCO_CG1V,
5798 SOUND_GAELCO_GAE1,
5799 SOUND_X1_010,
5800 SOUND_MULTIPCM,
5801 SOUND_C6280,
5802 SOUND_TIA,
5803 SOUND_SP0250,
5804 SOUND_SCSP,
5805 SOUND_PSXSPU,
5806 SOUND_YMF271,
5807 SOUND_CDDA,
5808 SOUND_ICS2115,
5809 SOUND_ST0016,
5810 SOUND_C352,
5811 SOUND_VRENDER0,
5812 SOUND_VOTRAX,
5813 SOUND_ES8712,
5814 SOUND_RF5C400,
5815 # 115 "src/sndintrf.h"
5816 SOUND_FILTER_VOLUME,
5817 SOUND_FILTER_RC,
5818 SOUND_FILTER_LOWPASS,
5819
5820 SOUND_COUNT
5821 };
5822 # 130 "src/sndintrf.h"
5823 enum
5824 {
5825 MAX_ROUTES = 16
5826 };
5827
5828
5829 enum
5830 {
5831
5832 SNDINFO_INT_FIRST = 0x00000,
5833
5834 SNDINFO_INT_CORE_SPECIFIC = 0x08000,
5835
5836
5837 SNDINFO_PTR_FIRST = 0x10000,
5838
5839 SNDINFO_PTR_SET_INFO = SNDINFO_PTR_FIRST,
5840 SNDINFO_PTR_START,
5841 SNDINFO_PTR_STOP,
5842 SNDINFO_PTR_RESET,
5843
5844 SNDINFO_PTR_CORE_SPECIFIC = 0x18000,
5845
5846
5847 SNDINFO_STR_FIRST = 0x20000,
5848
5849 SNDINFO_STR_NAME = SNDINFO_STR_FIRST,
5850 SNDINFO_STR_CORE_FAMILY,
5851 SNDINFO_STR_CORE_VERSION,
5852 SNDINFO_STR_CORE_FILE,
5853 SNDINFO_STR_CORE_CREDITS,
5854
5855 SNDINFO_STR_CORE_SPECIFIC = 0x28000
5856 };
5857
5858
5859 union sndinfo
5860 {
5861 INT64 i;
5862 void * p;
5863 genf * f;
5864 const char *s;
5865
5866 void (*set_info)(void *token, UINT32 state, union sndinfo *info);
5867 void * (*start)(int index, int clock, const void *config);
5868 void (*stop)(void *token);
5869 void (*reset)(void *token);
5870 };
5871 # 187 "src/sndintrf.h"
5872 struct _sound_interface
5873 {
5874
5875 void (*get_info)(void *token, UINT32 state, union sndinfo *info);
5876 void (*set_info)(void *token, UINT32 state, union sndinfo *info);
5877 void * (*start)(int index, int clock, const void *config);
5878 void (*stop)(void *token);
5879 void (*reset)(void *token);
5880 };
5881 typedef struct _sound_interface sound_interface;
5882 # 208 "src/sndintrf.h"
5883 struct _sound_route
5884 {
5885 int output;
5886 const char *target;
5887 float gain;
5888 };
5889 typedef struct _sound_route sound_route;
5890
5891
5892 struct _sound_config
5893 {
5894 int sound_type;
5895 int clock;
5896 const void *config;
5897 const char *tag;
5898 int routes;
5899 sound_route route[MAX_ROUTES];
5900 };
5901 typedef struct _sound_config sound_config;
5902
5903
5904 struct _speaker_config
5905 {
5906 const char *tag;
5907 float x, y, z;
5908 };
5909 typedef struct _speaker_config speaker_config;
5910 # 245 "src/sndintrf.h"
5911 INT64 sndnum_get_info_int(int sndnum, UINT32 state);
5912 void *sndnum_get_info_ptr(int sndnum, UINT32 state);
5913 genf *sndnum_get_info_fct(int sndnum, UINT32 state);
5914 const char *sndnum_get_info_string(int sndnum, UINT32 state);
5915
5916
5917 void sndnum_set_info_int(int sndnum, UINT32 state, INT64 data);
5918 void sndnum_set_info_ptr(int sndnum, UINT32 state, void *data);
5919 void sndnum_set_info_fct(int sndnum, UINT32 state, genf *data);
5920 # 262 "src/sndintrf.h"
5921 int sndnum_clock(int sndnum);
5922 void *sndnum_token(int sndnum);
5923 # 274 "src/sndintrf.h"
5924 INT64 sndti_get_info_int(int sndtype, int sndindex, UINT32 state);
5925 void *sndti_get_info_ptr(int sndtype, int sndindex, UINT32 state);
5926 genf *sndti_get_info_fct(int sndtype, int sndindex, UINT32 state);
5927 const char *sndti_get_info_string(int sndtype, int sndindex, UINT32 state);
5928
5929
5930 void sndti_set_info_int(int sndtype, int sndindex, UINT32 state, INT64 data);
5931 void sndti_set_info_ptr(int sndtype, int sndindex, UINT32 state, void *data);
5932 void sndti_set_info_fct(int sndtype, int sndindex, UINT32 state, genf *data);
5933 # 291 "src/sndintrf.h"
5934 int sndti_clock(int sndtype, int sndindex);
5935 void *sndti_token(int sndtype, int sndindex);
5936 # 303 "src/sndintrf.h"
5937 INT64 sndtype_get_info_int(int sndtype, UINT32 state);
5938 void *sndtype_get_info_ptr(int sndtype, UINT32 state);
5939 genf *sndtype_get_info_fct(int sndtype, UINT32 state);
5940 const char *sndtype_get_info_string(int sndtype, UINT32 state);
5941 # 322 "src/sndintrf.h"
5942 void sndintrf_init(void);
5943 int sound_init(void);
5944 void sound_exit(void);
5945 void sound_reset(void);
5946 void sound_frame_update(void);
5947 void sound_register_token(void *token);
5948 int sound_scalebufferpos(int value);
5949
5950 void sndintrf_load(int config_type, xml_data_node *parentnode);
5951 void sndintrf_save(int config_type, xml_data_node *parentnode);
5952 # 341 "src/sndintrf.h"
5953 int sndti_to_sndnum(int type, int index);
5954
5955
5956 void sound_global_enable(int enable);
5957
5958
5959 void sndti_reset(int type, int index);
5960
5961
5962 void sndti_set_output_gain(int type, int index, int output, float gain);
5963
5964
5965 int sound_get_user_gain_count(void);
5966 void sound_set_user_gain(int index, float gain);
5967 float sound_get_user_gain(int index);
5968 float sound_get_default_gain(int index);
5969 const char *sound_get_user_gain_name(int index);
5970 # 368 "src/sndintrf.h"
5971 UINT8 soundlatch_r(__attribute__((__unused__)) offs_t offset);
5972 UINT8 soundlatch2_r(__attribute__((__unused__)) offs_t offset);
5973 UINT8 soundlatch3_r(__attribute__((__unused__)) offs_t offset);
5974 UINT8 soundlatch4_r(__attribute__((__unused__)) offs_t offset);
5975 UINT16 soundlatch_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5976 UINT16 soundlatch2_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5977 UINT16 soundlatch3_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5978 UINT16 soundlatch4_word_r(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask);
5979
5980 void soundlatch_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5981 void soundlatch2_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5982 void soundlatch3_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5983 void soundlatch4_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5984 void soundlatch_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5985 void soundlatch2_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5986 void soundlatch3_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5987 void soundlatch4_word_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask);
5988
5989 void soundlatch_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5990 void soundlatch2_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5991 void soundlatch3_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5992 void soundlatch4_clear_w(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data);
5993
5994
5995
5996
5997
5998 void soundlatch_setclearedvalue(int value);
5999 # 74 "src/driver.h" 2
6000
6001
6002 # 1 "src/usrintrf.h" 1
6003 # 12 "src/usrintrf.h"
6004
6005 # 25 "src/usrintrf.h"
6006 enum
6007 {
6008 JUSTIFY_LEFT = 0,
6009 JUSTIFY_CENTER,
6010 JUSTIFY_RIGHT
6011 };
6012
6013
6014 enum
6015 {
6016 WRAP_NEVER,
6017 WRAP_TRUNCATE,
6018 WRAP_WORD
6019 };
6020
6021
6022 enum
6023 {
6024 DRAW_NONE,
6025 DRAW_NORMAL,
6026 DRAW_OPAQUE
6027 };
6028
6029
6030 enum
6031 {
6032 PAUSE_OFF = 0,
6033 PAUSE_ON = 1,
6034 PAUSE_SINGLE_STEP = 2
6035 };
6036 # 69 "src/usrintrf.h"
6037 typedef UINT32 (*ui_menu_handler)(UINT32 state);
6038
6039 struct _ui_menu_item
6040 {
6041 const char *text;
6042 const char *subtext;
6043 UINT32 flags;
6044 };
6045 typedef struct _ui_menu_item ui_menu_item;
6046
6047
6048 struct _memcard_interface
6049 {
6050 int (*create)(int);
6051 int (*load)(int);
6052 void (*save)(void);
6053 void (*eject)(void);
6054 };
6055 typedef struct _memcard_interface memcard_interface;
6056 # 97 "src/usrintrf.h"
6057 extern memcard_interface memcard_intf;
6058 # 110 "src/usrintrf.h"
6059 int ui_init(void);
6060 void ui_exit(void);
6061
6062
6063 int ui_update_and_render(mame_bitmap *bitmap);
6064
6065
6066 int ui_is_dirty(void);
6067
6068
6069 void ui_set_visible_area(int xmin, int ymin, int xmax, int ymax);
6070
6071
6072 int ui_get_line_height(void);
6073
6074
6075 int ui_get_char_width(UINT16 ch);
6076 int ui_get_string_width(const char *s);
6077
6078
6079 void ui_get_bounds(int *width, int *height);
6080
6081
6082 void ui_draw_text(const char *buf, int x, int y);
6083
6084
6085 void ui_draw_text_full(const char *buf, int x, int y, int wrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, int *totalwidth, int *totalheight);
6086
6087
6088 void ui_draw_message_window(const char *text);
6089
6090
6091 void ui_draw_menu(const ui_menu_item *items, int numitems, int selected);
6092
6093
6094 int ui_menu_generic_keys(int *selected, int num_items);
6095
6096
6097 void ui_menu_stack_reset(void);
6098 UINT32 ui_menu_stack_push(ui_menu_handler new_handler, UINT32 new_state);
6099 UINT32 ui_menu_stack_pop(void);
6100
6101
6102 void ui_popup(const char *text, ...) __attribute__((format(printf, 1, 2)));
6103 void ui_popup_time(int seconds, const char *text, ...) __attribute__((format(printf, 2, 3)));
6104
6105
6106 int ui_display_decoding(mame_bitmap *bitmap, int percent);
6107 int ui_display_copyright(mame_bitmap *bitmap);
6108 int ui_display_game_warnings(mame_bitmap *bitmap);
6109 int ui_display_game_info(mame_bitmap *bitmap);
6110
6111
6112 void ui_show_fps_temp(double seconds);
6113
6114
6115 void ui_set_show_fps(int show);
6116 int ui_get_show_fps(void);
6117
6118
6119 void ui_set_show_profiler(int show);
6120 int ui_get_show_profiler(void);
6121
6122
6123 int ui_is_setup_active(void);
6124
6125
6126 int ui_is_onscrd_active(void);
6127
6128
6129 void ui_display_fps(void);
6130 # 77 "src/driver.h" 2
6131 # 1 "src/cheat.h" 1
6132 # 12 "src/cheat.h"
6133
6134
6135
6136
6137
6138 extern int he_did_cheat;
6139
6140 void cheat_init(void);
6141 void cheat_exit(void);
6142
6143 int cheat_menu(int selection);
6144 void cheat_periodic(void);
6145
6146 void cheat_display_watches(void);
6147 # 78 "src/driver.h" 2
6148 # 1 "src/tilemap.h" 1
6149 # 12 "src/tilemap.h"
6150
6151
6152
6153
6154
6155 typedef struct _tilemap tilemap;
6156 # 53 "src/tilemap.h"
6157 struct _tile_data
6158 {
6159
6160
6161
6162
6163
6164
6165 const UINT8 *pen_data;
6166 const pen_t *pal_data;
6167 UINT32 flags;
6168 int skip;
6169 UINT32 tile_number;
6170 UINT32 pen_usage;
6171 UINT32 priority;
6172 UINT8 *mask_data;
6173 void *user_data;
6174 };
6175 typedef struct _tile_data tile_data;
6176
6177 extern tile_data tile_info;
6178 # 108 "src/tilemap.h"
6179 extern mame_bitmap *priority_bitmap;
6180
6181
6182 int tilemap_init( void );
6183 void tilemap_exit( void );
6184
6185 tilemap *tilemap_create(
6186 void (*tile_get_info)( int memory_offset ),
6187 UINT32 (*get_memory_offset)( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows ),
6188 int type,
6189 int tile_width, int tile_height,
6190 int num_cols, int num_rows );
6191
6192 void tilemap_set_transparent_pen( tilemap *tmap, int pen );
6193 void tilemap_set_transmask( tilemap *tmap, int which, UINT32 fgmask, UINT32 bgmask );
6194 void tilemap_set_depth( tilemap *tmap, int tile_depth, int tile_granularity );
6195
6196 void tilemap_mark_tile_dirty( tilemap *tmap, int memory_offset );
6197 void tilemap_mark_all_tiles_dirty( tilemap *tmap );
6198 void tilemap_mark_gfxdata_dirty( tilemap *tmap, UINT8 *dirty_array );
6199
6200 void tilemap_set_scroll_rows( tilemap *tmap, int scroll_rows );
6201 void tilemap_set_scrolldx( tilemap *tmap, int dx, int dx_if_flipped );
6202 void tilemap_set_scrollx( tilemap *tmap, int row, int value );
6203 int tilemap_get_scrolldx( tilemap *tmap );
6204
6205 void tilemap_set_scroll_cols( tilemap *tmap, int scroll_cols );
6206 void tilemap_set_scrolldy( tilemap *tmap, int dy, int dy_if_flipped );
6207 void tilemap_set_scrolly( tilemap *tmap, int col, int value );
6208 int tilemap_get_scrolldy( tilemap *tmap );
6209
6210 void tilemap_set_palette_offset( tilemap *tmap, int offset );
6211 void tilemap_set_user_data( tilemap *tmap, void *user_data );
6212
6213
6214
6215 void tilemap_set_flip( tilemap *tmap, int attributes );
6216 void tilemap_set_enable( tilemap *tmap, int enable );
6217
6218 void tilemap_draw( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority );
6219 void tilemap_draw_primask( mame_bitmap *dest, const rectangle *cliprect, tilemap *tmap, UINT32 flags, UINT32 priority, UINT32 priority_mask );
6220
6221 void tilemap_draw_roz(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
6222 UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
6223 int wraparound,
6224 UINT32 flags, UINT32 priority );
6225
6226 void tilemap_draw_roz_primask(mame_bitmap *dest,const rectangle *cliprect,tilemap *tmap,
6227 UINT32 startx,UINT32 starty,int incxx,int incxy,int incyx,int incyy,
6228 int wraparound,
6229 UINT32 flags, UINT32 priority, UINT32 priority_mask );
6230 # 170 "src/tilemap.h"
6231 mame_bitmap *tilemap_get_pixmap( tilemap * tmap );
6232 mame_bitmap *tilemap_get_transparency_bitmap( tilemap * tmap );
6233 UINT8 *tilemap_get_transparency_data( tilemap * tmap );
6234
6235
6236
6237 UINT32 tilemap_scan_cols( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6238 UINT32 tilemap_scan_cols_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6239 UINT32 tilemap_scan_cols_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6240 UINT32 tilemap_scan_cols_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6241
6242 UINT32 tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6243 UINT32 tilemap_scan_rows_flip_x( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6244 UINT32 tilemap_scan_rows_flip_y( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6245 UINT32 tilemap_scan_rows_flip_xy( UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows );
6246
6247
6248 UINT32 tilemap_count( void );
6249 void tilemap_nb_size( UINT32 number, UINT32 *width, UINT32 *height );
6250 void tilemap_nb_draw( mame_bitmap *dest, UINT32 number, UINT32 scrollx, UINT32 scrolly );
6251 # 79 "src/driver.h" 2
6252 # 1 "src/profiler.h" 1
6253 # 12 "src/profiler.h"
6254
6255
6256
6257
6258
6259
6260 enum
6261 {
6262 PROFILER_END = -1,
6263 PROFILER_CPU1 = 0,
6264 PROFILER_CPU2,
6265 PROFILER_CPU3,
6266 PROFILER_CPU4,
6267 PROFILER_CPU5,
6268 PROFILER_CPU6,
6269 PROFILER_CPU7,
6270 PROFILER_CPU8,
6271 PROFILER_MEMREAD,
6272 PROFILER_MEMWRITE,
6273 PROFILER_VIDEO,
6274 PROFILER_DRAWGFX,
6275 PROFILER_COPYBITMAP,
6276 PROFILER_TILEMAP_DRAW,
6277 PROFILER_TILEMAP_DRAW_ROZ,
6278 PROFILER_TILEMAP_UPDATE,
6279 PROFILER_ARTWORK,
6280 PROFILER_BLIT,
6281 PROFILER_SOUND,
6282 PROFILER_MIXER,
6283 PROFILER_TIMER_CALLBACK,
6284 PROFILER_HISCORE,
6285 PROFILER_INPUT,
6286 PROFILER_EXTRA,
6287
6288
6289
6290 PROFILER_USER1,
6291 PROFILER_USER2,
6292 PROFILER_USER3,
6293 PROFILER_USER4,
6294
6295 PROFILER_PROFILER,
6296 PROFILER_IDLE,
6297 PROFILER_TOTAL
6298 };
6299 # 75 "src/profiler.h"
6300 void profiler__mark(int type);
6301
6302
6303 void profiler_start(void);
6304 void profiler_stop(void);
6305 const char *profiler_get_text(void);
6306 # 80 "src/driver.h" 2
6307 # 309 "src/driver.h"
6308 cpu_config *machine_add_cpu(machine_config *machine, const char *tag, int type, int cpuclock);
6309 cpu_config *machine_find_cpu(machine_config *machine, const char *tag);
6310 void machine_remove_cpu(machine_config *machine, const char *tag);
6311
6312 speaker_config *machine_add_speaker(machine_config *machine, const char *tag, float x, float y, float z);
6313 speaker_config *machine_find_speaker(machine_config *machine, const char *tag);
6314 void machine_remove_speaker(machine_config *machine, const char *tag);
6315
6316 sound_config *machine_add_sound(machine_config *machine, const char *tag, int type, int clock);
6317 sound_config *machine_find_sound(machine_config *machine, const char *tag);
6318 void machine_remove_sound(machine_config *machine, const char *tag);
6319 # 337 "src/driver.h"
6320 struct _machine_config
6321 {
6322 cpu_config cpu[8];
6323 float frames_per_second;
6324 int vblank_duration;
6325 UINT32 cpu_slices_per_frame;
6326 INT32 watchdog_vblank_count;
6327 double watchdog_time;
6328
6329 void (*machine_init)(void);
6330 void (*machine_stop)(void);
6331 void (*nvram_handler)(mame_file *file, int read_or_write);
6332
6333 UINT32 video_attributes;
6334 UINT32 aspect_x, aspect_y;
6335 int screen_width,screen_height;
6336 rectangle default_visible_area;
6337 const gfx_decode *gfxdecodeinfo;
6338 UINT32 total_colors;
6339 UINT32 color_table_len;
6340
6341 void (*init_palette)(UINT16 *colortable,const UINT8 *color_prom);
6342 int (*video_start)(void);
6343 void (*video_stop)(void);
6344 void (*video_eof)(void);
6345
6346
6347
6348 void (*video_update)(int screen, mame_bitmap *bitmap,const rectangle *cliprect);
6349
6350
6351 sound_config sound[32];
6352 speaker_config speaker[4];
6353 };
6354 # 452 "src/driver.h"
6355 struct _game_driver
6356 {
6357 const char *source_file;
6358 const struct _game_driver *clone_of;
6359
6360 const char *name;
6361 const bios_entry *bios;
6362
6363 const char *description;
6364 const char *year;
6365 const char *manufacturer;
6366 void (*drv)(machine_config *);
6367 void (*construct_ipt)(input_port_init_params *param);
6368 void (*driver_init)(void);
6369
6370
6371
6372 const rom_entry *rom;
6373
6374
6375
6376
6377
6378 UINT32 flags;
6379 };
6380 # 574 "src/driver.h"
6381 extern const game_driver *drivers[];
6382 # 95 "src/memory.c" 2
6383
6384 # 1 "src/state.h" 1
6385 # 12 "src/state.h"
6386
6387 # 21 "src/state.h"
6388 void state_save_free(void);
6389 void state_save_allow_registration(int allowed);
6390 int state_save_registration_allowed(void);
6391
6392
6393 int state_save_get_reg_count(void);
6394
6395 void state_save_register_UINT8 (const char *module, int instance,
6396 const char *name, UINT8 *val, unsigned size);
6397 void state_save_register_INT8 (const char *module, int instance,
6398 const char *name, INT8 *val, unsigned size);
6399 void state_save_register_UINT16(const char *module, int instance,
6400 const char *name, UINT16 *val, unsigned size);
6401 void state_save_register_INT16 (const char *module, int instance,
6402 const char *name, INT16 *val, unsigned size);
6403 void state_save_register_UINT32(const char *module, int instance,
6404 const char *name, UINT32 *val, unsigned size);
6405 void state_save_register_INT32 (const char *module, int instance,
6406 const char *name, INT32 *val, unsigned size);
6407 void state_save_register_UINT64(const char *module, int instance,
6408 const char *name, UINT64 *val, unsigned size);
6409 void state_save_register_INT64 (const char *module, int instance,
6410 const char *name, INT64 *val, unsigned size);
6411 void state_save_register_double(const char *module, int instance,
6412 const char *name, double *val, unsigned size);
6413 void state_save_register_float (const char *module, int instance,
6414 const char *name, float *val, unsigned size);
6415 void state_save_register_int (const char *module, int instance,
6416 const char *name, int *val);
6417
6418 void state_save_register_func_presave(void (*func)(void));
6419 void state_save_register_func_postload(void (*func)(void));
6420
6421 void state_save_register_func_presave_int(void (*func)(int), int param);
6422 void state_save_register_func_postload_int(void (*func)(int), int param);
6423
6424 void state_save_register_func_presave_ptr(void (*func)(void *), void *param);
6425 void state_save_register_func_postload_ptr(void (*func)(void *), void *param);
6426
6427
6428
6429 int state_save_save_begin(mame_file *file);
6430 int state_save_load_begin(mame_file *file);
6431
6432 void state_save_push_tag(int tag);
6433 void state_save_pop_tag(void);
6434
6435 void state_save_save_continue(void);
6436 void state_save_load_continue(void);
6437
6438 void state_save_save_finish(void);
6439 void state_save_load_finish(void);
6440
6441
6442 void state_save_dump_registry(void);
6443
6444
6445 int state_save_check_file(mame_file *file, const char *gamename, int validate_signature, void ( *errormsg)(const char *fmt, ...));
6446 # 97 "src/memory.c" 2
6447 # 1 "src/debug/debugcpu.h" 1
6448 # 15 "src/debug/debugcpu.h"
6449 # 1 "src/debug/express.h" 1
6450 # 84 "src/debug/express.h"
6451 struct register_info
6452 {
6453 UINT64 (*getter)(UINT32);
6454 void (*setter)(UINT32, UINT64);
6455 };
6456
6457
6458 struct function_info
6459 {
6460 UINT16 minparams;
6461 UINT16 maxparams;
6462 UINT64 (*execute)(UINT32, UINT32, UINT64 *);
6463 };
6464
6465
6466 struct generic_info
6467 {
6468 void * ptr;
6469 UINT64 value;
6470 };
6471
6472
6473 struct symbol_entry
6474 {
6475 UINT32 ref;
6476 UINT32 type;
6477 union
6478 {
6479 struct register_info reg;
6480 struct function_info func;
6481 struct generic_info gen;
6482 } info;
6483 };
6484
6485
6486 struct symbol_table;
6487
6488
6489 struct parsed_expression;
6490
6491
6492 typedef UINT32 EXPRERR;
6493 # 134 "src/debug/express.h"
6494 UINT64 external_read_memory(int space, UINT32 offset, int size);
6495 void external_write_memory(int space, UINT32 offset, int size, UINT64 value);
6496 # 144 "src/debug/express.h"
6497 EXPRERR expression_evaluate(const char *expression, const struct symbol_table *table, UINT64 *result);
6498 EXPRERR expression_parse(const char *expression, const struct symbol_table *table, struct parsed_expression **result);
6499 EXPRERR expression_execute(struct parsed_expression *expr, UINT64 *result);
6500 void expression_free(struct parsed_expression *expr);
6501 const char * expression_original_string(struct parsed_expression *expr);
6502 const char * exprerr_to_string(EXPRERR error);
6503
6504
6505 struct symbol_table * symtable_alloc(struct symbol_table *parent);
6506 int symtable_add(struct symbol_table *table, const char *name, const struct symbol_entry *entry);
6507 int symtable_add_register(struct symbol_table *table, const char *name, UINT32 ref, UINT64 (*getter)(UINT32), void (*setter)(UINT32, UINT64));
6508 int symtable_add_function(struct symbol_table *table, const char *name, UINT32 ref, UINT16 minparams, UINT16 maxparams, UINT64 (*execute)(UINT32, UINT32, UINT64 *));
6509 int symtable_add_value(struct symbol_table *table, const char *name, UINT64 value);
6510 const struct symbol_entry * symtable_find(const struct symbol_table *table, const char *name);
6511 void symtable_free(struct symbol_table *table);
6512 # 16 "src/debug/debugcpu.h" 2
6513 # 28 "src/debug/debugcpu.h"
6514 enum
6515 {
6516 EXECUTION_STATE_STOPPED,
6517 EXECUTION_STATE_RUNNING,
6518 EXECUTION_STATE_NEXT_CPU,
6519 EXECUTION_STATE_STEP_INTO,
6520 EXECUTION_STATE_STEP_OVER,
6521 EXECUTION_STATE_STEP_OUT
6522 };
6523 # 54 "src/debug/debugcpu.h"
6524 typedef void (*debug_hook_read_ptr)(int spacenum, int size, offs_t address);
6525 typedef void (*debug_hook_write_ptr)(int spacenum, int size, offs_t address, UINT64 data);
6526
6527
6528
6529 struct debug_trace_info
6530 {
6531 FILE * file;
6532 char * action;
6533 offs_t history[64];
6534 int loops;
6535 int nextdex;
6536 offs_t trace_over_target;
6537
6538
6539 };
6540
6541
6542 struct _debug_space_info
6543 {
6544 UINT8 databytes;
6545 UINT8 pageshift;
6546 UINT8 addr2byte_lshift;
6547 UINT8 addr2byte_rshift;
6548 UINT8 physchars;
6549 UINT8 logchars;
6550 offs_t physaddrmask;
6551 offs_t logaddrmask;
6552 offs_t physbytemask;
6553 offs_t logbytemask;
6554 struct watchpoint *first_wp;
6555 };
6556 typedef struct _debug_space_info debug_space_info;
6557
6558
6559 struct _debug_hotspot_entry
6560 {
6561 offs_t access;
6562 offs_t pc;
6563 int spacenum;
6564 UINT32 count;
6565 };
6566 typedef struct _debug_hotspot_entry debug_hotspot_entry;
6567
6568
6569 struct debug_cpu_info
6570 {
6571 UINT8 valid;
6572 UINT8 endianness;
6573 UINT8 opwidth;
6574 UINT8 ignoring;
6575 offs_t temp_breakpoint_pc;
6576 int read_watchpoints;
6577 int write_watchpoints;
6578 struct symbol_table *symtable;
6579 struct debug_trace_info trace;
6580 struct breakpoint *first_bp;
6581 debug_space_info space[3];
6582 debug_hotspot_entry *hotspots;
6583 int hotspot_count;
6584 int hotspot_threshhold;
6585 int (*translate)(int space, offs_t *address);
6586 int (*read)(int space, UINT32 offset, int size, UINT64 *value);
6587 int (*write)(int space, UINT32 offset, int size, UINT64 value);
6588 int (*readop)(UINT32 offset, int size, UINT64 *value);
6589 };
6590
6591
6592 struct breakpoint
6593 {
6594 int index;
6595 UINT8 enabled;
6596 offs_t address;
6597 struct parsed_expression *condition;
6598 char * action;
6599 struct breakpoint *next;
6600 };
6601
6602
6603 struct watchpoint
6604 {
6605 int index;
6606 UINT8 enabled;
6607 UINT8 type;
6608 offs_t address;
6609 offs_t length;
6610 struct parsed_expression *condition;
6611 char * action;
6612 struct watchpoint *next;
6613 };
6614
6615
6616
6617
6618
6619
6620
6621 extern FILE *debug_source_file;
6622 extern struct symbol_table *global_symtable;
6623 # 161 "src/debug/debugcpu.h"
6624 void debug_cpu_init(void);
6625 void debug_cpu_exit(void);
6626
6627
6628 const struct debug_cpu_info *debug_get_cpu_info(int cpunum);
6629 void debug_halt_on_next_instruction(void);
6630 void debug_refresh_display(void);
6631 int debug_get_execution_state(void);
6632 UINT32 debug_get_execution_counter(void);
6633 void debug_trace_printf(int cpunum, const char *fmt, ...);
6634 void debug_source_script(const char *file);
6635 void debug_flush_traces(void);
6636
6637
6638 void debug_vblank_hook(void);
6639 void debug_interrupt_hook(int cpunum, int irqline);
6640 void debug_get_memory_hooks(int cpunum, debug_hook_read_ptr *read, debug_hook_write_ptr *write);
6641
6642
6643 void debug_cpu_single_step(int numsteps);
6644 void debug_cpu_single_step_over(int numsteps);
6645 void debug_cpu_single_step_out(void);
6646 void debug_cpu_go(offs_t targetpc);
6647 void debug_cpu_go_vblank(void);
6648 void debug_cpu_go_interrupt(int irqline);
6649 void debug_cpu_go_milliseconds(UINT64 milliseconds);
6650 void debug_cpu_next_cpu(void);
6651 void debug_cpu_ignore_cpu(int cpunum, int ignore);
6652
6653
6654 void debug_cpu_trace(int cpunum, FILE *file, int trace_over, const char *action);
6655
6656
6657 void debug_check_breakpoints(int cpunum, offs_t pc);
6658 struct breakpoint * debug_breakpoint_first(int cpunum);
6659 int debug_breakpoint_set(int cpunum, offs_t address, struct parsed_expression *condition, const char *action);
6660 int debug_breakpoint_clear(int bpnum);
6661 int debug_breakpoint_enable(int bpnum, int enable);
6662
6663
6664 struct watchpoint * debug_watchpoint_first(int cpunum, int spacenum);
6665 int debug_watchpoint_set(int cpunum, int spacenum, int type, offs_t address, offs_t length, struct parsed_expression *condition, const char *action);
6666 int debug_watchpoint_clear(int wpnum);
6667 int debug_watchpoint_enable(int wpnum, int enable);
6668
6669
6670 int debug_hotspot_track(int cpunum, int numspots, int threshhold);
6671
6672
6673 UINT8 debug_read_byte(int spacenum, offs_t address);
6674 UINT16 debug_read_word(int spacenum, offs_t address);
6675 UINT32 debug_read_dword(int spacenum, offs_t address);
6676 UINT64 debug_read_qword(int spacenum, offs_t address);
6677 void debug_write_byte(int spacenum, offs_t address, UINT8 data);
6678 void debug_write_word(int spacenum, offs_t address, UINT16 data);
6679 void debug_write_dword(int spacenum, offs_t address, UINT32 data);
6680 void debug_write_qword(int spacenum, offs_t address, UINT64 data);
6681 UINT64 debug_read_opcode(UINT32 offset, int size, int arg);
6682 # 98 "src/memory.c" 2
6683 # 173 "src/memory.c"
6684 struct _memory_block
6685 {
6686 UINT8 cpunum;
6687 UINT8 spacenum;
6688 UINT8 isallocated;
6689 offs_t start, end;
6690 UINT8 * data;
6691 };
6692 typedef struct _memory_block memory_block;
6693
6694 struct _bank_data
6695 {
6696 UINT8 used;
6697 UINT8 dynamic;
6698 UINT8 cpunum;
6699 UINT8 spacenum;
6700 UINT8 read;
6701 UINT8 write;
6702 offs_t base;
6703 offs_t end;
6704 UINT8 curentry;
6705 void * entry[64];
6706 void * entryd[64];
6707 };
6708 typedef struct _bank_data bank_data;
6709
6710 union _rwhandlers
6711 {
6712 genf * generic;
6713 read_handlers read;
6714 write_handlers write;
6715 };
6716 typedef union _rwhandlers rwhandlers;
6717
6718 struct _handler_data
6719 {
6720 rwhandlers handler;
6721 offs_t offset;
6722 offs_t top;
6723 offs_t mask;
6724 const char * name;
6725 };
6726
6727
6728 struct _subtable_data
6729 {
6730 UINT8 checksum_valid;
6731 UINT32 checksum;
6732 UINT32 usecount;
6733 };
6734 typedef struct _subtable_data subtable_data;
6735
6736 struct _table_data
6737 {
6738 UINT8 * table;
6739 UINT8 subtable_alloc;
6740 subtable_data subtable[64];
6741 handler_data handlers[((256-64))];
6742 };
6743 typedef struct _table_data table_data;
6744
6745 struct _addrspace_data
6746 {
6747 UINT8 cpunum;
6748 UINT8 spacenum;
6749 INT8 ashift;
6750 UINT8 abits;
6751 UINT8 dbits;
6752 offs_t rawmask;
6753 offs_t mask;
6754 UINT64 unmap;
6755 table_data read;
6756 table_data write;
6757 data_accessors * accessors;
6758 address_map * map;
6759 address_map * adjmap;
6760 };
6761 typedef struct _addrspace_data addrspace_data;
6762
6763 struct _cpu_data
6764 {
6765 opbase_handler opbase;
6766
6767 void * op_ram;
6768 void * op_rom;
6769 offs_t op_mask;
6770 offs_t op_mem_min;
6771 offs_t op_mem_max;
6772 UINT8 opcode_entry;
6773
6774 UINT8 spacemask;
6775 addrspace_data space[3];
6776 };
6777 typedef struct _cpu_data cpu_data;
6778
6779
6780
6781
6782
6783
6784 UINT8 * opcode_base;
6785 UINT8 * opcode_arg_base;
6786 offs_t opcode_mask;
6787 offs_t opcode_memory_min;
6788 offs_t opcode_memory_max;
6789 UINT8 opcode_entry;
6790
6791 address_space active_address_space[3];
6792
6793 static UINT8 * bank_ptr[72];
6794 static UINT8 * bankd_ptr[72];
6795 static void * shared_ptr[256];
6796
6797 static memory_block memory_block_list[1024];
6798 static int memory_block_count = 0;
6799
6800 static int cur_context;
6801
6802 static opbase_handler opbasefunc;
6803
6804 static int debugger_access;
6805
6806 static cpu_data cpudata[8];
6807 static bank_data bankdata[72];
6808
6809
6810
6811
6812
6813
6814 static data_accessors memory_accessors[3][4][2] =
6815 {
6816
6817 {
6818 {
6819 { program_read_byte_8, ((void *)0), ((void *)0), ((void *)0), program_write_byte_8, ((void *)0), ((void *)0), ((void *)0) },
6820 { program_read_byte_8, ((void *)0), ((void *)0), ((void *)0), program_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }
6821 },
6822 {
6823 { program_read_byte_16le, program_read_word_16le, ((void *)0), ((void *)0), program_write_byte_16le, program_write_word_16le, ((void *)0), ((void *)0) },
6824 { program_read_byte_16be, program_read_word_16be, ((void *)0), ((void *)0), program_write_byte_16be, program_write_word_16be, ((void *)0), ((void *)0) }
6825 },
6826 {
6827 { program_read_byte_32le, program_read_word_32le, program_read_dword_32le, ((void *)0), program_write_byte_32le, program_write_word_32le, program_write_dword_32le, ((void *)0) },
6828 { program_read_byte_32be, program_read_word_32be, program_read_dword_32be, ((void *)0), program_write_byte_32be, program_write_word_32be, program_write_dword_32be, ((void *)0) }
6829 },
6830 {
6831 { program_read_byte_64le, program_read_word_64le, program_read_dword_64le, program_read_qword_64le, program_write_byte_64le, program_write_word_64le, program_write_dword_64le, program_write_qword_64le },
6832 { program_read_byte_64be, program_read_word_64be, program_read_dword_64be, program_read_qword_64be, program_write_byte_64be, program_write_word_64be, program_write_dword_64be, program_write_qword_64be }
6833 }
6834 },
6835
6836
6837 {
6838 {
6839 { data_read_byte_8, ((void *)0), ((void *)0), ((void *)0), data_write_byte_8, ((void *)0), ((void *)0), ((void *)0) },
6840 { data_read_byte_8, ((void *)0), ((void *)0), ((void *)0), data_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }
6841 },
6842 {
6843 { data_read_byte_16le, data_read_word_16le, ((void *)0), ((void *)0), data_write_byte_16le, data_write_word_16le, ((void *)0), ((void *)0) },
6844 { data_read_byte_16be, data_read_word_16be, ((void *)0), ((void *)0), data_write_byte_16be, data_write_word_16be, ((void *)0), ((void *)0) }
6845 },
6846 {
6847 { data_read_byte_32le, data_read_word_32le, data_read_dword_32le, ((void *)0), data_write_byte_32le, data_write_word_32le, data_write_dword_32le, ((void *)0) },
6848 { data_read_byte_32be, data_read_word_32be, data_read_dword_32be, ((void *)0), data_write_byte_32be, data_write_word_32be, data_write_dword_32be, ((void *)0) }
6849 },
6850 {
6851 { data_read_byte_64le, data_read_word_64le, data_read_dword_64le, data_read_qword_64le, data_write_byte_64le, data_write_word_64le, data_write_dword_64le, data_write_qword_64le },
6852 { data_read_byte_64be, data_read_word_64be, data_read_dword_64be, data_read_qword_64be, data_write_byte_64be, data_write_word_64be, data_write_dword_64be, data_write_qword_64be }
6853 }
6854 },
6855
6856
6857 {
6858 {
6859 { io_read_byte_8, ((void *)0), ((void *)0), ((void *)0), io_write_byte_8, ((void *)0), ((void *)0), ((void *)0) },
6860 { io_read_byte_8, ((void *)0), ((void *)0), ((void *)0), io_write_byte_8, ((void *)0), ((void *)0), ((void *)0) }
6861 },
6862 {
6863 { io_read_byte_16le, io_read_word_16le, ((void *)0), ((void *)0), io_write_byte_16le, io_write_word_16le, ((void *)0), ((void *)0) },
6864 { io_read_byte_16be, io_read_word_16be, ((void *)0), ((void *)0), io_write_byte_16be, io_write_word_16be, ((void *)0), ((void *)0) }
6865 },
6866 {
6867 { io_read_byte_32le, io_read_word_32le, io_read_dword_32le, ((void *)0), io_write_byte_32le, io_write_word_32le, io_write_dword_32le, ((void *)0) },
6868 { io_read_byte_32be, io_read_word_32be, io_read_dword_32be, ((void *)0), io_write_byte_32be, io_write_word_32be, io_write_dword_32be, ((void *)0) }
6869 },
6870 {
6871 { io_read_byte_64le, io_read_word_64le, io_read_dword_64le, io_read_qword_64le, io_write_byte_64le, io_write_word_64le, io_write_dword_64le, io_write_qword_64le },
6872 { io_read_byte_64be, io_read_word_64be, io_read_dword_64be, io_read_qword_64be, io_write_byte_64be, io_write_word_64be, io_write_dword_64be, io_write_qword_64be }
6873 }
6874 },
6875 };
6876
6877
6878
6879
6880
6881
6882
6883 static int init_cpudata(void);
6884 static int init_addrspace(UINT8 cpunum, UINT8 spacenum);
6885 static int preflight_memory(void);
6886 static int populate_memory(void);
6887 static void install_mem_handler(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name);
6888 static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked);
6889 static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask);
6890 static void populate_table_range(addrspace_data *space, int iswrite, offs_t start, offs_t stop, UINT8 handler);
6891 static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler);
6892 static UINT8 allocate_subtable(table_data *tabledata);
6893 static void reallocate_subtable(table_data *tabledata, UINT8 subentry);
6894 static int merge_subtables(table_data *tabledata);
6895 static void release_subtable(table_data *tabledata, UINT8 subentry);
6896 static UINT8 *open_subtable(table_data *tabledata, offs_t l1index);
6897 static void close_subtable(table_data *tabledata, offs_t l1index);
6898 static int allocate_memory(void);
6899 static void *allocate_memory_block(int cpunum, int spacenum, offs_t start, offs_t end, void *memory);
6900 static void register_for_save(int cpunum, int spacenum, offs_t start, void *base, size_t numbytes);
6901 static address_map *assign_intersecting_blocks(addrspace_data *space, offs_t start, offs_t end, UINT8 *base);
6902 static int find_memory(void);
6903 static void *memory_find_base(int cpunum, int spacenum, int readwrite, offs_t offset);
6904 static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which);
6905
6906 static void mem_dump(void)
6907 {
6908 FILE *file;
6909
6910 if ((0))
6911 {
6912 file = fopen("memdump.log", "w");
6913 if (file)
6914 {
6915 memory_dump(file);
6916 fclose(file);
6917 }
6918 }
6919 }
6920
6921
6922
6923
6924
6925
6926
6927 int memory_init(void)
6928 {
6929
6930 cur_context = -1;
6931
6932
6933 memset(shared_ptr, 0, sizeof(shared_ptr));
6934 memset(bank_ptr, 0, sizeof(bank_ptr));
6935 memset(bankd_ptr, 0, sizeof(bankd_ptr));
6936
6937
6938 memset(memory_block_list, 0, sizeof(memory_block_list));
6939 memory_block_count = 0;
6940
6941
6942 if (!init_cpudata())
6943 return 0;
6944
6945
6946 if (!preflight_memory())
6947 return 0;
6948
6949
6950 if (!populate_memory())
6951 return 0;
6952
6953
6954 if (!allocate_memory())
6955 return 0;
6956
6957
6958 if (!find_memory())
6959 return 0;
6960
6961
6962 mem_dump();
6963 return 1;
6964 }
6965
6966
6967
6968
6969
6970
6971 void memory_exit(void)
6972 {
6973 int cpunum, spacenum;
6974
6975
6976 for (cpunum = 0; cpunum < 8; cpunum++)
6977 for (spacenum = 0; spacenum < 3; spacenum++)
6978 {
6979 if (cpudata[cpunum].space[spacenum].read.table)
6980 free(cpudata[cpunum].space[spacenum].read.table);
6981 if (cpudata[cpunum].space[spacenum].write.table)
6982 free(cpudata[cpunum].space[spacenum].write.table);
6983 }
6984 }
6985
6986
6987
6988
6989
6990
6991 void memory_set_context(int activecpu)
6992 {
6993
6994 if (cur_context != -1)
6995 {
6996 cpudata[cur_context].op_ram = opcode_arg_base;
6997 cpudata[cur_context].op_rom = opcode_base;
6998 cpudata[cur_context].op_mask = opcode_mask;
6999 cpudata[cur_context].op_mem_min = opcode_memory_min;
7000 cpudata[cur_context].op_mem_max = opcode_memory_max;
7001 cpudata[cur_context].opcode_entry = opcode_entry;
7002 }
7003 cur_context = activecpu;
7004
7005 opcode_arg_base = cpudata[activecpu].op_ram;
7006 opcode_base = cpudata[activecpu].op_rom;
7007 opcode_mask = cpudata[activecpu].op_mask;
7008 opcode_memory_min = cpudata[activecpu].op_mem_min;
7009 opcode_memory_max = cpudata[activecpu].op_mem_max;
7010 opcode_entry = cpudata[activecpu].opcode_entry;
7011
7012
7013 active_address_space[0].addrmask = cpudata[activecpu].space[0].mask;
7014 active_address_space[0].readlookup = cpudata[activecpu].space[0].read.table;
7015 active_address_space[0].writelookup = cpudata[activecpu].space[0].write.table;
7016 active_address_space[0].readhandlers = cpudata[activecpu].space[0].read.handlers;
7017 active_address_space[0].writehandlers = cpudata[activecpu].space[0].write.handlers;
7018 active_address_space[0].accessors = cpudata[activecpu].space[0].accessors;
7019
7020
7021 if (cpudata[activecpu].spacemask & (1 << 1))
7022 {
7023 active_address_space[1].addrmask = cpudata[activecpu].space[1].mask;
7024 active_address_space[1].readlookup = cpudata[activecpu].space[1].read.table;
7025 active_address_space[1].writelookup = cpudata[activecpu].space[1].write.table;
7026 active_address_space[1].readhandlers = cpudata[activecpu].space[1].read.handlers;
7027 active_address_space[1].writehandlers = cpudata[activecpu].space[1].write.handlers;
7028 active_address_space[1].accessors = cpudata[activecpu].space[1].accessors;
7029 }
7030
7031
7032 if (cpudata[activecpu].spacemask & (1 << 2))
7033 {
7034 active_address_space[2].addrmask = cpudata[activecpu].space[2].mask;
7035 active_address_space[2].readlookup = cpudata[activecpu].space[2].read.table;
7036 active_address_space[2].writelookup = cpudata[activecpu].space[2].write.table;
7037 active_address_space[2].readhandlers = cpudata[activecpu].space[2].read.handlers;
7038 active_address_space[2].writehandlers = cpudata[activecpu].space[2].write.handlers;
7039 active_address_space[2].accessors = cpudata[activecpu].space[2].accessors;
7040 }
7041
7042 opbasefunc = cpudata[activecpu].opbase;
7043 # 542 "src/memory.c"
7044 }
7045
7046
7047
7048
7049
7050
7051
7052 const address_map *memory_get_map(int cpunum, int spacenum)
7053 {
7054 return cpudata[cpunum].space[spacenum].map;
7055 }
7056
7057
7058
7059
7060
7061
7062
7063 opbase_handler memory_set_opbase_handler(int cpunum, opbase_handler function)
7064 {
7065 opbase_handler old = cpudata[cpunum].opbase;
7066 cpudata[cpunum].opbase = function;
7067 if (cpunum == cpu_getactivecpu())
7068 opbasefunc = function;
7069 return old;
7070 }
7071
7072
7073
7074
7075
7076
7077 void memory_set_opbase(offs_t pc)
7078 {
7079 address_space *space = &active_address_space[0];
7080
7081 UINT8 *base = ((void *)0), *based = ((void *)0);
7082 handler_data *handlers;
7083 UINT8 entry;
7084
7085
7086 if (opbasefunc)
7087 {
7088 pc = (*opbasefunc)(pc);
7089 if (pc == ~0)
7090 return;
7091 }
7092
7093
7094 pc &= space->addrmask;
7095 entry = space->readlookup[((pc) >> (32 - 18))];
7096 if (entry >= (256-64))
7097 entry = space->readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((pc) & ((1 << (32 - 18)) - 1)))];
7098 opcode_entry = entry;
7099
7100
7101 if (entry < 1 || entry >= 68)
7102 {
7103
7104 for (entry = 1; entry < 72; entry++)
7105 {
7106 bank_data *bdata = &bankdata[entry];
7107 if (bdata->used && bdata->cpunum == cur_context && bdata->spacenum == 0 &&
7108 bdata->base < pc && bdata->end > pc)
7109 break;
7110 }
7111
7112
7113 if (entry == 72)
7114 {
7115 logerror("cpu #%d (PC=%08X): warning - op-code execute on mapped I/O\n",
7116 cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))));
7117 return;
7118 }
7119 }
7120
7121
7122 base = bank_ptr[entry];
7123 based = bankd_ptr[entry];
7124 if (!based)
7125 based = base;
7126
7127
7128 handlers = &active_address_space[0].readhandlers[entry];
7129 opcode_mask = handlers->mask;
7130 opcode_arg_base = base - (handlers->offset & opcode_mask);
7131 opcode_base = based - (handlers->offset & opcode_mask);
7132 opcode_memory_min = handlers->offset;
7133 opcode_memory_max = handlers->top;
7134 }
7135
7136
7137
7138
7139
7140
7141
7142 void memory_set_decrypted_region(int cpunum, offs_t start, offs_t end, void *base)
7143 {
7144 int banknum, found = 0;
7145
7146
7147 for (banknum = 0; banknum < 72; banknum++)
7148 {
7149 bank_data *bdata = &bankdata[banknum];
7150 if (bdata->used && bdata->cpunum == cpunum && bdata->spacenum == 0 && bdata->read)
7151 {
7152 if (bdata->base >= start && bdata->end <= end)
7153 {
7154 bankd_ptr[banknum] = (UINT8 *)base + bdata->base - start;
7155 found = 1;
7156
7157
7158 if (cpunum == cur_context && opcode_entry == banknum)
7159 memory_set_opbase(activecpu_get_physical_pc_byte());
7160 }
7161 else if (bdata->base < end && bdata->end > start)
7162 osd_die("memory_set_decrypted_region found straddled region %08X-%08X for CPU %d\n", start, end, cpunum);
7163 }
7164 }
7165
7166 if (!found)
7167 osd_die("memory_set_decrypted_region unable to find matching region %08X-%08X for CPU %d\n", start, end, cpunum);
7168 }
7169 # 675 "src/memory.c"
7170 void *memory_get_read_ptr(int cpunum, int spacenum, offs_t offset)
7171 {
7172 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7173 UINT8 entry;
7174
7175
7176 offset &= space->mask;
7177 entry = space->read.table[((offset) >> (32 - 18))];
7178 if (entry >= (256-64))
7179 entry = space->read.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
7180
7181
7182 if (entry >= 68)
7183 return ((void *)0);
7184 offset = (offset - space->read.handlers[entry].offset) & space->read.handlers[entry].mask;
7185 return &bank_ptr[entry][offset];
7186 }
7187 # 700 "src/memory.c"
7188 void *memory_get_write_ptr(int cpunum, int spacenum, offs_t offset)
7189 {
7190 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7191 UINT8 entry;
7192
7193
7194 offset &= space->mask;
7195 entry = space->write.table[((offset) >> (32 - 18))];
7196 if (entry >= (256-64))
7197 entry = space->write.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
7198
7199
7200 if (entry >= 68)
7201 return ((void *)0);
7202 offset = (offset - space->write.handlers[entry].offset) & space->write.handlers[entry].mask;
7203 return &bank_ptr[entry][offset];
7204 }
7205 # 725 "src/memory.c"
7206 void *memory_get_op_ptr(int cpunum, offs_t offset, int arg)
7207 {
7208 addrspace_data *space = &cpudata[cpunum].space[0];
7209 void *ptr = ((void *)0);
7210 UINT8 entry;
7211
7212
7213 if (cpudata[cpunum].opbase)
7214 {
7215
7216 UINT8 *saved_opcode_base = opcode_base;
7217 UINT8 *saved_opcode_arg_base = opcode_arg_base;
7218 offs_t saved_opcode_mask = opcode_mask;
7219 offs_t saved_opcode_memory_min = opcode_memory_min;
7220 offs_t saved_opcode_memory_max = opcode_memory_max;
7221 UINT8 saved_opcode_entry = opcode_entry;
7222
7223
7224 offs_t new_offset = (*cpudata[cpunum].opbase)(offset);
7225
7226
7227 if (new_offset == ~0)
7228 ptr = arg ? &opcode_arg_base[offset] : &opcode_base[offset];
7229
7230
7231 else
7232 offset = new_offset;
7233
7234
7235 opcode_base = saved_opcode_base;
7236 opcode_arg_base = saved_opcode_arg_base;
7237 opcode_mask = saved_opcode_mask;
7238 opcode_memory_min = saved_opcode_memory_min;
7239 opcode_memory_max = saved_opcode_memory_max;
7240 opcode_entry = saved_opcode_entry;
7241
7242
7243 if (ptr)
7244 return ptr;
7245 }
7246
7247
7248 offset &= space->mask;
7249 entry = space->read.table[((offset) >> (32 - 18))];
7250 if (entry >= (256-64))
7251 entry = space->read.table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
7252
7253
7254 if (entry >= 68)
7255 return ((void *)0);
7256
7257
7258 offset = (offset - space->read.handlers[entry].offset) & space->read.handlers[entry].mask;
7259 return (!arg && bankd_ptr[entry]) ? &bankd_ptr[entry][offset] : &bank_ptr[entry][offset];
7260 }
7261
7262
7263
7264
7265
7266
7267
7268 void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride)
7269 {
7270 int entrynum;
7271
7272
7273 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7274 osd_die("memory_configure_bank called with invalid bank %d\n", banknum);
7275 if (bankdata[banknum].dynamic)
7276 osd_die("memory_configure_bank called with dynamic bank %d\n", banknum);
7277 if (startentry < 0 || startentry + numentries > 64)
7278 osd_die("memory_configure_bank called with out-of-range entries %d-%d\n", startentry, startentry + numentries - 1);
7279
7280
7281 for (entrynum = startentry; entrynum < startentry + numentries; entrynum++)
7282 bankdata[banknum].entry[entrynum] = (UINT8 *)base + (entrynum - startentry) * stride;
7283 }
7284 # 811 "src/memory.c"
7285 void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride)
7286 {
7287 int entrynum;
7288
7289
7290 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7291 osd_die("memory_configure_bank called with invalid bank %d\n", banknum);
7292 if (bankdata[banknum].dynamic)
7293 osd_die("memory_configure_bank called with dynamic bank %d\n", banknum);
7294 if (startentry < 0 || startentry + numentries > 64)
7295 osd_die("memory_configure_bank called with out-of-range entries %d-%d\n", startentry, startentry + numentries - 1);
7296
7297
7298 for (entrynum = startentry; entrynum < startentry + numentries; entrynum++)
7299 bankdata[banknum].entryd[entrynum] = (UINT8 *)base + (entrynum - startentry) * stride;
7300 }
7301
7302
7303
7304
7305
7306
7307
7308 void memory_set_bank(int banknum, int entrynum)
7309 {
7310
7311 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7312 osd_die("memory_set_bank called with invalid bank %d\n", banknum);
7313 if (bankdata[banknum].dynamic)
7314 osd_die("memory_set_bank called with dynamic bank %d\n", banknum);
7315 if (entrynum < 0 || entrynum > 64)
7316 osd_die("memory_set_bank called with out-of-range entry %d\n", entrynum);
7317 if (!bankdata[banknum].entry[entrynum])
7318 osd_die("memory_set_bank called for bank %d with invalid bank entry %d\n", banknum, entrynum);
7319
7320
7321 bankdata[banknum].curentry = entrynum;
7322 bank_ptr[banknum] = bankdata[banknum].entry[entrynum];
7323 bankd_ptr[banknum] = bankdata[banknum].entryd[entrynum];
7324
7325
7326 if (opcode_entry == banknum && cpu_getactivecpu() >= 0)
7327 {
7328 opcode_entry = 0xff;
7329 memory_set_opbase(activecpu_get_physical_pc_byte());
7330 }
7331 }
7332
7333
7334
7335
7336
7337
7338
7339 void memory_set_bankptr(int banknum, void *base)
7340 {
7341
7342 if (banknum < 1 || banknum > 32 || !bankdata[banknum].used)
7343 osd_die("memory_set_bankptr called with invalid bank %d\n", banknum);
7344 if (bankdata[banknum].dynamic)
7345 osd_die("memory_set_bankptr called with dynamic bank %d\n", banknum);
7346
7347
7348 bank_ptr[banknum] = base;
7349
7350
7351 if (opcode_entry == banknum && cpu_getactivecpu() >= 0)
7352 {
7353 opcode_entry = 0xff;
7354 memory_set_opbase(activecpu_get_physical_pc_byte());
7355 }
7356 }
7357
7358
7359
7360
7361
7362
7363 void memory_set_debugger_access(int debugger)
7364 {
7365 debugger_access = debugger;
7366 }
7367
7368
7369
7370
7371
7372
7373
7374 void *_memory_install_read_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, int handler, const char *handler_name)
7375 {
7376 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7377 if ((handler < 0) || (handler >= 72))
7378 osd_die("fatal: can only use static banks with memory_install_read_handler()\n");
7379 install_mem_handler(space, 0, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7380 mem_dump();
7381 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7382 }
7383
7384 UINT8 *_memory_install_read8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name)
7385 {
7386 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7387 install_mem_handler(space, 0, 8, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7388 mem_dump();
7389 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7390 }
7391
7392 UINT16 *_memory_install_read16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name)
7393 {
7394 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7395 install_mem_handler(space, 0, 16, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7396 mem_dump();
7397 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7398 }
7399
7400 UINT32 *_memory_install_read32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name)
7401 {
7402 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7403 install_mem_handler(space, 0, 32, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7404 mem_dump();
7405 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7406 }
7407
7408 UINT64 *_memory_install_read64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name)
7409 {
7410 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7411 install_mem_handler(space, 0, 64, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7412 mem_dump();
7413 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7414 }
7415
7416
7417
7418
7419
7420
7421
7422 void *_memory_install_write_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, int handler, const char *handler_name)
7423 {
7424 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7425 if ((handler < 0) || (handler >= 72))
7426 osd_die("fatal: can only use static banks with memory_install_write_handler()\n");
7427 install_mem_handler(space, 1, space->dbits, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7428 mem_dump();
7429 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7430 }
7431
7432 UINT8 *_memory_install_write8_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name)
7433 {
7434 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7435 install_mem_handler(space, 1, 8, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7436 mem_dump();
7437 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7438 }
7439
7440 UINT16 *_memory_install_write16_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name)
7441 {
7442 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7443 install_mem_handler(space, 1, 16, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7444 mem_dump();
7445 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7446 }
7447
7448 UINT32 *_memory_install_write32_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name)
7449 {
7450 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7451 install_mem_handler(space, 1, 32, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7452 mem_dump();
7453 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7454 }
7455
7456 UINT64 *_memory_install_write64_handler(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name)
7457 {
7458 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7459 install_mem_handler(space, 1, 64, 0, start, end, mask, mirror, (genf *)handler, 0, handler_name);
7460 mem_dump();
7461 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((start) << -(space)->ashift) : ((start) >> (space)->ashift)));
7462 }
7463 # 997 "src/memory.c"
7464 void *_memory_install_read_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, int handler, const char *handler_name)
7465 {
7466 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7467 if ((handler < 0) || (handler >= 72))
7468 osd_die("fatal: can only use static banks with memory_install_read_matchmask_handler()\n");
7469 install_mem_handler(space, 0, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7470 mem_dump();
7471 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7472 }
7473
7474 UINT8 *_memory_install_read8_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read8_handler handler, const char *handler_name)
7475 {
7476 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7477 install_mem_handler(space, 0, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7478 mem_dump();
7479 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7480 }
7481
7482 UINT16 *_memory_install_read16_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read16_handler handler, const char *handler_name)
7483 {
7484 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7485 install_mem_handler(space, 0, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7486 mem_dump();
7487 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7488 }
7489
7490 UINT32 *_memory_install_read32_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read32_handler handler, const char *handler_name)
7491 {
7492 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7493 install_mem_handler(space, 0, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7494 mem_dump();
7495 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7496 }
7497
7498 UINT64 *_memory_install_read64_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, read64_handler handler, const char *handler_name)
7499 {
7500 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7501 install_mem_handler(space, 0, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7502 mem_dump();
7503 return memory_find_base(cpunum, spacenum, 0, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7504 }
7505 # 1046 "src/memory.c"
7506 void *_memory_install_write_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, int handler, const char *handler_name)
7507 {
7508 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7509 if ((handler < 0) || (handler >= 72))
7510 osd_die("fatal: can only use static banks with memory_install_write_matchmask_handler()\n");
7511 install_mem_handler(space, 1, space->dbits, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7512 mem_dump();
7513 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7514 }
7515
7516 UINT8 *_memory_install_write8_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write8_handler handler, const char *handler_name)
7517 {
7518 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7519 install_mem_handler(space, 1, 8, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7520 mem_dump();
7521 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7522 }
7523
7524 UINT16 *_memory_install_write16_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write16_handler handler, const char *handler_name)
7525 {
7526 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7527 install_mem_handler(space, 1, 16, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7528 mem_dump();
7529 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7530 }
7531
7532 UINT32 *_memory_install_write32_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write32_handler handler, const char *handler_name)
7533 {
7534 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7535 install_mem_handler(space, 1, 32, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7536 mem_dump();
7537 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7538 }
7539
7540 UINT64 *_memory_install_write64_matchmask_handler(int cpunum, int spacenum, offs_t matchval, offs_t maskval, offs_t mask, offs_t mirror, write64_handler handler, const char *handler_name)
7541 {
7542 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7543 install_mem_handler(space, 1, 64, 1, matchval, maskval, mask, mirror, (genf *)handler, 0, handler_name);
7544 mem_dump();
7545 return memory_find_base(cpunum, spacenum, 1, (((space)->ashift < 0) ? ((matchval) << -(space)->ashift) : ((matchval) >> (space)->ashift)));
7546 }
7547
7548
7549
7550
7551
7552
7553 address_map *construct_map_0(address_map *map)
7554 {
7555 map->flags = 0x04;
7556 return map;
7557 }
7558
7559
7560
7561
7562
7563
7564
7565 static int init_cpudata(void)
7566 {
7567 int cpunum, spacenum;
7568
7569
7570 memset(&cpudata, 0, sizeof(cpudata));
7571
7572
7573 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
7574 {
7575
7576 cpudata[cpunum].op_ram = cpudata[cpunum].op_rom = memory_region(REGION_CPU1 + cpunum);
7577 cpudata[cpunum].op_mem_max = memory_region_length(REGION_CPU1 + cpunum);
7578 cpudata[cpunum].op_mem_min = 0;
7579 cpudata[cpunum].opcode_entry = 71;
7580 cpudata[cpunum].opbase = ((void *)0);
7581
7582
7583 cpudata[cpunum].spacemask = 0;
7584 for (spacenum = 0; spacenum < 3; spacenum++)
7585 if (!init_addrspace(cpunum, spacenum))
7586 return 0;
7587 cpudata[cpunum].op_mask = cpudata[cpunum].space[0].mask;
7588 }
7589 return 1;
7590 }
7591
7592
7593
7594
7595
7596
7597
7598 static __inline__ void adjust_addresses(addrspace_data *space, int ismatchmask, offs_t *start, offs_t *end, offs_t *mask, offs_t *mirror)
7599 {
7600
7601 if (!*mask) *mask = space->rawmask;
7602
7603
7604 *mask &= ~*mirror;
7605 *start &= ~*mirror & space->rawmask;
7606 *end &= ~*mirror & space->rawmask;
7607
7608
7609 *mask = (((space)->ashift < 0) ? ((*mask) << -(space)->ashift) : ((*mask) >> (space)->ashift));
7610 *start = (((space)->ashift < 0) ? ((*start) << -(space)->ashift) : ((*start) >> (space)->ashift));
7611 *end = ismatchmask ? (((space)->ashift < 0) ? ((*end) << -(space)->ashift) : ((*end) >> (space)->ashift)) : (((space)->ashift < 0) ? (((*end) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((*end) >> (space)->ashift));
7612 *mirror = (((space)->ashift < 0) ? ((*mirror) << -(space)->ashift) : ((*mirror) >> (space)->ashift));
7613 }
7614
7615
7616
7617
7618
7619
7620
7621 static int init_addrspace(UINT8 cpunum, UINT8 spacenum)
7622 {
7623 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7624 int cputype = Machine->drv->cpu[cpunum].cpu_type;
7625 int abits = cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_WIDTH + (spacenum));
7626 int dbits = cputype_get_info_int(cputype, CPUINFO_INT_DATABUS_WIDTH + (spacenum));
7627 int accessorindex = (dbits == 8) ? 0 : (dbits == 16) ? 1 : (dbits == 32) ? 2 : 3;
7628 construct_map_t internal_map = (construct_map_t)cputype_get_info_fct(cputype, CPUINFO_PTR_INTERNAL_MEMORY_MAP + spacenum);
7629 int entrynum;
7630
7631
7632 space->cpunum = cpunum;
7633 space->spacenum = spacenum;
7634 space->ashift = cputype_get_info_int(cputype, CPUINFO_INT_ADDRBUS_SHIFT + (spacenum));
7635 space->abits = abits - space->ashift;
7636 space->dbits = dbits;
7637 space->rawmask = 0xffffffffUL >> (32 - abits);
7638 space->mask = (((space)->ashift < 0) ? (((space->rawmask) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((space->rawmask) >> (space)->ashift));
7639 space->accessors = &memory_accessors[spacenum][accessorindex][cputype_get_info_int(cputype, CPUINFO_INT_ENDIANNESS) == CPU_IS_LE ? 0 : 1];
7640 space->map = ((void *)0);
7641 space->adjmap = ((void *)0);
7642
7643
7644 if (space->abits == 0)
7645 return 1;
7646 cpudata[cpunum].spacemask |= 1 << spacenum;
7647
7648
7649 if (internal_map || Machine->drv->cpu[cpunum].construct_map[spacenum][0] || Machine->drv->cpu[cpunum].construct_map[spacenum][1])
7650 {
7651
7652 address_map *map = auto_malloc(sizeof(space->map[0]) * 256 * 4);
7653 memset(map, 0, sizeof(space->map[0]) * 256 * 4);
7654
7655
7656 space->map = map;
7657 space->adjmap = &map[256 * 2];
7658
7659
7660 if (internal_map)
7661 map = (*internal_map)(map);
7662
7663
7664 if (Machine->drv->cpu[cpunum].construct_map[spacenum][0])
7665 map = (*Machine->drv->cpu[cpunum].construct_map[spacenum][0])(map);
7666 if (Machine->drv->cpu[cpunum].construct_map[spacenum][1])
7667 map = (*Machine->drv->cpu[cpunum].construct_map[spacenum][1])(map);
7668
7669
7670 if (spacenum == 0 && memory_region(REGION_CPU1 + cpunum))
7671 for (map = space->map; !(((map)->flags & 0x04) != 0); map++)
7672 if (!(((map)->flags & 0x01) != 0) && ((FPTR)(map->read.handler) == 69) && !map->region)
7673 {
7674 map->region = REGION_CPU1 + cpunum;
7675 map->region_offs = (((space)->ashift < 0) ? ((map->start) << -(space)->ashift) : ((map->start) >> (space)->ashift));
7676 }
7677
7678
7679 for (map = space->map; !(((map)->flags & 0x04) != 0); map++)
7680 if (map->region)
7681 map->memory = memory_region(map->region) + map->region_offs;
7682
7683
7684 memcpy(space->adjmap, space->map, sizeof(space->map[0]) * 256 * 2);
7685 for (map = space->adjmap; !(((map)->flags & 0x04) != 0); map++)
7686 if (!(((map)->flags & 0x01) != 0))
7687 adjust_addresses(space, (((map)->flags & 0x02) != 0), &map->start, &map->end, &map->mask, &map->mirror);
7688
7689
7690 for (map = space->adjmap; !(((map)->flags & 0x04) != 0); map++)
7691 if (map->region && map->share == 0 && !map->base)
7692 {
7693 UINT8 *base = memory_region(map->region);
7694 offs_t length = memory_region_length(map->region);
7695
7696
7697 if (!base)
7698 osd_die("Error: CPU %d space %d memory map entry %X-%X references non-existant region %d", cpunum, spacenum, map->start, map->end, map->region);
7699 if (map->region_offs + (map->end - map->start + 1) > length)
7700 osd_die("Error: CPU %d space %d memory map entry %X-%X extends beyond region %d size (%X)", cpunum, spacenum, map->start, map->end, map->region, length);
7701 }
7702 }
7703
7704
7705 memset(space->read.handlers, 0, sizeof(space->read.handlers));
7706 memset(space->write.handlers, 0, sizeof(space->write.handlers));
7707 for (entrynum = 0; entrynum < ((256-64)); entrynum++)
7708 {
7709 space->read.handlers[entrynum].handler.generic = get_static_handler(dbits, 0, spacenum, entrynum);
7710 space->read.handlers[entrynum].mask = space->mask;
7711 space->write.handlers[entrynum].handler.generic = get_static_handler(dbits, 1, spacenum, entrynum);
7712 space->write.handlers[entrynum].mask = space->mask;
7713 }
7714
7715
7716 space->read.table = malloc(1 << 18);
7717 space->write.table = malloc(1 << 18);
7718 if (!space->read.table)
7719 osd_die("cpu #%d couldn't allocate read table\n", cpunum);
7720 if (!space->write.table)
7721 osd_die("cpu #%d couldn't allocate write table\n", cpunum);
7722
7723
7724 memset(space->read.table, 71, 1 << 18);
7725 memset(space->write.table, 71, 1 << 18);
7726 return 1;
7727 }
7728
7729
7730
7731
7732
7733
7734
7735 static int preflight_memory(void)
7736 {
7737 int cpunum, spacenum, entrynum;
7738
7739
7740 memset(&bankdata, 0, sizeof(bankdata));
7741
7742
7743 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
7744 for (spacenum = 0; spacenum < 3; spacenum++)
7745 if (cpudata[cpunum].spacemask & (1 << spacenum))
7746 {
7747 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7748 const address_map *map;
7749
7750
7751 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
7752 {
7753
7754 if ((((map)->flags & 0x01) != 0))
7755 {
7756 UINT32 flags = ((map)->start);
7757 UINT32 val;
7758
7759
7760 if (flags & 0x00000001)
7761 {
7762 val = (flags & (0x0f << 8)) >> 8;
7763 if (val != spacenum)
7764 {
7765 osd_die("cpu #%d has address space %d handlers in place of address space %d handlers!\n", cpunum, val, spacenum);
7766 return -1;
7767 }
7768 }
7769
7770
7771 if (flags & 0x00000004)
7772 {
7773 val = (flags & (0x07 << 18)) >> 18;
7774 val = (val + 1) * 8;
7775 if (val != space->dbits)
7776 {
7777 osd_die("cpu #%d uses wrong %d-bit handlers for address space %d (should be %d-bit)!\n", cpunum, val, spacenum, space->dbits);
7778 return -1;
7779 }
7780 }
7781
7782
7783 if (flags & 0x00000002)
7784 {
7785 space->rawmask = 0xffffffffUL >> (32 - ((flags & (0x3f << 12)) >> 12));
7786 space->mask = (((space)->ashift < 0) ? (((space->rawmask) << -(space)->ashift) | ((1 << -(space)->ashift) - 1)) : ((space->rawmask) >> (space)->ashift));
7787 }
7788
7789
7790 if (flags & 0x00000008)
7791 space->unmap = ((flags & (1 << 21)) == 0) ? (UINT64)0 : (UINT64)-1;
7792 }
7793
7794
7795 else
7796 {
7797 int bank = -1;
7798
7799
7800 if (((FPTR)(map->read.handler) >= 1 && (FPTR)(map->read.handler) <= (68 - 1)))
7801 bank = ((FPTR)(map->read.handler));
7802 else if (((FPTR)(map->write.handler) >= 1 && (FPTR)(map->write.handler) <= (68 - 1)))
7803 bank = ((FPTR)(map->write.handler));
7804
7805
7806 if (bank >= 1 && bank <= 32)
7807 {
7808 bank_data *bdata = &bankdata[bank];
7809
7810
7811 if (!bdata->used)
7812 state_save_register_UINT8("memory", bank, "bank.entry", &bdata->curentry, 1);
7813
7814 bdata->used = 1;
7815 bdata->dynamic = 0;
7816 bdata->cpunum = cpunum;
7817 bdata->spacenum = spacenum;
7818 if (bank == ((FPTR)(map->read.handler)))
7819 bdata->read = 1;
7820 if (bank == ((FPTR)(map->write.handler)))
7821 bdata->write = 1;
7822 bdata->base = map->start;
7823 bdata->end = map->end;
7824 bdata->curentry = 64;
7825 }
7826 }
7827 }
7828
7829
7830 for (entrynum = 0; entrynum < ((256-64)); entrynum++)
7831 {
7832 space->read.handlers[entrynum].mask &= space->mask;
7833 space->write.handlers[entrynum].mask &= space->mask;
7834 }
7835 }
7836
7837 return 1;
7838 }
7839
7840
7841
7842
7843
7844
7845
7846 static int populate_memory(void)
7847 {
7848 int cpunum, spacenum;
7849
7850
7851 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
7852 for (spacenum = 0; spacenum < 3; spacenum++)
7853 if (cpudata[cpunum].spacemask & (1 << spacenum))
7854 {
7855 addrspace_data *space = &cpudata[cpunum].space[spacenum];
7856 const address_map *map;
7857
7858
7859 if (space->map)
7860 {
7861
7862 for (map = space->map; !(((map)->flags & 0x04) != 0); map++) ;
7863
7864
7865 for (map--; map >= space->map; map--)
7866 if (!(((map)->flags & 0x01) != 0))
7867 {
7868 int ismatchmask = ((map->flags & 0x02) != 0);
7869 int isfixed = (map->memory != ((void *)0)) || (map->share != 0);
7870 if (map->read.handler)
7871 install_mem_handler(space, 0, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->read.handler, isfixed, map->read_name);
7872 if (map->write.handler)
7873 install_mem_handler(space, 1, space->dbits, ismatchmask, map->start, map->end, map->mask, map->mirror, map->write.handler, isfixed, map->write_name);
7874 }
7875 }
7876 }
7877
7878 return 1;
7879 }
7880
7881
7882
7883
7884
7885
7886
7887 static void install_mem_handler(addrspace_data *space, int iswrite, int databits, int ismatchmask, offs_t start, offs_t end, offs_t mask, offs_t mirror, genf *handler, int isfixed, const char *handler_name)
7888 {
7889 offs_t lmirrorbit[18], lmirrorbits, hmirrorbit[(32 - 18)], hmirrorbits, lmirrorcount, hmirrorcount;
7890 table_data *tabledata = iswrite ? &space->write : &space->read;
7891 UINT8 idx, prev_entry = 0;
7892 int cur_index, prev_index = 0;
7893 offs_t original_mask = mask;
7894 int i;
7895
7896
7897 if (space->dbits != databits)
7898 osd_die("fatal: install_mem_handler called with a %d-bit handler for a %d-bit address space\n", databits, space->dbits);
7899 if (start > end)
7900 osd_die("fatal: install_mem_handler called with start greater than end\n");
7901
7902
7903 if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1)))
7904 {
7905 bank_data *bdata = &bankdata[((FPTR)(handler))];
7906
7907
7908 if (!bdata->used)
7909 {
7910 bdata->used = 1;
7911 bdata->dynamic = 0;
7912 bdata->cpunum = space->cpunum;
7913 bdata->spacenum = space->spacenum;
7914 bdata->base = start;
7915 bdata->end = end;
7916 bdata->curentry = 64;
7917
7918
7919 if (state_save_registration_allowed())
7920 state_save_register_UINT8("memory", ((FPTR)(handler)), "bank.entry", &bdata->curentry, 1);
7921
7922 ;
7923 }
7924 }
7925
7926
7927 adjust_addresses(space, ismatchmask, &start, &end, &mask, &mirror);
7928
7929
7930 if (((FPTR)(handler) == 69))
7931 handler = iswrite ? (genf *)71 : (genf *)((read8_handler)68);
7932
7933
7934 if (((FPTR)(handler) == 68))
7935 {
7936 handler = (genf *)assign_dynamic_bank(space->cpunum, space->spacenum, start, end, mirror, isfixed, original_mask != 0);
7937 if (!bank_ptr[((FPTR)(handler))])
7938 bank_ptr[((FPTR)(handler))] = memory_find_base(space->cpunum, space->spacenum, iswrite, start);
7939 }
7940
7941
7942 if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1)))
7943 {
7944 bank_data *bdata = &bankdata[((FPTR)(handler))];
7945
7946
7947 if (!iswrite)
7948 bdata->read = 1;
7949 else
7950 bdata->write = 1;
7951 }
7952
7953
7954 hmirrorbits = lmirrorbits = 0;
7955 for (i = 0; i < (32 - 18); i++)
7956 if (mirror & (1 << i))
7957 lmirrorbit[lmirrorbits++] = 1 << i;
7958 for (i = (32 - 18); i < 32; i++)
7959 if (mirror & (1 << i))
7960 hmirrorbit[hmirrorbits++] = 1 << i;
7961
7962
7963 idx = get_handler_index(tabledata->handlers, handler, handler_name, start, end, mask);
7964
7965
7966 for (hmirrorcount = 0; hmirrorcount < (1 << hmirrorbits); hmirrorcount++)
7967 {
7968
7969 offs_t hmirrorbase = 0;
7970 for (i = 0; i < hmirrorbits; i++)
7971 if (hmirrorcount & (1 << i))
7972 hmirrorbase |= hmirrorbit[i];
7973
7974
7975
7976
7977 cur_index = ((start + hmirrorbase) >> (32 - 18));
7978 if (cur_index == ((end + hmirrorbase) >> (32 - 18)))
7979 {
7980 if (hmirrorcount != 0 && prev_entry == tabledata->table[cur_index])
7981 {
7982 ;
7983
7984
7985 if (tabledata->table[cur_index] >= (256-64))
7986 release_subtable(tabledata, tabledata->table[cur_index]);
7987
7988
7989 if (tabledata->table[prev_index] >= (256-64))
7990 reallocate_subtable(tabledata, tabledata->table[prev_index]);
7991
7992
7993 tabledata->table[cur_index] = tabledata->table[prev_index];
7994 continue;
7995 }
7996 prev_index = cur_index;
7997 prev_entry = tabledata->table[cur_index];
7998 }
7999
8000
8001 for (lmirrorcount = 0; lmirrorcount < (1 << lmirrorbits); lmirrorcount++)
8002 {
8003
8004 offs_t lmirrorbase = hmirrorbase;
8005 for (i = 0; i < lmirrorbits; i++)
8006 if (lmirrorcount & (1 << i))
8007 lmirrorbase |= lmirrorbit[i];
8008
8009
8010 if (!ismatchmask)
8011 populate_table_range(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx);
8012 else
8013 populate_table_match(space, iswrite, start + lmirrorbase, end + lmirrorbase, idx);
8014 }
8015 }
8016
8017
8018 if (space->cpunum == cur_context)
8019 memory_set_context(cur_context);
8020 }
8021
8022
8023
8024
8025
8026
8027
8028 static genf *assign_dynamic_bank(int cpunum, int spacenum, offs_t start, offs_t end, offs_t mirror, int isfixed, int ismasked)
8029 {
8030 int bank;
8031
8032
8033 for (bank = 66; bank >= 1; bank--)
8034 if (!bankdata[bank].used || (bankdata[bank].dynamic && bankdata[bank].cpunum == cpunum && bankdata[bank].spacenum == spacenum && bankdata[bank].base == start))
8035 {
8036 bankdata[bank].used = 1;
8037 bankdata[bank].dynamic = 1;
8038 bankdata[bank].cpunum = cpunum;
8039 bankdata[bank].spacenum = spacenum;
8040 bankdata[bank].base = start;
8041 bankdata[bank].end = end;
8042 ;
8043 return ((genf *)(bank));
8044 }
8045
8046
8047 osd_die("cpu #%d: ran out of banks for RAM/ROM regions!\n", cpunum);
8048 return ((void *)0);
8049 }
8050
8051
8052
8053
8054
8055
8056
8057 static UINT8 get_handler_index(handler_data *table, genf *handler, const char *handler_name, offs_t start, offs_t end, offs_t mask)
8058 {
8059 int i;
8060
8061 start &= mask;
8062
8063
8064 if (((FPTR)(handler) < 72))
8065 {
8066 i = (FPTR)handler;
8067 if (((FPTR)(handler) >= 1 && (FPTR)(handler) <= (68 - 1)))
8068 {
8069 table[i].offset = start;
8070 table[i].top = end;
8071 table[i].mask = mask;
8072 table[i].name = handler_name;
8073 }
8074 return i;
8075 }
8076
8077
8078 for (i = 72; i < (256-64); i++)
8079 {
8080 if (table[i].handler.generic == ((void *)0))
8081 {
8082 table[i].handler.generic = handler;
8083 table[i].offset = start;
8084 table[i].top = end;
8085 table[i].mask = mask;
8086 table[i].name = handler_name;
8087 return i;
8088 }
8089 if (table[i].handler.generic == handler && table[i].offset == start && table[i].mask == mask)
8090 return i;
8091 }
8092 return 0;
8093 }
8094
8095
8096
8097
8098
8099
8100
8101 static void populate_table_range(addrspace_data *space, int iswrite, offs_t start, offs_t stop, UINT8 handler)
8102 {
8103 table_data *tabledata = iswrite ? &space->write : &space->read;
8104 offs_t l2mask = (1 << (32 - 18)) - 1;
8105 offs_t l1start = start >> (32 - 18);
8106 offs_t l2start = start & l2mask;
8107 offs_t l1stop = stop >> (32 - 18);
8108 offs_t l2stop = stop & l2mask;
8109 offs_t l1index;
8110
8111
8112 if (start > stop)
8113 return;
8114
8115
8116 if (l2start != 0)
8117 {
8118 UINT8 *subtable = open_subtable(tabledata, l1start);
8119
8120
8121 if (l1start == l1stop)
8122 {
8123 memset(&subtable[l2start], handler, l2stop - l2start + 1);
8124 close_subtable(tabledata, l1start);
8125 return;
8126 }
8127
8128
8129 memset(&subtable[l2start], handler, (1 << (32 - 18)) - l2start);
8130 close_subtable(tabledata, l1start);
8131 if (l1start != (offs_t)~0) l1start++;
8132 }
8133
8134
8135 if (l2stop != l2mask)
8136 {
8137 UINT8 *subtable = open_subtable(tabledata, l1stop);
8138
8139
8140 memset(&subtable[0], handler, l2stop + 1);
8141 close_subtable(tabledata, l1stop);
8142
8143
8144 if (l1start == l1stop)
8145 return;
8146 if (l1stop != 0) l1stop--;
8147 }
8148
8149
8150 for (l1index = l1start; l1index <= l1stop; l1index++)
8151 {
8152
8153 if (tabledata->table[l1index] >= (256-64))
8154 release_subtable(tabledata, tabledata->table[l1index]);
8155 tabledata->table[l1index] = handler;
8156 }
8157 }
8158
8159
8160
8161
8162
8163
8164
8165 static void populate_table_match(addrspace_data *space, int iswrite, offs_t matchval, offs_t matchmask, UINT8 handler)
8166 {
8167 table_data *tabledata = iswrite ? &space->write : &space->read;
8168 int lowermask, lowermatch;
8169 int uppermask, uppermatch;
8170 int l1index, l2index;
8171
8172
8173 matchval &= matchmask;
8174
8175
8176 lowermask = matchmask & ((1<<(32 - 18))-1);
8177 lowermatch = matchval & ((1<<(32 - 18))-1);
8178
8179
8180 uppermask = matchmask >> (32 - 18);
8181 uppermatch = matchval >> (32 - 18);
8182
8183
8184 if (lowermask == 0)
8185 {
8186
8187 for (l1index = 0; l1index <= (space->mask >> (32 - 18)); l1index++)
8188 if ((l1index & uppermatch) == uppermask)
8189 {
8190
8191 if (tabledata->table[l1index] >= (256-64))
8192 release_subtable(tabledata, tabledata->table[l1index]);
8193 tabledata->table[l1index] = handler;
8194 }
8195 }
8196
8197
8198 else
8199 {
8200
8201 for (l1index = 0; l1index <= (space->mask >> (32 - 18)); l1index++)
8202 if ((l1index & uppermatch) == uppermask)
8203 {
8204 UINT8 *subtable = open_subtable(tabledata, l1index);
8205
8206
8207 for (l2index = 0; l2index < (1 << (32 - 18)); l2index++)
8208 if ((l2index & lowermask) == lowermatch)
8209 subtable[l2index] = handler;
8210 close_subtable(tabledata, l1index);
8211 }
8212 }
8213 }
8214
8215
8216
8217
8218
8219
8220
8221 static UINT8 allocate_subtable(table_data *tabledata)
8222 {
8223
8224 while (1)
8225 {
8226 UINT8 subindex;
8227
8228
8229 for (subindex = 0; subindex < 64; subindex++)
8230 if (tabledata->subtable[subindex].usecount == 0)
8231 {
8232
8233 if (subindex >= tabledata->subtable_alloc)
8234 {
8235 tabledata->subtable_alloc += 8;
8236 tabledata->table = realloc(tabledata->table, (1 << 18) + (tabledata->subtable_alloc << (32 - 18)));
8237 if (!tabledata->table)
8238 osd_die("error: ran out of memory allocating memory subtable\n");
8239 }
8240
8241
8242 tabledata->subtable[subindex].usecount++;
8243 return subindex + (256-64);
8244 }
8245
8246
8247 if (!merge_subtables(tabledata))
8248 osd_die("Ran out of subtables!\n");
8249 }
8250
8251
8252 return 0;
8253 }
8254
8255
8256
8257
8258
8259
8260
8261 static void reallocate_subtable(table_data *tabledata, UINT8 subentry)
8262 {
8263 UINT8 subindex = subentry - (256-64);
8264
8265
8266 if (tabledata->subtable[subindex].usecount <= 0)
8267 osd_die("Called reallocate_subtable on a table with a usecount of 0\n");
8268
8269
8270 tabledata->subtable[subindex].usecount++;
8271 }
8272
8273
8274
8275
8276
8277
8278
8279 static int merge_subtables(table_data *tabledata)
8280 {
8281 int merged = 0;
8282 UINT8 subindex;
8283
8284 ;
8285
8286
8287 for (subindex = 0; subindex < 64; subindex++)
8288 if (!tabledata->subtable[subindex].checksum_valid && tabledata->subtable[subindex].usecount != 0)
8289 {
8290 UINT32 *subtable = (UINT32 *)(&(tabledata)->table[(1 << 18) + (((subindex + (256-64)) - (256-64)) << (32 - 18))]);
8291 UINT32 checksum = 0;
8292 int l2index;
8293
8294
8295 for (l2index = 0; l2index < (1 << (32 - 18))/4; l2index++)
8296 checksum += subtable[l2index];
8297 tabledata->subtable[subindex].checksum = checksum;
8298 tabledata->subtable[subindex].checksum_valid = 1;
8299 }
8300
8301
8302 for (subindex = 0; subindex < 64; subindex++)
8303 if (tabledata->subtable[subindex].usecount != 0)
8304 {
8305 UINT8 *subtable = (&(tabledata)->table[(1 << 18) + (((subindex + (256-64)) - (256-64)) << (32 - 18))]);
8306 UINT32 checksum = tabledata->subtable[subindex].checksum;
8307 UINT8 sumindex;
8308
8309 for (sumindex = subindex + 1; sumindex < 64; sumindex++)
8310 if (tabledata->subtable[sumindex].usecount != 0 &&
8311 tabledata->subtable[sumindex].checksum == checksum &&
8312 !memcmp(subtable, (&(tabledata)->table[(1 << 18) + (((sumindex + (256-64)) - (256-64)) << (32 - 18))]), 1 << (32 - 18)))
8313 {
8314 int l1index;
8315
8316 ;
8317
8318
8319 for (l1index = 0; l1index <= (0xffffffffUL >> (32 - 18)); l1index++)
8320 if (tabledata->table[l1index] == sumindex + (256-64))
8321 {
8322 release_subtable(tabledata, sumindex + (256-64));
8323 reallocate_subtable(tabledata, subindex + (256-64));
8324 tabledata->table[l1index] = subindex + (256-64);
8325 merged++;
8326 }
8327 }
8328 }
8329
8330 return merged;
8331 }
8332
8333
8334
8335
8336
8337
8338
8339 static void release_subtable(table_data *tabledata, UINT8 subentry)
8340 {
8341 UINT8 subindex = subentry - (256-64);
8342
8343
8344 if (tabledata->subtable[subindex].usecount <= 0)
8345 osd_die("Called release_subtable on a table with a usecount of 0\n");
8346
8347
8348 tabledata->subtable[subindex].usecount--;
8349 if (tabledata->subtable[subindex].usecount == 0)
8350 tabledata->subtable[subindex].checksum = 0;
8351 }
8352
8353
8354
8355
8356
8357
8358
8359 static UINT8 *open_subtable(table_data *tabledata, offs_t l1index)
8360 {
8361 UINT8 subentry = tabledata->table[l1index];
8362
8363
8364 if (subentry < (256-64))
8365 {
8366 UINT8 newentry = allocate_subtable(tabledata);
8367 memset((&(tabledata)->table[(1 << 18) + (((newentry) - (256-64)) << (32 - 18))]), subentry, 1 << (32 - 18));
8368 tabledata->table[l1index] = newentry;
8369 tabledata->subtable[newentry - (256-64)].checksum = (subentry + (subentry << 8) + (subentry << 16) + (subentry << 24)) * ((1 << (32 - 18))/4);
8370 subentry = newentry;
8371 }
8372
8373
8374 else if (tabledata->subtable[subentry - (256-64)].usecount > 1)
8375 {
8376 UINT8 newentry = allocate_subtable(tabledata);
8377 memcpy((&(tabledata)->table[(1 << 18) + (((newentry) - (256-64)) << (32 - 18))]), (&(tabledata)->table[(1 << 18) + (((subentry) - (256-64)) << (32 - 18))]), 1 << (32 - 18));
8378 release_subtable(tabledata, subentry);
8379 tabledata->table[l1index] = newentry;
8380 tabledata->subtable[newentry - (256-64)].checksum = tabledata->subtable[subentry - (256-64)].checksum;
8381 subentry = newentry;
8382 }
8383
8384
8385 tabledata->subtable[subentry - (256-64)].checksum_valid = 0;
8386
8387
8388 return (&(tabledata)->table[(1 << 18) + (((subentry) - (256-64)) << (32 - 18))]);
8389 }
8390
8391
8392
8393
8394
8395
8396 static void close_subtable(table_data *tabledata, offs_t l1index)
8397 {
8398
8399 }
8400
8401
8402
8403
8404
8405
8406
8407 static int amentry_needs_backing_store(int cpunum, int spacenum, const address_map *map)
8408 {
8409 int handler;
8410
8411 if ((((map)->flags & 0x01) != 0))
8412 return 0;
8413 if (map->base)
8414 return 1;
8415
8416 handler = (int)map->write.handler;
8417 if (handler >= 0 && handler < 72)
8418 {
8419 if (handler != 0 &&
8420 handler != 69 &&
8421 handler != 70 &&
8422 handler != 71)
8423 return 1;
8424 }
8425
8426 handler = (int)map->read.handler;
8427 if (handler >= 0 && handler < 72)
8428 {
8429 if (handler != 0 &&
8430 (handler < 1 || handler > 1 + 66 - 1) &&
8431 (handler != 69 || spacenum != 0 || map->start >= memory_region_length(REGION_CPU1 + cpunum)) &&
8432 handler != 70 &&
8433 handler != 71)
8434 return 1;
8435 }
8436
8437 return 0;
8438 }
8439
8440
8441
8442
8443
8444
8445
8446 static int allocate_memory(void)
8447 {
8448 int cpunum, spacenum;
8449
8450
8451 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
8452 for (spacenum = 0; spacenum < 3; spacenum++)
8453 if (cpudata[cpunum].spacemask & (1 << spacenum))
8454 {
8455 addrspace_data *space = &cpudata[cpunum].space[spacenum];
8456 address_map *map, *unassigned = ((void *)0);
8457 int start_count = memory_block_count;
8458 int i;
8459
8460
8461
8462 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8463 if (!(((map)->flags & 0x01) != 0) && map->memory)
8464 {
8465 if (!(((map)->flags & 0x02) != 0))
8466 allocate_memory_block(cpunum, spacenum, map->start, map->end, map->memory);
8467 else
8468 allocate_memory_block(cpunum, spacenum, map->start, map->start + map->mask, map->memory);
8469 }
8470
8471
8472 for (i = start_count; i < memory_block_count; i++)
8473 unassigned = assign_intersecting_blocks(space, memory_block_list[i].start, memory_block_list[i].end, memory_block_list[i].data);
8474
8475
8476 if (!unassigned)
8477 unassigned = assign_intersecting_blocks(space, ~0, 0, ((void *)0));
8478
8479
8480 while (unassigned)
8481 {
8482 offs_t curstart, curend;
8483 int changed;
8484 void *block;
8485
8486
8487 curstart = unassigned->start / 65536;
8488 if (!(((unassigned)->flags & 0x02) != 0))
8489 curend = unassigned->end / 65536;
8490 else
8491 curend = (unassigned->start + unassigned->mask) / 65536;
8492
8493
8494 do
8495 {
8496 changed = 0;
8497
8498
8499 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8500 if (!(((map)->flags & 0x01) != 0) && !map->memory && map != unassigned && amentry_needs_backing_store(cpunum, spacenum, map))
8501 {
8502 offs_t blockstart, blockend;
8503
8504
8505 blockstart = map->start / 65536;
8506 if (!(((map)->flags & 0x02) != 0))
8507 blockend = map->end / 65536;
8508 else
8509 blockend = (map->start + map->mask) / 65536;
8510
8511
8512 if (blockstart <= curend + 1 && blockend >= curstart - 1)
8513 {
8514 if (blockstart < curstart)
8515 curstart = blockstart, changed = 1;
8516 if (blockend > curend)
8517 curend = blockend, changed = 1;
8518 }
8519 }
8520 } while (changed);
8521
8522
8523 curstart = curstart * 65536;
8524 curend = curend * 65536 + (65536 - 1);
8525 block = allocate_memory_block(cpunum, spacenum, curstart, curend, ((void *)0));
8526
8527
8528 unassigned = assign_intersecting_blocks(space, curstart, curend, block);
8529 }
8530 }
8531
8532 return 1;
8533 }
8534
8535
8536
8537
8538
8539
8540
8541 static void *allocate_memory_block(int cpunum, int spacenum, offs_t start, offs_t end, void *memory)
8542 {
8543 memory_block *block = &memory_block_list[memory_block_count];
8544 int allocatemem = (memory == ((void *)0));
8545
8546 ;
8547
8548
8549 if (allocatemem)
8550 {
8551 memory = auto_malloc(end - start + 1);
8552 memset(memory, 0, end - start + 1);
8553 }
8554
8555
8556 register_for_save(cpunum, spacenum, start, memory, end - start + 1);
8557
8558
8559 block->cpunum = cpunum;
8560 block->spacenum = spacenum;
8561 block->isallocated = allocatemem;
8562 block->start = start;
8563 block->end = end;
8564 block->data = memory;
8565 memory_block_count++;
8566 return memory;
8567 }
8568
8569
8570
8571
8572
8573
8574
8575 static void register_for_save(int cpunum, int spacenum, offs_t start, void *base, size_t numbytes)
8576 {
8577 char name[256];
8578
8579 sprintf(name, "%d.%08x-%08x", spacenum, start, (int)(start + numbytes - 1));
8580 switch (cpudata[cpunum].space[spacenum].dbits)
8581 {
8582 case 8:
8583 state_save_register_UINT8 ("memory", cpunum, name, base, numbytes);
8584 break;
8585 case 16:
8586 state_save_register_UINT16("memory", cpunum, name, base, numbytes/2);
8587 break;
8588 case 32:
8589 state_save_register_UINT32("memory", cpunum, name, base, numbytes/4);
8590 break;
8591 case 64:
8592 state_save_register_UINT64("memory", cpunum, name, base, numbytes/8);
8593 break;
8594 }
8595 }
8596
8597
8598
8599
8600
8601
8602
8603 static address_map *assign_intersecting_blocks(addrspace_data *space, offs_t start, offs_t end, UINT8 *base)
8604 {
8605 address_map *map, *unassigned = ((void *)0);
8606
8607
8608 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8609 if (!(((map)->flags & 0x01) != 0))
8610 {
8611
8612 if (!map->memory)
8613 {
8614
8615 if (map->share && shared_ptr[map->share])
8616 {
8617 map->memory = shared_ptr[map->share];
8618 ;
8619 }
8620
8621
8622 else
8623 {
8624 if (!(((map)->flags & 0x02) != 0))
8625 {
8626 if (map->start >= start && map->end <= end)
8627 {
8628 map->memory = base + (map->start - start);
8629 ;
8630 }
8631 }
8632 else
8633 {
8634 if (map->start >= start && map->start + map->mask <= end)
8635 {
8636 map->memory = base + (map->start - start);
8637 ;
8638 }
8639 }
8640 }
8641 }
8642
8643
8644 if (map->memory && map->share && !shared_ptr[map->share])
8645 shared_ptr[map->share] = map->memory;
8646
8647
8648 if (!map->memory && !unassigned && amentry_needs_backing_store(space->cpunum, space->spacenum, map))
8649 unassigned = map;
8650 }
8651
8652 return unassigned;
8653 }
8654
8655
8656
8657
8658
8659
8660 static void reattach_banks(void)
8661 {
8662 int banknum;
8663
8664
8665 for (banknum = 1; banknum <= 66; banknum++)
8666 if (bankdata[banknum].used && !bankdata[banknum].dynamic)
8667 {
8668
8669 if (bankdata[banknum].curentry != 64)
8670 bank_ptr[banknum] = bankdata[banknum].entry[bankdata[banknum].curentry];
8671 }
8672 }
8673
8674
8675
8676
8677
8678
8679
8680 static int find_memory(void)
8681 {
8682 int cpunum, spacenum, banknum;
8683
8684
8685 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
8686 for (spacenum = 0; spacenum < 3; spacenum++)
8687 if (cpudata[cpunum].spacemask & (1 << spacenum))
8688 {
8689 addrspace_data *space = &cpudata[cpunum].space[spacenum];
8690 const address_map *map;
8691
8692
8693 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8694 if (!(((map)->flags & 0x01) != 0))
8695 {
8696
8697 if (map->base) *map->base = map->memory;
8698 if (map->size)
8699 {
8700 if (!(((map)->flags & 0x02) != 0))
8701 *map->size = map->end - map->start + 1;
8702 else
8703 *map->size = map->mask + 1;
8704 }
8705 }
8706 }
8707
8708
8709 for (banknum = 1; banknum <= 66; banknum++)
8710 if (bankdata[banknum].used)
8711 {
8712 address_map *map;
8713
8714
8715 for (map = cpudata[bankdata[banknum].cpunum].space[bankdata[banknum].spacenum].adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8716 if (!(((map)->flags & 0x01) != 0) && map->start == bankdata[banknum].base)
8717 {
8718 bank_ptr[banknum] = map->memory;
8719 ;
8720 break;
8721 }
8722
8723
8724 if (!bankdata[banknum].dynamic && bankdata[banknum].curentry != 64)
8725 bank_ptr[banknum] = bankdata[banknum].entry[bankdata[banknum].curentry];
8726 }
8727
8728
8729 state_save_register_func_postload(reattach_banks);
8730
8731 return 1;
8732 }
8733 # 2281 "src/memory.c"
8734 static void *memory_find_base(int cpunum, int spacenum, int readwrite, offs_t offset)
8735 {
8736 addrspace_data *space = &cpudata[cpunum].space[spacenum];
8737 address_map *map;
8738 memory_block *block;
8739 int blocknum;
8740
8741 ;
8742
8743
8744 for (map = space->adjmap; map && !(((map)->flags & 0x04) != 0); map++)
8745 if (!(((map)->flags & 0x01) != 0))
8746 {
8747 offs_t maskoffs = offset & map->mask;
8748 if (!(((map)->flags & 0x02) != 0))
8749 {
8750 if (maskoffs >= map->start && maskoffs <= map->end)
8751 {
8752 ;
8753 return (UINT8 *)map->memory + (maskoffs - map->start);
8754 }
8755 }
8756 else
8757 {
8758 if ((maskoffs & map->end) == map->start)
8759 {
8760 ;
8761 return (UINT8 *)map->memory + (maskoffs - map->start);
8762 }
8763 }
8764 }
8765
8766
8767 for (blocknum = 0, block = memory_block_list; blocknum < memory_block_count; blocknum++, block++)
8768 if (block->cpunum == cpunum && block->spacenum == spacenum && block->start <= offset && block->end > offset)
8769 {
8770 ;
8771 return block->data + offset - block->start;
8772 }
8773
8774 ;
8775 return ((void *)0);
8776 }
8777 # 2695 "src/memory.c"
8778 UINT8 program_read_byte_8(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler8)(address); } while (0); return 0; }
8779 void program_write_byte_8(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler8)(address, data)); ; return; } while (0);}
8780
8781 UINT8 program_read_byte_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 1)]; } while (0); else { int shift = 8 * (~address & 1); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8782 UINT16 program_read_word_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8783 void program_write_byte_16be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 1)] = data); ; return; } while (0); else { int shift = 8 * (~address & 1); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8784 void program_write_word_16be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8785
8786 UINT8 program_read_byte_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 1); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8787 UINT16 program_read_word_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8788 void program_write_byte_16le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 1); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8789 void program_write_word_16le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8790
8791 UINT8 program_read_byte_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 3)]; } while (0); else { int shift = 8 * (~address & 3); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8792 UINT16 program_read_word_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 2)]; } while (0); else { int shift = 8 * (~address & 2); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8793 UINT32 program_read_dword_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8794 void program_write_byte_32be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 3)] = data); ; return; } while (0); else { int shift = 8 * (~address & 3); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8795 void program_write_word_32be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 2)] = data); ; return; } while (0); else { int shift = 8 * (~address & 2); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8796 void program_write_dword_32be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8797
8798 UINT8 program_read_byte_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 3); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8799 UINT16 program_read_word_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 2); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8800 UINT32 program_read_dword_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8801 void program_write_byte_32le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 3); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8802 void program_write_word_32le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 2); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8803 void program_write_dword_32le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8804
8805 UINT8 program_read_byte_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 7)]; } while (0); else { int shift = 8 * (~address & 7); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8806 UINT16 program_read_word_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 6)]; } while (0); else { int shift = 8 * (~address & 6); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8807 UINT32 program_read_dword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][((address) ^ 4)]; } while (0); else { int shift = 8 * (~address & 4); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8808 UINT64 program_read_qword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8809 void program_write_byte_64be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 7)] = data); ; return; } while (0); else { int shift = 8 * (~address & 7); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8810 void program_write_word_64be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 6)] = data); ; return; } while (0); else { int shift = 8 * (~address & 6); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8811 void program_write_dword_64be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][((address) ^ 4)] = data); ; return; } while (0); else { int shift = 8 * (~address & 4); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8812 void program_write_qword_64be(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8813
8814 UINT8 program_read_byte_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 7); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8815 UINT16 program_read_word_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 6); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8816 UINT32 program_read_dword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 4); do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8817 UINT64 program_read_qword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].readhandlers[entry].offset) & active_address_space[0].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[0].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8818 void program_write_byte_64le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~0; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 7); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8819 void program_write_word_64le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~1; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 6); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8820 void program_write_dword_64le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~3; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 4); do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8821 void program_write_qword_64le(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[0].addrmask & ~7; entry = active_address_space[0].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[0].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[0].writehandlers[entry].offset) & active_address_space[0].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[0].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8822
8823
8824
8825
8826
8827
8828 UINT8 data_read_byte_8(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler8)(address); } while (0); return 0; }
8829 void data_write_byte_8(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler8)(address, data)); ; return; } while (0);}
8830
8831 UINT8 data_read_byte_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 1)]; } while (0); else { int shift = 8 * (~address & 1); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8832 UINT16 data_read_word_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8833 void data_write_byte_16be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 1)] = data); ; return; } while (0); else { int shift = 8 * (~address & 1); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8834 void data_write_word_16be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8835
8836 UINT8 data_read_byte_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 1); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8837 UINT16 data_read_word_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8838 void data_write_byte_16le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 1); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8839 void data_write_word_16le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8840
8841 UINT8 data_read_byte_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 3)]; } while (0); else { int shift = 8 * (~address & 3); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8842 UINT16 data_read_word_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 2)]; } while (0); else { int shift = 8 * (~address & 2); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8843 UINT32 data_read_dword_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8844 void data_write_byte_32be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 3)] = data); ; return; } while (0); else { int shift = 8 * (~address & 3); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8845 void data_write_word_32be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 2)] = data); ; return; } while (0); else { int shift = 8 * (~address & 2); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8846 void data_write_dword_32be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8847
8848 UINT8 data_read_byte_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 3); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8849 UINT16 data_read_word_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 2); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8850 UINT32 data_read_dword_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8851 void data_write_byte_32le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 3); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8852 void data_write_word_32le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 2); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8853 void data_write_dword_32le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8854
8855 UINT8 data_read_byte_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 7)]; } while (0); else { int shift = 8 * (~address & 7); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8856 UINT16 data_read_word_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 6)]; } while (0); else { int shift = 8 * (~address & 6); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8857 UINT32 data_read_dword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][((address) ^ 4)]; } while (0); else { int shift = 8 * (~address & 4); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8858 UINT64 data_read_qword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8859 void data_write_byte_64be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 7)] = data); ; return; } while (0); else { int shift = 8 * (~address & 7); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8860 void data_write_word_64be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 6)] = data); ; return; } while (0); else { int shift = 8 * (~address & 6); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8861 void data_write_dword_64be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][((address) ^ 4)] = data); ; return; } while (0); else { int shift = 8 * (~address & 4); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8862 void data_write_qword_64be(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8863
8864 UINT8 data_read_byte_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 7); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8865 UINT16 data_read_word_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 6); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8866 UINT32 data_read_dword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 4); do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8867 UINT64 data_read_qword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].readhandlers[entry].offset) & active_address_space[1].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[1].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8868 void data_write_byte_64le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~0; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 7); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8869 void data_write_word_64le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~1; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 6); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8870 void data_write_dword_64le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~3; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 4); do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8871 void data_write_qword_64le(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[1].addrmask & ~7; entry = active_address_space[1].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[1].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[1].writehandlers[entry].offset) & active_address_space[1].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[1].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8872
8873
8874
8875
8876
8877
8878 UINT8 io_read_byte_8(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler8)(address); } while (0); return 0; }
8879 void io_write_byte_8(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler8)(address, data)); ; return; } while (0);}
8880
8881 UINT8 io_read_byte_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 1)]; } while (0); else { int shift = 8 * (~address & 1); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8882 UINT16 io_read_word_16be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8883 void io_write_byte_16be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 1)] = data); ; return; } while (0); else { int shift = 8 * (~address & 1); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8884 void io_write_word_16be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8885
8886 UINT8 io_read_byte_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 1); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> (1), ~((UINT16)0xff << shift)) >> shift; } while (0); } return 0; }
8887 UINT16 io_read_word_16le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler16)(address >> 1,0); } while (0); return 0; }
8888 void io_write_byte_16le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 1); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> (1), (UINT16)data << shift, ~((UINT16)0xff << shift))); ; return; } while (0); } }
8889 void io_write_word_16le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler16)(address >> 1, data, 0)); ; return; } while (0);}
8890
8891 UINT8 io_read_byte_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 3)]; } while (0); else { int shift = 8 * (~address & 3); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8892 UINT16 io_read_word_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 2)]; } while (0); else { int shift = 8 * (~address & 2); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8893 UINT32 io_read_dword_32be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8894 void io_write_byte_32be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 3)] = data); ; return; } while (0); else { int shift = 8 * (~address & 3); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8895 void io_write_word_32be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 2)] = data); ; return; } while (0); else { int shift = 8 * (~address & 2); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8896 void io_write_dword_32be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8897
8898 UINT8 io_read_byte_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 3); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xff << shift)) >> shift; } while (0); } return 0; }
8899 UINT16 io_read_word_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 2); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> (2), ~((UINT32)0xffff << shift)) >> shift; } while (0); } return 0; }
8900 UINT32 io_read_dword_32le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler32)(address >> 2,0); } while (0); return 0; }
8901 void io_write_byte_32le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 3); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xff << shift))); ; return; } while (0); } }
8902 void io_write_word_32le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 2); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> (2), (UINT32)data << shift, ~((UINT32)0xffff << shift))); ; return; } while (0); } }
8903 void io_write_dword_32le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler32)(address >> 2, data, 0)); ; return; } while (0);}
8904
8905 UINT8 io_read_byte_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][((address) ^ 7)]; } while (0); else { int shift = 8 * (~address & 7); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8906 UINT16 io_read_word_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][((address) ^ 6)]; } while (0); else { int shift = 8 * (~address & 6); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8907 UINT32 io_read_dword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][((address) ^ 4)]; } while (0); else { int shift = 8 * (~address & 4); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8908 UINT64 io_read_qword_64be(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8909 void io_write_byte_64be(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][((address) ^ 7)] = data); ; return; } while (0); else { int shift = 8 * (~address & 7); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8910 void io_write_word_64be(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][((address) ^ 6)] = data); ; return; } while (0); else { int shift = 8 * (~address & 6); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8911 void io_write_dword_64be(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][((address) ^ 4)] = data); ; return; } while (0); else { int shift = 8 * (~address & 4); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8912 void io_write_qword_64be(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8913
8914 UINT8 io_read_byte_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 7); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xff << shift)) >> shift; } while (0); } return 0; }
8915 UINT16 io_read_word_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT16 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 6); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffff << shift)) >> shift; } while (0); } return 0; }
8916 UINT32 io_read_dword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT32 *)&bank_ptr[entry][(address)]; } while (0); else { int shift = 8 * (address & 4); do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> (3), ~((UINT64)0xffffffff << shift)) >> shift; } while (0); } return 0; }
8917 UINT64 io_read_qword_64le(offs_t address) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].readlookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].readlookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].readhandlers[entry].offset) & active_address_space[2].readhandlers[entry].mask; if (entry < 68) do { ; return *(UINT64 *)&bank_ptr[entry][address]; } while (0); else do { ; return (*active_address_space[2].readhandlers[entry].handler.read.handler64)(address >> 3,0); } while (0); return 0; }
8918 void io_write_byte_64le(offs_t address, UINT8 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~0; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 7); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xff << shift))); ; return; } while (0); } }
8919 void io_write_word_64le(offs_t address, UINT16 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~1; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT16 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 6); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffff << shift))); ; return; } while (0); } }
8920 void io_write_dword_64le(offs_t address, UINT32 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~3; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT32 *)&bank_ptr[entry][(address)] = data); ; return; } while (0); else { int shift = 8 * (address & 4); do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> (3), (UINT64)data << shift, ~((UINT64)0xffffffff << shift))); ; return; } while (0); } }
8921 void io_write_qword_64le(offs_t address, UINT64 data) { UINT32 entry; do { ; } while (0); address &= active_address_space[2].addrmask & ~7; entry = active_address_space[2].writelookup[((address) >> (32 - 18))]; if (entry >= (256-64)) entry = active_address_space[2].writelookup[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((address) & ((1 << (32 - 18)) - 1)))];; ; address = (address - active_address_space[2].writehandlers[entry].offset) & active_address_space[2].writehandlers[entry].mask; if (entry < 68) do { (*(UINT64 *)&bank_ptr[entry][address] = data); ; return; } while (0); else do { ((*active_address_space[2].writehandlers[entry].handler.write.handler64)(address >> 3, data, 0)); ; return; } while (0);}
8922
8923
8924
8925
8926
8927
8928 UINT8 cpu_readop_safe(offs_t offset)
8929 {
8930 activecpu_set_opbase(offset);
8931 return (opcode_base[(offset) & opcode_mask]);
8932 }
8933
8934 UINT16 cpu_readop16_safe(offs_t offset)
8935 {
8936 activecpu_set_opbase(offset);
8937 return (*(UINT16 *)&opcode_base[(offset) & opcode_mask]);
8938 }
8939
8940 UINT32 cpu_readop32_safe(offs_t offset)
8941 {
8942 activecpu_set_opbase(offset);
8943 return (*(UINT32 *)&opcode_base[(offset) & opcode_mask]);
8944 }
8945
8946 UINT64 cpu_readop64_safe(offs_t offset)
8947 {
8948 activecpu_set_opbase(offset);
8949 return (*(UINT64 *)&opcode_base[(offset) & opcode_mask]);
8950 }
8951
8952 UINT8 cpu_readop_arg_safe(offs_t offset)
8953 {
8954 activecpu_set_opbase(offset);
8955 return (opcode_arg_base[(offset) & opcode_mask]);
8956 }
8957
8958 UINT16 cpu_readop_arg16_safe(offs_t offset)
8959 {
8960 activecpu_set_opbase(offset);
8961 return (*(UINT16 *)&opcode_arg_base[(offset) & opcode_mask]);
8962 }
8963
8964 UINT32 cpu_readop_arg32_safe(offs_t offset)
8965 {
8966 activecpu_set_opbase(offset);
8967 return (*(UINT32 *)&opcode_arg_base[(offset) & opcode_mask]);
8968 }
8969
8970 UINT64 cpu_readop_arg64_safe(offs_t offset)
8971 {
8972 activecpu_set_opbase(offset);
8973 return (*(UINT64 *)&opcode_arg_base[(offset) & opcode_mask]);
8974 }
8975
8976
8977
8978
8979
8980
8981 static UINT8 mrh8_unmap_program(__attribute__((__unused__)) offs_t offset)
8982 {
8983 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte read from %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)));
8984 return cpudata[cpu_getactivecpu()].space[0].unmap;
8985 }
8986 static UINT16 mrh16_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask)
8987 {
8988 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word read from %08X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), mem_mask ^ 0xffff);
8989 return cpudata[cpu_getactivecpu()].space[0].unmap;
8990 }
8991 static UINT32 mrh32_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask)
8992 {
8993 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword read from %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), mem_mask ^ 0xffffffff);
8994 return cpudata[cpu_getactivecpu()].space[0].unmap;
8995 }
8996 static UINT64 mrh64_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask)
8997 {
8998 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
8999 return cpudata[cpu_getactivecpu()].space[0].unmap;
9000 }
9001
9002 static void mwh8_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data)
9003 {
9004 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte write to %08X = %02X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), data);
9005 }
9006 static void mwh16_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask)
9007 {
9008 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), data, mem_mask ^ 0xffff);
9009 }
9010 static void mwh32_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask)
9011 {
9012 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), data, mem_mask ^ 0xffffffff);
9013 }
9014 static void mwh64_unmap_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask)
9015 {
9016 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[0])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[0])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[0])->ashift)), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9017 }
9018
9019 static UINT8 mrh8_unmap_data(__attribute__((__unused__)) offs_t offset)
9020 {
9021 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte read from %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)));
9022 return cpudata[cpu_getactivecpu()].space[1].unmap;
9023 }
9024 static UINT16 mrh16_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask)
9025 {
9026 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word read from %08X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), mem_mask ^ 0xffff);
9027 return cpudata[cpu_getactivecpu()].space[1].unmap;
9028 }
9029 static UINT32 mrh32_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask)
9030 {
9031 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword read from %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), mem_mask ^ 0xffffffff);
9032 return cpudata[cpu_getactivecpu()].space[1].unmap;
9033 }
9034 static UINT64 mrh64_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask)
9035 {
9036 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9037 return cpudata[cpu_getactivecpu()].space[1].unmap;
9038 }
9039
9040 static void mwh8_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data)
9041 {
9042 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte write to %08X = %02X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), data);
9043 }
9044 static void mwh16_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask)
9045 {
9046 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), data, mem_mask ^ 0xffff);
9047 }
9048 static void mwh32_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask)
9049 {
9050 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), data, mem_mask ^ 0xffffffff);
9051 }
9052 static void mwh64_unmap_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask)
9053 {
9054 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[1])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[1])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[1])->ashift)), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9055 }
9056
9057 static UINT8 mrh8_unmap_io(__attribute__((__unused__)) offs_t offset)
9058 {
9059 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte read from %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)));
9060 return cpudata[cpu_getactivecpu()].space[2].unmap;
9061 }
9062 static UINT16 mrh16_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask)
9063 {
9064 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word read from %08X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), mem_mask ^ 0xffff);
9065 return cpudata[cpu_getactivecpu()].space[2].unmap;
9066 }
9067 static UINT32 mrh32_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask)
9068 {
9069 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword read from %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), mem_mask ^ 0xffffffff);
9070 return cpudata[cpu_getactivecpu()].space[2].unmap;
9071 }
9072 static UINT64 mrh64_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask)
9073 {
9074 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword read from %08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9075 return cpudata[cpu_getactivecpu()].space[2].unmap;
9076 }
9077
9078 static void mwh8_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data)
9079 {
9080 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte write to %08X = %02X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), data);
9081 }
9082 static void mwh16_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask)
9083 {
9084 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word write to %08X = %04X & %04X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*2) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*2) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), data, mem_mask ^ 0xffff);
9085 }
9086 static void mwh32_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask)
9087 {
9088 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*4) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*4) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), data, mem_mask ^ 0xffffffff);
9089 }
9090 static void mwh64_unmap_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask)
9091 {
9092 if (!debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), ((offs_t)activecpu_get_info_int(CPUINFO_INT_REGISTER + (REG_PC))), (((&cpudata[cpu_getactivecpu()].space[2])->ashift < 0) ? ((offset*8) >> -(&cpudata[cpu_getactivecpu()].space[2])->ashift) : ((offset*8) << (&cpudata[cpu_getactivecpu()].space[2])->ashift)), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32) ^ 0xffffffff, (int)(mem_mask & 0xffffffff) ^ 0xffffffff);
9093 }
9094
9095
9096
9097
9098
9099
9100 static UINT8 mrh8_nop_program(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9101 static UINT16 mrh16_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9102 static UINT32 mrh32_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9103 static UINT64 mrh64_nop_program(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[0].unmap; }
9104
9105 static UINT8 mrh8_nop_data(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9106 static UINT16 mrh16_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9107 static UINT32 mrh32_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9108 static UINT64 mrh64_nop_data(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[1].unmap; }
9109
9110 static UINT8 mrh8_nop_io(__attribute__((__unused__)) offs_t offset) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9111 static UINT16 mrh16_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9112 static UINT32 mrh32_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9113 static UINT64 mrh64_nop_io(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 mem_mask) { return cpudata[cpu_getactivecpu()].space[2].unmap; }
9114
9115 static void mwh8_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT8 data) { }
9116 static void mwh16_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT16 data, __attribute__((__unused__)) UINT16 mem_mask) { }
9117 static void mwh32_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT32 data, __attribute__((__unused__)) UINT32 mem_mask) { }
9118 static void mwh64_nop(__attribute__((__unused__)) offs_t offset, __attribute__((__unused__)) UINT64 data, __attribute__((__unused__)) UINT64 mem_mask) { }
9119
9120
9121
9122
9123
9124
9125
9126 static genf *get_static_handler(int databits, int readorwrite, int spacenum, int which)
9127 {
9128 static const struct
9129 {
9130 UINT8 databits;
9131 UINT8 handlernum;
9132 UINT8 spacenum;
9133 genf * read;
9134 genf * write;
9135 } static_handler_list[] =
9136 {
9137 { 8, 71, 0, (genf *)mrh8_unmap_program, (genf *)mwh8_unmap_program },
9138 { 8, 71, 1, (genf *)mrh8_unmap_data, (genf *)mwh8_unmap_data },
9139 { 8, 71, 2, (genf *)mrh8_unmap_io, (genf *)mwh8_unmap_io },
9140 { 8, 70, 0, (genf *)mrh8_nop_program, (genf *)mwh8_nop },
9141 { 8, 70, 1, (genf *)mrh8_nop_data, (genf *)mwh8_nop },
9142 { 8, 70, 2, (genf *)mrh8_nop_io, (genf *)mwh8_nop },
9143
9144 { 16, 71, 0, (genf *)mrh16_unmap_program,(genf *)mwh16_unmap_program },
9145 { 16, 71, 1, (genf *)mrh16_unmap_data, (genf *)mwh16_unmap_data },
9146 { 16, 71, 2, (genf *)mrh16_unmap_io, (genf *)mwh16_unmap_io },
9147 { 16, 70, 0, (genf *)mrh16_nop_program, (genf *)mwh16_nop },
9148 { 16, 70, 1, (genf *)mrh16_nop_data, (genf *)mwh16_nop },
9149 { 16, 70, 2, (genf *)mrh16_nop_io, (genf *)mwh16_nop },
9150
9151 { 32, 71, 0, (genf *)mrh32_unmap_program,(genf *)mwh32_unmap_program },
9152 { 32, 71, 1, (genf *)mrh32_unmap_data, (genf *)mwh32_unmap_data },
9153 { 32, 71, 2, (genf *)mrh32_unmap_io, (genf *)mwh32_unmap_io },
9154 { 32, 70, 0, (genf *)mrh32_nop_program, (genf *)mwh32_nop },
9155 { 32, 70, 1, (genf *)mrh32_nop_data, (genf *)mwh32_nop },
9156 { 32, 70, 2, (genf *)mrh32_nop_io, (genf *)mwh32_nop },
9157
9158 { 64, 71, 0, (genf *)mrh64_unmap_program,(genf *)mwh64_unmap_program },
9159 { 64, 71, 1, (genf *)mrh64_unmap_data, (genf *)mwh64_unmap_data },
9160 { 64, 71, 2, (genf *)mrh64_unmap_io, (genf *)mwh64_unmap_io },
9161 { 64, 70, 0, (genf *)mrh64_nop_program, (genf *)mwh64_nop },
9162 { 64, 70, 1, (genf *)mrh64_nop_data, (genf *)mwh64_nop },
9163 { 64, 70, 2, (genf *)mrh64_nop_io, (genf *)mwh64_nop },
9164 };
9165 int tablenum;
9166
9167 for (tablenum = 0; tablenum < sizeof(static_handler_list) / sizeof(static_handler_list[0]); tablenum++)
9168 if (static_handler_list[tablenum].databits == databits && static_handler_list[tablenum].handlernum == which)
9169 if (static_handler_list[tablenum].spacenum == 0xff || static_handler_list[tablenum].spacenum == spacenum)
9170 return readorwrite ? static_handler_list[tablenum].write : static_handler_list[tablenum].read;
9171
9172 return ((void *)0);
9173 }
9174
9175
9176
9177
9178
9179
9180 static const char *handler_to_string(const table_data *table, UINT8 entry)
9181 {
9182 static const char *strings[] =
9183 {
9184 "invalid", "bank 1", "bank 2", "bank 3",
9185 "bank 4", "bank 5", "bank 6", "bank 7",
9186 "bank 8", "bank 9", "bank 10", "bank 11",
9187 "bank 12", "bank 13", "bank 14", "bank 15",
9188 "bank 16", "bank 17", "bank 18", "bank 19",
9189 "bank 20", "bank 21", "bank 22", "bank 23",
9190 "bank 24", "bank 25", "bank 26", "bank 27",
9191 "bank 28", "bank 29", "bank 30", "bank 31",
9192 "bank 32", "ram[33]", "ram[34]", "ram[35]",
9193 "ram[36]", "ram[37]", "ram[38]", "ram[39]",
9194 "ram[40]", "ram[41]", "ram[42]", "ram[43]",
9195 "ram[44]", "ram[45]", "ram[46]", "ram[47]",
9196 "ram[48]", "ram[49]", "ram[50]", "ram[51]",
9197 "ram[52]", "ram[53]", "ram[54]", "ram[55]",
9198 "ram[56]", "ram[57]", "ram[58]", "ram[59]",
9199 "ram[60]", "ram[61]", "ram[62]", "ram[63]",
9200 "ram[64]", "ram[65]", "ram[66]", "ram[67]",
9201 "ram[68]", "rom", "nop", "unmapped"
9202 };
9203
9204
9205 if (entry < 72)
9206 return strings[entry];
9207 else
9208 return table->handlers[entry].name ? table->handlers[entry].name : "???";
9209 }
9210
9211 static void dump_map(FILE *file, const addrspace_data *space, const table_data *table)
9212 {
9213 int l1count = 1 << 18;
9214 int l2count = 1 << (32 - 18);
9215 UINT8 lastentry = 71;
9216 int entrymatches = 0;
9217 int i, j;
9218
9219
9220 fprintf(file, " Address bits = %d\n", space->abits);
9221 fprintf(file, " Data bits = %d\n", space->dbits);
9222 fprintf(file, " L1 bits = %d\n", 18);
9223 fprintf(file, " L2 bits = %d\n", (32 - 18));
9224 fprintf(file, " Address mask = %X\n", space->mask);
9225 fprintf(file, "\n");
9226
9227
9228 for (i = 0; i < l1count; i++)
9229 {
9230 UINT8 entry = table->table[i];
9231
9232
9233 if (entry < (256-64) && entry == lastentry)
9234 {
9235 entrymatches++;
9236 continue;
9237 }
9238
9239
9240 if (lastentry < (256-64) && lastentry != 71)
9241 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9242 (i - entrymatches) << (32 - 18),
9243 (i << (32 - 18)) - 1,
9244 lastentry,
9245 handler_to_string(table, lastentry),
9246 table->handlers[lastentry].offset);
9247
9248
9249 lastentry = entry;
9250 entrymatches = 1;
9251
9252
9253 if (entry >= (256-64))
9254 {
9255 UINT8 lastentry2 = 71;
9256 int entry2matches = 0;
9257
9258
9259 entry -= (256-64);
9260 for (j = 0; j < l2count; j++)
9261 {
9262 UINT8 entry2 = table->table[(1 << 18) + (entry << (32 - 18)) + j];
9263
9264
9265 if (entry2 < (256-64) && entry2 == lastentry2)
9266 {
9267 entry2matches++;
9268 continue;
9269 }
9270
9271
9272 if (lastentry2 < (256-64) && lastentry2 != 71)
9273 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9274 ((i << (32 - 18)) | (j - entry2matches)),
9275 ((i << (32 - 18)) | j) - 1,
9276 lastentry2,
9277 handler_to_string(table, lastentry2),
9278 table->handlers[lastentry2].offset);
9279
9280
9281 lastentry2 = entry2;
9282 entry2matches = 1;
9283 }
9284
9285
9286 if (lastentry2 < (256-64) && lastentry2 != 71)
9287 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9288 ((i << (32 - 18)) | (j - entry2matches)),
9289 ((i << (32 - 18)) | j) - 1,
9290 lastentry2,
9291 handler_to_string(table, lastentry2),
9292 table->handlers[lastentry2].offset);
9293 }
9294 }
9295
9296
9297 if (lastentry < (256-64) && lastentry != 71)
9298 fprintf(file, "%08X-%08X = %02X: %s [offset=%08X]\n",
9299 (i - entrymatches) << (32 - 18),
9300 (i << (32 - 18)) - 1,
9301 lastentry,
9302 handler_to_string(table, lastentry),
9303 table->handlers[lastentry].offset);
9304 }
9305
9306 void memory_dump(FILE *file)
9307 {
9308 int cpunum, spacenum;
9309
9310
9311 if (!file)
9312 return;
9313
9314
9315 for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++)
9316 for (spacenum = 0; spacenum < 3; spacenum++)
9317 if (cpudata[cpunum].space[spacenum].abits)
9318 {
9319 fprintf(file, "\n\n"
9320 "=========================================\n"
9321 "CPU %d address space %d read handler dump\n"
9322 "=========================================\n", cpunum, spacenum);
9323 dump_map(file, &cpudata[cpunum].space[spacenum], &cpudata[cpunum].space[spacenum].read);
9324
9325 fprintf(file, "\n\n"
9326 "==========================================\n"
9327 "CPU %d address space %d write handler dump\n"
9328 "==========================================\n", cpunum, spacenum);
9329 dump_map(file, &cpudata[cpunum].space[spacenum], &cpudata[cpunum].space[spacenum].write);
9330 }
9331 }
9332
9333
9334
9335
9336
9337
9338
9339 const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t offset)
9340 {
9341 addrspace_data *space = &cpudata[cpunum].space[spacenum];
9342 const table_data *table = read0_or_write1 ? &space->write : &space->read;
9343 UINT8 entry;
9344
9345
9346 offset &= space->mask;
9347 entry = table->table[((offset) >> (32 - 18))];
9348 if (entry >= (256-64))
9349 entry = table->table[((1 << 18) + (((entry) - (256-64)) << (32 - 18)) + ((offset) & ((1 << (32 - 18)) - 1)))];
9350
9351
9352 return handler_to_string(table, entry);
9353 }