trunk/src/mame/drivers/fcrash.c
| r21936 | r21937 | |
| 168 | 168 | WRITE16_MEMBER(cps_state::knightsb_layer_w) |
| 169 | 169 | { |
| 170 | 170 | if (offset == 0x05) |
| 171 | | m_cps_a_regs[0x14 / 2] = data + 0xffce; /* scroll 3x */ |
| 171 | m_cps_a_regs[0x14 / 2] = data; /* scroll 3x */ |
| 172 | 172 | else |
| 173 | 173 | if (offset == 0x04) |
| 174 | 174 | m_cps_a_regs[0x16 / 2] = data; /* scroll 3y */ |
| 175 | 175 | else |
| 176 | 176 | if (offset == 0x03) |
| 177 | | m_cps_a_regs[0x10 / 2] = data + 0xffce; /* scroll 2x */ |
| 177 | m_cps_a_regs[0x10 / 2] = data; /* scroll 2x */ |
| 178 | 178 | else |
| 179 | 179 | if (offset == 0x01) |
| 180 | | m_cps_a_regs[0x0c / 2] = data + 0xffc2; /* scroll 1x */ |
| 180 | m_cps_a_regs[0x0c / 2] = data; /* scroll 1x */ |
| 181 | 181 | else |
| 182 | 182 | if (offset == 0x02) |
| 183 | 183 | { |
| r21936 | r21937 | |
| 189 | 189 | m_cps_a_regs[0x0e / 2] = data; /* scroll 1y - fixes scroll of high scores */ |
| 190 | 190 | else |
| 191 | 191 | if (offset == 0x06) |
| 192 | { |
| 193 | switch (data) |
| 194 | { |
| 195 | case 0x0000: |
| 196 | case 0x001f: |
| 197 | case 0x00ff: |
| 198 | data = 0x12f2; |
| 199 | break; |
| 200 | case 0x2000: |
| 201 | data = 0x06f2; |
| 202 | break; |
| 203 | case 0xa000: |
| 204 | data = 0x24d0; |
| 205 | break; |
| 206 | default: |
| 207 | printf ("Unknown control word = %X\n",data); |
| 208 | data = 0x12c0; |
| 209 | } |
| 192 | 210 | m_cps_b_regs[m_layer_enable_reg / 2] = data; |
| 211 | } |
| 193 | 212 | else |
| 194 | 213 | if (offset == 0x10) |
| 195 | 214 | m_cps_b_regs[m_layer_mask_reg[1] / 2] = data; |
| r21936 | r21937 | |
| 466 | 485 | AM_RANGE(0x000000, 0x3fffff) AM_ROM |
| 467 | 486 | AM_RANGE(0x800000, 0x800001) AM_READ_PORT("IN1") /* Player input ports */ |
| 468 | 487 | AM_RANGE(0x800002, 0x800003) AM_READ_PORT("IN2")//(cps1_in2_r) /* Player 3 controls */ |
| 488 | AM_RANGE(0x800004, 0x800005) AM_WRITENOP // writes 0000 here |
| 469 | 489 | AM_RANGE(0x800006, 0x800007) AM_WRITE(fcrash_soundlatch_w) /* Sound command */ |
| 470 | 490 | AM_RANGE(0x800018, 0x80001f) AM_READ(cps1_dsw_r) /* System input ports / Dip Switches */ |
| 471 | 491 | AM_RANGE(0x800030, 0x800037) AM_WRITENOP //AM_WRITE(cps1_coinctrl_w) only writes bit 15 |
| 472 | | AM_RANGE(0x800100, 0x80013f) AM_WRITE(cps1_cps_a_w) AM_SHARE("cps_a_regs") /* CPS-A custom */ |
| 473 | | AM_RANGE(0x800140, 0x80017f) AM_READWRITE(cps1_cps_b_r, cps1_cps_b_w) AM_SHARE("cps_b_regs") /* CPS-B custom */ |
| 474 | | AM_RANGE(0x800180, 0x800181) AM_WRITE(cps1_soundlatch2_w) /* Sound timer fade */ |
| 475 | | AM_RANGE(0x880000, 0x880001) AM_WRITENOP //? |
| 492 | AM_RANGE(0x800100, 0x80013f) AM_RAM AM_SHARE("cps_a_regs") /* CPS-A custom */ |
| 493 | AM_RANGE(0x800140, 0x80017f) AM_RAM AM_SHARE("cps_b_regs") /* CPS-B custom */ |
| 494 | AM_RANGE(0x800180, 0x800181) AM_WRITENOP //AM_WRITE(cps1_soundlatch2_w) /* Sound timer fade */ |
| 495 | AM_RANGE(0x880000, 0x880001) AM_WRITENOP // unknown |
| 476 | 496 | AM_RANGE(0x900000, 0x93ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_SHARE("gfxram") |
| 477 | 497 | AM_RANGE(0x980000, 0x98002f) AM_WRITE(knightsb_layer_w) |
| 478 | | AM_RANGE(0x991000, 0x993fff) AM_WRITENOP // could be bootleg_sprite_ram |
| 479 | 498 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 480 | 499 | ADDRESS_MAP_END |
| 481 | 500 | |
| r21936 | r21937 | |
| 543 | 562 | static ADDRESS_MAP_START( knightsb_z80map, AS_PROGRAM, 8, cps_state ) |
| 544 | 563 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 545 | 564 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 565 | AM_RANGE(0xcffe, 0xcfff) AM_WRITENOP // writes lots of data |
| 546 | 566 | AM_RANGE(0xd000, 0xd7ff) AM_RAM |
| 547 | 567 | AM_RANGE(0xd800, 0xd801) AM_DEVREADWRITE("2151", ym2151_device, read, write) |
| 548 | 568 | AM_RANGE(0xdc00, 0xdc00) AM_READ(soundlatch_byte_r) |
| r21936 | r21937 | |
| 1161 | 1181 | m_audiocpu = machine().device<cpu_device>("audiocpu"); |
| 1162 | 1182 | m_msm_1 = machine().device<msm5205_device>("msm1"); |
| 1163 | 1183 | m_msm_2 = machine().device<msm5205_device>("msm2"); |
| 1164 | | m_layer_enable_reg = 0x20; |
| 1184 | m_layer_enable_reg = 0x30; |
| 1165 | 1185 | m_layer_mask_reg[0] = 0x28; |
| 1166 | 1186 | m_layer_mask_reg[1] = 0x2a; |
| 1167 | 1187 | m_layer_mask_reg[2] = 0x2c; |
| 1168 | 1188 | m_layer_mask_reg[3] = 0x2e; |
| 1169 | | m_layer_scroll1x_offset = 0; |
| 1170 | | m_layer_scroll2x_offset = 0; |
| 1171 | | m_layer_scroll3x_offset = 0; |
| 1189 | m_layer_scroll1x_offset = 0x3e; //text |
| 1190 | m_layer_scroll2x_offset = 0x3c; //bricks around scores |
| 1191 | m_layer_scroll3x_offset = 0x40; //hill with sword going in |
| 1172 | 1192 | m_sprite_base = 0x1000; |
| 1173 | | m_sprite_list_end_marker = 0xffff; |
| 1193 | m_sprite_list_end_marker = 0x8000; |
| 1174 | 1194 | m_sprite_x_offset = 0; |
| 1175 | 1195 | } |
| 1176 | 1196 | |
| r21936 | r21937 | |
| 1343 | 1363 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1344 | 1364 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1345 | 1365 | MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 ) |
| 1346 | | MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_cps1) |
| 1366 | MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_fcrash) |
| 1347 | 1367 | MCFG_SCREEN_VBLANK_DRIVER(cps_state, screen_eof_cps1) |
| 1348 | 1368 | |
| 1349 | 1369 | MCFG_GFXDECODE(cps1) |
| r21936 | r21937 | |
| 1777 | 1797 | rom[i + 6] = tmp; |
| 1778 | 1798 | } |
| 1779 | 1799 | |
| 1780 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x70c018, 0x70c01f, read16_delegate(FUNC(cps_state::cps1_dsw_r),this)); |
| 1781 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x708000, 0x708fff, write16_delegate(FUNC(cps_state::sf2mdt_layer_w),this)); |
| 1782 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x70c000, 0x70c001, "IN1"); |
| 1783 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_port(0x70c008, 0x70c009, "IN2"); |
| 1784 | | |
| 1785 | | /* bootleg sprite ram */ |
| 1786 | | m_bootleg_sprite_ram = (UINT16*)machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x700000, 0x703fff); |
| 1787 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x704000, 0x707fff, m_bootleg_sprite_ram); /* both of these need to be mapped - see the "Magic Delta Turbo" text on the title screen */ |
| 1788 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x70c106, 0x70c107, write16_delegate(FUNC(cps_state::cawingbl_soundlatch_w),this)); |
| 1789 | | |
| 1790 | | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x800030, 0x800031); /* coin lockout doesn't work (unmap it) */ |
| 1791 | | |
| 1792 | | DRIVER_INIT_CALL(cps1); |
| 1800 | DRIVER_INIT_CALL(sf2mdta); |
| 1793 | 1801 | } |
| 1794 | 1802 | |
| 1795 | 1803 | DRIVER_INIT_MEMBER(cps_state, sf2mdta) |
| r21936 | r21937 | |
| 1811 | 1819 | DRIVER_INIT_CALL(cps1); |
| 1812 | 1820 | } |
| 1813 | 1821 | |
| 1822 | DRIVER_INIT_MEMBER(cps_state, knightsb) |
| 1823 | { |
| 1824 | /* bootleg sprite ram */ |
| 1825 | m_bootleg_sprite_ram = (UINT16*)machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x990000, 0x993fff); |
| 1814 | 1826 | |
| 1827 | DRIVER_INIT_CALL(cps1); |
| 1828 | } |
| 1829 | |
| 1830 | |
| 1815 | 1831 | GAME( 1990, fcrash, ffight, fcrash, fcrash, cps_state, cps1, ROT0, "bootleg (Playmark)", "Final Crash (bootleg of Final Fight)", GAME_SUPPORTS_SAVE ) |
| 1816 | 1832 | GAME( 1991, kodb, kod, kodb, kodb, cps_state, kodb, ROT0, "bootleg (Playmark)", "The King of Dragons (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 910731 "ETC" |
| 1817 | | GAME( 1991, knightsb, knights, knightsb, knights, cps_state, cps1, ROT0, "bootleg", "Knights of the Round (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // 911127 - based on World version |
| 1833 | GAME( 1991, knightsb, knights, knightsb, knights, cps_state, knightsb, ROT0, "bootleg", "Knights of the Round (bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // 911127 - based on World version |
| 1818 | 1834 | GAME( 1990, cawingbl, cawing, cawingbl, cawingbl, cps_state, cawingbl, ROT0, "bootleg", "Carrier Air Wing (bootleg with 2xYM2203 + 2xMSM205 set 1)", GAME_SUPPORTS_SAVE ) |
| 1819 | 1835 | GAME( 1990, cawingb2, cawing, cawingbl, cawingbl, cps_state, cawingbl, ROT0, "bootleg", "Carrier Air Wing (bootleg with 2xYM2203 + 2xMSM205 set 2)", GAME_SUPPORTS_SAVE ) |
| 1820 | 1836 | GAME( 1992, sf2mdt, sf2ce, sf2mdt, sf2mdt, cps_state, sf2mdt, ROT0, "bootleg", "Street Fighter II': Magic Delta Turbo (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 920313 - based on (heavily modified) World version |