Previous | 199869 Revisions | Next |
r32100 Saturday 13th September, 2014 at 10:41:04 UTC by David Haywood |
---|
Added proper NMK004 internal rom [trap15] Hooked up support for NMK004 internal rom in MAME, replacing Nicola's old simulation code [trap15, David Haywood] Fixed TLCS90 16-bit timers & support NMI in the core [trap15] Various tweaks and improvements in nmk16.c (timings, sound balance, etc.) [trap15, David Haywood] US AAF Mustang now has sound / music for the first time Much better sound / music in the following games Bio-ship Paladin, Vandyke, Black Heart, Acrobat Mission, Koutetsu Yousai Strahl, Thunder Dragon, Hacha Mecha Fighter, Super Spacefortress Macross, GunNail new clones Hacha Mecha Fighter (19th Sep. 1991, unprotected, bootleg Thunder Dragon conversion) [trap15] note, Thunder Dragon parent was not protected, I've marked it as such and removed the protection sim from it The protected Hacha Mecha Fighter set never worked properly, I've demoted it to non-working as a result, the new bootleg works with full sound and correct game logic. The protected sets don't handshake with the NMK004 so now lack sound (the sim code didn't care) note2, currently needs an ugly kludge to prevent bioship resetting periodically, the nmk004 is used as a watchdog, but it ends up hitting it slihtly too late so often resets after a few minutes, probably wants even more precise timing for timers / cores / framerate / whatever? note3, still need to tweak a few things, convert to raw video params, add 2nd buffer. |
[src/emu/cpu/tlcs90] | tlcs90.c tlcs90.h |
[src/mame] | mame.lst |
[src/mame/drivers] | nmk16.c |
[src/mame/includes] | nmk16.h |
[src/mame/machine] | nmk004.c nmk004.h |
[src/mame/video] | nmk16.c |
r32099 | r32100 | |
---|---|---|
5 | 5 | Task Force Harrier 1989 UPL 68000 Z80 YM2203 2xOKIM6295 |
6 | 6 | Many Block 1991 Bee-Oh 68000 Z80 YM2203 2xOKIM6295 |
7 | 7 | Mustang 1990 UPL 68000 NMK004 YM2203 2xOKIM6295 |
8 | Bio-ship Paladin 1990 UPL 68000 | |
8 | Bio-ship Paladin 1990 UPL 68000 NMK004 YM2203 2xOKIM6295 | |
9 | 9 | Vandyke 1990 UPL 68000 NMK004 YM2203 2xOKIM6295 |
10 | 10 | Black Heart 1991 UPL 68000 NMK004 YM2203 2xOKIM6295 |
11 | 11 | Acrobat Mission 1991 UPL 68000 NMK004 YM2203 2xOKIM6295 |
12 | Strahl 1992 UPL 68000 <unknown cpu> YM2203 2xOKIM6295 | |
13 | Thunder Dragon 1991 NMK/Tecmo 68000 <unknown cpu> YM2203 2xOKIM6295 | |
14 | Hacha Mecha Fighter 1991 NMK 68000 <unknown cpu> YM2203 2xOKIM6295 | |
15 | Macross 1992 Banpresto 68000 <unknown cpu> YM2203 2xOKIM6295 | |
12 | Strahl 1992 UPL 68000 NMK004 YM2203 2xOKIM6295 | |
13 | Thunder Dragon 1991 NMK/Tecmo 68000 NMK004 YM2203 2xOKIM6295 | |
14 | Hacha Mecha Fighter 1991 NMK 68000 NMK004 YM2203 2xOKIM6295 | |
15 | Macross 1992 Banpresto 68000 NMK004 YM2203 2xOKIM6295 | |
16 | 16 | GunNail 1993 NMK/Tecmo 68000 NMK004 YM2203 2xOKIM6295 |
17 | 17 | Macross II 1993 Banpresto 68000 Z80 YM2203 2xOKIM6295 |
18 | 18 | Thunder Dragon 2 1993 NMK 68000 Z80 YM2203 2xOKIM6295 |
r32099 | r32100 | |
29 | 29 | Nouryoku Koujou Iinkai 1995 Tecmo 68000 2xOKIM6295 |
30 | 30 | |
31 | 31 | driver by Mirko Buffoni, Richard Bush, Nicola Salmoria, Bryan McPhail, |
32 | David Haywood, | |
32 | David Haywood, R. Belmont, and trap15. | |
33 | 33 | |
34 | 34 | Afega based their hardware on the NMK hardware, not surprising considering Twin |
35 | 35 | Action is simply a hack of USSAF Mustang. |
36 | 36 | |
37 | The NMK004 CPU might be a Toshiba TLCS-90 class CPU with internal ROM in the | |
38 | 0000-1fff range. | |
37 | The NMK004 CPU is a Toshiba TMP90C840 with internal ROM. | |
38 | The dumped internal ROM has a date string of 900315 in ROM and a version number of V-00 | |
39 | 39 | |
40 | 40 | The later games (from GunNail onwards) have an higher resolution (384x224 instead |
41 | 41 | of 256x224) but the hardware is pretty much the same. It's obvious that the higher |
r32099 | r32100 | |
44 | 44 | games rely on mirror addresses to access the tilemap sequentially. |
45 | 45 | |
46 | 46 | TODO: |
47 | - NMK004 sound CPU is just (imperfectly) simulated for now. | |
47 | - tharrier performs a handshake operation which is the same as that used by the | |
48 | other games to initialize the NMK004 at boot, however it doesn't have an NMK004 | |
49 | (it uses a Z80 based sound system and also predates the NMK004) | |
50 | maybe it has a pre-NMK004 chip using the same communication protocol but used | |
51 | for protection instead. | |
48 | 52 | |
49 | - There is a handshaking operation happening on boot in most games. It happens on | |
50 | the NMK004 communication ports so I have implemented it in NMK004.c. However, | |
51 | the same handshaking also happen in tharrier, which doesn't have a NMK004! | |
52 | Therefore, it might be another protection device, which sits in the middle | |
53 | between CPU and NMK004. | |
54 | ||
55 | - Sound communication in Mustang might be incorrectly implemented (it does not | |
56 | make correct sounds with our NMK004 simulation) | |
57 | ||
58 | 53 | - Protection is patched in several games. |
59 | 54 | |
60 | 55 | - Hacha Mecha Fighter: mcu simulation is wrong/incorrect (see notes). |
r32099 | r32100 | |
64 | 59 | ships. Increasing CPU speed from 12 to 16 MHz improved it, but it's still not |
65 | 60 | 100% fixed. (the CPU speed has been verified to be 10Mhz??) |
66 | 61 | |
67 | - Hacha Mecha Fighter: (BTANB) the bomb graphics are pretty weird when the game is in | |
68 | japanese mode,but it's like this on the original game,it's just a japanese write for | |
69 | "bomb" word (I presume) | |
70 | ||
71 | 62 | - (PCB owners): Measure pixel clock / vblank duration for all of these games. |
72 | 63 | |
73 | 64 | - for the Afega games (Guardian Storm especially) the lives display has bad colours, |
74 | 65 | it doesn't matter if this is drawn with the TX layer (some sets) or the sprites (others) |
75 | 66 | so it's probably something else funky with the memory access. |
76 | 67 | |
77 | ---- | |
68 | NOT BUGS: | |
69 | - Hacha Mecha Fighter: (BTANB) the bomb graphics are pretty weird when the game | |
70 | is in japanese mode, but it's like this on the original game. | |
78 | 71 | |
79 | IRQ1 controls audio output and coin/joysticks reads | |
80 | IRQ4 controls DSW reads and vblank. | |
81 | IRQ2 points to RTE (not used). | |
72 | - Vandyke: Many enemies make very strange sounds because they seem to have no | |
73 | rate limit for making their sound effect. This is normal, it's like this on all | |
74 | PCB recordings. | |
75 | ||
82 | 76 | |
83 | 77 | ---- |
84 | 78 | |
r32099 | r32100 | |
165 | 159 | #include "includes/nmk16.h" |
166 | 160 | |
167 | 161 | |
162 | WRITE16_MEMBER(nmk16_state::nmk16_x0016_w) | |
163 | { | |
164 | // this is part of a watchdog scheme | |
165 | // generating an NMI on the NMK004 keeps a timer alive | |
166 | // if that timer expires the NMK004 resets the system | |
167 | m_nmk004->m_cpu->set_input_line(INPUT_LINE_NMI, (data & 1) ? ASSERT_LINE : CLEAR_LINE); | |
168 | } | |
169 | ||
170 | ||
171 | WRITE16_MEMBER(nmk16_state::nmk16_bioship_x0016_w) | |
172 | { | |
173 | // ugly, ugly logic invert hack, but otherwise bioship doesn't hit the NMI enough to keep the game alive! | |
174 | m_nmk004->m_cpu->set_input_line(INPUT_LINE_NMI, (data & 1) ? CLEAR_LINE : ASSERT_LINE); | |
175 | } | |
176 | ||
168 | 177 | /********************************************************** |
169 | 178 | Protection: Memory Scrambling |
170 | 179 | |
r32099 | r32100 | |
322 | 331 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
323 | 332 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
324 | 333 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
325 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
326 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ | |
334 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
335 | AM_RANGE(0x080016, 0x080017) AM_WRITE(nmk16_x0016_w) | |
327 | 336 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
328 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
337 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
329 | 338 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
330 | 339 | AM_RANGE(0x08c000, 0x08c007) AM_WRITE(vandyke_scroll_w) |
331 | 340 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
r32099 | r32100 | |
340 | 349 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
341 | 350 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
342 | 351 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
343 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
352 | // AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
344 | 353 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ |
345 | 354 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
346 | 355 | AM_RANGE(0x080010, 0x08001d) AM_WRITE(vandykeb_scroll_w) /* 10, 12, 1a, 1c */ |
347 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
356 | // AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
348 | 357 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
349 | 358 | AM_RANGE(0x08c000, 0x08c007) AM_WRITENOP /* just in case... */ |
350 | 359 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
r32099 | r32100 | |
413 | 422 | AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") |
414 | 423 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
415 | 424 | AM_RANGE(0x080004, 0x080005) AM_READ_PORT("DSW1") |
416 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) AM_WRITENOP | |
425 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) AM_WRITENOP | |
417 | 426 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
418 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP // frame number? | |
419 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
427 | AM_RANGE(0x080016, 0x080017) AM_WRITE(nmk16_x0016_w) // frame number? | |
428 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
420 | 429 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
421 | 430 | AM_RANGE(0x08c000, 0x08c001) AM_WRITE(mustang_scroll_w) |
422 | 431 | AM_RANGE(0x08c002, 0x08c087) AM_WRITENOP // ?? |
r32099 | r32100 | |
468 | 477 | AM_RANGE(0xc0002, 0xc0003) AM_READ_PORT("IN1") |
469 | 478 | AM_RANGE(0xc0008, 0xc0009) AM_READ_PORT("DSW1") |
470 | 479 | AM_RANGE(0xc000a, 0xc000b) AM_READ_PORT("DSW2") |
471 | AM_RANGE(0xc000e, 0xc000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
480 | AM_RANGE(0xc000e, 0xc000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
472 | 481 | AM_RANGE(0xc0014, 0xc0015) AM_WRITE(nmk_flipscreen_w) |
473 | AM_RANGE(0xc0016, 0xc0017) AM_WRITE | |
482 | AM_RANGE(0xc0016, 0xc0017) AM_WRITE(nmk16_x0016_w) | |
474 | 483 | AM_RANGE(0xc0018, 0xc0019) AM_WRITE(nmk_tilebank_w) |
475 | AM_RANGE(0xc001e, 0xc001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
484 | AM_RANGE(0xc001e, 0xc001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
476 | 485 | AM_RANGE(0xc4000, 0xc45ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
477 | 486 | AM_RANGE(0xc8000, 0xc8007) AM_RAM_WRITE(nmk_scroll_w) |
478 | 487 | AM_RANGE(0xcc000, 0xcffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
r32099 | r32100 | |
485 | 494 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
486 | 495 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
487 | 496 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
488 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
497 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
489 | 498 | // AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
490 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
499 | AM_RANGE(0x080016, 0x080017) AM_WRITE(nmk16_bioship_x0016_w) | |
500 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
491 | 501 | AM_RANGE(0x084000, 0x084001) AM_WRITE(bioship_bank_w) |
492 | 502 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
493 | 503 | AM_RANGE(0x08c000, 0x08c007) AM_RAM_WRITE(bioshipbg_scroll_w) |
r32099 | r32100 | |
662 | 672 | AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") |
663 | 673 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
664 | 674 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
665 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("UNK") | |
666 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
675 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") | |
676 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
667 | 677 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
678 | AM_RANGE(0x080016, 0x080017) AM_WRITE(nmk16_x0016_w) | |
668 | 679 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
669 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
680 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
670 | 681 | /* Video Region */ |
671 | 682 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
672 | 683 | AM_RANGE(0x08c000, 0x08c007) AM_WRITE(nmk_scroll_w) |
673 | 684 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
674 | 685 | AM_RANGE(0x09c000, 0x09c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_SHARE("nmk_txvideoram") |
675 | 686 | /* Main RAM, inc sprites, shared with MCU */ |
676 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM | |
687 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("mainram") // ram is shared with MCU | |
677 | 688 | ADDRESS_MAP_END |
678 | 689 | |
679 | 690 | |
r32099 | r32100 | |
890 | 901 | // AM_RANGE(0x0b9000, 0x0bdfff) AM_RAM AM_SHARE("mcu_work_ram") /* Work RAM */ |
891 | 902 | // AM_RANGE(0x0be000, 0x0befff) AM_READWRITE(mcu_shared_r,tdragon_mcu_shared_w) AM_SHARE("mcu_shared_ram") /* Work RAM */ |
892 | 903 | // AM_RANGE(0x0bf000, 0x0bffff) AM_RAM /* Work RAM */ |
893 | AM_RANGE(0x0b0000, 0x0bffff) AM_RAM | |
904 | AM_RANGE(0x0b0000, 0x0bffff) AM_RAM AM_SHARE("mainram") | |
894 | 905 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("IN0") |
895 | 906 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("IN1") |
896 | 907 | AM_RANGE(0x0c0008, 0x0c0009) AM_READ_PORT("DSW1") |
897 | 908 | AM_RANGE(0x0c000a, 0x0c000b) AM_READ_PORT("DSW2") |
898 | AM_RANGE(0x0c000e, 0x0c000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
909 | AM_RANGE(0x0c000e, 0x0c000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
899 | 910 | AM_RANGE(0x0c0014, 0x0c0015) AM_WRITE(nmk_flipscreen_w) /* Maybe */ |
911 | AM_RANGE(0x0c0016, 0x0c0017) AM_WRITE(nmk16_x0016_w) | |
900 | 912 | AM_RANGE(0x0c0018, 0x0c0019) AM_WRITE(nmk_tilebank_w) /* Tile Bank ? */ |
901 | AM_RANGE(0x0c001e, 0x0c001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
913 | AM_RANGE(0x0c001e, 0x0c001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
902 | 914 | AM_RANGE(0x0c4000, 0x0c4007) AM_RAM_WRITE(nmk_scroll_w) |
903 | 915 | AM_RANGE(0x0c8000, 0x0c87ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
904 | 916 | AM_RANGE(0x0cc000, 0x0cffff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
r32099 | r32100 | |
958 | 970 | AM_RANGE(0x80002, 0x80003) AM_READ_PORT("IN1") |
959 | 971 | AM_RANGE(0x80008, 0x80009) AM_READ_PORT("DSW1") |
960 | 972 | AM_RANGE(0x8000a, 0x8000b) AM_READ_PORT("DSW2") |
961 | AM_RANGE(0x8000e, 0x8000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
973 | AM_RANGE(0x8000e, 0x8000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
962 | 974 | AM_RANGE(0x80014, 0x80015) AM_WRITE(nmk_flipscreen_w) |
963 | AM_RANGE(0x80016, 0x80017) AM_WRITENOP /* IRQ enable? */ | |
964 | AM_RANGE(0x8001e, 0x8001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
975 | AM_RANGE(0x80016, 0x80017) AM_WRITE(nmk16_x0016_w) | |
976 | AM_RANGE(0x8001e, 0x8001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
965 | 977 | AM_RANGE(0x84000, 0x84007) AM_RAM_WRITE(nmk_scroll_w) |
966 | 978 | AM_RANGE(0x88000, 0x88007) AM_RAM_WRITE(nmk_scroll_2_w) |
967 | 979 | AM_RANGE(0x8c000, 0x8c7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
r32099 | r32100 | |
977 | 989 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
978 | 990 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
979 | 991 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
980 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
992 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
981 | 993 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
982 | AM_RANGE(0x080016, 0x080017) AM_WRITE | |
994 | AM_RANGE(0x080016, 0x080017) AM_WRITE(nmk16_x0016_w) | |
983 | 995 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
984 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
996 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
985 | 997 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
986 | 998 | AM_RANGE(0x08c000, 0x08c007) AM_RAM_WRITE(nmk_scroll_w) |
987 | 999 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") |
r32099 | r32100 | |
995 | 1007 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") |
996 | 1008 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") |
997 | 1009 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") |
998 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD("nmk004", nmk004_device, read) | |
1010 | AM_RANGE(0x08000e, 0x08000f) AM_DEVREAD8("nmk004", nmk004_device, read, 0x00ff) | |
999 | 1011 | AM_RANGE(0x080014, 0x080015) AM_WRITE(nmk_flipscreen_w) |
1000 | AM_RANGE(0x080016, 0x080017) AM_WRITE | |
1012 | AM_RANGE(0x080016, 0x080017) AM_WRITE(nmk16_x0016_w) | |
1001 | 1013 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) |
1002 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE("nmk004", nmk004_device, write) | |
1014 | AM_RANGE(0x08001e, 0x08001f) AM_DEVWRITE8("nmk004", nmk004_device, write, 0x00ff) | |
1003 | 1015 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
1004 | 1016 | AM_RANGE(0x08c000, 0x08c1ff) AM_WRITEONLY AM_SHARE("scrollram") |
1005 | 1017 | AM_RANGE(0x08c200, 0x08c3ff) AM_WRITEONLY AM_SHARE("scrollramy") |
r32099 | r32100 | |
1561 | 1573 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
1562 | 1574 | INPUT_PORTS_END |
1563 | 1575 | |
1564 | static INPUT_PORTS_START( hachamf ) | |
1576 | static INPUT_PORTS_START( hachamf_prot ) | |
1565 | 1577 | PORT_START("IN0") |
1566 | 1578 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
1567 | 1579 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
r32099 | r32100 | |
1638 | 1650 | PORT_DIPSETTING( 0x00c0, "3" ) |
1639 | 1651 | PORT_DIPSETTING( 0x0080, "4" ) |
1640 | 1652 | |
1641 | PORT_START(" | |
1653 | PORT_START("DSW2") | |
1642 | 1654 | INPUT_PORTS_END |
1643 | 1655 | |
1656 | ||
1657 | static INPUT_PORTS_START( hachamfb ) | |
1658 | PORT_START("IN0") | |
1659 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
1660 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
1661 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
1662 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) | |
1663 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) | |
1664 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
1665 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
1666 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //bryan: test mode in some games? | |
1667 | ||
1668 | PORT_START("IN1") | |
1669 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) | |
1670 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) | |
1671 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) | |
1672 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) | |
1673 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
1674 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) | |
1675 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
1676 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
1677 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
1678 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
1679 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
1680 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) | |
1681 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
1682 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
1683 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
1684 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
1685 | ||
1686 | PORT_START("DSW1") | |
1687 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") | |
1688 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
1689 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
1690 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:7") | |
1691 | PORT_DIPSETTING( 0x00, DEF_STR( English ) ) | |
1692 | PORT_DIPSETTING( 0x02, DEF_STR( Japanese ) ) | |
1693 | PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") | |
1694 | PORT_DIPSETTING( 0x04, DEF_STR( Easy ) ) | |
1695 | PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) ) | |
1696 | PORT_DIPSETTING( 0x08, DEF_STR( Hard ) ) | |
1697 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
1698 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") | |
1699 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
1700 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
1701 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") | |
1702 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
1703 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
1704 | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") | |
1705 | PORT_DIPSETTING( 0x00, "1" ) | |
1706 | PORT_DIPSETTING( 0x40, "2" ) | |
1707 | PORT_DIPSETTING( 0xc0, "3" ) | |
1708 | PORT_DIPSETTING( 0x80, "4" ) | |
1709 | ||
1710 | PORT_START("DSW2") | |
1711 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") | |
1712 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1713 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
1714 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") | |
1715 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1716 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
1717 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") // turning these 3 off results in a broken freeplay mode, probably a leftover from the bootleg not simulating coinage settings | |
1718 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1719 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) | |
1720 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") // ^ | |
1721 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1722 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) | |
1723 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") // ^ | |
1724 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1725 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) | |
1726 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") // likewise turning these 3 off | |
1727 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1728 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) | |
1729 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") // ^ | |
1730 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1731 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) | |
1732 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") // ^ | |
1733 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
1734 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) | |
1735 | INPUT_PORTS_END | |
1736 | ||
1644 | 1737 | static INPUT_PORTS_START( strahl ) |
1645 | 1738 | PORT_START("IN0") |
1646 | 1739 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
r32099 | r32100 | |
1873 | 1966 | PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) |
1874 | 1967 | INPUT_PORTS_END |
1875 | 1968 | |
1876 | static INPUT_PORTS_START( tdragon ) | |
1969 | static INPUT_PORTS_START( tdragon_prot ) | |
1877 | 1970 | PORT_START("IN0") |
1878 | 1971 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
1879 | 1972 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) |
r32099 | r32100 | |
1953 | 2046 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
1954 | 2047 | INPUT_PORTS_END |
1955 | 2048 | |
2049 | static INPUT_PORTS_START( tdragon ) | |
2050 | PORT_START("IN0") | |
2051 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) | |
2052 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) | |
2053 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
2054 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) | |
2055 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) | |
2056 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // TEST in service mode | |
2057 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
2058 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
2059 | ||
2060 | PORT_START("IN1") | |
2061 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) | |
2062 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) | |
2063 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) | |
2064 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) | |
2065 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
2066 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) | |
2067 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
2068 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
2069 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
2070 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
2071 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
2072 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) | |
2073 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
2074 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
2075 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
2076 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
2077 | ||
2078 | PORT_START("DSW1") | |
2079 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8") | |
2080 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) | |
2081 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
2082 | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") /* The manual states this dip is "Unused" */ | |
2083 | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) | |
2084 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
2085 | PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5") | |
2086 | PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) | |
2087 | PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) ) | |
2088 | PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) | |
2089 | PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) ) | |
2090 | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4") /* The manual states this dip is "Unused" */ | |
2091 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) | |
2092 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
2093 | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") /* The manual states this dip is "Unused" */ | |
2094 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) | |
2095 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
2096 | PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1") | |
2097 | PORT_DIPSETTING( 0x0000, "1" ) | |
2098 | PORT_DIPSETTING( 0x0040, "2" ) | |
2099 | PORT_DIPSETTING( 0x00c0, "3" ) | |
2100 | PORT_DIPSETTING( 0x0080, "4" ) | |
2101 | ||
2102 | PORT_START("DSW2") // reverse bit order compared to tdragon_prot? | |
2103 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:8") | |
2104 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
2105 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
2106 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7") | |
2107 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) | |
2108 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) | |
2109 | PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:4,5,6") | |
2110 | PORT_DIPSETTING( 0x0010, DEF_STR( 4C_1C ) ) | |
2111 | PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) ) | |
2112 | PORT_DIPSETTING( 0x0018, DEF_STR( 2C_1C ) ) | |
2113 | PORT_DIPSETTING( 0x001c, DEF_STR( 1C_1C ) ) | |
2114 | PORT_DIPSETTING( 0x000c, DEF_STR( 1C_2C ) ) | |
2115 | PORT_DIPSETTING( 0x0014, DEF_STR( 1C_3C ) ) | |
2116 | PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) | |
2117 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) | |
2118 | PORT_DIPNAME( 0x00e0, 0x00e0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3") | |
2119 | PORT_DIPSETTING( 0x0080, DEF_STR( 4C_1C ) ) | |
2120 | PORT_DIPSETTING( 0x0040, DEF_STR( 3C_1C ) ) | |
2121 | PORT_DIPSETTING( 0x00c0, DEF_STR( 2C_1C ) ) | |
2122 | PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_1C ) ) | |
2123 | PORT_DIPSETTING( 0x0060, DEF_STR( 1C_2C ) ) | |
2124 | PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_3C ) ) | |
2125 | PORT_DIPSETTING( 0x0020, DEF_STR( 1C_4C ) ) | |
2126 | PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) | |
2127 | INPUT_PORTS_END | |
2128 | ||
1956 | 2129 | static INPUT_PORTS_START( tdragonb ) |
1957 | 2130 | PORT_START("IN0") |
1958 | 2131 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
r32099 | r32100 | |
3608 | 3781 | { |
3609 | 3782 | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); |
3610 | 3783 | } |
3784 | /* | |
3785 | ---- | |
3611 | 3786 | |
3787 | IRQ1 - Half-blanking interrupt | |
3788 | IRQ2 - Display interrupt | |
3789 | IRQ4 - V-blanking interrupt | |
3790 | ||
3791 | Timing: | |
3792 | ||
3793 | 17.8 msec | |
3794 | |<---------------------------->| | |
3795 | | 3.45 msec | 14.35 msec | | |
3796 | |<--------->|<---------------->| | |
3797 | | | | 8.9 msec | | | |
3798 | | | |<-------->| | | |
3799 | LV4 LV2 LV1 LV1 | |
3800 | | DISPLAY | |
3801 | |<->|<--->| | | |
3802 | |256| 694 | | | |
3803 | | us| usec| | | |
3804 | | | DMA | | | |
3805 | ||
3806 | CPU is stopped during DMA | |
3807 | ||
3808 | */ | |
3809 | ||
3810 | // todo:total scanlines is 263, adjust according to that! | |
3811 | // todo: replace with raw screen timings | |
3612 | 3812 | TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline) |
3613 | 3813 | { |
3814 | const int NUM_SCANLINES = 256; | |
3815 | const int IRQ1_SCANLINE = 25; // guess | |
3816 | const int VBIN_SCANLINE = 0; | |
3817 | const int VBOUT_sCANLINE = 240; | |
3818 | const int SPRDMA_SCANLINE = 241; // 256 USEC after VBOUT | |
3819 | ||
3614 | 3820 | int scanline = param; |
3615 | 3821 | |
3616 | if(scanline == 240) // vblank-out irq | |
3617 | m_maincpu->set_input_line(4, HOLD_LINE); | |
3822 | if(scanline == VBOUT_sCANLINE) // vblank-out irq | |
3823 | m_maincpu->set_input_line(4, HOLD_LINE); | |
3618 | 3824 | |
3619 | /* This is either vblank-in or sprite dma irq complete, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous | |
3620 | cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */ | |
3621 | if(scanline == 0) | |
3622 | m_maincpu->set_input_line(2, HOLD_LINE); | |
3623 | } | |
3825 | if (scanline == SPRDMA_SCANLINE) | |
3826 | { | |
3827 | memcpy(m_spriteram_old2, m_mainram + m_sprdma_base / 2, 0x1000); | |
3828 | // todo, sprites are also framebuffered, so needs one more frame of delay | |
3829 | } | |
3624 | 3830 | |
3625 | /* bee-oh board, almost certainly it has different timings */ | |
3626 | TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::manybloc_scanline) | |
3627 | { | |
3628 | int scanline = param; | |
3831 | /* Vblank-in irq, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous | |
3832 | cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */ | |
3833 | if(scanline == VBIN_SCANLINE) | |
3834 | m_maincpu->set_input_line(2, HOLD_LINE); | |
3629 | 3835 | |
3630 | if(scanline == 248) // vblank-out irq | |
3631 | m_maincpu->set_input_line(4, HOLD_LINE); | |
3836 | /* time from IRQ2 to first IRQ1 fire. is not stated, 25 is a guess */ | |
3837 | if(scanline == IRQ1_SCANLINE) | |
3838 | m_maincpu->set_input_line(1, HOLD_LINE); | |
3632 | 3839 | |
3633 | /* This is either vblank-in or sprite dma irq complete */ | |
3634 | if(scanline == 0) | |
3635 | m_maincpu->set_input_line(2, HOLD_LINE); | |
3840 | /* 8.9ms from first IRQ1 to second IRQ1 fire. approx 128 lines (half frame time) */ | |
3841 | if(scanline == IRQ1_SCANLINE+(NUM_SCANLINES/2)) // if this happens too late bioship sprites will glitch on the left edge | |
3842 | m_maincpu->set_input_line(1, HOLD_LINE); | |
3636 | 3843 | } |
3637 | 3844 | |
3638 | static MACHINE_CONFIG_START( tharrier, nmk16_state ) | |
3845 | #define NMK_HACKY_INTERRUPT_TIMING \ | |
3846 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) \ | |
3639 | 3847 | |
3640 | /* basic machine hardware */ | |
3641 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */ | |
3642 | MCFG_CPU_PROGRAM_MAP(tharrier_map) | |
3643 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
3644 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
3848 | #define NMK_HACKY_SCREEN_LOWRES \ | |
3849 | MCFG_SCREEN_ADD("screen", RASTER) \ | |
3850 | MCFG_SCREEN_REFRESH_RATE(56.18) \ | |
3851 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3450)) \ | |
3852 | MCFG_SCREEN_SIZE(256, 256) \ | |
3853 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) \ | |
3854 | MCFG_SCREEN_PALETTE("palette") | |
3645 | 3855 | |
3646 | MCFG_CPU_ADD("audiocpu", Z80, 3000000) | |
3647 | MCFG_CPU_PROGRAM_MAP(tharrier_sound_map) | |
3648 | MCFG_CPU_IO_MAP(tharrier_sound_io_map) | |
3649 | ||
3650 | /* video hardware */ | |
3651 | MCFG_SCREEN_ADD("screen", RASTER) | |
3652 | MCFG_SCREEN_REFRESH_RATE(56) | |
3653 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3654 | MCFG_SCREEN_SIZE(256, 256) | |
3655 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
3656 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_tharrier) | |
3657 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3856 | #define NMK_HACKY_SCREEN_HIRES \ | |
3857 | MCFG_SCREEN_ADD("screen", RASTER) \ | |
3858 | MCFG_SCREEN_REFRESH_RATE(56.18) \ | |
3859 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3450)) \ | |
3860 | MCFG_SCREEN_SIZE(512, 256) \ | |
3861 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) \ | |
3658 | 3862 | MCFG_SCREEN_PALETTE("palette") |
3659 | 3863 | |
3660 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", tharrier) | |
3661 | MCFG_PALETTE_ADD("palette", 512) | |
3662 | MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) | |
3663 | MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) | |
3664 | 3864 | |
3665 | /* sound hardware */ | |
3666 | MCFG_SPEAKER_STANDARD_MONO("mono") | |
3667 | 3865 | |
3668 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) | |
3669 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(nmk16_state, ym2203_irqhandler)) | |
3670 | MCFG_SOUND_ROUTE(0, "mono", 0.50) | |
3671 | MCFG_SOUND_ROUTE(1, "mono", 0.50) | |
3672 | MCFG_SOUND_ROUTE(2, "mono", 0.50) | |
3673 | MCFG_SOUND_ROUTE(3, "mono", 2.00) | |
3674 | 3866 | |
3675 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) | |
3676 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) | |
3867 | static MACHINE_CONFIG_START( tharrier, nmk16_state ) | |
3677 | 3868 | |
3678 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) | |
3679 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) | |
3680 | MACHINE_CONFIG_END | |
3681 | ||
3682 | static MACHINE_CONFIG_START( manybloc, nmk16_state ) | |
3683 | ||
3684 | 3869 | /* basic machine hardware */ |
3685 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10? MHz - check */ | |
3686 | MCFG_CPU_PROGRAM_MAP(manybloc_map) | |
3687 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 56)/* this needs to equal the framerate on this, rather than being double it .. */ | |
3688 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, manybloc_scanline, "screen", 0, 1) | |
3870 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */ | |
3871 | MCFG_CPU_PROGRAM_MAP(tharrier_map) | |
3872 | NMK_HACKY_INTERRUPT_TIMING | |
3689 | 3873 | |
3690 | 3874 | MCFG_CPU_ADD("audiocpu", Z80, 3000000) |
3691 | 3875 | MCFG_CPU_PROGRAM_MAP(tharrier_sound_map) |
3692 | 3876 | MCFG_CPU_IO_MAP(tharrier_sound_io_map) |
3693 | 3877 | |
3694 | 3878 | /* video hardware */ |
3695 | MCFG_SCREEN_ADD("screen", RASTER) | |
3696 | MCFG_SCREEN_REFRESH_RATE(56) | |
3697 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3698 | MCFG_SCREEN_SIZE(256, 256) | |
3699 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
3700 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_manybloc) | |
3701 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3702 | MCFG_SCREEN_PALETTE("palette") | |
3879 | NMK_HACKY_SCREEN_LOWRES | |
3880 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_tharrier) | |
3881 | ||
3703 | 3882 | |
3704 | 3883 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", tharrier) |
3705 | 3884 | MCFG_PALETTE_ADD("palette", 512) |
3706 | 3885 | MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) |
3707 | ||
3708 | 3886 | MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) |
3709 | 3887 | |
3710 | 3888 | /* sound hardware */ |
r32099 | r32100 | |
3715 | 3893 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
3716 | 3894 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
3717 | 3895 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
3718 | MCFG_SOUND_ROUTE(3, "mono", | |
3896 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
3719 | 3897 | |
3720 | 3898 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
3721 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
3899 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3722 | 3900 | |
3723 | 3901 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
3724 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
3902 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3725 | 3903 | MACHINE_CONFIG_END |
3726 | 3904 | |
3727 | 3905 | static MACHINE_CONFIG_START( mustang, nmk16_state ) |
r32099 | r32100 | |
3729 | 3907 | /* basic machine hardware */ |
3730 | 3908 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */ |
3731 | 3909 | MCFG_CPU_PROGRAM_MAP(mustang_map) |
3732 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
3733 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
3910 | NMK_HACKY_INTERRUPT_TIMING | |
3734 | 3911 | |
3735 | 3912 | /* video hardware */ |
3736 | MCFG_SCREEN_ADD("screen", RASTER) | |
3737 | MCFG_SCREEN_REFRESH_RATE(56) | |
3738 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3739 | MCFG_SCREEN_SIZE(256, 256) | |
3740 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
3913 | NMK_HACKY_SCREEN_LOWRES | |
3741 | 3914 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
3742 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3743 | MCFG_SCREEN_PALETTE("palette") | |
3915 | ||
3744 | 3916 | |
3745 | 3917 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
3746 | 3918 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
3751 | 3923 | /* sound hardware */ |
3752 | 3924 | MCFG_SPEAKER_STANDARD_MONO("mono") |
3753 | 3925 | |
3754 | MCFG_NMK004_ADD("nmk004") | |
3926 | MCFG_NMK004_ADD("nmk004", 8000000) | |
3755 | 3927 | |
3756 | 3928 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
3757 | 3929 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
3758 | 3930 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
3759 | 3931 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
3760 | 3932 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
3761 | MCFG_SOUND_ROUTE(3, "mono", | |
3933 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
3762 | 3934 | |
3763 | 3935 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
3764 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
3936 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3765 | 3937 | |
3766 | 3938 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
3767 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
3939 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3768 | 3940 | MACHINE_CONFIG_END |
3769 | 3941 | |
3770 | 3942 | static MACHINE_CONFIG_START( mustangb, nmk16_state ) |
r32099 | r32100 | |
3772 | 3944 | /* basic machine hardware */ |
3773 | 3945 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */ |
3774 | 3946 | MCFG_CPU_PROGRAM_MAP(mustangb_map) |
3775 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
3776 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
3947 | NMK_HACKY_INTERRUPT_TIMING | |
3777 | 3948 | |
3778 | 3949 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
3779 | 3950 | |
3780 | 3951 | /* video hardware */ |
3781 | MCFG_SCREEN_ADD("screen", RASTER) | |
3782 | MCFG_SCREEN_REFRESH_RATE(56) | |
3783 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3784 | MCFG_SCREEN_SIZE(256, 256) | |
3785 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
3952 | NMK_HACKY_SCREEN_LOWRES | |
3786 | 3953 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
3787 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3788 | MCFG_SCREEN_PALETTE("palette") | |
3954 | ||
3789 | 3955 | |
3790 | 3956 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
3791 | 3957 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
3806 | 3972 | /* basic machine hardware */ |
3807 | 3973 | MCFG_CPU_ADD("maincpu", M68000, BIOSHIP_CRYSTAL1 ) /* 10.0 MHz (verified) */ |
3808 | 3974 | MCFG_CPU_PROGRAM_MAP(bioship_map) |
3809 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 100)/* 112 breaks the title screen */ | |
3810 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
3975 | NMK_HACKY_INTERRUPT_TIMING | |
3811 | 3976 | |
3812 | 3977 | /* video hardware */ |
3813 | MCFG_SCREEN_ADD("screen", RASTER) | |
3814 | MCFG_SCREEN_REFRESH_RATE(56) | |
3815 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3816 | MCFG_SCREEN_SIZE(256, 256) | |
3817 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
3978 | NMK_HACKY_SCREEN_LOWRES | |
3818 | 3979 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_bioship) |
3819 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3820 | MCFG_SCREEN_PALETTE("palette") | |
3980 | ||
3821 | 3981 | |
3822 | 3982 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", bioship) |
3823 | 3983 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
3828 | 3988 | /* sound hardware */ |
3829 | 3989 | MCFG_SPEAKER_STANDARD_MONO("mono") |
3830 | 3990 | |
3831 | MCFG_NMK004_ADD("nmk004") | |
3991 | MCFG_NMK004_ADD("nmk004", 8000000) | |
3832 | 3992 | |
3833 | 3993 | MCFG_SOUND_ADD("ymsnd", YM2203, BIOSHIP_CRYSTAL2 / 8) /* 1.5 Mhz (verified) */ |
3834 | 3994 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
3835 | 3995 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
3836 | 3996 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
3837 | 3997 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
3838 | MCFG_SOUND_ROUTE(3, "mono", | |
3998 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
3839 | 3999 | |
3840 | MCFG_OKIM6295_ADD("oki1", BIOSHIP_CRYSTAL2 / 3 , OKIM6295_PIN7_HIGH) /* 4.0 Mhz, Pin 7 High (verified) */ | |
3841 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) | |
4000 | MCFG_OKIM6295_ADD("oki1", BIOSHIP_CRYSTAL2 / 3 , OKIM6295_PIN7_LOW) /* 4.0 Mhz, Pin 7 High (verified) */ | |
4001 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3842 | 4002 | |
3843 | MCFG_OKIM6295_ADD("oki2", BIOSHIP_CRYSTAL2 / 3 , OKIM6295_PIN7_HIGH) /* 4.0 Mhz, Pin 7 High (verified) */ | |
3844 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) | |
4003 | MCFG_OKIM6295_ADD("oki2", BIOSHIP_CRYSTAL2 / 3 , OKIM6295_PIN7_LOW) /* 4.0 Mhz, Pin 7 High (verified) */ | |
4004 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3845 | 4005 | MACHINE_CONFIG_END |
3846 | 4006 | |
3847 | 4007 | static MACHINE_CONFIG_START( vandyke, nmk16_state ) |
r32099 | r32100 | |
3849 | 4009 | /* basic machine hardware */ |
3850 | 4010 | MCFG_CPU_ADD("maincpu", M68000, XTAL_10MHz) /* 68000p12 running at 10Mhz, verified on pcb */ |
3851 | 4011 | MCFG_CPU_PROGRAM_MAP(vandyke_map) |
3852 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
3853 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
4012 | NMK_HACKY_INTERRUPT_TIMING | |
3854 | 4013 | |
3855 | 4014 | /* video hardware */ |
3856 | MCFG_SCREEN_ADD("screen", RASTER) | |
3857 | MCFG_SCREEN_REFRESH_RATE(56) | |
3858 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3859 | MCFG_SCREEN_SIZE(256, 256) | |
3860 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4015 | NMK_HACKY_SCREEN_LOWRES | |
3861 | 4016 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
3862 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3863 | MCFG_SCREEN_PALETTE("palette") | |
4017 | ||
3864 | 4018 | |
3865 | 4019 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
3866 | 4020 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
3871 | 4025 | /* sound hardware */ |
3872 | 4026 | MCFG_SPEAKER_STANDARD_MONO("mono") |
3873 | 4027 | |
3874 | MCFG_NMK004_ADD("nmk004") | |
4028 | MCFG_NMK004_ADD("nmk004", 8000000) | |
3875 | 4029 | |
3876 | 4030 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8) /* verified on pcb */ |
3877 | 4031 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
3878 | 4032 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
3879 | 4033 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
3880 | 4034 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
3881 | MCFG_SOUND_ROUTE(3, "mono", | |
4035 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
3882 | 4036 | |
3883 | 4037 | MCFG_OKIM6295_ADD("oki1", XTAL_12MHz/3, OKIM6295_PIN7_LOW) /* verified on pcb */ |
3884 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4038 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3885 | 4039 | |
3886 | 4040 | MCFG_OKIM6295_ADD("oki2", XTAL_12MHz/3, OKIM6295_PIN7_LOW) /* verified on pcb */ |
3887 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4041 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3888 | 4042 | MACHINE_CONFIG_END |
3889 | 4043 | |
3890 | 4044 | static MACHINE_CONFIG_START( vandykeb, nmk16_state ) |
r32099 | r32100 | |
3892 | 4046 | /* basic machine hardware */ |
3893 | 4047 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */ |
3894 | 4048 | MCFG_CPU_PROGRAM_MAP(vandykeb_map) |
3895 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
3896 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
4049 | NMK_HACKY_INTERRUPT_TIMING | |
3897 | 4050 | |
3898 | 4051 | MCFG_CPU_ADD("mcu", PIC16C57, 12000000) /* 3MHz */ |
3899 | 4052 | MCFG_DEVICE_DISABLE() |
3900 | 4053 | |
3901 | 4054 | /* video hardware */ |
3902 | MCFG_SCREEN_ADD("screen", RASTER) | |
3903 | MCFG_SCREEN_REFRESH_RATE(56) | |
3904 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3905 | MCFG_SCREEN_SIZE(256, 256) | |
3906 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4055 | NMK_HACKY_SCREEN_LOWRES | |
3907 | 4056 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
3908 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3909 | MCFG_SCREEN_PALETTE("palette") | |
4057 | ||
3910 | 4058 | |
3911 | 4059 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
3912 | 4060 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
3917 | 4065 | /* sound hardware */ |
3918 | 4066 | MCFG_SPEAKER_STANDARD_MONO("mono") |
3919 | 4067 | |
3920 | MCFG_NMK004_ADD("nmk004") | |
3921 | ||
3922 | 4068 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
3923 | 4069 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
3924 | 4070 | MACHINE_CONFIG_END |
r32099 | r32100 | |
3928 | 4074 | /* basic machine hardware */ |
3929 | 4075 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz (verified on pcb) */ |
3930 | 4076 | MCFG_CPU_PROGRAM_MAP(acrobatm_map) |
3931 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
3932 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
4077 | NMK_HACKY_INTERRUPT_TIMING | |
3933 | 4078 | |
3934 | 4079 | /* video hardware */ |
3935 | MCFG_SCREEN_ADD("screen", RASTER) | |
3936 | MCFG_SCREEN_REFRESH_RATE(56) | |
3937 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3938 | MCFG_SCREEN_SIZE(256, 256) | |
3939 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4080 | NMK_HACKY_SCREEN_LOWRES | |
3940 | 4081 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
3941 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3942 | MCFG_SCREEN_PALETTE("palette") | |
4082 | ||
3943 | 4083 | |
3944 | 4084 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
3945 | 4085 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
3950 | 4090 | /* sound hardware */ |
3951 | 4091 | MCFG_SPEAKER_STANDARD_MONO("mono") |
3952 | 4092 | |
3953 | MCFG_NMK004_ADD("nmk004") | |
4093 | MCFG_NMK004_ADD("nmk004", 8000000) | |
3954 | 4094 | |
3955 | 4095 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) /* (verified on pcb) */ |
3956 | 4096 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
3957 | 4097 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
3958 | 4098 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
3959 | 4099 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
3960 | MCFG_SOUND_ROUTE(3, "mono", | |
4100 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
3961 | 4101 | |
3962 | 4102 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) /* (verified on pcb) on the pcb pin7 is not connected to gnd or +5v! */ |
3963 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4103 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3964 | 4104 | |
3965 | 4105 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) /* (verified on pcb) on the pcb pin7 is not connected to gnd or +5v! */ |
3966 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4106 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
3967 | 4107 | MACHINE_CONFIG_END |
3968 | 4108 | |
3969 | 4109 | |
r32099 | r32100 | |
3972 | 4112 | /* basic machine hardware */ |
3973 | 4113 | MCFG_CPU_ADD("maincpu", M68000, 10000000) |
3974 | 4114 | MCFG_CPU_PROGRAM_MAP(tdragonb_map) |
3975 | //MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
3976 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */ | |
3977 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
4115 | NMK_HACKY_INTERRUPT_TIMING | |
3978 | 4116 | |
3979 | 4117 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
3980 | 4118 | |
3981 | 4119 | /* video hardware */ |
3982 | MCFG_SCREEN_ADD("screen", RASTER) | |
3983 | MCFG_SCREEN_REFRESH_RATE(56) | |
3984 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
3985 | MCFG_SCREEN_SIZE(256, 256) | |
3986 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4120 | NMK_HACKY_SCREEN_LOWRES | |
3987 | 4121 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
3988 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
3989 | MCFG_SCREEN_PALETTE("palette") | |
4122 | ||
3990 | 4123 | |
3991 | 4124 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
3992 | 4125 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4003 | 4136 | /* basic machine hardware */ |
4004 | 4137 | MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz) /* verified on pcb */ |
4005 | 4138 | MCFG_CPU_PROGRAM_MAP(tdragon_map) |
4006 | //MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4007 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */ | |
4008 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
4139 | NMK_HACKY_INTERRUPT_TIMING | |
4009 | 4140 | |
4010 | 4141 | /* video hardware */ |
4011 | MCFG_SCREEN_ADD("screen", RASTER) | |
4012 | MCFG_SCREEN_REFRESH_RATE(56) | |
4013 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4014 | MCFG_SCREEN_SIZE(256, 256) | |
4015 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4142 | NMK_HACKY_SCREEN_LOWRES | |
4016 | 4143 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
4017 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4018 | MCFG_SCREEN_PALETTE("palette") | |
4144 | ||
4019 | 4145 | |
4020 | 4146 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
4021 | 4147 | MCFG_PALETTE_ADD("palette", 1024) |
4022 | 4148 | MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) |
4023 | 4149 | |
4024 | 4150 | MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) |
4025 | MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, tdragon_mcu_sim, attotime::from_hz(10000)) | |
4026 | 4151 | |
4027 | 4152 | /* sound hardware */ |
4028 | 4153 | MCFG_SPEAKER_STANDARD_MONO("mono") |
4029 | 4154 | |
4030 | MCFG_NMK004_ADD("nmk004") | |
4155 | MCFG_NMK004_ADD("nmk004", 8000000) | |
4031 | 4156 | |
4032 | 4157 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8) /* verified on pcb */ |
4033 | 4158 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
4034 | 4159 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
4035 | 4160 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
4036 | 4161 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
4037 | MCFG_SOUND_ROUTE(3, "mono", | |
4162 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4038 | 4163 | |
4039 | 4164 | MCFG_OKIM6295_ADD("oki1", XTAL_8MHz/2, OKIM6295_PIN7_LOW) /* verified on pcb */ |
4040 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4165 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4041 | 4166 | |
4042 | 4167 | MCFG_OKIM6295_ADD("oki2", XTAL_8MHz/2, OKIM6295_PIN7_LOW) /* verified on pcb */ |
4043 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4168 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4044 | 4169 | MACHINE_CONFIG_END |
4170 | static MACHINE_CONFIG_DERIVED( tdragon_prot, tdragon ) | |
4171 | MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, tdragon_mcu_sim, attotime::from_hz(10000)) | |
4172 | MACHINE_CONFIG_END | |
4045 | 4173 | |
4046 | 4174 | static MACHINE_CONFIG_START( ssmissin, nmk16_state ) |
4047 | 4175 | |
4048 | 4176 | /* basic machine hardware */ |
4049 | 4177 | MCFG_CPU_ADD("maincpu", M68000, 8000000) /* 8 Mhz */ |
4050 | 4178 | MCFG_CPU_PROGRAM_MAP(ssmissin_map) |
4051 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4052 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112) /* input related */ | |
4179 | NMK_HACKY_INTERRUPT_TIMING | |
4053 | 4180 | |
4054 | 4181 | MCFG_CPU_ADD("audiocpu", Z80, 8000000/2) /* 4 Mhz */ |
4055 | 4182 | MCFG_CPU_PROGRAM_MAP(ssmissin_sound_map) |
4056 | 4183 | |
4057 | 4184 | /* video hardware */ |
4058 | MCFG_SCREEN_ADD("screen", RASTER) | |
4059 | MCFG_SCREEN_REFRESH_RATE(56) | |
4060 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4061 | MCFG_SCREEN_SIZE(256, 256) | |
4062 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4185 | NMK_HACKY_SCREEN_LOWRES | |
4063 | 4186 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
4064 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4065 | MCFG_SCREEN_PALETTE("palette") | |
4187 | ||
4066 | 4188 | |
4067 | 4189 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
4068 | 4190 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4083 | 4205 | /* basic machine hardware */ |
4084 | 4206 | MCFG_CPU_ADD("maincpu", M68000, 12000000) /* 12 MHz ? */ |
4085 | 4207 | MCFG_CPU_PROGRAM_MAP(strahl_map) |
4086 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
4087 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
4208 | NMK_HACKY_INTERRUPT_TIMING | |
4088 | 4209 | |
4089 | /* video hardware */ | |
4090 | MCFG_SCREEN_ADD("screen", RASTER) | |
4091 | MCFG_SCREEN_REFRESH_RATE(56) | |
4092 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4093 | MCFG_SCREEN_SIZE(256, 256) | |
4094 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4210 | /* video hardware */ | |
4211 | NMK_HACKY_SCREEN_LOWRES | |
4095 | 4212 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_strahl) |
4096 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_strahl) | |
4097 | MCFG_SCREEN_PALETTE("palette") | |
4098 | ||
4213 | ||
4099 | 4214 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", strahl) |
4100 | 4215 | MCFG_PALETTE_ADD("palette", 1024) |
4101 | 4216 | MCFG_PALETTE_FORMAT(RRRRGGGGBBBBxxxx) |
r32099 | r32100 | |
4105 | 4220 | /* sound hardware */ |
4106 | 4221 | MCFG_SPEAKER_STANDARD_MONO("mono") |
4107 | 4222 | |
4108 | MCFG_NMK004_ADD("nmk004") | |
4223 | MCFG_NMK004_ADD("nmk004", 8000000) | |
4109 | 4224 | |
4110 | 4225 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
4111 | 4226 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
4112 | 4227 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
4113 | 4228 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
4114 | 4229 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
4115 | MCFG_SOUND_ROUTE(3, "mono", | |
4230 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4116 | 4231 | |
4117 | 4232 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
4118 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4233 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4119 | 4234 | |
4120 | 4235 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
4121 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4236 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4122 | 4237 | MACHINE_CONFIG_END |
4123 | 4238 | |
4124 | 4239 | static MACHINE_CONFIG_START( hachamf, nmk16_state ) |
r32099 | r32100 | |
4126 | 4241 | /* basic machine hardware */ |
4127 | 4242 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */ |
4128 | 4243 | MCFG_CPU_PROGRAM_MAP(hachamf_map) |
4129 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4130 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
4244 | NMK_HACKY_INTERRUPT_TIMING | |
4131 | 4245 | |
4132 | 4246 | /* video hardware */ |
4133 | MCFG_SCREEN_ADD("screen", RASTER) | |
4134 | MCFG_SCREEN_REFRESH_RATE(56) | |
4135 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4136 | MCFG_SCREEN_SIZE(256, 256) | |
4137 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4247 | NMK_HACKY_SCREEN_LOWRES | |
4138 | 4248 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
4139 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4140 | MCFG_SCREEN_PALETTE("palette") | |
4249 | ||
4141 | 4250 | |
4142 | 4251 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
4143 | 4252 | MCFG_PALETTE_ADD("palette", 1024) |
4144 | 4253 | MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) |
4145 | 4254 | |
4146 | 4255 | MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) |
4147 | MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, hachamf_mcu_sim, attotime::from_hz(10000)) | |
4148 | 4256 | |
4149 | 4257 | /* sound hardware */ |
4150 | 4258 | MCFG_SPEAKER_STANDARD_MONO("mono") |
4151 | 4259 | |
4152 | MCFG_NMK004_ADD("nmk004") | |
4260 | MCFG_NMK004_ADD("nmk004", 8000000) | |
4153 | 4261 | |
4154 | 4262 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
4155 | 4263 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
4156 | 4264 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
4157 | 4265 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
4158 | 4266 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
4159 | MCFG_SOUND_ROUTE(3, "mono", | |
4267 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4160 | 4268 | |
4161 | 4269 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
4162 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4270 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4163 | 4271 | |
4164 | 4272 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
4165 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4273 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4166 | 4274 | MACHINE_CONFIG_END |
4275 | static MACHINE_CONFIG_DERIVED( hachamf_prot, hachamf ) | |
4276 | MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, hachamf_mcu_sim, attotime::from_hz(10000)) | |
4277 | MACHINE_CONFIG_END | |
4167 | 4278 | |
4279 | ||
4168 | 4280 | static MACHINE_CONFIG_START( macross, nmk16_state ) |
4169 | 4281 | |
4170 | 4282 | /* basic machine hardware */ |
4171 | 4283 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */ |
4172 | 4284 | MCFG_CPU_PROGRAM_MAP(macross_map) |
4173 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4174 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
4285 | NMK_HACKY_INTERRUPT_TIMING | |
4175 | 4286 | |
4176 | 4287 | /* video hardware */ |
4177 | MCFG_SCREEN_ADD("screen", RASTER) | |
4178 | MCFG_SCREEN_REFRESH_RATE(56) | |
4179 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4180 | MCFG_SCREEN_SIZE(256, 256) | |
4181 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4288 | NMK_HACKY_SCREEN_LOWRES | |
4182 | 4289 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
4183 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4184 | MCFG_SCREEN_PALETTE("palette") | |
4290 | ||
4185 | 4291 | |
4186 | 4292 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
4187 | 4293 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4192 | 4298 | /* sound hardware */ |
4193 | 4299 | MCFG_SPEAKER_STANDARD_MONO("mono") |
4194 | 4300 | |
4195 | MCFG_NMK004_ADD("nmk004") | |
4301 | MCFG_NMK004_ADD("nmk004", 8000000) | |
4196 | 4302 | |
4197 | 4303 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
4198 | 4304 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
4199 | 4305 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
4200 | 4306 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
4201 | 4307 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
4202 | MCFG_SOUND_ROUTE(3, "mono", | |
4308 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4203 | 4309 | |
4204 | 4310 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
4205 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4311 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4206 | 4312 | |
4207 | 4313 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
4208 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4314 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4209 | 4315 | MACHINE_CONFIG_END |
4210 | 4316 | |
4211 | 4317 | static MACHINE_CONFIG_START( blkheart, nmk16_state ) |
r32099 | r32100 | |
4213 | 4319 | /* basic machine hardware */ |
4214 | 4320 | MCFG_CPU_ADD("maincpu", M68000, XTAL_8MHz) /* verified on pcb */ |
4215 | 4321 | MCFG_CPU_PROGRAM_MAP(macross_map) |
4216 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4217 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
4322 | NMK_HACKY_INTERRUPT_TIMING | |
4218 | 4323 | |
4219 | 4324 | /* video hardware */ |
4220 | MCFG_SCREEN_ADD("screen", RASTER) | |
4221 | MCFG_SCREEN_REFRESH_RATE(56.18) /* verified on pcb */ | |
4222 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4223 | MCFG_SCREEN_SIZE(256, 256) | |
4224 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
4325 | NMK_HACKY_SCREEN_LOWRES | |
4225 | 4326 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
4226 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4227 | MCFG_SCREEN_PALETTE("palette") | |
4327 | ||
4228 | 4328 | |
4229 | 4329 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
4230 | 4330 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4235 | 4335 | /* sound hardware */ |
4236 | 4336 | MCFG_SPEAKER_STANDARD_MONO("mono") |
4237 | 4337 | |
4238 | MCFG_NMK004_ADD("nmk004") | |
4338 | MCFG_NMK004_ADD("nmk004", 8000000) | |
4239 | 4339 | |
4240 | 4340 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_12MHz/8 ) /* verified on pcb */ |
4241 | 4341 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
4242 | 4342 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
4243 | 4343 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
4244 | 4344 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
4245 | MCFG_SOUND_ROUTE(3, "mono", | |
4345 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4246 | 4346 | |
4247 | 4347 | MCFG_OKIM6295_ADD("oki1", XTAL_8MHz/2, OKIM6295_PIN7_LOW) /* verified on pcb */ |
4248 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4348 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4249 | 4349 | |
4250 | 4350 | MCFG_OKIM6295_ADD("oki2", XTAL_8MHz/2, OKIM6295_PIN7_LOW) /* verified on pcb */ |
4251 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4351 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4252 | 4352 | MACHINE_CONFIG_END |
4253 | 4353 | |
4254 | 4354 | static MACHINE_CONFIG_START( gunnail, nmk16_state ) |
r32099 | r32100 | |
4256 | 4356 | /* basic machine hardware */ |
4257 | 4357 | MCFG_CPU_ADD("maincpu", M68000, 12000000) /* 12 MHz? */ |
4258 | 4358 | MCFG_CPU_PROGRAM_MAP(gunnail_map) |
4259 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4260 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112) | |
4359 | NMK_HACKY_INTERRUPT_TIMING | |
4261 | 4360 | |
4262 | 4361 | /* video hardware */ |
4263 | MCFG_SCREEN_ADD("screen", RASTER) | |
4264 | MCFG_SCREEN_REFRESH_RATE(56) | |
4265 | // MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4266 | MCFG_SCREEN_SIZE(512, 256) | |
4267 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) | |
4362 | NMK_HACKY_SCREEN_HIRES | |
4268 | 4363 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_gunnail) |
4269 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4270 | MCFG_SCREEN_PALETTE("palette") | |
4364 | ||
4271 | 4365 | |
4366 | ||
4367 | ||
4272 | 4368 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
4273 | 4369 | MCFG_PALETTE_ADD("palette", 1024) |
4274 | 4370 | MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) |
r32099 | r32100 | |
4278 | 4374 | /* sound hardware */ |
4279 | 4375 | MCFG_SPEAKER_STANDARD_MONO("mono") |
4280 | 4376 | |
4281 | MCFG_NMK004_ADD("nmk004") | |
4377 | MCFG_NMK004_ADD("nmk004", 8000000) | |
4282 | 4378 | |
4283 | 4379 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
4284 | 4380 | MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("nmk004", nmk004_device, ym2203_irq_handler)) |
4285 | 4381 | MCFG_SOUND_ROUTE(0, "mono", 0.50) |
4286 | 4382 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
4287 | 4383 | MCFG_SOUND_ROUTE(2, "mono", 0.50) |
4288 | MCFG_SOUND_ROUTE(3, "mono", | |
4384 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4289 | 4385 | |
4290 | 4386 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
4291 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4387 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4292 | 4388 | |
4293 | 4389 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
4294 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4390 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4295 | 4391 | MACHINE_CONFIG_END |
4296 | 4392 | |
4297 | 4393 | static MACHINE_CONFIG_START( macross2, nmk16_state ) |
r32099 | r32100 | |
4299 | 4395 | /* basic machine hardware */ |
4300 | 4396 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */ |
4301 | 4397 | MCFG_CPU_PROGRAM_MAP(macross2_map) |
4302 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4303 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
4398 | NMK_HACKY_INTERRUPT_TIMING | |
4304 | 4399 | |
4305 | 4400 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz ? */ |
4306 | 4401 | MCFG_CPU_PROGRAM_MAP(macross2_sound_map) |
4307 | 4402 | MCFG_CPU_IO_MAP(macross2_sound_io_map) |
4308 | 4403 | |
4309 | 4404 | /* video hardware */ |
4310 | MCFG_SCREEN_ADD("screen", RASTER) | |
4311 | MCFG_SCREEN_REFRESH_RATE(56) | |
4312 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4313 | MCFG_SCREEN_SIZE(512, 256) | |
4314 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) | |
4405 | NMK_HACKY_SCREEN_HIRES | |
4315 | 4406 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_gunnail) |
4316 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4317 | MCFG_SCREEN_PALETTE("palette") | |
4407 | ||
4318 | 4408 | |
4319 | 4409 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross2) |
4320 | 4410 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4327 | 4417 | |
4328 | 4418 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
4329 | 4419 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(nmk16_state, ym2203_irqhandler)) |
4330 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) | |
4420 | MCFG_SOUND_ROUTE(0, "mono", 0.50) | |
4421 | MCFG_SOUND_ROUTE(1, "mono", 0.50) | |
4422 | MCFG_SOUND_ROUTE(2, "mono", 0.50) | |
4423 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4331 | 4424 | |
4332 | 4425 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
4333 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4426 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4334 | 4427 | |
4335 | 4428 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
4336 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0. | |
4429 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4337 | 4430 | |
4338 | 4431 | MCFG_DEVICE_ADD("nmk112", NMK112, 0) |
4339 | 4432 | MCFG_NMK112_ROM0("oki1") |
r32099 | r32100 | |
4345 | 4438 | /* basic machine hardware */ |
4346 | 4439 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */ |
4347 | 4440 | MCFG_CPU_PROGRAM_MAP(macross2_map) |
4348 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4349 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
4441 | NMK_HACKY_INTERRUPT_TIMING | |
4350 | 4442 | |
4351 | 4443 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz */ |
4352 | 4444 | MCFG_CPU_PROGRAM_MAP(macross2_sound_map) |
4353 | 4445 | MCFG_CPU_IO_MAP(macross2_sound_io_map) |
4354 | 4446 | |
4355 | 4447 | /* video hardware */ |
4356 | MCFG_SCREEN_ADD("screen", RASTER) | |
4357 | MCFG_SCREEN_REFRESH_RATE(56) | |
4358 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4359 | MCFG_SCREEN_SIZE(512, 256) | |
4360 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) | |
4448 | NMK_HACKY_SCREEN_HIRES | |
4361 | 4449 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_tdragon2) |
4362 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4363 | MCFG_SCREEN_PALETTE("palette") | |
4450 | ||
4364 | 4451 | |
4365 | 4452 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross2) |
4366 | 4453 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4373 | 4460 | |
4374 | 4461 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
4375 | 4462 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(nmk16_state, ym2203_irqhandler)) |
4376 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) | |
4463 | MCFG_SOUND_ROUTE(0, "mono", 0.50) | |
4464 | MCFG_SOUND_ROUTE(1, "mono", 0.50) | |
4465 | MCFG_SOUND_ROUTE(2, "mono", 0.50) | |
4466 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4377 | 4467 | |
4378 | 4468 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
4379 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.0 | |
4469 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4380 | 4470 | |
4381 | 4471 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
4382 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.0 | |
4472 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4383 | 4473 | |
4384 | 4474 | MCFG_DEVICE_ADD("nmk112", NMK112, 0) |
4385 | 4475 | MCFG_NMK112_ROM0("oki1") |
r32099 | r32100 | |
4391 | 4481 | /* basic machine hardware */ |
4392 | 4482 | MCFG_CPU_ADD("maincpu", M68000, 14000000) /* 14 MHz measured */ |
4393 | 4483 | MCFG_CPU_PROGRAM_MAP(raphero_map) |
4394 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4395 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
4484 | NMK_HACKY_INTERRUPT_TIMING | |
4396 | 4485 | |
4397 | 4486 | MCFG_CPU_ADD("audiocpu",TMP90841, 8000000) |
4398 | 4487 | MCFG_CPU_PROGRAM_MAP(raphero_sound_mem_map) |
4399 | 4488 | |
4400 | 4489 | /* video hardware */ |
4401 | MCFG_SCREEN_ADD("screen", RASTER) | |
4402 | MCFG_SCREEN_REFRESH_RATE(56) // measured | |
4403 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4404 | MCFG_SCREEN_SIZE(512, 256) | |
4405 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) | |
4490 | NMK_HACKY_SCREEN_HIRES | |
4406 | 4491 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_tdragon2) |
4407 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4408 | MCFG_SCREEN_PALETTE("palette") | |
4492 | ||
4409 | 4493 | |
4410 | 4494 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross2) |
4411 | 4495 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4418 | 4502 | |
4419 | 4503 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) |
4420 | 4504 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(nmk16_state, ym2203_irqhandler)) |
4421 | MCFG_SOUND_ROUTE(0, "mono", 0.70) | |
4422 | MCFG_SOUND_ROUTE(1, "mono", 0.70) | |
4423 | MCFG_SOUND_ROUTE(2, "mono", 0.70) | |
4424 | MCFG_SOUND_ROUTE(3, "mono", 1.00) | |
4505 | MCFG_SOUND_ROUTE(0, "mono", 0.50) | |
4506 | MCFG_SOUND_ROUTE(1, "mono", 0.50) | |
4507 | MCFG_SOUND_ROUTE(2, "mono", 0.50) | |
4508 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4425 | 4509 | |
4426 | 4510 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) |
4427 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.0 | |
4511 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4428 | 4512 | |
4429 | 4513 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) |
4430 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.0 | |
4514 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4431 | 4515 | |
4432 | 4516 | MCFG_DEVICE_ADD("nmk112", NMK112, 0) |
4433 | 4517 | MCFG_NMK112_ROM0("oki1") |
r32099 | r32100 | |
4439 | 4523 | /* basic machine hardware */ |
4440 | 4524 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* verified on pcb */ |
4441 | 4525 | MCFG_CPU_PROGRAM_MAP(bjtwin_map) |
4442 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq4_line_hold) | |
4443 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */ | |
4526 | NMK_HACKY_INTERRUPT_TIMING | |
4444 | 4527 | |
4445 | 4528 | /* video hardware */ |
4446 | MCFG_SCREEN_ADD("screen", RASTER) | |
4447 | MCFG_SCREEN_REFRESH_RATE(56) | |
4448 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4449 | MCFG_SCREEN_SIZE(512, 256) | |
4450 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) | |
4529 | NMK_HACKY_SCREEN_HIRES | |
4451 | 4530 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_bjtwin) |
4452 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4453 | MCFG_SCREEN_PALETTE("palette") | |
4531 | ||
4454 | 4532 | |
4455 | 4533 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", bjtwin) |
4456 | 4534 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4482 | 4560 | MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state, irq6_line_hold) // recoded to use this irq |
4483 | 4561 | |
4484 | 4562 | /* video hardware */ |
4485 | MCFG_SCREEN_ADD("screen", RASTER) | |
4486 | MCFG_SCREEN_REFRESH_RATE(56) | |
4487 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4488 | MCFG_SCREEN_SIZE(512, 256) | |
4489 | MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) | |
4563 | NMK_HACKY_SCREEN_HIRES | |
4490 | 4564 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_bjtwin) |
4491 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4492 | MCFG_SCREEN_PALETTE("palette") | |
4565 | ||
4493 | 4566 | |
4494 | 4567 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", atombjt) |
4495 | 4568 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
4507 | 4580 | |
4508 | 4581 | |
4509 | 4582 | |
4583 | TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::manybloc_scanline) | |
4584 | { | |
4585 | int scanline = param; | |
4586 | ||
4587 | if(scanline == 248) // vblank-out irq | |
4588 | m_maincpu->set_input_line(4, HOLD_LINE); | |
4589 | ||
4590 | if (scanline==248) | |
4591 | memcpy(m_spriteram_old2, m_mainram + m_sprdma_base / 2, 0x1000); | |
4592 | ||
4593 | /* This is either vblank-in or sprite dma irq complete */ | |
4594 | if(scanline == 0) | |
4595 | m_maincpu->set_input_line(2, HOLD_LINE); | |
4596 | } | |
4597 | ||
4598 | // non-nmk board, different to the others, very timing sensitive | |
4599 | static MACHINE_CONFIG_START( manybloc, nmk16_state ) | |
4600 | ||
4601 | /* basic machine hardware */ | |
4602 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10? MHz - check */ | |
4603 | MCFG_CPU_PROGRAM_MAP(manybloc_map) | |
4604 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 56)/* this needs to equal the framerate on this, rather than being double it .. */ | |
4605 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, manybloc_scanline, "screen", 0, 1) | |
4606 | ||
4607 | MCFG_CPU_ADD("audiocpu", Z80, 3000000) | |
4608 | MCFG_CPU_PROGRAM_MAP(tharrier_sound_map) | |
4609 | MCFG_CPU_IO_MAP(tharrier_sound_io_map) | |
4610 | ||
4611 | /* video hardware */ | |
4612 | MCFG_SCREEN_ADD("screen", RASTER) | |
4613 | MCFG_SCREEN_REFRESH_RATE(56) | |
4614 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4615 | MCFG_SCREEN_SIZE(256, 256) | |
4616 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) | |
4617 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_manybloc) | |
4618 | ||
4619 | MCFG_SCREEN_PALETTE("palette") | |
4620 | ||
4621 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", tharrier) | |
4622 | MCFG_PALETTE_ADD("palette", 512) | |
4623 | MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx) | |
4624 | ||
4625 | MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross) | |
4626 | ||
4627 | /* sound hardware */ | |
4628 | MCFG_SPEAKER_STANDARD_MONO("mono") | |
4629 | ||
4630 | MCFG_SOUND_ADD("ymsnd", YM2203, 1500000) | |
4631 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(nmk16_state, ym2203_irqhandler)) | |
4632 | MCFG_SOUND_ROUTE(0, "mono", 0.50) | |
4633 | MCFG_SOUND_ROUTE(1, "mono", 0.50) | |
4634 | MCFG_SOUND_ROUTE(2, "mono", 0.50) | |
4635 | MCFG_SOUND_ROUTE(3, "mono", 1.20) | |
4636 | ||
4637 | MCFG_OKIM6295_ADD("oki1", 16000000/4, OKIM6295_PIN7_LOW) | |
4638 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4639 | ||
4640 | MCFG_OKIM6295_ADD("oki2", 16000000/4, OKIM6295_PIN7_LOW) | |
4641 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) | |
4642 | MACHINE_CONFIG_END | |
4643 | ||
4644 | ||
4510 | 4645 | UINT8 nmk16_state::decode_byte(UINT8 src, const UINT8 *bitp) |
4511 | 4646 | { |
4512 | 4647 | UINT8 ret, i; |
r32099 | r32100 | |
4671 | 4806 | decode_gfx(); |
4672 | 4807 | } |
4673 | 4808 | |
4674 | DRIVER_INIT_MEMBER(nmk16_state,hachamf) | |
4809 | DRIVER_INIT_MEMBER(nmk16_state,hachamf_prot) | |
4675 | 4810 | { |
4676 | 4811 | UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); |
4677 | 4812 | |
r32099 | r32100 | |
4680 | 4815 | // kludge the sound communication to let commands go through. |
4681 | 4816 | rom[0x048a/2] = 0x4e71; |
4682 | 4817 | rom[0x04aa/2] = 0x4e71; |
4818 | ||
4819 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x0f0000, 0x0fffff, write16_delegate(FUNC(nmk16_state::hachamf_mainram_w),this)); | |
4683 | 4820 | } |
4684 | 4821 | |
4685 | 4822 | DRIVER_INIT_MEMBER(nmk16_state,tdragonb) |
r32099 | r32100 | |
4687 | 4824 | decode_tdragonb(); |
4688 | 4825 | } |
4689 | 4826 | |
4690 | DRIVER_INIT_MEMBER(nmk16_state,tdragon) | |
4827 | DRIVER_INIT_MEMBER(nmk16_state,tdragon_prot) | |
4691 | 4828 | { |
4692 | 4829 | UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); |
4693 | 4830 | |
r32099 | r32100 | |
4697 | 4834 | // kludge the sound communication to let commands go through. |
4698 | 4835 | rom[0x048a/2] = 0x4e71; |
4699 | 4836 | rom[0x04aa/2] = 0x4e71; |
4837 | ||
4838 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x0b0000, 0x0bffff, write16_delegate(FUNC(nmk16_state::tdragon_mainram_w),this)); | |
4700 | 4839 | } |
4701 | 4840 | |
4702 | 4841 | DRIVER_INIT_MEMBER(nmk16_state,ssmissin) |
r32099 | r32100 | |
4939 | 5078 | /* basic machine hardware */ |
4940 | 5079 | MCFG_CPU_ADD("maincpu", M68000,XTAL_12MHz) /* 68000p10 running at 12mhz, verified on pcb */ |
4941 | 5080 | MCFG_CPU_PROGRAM_MAP(afega) |
4942 | MC | |
5081 | NMK_HACKY_INTERRUPT_TIMING | |
4943 | 5082 | |
4944 | 5083 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_4MHz) /* verified on pcb */ |
4945 | 5084 | MCFG_CPU_PROGRAM_MAP(afega_sound_cpu) |
4946 | 5085 | |
4947 | 5086 | /* video hardware */ |
4948 | MCFG_SCREEN_ADD("screen", RASTER) | |
4949 | MCFG_SCREEN_REFRESH_RATE(56) | |
4950 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
4951 | MCFG_SCREEN_SIZE(256, 256) | |
4952 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
5087 | NMK_HACKY_SCREEN_LOWRES | |
4953 | 5088 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_afega) |
4954 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
4955 | MCFG_SCREEN_PALETTE("palette") | |
5089 | ||
4956 | 5090 | |
4957 | 5091 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", stagger1) |
4958 | 5092 | MCFG_PALETTE_ADD("palette", 768) |
r32099 | r32100 | |
5026 | 5160 | /* basic machine hardware */ |
5027 | 5161 | MCFG_CPU_ADD("maincpu", M68000,12000000) |
5028 | 5162 | MCFG_CPU_PROGRAM_MAP(afega) |
5029 | MC | |
5163 | NMK_HACKY_INTERRUPT_TIMING | |
5030 | 5164 | |
5031 | 5165 | MCFG_CPU_ADD("audiocpu", Z80,4000000) |
5032 | 5166 | MCFG_CPU_PROGRAM_MAP(firehawk_sound_cpu) |
5033 | 5167 | |
5034 | 5168 | /* video hardware */ |
5035 | MCFG_SCREEN_ADD("screen", RASTER) | |
5036 | MCFG_SCREEN_REFRESH_RATE(56) | |
5037 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
5038 | MCFG_SCREEN_SIZE(256, 256) | |
5039 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
5169 | NMK_HACKY_SCREEN_LOWRES | |
5040 | 5170 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_firehawk) |
5041 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
5042 | MCFG_SCREEN_PALETTE("palette") | |
5171 | ||
5043 | 5172 | |
5044 | 5173 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", grdnstrm) |
5045 | 5174 | MCFG_PALETTE_ADD("palette", 768) |
r32099 | r32100 | |
5062 | 5191 | /* basic machine hardware */ |
5063 | 5192 | MCFG_CPU_ADD("maincpu", M68000,12000000) |
5064 | 5193 | MCFG_CPU_PROGRAM_MAP(twinactn_map) |
5065 | MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */ | |
5066 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1) | |
5194 | NMK_HACKY_INTERRUPT_TIMING | |
5067 | 5195 | |
5068 | 5196 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) |
5069 | 5197 | MCFG_CPU_PROGRAM_MAP(twinactn_sound_cpu) |
5070 | 5198 | |
5071 | 5199 | /* video hardware */ |
5072 | MCFG_SCREEN_ADD("screen", RASTER) | |
5073 | MCFG_SCREEN_REFRESH_RATE(56) | |
5074 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) | |
5075 | MCFG_SCREEN_SIZE(256, 256) | |
5076 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
5200 | NMK_HACKY_SCREEN_LOWRES | |
5077 | 5201 | MCFG_SCREEN_UPDATE_DRIVER(nmk16_state, screen_update_macross) |
5078 | MCFG_SCREEN_VBLANK_DRIVER(nmk16_state, screen_eof_nmk) | |
5079 | MCFG_SCREEN_PALETTE("palette") | |
5202 | ||
5080 | 5203 | |
5081 | 5204 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", macross) |
5082 | 5205 | MCFG_PALETTE_ADD("palette", 1024) |
r32099 | r32100 | |
5869 | 5992 | |
5870 | 5993 | ROM_REGION( 0xa0000, "oki1", 0 ) /* Oki sample data */ |
5871 | 5994 | ROM_LOAD( "str8pmw1.540", 0x00000, 0x20000, CRC(01d6bb6a) SHA1(b157f6f921483ed8067a7e13e370f73fdb60d136) ) |
5872 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ | |
5995 | /* this is a mess */ | |
5996 | ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */ | |
5997 | ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */ | |
5998 | ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */ | |
5873 | 5999 | |
5874 | 6000 | ROM_REGION( 0xa0000, "oki2", 0 ) /* Oki sample data */ |
5875 | 6001 | ROM_LOAD( "str9pew1.639", 0x00000, 0x20000, CRC(6bb3eb9f) SHA1(9c1394df4f8a08f9098c85eb3d38fb862d6eabbb) ) |
5876 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ | |
6002 | /* this is a mess */ | |
6003 | ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */ | |
6004 | ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */ | |
6005 | ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */ | |
5877 | 6006 | ROM_END |
5878 | 6007 | |
5879 | 6008 | ROM_START( strahla ) |
r32099 | r32100 | |
5900 | 6029 | |
5901 | 6030 | ROM_REGION( 0xa0000, "oki1", 0 ) /* Oki sample data */ |
5902 | 6031 | ROM_LOAD( "str8pmw1.540", 0x00000, 0x20000, CRC(01d6bb6a) SHA1(b157f6f921483ed8067a7e13e370f73fdb60d136) ) |
5903 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ | |
6032 | /* this is a mess */ | |
6033 | ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */ | |
6034 | ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */ | |
6035 | ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */ | |
5904 | 6036 | |
5905 | 6037 | ROM_REGION( 0xa0000, "oki2", 0 ) /* Oki sample data */ |
5906 | 6038 | ROM_LOAD( "str9pew1.639", 0x00000, 0x20000, CRC(6bb3eb9f) SHA1(9c1394df4f8a08f9098c85eb3d38fb862d6eabbb) ) |
6039 | /* this is a mess */ | |
6040 | ROM_CONTINUE( 0x80000, 0x20000 ) /* banked */ | |
6041 | ROM_CONTINUE( 0x60000, 0x20000 ) /* banked */ | |
6042 | ROM_CONTINUE( 0x40000, 0x20000 ) /* banked */ | |
6043 | ROM_END | |
6044 | ||
6045 | ROM_START( hachamfb ) | |
6046 | ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */ | |
6047 | ROM_LOAD16_BYTE( "8.bin", 0x00000, 0x20000, CRC(14845b65) SHA1(5cafd07a8a6f5ccbb36de7a90571f8b33ecf273e) ) | |
6048 | ROM_LOAD16_BYTE( "7.bin", 0x00001, 0x20000, CRC(069ca579) SHA1(0db4c3c41e17fca613d11de89b388a4af206ec6b) ) | |
6049 | ||
6050 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* unknown - sound cpu ?????? */ | |
6051 | ROM_LOAD( "1.70", 0x00000, 0x10000, CRC(9e6f48fc) SHA1(aeb5bfecc025b5478f6de874792fc0f7f54932be) ) | |
6052 | ||
6053 | ROM_REGION( 0x020000, "fgtile", 0 ) | |
6054 | ROM_LOAD( "5.95", 0x000000, 0x020000, CRC(29fb04a2) SHA1(9654b90a66d0e2a0f9cd369cab29cdd0c6f77869) ) /* 8x8 tiles */ | |
6055 | ||
6056 | ROM_REGION( 0x100000, "bgtile", 0 ) /* 16x16 tiles */ | |
6057 | ROM_LOAD( "91076-4.101", 0x000000, 0x100000, CRC(df9653a4) SHA1(4a3204a98d7738c7895169fcece922fdf355f4fa) ) | |
6058 | ||
6059 | ROM_REGION( 0x100000, "sprites", 0 ) | |
6060 | ROM_LOAD16_WORD_SWAP( "91076-8.57", 0x000000, 0x100000, CRC(7fd0f556) SHA1(d1b4bec0946869d3d7bcb870d9ae3bd17395a231) ) /* Sprites */ | |
6061 | ||
6062 | ROM_REGION( 0x0a0000, "oki1", 0 ) /* OKIM6295 samples */ | |
6063 | ROM_LOAD( "91076-2.46", 0x00000, 0x20000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) ) /* 1st & 2nd half identical, needs verifying */ | |
5907 | 6064 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ |
6065 | ||
6066 | ROM_REGION( 0x0a0000, "oki2", 0 ) /* OKIM6295 samples */ | |
6067 | ROM_LOAD( "91076-3.45", 0x00000, 0x20000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) ) /* 1st & 2nd half identical, needs verifying */ | |
6068 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ | |
5908 | 6069 | ROM_END |
5909 | 6070 | |
5910 | 6071 | ROM_START( hachamf ) |
r32099 | r32100 | |
5925 | 6086 | ROM_LOAD16_WORD_SWAP( "91076-8.57", 0x000000, 0x100000, CRC(7fd0f556) SHA1(d1b4bec0946869d3d7bcb870d9ae3bd17395a231) ) /* Sprites */ |
5926 | 6087 | |
5927 | 6088 | ROM_REGION( 0x0a0000, "oki1", 0 ) /* OKIM6295 samples */ |
5928 | ROM_LOAD( "91076-2.46", 0x00000, 0x20000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) ) | |
6089 | ROM_LOAD( "91076-2.46", 0x00000, 0x20000, CRC(3f1e67f2) SHA1(413e78587d8a043a0eb94447313ba1b3c5b35be5) ) /* 1st & 2nd half identical, needs verifying */ | |
5929 | 6090 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ |
5930 | 6091 | |
5931 | 6092 | ROM_REGION( 0x0a0000, "oki2", 0 ) /* OKIM6295 samples */ |
5932 | ROM_LOAD( "91076-3.45", 0x00000, 0x20000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) ) | |
6093 | ROM_LOAD( "91076-3.45", 0x00000, 0x20000, CRC(b25ed93b) SHA1(d7bc686bbccf982f40420a11158aa8e5dd4207c5) ) /* 1st & 2nd half identical, needs verifying */ | |
5933 | 6094 | ROM_CONTINUE( 0x40000, 0x60000 ) /* banked */ |
5934 | 6095 | ROM_END |
5935 | 6096 | |
r32099 | r32100 | |
7535 | 7696 | ***************************************************************************/ |
7536 | 7697 | |
7537 | 7698 | |
7538 | GAME( 1989, tharrier, 0, tharrier, tharrier, driver_device, 0, ROT270, "UPL", "Task Force Harrier", GAME_IMPERFECT_GRAPHICS ) | |
7539 | GAME( 1989, tharrieru, tharrier,tharrier, tharrier, driver_device, 0, ROT270, "UPL (American Sammy license)", "Task Force Harrier (US?)", GAME_IMPERFECT_GRAPHICS ) | |
7699 | GAME( 1989, tharrier, 0, tharrier, tharrier, driver_device, 0, ROT270, "UPL", "Task Force Harrier", 0 ) | |
7700 | GAME( 1989, tharrieru, tharrier,tharrier, tharrier, driver_device, 0, ROT270, "UPL (American Sammy license)", "Task Force Harrier (US?)", 0 ) | |
7540 | 7701 | |
7541 | GAME( 1990, mustang, 0, mustang, mustang, driver_device, 0, ROT0, "UPL", "US AAF Mustang (25th May. 1990)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7542 | GAME( 1990, mustangs, mustang, mustang, mustang, driver_device, 0, ROT0, "UPL (Seoul Trading license)", "US AAF Mustang (25th May. 1990 / Seoul Trading)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7702 | GAME( 1990, mustang, 0, mustang, mustang, driver_device, 0, ROT0, "UPL", "US AAF Mustang (25th May. 1990)", 0 ) | |
7703 | GAME( 1990, mustangs, mustang, mustang, mustang, driver_device, 0, ROT0, "UPL (Seoul Trading license)", "US AAF Mustang (25th May. 1990 / Seoul Trading)", 0 ) | |
7543 | 7704 | |
7544 | GAME( 1990, bioship, 0, bioship, bioship, driver_device, 0, ROT0, "UPL (American Sammy license)", "Bio-ship Paladin", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7545 | GAME( 1990, sbsgomo, bioship, bioship, bioship, driver_device, 0, ROT0, "UPL", "Space Battle Ship Gomorrah", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7705 | GAME( 1990, bioship, 0, bioship, bioship, driver_device, 0, ROT0, "UPL (American Sammy license)", "Bio-ship Paladin", 0 ) | |
7706 | GAME( 1990, sbsgomo, bioship, bioship, bioship, driver_device, 0, ROT0, "UPL", "Space Battle Ship Gomorrah", 0 ) | |
7546 | 7707 | |
7547 | GAME( 1990, vandyke, 0, vandyke, vandyke, driver_device, 0, ROT270, "UPL", "Vandyke (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7548 | GAME( 1990, vandykejal, vandyke, vandyke, vandyke, driver_device, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 1)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7549 | GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, driver_device, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 2)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7550 | GAME( 1990, vandykeb, vandyke, vandykeb, vandykeb, nmk16_state, vandykeb, ROT270, "bootleg", "Vandyke (bootleg with PIC16c57)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7708 | GAME( 1990, vandyke, 0, vandyke, vandyke, driver_device, 0, ROT270, "UPL", "Vandyke (Japan)", 0 ) | |
7709 | GAME( 1990, vandykejal, vandyke, vandyke, vandyke, driver_device, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 1)", 0 ) | |
7710 | GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, driver_device, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 2)", 0 ) | |
7711 | GAME( 1990, vandykeb, vandyke, vandykeb, vandykeb, nmk16_state, vandykeb, ROT270, "bootleg", "Vandyke (bootleg with PIC16c57)", GAME_NO_SOUND ) | |
7551 | 7712 | |
7552 | GAME( 1991, blkheart, 0, blkheart, blkheart, driver_device, 0, ROT0, "UPL", "Black Heart", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7553 | GAME( 1991, blkheartj,blkheart, blkheart, blkheart, driver_device, 0, ROT0, "UPL", "Black Heart (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7713 | GAME( 1991, blkheart, 0, blkheart, blkheart, driver_device, 0, ROT0, "UPL", "Black Heart", 0 ) | |
7714 | GAME( 1991, blkheartj,blkheart, blkheart, blkheart, driver_device, 0, ROT0, "UPL", "Black Heart (Japan)", 0 ) | |
7554 | 7715 | |
7555 | GAME( 1991, acrobatm, 0, acrobatm, acrobatm, driver_device, 0, ROT270, "UPL (Taito license)", "Acrobat Mission", | |
7716 | GAME( 1991, acrobatm, 0, acrobatm, acrobatm, driver_device, 0, ROT270, "UPL (Taito license)", "Acrobat Mission", 0 ) | |
7556 | 7717 | |
7557 | GAME( 1992, strahl, 0, strahl, strahl, driver_device, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 1)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7558 | GAME( 1992, strahla, strahl, strahl, strahl, driver_device, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 2)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7718 | GAME( 1992, strahl, 0, strahl, strahl, driver_device, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 1)", 0 ) | |
7719 | GAME( 1992, strahla, strahl, strahl, strahl, driver_device, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 2)", 0 ) | |
7559 | 7720 | |
7560 | GAME( 1991, tdragon, 0, tdragon, tdragon, nmk16_state, tdragon, ROT270, "NMK (Tecmo license)", "Thunder Dragon (9th Jan. 1992)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7561 | GAME( 1991, tdragon1, tdragon, tdragon, tdragon, nmk16_state, tdragon, ROT270, "NMK (Tecmo license)", "Thunder Dragon (4th Jun. 1991)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7721 | GAME( 1991, tdragon, 0, tdragon, tdragon, driver_device, 0, ROT270, "NMK (Tecmo license)","Thunder Dragon (8th Jan. 1992, unprotected)", 0 ) | |
7722 | GAME( 1991, tdragon1, tdragon, tdragon_prot, tdragon_prot, nmk16_state, tdragon_prot, ROT270, "NMK (Tecmo license)","Thunder Dragon (4th Jun. 1991, protected)", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND ) | |
7562 | 7723 | |
7563 | GAME( 1991, hachamf, 0, hachamf, hachamf, nmk16_state, hachamf, ROT0, "NMK", "Hacha Mecha Fighter (19th Sep. 1991)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
7724 | GAME( 1991, hachamf, 0, hachamf_prot, hachamf_prot, nmk16_state, hachamf_prot, ROT0, "NMK", "Hacha Mecha Fighter (19th Sep. 1991, protected)", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING ) // lots of things wrong due to protection | |
7725 | GAME( 1991, hachamfb, hachamf,hachamf, hachamfb, driver_device, 0, ROT0, "bootleg", "Hacha Mecha Fighter (19th Sep. 1991, unprotected, bootleg Thunder Dragon conversion)", 0 ) // appears to be a Thunder Dragon conversion, could be bootleg? | |
7564 | 7726 | |
7565 | GAME( 1992, macross, 0, macross, macross, nmk16_state, nmk, ROT270, "Banpresto", "Super Spacefortress Macross / Chou-Jikuu Yousai Macross", | |
7727 | GAME( 1992, macross, 0, macross, macross, nmk16_state, nmk, ROT270, "Banpresto", "Super Spacefortress Macross / Chou-Jikuu Yousai Macross", 0 ) | |
7566 | 7728 | |
7567 | GAME( 1993, gunnail, 0, gunnail, gunnail, nmk16_state, nmk, ROT270, "NMK / Tecmo", "GunNail (28th May. 1992)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
7729 | GAME( 1993, gunnail, 0, gunnail, gunnail, nmk16_state, nmk, ROT270, "NMK / Tecmo", "GunNail (28th May. 1992)", 0 ) // Tecmo is displayed only when set to Japan | |
7730 | // a 1992 version of Gunnail exists, see https://www.youtube.com/watch?v=tf15Wz0zUiA 3:10 | |
7568 | 7731 | |
7569 | GAME( 1993, macross2, 0, macross2, macross2, driver_device, 0, ROT0, "Banpresto", "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II", GAME_NO_COCKTAIL | |
7732 | GAME( 1993, macross2, 0, macross2, macross2, driver_device, 0, ROT0, "Banpresto", "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II", GAME_NO_COCKTAIL ) | |
7570 | 7733 | |
7571 | GAME( 1993, tdragon2, 0, tdragon2, tdragon2, driver_device, 0, ROT270, "NMK", "Thunder Dragon 2 (9th Nov. 1993)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) | |
7572 | GAME( 1993, tdragon2a,tdragon2, tdragon2, tdragon2, driver_device, 0, ROT270, "NMK", "Thunder Dragon 2 (1st Oct. 1993)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) | |
7573 | GAME( 1993, bigbang, tdragon2, tdragon2, tdragon2, driver_device, 0, ROT270, "NMK", "Big Bang (9th Nov. 1993)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) | |
7734 | GAME( 1993, tdragon2, 0, tdragon2, tdragon2, driver_device, 0, ROT270, "NMK", "Thunder Dragon 2 (9th Nov. 1993)", GAME_NO_COCKTAIL ) | |
7735 | GAME( 1993, tdragon2a,tdragon2, tdragon2, tdragon2, driver_device, 0, ROT270, "NMK", "Thunder Dragon 2 (1st Oct. 1993)", GAME_NO_COCKTAIL ) | |
7736 | GAME( 1993, bigbang, tdragon2, tdragon2, tdragon2, driver_device, 0, ROT270, "NMK", "Big Bang (9th Nov. 1993)", GAME_NO_COCKTAIL ) | |
7574 | 7737 | |
7575 | 7738 | /* arcadia was a name conflict to the Emerson Arcadia 2001 in mess */ |
7576 | GAME( 1994, arcadian, 0, raphero, raphero, driver_device, 0, ROT270, "NMK", "Arcadia (NMK)", GAME_IMPERFECT_GRAPHICS ) // 23rd July 1993 in test mode, (c)1994 on title screen | |
7577 | GAME( 1994, raphero, arcadian, raphero, raphero, driver_device, 0, ROT270, "NMK (Media Trading license)", "Rapid Hero", GAME_IMPERFECT_GRAPHICS ) // 23rd July 1993 in test mode, (c)1994 on title screen | |
7739 | GAME( 1994, arcadian, 0, raphero, raphero, driver_device, 0, ROT270, "NMK", "Arcadia (NMK)", 0 ) // 23rd July 1993 in test mode, (c)1994 on title screen | |
7740 | GAME( 1994, raphero, arcadian, raphero, raphero, driver_device, 0, ROT270, "NMK (Media Trading license)", "Rapid Hero", 0 ) // ^^ | |
7578 | 7741 | |
7579 | 7742 | /* both sets of both these games show a date of 9th Mar 1992 in the test mode, they look like different revisions so I doubt this is accurate */ |
7580 | 7743 | GAME( 1992, sabotenb, 0, bjtwin, sabotenb, nmk16_state, nmk, ROT0, "NMK / Tecmo", "Saboten Bombers (set 1)", GAME_NO_COCKTAIL ) |
r32099 | r32100 | |
7595 | 7758 | // these use the seibu sound system (sound / music stolen from Raiden) rather than the bootleggers copying the nmk004 |
7596 | 7759 | GAME( 1990, mustangb, mustang, mustangb, mustang, driver_device, 0, ROT0, "bootleg", "US AAF Mustang (bootleg)", 0 ) |
7597 | 7760 | GAME( 1990, mustangb2,mustang, mustangb, mustang, driver_device, 0, ROT0, "bootleg (TAB Austria)", "US AAF Mustang (TAB Austria bootleg)", 0 ) // PCB and roms have TAB Austria stickers |
7598 | GAME( 1991, tdragonb, tdragon, tdragonb, tdragonb, nmk16_state, tdragonb, ROT270, "bootleg", "Thunder Dragon (bootleg)", 0 ) | |
7761 | GAME( 1991, tdragonb, tdragon, tdragonb, tdragonb, nmk16_state, tdragonb, ROT270, "bootleg", "Thunder Dragon (bootleg)", 0 ) | |
7599 | 7762 | |
7600 | 7763 | // these are from Comad, based on the Thunder Dragon code? |
7601 | 7764 | GAME( 1992, ssmissin, 0, ssmissin, ssmissin, nmk16_state, ssmissin, ROT270, "Comad", "S.S. Mission", GAME_NO_COCKTAIL ) |
r32099 | r32100 | |
7616 | 7779 | |
7617 | 7780 | GAME( 1998, grdnstrm, 0, grdnstrm, grdnstrm, driver_device, 0, ORIENTATION_FLIP_Y, "Afega (Apples Industries license)", "Guardian Storm (horizontal, not encrypted)", 0 ) |
7618 | 7781 | GAME( 1998, grdnstrmv,grdnstrm, grdnstrmk,grdnstrk, nmk16_state, grdnstrm, ROT270, "Afega (Apples Industries license)", "Guardian Storm (vertical)", 0 ) |
7619 | GAME( 1998, grdnstrmj,grdnstrm, grdnstrmk,grdnstrk, nmk16_state, grdnstrmg, ROT270, | |
7782 | GAME( 1998, grdnstrmj,grdnstrm, grdnstrmk,grdnstrk, nmk16_state, grdnstrmg, ROT270, "Afega", "Sen Jing - Guardian Storm (Japan)", 0 ) | |
7620 | 7783 | GAME( 1998, grdnstrmk,grdnstrm, grdnstrmk,grdnstrk, nmk16_state, grdnstrm, ROT270, "Afega", "Jeon Sin - Guardian Storm (Korea)", 0 ) |
7621 | 7784 | GAME( 1998, redfoxwp2,grdnstrm, grdnstrmk,grdnstrk, nmk16_state, grdnstrm, ROT270, "Afega", "Red Fox War Planes II (China, set 1)", 0 ) |
7622 | 7785 | GAME( 1998, redfoxwp2a,grdnstrm,grdnstrmk,grdnstrk, nmk16_state, redfoxwp2a,ROT270, "Afega", "Red Fox War Planes II (China, set 2)", 0 ) |
r32099 | r32100 | |
---|---|---|
7909 | 7909 | tdragon // (c) 1991 NMK / Tecmo |
7910 | 7910 | tdragon1 // (c) 1991 NMK / Tecmo |
7911 | 7911 | hachamf // (c) 1991 NMK |
7912 | hachamfb // bootleg | |
7912 | 7913 | macross // (c) 1992 Banpresto |
7913 | 7914 | riot // (c) 1992 NMK |
7914 | 7915 | gunnail // (c) 1993 NMK / Tecmo |
r32099 | r32100 | |
---|---|---|
1 | #include "emu.h" | |
2 | #include "nmk004.h" | |
1 | // license:MAME | |
2 | // copyright-holders:David Haywood,trap15 | |
3 | /*************************************************************************** | |
3 | 4 | |
4 | #define FM_FLAG_NEED_INITIALIZATION (1<<0) | |
5 | #define FM_FLAG_UNKNOWN2 (1<<1) | |
6 | #define FM_FLAG_NOTE_IS_PAUSE (1<<2) | |
7 | #define FM_FLAG_UNKNOWN3 (1<<3) | |
8 | #define FM_FLAG_MODULATE_NOTE (1<<4) | |
9 | #define FM_FLAG_MUST_SEND_KEYON (1<<5) | |
10 | #define FM_FLAG_MUST_SEND_CONFIGURATION (1<<6) | |
11 | #define FM_FLAG_ACTIVE (1<<7) | |
5 | NMK004 emulation | |
12 | 6 | |
13 | #define PSG_FLAG_ACTIVE (1<<0) | |
14 | #define PSG_FLAG_NOTE_IS_PAUSE (1<<1) | |
15 | #define PSG_FLAG_NEED_INITIALIZATION (1<<2) | |
16 | #define PSG_FLAG_INITIALIZE_VOLUME (1<<3) | |
17 | #define PSG_FLAG_NOTE_IS_NOISE (1<<5) | |
18 | #define PSG_FLAG_NOISE_NOT_ENABLED (1<<6) | |
7 | ***************************************************************************/ | |
19 | 8 | |
20 | #define EFFECTS_FLAG_NEED_INITIALIZATION (1<<0) | |
21 | #define EFFECTS_FLAG_ACTIVE (1<<7) | |
9 | #include "emu.h" | |
10 | #include "nmk004.h" | |
22 | 11 | |
23 | #define NOTE_PAUSE 0x0c | |
24 | ||
25 | #define SAMPLE_TABLE_0 0xefe0 | |
26 | #define SAMPLE_TABLE_1 0xefe2 | |
27 | #define FM_MODULATION_TABLE 0xefe4 | |
28 | #define FM_NOTE_TABLE 0xefe6 | |
29 | #define NOTE_LENGTH_TABLE_1 0xefe8 | |
30 | #define NOTE_LENGTH_TABLE_2 0xefea | |
31 | #define NOTE_LENGTH_TABLE_3 0xefec | |
32 | #define PSG_VOLUME_TABLE 0xefee | |
33 | #define COMMAND_TABLE 0xeff0 | |
34 | #define PSG_NOTE_TABLE 0xeff2 | |
35 | ||
36 | ||
37 | const device_type NMK004 = &device_creator<nmk004_device>; | |
38 | ||
39 | nmk004_device::nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
40 | : device_t(mconfig, NMK004, "NMK004", tag, owner, clock, "nmk004", __FILE__), | |
41 | m_rom(NULL), | |
42 | m_from_main(0), | |
43 | m_to_main(0), | |
44 | m_protection_check(0), | |
45 | m_last_command(0), | |
46 | m_oki_playing(0) | |
12 | WRITE8_MEMBER( nmk004_device::write ) | |
47 | 13 | { |
48 | memset(m_fm_control, 0, sizeof(m_fm_control)); | |
49 | memset(m_psg_control, 0, sizeof(m_psg_control)); | |
50 | memset(m_effects_control, 0, sizeof(m_effects_control)); | |
14 | space.machine().scheduler().synchronize(); | |
15 | to_nmk004 = data; | |
51 | 16 | } |
52 | 17 | |
53 | //------------------------------------------------- | |
54 | // device_config_complete - perform any | |
55 | // operations now that the configuration is | |
56 | // complete | |
57 | //------------------------------------------------- | |
58 | ||
59 | void nmk004_device::device_config_complete() | |
18 | READ8_MEMBER( nmk004_device::read ) | |
60 | 19 | { |
20 | space.machine().scheduler().synchronize(); | |
21 | return to_main; | |
61 | 22 | } |
62 | 23 | |
63 | //------------------------------------------------- | |
64 | // device_start - device-specific startup | |
65 | //------------------------------------------------- | |
66 | ||
67 | void nmk004_device::device_start() | |
24 | WRITE8_MEMBER(nmk004_device::nmk004_port4_w) | |
68 | 25 | { |
69 | /* we have to do this via a timer because we get called before the sound reset */ | |
70 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(nmk004_device::real_init), this)); | |
71 | } | |
26 | // bit 0x08 toggles frequently but is connected to nothing? | |
72 | 27 | |
73 | //------------------------------------------------- | |
74 | // device_reset - device-specific reset | |
75 | //------------------------------------------------- | |
76 | ||
77 | void nmk004_device::device_reset() | |
78 | { | |
28 | // bit 0x01 is set to reset the 68k | |
29 | m_systemcpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE); | |
79 | 30 | } |
80 | 31 | |
81 | ||
32 | WRITE8_MEMBER(nmk004_device::nmk004_oki0_bankswitch_w) | |
82 | 33 | { |
83 | return m_rom[address]; | |
84 | } | |
34 | UINT8 *rom = memregion(":oki1")->base(); | |
85 | 35 | |
86 | UINT16 nmk004_device::read16(int address) | |
87 | { | |
88 | return m_rom[address] + 256 * m_rom[address+1]; | |
36 | data++; // so that 3 wraps around | |
37 | data &= 3; | |
38 | memcpy(rom + 0x20000,rom + 0x20000 + data * 0x20000,0x20000); | |
89 | 39 | } |
90 | 40 | |
91 | ||
92 | ||
93 | /***************************** | |
94 | ||
95 | OKI6295 | |
96 | ||
97 | *****************************/ | |
98 | ||
99 | void nmk004_device::oki_play_sample(int sample_no) | |
41 | WRITE8_MEMBER(nmk004_device::nmk004_oki1_bankswitch_w) | |
100 | 42 | { |
101 | UINT16 table_start = (sample_no & 0x80) ? read16(SAMPLE_TABLE_1) : read16(SAMPLE_TABLE_0); | |
102 | UINT8 byte1 = read8(table_start + 2 * (sample_no & 0x7f) + 0); | |
103 | UINT8 byte2 = read8(table_start + 2 * (sample_no & 0x7f) + 1); | |
104 | int chip = (byte1 & 0x80) >> 7; | |
105 | okim6295_device *okidevice = (chip) ? m_oki2device : m_oki1device; | |
43 | UINT8 *rom = memregion(":oki2")->base(); | |
106 | 44 | |
107 | if ((byte1 & 0x7f) == 0) | |
108 | { | |
109 | // stop all channels | |
110 | okidevice->write_command( 0x78 ); | |
111 | } | |
112 | else | |
113 | { | |
114 | int sample = byte1 & 0x7f; | |
115 | int ch = byte2 & 0x03; | |
116 | int force = (byte2 & 0x80) >> 7; | |
117 | ||
118 | if (!force && (m_oki_playing & (1 << (ch + 4*chip)))) | |
119 | return; | |
120 | ||
121 | m_oki_playing |= 1 << (ch + 4*chip); | |
122 | ||
123 | // stop channel | |
124 | okidevice->write_command( 0x08 << ch ); | |
125 | ||
126 | if (sample != 0) | |
127 | { | |
128 | UINT8 *rom = machine().root_device().memregion((chip == 0) ? "oki1" : "oki2")->base(); | |
129 | int bank = (byte2 & 0x0c) >> 2; | |
130 | int vol = (byte2 & 0x70) >> 4; | |
131 | ||
132 | if (bank != 3) | |
133 | memcpy(rom + 0x20000,rom + 0x40000 + bank * 0x20000,0x20000); | |
134 | ||
135 | okidevice->write_command( 0x80 | sample ); | |
136 | okidevice->write_command( (0x10 << ch) | vol ); | |
137 | } | |
138 | } | |
45 | data++; // so that 3 wraps around | |
46 | data &= 3; | |
47 | memcpy(rom + 0x20000,rom + 0x20000 + data * 0x20000,0x20000); | |
139 | 48 | } |
140 | 49 | |
141 | ||
50 | READ8_MEMBER(nmk004_device::nmk004_tonmk004_r) | |
142 | 51 | { |
143 | m_oki_playing = ((m_oki2device->read_status() & 0x0f) << 4) | (m_oki1device->read_status() & 0x0f); | |
52 | space.machine().scheduler().synchronize(); | |
53 | return to_nmk004; | |
144 | 54 | } |
145 | 55 | |
146 | ||
147 | ||
148 | /***************************** | |
149 | ||
150 | EFFECTS (OKI6295) | |
151 | ||
152 | *****************************/ | |
153 | ||
154 | void nmk004_device::effects_update(int channel) | |
56 | WRITE8_MEMBER(nmk004_device::nmk004_tomain_w) | |
155 | 57 | { |
156 | struct effects_control *effects = &m_effects_control[channel]; | |
157 | ||
158 | // advance the timers | |
159 | if (effects->timer) | |
160 | effects->timer--; | |
161 | ||
162 | ||
163 | if (effects->flags & EFFECTS_FLAG_NEED_INITIALIZATION) | |
164 | { | |
165 | effects->flags = EFFECTS_FLAG_ACTIVE; | |
166 | effects->timer = 0; | |
167 | } | |
168 | ||
169 | ||
170 | if (effects->flags & EFFECTS_FLAG_ACTIVE) | |
171 | { | |
172 | if (effects->timer == 0) | |
173 | { | |
174 | UINT8 token; | |
175 | ||
176 | do | |
177 | { | |
178 | //logerror("channel %d address %04x token %02x\n",channel,effects->current,read8(effects->current)); | |
179 | token = read8(effects->current++); | |
180 | ||
181 | if (token == 0x0ef || (token & 0xf0) == 0xf0) | |
182 | { | |
183 | switch (token) | |
184 | { | |
185 | case 0xef: // play sample | |
186 | oki_play_sample(read8(effects->current++)); | |
187 | break; | |
188 | ||
189 | case 0xf6: // jump | |
190 | effects->current = read16(effects->current); | |
191 | break; | |
192 | ||
193 | case 0xf7: // begin repeat loop | |
194 | effects->loop_times = read8(effects->current++); | |
195 | effects->loop_start = effects->current; | |
196 | break; | |
197 | ||
198 | case 0xf8: // end repeat loop | |
199 | if (--effects->loop_times > 0) | |
200 | effects->current = effects->loop_start; | |
201 | break; | |
202 | ||
203 | case 0xf9: // call subtable | |
204 | effects->return_address[effects->return_address_depth++] = effects->current + 2; | |
205 | effects->current = read16(effects->current); | |
206 | break; | |
207 | ||
208 | case 0xfa: // return from subtable | |
209 | effects->current = effects->return_address[--effects->return_address_depth]; | |
210 | break; | |
211 | ||
212 | case 0xfc: // ??? (hachamf command 04) | |
213 | break; | |
214 | ||
215 | case 0xfd: // ??? (hachamf command 04) | |
216 | break; | |
217 | ||
218 | case 0xff: // end | |
219 | effects->flags = 0; // disable channel | |
220 | return; | |
221 | ||
222 | default: | |
223 | fatalerror("effects channel %d unsupported token %02x\n",channel,token); | |
224 | } | |
225 | } | |
226 | } while (token == 0xef || (token & 0xf0) == 0xf0); | |
227 | ||
228 | effects->current--; | |
229 | ||
230 | if ((read8(effects->current) & 0x80) == 0) | |
231 | { | |
232 | if (read8(effects->current++) != 0x0c) | |
233 | { | |
234 | // this shouldn't happen on the effects channels (but it happens e.g. hachamf command 04) | |
235 | ||
236 | logerror("effects channel %d invalid token %02x\n",channel,read8(effects->current)); | |
237 | } | |
238 | } | |
239 | ||
240 | // optional note length (otherwise use the same length as the previous one) | |
241 | if (read8(effects->current) & 0x80) | |
242 | { | |
243 | UINT16 table_start = read16(NOTE_LENGTH_TABLE_1); | |
244 | ||
245 | effects->timer_duration = read16(table_start + 2 * (read8(effects->current++) & 0x7f)); | |
246 | } | |
247 | ||
248 | effects->timer = effects->timer_duration; | |
249 | } | |
250 | } | |
58 | space.machine().scheduler().synchronize(); | |
59 | to_main = data; | |
251 | 60 | } |
252 | 61 | |
253 | 62 | |
254 | ||
255 | /***************************** | |
256 | ||
257 | YM2203 - FM | |
258 | ||
259 | *****************************/ | |
260 | ||
261 | void nmk004_device::fm_update(int channel) | |
63 | void nmk004_device::ym2203_irq_handler(int irq) | |
262 | 64 | { |
263 | struct fm_control *fm = &m_fm_control[channel]; | |
264 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
265 | ||
266 | // advance the timers | |
267 | if (fm->timer1) | |
268 | fm->timer1--; | |
269 | ||
270 | if (fm->timer2) | |
271 | fm->timer2--; | |
272 | ||
273 | if (fm->modulation_timer) | |
274 | fm->modulation_timer--; | |
275 | ||
276 | ||
277 | if (fm->flags & FM_FLAG_NEED_INITIALIZATION) | |
278 | { | |
279 | fm->flags = FM_FLAG_ACTIVE; | |
280 | fm->timer1 = 0; | |
281 | } | |
282 | ||
283 | ||
284 | if (fm->flags & FM_FLAG_ACTIVE) | |
285 | { | |
286 | if (fm->timer1 == 0) | |
287 | { | |
288 | UINT8 token; | |
289 | ||
290 | do | |
291 | { | |
292 | //logerror("channel %d address %04x token %02x\n",channel,fm->current,read8(fm->current)); | |
293 | token = read8(fm->current++); | |
294 | ||
295 | if (token == 0x0ef || (token & 0xf0) == 0xf0) | |
296 | { | |
297 | int i; | |
298 | ||
299 | switch (token) | |
300 | { | |
301 | // case 0xef: // play sample | |
302 | // oki_play_sample(read8(fm->current++)); | |
303 | // break; | |
304 | ||
305 | case 0xf0: // slot (for keyon ym2203 command) | |
306 | fm->flags |= FM_FLAG_MUST_SEND_CONFIGURATION; | |
307 | fm->slot = read8(fm->current++); | |
308 | if (channel < 3 || !(m_fm_control[channel-3].flags & FM_FLAG_ACTIVE)) | |
309 | { | |
310 | m_ymdevice->control_port_w(space, 0, 0x28); // keyon/off | |
311 | m_ymdevice->write_port_w(space, 0, channel % 3); | |
312 | } | |
313 | break; | |
314 | ||
315 | case 0xf1: // sound shape | |
316 | fm->flags |= FM_FLAG_MUST_SEND_CONFIGURATION; | |
317 | for (i = 0x00; i < 0x04; i++) | |
318 | fm->voice_params[i] = read8(fm->current++); | |
319 | break; | |
320 | ||
321 | case 0xf2: // sound shape | |
322 | fm->flags |= FM_FLAG_MUST_SEND_CONFIGURATION; | |
323 | for (i = 0; i < 4; i++) | |
324 | fm->voice_volume[i] = read8(fm->current++); | |
325 | break; | |
326 | ||
327 | case 0xf3: // sound shape | |
328 | fm->flags |= FM_FLAG_MUST_SEND_CONFIGURATION; | |
329 | for (i = 0x08; i < 0x18; i++) | |
330 | fm->voice_params[i] = read8(fm->current++); | |
331 | break; | |
332 | ||
333 | case 0xf4: // set self-feedback | |
334 | fm->flags |= FM_FLAG_MUST_SEND_CONFIGURATION; | |
335 | fm->self_feedback = read8(fm->current++); | |
336 | break; | |
337 | ||
338 | case 0xf5: // select note duration table | |
339 | fm->note_duration_table_select = read8(fm->current++); | |
340 | break; | |
341 | ||
342 | case 0xf6: // jump | |
343 | fm->current = read16(fm->current); | |
344 | break; | |
345 | ||
346 | case 0xf7: // begin repeat loop | |
347 | fm->loop_times = read8(fm->current++); | |
348 | fm->loop_start = fm->current; | |
349 | break; | |
350 | ||
351 | case 0xf8: // end repeat loop | |
352 | if (--fm->loop_times > 0) | |
353 | fm->current = fm->loop_start; | |
354 | break; | |
355 | ||
356 | case 0xf9: // call subtable | |
357 | fm->return_address[fm->return_address_depth++] = fm->current + 2; | |
358 | fm->current = read16(fm->current); | |
359 | break; | |
360 | ||
361 | case 0xfa: // return from subtable | |
362 | fm->current = fm->return_address[--fm->return_address_depth]; | |
363 | break; | |
364 | ||
365 | case 0xfb: // set octave | |
366 | fm->octave = read8(fm->current++); | |
367 | break; | |
368 | ||
369 | case 0xfc: // ??? | |
370 | fm->flags |= FM_FLAG_UNKNOWN2; | |
371 | fm->flags |= FM_FLAG_UNKNOWN3; | |
372 | break; | |
373 | ||
374 | case 0xfd: // ??? | |
375 | fm->flags &= ~FM_FLAG_UNKNOWN2; | |
376 | break; | |
377 | ||
378 | case 0xfe: // set note modulation | |
379 | fm->modulation_table_number = read8(fm->current++); | |
380 | if (fm->modulation_table_number == 0) | |
381 | { | |
382 | fm->flags &= ~FM_FLAG_MODULATE_NOTE; | |
383 | } | |
384 | else | |
385 | { | |
386 | UINT16 table_start = read16(FM_MODULATION_TABLE); | |
387 | ||
388 | fm->modulation_table = read16(table_start + 2 * (fm->modulation_table_number - 1)); | |
389 | fm->modulation_timer = read16(fm->modulation_table); | |
390 | fm->modulation_table_position = fm->modulation_table + 2; | |
391 | fm->flags |= FM_FLAG_MODULATE_NOTE; | |
392 | } | |
393 | break; | |
394 | ||
395 | case 0xff: // end | |
396 | fm->flags = FM_FLAG_MUST_SEND_CONFIGURATION; // disable channel | |
397 | for (i = 0x04; i < 0x08; i++) | |
398 | fm->voice_params[i] = 0x7f; | |
399 | for (i = 0x14; i < 0x18; i++) | |
400 | fm->voice_params[i] = 0x0f; | |
401 | return; | |
402 | ||
403 | default: | |
404 | fatalerror("fm channel %d unsupported token %02x\n",channel,token); | |
405 | } | |
406 | } | |
407 | } while (token == 0xef || (token & 0xf0) == 0xf0); | |
408 | ||
409 | fm->current--; | |
410 | ||
411 | if ((read8(fm->current) & 0x80) == 0) | |
412 | { | |
413 | int note = read8(fm->current++); | |
414 | ||
415 | fm->note = note; | |
416 | if ((note & 0x0f) == NOTE_PAUSE) | |
417 | fm->flags |= FM_FLAG_NOTE_IS_PAUSE; | |
418 | else | |
419 | { | |
420 | UINT16 table_start = read16(FM_NOTE_TABLE); | |
421 | UINT16 period = read16(table_start + 2 * (note & 0x0f)); | |
422 | UINT8 octave = ((fm->octave << 4) + note) & 0xf0; | |
423 | ||
424 | fm->flags &= ~FM_FLAG_NOTE_IS_PAUSE; | |
425 | fm->note_period = period | (octave << 7); | |
426 | ||
427 | fm->must_update_voice_params = 1; | |
428 | } | |
429 | } | |
430 | ||
431 | // optional note length (otherwise use the same length as the previous one) | |
432 | if (read8(fm->current) & 0x80) | |
433 | { | |
434 | UINT16 table_start; | |
435 | UINT8 duration = read8(fm->current++) & 0x7f; | |
436 | ||
437 | table_start = read16(NOTE_LENGTH_TABLE_1); | |
438 | fm->timer1_duration = read16(table_start + 2 * duration); | |
439 | ||
440 | table_start = fm->note_duration_table_select ? read16(NOTE_LENGTH_TABLE_3) : read16(NOTE_LENGTH_TABLE_2); | |
441 | fm->timer2_duration = read16(table_start + 2 * duration); | |
442 | } | |
443 | ||
444 | fm->timer1 = fm->timer1_duration; | |
445 | fm->timer2 = fm->timer2_duration; | |
446 | ||
447 | ||
448 | if (!(fm->flags & FM_FLAG_NOTE_IS_PAUSE) && | |
449 | ((fm->flags & FM_FLAG_UNKNOWN3) || !(fm->flags & FM_FLAG_UNKNOWN2))) | |
450 | { | |
451 | fm->flags &= ~FM_FLAG_UNKNOWN3; | |
452 | fm->flags |= FM_FLAG_MUST_SEND_KEYON; | |
453 | fm->flags |= FM_FLAG_MUST_SEND_CONFIGURATION; | |
454 | } | |
455 | } | |
456 | } | |
457 | ||
458 | ||
459 | ||
460 | if ((fm->flags & FM_FLAG_MODULATE_NOTE) && (fm->flags & FM_FLAG_MUST_SEND_KEYON)) | |
461 | { | |
462 | fm->modulation_timer = read16(fm->modulation_table); | |
463 | fm->modulation_table_position = fm->modulation_table + 2; | |
464 | } | |
465 | ||
466 | if (!(fm->flags & FM_FLAG_MODULATE_NOTE) || (fm->flags & FM_FLAG_MUST_SEND_KEYON) || fm->must_update_voice_params) | |
467 | { | |
468 | int i; | |
469 | ||
470 | fm->must_update_voice_params = 0; | |
471 | ||
472 | for (i = 0; i < 4; i++) | |
473 | fm->voice_params[0x04 + i] = fm->voice_volume[i]; | |
474 | ||
475 | fm->f_number = fm->note_period; | |
476 | } | |
477 | else | |
478 | { | |
479 | if (fm->modulation_timer == 0) | |
480 | { | |
481 | int i; | |
482 | UINT16 a; | |
483 | ||
484 | for (i = 0; i < 4; i++) | |
485 | fm->voice_params[0x04 + i] = fm->voice_volume[i]; | |
486 | ||
487 | fm->modulation_table_position++; | |
488 | a = read8(fm->modulation_table_position++); | |
489 | if (a & 0x80) // sign extend | |
490 | a |= 0xff00; | |
491 | a *= 4; | |
492 | ||
493 | fm->f_number = fm->note_period + a; | |
494 | ||
495 | fm->modulation_timer = read8(fm->modulation_table_position++); // modulation_timer is UINT16 but this is just 8-bit | |
496 | ||
497 | if (read8(fm->modulation_table_position) == 0x80) // end of table - repeat | |
498 | { | |
499 | fm->modulation_table_position = fm->modulation_table + 2; | |
500 | } | |
501 | else if (read8(fm->modulation_table_position) == 0x88) // end of table - stop | |
502 | { | |
503 | fm->flags &= ~FM_FLAG_MODULATE_NOTE; | |
504 | } | |
505 | } | |
506 | } | |
507 | ||
508 | ||
509 | #if 0 | |
510 | popmessage("%02x %02x %02x %02x %02x %02x", | |
511 | m_fm_control[0].note, | |
512 | m_fm_control[1].note, | |
513 | m_fm_control[2].note, | |
514 | m_fm_control[3].note, | |
515 | m_fm_control[4].note, | |
516 | m_fm_control[5].note); | |
517 | #endif | |
518 | #if 0 | |
519 | popmessage("%02x %02x%02x%02x%02x %02x %02x%02x%02x%02x %02x %02x%02x%02x%02x", | |
520 | m_fm_control[3].note, | |
521 | m_fm_control[3].voice_volume[0], | |
522 | m_fm_control[3].voice_volume[1], | |
523 | m_fm_control[3].voice_volume[2], | |
524 | m_fm_control[3].voice_volume[3], | |
525 | m_fm_control[4].note, | |
526 | m_fm_control[4].voice_volume[0], | |
527 | m_fm_control[4].voice_volume[1], | |
528 | m_fm_control[4].voice_volume[2], | |
529 | m_fm_control[4].voice_volume[3], | |
530 | m_fm_control[5].note, | |
531 | m_fm_control[5].voice_volume[0], | |
532 | m_fm_control[5].voice_volume[1], | |
533 | m_fm_control[5].voice_volume[2], | |
534 | m_fm_control[5].voice_volume[3]); | |
535 | #endif | |
65 | m_cpu->set_input_line(0, irq ? ASSERT_LINE : CLEAR_LINE); | |
536 | 66 | } |
537 | 67 | |
68 | static ADDRESS_MAP_START( nmk004_sound_mem_map, AS_PROGRAM, 8, nmk004_device ) | |
69 | //AM_RANGE(0x0000, 0x1fff) AM_ROM /* 0x0000 - 0x1fff = internal ROM */ | |
70 | AM_RANGE(0x2000, 0xefff) AM_ROM AM_REGION(":audiocpu", 0x2000 ) | |
71 | AM_RANGE(0xf000, 0xf7ff) AM_RAM | |
72 | AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE(":ymsnd", ym2203_device, read, write) | |
73 | AM_RANGE(0xf900, 0xf900) AM_DEVREADWRITE(":oki1", okim6295_device, read, write) | |
74 | AM_RANGE(0xfa00, 0xfa00) AM_DEVREADWRITE(":oki2", okim6295_device, read, write) | |
75 | AM_RANGE(0xfb00, 0xfb00) AM_READ(nmk004_tonmk004_r) // from main cpu | |
76 | AM_RANGE(0xfc00, 0xfc00) AM_WRITE(nmk004_tomain_w) // to main cpu | |
77 | AM_RANGE(0xfc01, 0xfc01) AM_WRITE(nmk004_oki0_bankswitch_w) | |
78 | AM_RANGE(0xfc02, 0xfc02) AM_WRITE(nmk004_oki1_bankswitch_w) | |
79 | ADDRESS_MAP_END | |
538 | 80 | |
539 | void nmk004_device::fm_voices_update(void) | |
540 | { | |
541 | static const int ym2203_registers[0x18] = | |
542 | { | |
543 | 0x30,0x38,0x34,0x3C,0x40,0x48,0x44,0x4C,0x50,0x58,0x54,0x5C,0x60,0x68,0x64,0x6C, | |
544 | 0x70,0x78,0x74,0x7C,0x80,0x88,0x84,0x8C | |
545 | }; | |
546 | int channel,i; | |
81 | static ADDRESS_MAP_START( nmk004_sound_io_map, AS_IO, 8, nmk004_device ) | |
82 | AM_RANGE(0xFFC8, 0xFFC8) AM_WRITE(nmk004_port4_w) | |
83 | ADDRESS_MAP_END | |
547 | 84 | |
548 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
549 | for (channel = 0; channel < 3;channel++) | |
550 | { | |
551 | struct fm_control *fm1 = &m_fm_control[channel]; | |
552 | struct fm_control *fm2 = &m_fm_control[channel + 3]; | |
553 | 85 | |
554 | if (fm1->flags & FM_FLAG_MUST_SEND_CONFIGURATION) | |
555 | { | |
556 | fm1->flags &= ~FM_FLAG_MUST_SEND_CONFIGURATION; | |
86 | static MACHINE_CONFIG_FRAGMENT( nmk004 ) | |
87 | MCFG_CPU_ADD("mcu",TMP90840, DERIVED_CLOCK(1,1)) // unkonwn type, but 0x2000 byte internal ROM | |
88 | MCFG_CPU_PROGRAM_MAP(nmk004_sound_mem_map) | |
89 | MCFG_CPU_IO_MAP(nmk004_sound_io_map) | |
90 | MACHINE_CONFIG_END | |
557 | 91 | |
558 | for (i = 0; i < 0x18; i++) | |
559 | { | |
560 | m_ymdevice->control_port_w(space, 0, ym2203_registers[i] + channel); | |
561 | m_ymdevice->write_port_w(space, 0, fm1->voice_params[i]); | |
562 | } | |
563 | } | |
564 | 92 | |
565 | if (fm2->flags & FM_FLAG_MUST_SEND_CONFIGURATION) | |
566 | { | |
567 | fm2->flags &= ~FM_FLAG_MUST_SEND_CONFIGURATION; | |
93 | ROM_START( nmk004 ) | |
94 | ROM_REGION( 0x2000, "mcu", 0 ) | |
95 | ROM_LOAD( "nmk004.bin", 0x00000, 0x02000, CRC(83b6f611) SHA1(bb7ddc00affe8a066002ecd6858dbd2854af8940) ) | |
96 | ROM_END | |
568 | 97 | |
569 | if (!(fm1->flags & FM_FLAG_ACTIVE)) | |
570 | { | |
571 | for (i = 0; i < 0x18; i++) | |
572 | { | |
573 | m_ymdevice->control_port_w(space, 0, ym2203_registers[i] + channel); | |
574 | m_ymdevice->write_port_w(space, 0, fm2->voice_params[i]); | |
575 | } | |
576 | } | |
577 | } | |
578 | 98 | |
99 | const device_type NMK004 = &device_creator<nmk004_device>; | |
579 | 100 | |
580 | if (fm1->flags & FM_FLAG_ACTIVE) | |
581 | { | |
582 | m_ymdevice->control_port_w(space, 0, 0xb0 + channel); // self-feedback | |
583 | m_ymdevice->write_port_w(space, 0, fm1->self_feedback); | |
584 | ||
585 | m_ymdevice->control_port_w(space, 0, 0xa4 + channel); // F-number | |
586 | m_ymdevice->write_port_w(space, 0, fm1->f_number >> 8); | |
587 | ||
588 | m_ymdevice->control_port_w(space, 0, 0xa0 + channel); // F-number | |
589 | m_ymdevice->write_port_w(space, 0, fm1->f_number & 0xff); | |
590 | } | |
591 | else | |
592 | { | |
593 | m_ymdevice->control_port_w(space, 0, 0xb0 + channel); // self-feedback | |
594 | m_ymdevice->write_port_w(space, 0, fm2->self_feedback); | |
595 | ||
596 | m_ymdevice->control_port_w(space, 0, 0xa4 + channel); // F-number | |
597 | m_ymdevice->write_port_w(space, 0, fm2->f_number >> 8); | |
598 | ||
599 | m_ymdevice->control_port_w(space, 0, 0xa0 + channel); // F-number | |
600 | m_ymdevice->write_port_w(space, 0, fm2->f_number & 0xff); | |
601 | } | |
602 | ||
603 | ||
604 | ||
605 | if (fm1->flags & FM_FLAG_MUST_SEND_KEYON) | |
606 | { | |
607 | fm1->flags &= ~FM_FLAG_MUST_SEND_KEYON; | |
608 | ||
609 | m_ymdevice->control_port_w(space, 0, 0x28); // keyon/off | |
610 | m_ymdevice->write_port_w(space, 0, fm1->slot | channel); | |
611 | } | |
612 | ||
613 | if (fm2->flags & FM_FLAG_MUST_SEND_KEYON) | |
614 | { | |
615 | fm2->flags &= ~FM_FLAG_MUST_SEND_KEYON; | |
616 | ||
617 | if (!(fm1->flags & FM_FLAG_ACTIVE)) | |
618 | { | |
619 | m_ymdevice->control_port_w(space, 0, 0x28); // keyon/off | |
620 | m_ymdevice->write_port_w(space, 0, fm2->slot | channel); | |
621 | } | |
622 | } | |
623 | } | |
624 | } | |
625 | ||
626 | ||
627 | ||
628 | /***************************** | |
629 | ||
630 | YM2203 - PSG | |
631 | ||
632 | *****************************/ | |
633 | ||
634 | void nmk004_device::psg_update(int channel) | |
101 | nmk004_device::nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
102 | : device_t(mconfig, NMK004, "NMK004", tag, owner, clock, "nmk004", __FILE__), | |
103 | m_cpu(*this, "mcu"), | |
104 | m_systemcpu(*this, ":maincpu"), | |
105 | to_nmk004(0xff), | |
106 | to_main(0xff) | |
635 | 107 | { |
636 | struct psg_control *psg = &m_psg_control[channel]; | |
637 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
638 | ||
639 | // advance the timers | |
640 | if (psg->note_timer) | |
641 | psg->note_timer--; | |
642 | ||
643 | if (psg->volume_timer) | |
644 | psg->volume_timer--; | |
645 | ||
646 | if (psg->flags & PSG_FLAG_NEED_INITIALIZATION) | |
647 | { | |
648 | psg->flags &= ~PSG_FLAG_NEED_INITIALIZATION; | |
649 | psg->flags |= PSG_FLAG_ACTIVE; | |
650 | ||
651 | if (psg->flags & PSG_FLAG_NOTE_IS_NOISE) | |
652 | { | |
653 | int enable; | |
654 | ||
655 | psg->flags &= ~PSG_FLAG_NOTE_IS_NOISE; | |
656 | psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED; | |
657 | ||
658 | // enable noise, disable tone on this channel | |
659 | m_ymdevice->control_port_w(space, 0, 0x07); | |
660 | enable = m_ymdevice->read_port_r(space, 0); | |
661 | enable |= (0x01 << channel); // disable tone | |
662 | enable &= ~(0x08 << channel); // enable noise | |
663 | m_ymdevice->write_port_w(space, 0, enable); | |
664 | } | |
665 | ||
666 | ||
667 | psg->note_timer = 0; | |
668 | psg->volume_timer = 0; | |
669 | psg->octave = 0; | |
670 | } | |
671 | ||
672 | if (psg->flags & PSG_FLAG_ACTIVE) | |
673 | { | |
674 | if (psg->note_timer == 0) | |
675 | { | |
676 | UINT8 token; | |
677 | ||
678 | do | |
679 | { | |
680 | token = read8(psg->current++); | |
681 | ||
682 | if ((token & 0xf0) == 0xf0) | |
683 | { | |
684 | int enable; | |
685 | ||
686 | switch (token) | |
687 | { | |
688 | case 0xf0: // noise | |
689 | psg->flags |= PSG_FLAG_NOTE_IS_NOISE; | |
690 | break; | |
691 | ||
692 | case 0xf1: // note | |
693 | psg->flags &= ~PSG_FLAG_NOTE_IS_NOISE; | |
694 | psg->flags &= ~PSG_FLAG_NOISE_NOT_ENABLED; | |
695 | ||
696 | // enable noise, disable tone on this channel | |
697 | m_ymdevice->control_port_w(space, 0, 0x07); | |
698 | enable = m_ymdevice->read_port_r(space, 0); | |
699 | enable |= (0x01 << channel); // disable tone | |
700 | enable &= ~(0x08 << channel); // enable noise | |
701 | m_ymdevice->write_port_w(space, 0, enable); | |
702 | break; | |
703 | ||
704 | case 0xf2: // set volume shape | |
705 | case 0xf3: | |
706 | case 0xf4: | |
707 | case 0xf5: | |
708 | psg->volume_shape = read8(psg->current++); | |
709 | break; | |
710 | ||
711 | case 0xf6: // jump | |
712 | psg->current = read16(psg->current); | |
713 | break; | |
714 | ||
715 | case 0xf7: // begin repeat loop | |
716 | psg->loop_times = read8(psg->current++); | |
717 | psg->loop_start = psg->current; | |
718 | break; | |
719 | ||
720 | case 0xf8: // end repeat loop | |
721 | if (--psg->loop_times > 0) | |
722 | psg->current = psg->loop_start; | |
723 | break; | |
724 | ||
725 | case 0xf9: // call subtable | |
726 | psg->return_address[psg->return_address_depth++] = psg->current + 2; | |
727 | psg->current = read16(psg->current); | |
728 | break; | |
729 | ||
730 | case 0xfa: // return from subtable | |
731 | psg->current = psg->return_address[--psg->return_address_depth]; | |
732 | break; | |
733 | ||
734 | case 0xfb: // set octave | |
735 | case 0xfc: | |
736 | case 0xfd: | |
737 | case 0xfe: | |
738 | psg->octave = read8(psg->current++); | |
739 | break; | |
740 | ||
741 | case 0xff: // end | |
742 | psg->flags = 0; // disable channel | |
743 | psg->volume_shape = 0; | |
744 | ||
745 | // mute channel | |
746 | m_ymdevice->control_port_w(space, 0, 8 + channel); | |
747 | m_ymdevice->write_port_w(space, 0, 0); | |
748 | return; | |
749 | } | |
750 | } | |
751 | } while ((token & 0xf0) == 0xf0); | |
752 | ||
753 | // token is the note to play | |
754 | psg->note = token; | |
755 | if ((psg->note & 0x0f) > NOTE_PAUSE) | |
756 | { | |
757 | fatalerror("PSG channel %d invalid note %02x\n",channel,psg->note); | |
758 | } | |
759 | ||
760 | // optional note length (otherwise use the same length as the previous one) | |
761 | if (read8(psg->current) & 0x80) | |
762 | { | |
763 | UINT16 table_start = read16(NOTE_LENGTH_TABLE_1); | |
764 | ||
765 | psg->note_length = read16(table_start + 2 * (read8(psg->current++) & 0x7f)); | |
766 | } | |
767 | ||
768 | psg->note_timer = psg->note_length; | |
769 | psg->volume_timer = 0; | |
770 | ||
771 | psg->flags |= PSG_FLAG_INITIALIZE_VOLUME; | |
772 | ||
773 | if (psg->note == NOTE_PAUSE) | |
774 | psg->flags |= PSG_FLAG_NOTE_IS_PAUSE; | |
775 | else | |
776 | { | |
777 | psg->flags &= ~PSG_FLAG_NOTE_IS_PAUSE; | |
778 | ||
779 | if (!(psg->flags & PSG_FLAG_NOTE_IS_NOISE)) | |
780 | { | |
781 | UINT16 table_start = read16(PSG_NOTE_TABLE); | |
782 | UINT16 period = read16(table_start + 2 * (psg->note & 0x0f)); | |
783 | UINT8 octave = psg->octave + ((psg->note & 0xf0) >> 4); | |
784 | ||
785 | period >>= octave; | |
786 | ||
787 | m_ymdevice->control_port_w(space, 0, 2 * channel + 1); | |
788 | m_ymdevice->write_port_w(space, 0, (period & 0x0f00) >> 8); | |
789 | m_ymdevice->control_port_w(space, 0, 2 * channel + 0); | |
790 | m_ymdevice->write_port_w(space, 0, (period & 0x00ff)); | |
791 | ||
792 | psg->note_period_hi_bits = (period & 0x0f00) >> 8; | |
793 | } | |
794 | else | |
795 | { | |
796 | if (!(psg->flags & PSG_FLAG_NOISE_NOT_ENABLED)) | |
797 | { | |
798 | int enable; | |
799 | ||
800 | psg->flags |= PSG_FLAG_NOISE_NOT_ENABLED; | |
801 | ||
802 | // disable noise, enable tone on this channel | |
803 | m_ymdevice->control_port_w(space, 0, 0x07); | |
804 | enable = m_ymdevice->read_port_r(space, 0); | |
805 | enable &= ~(0x01 << channel); // enable tone | |
806 | enable |= (0x08 << channel); // disable noise | |
807 | m_ymdevice->write_port_w(space, 0, enable); | |
808 | } | |
809 | ||
810 | m_ymdevice->control_port_w(space, 0, 0x06); // noise period | |
811 | m_ymdevice->write_port_w(space, 0, psg->note); | |
812 | psg->note_period_hi_bits = psg->note; | |
813 | } | |
814 | } | |
815 | } | |
816 | ||
817 | if (psg->volume_timer == 0) | |
818 | { | |
819 | UINT16 table_start = read16(PSG_VOLUME_TABLE); | |
820 | UINT16 vol_table_start = read16(table_start + 2 * psg->volume_shape); | |
821 | int volume; | |
822 | ||
823 | if (psg->flags & PSG_FLAG_INITIALIZE_VOLUME) | |
824 | { | |
825 | psg->flags &= ~PSG_FLAG_INITIALIZE_VOLUME; | |
826 | psg->volume_position = 0; | |
827 | } | |
828 | ||
829 | volume = read8(vol_table_start + psg->volume_position++); | |
830 | psg->volume_timer = read8(vol_table_start + psg->volume_position++); | |
831 | ||
832 | if (psg->flags & PSG_FLAG_NOTE_IS_PAUSE) | |
833 | volume = 0; | |
834 | ||
835 | // set volume | |
836 | m_ymdevice->control_port_w(space, 0, 8 + channel); | |
837 | m_ymdevice->write_port_w(space, 0, volume & 0x0f); | |
838 | } | |
839 | } | |
840 | 108 | } |
841 | 109 | |
842 | 110 | |
843 | ||
844 | /***************************** | |
845 | ||
846 | Command processing | |
847 | ||
848 | *****************************/ | |
849 | ||
850 | void nmk004_device::get_command(void) | |
111 | //------------------------------------------------- | |
112 | // device_start - device-specific startup | |
113 | //------------------------------------------------- | |
114 | void nmk004_device::device_start() | |
851 | 115 | { |
852 | static const UINT8 from_main[] = | |
853 | { | |
854 | 0x00,0x22,0x62,0x8c,0xc7,0x00,0x00,0x3f,0x7f,0x89,0xc7,0x00,0x00,0x2b,0x6b | |
855 | }; | |
856 | static const UINT8 to_main[] = | |
857 | { | |
858 | 0x82,0xc7,0x00,0x2c,0x6c,0x00,0x9f,0xc7,0x00,0x29,0x69,0x00,0x8b,0xc7,0x00 | |
859 | }; | |
860 | ||
861 | UINT8 cmd = m_from_main; | |
862 | ||
863 | if (m_protection_check < sizeof(to_main)) | |
864 | { | |
865 | // startup handshake | |
866 | if (cmd == from_main[m_protection_check]) | |
867 | { | |
868 | logerror("advance handshake to %02x\n",to_main[m_protection_check]); | |
869 | m_to_main = to_main[m_protection_check++]; | |
870 | } | |
871 | } | |
872 | else | |
873 | { | |
874 | // send command back to main CPU to acknowledge reception | |
875 | m_to_main = cmd; | |
876 | } | |
877 | ||
878 | if (m_last_command != cmd) | |
879 | { | |
880 | UINT16 table_start = read16(COMMAND_TABLE); | |
881 | UINT16 cmd_table = read16(table_start + 2 * cmd); | |
882 | ||
883 | m_last_command = cmd; | |
884 | ||
885 | if ((cmd_table & 0xff00) == 0) | |
886 | { | |
887 | oki_play_sample(cmd_table); | |
888 | } | |
889 | else | |
890 | { | |
891 | int channel; | |
892 | ||
893 | while ((channel = read8(cmd_table++)) != 0xff) | |
894 | { | |
895 | table_start = read16(cmd_table); | |
896 | cmd_table += 2; | |
897 | ||
898 | if (channel == 0xef) break; // bioship bug? | |
899 | ||
900 | //logerror("%04x: channel %d table %04x\n",cmd_table-3,channel,table_start); | |
901 | if (channel < FM_CHANNELS) | |
902 | { | |
903 | m_fm_control[channel].current = table_start; | |
904 | m_fm_control[channel].return_address_depth = 0; | |
905 | m_fm_control[channel].flags |= FM_FLAG_NEED_INITIALIZATION; | |
906 | } | |
907 | else | |
908 | { | |
909 | channel -= FM_CHANNELS; | |
910 | if (channel < PSG_CHANNELS) | |
911 | { | |
912 | m_psg_control[channel].current = table_start; | |
913 | m_psg_control[channel].return_address_depth = 0; | |
914 | m_psg_control[channel].flags |= PSG_FLAG_NEED_INITIALIZATION; | |
915 | } | |
916 | else | |
917 | { | |
918 | channel -= PSG_CHANNELS; | |
919 | if (channel >= EFFECTS_CHANNELS) | |
920 | { | |
921 | fatalerror("too many effects channels\n"); | |
922 | } | |
923 | m_effects_control[channel].current = table_start; | |
924 | m_effects_control[channel].return_address_depth = 0; | |
925 | m_effects_control[channel].flags |= EFFECTS_FLAG_NEED_INITIALIZATION; | |
926 | } | |
927 | } | |
928 | } | |
929 | } | |
930 | } | |
931 | 116 | } |
932 | 117 | |
933 | ||
934 | ||
935 | void nmk004_device::update_music(void) | |
118 | //------------------------------------------------- | |
119 | // device_mconfig_additions - return a pointer to | |
120 | // the device's machine fragment | |
121 | //------------------------------------------------- | |
122 | machine_config_constructor nmk004_device::device_mconfig_additions() const | |
936 | 123 | { |
937 | int channel; | |
938 | ||
939 | for (channel = 0; channel < FM_CHANNELS; channel++) | |
940 | fm_update(channel); | |
941 | fm_voices_update(); | |
942 | ||
943 | for (channel = 0; channel < PSG_CHANNELS; channel++) | |
944 | psg_update(channel); | |
945 | ||
946 | for (channel = 0; channel < EFFECTS_CHANNELS; channel++) | |
947 | effects_update(channel); | |
124 | return MACHINE_CONFIG_NAME( nmk004 ); | |
948 | 125 | } |
949 | 126 | |
950 | ||
951 | ||
952 | void nmk004_device::ym2203_irq_handler(int irq) | |
127 | //------------------------------------------------- | |
128 | // device_rom_region - return a pointer to the | |
129 | // the device's ROM definitions | |
130 | //------------------------------------------------- | |
131 | const rom_entry *nmk004_device::device_rom_region() const | |
953 | 132 | { |
954 | if (irq) | |
955 | { | |
956 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
957 | int status = m_ymdevice->status_port_r(space,0); | |
958 | ||
959 | if (status & 1) // timer A expired | |
960 | { | |
961 | oki_update_state(); | |
962 | get_command(); | |
963 | update_music(); | |
964 | ||
965 | // restart timer | |
966 | m_ymdevice->control_port_w(space, 0, 0x27); | |
967 | m_ymdevice->write_port_w(space, 0, 0x15); | |
968 | } | |
969 | } | |
133 | return ROM_NAME(nmk004 ); | |
970 | 134 | } |
971 | ||
972 | ||
973 | TIMER_CALLBACK_MEMBER( nmk004_device::real_init ) | |
974 | { | |
975 | static const UINT8 ym2203_init[] = | |
976 | { | |
977 | 0x07,0x38,0x08,0x00,0x09,0x00,0x0A,0x00,0x24,0xB3,0x25,0x00,0x26,0xF9,0x27,0x15, | |
978 | 0x28,0x00,0x28,0x01,0x28,0x02,0x40,0x00,0x41,0x00,0x42,0x00,0x44,0x00,0x45,0x00, | |
979 | 0x46,0x00,0x48,0x00,0x49,0x00,0x4A,0x00,0x4C,0x00,0x4D,0x00,0x4E,0x00,0xFF, | |
980 | }; | |
981 | int i; | |
982 | ||
983 | m_ymdevice = machine().device<ym2203_device>("ymsnd"); | |
984 | m_oki1device = machine().device<okim6295_device>("oki1"); | |
985 | m_oki2device = machine().device<okim6295_device>("oki2"); | |
986 | ||
987 | m_rom = machine().root_device().memregion("audiocpu")->base(); | |
988 | ||
989 | address_space &space = machine().firstcpu->space(AS_PROGRAM); | |
990 | ||
991 | if (m_ymdevice != NULL) | |
992 | { | |
993 | m_ymdevice->control_port_w(space, 0, 0x2f); | |
994 | ||
995 | i = 0; | |
996 | while (ym2203_init[i] != 0xff) | |
997 | { | |
998 | m_ymdevice->control_port_w(space, 0, ym2203_init[i++]); | |
999 | m_ymdevice->write_port_w(space, 0, ym2203_init[i++]); | |
1000 | } | |
1001 | } | |
1002 | else | |
1003 | return; | |
1004 | ||
1005 | m_oki_playing = 0; | |
1006 | ||
1007 | oki_play_sample(0); | |
1008 | ||
1009 | m_protection_check = 0; | |
1010 | } | |
1011 | ||
1012 | ||
1013 | WRITE16_MEMBER( nmk004_device::write ) | |
1014 | { | |
1015 | if (ACCESSING_BITS_0_7) | |
1016 | { | |
1017 | //logerror("%06x: NMK004_w %02x\n",space.device().safe_pc(),data); | |
1018 | m_from_main = data & 0xff; | |
1019 | } | |
1020 | } | |
1021 | ||
1022 | READ16_MEMBER( nmk004_device::read ) | |
1023 | { | |
1024 | //static int last; | |
1025 | int res = m_to_main; | |
1026 | ||
1027 | //if (res != last) logerror("%06x: NMK004_r %02x\n",space.device().safe_pc(),res); | |
1028 | //last = res; | |
1029 | ||
1030 | return res; | |
1031 | } |
r32099 | r32100 | |
---|---|---|
1 | #include "sound/2203intf.h" | |
2 | #include "sound/okim6295.h" | |
1 | // license:MAME | |
2 | // copyright-holders:David Haywood,trap15 | |
3 | /*************************************************************************** | |
3 | 4 | |
4 | #define FM_CHANNELS 6 | |
5 | #define PSG_CHANNELS 3 | |
6 | #define EFFECTS_CHANNELS 8 | |
5 | NMK004 emulation | |
7 | 6 | |
8 | struct psg_control | |
9 | { | |
10 | /* C220 */ UINT8 flags; | |
11 | /* C221-C222 */ UINT16 note_timer; | |
12 | /* C223-C224 */ UINT16 note_length; | |
13 | /* C225 */ UINT8 volume_timer; | |
14 | /* C227-C228 */ UINT16 current; // current position in control table | |
15 | /* C229-C22A */ UINT16 return_address[16]; // return address when control table calls a subtable | |
16 | int return_address_depth; | |
17 | /* C22B-C22C */ UINT16 loop_start; // first instruction of loop | |
18 | /* C22D */ UINT8 loop_times; // number of times to loop | |
19 | /* C22E */ UINT8 volume_shape; | |
20 | /* C22F */ UINT8 volume_position; | |
21 | /* C230 */ UINT8 octave; // base octave | |
22 | /* C231 */ UINT8 note; // note to play | |
23 | /* C233 */ UINT8 note_period_hi_bits; | |
24 | }; | |
7 | ***************************************************************************/ | |
25 | 8 | |
26 | struct fm_control | |
27 | { | |
28 | UINT8 note; | |
29 | /* C020 */ UINT8 flags; | |
30 | /* C021 */ UINT8 slot; // for ym2203 keyon command | |
31 | /* C022-C039 */ UINT8 voice_params[0x18]; // parameters for the YM2203 to configure sound shape | |
32 | /* C03A-C03B */ UINT16 f_number; | |
33 | /* C03C */ UINT8 self_feedback; | |
34 | /* C03D */ UINT8 note_duration_table_select; | |
35 | /* C03E-C03F */ UINT16 current; // current position in control table | |
36 | /* C040-C041 */ UINT16 loop_start; // first instruction of loop | |
37 | /* C042 */ UINT8 loop_times; // number of times to loop | |
38 | /* C043-C044 */ UINT16 return_address[16]; // return address when control table calls a subtable | |
39 | int return_address_depth; | |
40 | /* C045 */ UINT8 octave; | |
41 | /* C046-C047 */ UINT16 timer1; | |
42 | /* C048-C049 */ UINT16 timer2; | |
43 | /* C04A-C04B */ UINT16 timer1_duration; | |
44 | /* C04C-C04D */ UINT16 timer2_duration; | |
45 | /* C04E */ UINT8 modulation_table_number; | |
46 | /* C04F-C050 */ UINT16 modulation_timer; | |
47 | /* C051-C052 */ UINT16 modulation_table; | |
48 | /* C053-C054 */ UINT16 modulation_table_position; | |
49 | /* C055-C056 */ UINT16 note_period; | |
50 | /* C057-C05A */ UINT8 voice_volume[4]; // parameters for the YM2203 to configure sound shape | |
51 | /* C05C */ UINT8 must_update_voice_params; | |
52 | }; | |
9 | #ifndef NMK004_H | |
10 | #define NMK004_H | |
53 | 11 | |
54 | struct effects_control | |
55 | { | |
56 | /* C1A0 */ UINT8 flags; | |
57 | /* C1BE-C1BF */ UINT16 current; // current position in control table | |
58 | /* C1C0-C1C1 */ UINT16 loop_start; // first instruction of loop | |
59 | /* C1C2 */ UINT8 loop_times; // number of times to loop | |
60 | /* C1C3-C1C4 */ UINT16 return_address[16]; // return address when control table calls a subtable | |
61 | int return_address_depth; | |
62 | /* C1C6-C1C7 */ UINT16 timer; | |
63 | /* C1CA-C1CB */ UINT16 timer_duration; | |
64 | }; | |
12 | #include "cpu/tlcs90/tlcs90.h" | |
13 | #include "sound/2203intf.h" | |
14 | #include "sound/okim6295.h" | |
65 | 15 | |
16 | #define MCFG_NMK004_ADD(_tag, _clock) \ | |
17 | MCFG_DEVICE_ADD(_tag, NMK004, _clock) | |
18 | ||
19 | ||
20 | /* device get info callback */ | |
66 | 21 | class nmk004_device : public device_t |
67 | 22 | { |
68 | 23 | public: |
69 | 24 | nmk004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
70 | ~nmk004_device() {} | |
71 | 25 | |
26 | WRITE8_MEMBER( write ); | |
27 | READ8_MEMBER( read ); | |
28 | ||
29 | DECLARE_WRITE8_MEMBER(nmk004_port4_w); | |
30 | DECLARE_WRITE8_MEMBER(nmk004_oki0_bankswitch_w); | |
31 | DECLARE_WRITE8_MEMBER(nmk004_oki1_bankswitch_w); | |
32 | DECLARE_READ8_MEMBER(nmk004_tonmk004_r); | |
33 | DECLARE_WRITE8_MEMBER(nmk004_tomain_w); | |
72 | 34 | void ym2203_irq_handler(int irq); |
73 | DECLARE_READ16_MEMBER( read ); | |
74 | DECLARE_WRITE16_MEMBER( write ); | |
35 | required_device<tlcs90_device> m_cpu; | |
75 | 36 | |
76 | 37 | protected: |
77 | 38 | // device-level overrides |
78 | virtual void device_config_complete(); | |
79 | 39 | virtual void device_start(); |
80 | virtual void device_reset(); | |
40 | virtual const rom_entry *device_rom_region() const; | |
41 | virtual machine_config_constructor device_mconfig_additions() const; | |
81 | 42 | |
43 | ||
82 | 44 | private: |
83 | 45 | // internal state |
84 | const UINT8 *m_rom; // NMK004 data ROM | |
85 | UINT8 m_from_main; // command from main CPU | |
86 | UINT8 m_to_main; // answer to main CPU | |
87 | int m_protection_check; | |
46 | required_device<cpu_device> m_systemcpu; | |
47 | UINT8 to_nmk004; | |
48 | UINT8 to_main; | |
88 | 49 | |
89 | ym2203_device *m_ymdevice; | |
90 | okim6295_device *m_oki1device; | |
91 | okim6295_device *m_oki2device; | |
92 | ||
93 | /* C001 */ UINT8 m_last_command; // last command received | |
94 | /* C016 */ UINT8 m_oki_playing; // bitmap of active Oki channels | |
95 | /* C020-C19F */ struct fm_control m_fm_control[FM_CHANNELS]; | |
96 | /* C220-C2DF */ struct psg_control m_psg_control[PSG_CHANNELS]; | |
97 | /* C1A0-C21F */ struct effects_control m_effects_control[EFFECTS_CHANNELS]; | |
98 | ||
99 | TIMER_CALLBACK_MEMBER( real_init ); | |
100 | UINT8 read8(int address); | |
101 | UINT16 read16(int address); | |
102 | void oki_play_sample(int sample_no); | |
103 | void oki_update_state(void); | |
104 | void effects_update(int channel); | |
105 | void fm_update(int channel); | |
106 | void fm_voices_update(void); | |
107 | void psg_update(int channel); | |
108 | void get_command(void); | |
109 | void update_music(void); | |
110 | 50 | }; |
111 | 51 | |
112 | 52 | extern const device_type NMK004; |
113 | 53 | |
114 | #define MCFG_NMK004_ADD(_tag) \ | |
115 | MCFG_DEVICE_ADD(_tag, NMK004, 0) | |
54 | #endif /* NMK004_H */ |
r32099 | r32100 | |
---|---|---|
1 | 1 | #include "machine/nmk112.h" |
2 | 2 | #include "sound/okim6295.h" |
3 | #include "machine/nmk004.h" | |
3 | 4 | |
4 | 5 | class nmk16_state : public driver_device |
5 | 6 | { |
r32099 | r32100 | |
24 | 25 | m_afega_scroll_0(*this, "afega_scroll_0"), |
25 | 26 | m_afega_scroll_1(*this, "afega_scroll_1"), |
26 | 27 | m_gfxdecode(*this, "gfxdecode"), |
27 | m_palette(*this, "palette") {} | |
28 | m_palette(*this, "palette"), | |
29 | m_nmk004(*this, "nmk004"), | |
30 | m_sprdma_base(0x8000) | |
31 | {} | |
28 | 32 | |
29 | 33 | required_device<cpu_device> m_maincpu; |
30 | 34 | optional_device<cpu_device> m_audiocpu; |
r32099 | r32100 | |
45 | 49 | optional_shared_ptr<UINT16> m_afega_scroll_1; |
46 | 50 | required_device<gfxdecode_device> m_gfxdecode; |
47 | 51 | required_device<palette_device> m_palette; |
52 | optional_device<nmk004_device> m_nmk004; | |
53 | int m_sprdma_base; | |
48 | 54 | int mask[4*2]; |
49 | 55 | int m_simple_scroll; |
50 | 56 | int m_redraw_bitmap; |
r32099 | r32100 | |
113 | 119 | DECLARE_WRITE16_MEMBER(bioship_bank_w); |
114 | 120 | DECLARE_WRITE8_MEMBER(spec2k_oki1_banking_w); |
115 | 121 | DECLARE_WRITE8_MEMBER(twinactn_oki_bank_w); |
116 | DECLARE_READ16_MEMBER( atombjt_unkr_r ) | |
117 | { | |
118 | return 0x0000; | |
119 | } | |
120 | ||
122 | DECLARE_READ16_MEMBER(atombjt_unkr_r) {return 0x0000;} | |
123 | DECLARE_WRITE16_MEMBER(nmk16_x0016_w); | |
124 | DECLARE_WRITE16_MEMBER(nmk16_bioship_x0016_w); | |
121 | 125 | DECLARE_DRIVER_INIT(nmk); |
122 | 126 | DECLARE_DRIVER_INIT(vandykeb); |
123 | 127 | DECLARE_DRIVER_INIT(tdragonb); |
124 | 128 | DECLARE_DRIVER_INIT(ssmissin); |
125 | DECLARE_DRIVER_INIT(hachamf); | |
129 | DECLARE_DRIVER_INIT(hachamf_prot); | |
126 | 130 | DECLARE_DRIVER_INIT(redhawk); |
127 | DECLARE_DRIVER_INIT(tdragon); | |
131 | DECLARE_DRIVER_INIT(tdragon_prot); | |
128 | 132 | DECLARE_DRIVER_INIT(bubl2000); |
129 | 133 | DECLARE_DRIVER_INIT(grdnstrm); |
130 | 134 | DECLARE_DRIVER_INIT(spec2k); |
r32099 | r32100 | |
163 | 167 | UINT32 screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
164 | 168 | UINT32 screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
165 | 169 | UINT32 screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
166 | void screen_eof_nmk(screen_device &screen, bool state); | |
167 | void screen_eof_strahl(screen_device &screen, bool state); | |
168 | 170 | TIMER_DEVICE_CALLBACK_MEMBER(tdragon_mcu_sim); |
169 | 171 | TIMER_DEVICE_CALLBACK_MEMBER(hachamf_mcu_sim); |
170 | 172 | TIMER_DEVICE_CALLBACK_MEMBER(nmk16_scanline); |
r32099 | r32100 | |
---|---|---|
139 | 139 | m_fg_tilemap->set_transparent_pen(15); |
140 | 140 | m_tx_tilemap->set_transparent_pen(15); |
141 | 141 | |
142 | m_sprdma_base = 0xf000; | |
143 | ||
142 | 144 | nmk16_video_init(); |
143 | 145 | } |
144 | 146 | |
r32099 | r32100 | |
780 | 782 | return nmk16_bg_spr_update(screen, bitmap, cliprect); |
781 | 783 | } |
782 | 784 | |
783 | void nmk16_state::screen_eof_nmk(screen_device &screen, bool state) | |
784 | { | |
785 | // rising edge | |
786 | if (state) | |
787 | { | |
788 | /* sprites are DMA'd from Main RAM to a private buffer automatically | |
789 | (or at least this is how I interpret the datasheet) */ | |
790 | 785 | |
791 | /* -- I actually see little evidence to support this, sprite lag | |
792 | in some games should be checked on real boards */ | |
793 | ||
794 | // memcpy(m_spriteram_old2,m_spriteram_old,0x1000); | |
795 | memcpy(m_spriteram_old2,m_mainram+0x8000/2,0x1000); | |
796 | } | |
797 | } | |
798 | ||
799 | void nmk16_state::screen_eof_strahl(screen_device &screen, bool state) | |
800 | { | |
801 | // rising edge | |
802 | if (state) | |
803 | { | |
804 | /* sprites are DMA'd from Main RAM to a private buffer automatically | |
805 | (or at least this is how I interpret the datasheet) */ | |
806 | ||
807 | /* -- I actually see little evidence to support this, sprite lag | |
808 | in some games should be checked on real boards */ | |
809 | ||
810 | /* strahl sprites are allocated in memory range FF000-FFFFF */ | |
811 | ||
812 | memcpy(m_spriteram_old2,m_mainram+0xF000/2,0x1000); | |
813 | } | |
814 | } | |
815 | ||
816 | ||
817 | ||
818 | 786 | /*************************************************************************** |
819 | 787 | |
820 | 788 |
r32099 | r32100 | |
---|---|---|
1317 | 1317 | void tlcs90_device::check_interrupts() |
1318 | 1318 | { |
1319 | 1319 | tlcs90_e_irq irq; |
1320 | int mask; | |
1320 | 1321 | |
1321 | 1322 | if (!(F & IF)) |
1322 | 1323 | return; |
1323 | 1324 | |
1324 | for (irq = INT | |
1325 | for (irq = INTSWI; irq < INTMAX; irq++) | |
1325 | 1326 | { |
1326 | if ( m_irq_state & m_irq_mask & (1 << irq) ) | |
1327 | mask = (1 << irq); | |
1328 | if(irq >= INT0) mask &= m_irq_mask; | |
1329 | if ( m_irq_state & mask ) | |
1327 | 1330 | { |
1328 | 1331 | take_interrupt( irq ); |
1329 | 1332 | return; |
r32099 | r32100 | |
2342 | 2345 | break; |
2343 | 2346 | case 1: |
2344 | 2347 | // 16-bit mode |
2345 | if (i & 1) | |
2346 | { | |
2347 | logerror("%04X: CPU Timer %d clocked by Timer %d overflow signal\n", m_pc.w.l, i,i-1); | |
2348 | return; | |
2349 | } | |
2350 | 2348 | break; |
2351 | 2349 | case 2: |
2352 | 2350 | logerror("%04X: CPU Timer %d, unsupported PPG mode\n", m_pc.w.l, i); |
r32099 | r32100 | |
2411 | 2409 | |
2412 | 2410 | TIMER_CALLBACK_MEMBER( tlcs90_device::t90_timer_callback ) |
2413 | 2411 | { |
2414 | int i | |
2412 | int mode, timer_fired; | |
2415 | 2413 | int i = param; |
2416 | 2414 | |
2417 | 2415 | if ( (m_internal_registers[ T90_TRUN - T90_IOBASE ] & (1 << i)) == 0 ) |
2418 | 2416 | return; |
2419 | 2417 | |
2420 | ||
2418 | timer_fired = 0; | |
2421 | 2419 | |
2422 | m_timer_value[i]++; | |
2423 | ||
2424 | is16bit = ((m_internal_registers[ T90_TMOD - T90_IOBASE ] >> (i/2 * 2 + 2)) & 0x03) == 1; | |
2425 | ||
2420 | mode = (m_internal_registers[ T90_TMOD - T90_IOBASE ] >> ((i & ~1) + 2)) & 0x03; | |
2426 | 2421 | // Match |
2422 | switch (mode) | |
2423 | { | |
2424 | case 0x02: // 8bit PPG | |
2425 | case 0x03: // 8bit PWM | |
2426 | logerror("CPU Timer %d expired with unhandled mode %d\n", i, mode); | |
2427 | // TODO: hmm... | |
2428 | case 0x00: // 8bit | |
2429 | m_timer_value[i]++; | |
2430 | if ( m_timer_value[i] == m_internal_registers[ T90_TREG0+i - T90_IOBASE ] ) | |
2431 | timer_fired = 1; | |
2432 | break; | |
2427 | 2433 | |
2428 | if ( m_timer_value[i] == m_internal_registers[ T90_TREG0+i - T90_IOBASE ] ) | |
2429 | { | |
2430 | // logerror("CPU Timer %d match\n", i); | |
2434 | case 0x01: // 16bit | |
2435 | if(i & 1) | |
2436 | break; | |
2437 | m_timer_value[i]++; | |
2438 | if(m_timer_value[i] == 0) m_timer_value[i+1]++; | |
2439 | if(m_timer_value[i+1] == m_internal_registers[ T90_TREG0+i+1 - T90_IOBASE ]) | |
2440 | if(m_timer_value[i] == m_internal_registers[ T90_TREG0+i - T90_IOBASE ]) | |
2441 | timer_fired = 1; | |
2442 | break; | |
2443 | } | |
2431 | 2444 | |
2432 | if (is16bit) | |
2433 | { | |
2434 | if (i & 1) | |
2435 | { | |
2436 | if ( m_timer_value[i-1] == m_internal_registers[ T90_TREG0+i-1 - T90_IOBASE ] ) | |
2437 | { | |
2438 | m_timer_value[i] = 0; | |
2439 | m_timer_value[i-1] = 0; | |
2440 | ||
2441 | set_irq_line(INTT0 + i, 1); | |
2442 | } | |
2443 | } | |
2444 | else | |
2445 | set_irq_line(INTT0 + i, 1); | |
2446 | } | |
2447 | else | |
2448 | { | |
2449 | m_timer_value[i] = 0; | |
2450 | set_irq_line(INTT0 + i, 1); | |
2451 | } | |
2452 | ||
2453 | switch (i) | |
2454 | { | |
2455 | case 0: | |
2456 | case 2: | |
2457 | if ( !is16bit ) | |
2458 | if ( (m_internal_registers[ T90_TCLK - T90_IOBASE ] & (0x03 << (i * 2 + 2))) == 0 ) // T0/T1 match signal clocks T1/T3 | |
2459 | t90_timer_callback(ptr, i+1); | |
2460 | break; | |
2461 | } | |
2462 | } | |
2463 | ||
2464 | // Overflow | |
2465 | ||
2466 | if ( m_timer_value[i] == 0 ) | |
2467 | { | |
2468 | // logerror("CPU Timer %d overflow\n", i); | |
2469 | ||
2470 | switch (i) | |
2471 | { | |
2472 | case 0: | |
2473 | case 2: | |
2474 | if ( is16bit ) // T0/T1 overflow signal clocks T1/T3 | |
2475 | t90_timer_callback(ptr, i+1); | |
2476 | break; | |
2477 | } | |
2478 | } | |
2445 | if(timer_fired) { | |
2446 | // special stuff handling | |
2447 | switch(mode) { | |
2448 | case 0x02: // 8bit PPG | |
2449 | case 0x03: // 8bit PWM | |
2450 | // TODO: hmm... | |
2451 | case 0x00: // 8bit | |
2452 | if(i & 1) | |
2453 | break; | |
2454 | if ( (m_internal_registers[ T90_TCLK - T90_IOBASE ] & (0x0C << (i * 2))) == 0 ) // T0/T1 match signal clocks T1/T3 | |
2455 | t90_timer_callback(ptr, i+1); | |
2456 | break; | |
2457 | case 0x01: // 16bit, only can happen for i=0,2 | |
2458 | m_timer_value[i+1] = 0; | |
2459 | set_irq_line(INTT0 + i+1, 1); | |
2460 | break; | |
2461 | } | |
2462 | // regular handling | |
2463 | m_timer_value[i] = 0; | |
2464 | set_irq_line(INTT0 + i, 1); | |
2465 | } | |
2479 | 2466 | } |
2480 | 2467 | |
2481 | 2468 | TIMER_CALLBACK_MEMBER( tlcs90_device::t90_timer4_callback ) |
r32099 | r32100 | |
2523 | 2510 | { |
2524 | 2511 | if ( (old ^ data) & (0x20 | (1 << i)) ) // if timer bit or prescaler bit changed |
2525 | 2512 | { |
2526 | if ( data == (0x20 | (1 << i)) ) t90_start_timer(i); | |
2527 | else t90_stop_timer(i); | |
2513 | if ( (data & (1 << i)) && (data & 0x20) ) t90_start_timer(i); | |
2514 | else t90_stop_timer(i); | |
2528 | 2515 | } |
2529 | 2516 | } |
2517 | ||
2518 | ||
2530 | 2519 | // Timer 4 |
2531 | 2520 | if ( (old ^ data) & (0x20 | 0x10) ) |
2532 | 2521 | { |
r32099 | r32100 | |
---|---|---|
19 | 19 | enum tlcs90_e_irq { INTSWI = 0, INTNMI, INTWD, INT0, INTT0, INTT1, INTT2, INTT3, INTT4, INT1, INTT5, INT2, INTRX, INTTX, INTMAX }; |
20 | 20 | DECLARE_ENUM_OPERATORS(tlcs90_e_irq) |
21 | 21 | |
22 | ||
23 | 22 | class tlcs90_device : public cpu_device |
24 | 23 | { |
25 | 24 | public: |
Previous | 199869 Revisions | Next |