trunk/src/emu/cpu/tms0980/tms0980.c
| r242975 | r242976 | |
| 429 | 429 | m_sr = 0; |
| 430 | 430 | m_pa = 0; |
| 431 | 431 | m_pb = 0; |
| 432 | m_ps = 0; |
| 432 | 433 | m_a = 0; |
| 433 | 434 | m_x = 0; |
| 434 | 435 | m_y = 0; |
| r242975 | r242976 | |
| 466 | 467 | save_item(NAME(m_sr)); |
| 467 | 468 | save_item(NAME(m_pa)); |
| 468 | 469 | save_item(NAME(m_pb)); |
| 470 | save_item(NAME(m_ps)); |
| 469 | 471 | save_item(NAME(m_a)); |
| 470 | 472 | save_item(NAME(m_x)); |
| 471 | 473 | save_item(NAME(m_y)); |
| r242975 | r242976 | |
| 636 | 638 | tms1100_cpu_device::device_reset(); |
| 637 | 639 | |
| 638 | 640 | // small differences in 00-3f area |
| 639 | | m_fixed_decode[0x09] = F_COMX; // ! |
| 641 | m_fixed_decode[0x09] = F_COMX; |
| 640 | 642 | m_fixed_decode[0x0b] = F_TPC; |
| 641 | 643 | } |
| 642 | 644 | |
| r242975 | r242976 | |
| 958 | 960 | //------------------------------------------------- |
| 959 | 961 | |
| 960 | 962 | // handle branches: |
| 963 | |
| 964 | // TMS1000/common |
| 961 | 965 | // note: add(latch) and bl(branch latch) are specific to 0980 series, |
| 962 | 966 | // c(chapter) bits are specific to 1100(and 1400) series |
| 963 | 967 | |
| 964 | | // TMS1000/common: |
| 965 | | |
| 966 | 968 | void tms1xxx_cpu_device::op_br() |
| 967 | 969 | { |
| 968 | 970 | // BR/BL: conditional branch |
| 969 | | if (!m_status) |
| 970 | | return; |
| 971 | | |
| 972 | | if (!m_clatch) |
| 973 | | m_pa = m_pb; |
| 974 | | m_ca = m_cb; |
| 975 | | m_pc = m_opcode & m_pc_mask; |
| 971 | if (m_status) |
| 972 | { |
| 973 | if (m_clatch == 0) |
| 974 | m_pa = m_pb; |
| 975 | m_ca = m_cb; |
| 976 | m_pc = m_opcode & m_pc_mask; |
| 977 | } |
| 976 | 978 | } |
| 977 | 979 | |
| 978 | 980 | void tms1xxx_cpu_device::op_call() |
| 979 | 981 | { |
| 980 | 982 | // CALL/CALLL: conditional call |
| 981 | | if (!m_status) |
| 982 | | return; |
| 983 | if (m_status) |
| 984 | { |
| 985 | UINT8 prev_pa = m_pa; |
| 983 | 986 | |
| 984 | | UINT8 prev_pa = m_pa; |
| 985 | | if (!m_clatch) |
| 986 | | { |
| 987 | | m_sr = m_pc; |
| 988 | | m_clatch = 1; |
| 989 | | m_pa = m_pb; |
| 990 | | m_cs = m_ca; |
| 987 | if (m_clatch == 0) |
| 988 | { |
| 989 | m_clatch = 1; |
| 990 | m_sr = m_pc; |
| 991 | m_pa = m_pb; |
| 992 | m_cs = m_ca; |
| 993 | } |
| 994 | m_ca = m_cb; |
| 995 | m_pb = prev_pa; |
| 996 | m_pc = m_opcode & m_pc_mask; |
| 991 | 997 | } |
| 992 | | m_ca = m_cb; |
| 993 | | m_pb = prev_pa; |
| 994 | | m_pc = m_opcode & m_pc_mask; |
| 995 | 998 | } |
| 996 | 999 | |
| 997 | 1000 | void tms1xxx_cpu_device::op_retn() |
| 998 | 1001 | { |
| 999 | 1002 | // RETN: return from subroutine |
| 1000 | | if (m_clatch) |
| 1003 | if (m_clatch == 1) |
| 1001 | 1004 | { |
| 1005 | m_clatch = 0; |
| 1002 | 1006 | m_pc = m_sr; |
| 1003 | | m_clatch = 0; |
| 1004 | 1007 | m_ca = m_cs; |
| 1005 | 1008 | } |
| 1006 | 1009 | m_add = 0; |
| r242975 | r242976 | |
| 1014 | 1017 | void tms1400_cpu_device::op_br() |
| 1015 | 1018 | { |
| 1016 | 1019 | // BR/BL: conditional branch |
| 1017 | | if (!m_status) |
| 1018 | | return; |
| 1019 | | |
| 1020 | | //.. |
| 1020 | if (m_status) |
| 1021 | { |
| 1022 | m_pa = m_pb; // don't care about clatch |
| 1023 | m_ca = m_cb; |
| 1024 | m_pc = m_opcode & m_pc_mask; |
| 1025 | } |
| 1021 | 1026 | } |
| 1022 | 1027 | |
| 1023 | 1028 | void tms1400_cpu_device::op_call() |
| 1024 | 1029 | { |
| 1025 | 1030 | // CALL/CALLL: conditional call |
| 1026 | | if (!m_status) |
| 1027 | | return; |
| 1031 | if (m_status) |
| 1032 | { |
| 1033 | // 3-level stack, mask clatch 3 bits (no need to mask others) |
| 1034 | m_clatch = (m_clatch << 1 | 1) & 7; |
| 1028 | 1035 | |
| 1029 | | //.. |
| 1036 | m_sr = m_sr << m_pc_bits | m_pc; |
| 1037 | m_pc = m_opcode & m_pc_mask; |
| 1038 | |
| 1039 | m_ps = m_ps << 4 | m_pa; |
| 1040 | m_pa = m_pb; |
| 1041 | |
| 1042 | m_cs = m_cs << 2 | m_ca; |
| 1043 | m_ca = m_cb; |
| 1044 | } |
| 1045 | else |
| 1046 | { |
| 1047 | m_pb = m_pa; |
| 1048 | m_cb = m_ca; |
| 1049 | } |
| 1030 | 1050 | } |
| 1031 | 1051 | |
| 1032 | 1052 | void tms1400_cpu_device::op_retn() |
| 1033 | 1053 | { |
| 1034 | 1054 | // RETN: return from subroutine |
| 1035 | | //.. |
| 1055 | if (m_clatch & 1) |
| 1056 | { |
| 1057 | m_clatch >>= 1; |
| 1058 | |
| 1059 | m_pc = m_sr & m_pc_mask; |
| 1060 | m_sr >>= m_pc_bits; |
| 1061 | |
| 1062 | m_pa = m_pb = m_ps & 0xf; |
| 1063 | m_ps >>= 4; |
| 1064 | |
| 1065 | m_ca = m_cb = m_cs & 3; |
| 1066 | m_cs >>= 2; |
| 1067 | } |
| 1036 | 1068 | } |
| 1037 | 1069 | |
| 1038 | 1070 | |
| 1039 | 1071 | // handle other: |
| 1040 | 1072 | |
| 1041 | | // TMS1000/common: |
| 1073 | // TMS1000/common |
| 1042 | 1074 | |
| 1043 | 1075 | void tms1xxx_cpu_device::op_sbit() |
| 1044 | 1076 | { |
| r242975 | r242976 | |
| 1158 | 1190 | |
| 1159 | 1191 | |
| 1160 | 1192 | // TMS0980-specific (and possibly child classes) |
| 1193 | |
| 1161 | 1194 | void tms0980_cpu_device::op_comx() |
| 1162 | 1195 | { |
| 1163 | 1196 | // COMX: complement X register, but not the MSB |
| r242975 | r242976 | |
| 1203 | 1236 | |
| 1204 | 1237 | |
| 1205 | 1238 | // TMS0270-specific |
| 1239 | |
| 1206 | 1240 | void tms0270_cpu_device::op_setr() |
| 1207 | 1241 | { |
| 1208 | 1242 | // same as default, but handle write to output in dynamic_output |
trunk/src/mame/drivers/naomi.c
| r242975 | r242976 | |
| 521 | 521 | Star Horse (satellite) 840-0056C 23627 6 (128Mb)* 315-6319 315-6213 not present * +1 (64Mb), requires 837-13785 ARCNET&IO BD |
| 522 | 522 | Star Horse Progress (satellite) (Rev A) 840-0123C 24122A 7 (128Mb) 315-6319A 315-6213 not present requires 837-13785 ARCNET&IO BD |
| 523 | 523 | The King of Route 66 (Rev A) 840-0087C 23819A 10 (128Mb) 315-6319A 315-6213 not present |
| 524 | Virtua Striker 3 840-0061C 23663 11 (128Mb) 315-6319A 315-6213 317-0310-COM |
| 524 | 525 | Virtua Striker 3 (Rev B) 840-0061C 23663B 11 (128Mb) 315-6319A 315-6213 317-0310-COM |
| 525 | | Virtua Striker 3 (Rev C) 840-0061C 23663C 11 (128Mb) 315-6319A 315-6213 317-0310-COM |
| 526 | 526 | Wave Runner GP 840-0064C 24059 6 (128Mb) 315-6319A 315-6213 not present |
| 527 | 527 | Wild Riders 840-0046C 23622 10 (128Mb) 315-6319A 315-6213 317-0301-COM |
| 528 | 528 | WWF Royal Rumble 840-0040C 22261 8 (128Mb) 315-6319 315-6213 317-0285-COM |
| r242975 | r242976 | |
| 7790 | 7790 | NAOMI_DEFAULT_EEPROM |
| 7791 | 7791 | |
| 7792 | 7792 | ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF) |
| 7793 | | ROM_LOAD( "epr-23663c.ic22",0x0000000, 0x0400000, CRC(7007fec7) SHA1(523168f0b218d0bd5c815d65bf0caba2c8468c9d) ) |
| 7793 | // rom was handmade from 2 damaged dumps, needs to be verified |
| 7794 | ROM_LOAD( "epr-23663.ic22", 0x0000000, 0x0400000, BAD_DUMP CRC(6910a008) SHA1(865affff1cf31321725ef727a17be384555e3aae) ) |
| 7794 | 7795 | ROM_LOAD( "mpr-23652.ic1", 0x0800000, 0x1000000, CRC(992758a2) SHA1(5e2a25c520c1795128e5026fc00d355c24852ded) ) |
| 7795 | 7796 | ROM_LOAD( "mpr-23653.ic2", 0x1800000, 0x1000000, CRC(e210e932) SHA1(2f6f0a31c3e98b21f1ff3af1680e50b3535b130f) ) |
| 7796 | 7797 | ROM_LOAD( "mpr-23654.ic3", 0x2800000, 0x1000000, CRC(91335971) SHA1(fc7599b836fb7995dd7da940e64b08b3c09cb180) ) |
| r242975 | r242976 | |
| 9034 | 9035 | |
| 9035 | 9036 | /* 840-xxxxx (Sega Naomi 2 cart games) */ |
| 9036 | 9037 | /* 0046 */ GAME( 2001, wldrider, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS ) |
| 9037 | | /* 0061 */ GAME( 2001, vstrik3c, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart, Rev C)", GAME_FLAGS ) |
| 9038 | /* 0061 */ GAME( 2001, vstrik3c, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart)", GAME_FLAGS ) |
| 9038 | 9039 | /* 0061 */ GAME( 2001, vstrik3cb,vstrik3c,naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart, Rev B)", GAME_FLAGS ) |
| 9039 | 9040 | /* 0062 */ GAME( 2001, clubkrte, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Club Kart: European Session", GAME_FLAGS ) |
| 9040 | 9041 | /* 0062 */ GAME( 2001, clubkrtd, clubkrte,naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Club Kart: European Session (Rev D)", GAME_FLAGS ) |
trunk/src/mame/drivers/snowbros.c
| r242975 | r242976 | |
| 185 | 185 | if (ACCESSING_BITS_0_7) soundlatch_byte_w(space,0,data & 0xff); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | READ16_MEMBER(snowbros_state::toto_read) |
| 189 | { |
| 190 | int pc = space.device().safe_pc(); |
| 191 | if ((pc!= 0x3f010) && (pc!= 0x38008)) printf("toto prot %08x %04x\n", pc, mem_mask); |
| 192 | return 0x0700; |
| 193 | } |
| 194 | |
| 188 | 195 | /* Snow Bros Memory Map */ |
| 189 | 196 | |
| 190 | 197 | static ADDRESS_MAP_START( snowbros_map, AS_PROGRAM, 16, snowbros_state ) |
| r242975 | r242976 | |
| 1955 | 1962 | ROM_LOAD16_BYTE( "wb09.bin", 0x60001, 0x10000, CRC(9be718ca) SHA1(5c195e4f13efbdb229201d2408d018861bf389cc) ) |
| 1956 | 1963 | ROM_END |
| 1957 | 1964 | |
| 1965 | ROM_START( toto ) |
| 1966 | ROM_REGION( 0x40000, "maincpu", 0 ) |
| 1967 | ROM_LOAD16_BYTE( "u60.5j", 0x00000, 0x20000, CRC(39203792) SHA1(4c8d560be02a514cbf91774c7a0b4a95cf573356) ) |
| 1968 | ROM_LOAD16_BYTE( "u51.4j", 0x00001, 0x20000, CRC(7b846cd4) SHA1(04aa0bbaab4303fb08dff52d5515f7e764f1be6d)) |
| 1969 | |
| 1970 | ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */ |
| 1971 | ROM_LOAD( "u46.4c", 0x0000, 0x8000, CRC(77b1ef42) SHA1(75e3c8c2b687669cc56f972dd7375dab5185859c) ) |
| 1972 | |
| 1973 | ROM_REGION( 0x80000, "gfx1", 0 ) |
| 1974 | ROM_LOAD( "u107.8k", 0x00000, 0x20000, CRC(4486153b) SHA1(a6dc0c17bf2328ab725bce4aaa0a413a42129fb0) ) |
| 1975 | ROM_LOAD( "u108.8l", 0x20000, 0x20000, CRC(3286cf5f) SHA1(133366b0e10ab86111247cbedf329e8e3a7f2148) ) |
| 1976 | ROM_LOAD( "u109.8m", 0x40000, 0x20000, CRC(464d7251) SHA1(f03ee54e9301ea87de4171cecdbad4a5e17929c4) ) |
| 1977 | ROM_LOAD( "u110.8n", 0x60000, 0x20000, CRC(7dea56df) SHA1(7e7b9238837c6f4221cff416a2de21723d2c9272) ) |
| 1978 | ROM_END |
| 1979 | |
| 1958 | 1980 | /* Barko */ |
| 1959 | 1981 | |
| 1960 | 1982 | ROM_START( honeydol ) |
| r242975 | r242976 | |
| 2866 | 2888 | |
| 2867 | 2889 | |
| 2868 | 2890 | |
| 2891 | DRIVER_INIT_MEMBER(snowbros_state,toto) |
| 2892 | { |
| 2893 | // every single rom has bits 0x10 and 0x08 swapped |
| 2894 | UINT8 *src = memregion("maincpu")->base(); |
| 2895 | int len = memregion("maincpu")->bytes(); |
| 2896 | |
| 2897 | for (int i = 0; i < len; i++) |
| 2898 | { |
| 2899 | src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0); |
| 2900 | } |
| 2901 | |
| 2902 | src = memregion("gfx1")->base(); |
| 2903 | len = memregion("gfx1")->bytes(); |
| 2904 | |
| 2905 | for (int i = 0; i < len; i++) |
| 2906 | { |
| 2907 | src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0); |
| 2908 | } |
| 2909 | |
| 2910 | src = memregion("soundcpu")->base(); |
| 2911 | len = memregion("soundcpu")->bytes(); |
| 2912 | |
| 2913 | for (int i = 0; i < len; i++) |
| 2914 | { |
| 2915 | src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0); |
| 2916 | } |
| 2917 | |
| 2918 | // protection? (just return 0x07) |
| 2919 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x500006, 0x500007, read16_delegate(FUNC(snowbros_state::toto_read),this)); |
| 2920 | } |
| 2921 | |
| 2922 | |
| 2923 | |
| 2869 | 2924 | GAME( 1990, snowbros, 0, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 1)", 0 ) |
| 2870 | 2925 | GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 2)", 0 ) |
| 2871 | 2926 | GAME( 1990, snowbrosb, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 3)", 0 ) |
| r242975 | r242976 | |
| 2875 | 2930 | GAME( 1990, wintbob, snowbros, wintbob, snowbros, driver_device, 0, ROT0, "bootleg (Sakowa Project Korea)", "The Winter Bobble (bootleg of Snow Bros.)", 0 ) |
| 2876 | 2931 | GAME( 1990, snowbroswb,snowbros, wintbob, snowbros, driver_device, 0, ROT0, "bootleg", "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)", 0 ) // this was probably unhacked back from the more common Winter Bobble to make it look more original |
| 2877 | 2932 | |
| 2933 | GAME( 1996, toto, 0, snowbros, snowbros, snowbros_state, toto, ROT0, "SoftClub", "Come Back Toto", 0 ) // modified from 'snowbros' code |
| 2934 | |
| 2878 | 2935 | // none of the games below are on genuine SnowBros hardware, but they clone the functionality of it. |
| 2879 | 2936 | |
| 2880 | 2937 | // SemiCom / Jeil titles are protected, a dumb MCU copies code into RAM at startup, some also check for a specific return value from an address on startup. |
trunk/src/mame/drivers/twinkle.c
| r242975 | r242976 | |
| 254 | 254 | m_maincpu(*this, "maincpu"), |
| 255 | 255 | m_audiocpu(*this, "audiocpu") |
| 256 | 256 | { |
| 257 | | m_spu_hle[0x200] = 0; |
| 258 | | m_spu_hle[0x202] = 0; |
| 259 | 257 | } |
| 260 | 258 | |
| 261 | 259 | required_device<am53cf96_device> m_am53cf96; |
| r242975 | r242976 | |
| 264 | 262 | |
| 265 | 263 | UINT16 m_spu_ctrl; // SPU board control register |
| 266 | 264 | UINT8 m_spu_shared[0x400]; // SPU/PSX shared dual-ported RAM |
| 267 | | UINT8 m_spu_hle[0x400]; |
| 268 | 265 | UINT32 m_spu_ata_dma; |
| 269 | 266 | int m_spu_ata_dmarq; |
| 270 | 267 | |
| r242975 | r242976 | |
| 285 | 282 | DECLARE_WRITE16_MEMBER(twinkle_waveram_w); |
| 286 | 283 | DECLARE_READ16_MEMBER(shared_68k_r); |
| 287 | 284 | DECLARE_WRITE16_MEMBER(shared_68k_w); |
| 285 | DECLARE_READ16_MEMBER(unk_68k_r); |
| 288 | 286 | DECLARE_WRITE_LINE_MEMBER(spu_ata_irq); |
| 289 | 287 | DECLARE_WRITE_LINE_MEMBER(spu_ata_dmarq); |
| 290 | 288 | required_device<cpu_device> m_maincpu; |
| r242975 | r242976 | |
| 671 | 669 | |
| 672 | 670 | WRITE8_MEMBER(twinkle_state::shared_psx_w) |
| 673 | 671 | { |
| 674 | | //printf("shared_psx_w: %04x, %04x, %04x\n", offset, data, mem_mask); |
| 672 | // printf("shared_psx_w: %04x, %04x, %04x\n", offset, data, mem_mask); |
| 675 | 673 | |
| 676 | 674 | m_spu_shared[offset] = data; |
| 677 | 675 | |
| 678 | | // HLE sound board |
| 679 | | m_spu_hle[offset] = data; |
| 680 | | |
| 681 | 676 | if (offset == 0x03fe && data == 0xff) |
| 682 | 677 | { |
| 683 | | //printf("spu command %02x %02x\n", m_spu_hle[1], m_spu_hle[3]); |
| 678 | // printf("spu command %02x %02x\n", m_spu_shared[1], m_spu_shared[3]); |
| 684 | 679 | |
| 685 | | for (int i = 0x200; i < 0x300; i++) m_spu_hle[i] = 0xea; |
| 686 | | |
| 687 | | switch (m_spu_hle[1]) |
| 688 | | { |
| 689 | | case 0x91: // hdd sum 1 |
| 690 | | m_spu_hle[0x200] = 0; // ? |
| 691 | | m_spu_hle[0x202] = 0; // ? |
| 692 | | break; |
| 693 | | |
| 694 | | case 0x9a: // hdd sum 2 |
| 695 | | m_spu_hle[0x200] = 0; // ? |
| 696 | | m_spu_hle[0x202] = 0; // ? |
| 697 | | m_spu_hle[0x203] = 1; // Must be 1 to pass test |
| 698 | | break; |
| 699 | | |
| 700 | | case 0xa1: // version |
| 701 | | m_spu_hle[0x200] = 0; // ? |
| 702 | | m_spu_hle[0x202] = 0; // ? |
| 703 | | |
| 704 | | if (strcmp(machine().system().name, "bmiidx") == 0 || |
| 705 | | strcmp(machine().system().name, "bmiidxa") == 0 || |
| 706 | | strcmp(machine().system().name, "bmiidxc") == 0 || |
| 707 | | strcmp(machine().system().name, "bmiidxca") == 0) |
| 708 | | { |
| 709 | | strcpy((char *)&m_spu_hle[0x204], "GQ863JA_A"); |
| 710 | | } |
| 711 | | else if (strcmp(machine().system().name, "bmiidxs") == 0 || |
| 712 | | strcmp(machine().system().name, "bmiidxc2") == 0) |
| 713 | | { |
| 714 | | strcpy((char *)&m_spu_hle[0x204], "GC983JA_R"); |
| 715 | | } |
| 716 | | else if (strcmp(machine().system().name, "bmiidx2") == 0) |
| 717 | | { |
| 718 | | strcpy((char *)&m_spu_hle[0x204], "GC985JA_A"); |
| 719 | | } |
| 720 | | else if (strcmp(machine().system().name, "bmiidx3") == 0 || |
| 721 | | strcmp(machine().system().name, "bmiidx3a") == 0) |
| 722 | | { |
| 723 | | strcpy((char *)&m_spu_hle[0x204], "GC992JA_A"); |
| 724 | | } |
| 725 | | else if (strcmp(machine().system().name, "bmiidx4") == 0) |
| 726 | | { |
| 727 | | strcpy((char *)&m_spu_hle[0x204], "GCA03JA_A"); |
| 728 | | } |
| 729 | | else if (strcmp(machine().system().name, "bmiidx5") == 0) |
| 730 | | { |
| 731 | | strcpy((char *)&m_spu_hle[0x204], "GCA17JA_A"); |
| 732 | | } |
| 733 | | else if (strcmp(machine().system().name, "bmiidx6") == 0 || |
| 734 | | strcmp(machine().system().name, "bmiidx6a") == 0) |
| 735 | | { |
| 736 | | strcpy((char *)&m_spu_hle[0x204], "GCB4UJA_A"); |
| 737 | | } |
| 738 | | else if (strcmp(machine().system().name, "bmiidx7") == 0) |
| 739 | | { |
| 740 | | strcpy((char *)&m_spu_hle[0x204], "GCB44JA_A"); |
| 741 | | } |
| 742 | | else if (strcmp(machine().system().name, "bmiidx8") == 0) |
| 743 | | { |
| 744 | | strcpy((char *)&m_spu_hle[0x204], "GCC44JA_A"); |
| 745 | | } |
| 746 | | break; |
| 747 | | |
| 748 | | case 0x30: // play sound [3]=sound code |
| 749 | | case 0x51: // sound off |
| 750 | | case 0x25: // spu rom error ([3]==0x0f) |
| 751 | | case 0x26: // spu rom error ([3]==0x0f) |
| 752 | | case 0x08: // spu rom error |
| 753 | | case 0x40: // spu rom error ([3]==0x01 coin sound?) |
| 754 | | case 0x2f: // spu rom error |
| 755 | | case 0x52: // spu rom error |
| 756 | | case 0x04: // spu rom error ([3]==?) |
| 757 | | m_spu_hle[0x200] = 0; |
| 758 | | m_spu_hle[0x202] = 0; |
| 759 | | break; |
| 760 | | } |
| 680 | m_audiocpu->set_input_line(M68K_IRQ_4, HOLD_LINE); |
| 761 | 681 | } |
| 762 | 682 | } |
| 763 | 683 | |
| 764 | 684 | READ8_MEMBER(twinkle_state::shared_psx_r) |
| 765 | 685 | { |
| 766 | | //UINT32 result = m_spu_shared[offset]; |
| 767 | | UINT32 result = m_spu_hle[offset]; |
| 686 | UINT32 result = m_spu_shared[offset]; |
| 768 | 687 | |
| 769 | 688 | //printf("shared_psx_r: %04x, %04x, %04x\n", offset, result, mem_mask); |
| 770 | 689 | |
| r242975 | r242976 | |
| 803 | 722 | /* |
| 804 | 723 | System control register (Konami always has one) |
| 805 | 724 | |
| 806 | | bit 7 = write 0 to ack IRQ 1, write 1 to enable (IRQ 1 appears to be vblank) |
| 725 | bit 7 = write 0 to ack IRQ 1, write 1 to enable (IRQ 1 appears to be an RF5C400-related timer, or some free-running timing source) |
| 807 | 726 | bit 8 = write 0 to ack IRQ 2, write 1 to enable (IRQ 2 appears to be DMA completion) |
| 808 | | bit 9 = write 0 to ack IRQ 4, write 1 to enable (IRQ 4 appears to be "command sent", unsure how the MIPS causes it yet however) |
| 809 | | bit 10 = write 0 to ack IRQ 6, write 1 to enable (IRQ 6 is IDE) |
| 810 | | bit 11 = watchdog toggle? |
| 727 | bit 9 = write 0 to ack IRQ 4, write 1 to enable (IRQ 4 is "command available") |
| 728 | bit 10 = write 0 to ack IRQ 6, write 1 to enable (IRQ 6 is the ATA IRQ) |
| 729 | bit 11 = watchdog toggle |
| 811 | 730 | |
| 812 | 731 | Other bits unknown. |
| 813 | 732 | */ |
| r242975 | r242976 | |
| 836 | 755 | WRITE16_MEMBER(twinkle_state::spu_ata_dma_low_w) |
| 837 | 756 | { |
| 838 | 757 | m_spu_ata_dma = (m_spu_ata_dma & ~0xffff) | data; |
| 839 | | |
| 840 | | //printf("dma_low %08x\n", m_spu_ata_dma * 2); |
| 841 | 758 | } |
| 842 | 759 | |
| 843 | 760 | WRITE16_MEMBER(twinkle_state::spu_ata_dma_high_w) |
| 844 | 761 | { |
| 845 | 762 | m_spu_ata_dma = (m_spu_ata_dma & 0xffff) | (data << 16); |
| 846 | | |
| 847 | | //printf("dma_high %08x\n", m_spu_ata_dma * 2); |
| 848 | 763 | } |
| 849 | 764 | |
| 850 | 765 | WRITE_LINE_MEMBER(twinkle_state::spu_ata_dmarq) |
| r242975 | r242976 | |
| 864 | 779 | //waveram[m_spu_ata_dma++] = (data >> 8) | (data << 8); |
| 865 | 780 | // bp 4a0e ;bmiidx4 checksum |
| 866 | 781 | // bp 4d62 ;bmiidx4 dma |
| 867 | | m_waveram[m_spu_ata_dma++] = data; |
| 782 | |
| 783 | // $$$HACK - game DMAs nothing useful to 0x400000 but all sound plays are 0x400000 or above |
| 784 | // so limit sound RAM to 4MB (there's 6 MB on the board) and let the 5c400's address masking |
| 785 | // work for us until we figure out what's actually going on. |
| 786 | if (m_spu_ata_dma < 0x200000) |
| 787 | { |
| 788 | m_waveram[m_spu_ata_dma++] = data; |
| 789 | } |
| 868 | 790 | } |
| 869 | 791 | |
| 870 | 792 | m_ata->write_dmack(CLEAR_LINE); |
| r242975 | r242976 | |
| 886 | 808 | { |
| 887 | 809 | UINT16 result = m_spu_shared[offset]; |
| 888 | 810 | |
| 889 | | //printf("shared_68k_r: %04x, %04x, %04x\n", offset, result, mem_mask); |
| 811 | // printf("shared_68k_r: %04x, %04x, %04x\n", offset, result, mem_mask); |
| 890 | 812 | |
| 891 | 813 | return result; |
| 892 | 814 | } |
| 893 | 815 | |
| 894 | 816 | WRITE16_MEMBER(twinkle_state::shared_68k_w) |
| 895 | 817 | { |
| 896 | | //printf("shared_68k_w: %04x, %04x, %04x\n", offset, data, mem_mask); |
| 818 | // printf("shared_68k_w: %04x, %04x, %04x\n", offset, data, mem_mask); |
| 897 | 819 | |
| 898 | 820 | m_spu_shared[offset] = data & 0xff; |
| 899 | 821 | } |
| 900 | 822 | |
| 823 | READ16_MEMBER(twinkle_state::unk_68k_r) |
| 824 | { |
| 825 | return 0xffff; // must return 0xff for 68000 POST to complete properly |
| 826 | } |
| 827 | |
| 901 | 828 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, twinkle_state ) |
| 902 | 829 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 903 | 830 | AM_RANGE(0x100000, 0x13ffff) AM_RAM |
| 831 | AM_RANGE(0x200000, 0x200001) AM_READ(unk_68k_r) |
| 904 | 832 | // 220000 = LEDs? |
| 905 | 833 | AM_RANGE(0x230000, 0x230003) AM_WRITE(twinkle_spu_ctrl_w) |
| 906 | 834 | AM_RANGE(0x240000, 0x240003) AM_WRITE(spu_ata_dma_low_w) |
| r242975 | r242976 | |
| 909 | 837 | AM_RANGE(0x280000, 0x280fff) AM_READWRITE(shared_68k_r, shared_68k_w) |
| 910 | 838 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("ata", ata_interface_device, read_cs0, write_cs0) |
| 911 | 839 | // 34000E = ??? |
| 840 | AM_RANGE(0x34000e, 0x34000f) AM_WRITENOP |
| 912 | 841 | AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE("rfsnd", rf5c400_device, rf5c400_r, rf5c400_w) |
| 913 | | AM_RANGE(0x800000, 0xffffff) AM_READWRITE(twinkle_waveram_r, twinkle_waveram_w ) // 8 MB window wave RAM |
| 842 | AM_RANGE(0x800000, 0xbfffff) AM_READWRITE(twinkle_waveram_r, twinkle_waveram_w ) |
| 843 | AM_RANGE(0xfe0000, 0xffffff) AM_RAM // ...and the RAM test checks this last 128k (mirror of the work RAM at 0x100000?) |
| 914 | 844 | ADDRESS_MAP_END |
| 915 | 845 | |
| 916 | 846 | /* SCSI */ |
| r242975 | r242976 | |
| 1011 | 941 | |
| 1012 | 942 | MCFG_CPU_ADD("audiocpu", M68000, 32000000/2) /* 16.000 MHz */ |
| 1013 | 943 | MCFG_CPU_PROGRAM_MAP( sound_map ) |
| 944 | MCFG_CPU_PERIODIC_INT_DRIVER(twinkle_state, irq1_line_assert, 60) |
| 945 | MCFG_CPU_PERIODIC_INT_DRIVER(twinkle_state, irq2_line_assert, 60) |
| 1014 | 946 | |
| 1015 | 947 | MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) /* check TD pin on LTC1232 */ |
| 1016 | 948 | |
| r242975 | r242976 | |
| 1149 | 1081 | ROM_REGION32_LE( 0x080000, "audiocpu", 0 )\ |
| 1150 | 1082 | ROM_LOAD16_WORD_SWAP( "863a05.2x", 0x000000, 0x080000, CRC(6f42a09e) SHA1(cab5209f90f47b9ee6e721479913ad74e3ba84b1) )\ |
| 1151 | 1083 | \ |
| 1152 | | ROM_REGION16_LE(0x1800000, "rfsnd", ROMREGION_ERASE00) |
| 1084 | ROM_REGION16_LE(0x400000, "rfsnd", ROMREGION_ERASE00) |
| 1153 | 1085 | |
| 1154 | 1086 | ROM_START( gq863 ) |
| 1155 | 1087 | TWINKLE_BIOS |