Merge pull request #1431 from ajrhacker/ms1_tmap

Make Mega System 1 tilemaps into a device
This commit is contained in:
R. Belmont 2016-09-24 11:11:34 -04:00 committed by GitHub
commit a1eea6e153
9 changed files with 1177 additions and 1321 deletions

View File

@ -2017,6 +2017,8 @@ files {
MAME_DIR .. "src/mame/machine/jalcrpt.h",
MAME_DIR .. "src/mame/video/jalblend.cpp",
MAME_DIR .. "src/mame/video/jalblend.h",
MAME_DIR .. "src/mame/video/ms1_tmap.cpp",
MAME_DIR .. "src/mame/video/ms1_tmap.h",
}
createMAMEProjects(_target, _subtarget, "jpm")

View File

@ -196,16 +196,33 @@ Cisco Heat.
static ADDRESS_MAP_START( bigrun_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x080000, 0x083fff) AM_READWRITE(bigrun_vregs_r, bigrun_vregs_w) AM_SHARE("vregs") // Vregs
AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN1") AM_WRITE(leds_out_w) // Coins
AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN2") AM_WRITE(unknown_out_w) // Buttons
AM_RANGE(0x080004, 0x080005) AM_READ_PORT("IN3") AM_WRITE(motor_out_w) // Motor Limit Switches
AM_RANGE(0x080006, 0x080007) AM_READ_PORT("IN4") AM_WRITE(wheel_out_w) // DSW 1 & 2
AM_RANGE(0x080008, 0x080009) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // From sound cpu
AM_RANGE(0x08000a, 0x08000b) AM_DEVWRITE("soundlatch", generic_latch_16_device, write) // To sound cpu
AM_RANGE(0x08000c, 0x08000d) AM_WRITENOP // ??
AM_RANGE(0x080010, 0x080011) AM_READWRITE(bigrun_ip_select_r, ip_select_w)
AM_RANGE(0x080012, 0x080013) AM_WRITE(ip_select_plus1_w)
AM_RANGE(0x082000, 0x082005) AM_DEVREADWRITE("scroll0", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_DEVREADWRITE("scroll1", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082100, 0x082105) AM_DEVREADWRITE("scroll2", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082108, 0x082109) AM_NOP // ? written with 0 only
AM_RANGE(0x082200, 0x082201) AM_READ_PORT("IN5") // DSW 3 (4 bits)
AM_RANGE(0x082208, 0x082209) AM_NOP // watchdog reset
AM_RANGE(0x082308, 0x082309) AM_WRITE(cischeat_comms_w)
AM_RANGE(0x082400, 0x082401) AM_WRITE(active_layers_w)
AM_RANGE(0x084000, 0x087fff) AM_RAM // Linking with other units
AM_RANGE(0x088000, 0x08bfff) AM_RAM AM_SHARE("share2") // Sharedram with sub CPU#2
AM_RANGE(0x08c000, 0x08ffff) AM_RAM AM_SHARE("share1") // Sharedram with sub CPU#1
/* Only writes to the first 0x40000 bytes affect the tilemaps: */
/* either these games support larger tilemaps or have more ram than needed */
AM_RANGE(0x090000, 0x093fff) AM_WRITE(cischeat_scrollram_0_w) AM_SHARE("scrollram.0") // Scroll ram 0
AM_RANGE(0x094000, 0x097fff) AM_WRITE(cischeat_scrollram_1_w) AM_SHARE("scrollram.1") // Scroll ram 1
AM_RANGE(0x098000, 0x09bfff) AM_WRITE(cischeat_scrollram_2_w) AM_SHARE("scrollram.2") // Scroll ram 2
AM_RANGE(0x090000, 0x093fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll ram 0
AM_RANGE(0x094000, 0x097fff) AM_RAM_DEVWRITE("scroll1", megasys1_tilemap_device, write) AM_SHARE("scroll1") // Scroll ram 1
AM_RANGE(0x098000, 0x09bfff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll ram 2
AM_RANGE(0x09c000, 0x09ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palettes
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // RAM
@ -229,7 +246,24 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cischeat_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x080000, 0x087fff) AM_READWRITE(cischeat_vregs_r, cischeat_vregs_w) AM_SHARE("vregs") // Vregs
AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN1") AM_WRITE(leds_out_w) // Coins
AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN2") AM_WRITE(unknown_out_w) // Buttons
AM_RANGE(0x080004, 0x080005) AM_READ_PORT("IN3") AM_WRITE(motor_out_w) // Motor Limit Switches
AM_RANGE(0x080006, 0x080007) AM_READ_PORT("IN4") AM_WRITE(wheel_out_w) // DSW 1 & 2
AM_RANGE(0x08000a, 0x08000b) AM_DEVWRITE("soundlatch", generic_latch_16_device, write) // To sound cpu
AM_RANGE(0x08000c, 0x08000d) AM_WRITENOP // ??
AM_RANGE(0x080010, 0x080011) AM_READWRITE(cischeat_ip_select_r, ip_select_w)
AM_RANGE(0x080012, 0x080013) AM_WRITENOP // value above + 1
AM_RANGE(0x082000, 0x082005) AM_DEVREADWRITE("scroll0", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_DEVREADWRITE("scroll1", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082100, 0x082105) AM_DEVREADWRITE("scroll2", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082108, 0x082109) AM_NOP // ? written with 0 only
AM_RANGE(0x082200, 0x082201) AM_READ_PORT("IN5") // DSW 3 (4 bits)
AM_RANGE(0x082208, 0x082209) AM_NOP // watchdog reset
AM_RANGE(0x082300, 0x082301) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) AM_WRITE(cischeat_soundlatch_w) // From sound cpu
AM_RANGE(0x082308, 0x082309) AM_WRITE(cischeat_comms_w)
AM_RANGE(0x082400, 0x082401) AM_WRITE(active_layers_w)
AM_RANGE(0x088000, 0x088fff) AM_RAM // Linking with other units
/* Only the first 0x800 bytes are tested but:
@ -243,10 +277,9 @@ static ADDRESS_MAP_START( cischeat_map, AS_PROGRAM, 16, cischeat_state )
/* Only writes to the first 0x40000 bytes affect the tilemaps: */
/* either these games support larger tilemaps or have more ram than needed */
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_WRITE(cischeat_scrollram_0_w) AM_SHARE("scrollram.0") // Scroll ram 0
AM_RANGE(0x0a8000, 0x0affff) AM_RAM_WRITE(cischeat_scrollram_1_w) AM_SHARE("scrollram.1") // Scroll ram 1
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_WRITE(cischeat_scrollram_2_w) AM_SHARE("scrollram.2") // Scroll ram 2
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll ram 0
AM_RANGE(0x0a8000, 0x0affff) AM_RAM_DEVWRITE("scroll1", megasys1_tilemap_device, write) AM_SHARE("scroll1") // Scroll ram 1
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll ram 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palettes
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // RAM
@ -267,9 +300,32 @@ ADDRESS_MAP_END
098800-099000
0F8000-0F9000 */
/*
CPU #0 PC 00234A : Warning, vreg 0000 <- 0000
CPU #0 PC 002350 : Warning, vreg 0002 <- 0000
CPU #0 PC 00235C : Warning, vreg 0006 <- 0000
*/
static ADDRESS_MAP_START( f1gpstar_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x080000, 0x087fff) AM_READWRITE(f1gpstar_vregs_r, f1gpstar_vregs_w) AM_SHARE("vregs") // Vregs
AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN1") // DSW 1 & 2
AM_RANGE(0x080004, 0x080005) AM_READ_PORT("IN2") AM_WRITE(f1gpstar_motor_w) // Buttons
AM_RANGE(0x080006, 0x080007) AM_READ_PORT("IN3") // ? Read at boot only
AM_RANGE(0x080008, 0x080009) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // From sound cpu
AM_RANGE(0x080008, 0x080009) AM_DEVWRITE("soundlatch", generic_latch_16_device, write) // To sound cpu
AM_RANGE(0x08000c, 0x08000d) AM_READ_PORT("IN4") // DSW 3
AM_RANGE(0x080010, 0x080011) AM_READ(f1gpstar_wheel_r) AM_WRITENOP // Accel + Driving Wheel
AM_RANGE(0x080014, 0x080015) AM_WRITENOP
AM_RANGE(0x080018, 0x080019) AM_WRITE(f1gpstar_soundint_w)
AM_RANGE(0x082000, 0x082005) AM_DEVREADWRITE("scroll0", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_DEVREADWRITE("scroll1", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082100, 0x082105) AM_DEVREADWRITE("scroll2", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082108, 0x082109) AM_NOP // ? written with 0 only
AM_RANGE(0x082208, 0x082209) AM_NOP // watchdog reset
AM_RANGE(0x082308, 0x082309) AM_READNOP AM_WRITE(f1gpstar_comms_w)
AM_RANGE(0x082400, 0x082401) AM_WRITE(active_layers_w)
AM_RANGE(0x088000, 0x088fff) AM_RAM // Linking with other units
AM_RANGE(0x090000, 0x097fff) AM_RAM AM_SHARE("share2") // Sharedram with sub CPU#2
@ -277,10 +333,9 @@ static ADDRESS_MAP_START( f1gpstar_map, AS_PROGRAM, 16, cischeat_state )
/* Only writes to the first 0x40000 bytes affect the tilemaps: */
/* either these games support larger tilemaps or have more ram than needed */
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_WRITE(cischeat_scrollram_0_w) AM_SHARE("scrollram.0") // Scroll ram 0
AM_RANGE(0x0a8000, 0x0affff) AM_RAM_WRITE(cischeat_scrollram_1_w) AM_SHARE("scrollram.1") // Scroll ram 1
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_WRITE(cischeat_scrollram_2_w) AM_SHARE("scrollram.2") // Scroll ram 2
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll ram 0
AM_RANGE(0x0a8000, 0x0affff) AM_RAM_DEVWRITE("scroll1", megasys1_tilemap_device, write) AM_SHARE("scroll1") // Scroll ram 1
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll ram 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palettes
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // RAM
@ -288,6 +343,49 @@ static ADDRESS_MAP_START( f1gpstar_map, AS_PROGRAM, 16, cischeat_state )
ADDRESS_MAP_END
/**************************************************************************
Wild Pilot
**************************************************************************/
// Same as f1gpstar, but vregs are slightly different:
static ADDRESS_MAP_START( wildplt_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") AM_WRITE(f1gpstr2_io_w) // DSW 1 & 2
AM_RANGE(0x080004, 0x080005) AM_READ_PORT("IN1") AM_WRITE(f1gpstar_motor_w) // Buttons
AM_RANGE(0x080008, 0x080009) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // From sound cpu
AM_RANGE(0x080008, 0x080009) AM_DEVWRITE("soundlatch", generic_latch_16_device, write) // To sound cpu
AM_RANGE(0x08000c, 0x08000d) AM_WRITENOP // 1000, 3000
AM_RANGE(0x080010, 0x080011) AM_READ(wildplt_xy_r) AM_WRITENOP // X, Y
AM_RANGE(0x080014, 0x080015) AM_WRITENOP
AM_RANGE(0x080018, 0x080019) AM_READWRITE(f1gpstr2_ioready_r, f1gpstar_soundint_w)
AM_RANGE(0x081000, 0x081fff) AM_RAM AM_SHARE("shareio")
AM_RANGE(0x082000, 0x082005) AM_DEVREADWRITE("scroll0", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_DEVREADWRITE("scroll1", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082100, 0x082105) AM_DEVREADWRITE("scroll2", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082108, 0x082109) AM_NOP // ? written with 0 only
AM_RANGE(0x082208, 0x082209) AM_NOP // watchdog reset
AM_RANGE(0x082308, 0x082309) AM_READNOP AM_WRITE(f1gpstar_comms_w)
AM_RANGE(0x082400, 0x082401) AM_WRITE(active_layers_w)
AM_RANGE(0x088000, 0x088fff) AM_RAM // Linking with other units
AM_RANGE(0x090000, 0x097fff) AM_RAM AM_SHARE("share2") // Sharedram with sub CPU#2
AM_RANGE(0x098000, 0x09ffff) AM_RAM AM_SHARE("share1") // Sharedram with sub CPU#1
/* Only writes to the first 0x40000 bytes affect the tilemaps: */
/* either these games support larger tilemaps or have more ram than needed */
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll ram 0
AM_RANGE(0x0a8000, 0x0affff) AM_RAM_DEVWRITE("scroll1", megasys1_tilemap_device, write) AM_SHARE("scroll1") // Scroll ram 1
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll ram 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palettes
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // RAM
AM_RANGE(0x100000, 0x17ffff) AM_ROM AM_REGION("user1",0) // ROM
ADDRESS_MAP_END
/**************************************************************************
F1 GrandPrix Star II
**************************************************************************/
@ -295,7 +393,26 @@ ADDRESS_MAP_END
// Same as f1gpstar, but vregs are slightly different:
static ADDRESS_MAP_START( f1gpstr2_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x080000, 0x087fff) AM_READWRITE(f1gpstr2_vregs_r, f1gpstr2_vregs_w) AM_SHARE("vregs") // Vregs (slightly different from f1gpstar)
AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN1") AM_WRITE(f1gpstr2_io_w) // DSW 1 & 2
AM_RANGE(0x080004, 0x080005) AM_READ_PORT("IN2") AM_WRITE(f1gpstar_motor_w) // Buttons
AM_RANGE(0x080006, 0x080007) AM_READ_PORT("IN3") // ? Read at boot only
AM_RANGE(0x080008, 0x080009) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // From sound cpu
AM_RANGE(0x080008, 0x080009) AM_DEVWRITE("soundlatch", generic_latch_16_device, write) // To sound cpu
AM_RANGE(0x08000c, 0x08000d) AM_READ_PORT("IN4") // DSW 3
AM_RANGE(0x080010, 0x080011) AM_READ(f1gpstar_wheel_r) AM_WRITENOP
AM_RANGE(0x080014, 0x080015) AM_WRITENOP
AM_RANGE(0x080018, 0x080019) AM_READWRITE(f1gpstr2_ioready_r, f1gpstar_soundint_w)
AM_RANGE(0x081000, 0x081fff) AM_RAM AM_SHARE("shareio")
AM_RANGE(0x082000, 0x082005) AM_DEVREADWRITE("scroll0", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_DEVREADWRITE("scroll1", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082100, 0x082105) AM_DEVREADWRITE("scroll2", megasys1_tilemap_device, scroll_r, scroll_w)
AM_RANGE(0x082108, 0x082109) AM_NOP // ? written with 0 only
AM_RANGE(0x082208, 0x082209) AM_NOP // watchdog reset
AM_RANGE(0x082308, 0x082309) AM_READNOP AM_WRITE(f1gpstar_comms_w)
AM_RANGE(0x082400, 0x082401) AM_WRITE(active_layers_w)
AM_RANGE(0x088000, 0x088fff) AM_RAM // Linking with other units
AM_RANGE(0x090000, 0x097fff) AM_RAM AM_SHARE("share2") // Sharedram with sub CPU#2
@ -303,10 +420,9 @@ static ADDRESS_MAP_START( f1gpstr2_map, AS_PROGRAM, 16, cischeat_state )
/* Only writes to the first 0x40000 bytes affect the tilemaps: */
/* either these games support larger tilemaps or have more ram than needed */
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_WRITE(cischeat_scrollram_0_w) AM_SHARE("scrollram.0") // Scroll ram 0
AM_RANGE(0x0a8000, 0x0affff) AM_RAM_WRITE(cischeat_scrollram_1_w) AM_SHARE("scrollram.1") // Scroll ram 1
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_WRITE(cischeat_scrollram_2_w) AM_SHARE("scrollram.2") // Scroll ram 2
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll ram 0
AM_RANGE(0x0a8000, 0x0affff) AM_RAM_DEVWRITE("scroll1", megasys1_tilemap_device, write) AM_SHARE("scroll1") // Scroll ram 1
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll ram 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palettes
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // RAM
@ -417,9 +533,12 @@ WRITE16_MEMBER(cischeat_state::scudhamm_oki_bank_w)
static ADDRESS_MAP_START( scudhamm_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(scudhamm_vregs_w) AM_SHARE("vregs") // Video Registers + RAM
AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_WRITE(cischeat_scrollram_0_w) AM_SHARE("scrollram.0") // Scroll RAM 0
AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(cischeat_scrollram_2_w) AM_SHARE("scrollram.2") // Scroll RAM 2
AM_RANGE(0x082000, 0x082005) AM_DEVWRITE("scroll0", megasys1_tilemap_device, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_WRITENOP // UNUSED LAYER
AM_RANGE(0x082100, 0x082105) AM_DEVWRITE("scroll2", megasys1_tilemap_device, scroll_w)
AM_RANGE(0x082208, 0x082209) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll RAM 0
AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll RAM 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // Work RAM + Spriteram
AM_RANGE(0x100000, 0x100001) AM_WRITE(scudhamm_oki_bank_w) // Sound
@ -498,10 +617,13 @@ WRITE16_MEMBER(cischeat_state::armchmp2_leds_w)
static ADDRESS_MAP_START( armchmp2_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(scudhamm_vregs_w) AM_SHARE("vregs") // Video Registers + RAM
AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_WRITE(cischeat_scrollram_0_w) AM_SHARE("scrollram.0") // Scroll RAM 0
AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(cischeat_scrollram_2_w) AM_SHARE("scrollram.2") // Scroll RAM 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
AM_RANGE(0x082000, 0x082005) AM_DEVWRITE("scroll0", megasys1_tilemap_device, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_WRITENOP // UNUSED LAYER
AM_RANGE(0x082100, 0x082105) AM_DEVWRITE("scroll2", megasys1_tilemap_device, scroll_w)
AM_RANGE(0x082208, 0x082209) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll ram 0
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll ram 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // Work RAM + Spriteram
AM_RANGE(0x100000, 0x100001) AM_READ_PORT("IN2") AM_WRITE(scudhamm_oki_bank_w) // DSW + Sound
AM_RANGE(0x100004, 0x100005) AM_READ_PORT("IN3") // DSW
@ -639,10 +761,13 @@ CUSTOM_INPUT_MEMBER(cischeat_state::captflag_motor_busy_r)
static ADDRESS_MAP_START( captflag_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x082000, 0x082fff) AM_RAM_WRITE(scudhamm_vregs_w) AM_SHARE("vregs") // Video Registers + RAM
AM_RANGE(0x082000, 0x082005) AM_DEVWRITE("scroll0", megasys1_tilemap_device, scroll_w)
AM_RANGE(0x082008, 0x08200d) AM_WRITENOP // UNUSED LAYER
AM_RANGE(0x082100, 0x082105) AM_DEVWRITE("scroll2", megasys1_tilemap_device, scroll_w)
AM_RANGE(0x082208, 0x082209) AM_DEVREADWRITE("watchdog", watchdog_timer_device, reset16_r, reset16_w)
AM_RANGE(0x090008, 0x090009) AM_WRITENOP // 0?
AM_RANGE(0x0a0000, 0x0a3fff) AM_RAM_WRITE(cischeat_scrollram_0_w) AM_SHARE("scrollram.0") // Scroll RAM 0
AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(cischeat_scrollram_2_w) AM_SHARE("scrollram.2") // Scroll RAM 2
AM_RANGE(0x0a0000, 0x0a7fff) AM_RAM_DEVWRITE("scroll0", megasys1_tilemap_device, write) AM_SHARE("scroll0") // Scroll RAM 0
AM_RANGE(0x0b0000, 0x0b7fff) AM_RAM_DEVWRITE("scroll2", megasys1_tilemap_device, write) AM_SHARE("scroll2") // Scroll RAM 2
AM_RANGE(0x0b8000, 0x0bffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_SHARE("ram") // Work RAM + Spriteram
AM_RANGE(0x100000, 0x100001) AM_READ_PORT("SW1_2") AM_WRITE(captflag_oki_bank_w) // 2 x DSW + Sound
@ -766,7 +891,7 @@ WRITE16_MEMBER(cischeat_state::bigrun_soundbank_w)
static ADDRESS_MAP_START( bigrun_sound_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM
AM_RANGE(0x040000, 0x040001) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_WRITE(bigrun_soundbank_w) // From Main CPU
AM_RANGE(0x060000, 0x060001) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // To Main CPU
AM_RANGE(0x060000, 0x060001) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // To Main CPU
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
@ -792,7 +917,7 @@ static ADDRESS_MAP_START( cischeat_sound_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM
AM_RANGE(0x040002, 0x040003) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking
AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking
AM_RANGE(0x060002, 0x060003) AM_DEVREAD("soundlatch2", generic_latch_16_device, read) // To Main CPU
AM_RANGE(0x060002, 0x060003) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // To Main CPU
AM_RANGE(0x060004, 0x060005) AM_DEVREAD("soundlatch", generic_latch_16_device, read) // From Main CPU
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
@ -826,7 +951,8 @@ static ADDRESS_MAP_START( f1gpstr2_sound_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x040004, 0x040005) AM_WRITE(cischeat_soundbank_1_w) // Sample Banking
AM_RANGE(0x040008, 0x040009) AM_WRITE(cischeat_soundbank_2_w) // Sample Banking
AM_RANGE(0x04000e, 0x04000f) AM_WRITENOP // ? 0 (f1gpstar: no)
AM_RANGE(0x060004, 0x060005) AM_DEVREAD("soundlatch", generic_latch_16_device, read) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // From Main CPU (f1gpstar: 60000)
AM_RANGE(0x060002, 0x060003) AM_DEVWRITE("soundlatch2", generic_latch_16_device, write) // To Main CPU
AM_RANGE(0x060004, 0x060005) AM_DEVREAD("soundlatch", generic_latch_16_device, read) // From Main CPU
AM_RANGE(0x080000, 0x080003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0x00ff)
AM_RANGE(0x0a0000, 0x0a0003) AM_DEVREADWRITE8("oki1", okim6295_device, read, write, 0x00ff)
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("oki2", okim6295_device, read, write, 0x00ff)
@ -841,22 +967,12 @@ ADDRESS_MAP_END
**************************************************************************/
READ16_MEMBER(cischeat_state::f1gpstr2_io_r)
{
return m_vregs[offset + 0x1000/2];
}
WRITE16_MEMBER(cischeat_state::f1gpstr2_io_w)
{
COMBINE_DATA(&m_vregs[offset + 0x1000/2]);
}
static ADDRESS_MAP_START( f1gpstr2_io_map, AS_PROGRAM, 16, cischeat_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM
AM_RANGE(0x080000, 0x080fff) AM_READWRITE(f1gpstr2_io_r, f1gpstr2_io_w) //
AM_RANGE(0x080000, 0x080fff) AM_RAM AM_SHARE("shareio")
AM_RANGE(0x100000, 0x100001) AM_WRITEONLY AM_SHARE("ioready") //
AM_RANGE(0x180000, 0x183fff) AM_RAM // RAM
AM_RANGE(0x200000, 0x200001) AM_WRITENOP //
AM_RANGE(0x200000, 0x200001) AM_NOP //
ADDRESS_MAP_END
@ -1577,6 +1693,7 @@ INPUT_PORTS_END
**************************************************************************/
#ifdef UNUSED_VARIABLE
/* 8x8x4, straightforward layout */
static const gfx_layout tiles_8x8 =
{
@ -1588,6 +1705,7 @@ static const gfx_layout tiles_8x8 =
{ STEP8(0,4*8) },
8*8*4
};
#endif
/* 16x16x4, straightforward layout */
static const gfx_layout tiles_16x16 =
@ -1638,12 +1756,12 @@ static const gfx_layout road_layout =
**************************************************************************/
static GFXDECODE_START( bigrun )
GFXDECODE_ENTRY( "gfx1", 0, tiles_8x8, 0x0e00/2 , 16 ) // [0] Scroll 0
GFXDECODE_ENTRY( "gfx2", 0, tiles_8x8, 0x1600/2 , 16 ) // [1] Scroll 1
GFXDECODE_ENTRY( "gfx3", 0, tiles_8x8, 0x3600/2 , 16 ) // [2] Scroll 2
GFXDECODE_ENTRY( "gfx4", 0, tiles_16x16,0x2800/2 , 64 ) // [3] Sprites
GFXDECODE_ENTRY( "gfx5", 0, road_layout,0x1800/2 , 64 ) // [4] Road 0
GFXDECODE_ENTRY( "gfx6", 0, road_layout,0x2000/2 , 64 ) // [5] Road 1
//GFXDECODE_ENTRY( "scroll0", 0, tiles_8x8, 0x0e00/2 , 16 ) // Scroll 0
//GFXDECODE_ENTRY( "scroll1", 0, tiles_8x8, 0x1600/2 , 16 ) // Scroll 1
//GFXDECODE_ENTRY( "scroll2", 0, tiles_8x8, 0x3600/2 , 16 ) // Scroll 2
GFXDECODE_ENTRY( "sprites", 0, tiles_16x16,0x2800/2 , 64 ) // [0] Sprites
GFXDECODE_ENTRY( "road0", 0, road_layout,0x1800/2 , 64 ) // [1] Road 0
GFXDECODE_ENTRY( "road1", 0, road_layout,0x2000/2 , 64 ) // [2] Road 1
GFXDECODE_END
/**************************************************************************
@ -1651,12 +1769,12 @@ GFXDECODE_END
**************************************************************************/
static GFXDECODE_START( cischeat )
GFXDECODE_ENTRY( "gfx1", 0, tiles_8x8, 0x1c00/2, 32 ) // [0] Scroll 0
GFXDECODE_ENTRY( "gfx2", 0, tiles_8x8, 0x2c00/2, 32 ) // [1] Scroll 1
GFXDECODE_ENTRY( "gfx3", 0, tiles_8x8, 0x6c00/2, 32 ) // [2] Scroll 2
GFXDECODE_ENTRY( "gfx4", 0, tiles_16x16,0x5000/2, 128 ) // [3] Sprites
GFXDECODE_ENTRY( "gfx5", 0, road_layout,0x3800/2, 64 ) // [4] Road 0
GFXDECODE_ENTRY( "gfx6", 0, road_layout,0x4800/2, 64 ) // [5] Road 1
//GFXDECODE_ENTRY( "scroll0", 0, tiles_8x8, 0x1c00/2, 32 ) // Scroll 0
//GFXDECODE_ENTRY( "scroll1", 0, tiles_8x8, 0x2c00/2, 32 ) // Scroll 1
//GFXDECODE_ENTRY( "scroll2", 0, tiles_8x8, 0x6c00/2, 32 ) // Scroll 2
GFXDECODE_ENTRY( "sprites", 0, tiles_16x16,0x5000/2, 128 ) // [0] Sprites
GFXDECODE_ENTRY( "road0", 0, road_layout,0x3800/2, 64 ) // [1] Road 0
GFXDECODE_ENTRY( "road1", 0, road_layout,0x4800/2, 64 ) // [2] Road 1
GFXDECODE_END
/**************************************************************************
@ -1664,12 +1782,12 @@ GFXDECODE_END
**************************************************************************/
static GFXDECODE_START( f1gpstar )
GFXDECODE_ENTRY( "gfx1", 0, tiles_8x8, 0x1e00/2, 16 ) // [0] Scroll 0
GFXDECODE_ENTRY( "gfx2", 0, tiles_8x8, 0x2e00/2, 16 ) // [1] Scroll 1
GFXDECODE_ENTRY( "gfx3", 0, tiles_8x8, 0x6e00/2, 16 ) // [2] Scroll 2
GFXDECODE_ENTRY( "gfx4", 0, tiles_16x16,0x5000/2, 128 ) // [3] Sprites
GFXDECODE_ENTRY( "gfx5", 0, road_layout,0x3800/2, 64 ) // [4] Road 0
GFXDECODE_ENTRY( "gfx6", 0, road_layout,0x4800/2, 64 ) // [5] Road 1
//GFXDECODE_ENTRY( "scroll0", 0, tiles_8x8, 0x1e00/2, 16 ) // Scroll 0
//GFXDECODE_ENTRY( "scroll1", 0, tiles_8x8, 0x2e00/2, 16 ) // Scroll 1
//GFXDECODE_ENTRY( "scroll2", 0, tiles_8x8, 0x6e00/2, 16 ) // Scroll 2
GFXDECODE_ENTRY( "sprites", 0, tiles_16x16,0x5000/2, 128 ) // [0] Sprites
GFXDECODE_ENTRY( "road0", 0, road_layout,0x3800/2, 64 ) // [1] Road 0
GFXDECODE_ENTRY( "road1", 0, road_layout,0x4800/2, 64 ) // [2] Road 1
GFXDECODE_END
/**************************************************************************
@ -1677,10 +1795,10 @@ GFXDECODE_END
**************************************************************************/
static GFXDECODE_START( scudhamm )
GFXDECODE_ENTRY( "gfx1", 0, tiles_8x8, 0x1e00/2, 16 ) // [0] Scroll 0
GFXDECODE_ENTRY( "gfx1", 0, tiles_8x8, 0x0000/2, 16 ) // [1] UNUSED
GFXDECODE_ENTRY( "gfx3", 0, tiles_8x8, 0x4e00/2, 16 ) // [2] Scroll 2
GFXDECODE_ENTRY( "gfx4", 0, tiles_16x16_quad, 0x3000/2, 128 ) // [3] sprites
//GFXDECODE_ENTRY( "scroll0", 0, tiles_8x8, 0x1e00/2, 16 ) // Scroll 0
//GFXDECODE_ENTRY( "scroll0", 0, tiles_8x8, 0x0000/2, 16 ) // UNUSED
//GFXDECODE_ENTRY( "scroll2", 0, tiles_8x8, 0x4e00/2, 16 ) // Scroll 2
GFXDECODE_ENTRY( "sprites", 0, tiles_16x16_quad, 0x3000/2, 128 ) // [0] sprites
// No Road Layers
GFXDECODE_END
@ -1756,8 +1874,9 @@ static MACHINE_CONFIG_START( bigrun, cischeat_state )
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
MCFG_VIDEO_START_OVERRIDE(cischeat_state,bigrun)
MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 0x0e00/2)
MCFG_MEGASYS1_TILEMAP_ADD("scroll1", "palette", 0x1600/2)
MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 0x3600/2)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -1804,8 +1923,15 @@ static MACHINE_CONFIG_DERIVED( cischeat, bigrun )
MCFG_PALETTE_ENTRIES(0x8000/2)
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
MCFG_VIDEO_START_OVERRIDE(cischeat_state,cischeat)
MCFG_DEVICE_MODIFY("scroll0")
MCFG_MEGASYS1_TILEMAP_COLORBASE(0x1c00/2)
MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(5)
MCFG_DEVICE_MODIFY("scroll1")
MCFG_MEGASYS1_TILEMAP_COLORBASE(0x2c00/2)
MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(5)
MCFG_DEVICE_MODIFY("scroll2")
MCFG_MEGASYS1_TILEMAP_COLORBASE(0x6c00/2)
MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(5)
MACHINE_CONFIG_END
@ -1833,7 +1959,13 @@ static MACHINE_CONFIG_DERIVED( f1gpstar, bigrun )
MCFG_PALETTE_ENTRIES(0x8000/2)
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
MCFG_VIDEO_START_OVERRIDE(cischeat_state,f1gpstar)
MCFG_DEVICE_MODIFY("scroll0")
MCFG_MEGASYS1_TILEMAP_COLORBASE(0x1e00/2)
MCFG_DEVICE_MODIFY("scroll1")
MCFG_MEGASYS1_TILEMAP_COLORBASE(0x2e00/2)
MCFG_DEVICE_MODIFY("scroll2")
MCFG_MEGASYS1_TILEMAP_COLORBASE(0x6e00/2)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(cischeat_state, screen_update_f1gpstar)
MACHINE_CONFIG_END
@ -1856,6 +1988,12 @@ static MACHINE_CONFIG_DERIVED( f1gpstr2, f1gpstar )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( wildplt, f1gpstr2 )
MCFG_CPU_MODIFY("cpu1")
MCFG_CPU_PROGRAM_MAP(wildplt_map)
MACHINE_CONFIG_END
/**************************************************************************
Scud Hammer
**************************************************************************/
@ -1902,7 +2040,8 @@ static MACHINE_CONFIG_START( scudhamm, cischeat_state )
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_VIDEO_START_OVERRIDE(cischeat_state,f1gpstar)
MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 0x1e00/2)
MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 0x4e00/2)
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@ -1990,7 +2129,8 @@ static MACHINE_CONFIG_START( captflag, cischeat_state )
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_VIDEO_START_OVERRIDE(cischeat_state,f1gpstar)
MCFG_MEGASYS1_TILEMAP_ADD("scroll0", "palette", 0x1e00/2)
MCFG_MEGASYS1_TILEMAP_ADD("scroll2", "palette", 0x4e00/2)
// Motors
MCFG_TIMER_ADD_NONE("motor_left")
@ -2140,18 +2280,18 @@ ROM_START( bigrun )
ROM_LOAD16_BYTE( "br8950b.3", 0x000000, 0x020000, CRC(864cebf7) SHA1(4e63106cd5832901688dfce2e450f536a6927c81) )
ROM_LOAD16_BYTE( "br8950b.4", 0x000001, 0x020000, CRC(702c2a6e) SHA1(cf3327919e24b7206d404b008cb00117e4308f94) )
ROM_REGION( 0x040000, "gfx1", 0 ) // scroll 0
ROM_REGION( 0x040000, "scroll0", 0 ) // scroll 0
ROM_LOAD( "br8950b.5", 0x000000, 0x020000, CRC(0530764e) SHA1(0a89eab2ce9bd5df574a46bb6ea884c33407f122) )
ROM_LOAD( "br8950b.6", 0x020000, 0x020000, CRC(cf40ecfa) SHA1(96e1bfb7a33603a1eaaeb31386bba947fc005060) )
ROM_REGION( 0x040000, "gfx2", 0 ) // scroll 1
ROM_REGION( 0x040000, "scroll1", 0 ) // scroll 1
ROM_LOAD( "br8950b.7", 0x000000, 0x020000, CRC(bd5fd061) SHA1(e5e0afb0a3a1d5f7a27bd04b724c48ea65872233) )
ROM_LOAD( "br8950b.8", 0x020000, 0x020000, CRC(7d66f418) SHA1(f6564ac9d65d40af17f5dd422c435aeb6a385256) )
ROM_REGION( 0x020000, "gfx3", 0 ) // scroll 2
ROM_REGION( 0x020000, "scroll2", 0 ) // scroll 2
ROM_LOAD( "br8950b.9", 0x000000, 0x020000, CRC(be0864c4) SHA1(e0f1c0f09b30a731f0e062b1acb1b3a3a772a5cc) )
ROM_REGION( 0x280000, "gfx4", 0 ) /* sprites */
ROM_REGION( 0x280000, "sprites", 0 ) /* sprites */
ROM_LOAD16_BYTE( "mr88004a.t41", 0x000000, 0x080000, CRC(c781d8c5) SHA1(52b23842a20443b51490d701dca72fb0a3118033) )
ROM_LOAD16_BYTE( "mr88004d.t43", 0x000001, 0x080000, CRC(e4041208) SHA1(f5bd21b42f627b01bca2324082aecee7852a37e6) )
ROM_LOAD16_BYTE( "mr88004b.t42", 0x100000, 0x080000, CRC(2df2e7b9) SHA1(5772e0dc2f842077ea70a558b55ec5ceea693f00) )
@ -2159,11 +2299,11 @@ ROM_START( bigrun )
ROM_LOAD16_BYTE( "mb88004c.t48", 0x200000, 0x040000, CRC(02e2931d) SHA1(754b38929a2dd10d39634fb9cf737e3175a8b1ec) )
ROM_LOAD16_BYTE( "mb88004f.t49", 0x200001, 0x040000, CRC(4f012dab) SHA1(35f756b1c7b41f2e81ccbefb2075608a5d663152) )
ROM_REGION( 0x100000, "gfx5", 0 ) // Road 0
ROM_REGION( 0x100000, "road0", 0 ) // Road 0
ROM_LOAD( "mr88004g.t45", 0x000000, 0x080000, CRC(bb397bae) SHA1(c67d33bde6e8de2ea7581faadb96acd977adc13c) )
ROM_LOAD( "mb88004h.t46", 0x080000, 0x080000, CRC(6b31a1ba) SHA1(71a956f0f51a63bddedfef0febdc95108ed42226) )
ROM_REGION( 0x100000, "gfx6", 0 ) // Road 1
ROM_REGION( 0x100000, "road1", 0 ) // Road 1
ROM_LOAD( "mr88004g.t45", 0x000000, 0x080000, CRC(bb397bae) SHA1(c67d33bde6e8de2ea7581faadb96acd977adc13c) )
ROM_LOAD( "mb88004h.t46", 0x080000, 0x080000, CRC(6b31a1ba) SHA1(71a956f0f51a63bddedfef0febdc95108ed42226) )
@ -2188,7 +2328,7 @@ ROM_END
DRIVER_INIT_MEMBER(cischeat_state,bigrun)
{
cischeat_untangle_sprites("gfx4"); // Untangle sprites
cischeat_untangle_sprites("sprites"); // Untangle sprites
phantasm_rom_decode(machine(), "soundcpu"); // Decrypt sound cpu code
}
@ -2266,16 +2406,16 @@ ROM_START( cischeat )
ROM_COPY( "cpu2", 0x40000, 0x80000, 0x40000 )
ROM_COPY( "cpu3", 0x40000, 0xc0000, 0x40000 )
ROM_REGION( 0x040000, "gfx1", 0 )
ROM_REGION( 0x040000, "scroll0", 0 )
ROM_LOAD( "ch9071.a14", 0x000000, 0x040000, CRC(7a6d147f) SHA1(8f52e012d9699311c2a2409130c6200c6d2e1c51) ) // scroll 0
ROM_REGION( 0x040000, "gfx2", 0 )
ROM_REGION( 0x040000, "scroll1", 0 )
ROM_LOAD( "ch9071.t74", 0x000000, 0x040000, CRC(735a2e25) SHA1(51f528db207283c0d2b70acd5037ffafbe24f6f3) ) // scroll 1
ROM_REGION( 0x010000, "gfx3", 0 )
ROM_REGION( 0x010000, "scroll2", 0 )
ROM_LOAD( "ch9071.07", 0x000000, 0x010000, CRC(3724ccc3) SHA1(3797ea49156362467ba948c51ac7b52610d1b9de) ) // scroll 2
ROM_REGION( 0x400000, "gfx4", 0 ) /* sprites */
ROM_REGION( 0x400000, "sprites", 0 ) /* sprites */
ROM_LOAD16_BYTE( "ch9072.r15", 0x000000, 0x080000, CRC(38af4aea) SHA1(ea27ab44b33776984adaa9b26d85165d6700a12c) )
ROM_LOAD16_BYTE( "ch9072.r16", 0x000001, 0x080000, CRC(71388dad) SHA1(0d2451e36cfbf7400ade849b4c8a1e8f56fc089c) )
ROM_LOAD16_BYTE( "ch9072.r17", 0x100000, 0x080000, CRC(9d052cf3) SHA1(d6bd30965316104cb03e62a69df61eb60eb84741) )
@ -2285,11 +2425,11 @@ ROM_START( cischeat )
ROM_LOAD16_BYTE( "ch9072.r19", 0x300000, 0x080000, CRC(4e996fa8) SHA1(c74d761e0c8d17b3fb5d33b06136c4d0ba87c2e1) )
ROM_LOAD16_BYTE( "ch9072.r20", 0x300001, 0x080000, CRC(fa70b92d) SHA1(01b5f7309c9c7cd6d41c0f46678772dda45344e1) )
ROM_REGION( 0x100000, "gfx5", 0 )
ROM_REGION( 0x100000, "road0", 0 )
ROM_LOAD( "ch9073.r21", 0x000000, 0x080000, CRC(2943d2f6) SHA1(ae8a25c1d76d3c36aa326d0171acb7dce93c4d87) ) // Road
ROM_LOAD( "ch9073.r22", 0x080000, 0x080000, CRC(2dd44f85) SHA1(5f20f75e96e14389187d3471bc7f2ceb0758eec4) )
ROM_REGION( 0x100000, "gfx6", 0 )
ROM_REGION( 0x100000, "road1", 0 )
ROM_LOAD( "ch9073.r21", 0x000000, 0x080000, CRC(2943d2f6) SHA1(ae8a25c1d76d3c36aa326d0171acb7dce93c4d87) ) // Road
ROM_LOAD( "ch9073.r22", 0x080000, 0x080000, CRC(2dd44f85) SHA1(5f20f75e96e14389187d3471bc7f2ceb0758eec4) )
@ -2307,7 +2447,7 @@ ROM_END
DRIVER_INIT_MEMBER(cischeat_state,cischeat)
{
cischeat_untangle_sprites("gfx4"); // Untangle sprites
cischeat_untangle_sprites("sprites"); // Untangle sprites
astyanax_rom_decode(machine(), "soundcpu"); // Decrypt sound cpu code
}
@ -2458,16 +2598,16 @@ ROM_START( f1gpstar )
ROM_LOAD16_BYTE( "9188a-26.v10", 0x000000, 0x040000, CRC(0b76673f) SHA1(cf29333ffb51250ae2d5363d612260f536cd15af) ) // cpu #1
ROM_LOAD16_BYTE( "9188a-21.v10", 0x000001, 0x040000, CRC(3e098d77) SHA1(0bf7e8ca36086a7ae3d44a10b4ca43f869403eb0) )
ROM_REGION( 0x080000, "gfx1", 0 )
ROM_REGION( 0x080000, "scroll0", 0 )
ROM_LOAD( "90015-31.r56", 0x000000, 0x080000, CRC(0c8f0e2b) SHA1(6b0917a632c6beaca018146b6be66a3561b863b3) ) // scroll 0
ROM_REGION( 0x080000, "gfx2", 0 )
ROM_REGION( 0x080000, "scroll1", 0 )
ROM_LOAD( "90015-32.r57", 0x000000, 0x080000, CRC(9c921cfb) SHA1(006d4af6dbbc34bee05f3620ba0a947a568a2400) ) // scroll 1
ROM_REGION( 0x020000, "gfx3", 0 )
ROM_REGION( 0x020000, "scroll2", 0 )
ROM_LOAD( "9188a-30.v10", 0x000000, 0x020000, CRC(0ef1fbf1) SHA1(28fa0b677e70833954a5fc2fdce233d0dec4f43c) ) // scroll 2
ROM_REGION( 0x500000, "gfx4", 0 ) /* sprites */
ROM_REGION( 0x500000, "sprites", 0 ) /* sprites */
ROM_LOAD16_BYTE( "90015-21.r46", 0x000000, 0x080000, CRC(6f30211f) SHA1(aedba39fc6aab7847a3a2314e152bc00615cbd72) )
ROM_LOAD16_BYTE( "90015-22.r47", 0x000001, 0x080000, CRC(05a9a5da) SHA1(807c43c3ee76bce8e4874fa51d2453917b1e4f3b) )
ROM_LOAD16_BYTE( "90015-23.r48", 0x100000, 0x080000, CRC(58e9c6d2) SHA1(b81208819dbc5887183855001c72d0d91d32fc4b) )
@ -2479,13 +2619,13 @@ ROM_START( f1gpstar )
ROM_LOAD16_BYTE( "90015-29.r54", 0x400000, 0x080000, CRC(2cdec370) SHA1(9fd8e8d6783a6c820d1f580a8872b5cc59641aa9) )
ROM_LOAD16_BYTE( "90015-30.r55", 0x400001, 0x080000, CRC(47e37604) SHA1(114eb01d3258bf481c01a8378f5f08b2bdeffbba) )
ROM_REGION( 0x200000, "gfx5", 0 )
ROM_REGION( 0x200000, "road0", 0 )
ROM_LOAD( "90015-05.w10", 0x000000, 0x080000, CRC(8eb48a23) SHA1(e394eb013dd1fdc1c30616ce356bebd187453d08) ) // Road 0
ROM_LOAD( "90015-06.w11", 0x080000, 0x080000, CRC(32063a68) SHA1(587d35edec2755df11f4d63ff7bfd134a0f9fb36) )
ROM_LOAD( "90015-07.w12", 0x100000, 0x080000, CRC(0d0d54f3) SHA1(8040945ea8f9487f0527140c90d6a66965c27ff4) )
ROM_LOAD( "90015-08.w14", 0x180000, 0x080000, CRC(f48a42c5) SHA1(5caf50fbde682d7d1e4ec0cceacf0db7682b72a9) )
ROM_REGION( 0x100000, "gfx6", 0 )
ROM_REGION( 0x100000, "road1", 0 )
ROM_LOAD( "90015-09.w13", 0x000000, 0x080000, CRC(55f49315) SHA1(ad338cb53149ccea2dbe5ad890433c9f09a8211c) ) // Road 1
ROM_LOAD( "90015-10.w15", 0x080000, 0x080000, CRC(678be0cb) SHA1(3857b549170b62b29644cf5ebdd4aac1afa9e420) )
@ -2521,7 +2661,7 @@ ROM_END
DRIVER_INIT_MEMBER(cischeat_state,f1gpstar)
{
cischeat_untangle_sprites("gfx4");
cischeat_untangle_sprites("sprites");
}
@ -2673,16 +2813,16 @@ ROM_START( wildplt )
ROM_LOAD16_BYTE( "gp-9188a_26_ver1-0.bin", 0x000000, 0x40000, CRC(bc48db69) SHA1(d66fa43347b991b899e086bfcf9ceb6277b859a9) )
ROM_LOAD16_BYTE( "gp-9188a_21_ver1-0.bin", 0x000001, 0x40000, CRC(c3192fbe) SHA1(c4a82a9174f6dc48946925ab94f81162632f58b0) )
ROM_REGION( 0x080000, "gfx1", 0 )
ROM_REGION( 0x080000, "scroll0", 0 )
ROM_LOAD( "gp-9188a_25_ver1-0.bin", 0x000000, 0x80000, CRC(e69d3ccc) SHA1(10ab3d1980c571a478625ec4e505d711d90670cf) )
ROM_REGION( 0x080000, "gfx2", 0 )
ROM_REGION( 0x080000, "scroll1", 0 )
ROM_LOAD( "gp-9188a_28_ver1-0.bin", 0x000000, 0x80000, CRC(2166c803) SHA1(14b3446fbd9e6d65cdcc20e8e0820008d561894b) )
ROM_REGION( 0x020000, "gfx3", 0 )
ROM_REGION( 0x020000, "scroll2", 0 )
ROM_LOAD( "gp-9188a_30_ver1-0.bin", 0x000000, 0x20000, CRC(35478ed9) SHA1(4090ad8c529c1295799a0fe6d7b05d68ec2cf584) )
ROM_REGION( 0x500000, "gfx4", 0 ) /* sprites */
ROM_REGION( 0x500000, "sprites", 0 ) /* sprites */
ROM_LOAD16_BYTE( "mr92020-11_w65.bin", 0x000000, 0x80000, CRC(585448cb) SHA1(578d241b928cc5b531c63b118fd1e7f1b864d5f3) )
ROM_LOAD16_BYTE( "mr92020-12_w66.bin", 0x000001, 0x80000, CRC(07104f78) SHA1(757fa1e0722533f42f12c7e030a283b7e90fc225) )
ROM_LOAD16_BYTE( "mr92020-13_w67.bin", 0x100000, 0x80000, CRC(c4afa3dc) SHA1(deda215a72914c61d500fee82e108997990d4057) )
@ -2694,13 +2834,13 @@ ROM_START( wildplt )
ROM_LOAD16_BYTE( "gp-9189_9_ver1-0.bin", 0x400000, 0x80000, CRC(0d4f6b5e) SHA1(92412590d17b7297188678a2b64c1b0ee7b00622) )
ROM_LOAD16_BYTE( "gp-9189_10_ver1-0.bin", 0x400001, 0x80000, CRC(9240969c) SHA1(1f7995349787792a759b1ba60673f28d0fe15cfe) )
ROM_REGION( 0x200000, "gfx5", 0 )
ROM_REGION( 0x200000, "road0", 0 )
ROM_LOAD( "mr92020-08_c50.bin", 0x000000, 0x80000, CRC(5e840567) SHA1(26e0278f455013600d37fc89eb83ce8bf11bb39d) )
ROM_LOAD( "mr92020-07_c49.bin", 0x080000, 0x80000, CRC(48d8ecb2) SHA1(dee5c274576c4463d33895a12e01b1b30a6daa58) )
ROM_LOAD( "mr92020-06_c51.bin", 0x100000, 0x80000, CRC(c00f1245) SHA1(11b9f6acbdf7094debb5a7a897afeb6a63b84103) )
ROM_LOAD( "mr92020-05_c48.bin", 0x180000, 0x80000, CRC(74ef3306) SHA1(9c22250df5bd14d50bb27728fe40b7f9ec283c24) )
ROM_REGION( 0x200000, "gfx6", 0 )
ROM_REGION( 0x200000, "road1", 0 )
ROM_LOAD( "mr92020-04_c47.bin", 0x000000, 0x80000, CRC(c752f467) SHA1(9faa15567677dd5cc141727b182ba8d6de08329d) )
ROM_LOAD( "mr92020-03_c52.bin", 0x080000, 0x80000, CRC(985b5fe0) SHA1(a28eb20d37f171241fd0be702f2db12be1329836) )
ROM_LOAD( "mr92020-02_c53.bin", 0x100000, 0x80000, CRC(da961dd4) SHA1(fa36ee94d0a40a0e6e7201df2b74413f23e02ae0) )
@ -2731,13 +2871,6 @@ ROM_START( wildplt )
ROM_LOAD( "pr90015b.bin", 0x000000, 0x0100, CRC(be240dac) SHA1(6203b73c1a5e09e525380a78b555c3818929d5eb) )
ROM_END
DRIVER_INIT_MEMBER(cischeat_state,wildplt)
{
m_cpu1->space(AS_PROGRAM).install_read_handler(0x080000, 0x087fff, read16_delegate(FUNC(cischeat_state::wildplt_vregs_r),this));
DRIVER_INIT_CALL(f1gpstar);
}
/***************************************************************************
@ -2888,16 +3021,16 @@ ROM_START( f1gpstr2 )
ROM_LOAD16_BYTE( "9188a-26.124", 0x000000, 0x040000, CRC(8690bb79) SHA1(8ef822cf8371cb209c30cfe5c4d5e8b36392f732) ) // cpu1
ROM_LOAD16_BYTE( "9188a-21.91", 0x000001, 0x040000, CRC(c5a5807e) SHA1(15493030d154579d2095c7304dd843aed09a69ec) )
ROM_REGION( 0x080000, "gfx1", 0 )
ROM_REGION( 0x080000, "scroll0", 0 )
ROM_LOAD( "9188a-25.123", 0x000000, 0x080000, CRC(000c83d2) SHA1(656e4553873ad945bbd770166cc3add287e525dd) ) // scroll 0
ROM_REGION( 0x080000, "gfx2", 0 )
ROM_REGION( 0x080000, "scroll1", 0 )
ROM_LOAD( "9188a-28.152", 0x000000, 0x080000, CRC(e734f8ea) SHA1(efed2ce4a23d16a38872892c25fa9824ca0fed8e) ) // scroll 1
ROM_REGION( 0x020000, "gfx3", 0 )
ROM_REGION( 0x020000, "scroll2", 0 )
ROM_LOAD( "9188a-30.174", 0x000000, 0x020000, CRC(c5906023) SHA1(6006c86995abef1442232ff5fbd68c2a37038d1f) ) // scroll 2
ROM_REGION( 0x600000, "gfx4", 0 ) /* sprites */
ROM_REGION( 0x600000, "sprites", 0 ) /* sprites */
ROM_LOAD16_BYTE( "92021-11.1", 0x000000, 0x100000, CRC(fec883a7) SHA1(a17ca17fa37b35c5f28cede52efa91afe566a95a) )
ROM_LOAD16_BYTE( "92021-12.2", 0x000001, 0x100000, CRC(df283a7e) SHA1(4e9eed9475186e6f94d9ef84a798fa807fb37903) )
ROM_LOAD16_BYTE( "92021-13.11", 0x200000, 0x100000, CRC(1ceb593a) SHA1(e8428c42d10aa0d26717176b1bdea9a4a1d3e5f3) )
@ -2905,13 +3038,13 @@ ROM_START( f1gpstr2 )
ROM_LOAD16_BYTE( "92021-15.21", 0x400000, 0x100000, CRC(66e8b197) SHA1(10f6c5beb4ab57fbd1940db0e15d07df486e4351) )
ROM_LOAD16_BYTE( "92021-16.22", 0x400001, 0x100000, CRC(1f672dd8) SHA1(f75b8f3f9512e2ef085170888e621f54ee94f9d5) )
ROM_REGION( 0x200000, "gfx5", 0 )
ROM_REGION( 0x200000, "road0", 0 )
ROM_LOAD( "92021-08.64", 0x000000, 0x080000, CRC(54ff00c4) SHA1(f86f16c77b211206fbe39efa278634db8a3eaf75) ) // Road 0
ROM_LOAD( "92021-07.63", 0x080000, 0x080000, CRC(258d524a) SHA1(f2ba03b7fec81377b032476703cafe0fe79f6a2a) )
ROM_LOAD( "92021-06.62", 0x100000, 0x080000, CRC(f1423efe) SHA1(bd45ba2b7908d10dc4df10b9c04dca6830894d2a) )
ROM_LOAD( "92021-05.61", 0x180000, 0x080000, CRC(88bb6db1) SHA1(54413c41a4d02137aebc2a4866a38aadfe64825a) )
ROM_REGION( 0x200000, "gfx6", 0 )
ROM_REGION( 0x200000, "road1", 0 )
ROM_LOAD( "92021-04.17", 0x000000, 0x080000, CRC(3a2e6b1e) SHA1(350465ade24c16e4fe39613f89bf3e7277cdd31e) ) // Road 1
ROM_LOAD( "92021-03.16", 0x080000, 0x080000, CRC(1f041f65) SHA1(cc4defe3675b30e7de4b3e1eb580a71af4c36bc6) )
ROM_LOAD( "92021-02.15", 0x100000, 0x080000, CRC(d0582ad8) SHA1(b343a6525bb9d7dbb288ddec392b23e85ae150bb) )
@ -2987,16 +3120,16 @@ ROM_START( scudhamm )
ROM_LOAD16_BYTE( "3", 0x000000, 0x040000, CRC(a908e7bd) SHA1(be0a8f959ab5c19122eee6c3def6137f37f1a9c6) )
ROM_LOAD16_BYTE( "4", 0x000001, 0x040000, CRC(981c8b02) SHA1(db6c8993bf1c3993ab31dd649022ab76169975e1) )
ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
ROM_REGION( 0x080000, "scroll0", 0 ) /* Scroll 0 */
ROM_LOAD( "5", 0x000000, 0x080000, CRC(714c115e) SHA1(c3e88b3972e3926f37968f3e84b932e1ac177142) )
// ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
// ROM_REGION( 0x080000, "scroll1", 0 ) /* Scroll 1 */
// UNUSED
ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
ROM_REGION( 0x020000, "scroll2", 0 ) /* Scroll 2 */
ROM_LOAD( "6", 0x000000, 0x020000, CRC(b39aab63) SHA1(88275cce8b1323b2d835390a8fc2380b90d50d95) ) // 1xxxxxxxxxxxxxxxx = 0xFF
ROM_REGION( 0x500000, "gfx4", 0 ) /* Sprites */
ROM_REGION( 0x500000, "sprites", 0 ) /* Sprites */
ROM_LOAD16_BYTE( "1.bot", 0x000000, 0x080000, CRC(46450d73) SHA1(c9acdf1cef760e5194c346d721e859c61afbfce6) )
ROM_LOAD16_BYTE( "2.bot", 0x000001, 0x080000, CRC(fb7b66dd) SHA1(ad6bbae4fa72f957e5c0fc7bf6199ac45f837dac) )
ROM_LOAD16_BYTE( "3.bot", 0x100000, 0x080000, CRC(7d45960b) SHA1(abf59cf85f28c90d4c08e3a1e5408a9a700071cc) )
@ -3159,16 +3292,16 @@ ROM_START( armchmp2 )
ROM_LOAD16_BYTE( "ac-91106v2.6_4.ic63", 0x000000, 0x020000, CRC(e0cec032) SHA1(743b022b6de3efb045c4f1cca49caed0259ccfff) )
ROM_LOAD16_BYTE( "ac-91106v2.6_3.ic62", 0x000001, 0x020000, CRC(5de6da19) SHA1(1f46056596924789394ad2d99ec2d7fcb7845d3c) )
ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
ROM_REGION( 0x080000, "scroll0", 0 ) /* Scroll 0 */
ROM_LOAD( "mr91042-07-r66_6.ic95", 0x000000, 0x080000, CRC(d1be8699) SHA1(67563761f95892b08c7113ab1c52ab5aa7118fb8) )
// ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
// ROM_REGION( 0x080000, "scroll1", 0 ) /* Scroll 1 */
// UNUSED
ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
ROM_REGION( 0x020000, "scroll2", 0 ) /* Scroll 2 */
ROM_LOAD( "ac91106_ver1.2_7.ic99", 0x000000, 0x020000, CRC(09755aef) SHA1(39c901fb9408a0ba488f0112d7f48b929b092e3b) )
ROM_REGION( 0x300000, "gfx4", 0 ) /* Sprites */
ROM_REGION( 0x300000, "sprites", 0 ) /* Sprites */
ROM_LOAD16_BYTE( "mr91042-01-r60_1.ic1", 0x000000, 0x080000, CRC(fdfe6951) SHA1(ba6c5cd5d16fdca6f131302b19e621f8abe8136a) )
ROM_LOAD16_BYTE( "mr91042-02-r61_2.ic2", 0x000001, 0x080000, CRC(2e6c8b30) SHA1(70503fec251606b37fea2c7f91e682aece252035) )
ROM_LOAD16_BYTE( "mr91042-03-r62_3.ic5", 0x100000, 0x080000, CRC(07ba6d3a) SHA1(9c58e3a1931b593448c53a59e7f5b9aaac40ff88) )
@ -3204,16 +3337,16 @@ ROM_START( armchmp2o )
ROM_LOAD16_BYTE( "ac91106_ver1.7_4.ic63", 0x000000, 0x020000, CRC(aaa11bc7) SHA1(ac6186f45a006074d3a86d7437c5a3411bf27188) )
ROM_LOAD16_BYTE( "ac91106_ver1.7_3.ic62", 0x000001, 0x020000, CRC(a7965879) SHA1(556fecd6ea0f977b718d132c4180bb2160b9da7e) )
ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
ROM_REGION( 0x080000, "scroll0", 0 ) /* Scroll 0 */
ROM_LOAD( "mr91042-07-r66_6.ic95", 0x000000, 0x080000, CRC(d1be8699) SHA1(67563761f95892b08c7113ab1c52ab5aa7118fb8) )
// ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
// ROM_REGION( 0x080000, "scroll1", 0 ) /* Scroll 1 */
// UNUSED
ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
ROM_REGION( 0x020000, "scroll2", 0 ) /* Scroll 2 */
ROM_LOAD( "ac91106_ver1.2_7.ic99", 0x000000, 0x020000, CRC(09755aef) SHA1(39c901fb9408a0ba488f0112d7f48b929b092e3b) )
ROM_REGION( 0x300000, "gfx4", 0 ) /* Sprites */
ROM_REGION( 0x300000, "sprites", 0 ) /* Sprites */
ROM_LOAD16_BYTE( "mr91042-01-r60_1.ic1", 0x000000, 0x080000, CRC(fdfe6951) SHA1(ba6c5cd5d16fdca6f131302b19e621f8abe8136a) )
ROM_LOAD16_BYTE( "mr91042-02-r61_2.ic2", 0x000001, 0x080000, CRC(2e6c8b30) SHA1(70503fec251606b37fea2c7f91e682aece252035) )
ROM_LOAD16_BYTE( "mr91042-03-r62_3.ic5", 0x100000, 0x080000, CRC(07ba6d3a) SHA1(9c58e3a1931b593448c53a59e7f5b9aaac40ff88) )
@ -3255,16 +3388,16 @@ ROM_START( captflag )
ROM_LOAD16_BYTE( "cf-92128a_3_ver1.4.ic40", 0x000000, 0x020000, CRC(e62af6ae) SHA1(38eb581def468860e4705f25088550799303a9aa) )
ROM_LOAD16_BYTE( "cf-92128_4_ver1.4.ic46", 0x000001, 0x020000, CRC(e773f87f) SHA1(cf9d72b0df256b69b96f1cd6b5f86282801873e3) )
ROM_REGION( 0x80000, "gfx1", 0 ) /* Scroll 0 */
ROM_REGION( 0x80000, "scroll0", 0 ) /* Scroll 0 */
ROM_LOAD( "mr92027-11_w89.ic54", 0x000000, 0x080000, CRC(d34cae3c) SHA1(622ad4645df12d34e55bbfb7194508957bb2198b) ) // 5 on the PCB
// ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
// ROM_REGION( 0x080000, "scroll1", 0 ) /* Scroll 1 */
// UNUSED
ROM_REGION( 0x20000, "gfx3", 0 ) /* Scroll 2 */
ROM_REGION( 0x20000, "scroll2", 0 ) /* Scroll 2 */
ROM_LOAD( "cf-92128_6.ic55", 0x000000, 0x020000, CRC(12debfc2) SHA1(f28d3f63a3c8965fcd838eedad4ef3682a28da0d) ) // 6 on the PCB
ROM_REGION( 0x400000, "gfx4", 0 ) /* Sprites */
ROM_REGION( 0x400000, "sprites", 0 ) /* Sprites */
ROM_LOAD16_BYTE( "gp-9189_1.ic1", 0x000000, 0x080000, CRC(03d69f0f) SHA1(97a0552d94ca1e9c76896903c02c3f005752e5db) )
ROM_LOAD16_BYTE( "gp-9189_2.ic2", 0x000001, 0x080000, CRC(fbfba282) SHA1(65735d8f6abdb5816b8b26ce2969959a0f2e2c7d) )
ROM_LOAD16_BYTE( "mr92027-08_w85.ic5", 0x100000, 0x080000, CRC(1e02abff) SHA1(497aeab40c778ef6d8a76b005530fea5f4f68ab8) )
@ -3319,7 +3452,7 @@ GAMEL( 1990, cischeat, 0, cischeat, cischeat, cischeat_state, cischeat, R
GAMEL( 1991, f1gpstar, 0, f1gpstar, f1gpstar, cischeat_state, f1gpstar, ROT0, "Jaleco", "Grand Prix Star", MACHINE_IMPERFECT_GRAPHICS, layout_f1gpstar )
GAME ( 1992, armchmp2, 0, armchmp2, armchmp2, driver_device, 0, ROT270, "Jaleco", "Arm Champs II v2.6", MACHINE_IMPERFECT_GRAPHICS )
GAME ( 1992, armchmp2o,armchmp2, armchmp2, armchmp2, driver_device, 0, ROT270, "Jaleco", "Arm Champs II v1.7", MACHINE_IMPERFECT_GRAPHICS )
GAME ( 1992, wildplt, 0, f1gpstr2, wildplt, cischeat_state, wildplt, ROT0, "Jaleco", "Wild Pilot", MACHINE_IMPERFECT_GRAPHICS )
GAME ( 1992, wildplt, 0, wildplt, wildplt, cischeat_state, f1gpstar, ROT0, "Jaleco", "Wild Pilot", MACHINE_IMPERFECT_GRAPHICS )
GAMEL( 1993, f1gpstr2, 0, f1gpstr2, f1gpstar, cischeat_state, f1gpstar, ROT0, "Jaleco", "F-1 Grand Prix Star II", MACHINE_IMPERFECT_GRAPHICS, layout_f1gpstar )
GAME ( 1993, captflag, 0, captflag, captflag, cischeat_state, captflag, ROT270, "Jaleco", "Captain Flag (Japan)", MACHINE_IMPERFECT_GRAPHICS )
GAME ( 1994, scudhamm, 0, scudhamm, scudhamm, driver_device, 0, ROT270, "Jaleco", "Scud Hammer", MACHINE_IMPERFECT_GRAPHICS )

File diff suppressed because it is too large Load Diff

View File

@ -7,14 +7,14 @@
#include "machine/gen_latch.h"
#include "machine/ticket.h"
#include "machine/watchdog.h"
#include "video/ms1_tmap.h"
class cischeat_state : public driver_device
{
public:
cischeat_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_vregs(*this, "vregs"),
m_scrollram(*this, "scrollram.%u", 0),
m_tmap(*this, "scroll%u", 0),
m_ram(*this, "ram"),
m_roadram(*this, "roadram.%u", 0),
m_f1gpstr2_ioready(*this, "ioready"),
@ -42,20 +42,13 @@ public:
m_captflag_leds = 0;
}
required_shared_ptr<UINT16> m_vregs;
optional_shared_ptr_array<UINT16,3> m_scrollram;
optional_device_array<megasys1_tilemap_device, 3> m_tmap;
required_shared_ptr<UINT16> m_ram;
optional_shared_ptr_array<UINT16,2> m_roadram;
optional_shared_ptr<UINT16> m_f1gpstr2_ioready;
UINT16 *m_objectram;
tilemap_t *m_tmap[3];
tilemap_t *m_tilemap[3][2][4];
int m_scrollx[3];
int m_scrolly[3];
int m_active_layers;
int m_bits_per_color_code;
int m_scroll_flag[3];
UINT16 m_active_layers;
int m_prev;
int m_armold;
@ -65,6 +58,10 @@ public:
int m_debugsprites;
int m_show_unknown;
UINT16 *m_spriteram;
UINT8 m_motor_value;
UINT8 m_io_value;
DECLARE_WRITE16_MEMBER(scudhamm_motor_command_w);
DECLARE_WRITE16_MEMBER(scudhamm_leds_w);
DECLARE_WRITE16_MEMBER(scudhamm_enable_w);
@ -75,38 +72,34 @@ public:
DECLARE_READ16_MEMBER(armchmp2_buttons_r);
DECLARE_WRITE16_MEMBER(armchmp2_leds_w);
DECLARE_WRITE16_MEMBER(bigrun_soundbank_w);
DECLARE_READ16_MEMBER(f1gpstr2_io_r);
DECLARE_WRITE16_MEMBER(f1gpstr2_io_w);
DECLARE_READ16_MEMBER(scudhamm_motor_status_r);
DECLARE_READ16_MEMBER(scudhamm_motor_pos_r);
DECLARE_READ16_MEMBER(scudhamm_analog_r);
DECLARE_WRITE16_MEMBER(cischeat_scrollram_0_w);
DECLARE_WRITE16_MEMBER(cischeat_scrollram_1_w);
DECLARE_WRITE16_MEMBER(cischeat_scrollram_2_w);
DECLARE_READ16_MEMBER(bigrun_vregs_r);
DECLARE_WRITE16_MEMBER(bigrun_vregs_w);
DECLARE_READ16_MEMBER(cischeat_vregs_r);
DECLARE_WRITE16_MEMBER(cischeat_vregs_w);
DECLARE_READ16_MEMBER(f1gpstar_vregs_r);
DECLARE_READ16_MEMBER(f1gpstr2_vregs_r);
DECLARE_READ16_MEMBER(wildplt_vregs_r);
DECLARE_WRITE16_MEMBER(f1gpstar_vregs_w);
DECLARE_WRITE16_MEMBER(f1gpstr2_vregs_w);
DECLARE_WRITE16_MEMBER(scudhamm_vregs_w);
void cischeat_set_vreg_flag(int which, int data);
DECLARE_READ16_MEMBER(bigrun_ip_select_r);
DECLARE_WRITE16_MEMBER(leds_out_w);
DECLARE_WRITE16_MEMBER(unknown_out_w);
DECLARE_WRITE16_MEMBER(motor_out_w);
DECLARE_WRITE16_MEMBER(wheel_out_w);
DECLARE_WRITE16_MEMBER(ip_select_w);
DECLARE_WRITE16_MEMBER(ip_select_plus1_w);
DECLARE_WRITE16_MEMBER(bigrun_comms_w);
DECLARE_WRITE16_MEMBER(active_layers_w);
DECLARE_READ16_MEMBER(cischeat_ip_select_r);
DECLARE_WRITE16_MEMBER(cischeat_soundlatch_w);
DECLARE_WRITE16_MEMBER(cischeat_comms_w);
DECLARE_READ16_MEMBER(f1gpstar_wheel_r);
DECLARE_READ16_MEMBER(f1gpstr2_ioready_r);
DECLARE_READ16_MEMBER(wildplt_xy_r);
DECLARE_WRITE16_MEMBER(f1gpstar_motor_w);
DECLARE_WRITE16_MEMBER(f1gpstar_soundint_w);
DECLARE_WRITE16_MEMBER(f1gpstar_comms_w);
DECLARE_WRITE16_MEMBER(f1gpstr2_io_w);
DECLARE_WRITE16_MEMBER(cischeat_soundbank_1_w);
DECLARE_WRITE16_MEMBER(cischeat_soundbank_2_w);
DECLARE_DRIVER_INIT(wildplt);
DECLARE_DRIVER_INIT(cischeat);
DECLARE_DRIVER_INIT(bigrun);
DECLARE_DRIVER_INIT(f1gpstar);
TILEMAP_MAPPER_MEMBER(cischeat_scan_8x8);
TILEMAP_MAPPER_MEMBER(cischeat_scan_16x16);
TILE_GET_INFO_MEMBER(cischeat_get_scroll_tile_info_8x8);
TILE_GET_INFO_MEMBER(cischeat_get_scroll_tile_info_16x16);
DECLARE_VIDEO_START(bigrun);
DECLARE_VIDEO_START(f1gpstar);
DECLARE_VIDEO_START(cischeat);
virtual void video_start() override;
UINT32 screen_update_bigrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_scudhamm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_cischeat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -115,8 +108,6 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(scudhamm_scanline);
TIMER_DEVICE_CALLBACK_MEMBER(armchamp2_scanline);
void prepare_shadows();
inline void scrollram_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int which);
void create_tilemaps();
void cischeat_draw_road(bitmap_ind16 &bitmap, const rectangle &cliprect, int road_num, int priority1, int priority2, int transparency);
void f1gpstar_draw_road(bitmap_ind16 &bitmap, const rectangle &cliprect, int road_num, int priority1, int priority2, int transparency);
void cischeat_draw_sprites(bitmap_ind16 &bitmap , const rectangle &cliprect, int priority1, int priority2);

View File

@ -6,17 +6,11 @@
driver by Luca Elia (l.elia@tin.it)
This file contains definitions used across multiple megasys1
and non megasys1 Jaleco games:
* Scrolling layers handling
* Code decryption handling
***************************************************************************/
#include "machine/gen_latch.h"
#include "sound/okim6295.h"
#include "video/ms1_tmap.h"
class megasys1_state : public driver_device
@ -24,9 +18,8 @@ class megasys1_state : public driver_device
public:
megasys1_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_vregs(*this, "vregs"),
m_objectram(*this, "objectram"),
m_scrollram(*this, "scrollram.%u", 0),
m_tmap(*this, "scroll%u", 0),
m_ram(*this, "ram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
@ -47,9 +40,8 @@ public:
m_io_dsw2(*this, "DSW2")
{ }
required_shared_ptr<UINT16> m_vregs;
required_shared_ptr<UINT16> m_objectram;
required_shared_ptr_array<UINT16,3> m_scrollram;
optional_device_array<megasys1_tilemap_device, 3> m_tmap;
required_shared_ptr<UINT16> m_ram;
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
@ -76,18 +68,10 @@ public:
UINT16 m_ip_latched;
UINT8 m_ignore_oki_status;
UINT16 m_protection_val;
int m_scrollx[3];
int m_scrolly[3];
int m_active_layers;
int m_bits_per_color_code;
int m_scroll_flag[3];
int m_sprite_bank;
int m_screen_flag;
int m_sprite_flag;
int m_8x8_scroll_factor[3];
int m_16x16_scroll_factor[3];
tilemap_t *m_tmap[3];
tilemap_t *m_tilemap[3][2][4];
UINT16 m_active_layers;
UINT16 m_sprite_bank;
UINT16 m_screen_flag;
UINT16 m_sprite_flag;
int m_hardware_type_z;
std::unique_ptr<UINT16[]> m_buffer_objectram;
std::unique_ptr<UINT16[]> m_buffer2_objectram;
@ -110,14 +94,16 @@ public:
DECLARE_WRITE16_MEMBER(soldamj_spriteram16_w);
DECLARE_READ16_MEMBER(stdragon_mcu_hs_r);
DECLARE_WRITE16_MEMBER(stdragon_mcu_hs_w);
DECLARE_WRITE16_MEMBER(megasys1_scrollram_0_w);
DECLARE_WRITE16_MEMBER(megasys1_scrollram_1_w);
DECLARE_WRITE16_MEMBER(megasys1_scrollram_2_w);
DECLARE_WRITE16_MEMBER(megasys1_vregs_A_w);
DECLARE_WRITE16_MEMBER(megasys1_vregs_monkelf_w);
DECLARE_READ16_MEMBER(megasys1_vregs_C_r);
DECLARE_WRITE16_MEMBER(megasys1_vregs_C_w);
DECLARE_WRITE16_MEMBER(megasys1_vregs_D_w);
DECLARE_WRITE16_MEMBER(active_layers_w);
DECLARE_WRITE16_MEMBER(sprite_bank_w);
DECLARE_READ16_MEMBER(sprite_flag_r);
DECLARE_WRITE16_MEMBER(sprite_flag_w);
DECLARE_WRITE16_MEMBER(screen_flag_w);
DECLARE_WRITE16_MEMBER(soundlatch_w);
DECLARE_WRITE16_MEMBER(soundlatch_z_w);
DECLARE_WRITE16_MEMBER(soundlatch_c_w);
DECLARE_WRITE16_MEMBER(monkelf_scroll0_w);
DECLARE_WRITE16_MEMBER(monkelf_scroll1_w);
void megasys1_set_vreg_flag(int which, int data);
DECLARE_READ8_MEMBER(oki_status_1_r);
DECLARE_READ8_MEMBER(oki_status_2_r);
@ -148,10 +134,6 @@ public:
DECLARE_DRIVER_INIT(stdragona);
DECLARE_DRIVER_INIT(stdragonb);
DECLARE_DRIVER_INIT(systemz);
TILEMAP_MAPPER_MEMBER(megasys1_scan_8x8);
TILEMAP_MAPPER_MEMBER(megasys1_scan_16x16);
TILE_GET_INFO_MEMBER(megasys1_get_scroll_tile_info_8x8);
TILE_GET_INFO_MEMBER(megasys1_get_scroll_tile_info_16x16);
DECLARE_MACHINE_RESET(megasys1);
DECLARE_VIDEO_START(megasys1);
DECLARE_PALETTE_INIT(megasys1);
@ -164,8 +146,6 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(megasys1B_scanline);
DECLARE_WRITE16_MEMBER(ms1_ram_w);
inline void scrollram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int which);
void create_tilemaps();
void megasys1_priority_create();
void mix_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void partial_clear_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 param);

View File

@ -29,14 +29,7 @@ Note: if MAME_DEBUG is defined, pressing Z or X with:
[ 3 Scrolling Layers ]
see Megasys1.c
Tile Format: Cisco Heat F1 GP Star
Colour fedc b--- ---- ---- fedc ---- ---- ----
Code ---- -a98 7654 3210 ---- ba98 7654 3210
Layer Size: May be different from Megasys1?
see ms1_tmap.cpp
[ 2 Road Layers ]
@ -87,18 +80,9 @@ Note: if MAME_DEBUG is defined, pressing Z or X with:
#endif
#define CISCHEAT_VREG_SCROLL(_n_, _dir_) m_scroll##_dir_[_n_] = new_data
#define cischeat_tmap_SET_SCROLL(_n_) \
if (m_tmap[_n_]) \
{ \
m_tmap[_n_]->set_scrollx(0, m_scrollx[_n_]); \
m_tmap[_n_]->set_scrolly(0, m_scrolly[_n_]); \
}
#define cischeat_tmap_DRAW(_n_) \
if ( (m_tmap[_n_]) && (m_active_layers & (1 << _n_) ) ) \
if ( (m_tmap[_n_]).found() && (active_layers1 & (1 << _n_) ) ) \
{ \
m_tmap[_n_]->draw(screen, bitmap, cliprect, flag, 0 ); \
flag = 0; \
@ -123,157 +107,16 @@ void cischeat_state::prepare_shadows()
m_drawmode_table[15] = DRAWMODE_NONE;
}
/**************************************************************************
Cisco Heat
**************************************************************************/
#define TILES_PER_PAGE_X (0x20)
#define TILES_PER_PAGE_Y (0x20)
#define TILES_PER_PAGE (TILES_PER_PAGE_X * TILES_PER_PAGE_Y)
inline void cischeat_state::scrollram_w(address_space &space, offs_t offset, UINT16 data, UINT16 mem_mask, int which)
void cischeat_state::video_start()
{
COMBINE_DATA(&m_scrollram[which][offset]);
if (offset < 0x40000/2 && m_tmap[which])
{
if (m_scroll_flag[which] & 0x10) /* tiles are 8x8 */
{
m_tmap[which]->mark_tile_dirty(offset);
}
else
{
m_tmap[which]->mark_tile_dirty(offset*4 + 0);
m_tmap[which]->mark_tile_dirty(offset*4 + 1);
m_tmap[which]->mark_tile_dirty(offset*4 + 2);
m_tmap[which]->mark_tile_dirty(offset*4 + 3);
}
}
}
WRITE16_MEMBER(cischeat_state::cischeat_scrollram_0_w){ scrollram_w(space, offset, data, mem_mask, 0); }
WRITE16_MEMBER(cischeat_state::cischeat_scrollram_1_w){ scrollram_w(space, offset, data, mem_mask, 1); }
WRITE16_MEMBER(cischeat_state::cischeat_scrollram_2_w){ scrollram_w(space, offset, data, mem_mask, 2); }
TILEMAP_MAPPER_MEMBER(cischeat_state::cischeat_scan_8x8)
{
return (col * TILES_PER_PAGE_Y) +
(row / TILES_PER_PAGE_Y) * TILES_PER_PAGE * (num_cols / TILES_PER_PAGE_X) +
(row % TILES_PER_PAGE_Y);
}
TILEMAP_MAPPER_MEMBER(cischeat_state::cischeat_scan_16x16)
{
return ( ((col / 2) * (TILES_PER_PAGE_Y / 2)) +
((row / 2) / (TILES_PER_PAGE_Y / 2)) * (TILES_PER_PAGE / 4) * (num_cols / TILES_PER_PAGE_X) +
((row / 2) % (TILES_PER_PAGE_Y / 2)) )*4 + (row&1) + (col&1)*2;
}
TILE_GET_INFO_MEMBER(cischeat_state::cischeat_get_scroll_tile_info_8x8)
{
int tmap = (FPTR)tilemap.user_data();
UINT16 code = m_scrollram[tmap][tile_index];
SET_TILE_INFO_MEMBER(tmap, (code & 0xfff), code >> (16 - m_bits_per_color_code), 0);
}
TILE_GET_INFO_MEMBER(cischeat_state::cischeat_get_scroll_tile_info_16x16)
{
int tmap = (FPTR)tilemap.user_data();
UINT16 code = m_scrollram[tmap][tile_index/4];
SET_TILE_INFO_MEMBER(tmap, (code & 0xfff) * 4 + (tile_index & 3), code >> (16 - m_bits_per_color_code), 0);
}
void cischeat_state::create_tilemaps()
{
int layer, i;
for (layer = 0; layer < 3; layer++)
{
/* 16x16 tilemaps */
m_tilemap[layer][0][0] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
m_tilemap[layer][0][1] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
m_tilemap[layer][0][2] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
m_tilemap[layer][0][3] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);
/* 8x8 tilemaps */
m_tilemap[layer][1][0] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
m_tilemap[layer][1][1] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
m_tilemap[layer][1][2] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
m_tilemap[layer][1][3] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(cischeat_state::cischeat_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(cischeat_state::cischeat_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);
/* set user data and transparency */
for (i = 0; i < 8; i++)
{
m_tilemap[layer][i/4][i%4]->set_user_data((void *)(FPTR)layer);
m_tilemap[layer][i/4][i%4]->set_transparent_pen(15);
}
}
}
void cischeat_state::cischeat_set_vreg_flag(int which, int data)
{
if (m_scroll_flag[which] != data)
{
m_scroll_flag[which] = data;
m_tmap[which] = m_tilemap[which][(data >> 4) & 1][data & 3];
m_tmap[which]->mark_all_dirty();
}
}
/* 32 colour codes for the tiles */
VIDEO_START_MEMBER(cischeat_state,cischeat)
{
int i;
m_spriteram = &m_ram[0x8000/2];
create_tilemaps();
m_tmap[0] = m_tilemap[0][0][0];
m_tmap[1] = m_tilemap[1][0][0];
m_tmap[2] = m_tilemap[2][0][0];
m_active_layers = 0;
for (i = 0; i < 3; i ++)
{
m_scroll_flag[i] = m_scrollx[i] = m_scrolly[i] = 0;
}
m_bits_per_color_code = 5;
prepare_shadows();
}
/**************************************************************************
F1 GrandPrix Star
**************************************************************************/
/* 16 colour codes for the tiles */
VIDEO_START_MEMBER(cischeat_state,f1gpstar)
{
VIDEO_START_CALL_MEMBER(cischeat);
m_bits_per_color_code = 4;
}
VIDEO_START_MEMBER(cischeat_state,bigrun)
{
VIDEO_START_CALL_MEMBER(f1gpstar);
m_motor_value = 0;
m_io_value = 0;
}
@ -298,187 +141,111 @@ VIDEO_START_MEMBER(cischeat_state,bigrun)
Big Run
**************************************************************************/
READ16_MEMBER(cischeat_state::bigrun_vregs_r)
READ16_MEMBER(cischeat_state::bigrun_ip_select_r)
{
switch (offset)
switch (m_ip_select & 0x3)
{
case 0x0000/2 : return ioport("IN1")->read(); // Coins
case 0x0002/2 : return ioport("IN2")->read(); // Buttons
case 0x0004/2 : return ioport("IN3")->read(); // Motor Limit Switches
case 0x0006/2 : return ioport("IN4")->read(); // DSW 1 & 2
case 0x0008/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
case 0x0010/2 :
switch (m_ip_select & 0x3)
{
case 0 : return ioport("IN6")->read(); // Driving Wheel
case 1 : return 0xffff; // Cockpit: Up / Down Position
case 2 : return 0xffff; // Cockpit: Left / Right Position?
case 3 : return ioport("PEDAL")->read(); // Accelerator (Pedal)
default: return 0xffff;
}
case 0x2200/2 : return ioport("IN5")->read(); // DSW 3 (4 bits)
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return m_vregs[offset];
case 0 : return ioport("IN6")->read(); // Driving Wheel
case 1 : return 0xffff; // Cockpit: Up / Down Position
case 2 : return 0xffff; // Cockpit: Left / Right Position?
case 3 : return ioport("PEDAL")->read(); // Accelerator (Pedal)
default: return 0xffff;
}
}
WRITE16_MEMBER(cischeat_state::bigrun_vregs_w)
WRITE16_MEMBER(cischeat_state::leds_out_w)
{
UINT16 old_data = m_vregs[offset];
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
switch (offset)
// leds
if (ACCESSING_BITS_0_7)
{
case 0x0000/2 : // leds
if (ACCESSING_BITS_0_7)
{
machine().bookkeeping().coin_counter_w(0,new_data & 0x01);
machine().bookkeeping().coin_counter_w(1,new_data & 0x02);
output().set_led_value(0,new_data & 0x10); // start button
output().set_led_value(1,new_data & 0x20); // ?
}
break;
case 0x0002/2 : // ?? 91/1/91/1 ...
break;
case 0x0004/2 : // motor (seat?)
if (ACCESSING_BITS_0_7)
output().set_led_value(2, (new_data != old_data) ? 1 : 0);
break;
case 0x0006/2 : // motor (wheel?)
break;
case 0x000a/2 : // to sound cpu
m_soundlatch->write(space,0,new_data,0xffff);
break;
case 0x000c/2 : break; // ??
case 0x0010/2 : m_ip_select = new_data; break;
case 0x0012/2 : m_ip_select = new_data+1; break; // value above + 1
case 0x2000/2+0 : CISCHEAT_VREG_SCROLL(0,x); break;
case 0x2000/2+1 : CISCHEAT_VREG_SCROLL(0,y); break;
case 0x2000/2+2 : cischeat_set_vreg_flag(0,new_data);break;
case 0x2008/2+0 : CISCHEAT_VREG_SCROLL(1,x); break;
case 0x2008/2+1 : CISCHEAT_VREG_SCROLL(1,y); break;
case 0x2008/2+2 : cischeat_set_vreg_flag(1,new_data);break;
case 0x2100/2+0 : CISCHEAT_VREG_SCROLL(2,x); break;
case 0x2100/2+1 : CISCHEAT_VREG_SCROLL(2,y); break;
case 0x2100/2+2 : cischeat_set_vreg_flag(2,new_data);break;
case 0x2108/2 : break; // ? written with 0 only
case 0x2208/2 : break; // watchdog reset
/* Not sure about this one.. */
case 0x2308/2 : m_cpu2->set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
m_cpu3->set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
m_soundcpu->set_input_line(INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
machine().bookkeeping().coin_counter_w(0, data & 0x01);
machine().bookkeeping().coin_counter_w(1, data & 0x02);
output().set_led_value(0, data & 0x10); // start button
output().set_led_value(1, data & 0x20); // ?
}
}
WRITE16_MEMBER(cischeat_state::unknown_out_w)
{
// ?? 91/1/91/1 ...
}
WRITE16_MEMBER(cischeat_state::motor_out_w)
{
// motor (seat?)
if (ACCESSING_BITS_0_7)
output().set_led_value(2, (data & 0xff) != m_motor_value ? 1 : 0);
m_motor_value = data & 0xff;
}
WRITE16_MEMBER(cischeat_state::wheel_out_w)
{
// motor (wheel?)
}
WRITE16_MEMBER(cischeat_state::ip_select_w)
{
m_ip_select = data;
}
WRITE16_MEMBER(cischeat_state::ip_select_plus1_w)
{
// value above + 1
m_ip_select = data + 1;
}
WRITE16_MEMBER(cischeat_state::bigrun_comms_w)
{
/* Not sure about this one.. */
m_cpu2->set_input_line(INPUT_LINE_RESET, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
m_cpu3->set_input_line(INPUT_LINE_RESET, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
}
WRITE16_MEMBER(cischeat_state::active_layers_w)
{
COMBINE_DATA(&m_active_layers);
}
/**************************************************************************
Cisco Heat
**************************************************************************/
READ16_MEMBER(cischeat_state::cischeat_vregs_r)
READ16_MEMBER(cischeat_state::cischeat_ip_select_r)
{
switch (offset)
switch (m_ip_select & 0x3)
{
case 0x0000/2 : return ioport("IN1")->read(); // Coins
case 0x0002/2 : return ioport("IN2")->read(); // Buttons
case 0x0004/2 : return ioport("IN3")->read(); // Motor Limit Switches
case 0x0006/2 : return ioport("IN4")->read(); // DSW 1 & 2
case 0x0010/2 :
switch (m_ip_select & 0x3)
{
case 0 : return ioport("IN6")->read(); // Driving Wheel
case 1 : return ~0; // Cockpit: Up / Down Position?
case 2 : return ~0; // Cockpit: Left / Right Position?
default: return ~0;
}
case 0x2200/2 : return ioport("IN5")->read(); // DSW 3 (4 bits)
case 0x2300/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return m_vregs[offset];
case 0 : return ioport("IN6")->read(); // Driving Wheel
case 1 : return ~0; // Cockpit: Up / Down Position?
case 2 : return ~0; // Cockpit: Left / Right Position?
default: return ~0;
}
}
WRITE16_MEMBER(cischeat_state::cischeat_vregs_w)
WRITE16_MEMBER(cischeat_state::cischeat_soundlatch_w)
{
UINT16 old_data = m_vregs[offset];
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
/* Sound CPU: reads latch during int 4, and stores command */
m_soundlatch->write(space, 0, data, mem_mask);
m_soundcpu->set_input_line(4, HOLD_LINE);
}
switch (offset)
{
case 0x0000/2 : // leds
if (ACCESSING_BITS_0_7)
{
machine().bookkeeping().coin_counter_w(0,new_data & 0x01);
machine().bookkeeping().coin_counter_w(1,new_data & 0x02);
output().set_led_value(0,new_data & 0x10); // start button
output().set_led_value(1,new_data & 0x20); // ?
}
break;
case 0x0002/2 : // ?? 91/1/91/1 ...
break;
case 0x0004/2 : // motor (seat?)
if (ACCESSING_BITS_0_7)
output().set_led_value(2, (new_data != old_data) ? 1 : 0);
break;
case 0x0006/2 : // motor (wheel?)
break;
case 0x0010/2 : m_ip_select = new_data; break;
case 0x0012/2 : break; // value above + 1
case 0x2000/2+0 : CISCHEAT_VREG_SCROLL(0,x); break;
case 0x2000/2+1 : CISCHEAT_VREG_SCROLL(0,y); break;
case 0x2000/2+2 : cischeat_set_vreg_flag(0,new_data);break;
case 0x2008/2+0 : CISCHEAT_VREG_SCROLL(1,x); break;
case 0x2008/2+1 : CISCHEAT_VREG_SCROLL(1,y); break;
case 0x2008/2+2 : cischeat_set_vreg_flag(1,new_data);break;
case 0x2100/2+0 : CISCHEAT_VREG_SCROLL(2,x); break;
case 0x2100/2+1 : CISCHEAT_VREG_SCROLL(2,y); break;
case 0x2100/2+2 : cischeat_set_vreg_flag(2,new_data);break;
case 0x2108/2 : break; // ? written with 0 only
case 0x2208/2 : break; // watchdog reset
case 0x2300/2 : /* Sound CPU: reads latch during int 4, and stores command */
m_soundlatch->write(space, 0, new_data, 0xffff);
m_soundcpu->set_input_line(4, HOLD_LINE);
break;
/* Not sure about this one.. */
case 0x2308/2 : m_cpu2->set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
m_cpu3->set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
m_soundcpu->set_input_line(INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
}
WRITE16_MEMBER(cischeat_state::cischeat_comms_w)
{
/* Not sure about this one.. */
m_cpu2->set_input_line(INPUT_LINE_RESET, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
m_cpu3->set_input_line(INPUT_LINE_RESET, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
}
@ -487,185 +254,69 @@ WRITE16_MEMBER(cischeat_state::cischeat_vregs_w)
F1 GrandPrix Star
**************************************************************************/
READ16_MEMBER(cischeat_state::f1gpstar_vregs_r)
READ16_MEMBER(cischeat_state::f1gpstar_wheel_r)
{
switch (offset)
{
case 0x0000/2 : return ioport("IN1")->read(); // DSW 1 & 2
// case 0x0002/2 : return 0xFFFF;
case 0x0004/2 : return ioport("IN2")->read(); // Buttons
case 0x0006/2 : return ioport("IN3")->read(); // ? Read at boot only
case 0x0008/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
case 0x000c/2 : return ioport("IN4")->read(); // DSW 3
case 0x0010/2 : // Accel + Driving Wheel
return (ioport("PEDAL")->read() & 0xff) + ((ioport("IN5")->read() & 0xff)<<8);
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return m_vregs[offset];
}
return (ioport("PEDAL")->read() & 0xff) + ((ioport("IN5")->read() & 0xff)<<8);
}
READ16_MEMBER(cischeat_state::f1gpstr2_vregs_r)
READ16_MEMBER(cischeat_state::f1gpstr2_ioready_r)
{
if ((offset >= 0x1000/2) && (offset < 0x2000/2))
return m_vregs[offset];
switch (offset)
{
case 0x0018/2 :
return (m_f1gpstr2_ioready[0]&1) ? 0xff : 0xf0;
default:
return f1gpstar_vregs_r(space,offset,mem_mask);
}
return (m_f1gpstr2_ioready[0]&1) ? 0xff : 0xf0;
}
/**************************************************************************
Wild Pilot
**************************************************************************/
READ16_MEMBER(cischeat_state::wildplt_vregs_r)
READ16_MEMBER(cischeat_state::wildplt_xy_r)
{
if ((offset >= 0x1000/2) && (offset < 0x2000/2))
return m_vregs[offset];
// X, Y
return ioport("IN2")->read() | (ioport("IN3")->read()<<8);
}
switch (offset)
WRITE16_MEMBER(cischeat_state::f1gpstar_motor_w)
{
// "shudder" motors, leds
if (ACCESSING_BITS_0_7)
{
case 0x0000/2 : return ioport("IN0")->read(); // DSW 1 & 2
case 0x0004/2 : return ioport("IN1")->read(); // Buttons
case 0x0008/2 : return m_soundlatch2->read(space,0,0xffff); // From sound cpu
case 0x0010/2 : // X, Y
return ioport("IN2")->read() | (ioport("IN3")->read()<<8);
case 0x0018/2 :
return (m_f1gpstr2_ioready[0]&1) ? 0xff : 0xf0;
default: SHOW_READ_ERROR("vreg %04X read!",offset*2);
return m_vregs[offset];
machine().bookkeeping().coin_counter_w(0, data & 0x01);
machine().bookkeeping().coin_counter_w(1, data & 0x02);
output().set_led_value(0, data & 0x04); // start button
output().set_led_value(1, data & 0x20); // ?
// wheel | seat motor
output().set_led_value(2, ((data >> 3) | (data >> 4)) & 1 );
}
}
WRITE16_MEMBER(cischeat_state::f1gpstar_vregs_w)
WRITE16_MEMBER(cischeat_state::f1gpstar_soundint_w)
{
// UINT16 old_data = m_vregs[offset];
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
switch (offset)
{
/*
CPU #0 PC 00234A : Warning, vreg 0000 <- 0000
CPU #0 PC 002350 : Warning, vreg 0002 <- 0000
CPU #0 PC 00235C : Warning, vreg 0006 <- 0000
*/
// "shudder" motors, leds
case 0x0004/2 :
if (ACCESSING_BITS_0_7)
{
machine().bookkeeping().coin_counter_w(0,new_data & 0x01);
machine().bookkeeping().coin_counter_w(1,new_data & 0x02);
output().set_led_value(0,new_data & 0x04); // start button
output().set_led_value(1,new_data & 0x20); // ?
// wheel | seat motor
output().set_led_value(2, ((new_data >> 3) | (new_data >> 4)) & 1 );
}
break;
case 0x0014/2 : break;
/* Usually written in sequence, but not always */
case 0x0008/2 : m_soundlatch->write(space, 0, new_data, 0xffff); break;
case 0x0018/2 : m_soundcpu->set_input_line(4, HOLD_LINE); break;
case 0x0010/2 : break;
case 0x2000/2+0 : CISCHEAT_VREG_SCROLL(0,x); break;
case 0x2000/2+1 : CISCHEAT_VREG_SCROLL(0,y); break;
case 0x2000/2+2 : cischeat_set_vreg_flag(0,new_data);break;
case 0x2008/2+0 : CISCHEAT_VREG_SCROLL(1,x); break;
case 0x2008/2+1 : CISCHEAT_VREG_SCROLL(1,y); break;
case 0x2008/2+2 : cischeat_set_vreg_flag(1,new_data);break;
case 0x2100/2+0 : CISCHEAT_VREG_SCROLL(2,x); break;
case 0x2100/2+1 : CISCHEAT_VREG_SCROLL(2,y); break;
case 0x2100/2+2 : cischeat_set_vreg_flag(2,new_data);break;
case 0x2108/2 : break; // ? written with 0 only
case 0x2208/2 : break; // watchdog reset
/* Not sure about this one. Values: $10 then 0, $7 then 0 */
case 0x2308/2 : m_cpu2->set_input_line(INPUT_LINE_RESET, (new_data & 1) ? ASSERT_LINE : CLEAR_LINE );
m_cpu3->set_input_line(INPUT_LINE_RESET, (new_data & 2) ? ASSERT_LINE : CLEAR_LINE );
m_soundcpu->set_input_line(INPUT_LINE_RESET, (new_data & 4) ? ASSERT_LINE : CLEAR_LINE );
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
}
/* $80008 and $80018 usually written in sequence, but not always */
m_soundcpu->set_input_line(4, HOLD_LINE);
}
WRITE16_MEMBER(cischeat_state::f1gpstr2_vregs_w)
WRITE16_MEMBER(cischeat_state::f1gpstar_comms_w)
{
UINT16 old_data = m_vregs[offset];
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
if ((offset >= 0x1000/2) && (offset < 0x2000/2))
return;
switch (offset)
{
case 0x0000/2 :
if (ACCESSING_BITS_0_7)
{
if((old_data & 4) && ((new_data & 4) == 0))
m_cpu5->set_input_line(4, HOLD_LINE);
if((old_data & 2) && ((new_data & 2) == 0))
m_cpu5->set_input_line(2, HOLD_LINE);
}
break;
default:
f1gpstar_vregs_w(space, offset, data, mem_mask);
break;
}
/* Not sure about this one. Values: $10 then 0, $7 then 0 */
m_cpu2->set_input_line(INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
m_cpu3->set_input_line(INPUT_LINE_RESET, (data & 2) ? ASSERT_LINE : CLEAR_LINE);
m_soundcpu->set_input_line(INPUT_LINE_RESET, (data & 4) ? ASSERT_LINE : CLEAR_LINE);
}
/**************************************************************************
Scud Hammer
**************************************************************************/
WRITE16_MEMBER(cischeat_state::scudhamm_vregs_w)
WRITE16_MEMBER(cischeat_state::f1gpstr2_io_w)
{
// int old_data = m_vregs[offset];
int new_data = COMBINE_DATA(&m_vregs[offset]);
switch (offset)
if (ACCESSING_BITS_0_7)
{
case 0x000/2+0 : CISCHEAT_VREG_SCROLL(0,x); break;
case 0x000/2+1 : CISCHEAT_VREG_SCROLL(0,y); break;
case 0x000/2+2 : cischeat_set_vreg_flag(0,new_data);break;
// UNUSED LAYER
case 0x008/2+0 :
case 0x008/2+1 :
case 0x008/2+2 :
break;
case 0x100/2+0 : CISCHEAT_VREG_SCROLL(2,x); break;
case 0x100/2+1 : CISCHEAT_VREG_SCROLL(2,y); break;
case 0x100/2+2 : cischeat_set_vreg_flag(2,new_data);break;
case 0x208/2 : m_watchdog->reset_w(space,0,0); break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
if ((m_io_value & 4) && ((data & 4) == 0))
m_cpu5->set_input_line(4, HOLD_LINE);
if ((m_io_value & 2) && ((data & 2) == 0))
m_cpu5->set_input_line(2, HOLD_LINE);
m_io_value = data & 0xff;
}
}
@ -714,7 +365,7 @@ void cischeat_state::cischeat_draw_road(bitmap_ind16 &bitmap, const rectangle &c
int min_priority, max_priority;
rectangle rect = cliprect;
gfx_element *gfx = m_gfxdecode->gfx((road_num & 1)?5:4);
gfx_element *gfx = m_gfxdecode->gfx((road_num & 1) ? 2 : 1);
UINT16 *roadram = m_roadram[road_num & 1];
@ -804,7 +455,7 @@ void cischeat_state::f1gpstar_draw_road(bitmap_ind16 &bitmap, const rectangle &c
int min_priority, max_priority;
rectangle rect = cliprect;
gfx_element *gfx = m_gfxdecode->gfx((road_num & 1)?5:4);
gfx_element *gfx = m_gfxdecode->gfx((road_num & 1) ? 2 : 1);
UINT16 *roadram = m_roadram[road_num & 1];
@ -1013,7 +664,7 @@ if ( (m_debugsprites) && ( ((attr & 0x0300)>>8) != (m_debugsprites-1) ) ) { cont
{
for (x = xstart; x != xend; x += xinc)
{
m_gfxdecode->gfx(3)->zoom_transtable(bitmap,cliprect,code++,color,flipx,flipy,
m_gfxdecode->gfx(0)->zoom_transtable(bitmap,cliprect,code++,color,flipx,flipy,
(sx + x * xdim) / 0x10000, (sy + y * ydim) / 0x10000,
xscale, yscale, m_drawmode_table);
}
@ -1164,7 +815,7 @@ if ( (m_debugsprites) && ( ((attr & 0x0300)>>8) != (m_debugsprites-1) ) ) { cont
{
for (x = xstart; x != xend; x += xinc)
{
m_gfxdecode->gfx(3)->zoom_transtable(bitmap,cliprect,code++,color,flipx,flipy,
m_gfxdecode->gfx(0)->zoom_transtable(bitmap,cliprect,code++,color,flipx,flipy,
(sx + x * xdim) / 0x10000, (sy + y * ydim) / 0x10000,
xscale, yscale, m_drawmode_table);
}
@ -1206,15 +857,12 @@ if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed
if (machine().input().code_pressed(KEYCODE_R)) { msk |= 0x10;} \
if (machine().input().code_pressed(KEYCODE_T)) { msk |= 0x20;} \
\
if (msk != 0) m_active_layers &= msk; \
if (msk != 0) active_layers1 &= msk; \
} \
\
{ \
if ( machine().input().code_pressed(KEYCODE_Z) && machine().input().code_pressed_once(KEYCODE_U) ) \
m_show_unknown ^= 1; \
if (m_show_unknown) \
popmessage("0:%04X 2:%04X 4:%04X 6:%04X c:%04X", \
m_vregs[0],m_vregs[1],m_vregs[2],m_vregs[3],m_vregs[0xc/2] ); \
}
#else
#define CISCHEAT_LAYERSCTL
@ -1231,28 +879,22 @@ UINT32 cischeat_state::screen_update_bigrun(screen_device &screen, bitmap_ind16
#ifdef MAME_DEBUG
/* FAKE Videoreg */
m_active_layers = m_vregs[0x2400/2];
if (m_active_layers == 0) m_active_layers = 0x3f;
#else
m_active_layers = 0x3f;
#endif
active_layers1 = m_active_layers;
if (active_layers1 == 0) active_layers1 = 0x3f;
#else
active_layers1 = 0x3f;
#endif
#ifdef MAME_DEBUG
CISCHEAT_LAYERSCTRL
#endif
cischeat_tmap_SET_SCROLL(0)
cischeat_tmap_SET_SCROLL(1)
cischeat_tmap_SET_SCROLL(2)
bitmap.fill(0, cliprect);
for (i = 7; i >= 4; i--)
{ /* bitmap, road, min_priority, max_priority, transparency */
if (m_active_layers & 0x10) cischeat_draw_road(bitmap,cliprect,0,i,i,FALSE);
if (m_active_layers & 0x20) cischeat_draw_road(bitmap,cliprect,1,i,i,TRUE);
if (active_layers1 & 0x10) cischeat_draw_road(bitmap,cliprect,0,i,i,FALSE);
if (active_layers1 & 0x20) cischeat_draw_road(bitmap,cliprect,1,i,i,TRUE);
}
flag = 0;
@ -1261,15 +903,14 @@ UINT32 cischeat_state::screen_update_bigrun(screen_device &screen, bitmap_ind16
for (i = 3; i >= 0; i--)
{ /* bitmap, road, min_priority, max_priority, transparency */
if (m_active_layers & 0x10) cischeat_draw_road(bitmap,cliprect,0,i,i,TRUE);
if (m_active_layers & 0x20) cischeat_draw_road(bitmap,cliprect,1,i,i,TRUE);
if (active_layers1 & 0x10) cischeat_draw_road(bitmap,cliprect,0,i,i,TRUE);
if (active_layers1 & 0x20) cischeat_draw_road(bitmap,cliprect,1,i,i,TRUE);
}
if (m_active_layers & 0x08) bigrun_draw_sprites(bitmap,cliprect,15,0);
if (active_layers1 & 0x08) bigrun_draw_sprites(bitmap,cliprect,15,0);
cischeat_tmap_DRAW(2)
m_active_layers = active_layers1;
return 0;
}
@ -1284,47 +925,39 @@ UINT32 cischeat_state::screen_update_cischeat(screen_device &screen, bitmap_ind1
#ifdef MAME_DEBUG
/* FAKE Videoreg */
m_active_layers = m_vregs[0x2400/2];
if (m_active_layers == 0) m_active_layers = 0x3f;
#else
m_active_layers = 0x3f;
#endif
active_layers1 = m_active_layers;
if (active_layers1 == 0) active_layers1 = 0x3f;
#else
active_layers1 = 0x3f;
#endif
#ifdef MAME_DEBUG
CISCHEAT_LAYERSCTRL
#endif
cischeat_tmap_SET_SCROLL(0)
cischeat_tmap_SET_SCROLL(1)
cischeat_tmap_SET_SCROLL(2)
bitmap.fill(0, cliprect);
/* bitmap, road, priority, transparency */
if (m_active_layers & 0x10) cischeat_draw_road(bitmap,cliprect,0,7,5,FALSE);
if (m_active_layers & 0x20) cischeat_draw_road(bitmap,cliprect,1,7,5,TRUE);
if (active_layers1 & 0x10) cischeat_draw_road(bitmap,cliprect,0,7,5,FALSE);
if (active_layers1 & 0x20) cischeat_draw_road(bitmap,cliprect,1,7,5,TRUE);
flag = 0;
cischeat_tmap_DRAW(0)
// else bitmap.fill(0, cliprect);
cischeat_tmap_DRAW(1)
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,15,3);
if (m_active_layers & 0x10) cischeat_draw_road(bitmap,cliprect,0,4,1,TRUE);
if (m_active_layers & 0x20) cischeat_draw_road(bitmap,cliprect,1,4,1,TRUE);
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,2,2);
if (m_active_layers & 0x10) cischeat_draw_road(bitmap,cliprect,0,0,0,TRUE);
if (m_active_layers & 0x20) cischeat_draw_road(bitmap,cliprect,1,0,0,TRUE);
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,1,0);
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,15,3);
if (active_layers1 & 0x10) cischeat_draw_road(bitmap,cliprect,0,4,1,TRUE);
if (active_layers1 & 0x20) cischeat_draw_road(bitmap,cliprect,1,4,1,TRUE);
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,2,2);
if (active_layers1 & 0x10) cischeat_draw_road(bitmap,cliprect,0,0,0,TRUE);
if (active_layers1 & 0x20) cischeat_draw_road(bitmap,cliprect,1,0,0,TRUE);
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,1,0);
cischeat_tmap_DRAW(2)
/* for the map screen */
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,0+16,0+16);
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,0+16,0+16);
m_active_layers = active_layers1;
return 0;
}
@ -1340,29 +973,23 @@ UINT32 cischeat_state::screen_update_f1gpstar(screen_device &screen, bitmap_ind1
#ifdef MAME_DEBUG
/* FAKE Videoreg */
m_active_layers = m_vregs[0x2400/2];
if (m_active_layers == 0) m_active_layers = 0x3f;
#else
m_active_layers = 0x3f;
#endif
active_layers1 = m_active_layers;
if (active_layers1 == 0) active_layers1 = 0x3f;
#else
active_layers1 = 0x3f;
#endif
#ifdef MAME_DEBUG
CISCHEAT_LAYERSCTRL
#endif
cischeat_tmap_SET_SCROLL(0);
cischeat_tmap_SET_SCROLL(1);
cischeat_tmap_SET_SCROLL(2);
bitmap.fill(0, cliprect);
/* 1: clouds 5, grad 7, road 0 2: clouds 5, grad 7, road 0, tunnel roof 0 */
/* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */
if (m_active_layers & 0x20) f1gpstar_draw_road(bitmap,cliprect,1,6,7,TRUE);
if (m_active_layers & 0x10) f1gpstar_draw_road(bitmap,cliprect,0,6,7,TRUE);
if (active_layers1 & 0x20) f1gpstar_draw_road(bitmap,cliprect,1,6,7,TRUE);
if (active_layers1 & 0x10) f1gpstar_draw_road(bitmap,cliprect,0,6,7,TRUE);
flag = 0;
cischeat_tmap_DRAW(0)
@ -1370,21 +997,19 @@ UINT32 cischeat_state::screen_update_f1gpstar(screen_device &screen, bitmap_ind1
cischeat_tmap_DRAW(1)
/* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */
if (m_active_layers & 0x20) f1gpstar_draw_road(bitmap,cliprect,1,1,5,TRUE);
if (m_active_layers & 0x10) f1gpstar_draw_road(bitmap,cliprect,0,1,5,TRUE);
if (active_layers1 & 0x20) f1gpstar_draw_road(bitmap,cliprect,1,1,5,TRUE);
if (active_layers1 & 0x10) f1gpstar_draw_road(bitmap,cliprect,0,1,5,TRUE);
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,15,2);
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,15,2);
/* road 1!! 0!! */ /* bitmap, road, min_priority, max_priority, transparency */
if (m_active_layers & 0x20) f1gpstar_draw_road(bitmap,cliprect,1,0,0,TRUE);
if (m_active_layers & 0x10) f1gpstar_draw_road(bitmap,cliprect,0,0,0,TRUE);
if (active_layers1 & 0x20) f1gpstar_draw_road(bitmap,cliprect,1,0,0,TRUE);
if (active_layers1 & 0x10) f1gpstar_draw_road(bitmap,cliprect,0,0,0,TRUE);
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,1,1);
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,1,1);
cischeat_tmap_DRAW(2)
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,0,0);
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,0,0);
m_active_layers = active_layers1;
return 0;
}
@ -1396,24 +1021,12 @@ UINT32 cischeat_state::screen_update_f1gpstar(screen_device &screen, bitmap_ind1
UINT32 cischeat_state::screen_update_scudhamm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int active_layers1, flag;
active_layers1 = m_active_layers;
m_active_layers = 0x0d;
int active_layers1 = 0x0d;
#ifdef MAME_DEBUG
m_debugsprites = 0;
if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) )
{
int msk = 0;
if (machine().input().code_pressed(KEYCODE_Q)) { msk |= 0x1;}
if (machine().input().code_pressed(KEYCODE_W)) { msk |= 0x2;}
if (machine().input().code_pressed(KEYCODE_E)) { msk |= 0x4;}
if (machine().input().code_pressed(KEYCODE_A)) { msk |= 0x8; m_debugsprites = 1;}
if (machine().input().code_pressed(KEYCODE_S)) { msk |= 0x8; m_debugsprites = 2;}
if (machine().input().code_pressed(KEYCODE_D)) { msk |= 0x8; m_debugsprites = 3;}
if (machine().input().code_pressed(KEYCODE_F)) { msk |= 0x8; m_debugsprites = 4;}
if (msk != 0) m_active_layers &= msk;
#if 1
{
address_space &space = m_maincpu->space(AS_PROGRAM);
@ -1438,17 +1051,12 @@ if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed
}
#endif
cischeat_tmap_SET_SCROLL(0)
cischeat_tmap_SET_SCROLL(2)
bitmap.fill(0, cliprect);
flag = 0;
cischeat_tmap_DRAW(0)
if (active_layers1 & 0x01) m_tmap[0]->draw(screen, bitmap, cliprect, 0, 0);
// no layer 1
if (m_active_layers & 0x08) cischeat_draw_sprites(bitmap,cliprect,0,15);
cischeat_tmap_DRAW(2)
if (active_layers1 & 0x08) cischeat_draw_sprites(bitmap,cliprect,0,15);
if (active_layers1 & 0x04) m_tmap[2]->draw(screen, bitmap, cliprect, 0, 0);
m_active_layers = active_layers1;
return 0;
}

View File

@ -196,33 +196,10 @@ actual code sent to the hardware.
#include "emu.h"
#include "includes/megasys1.h"
#ifdef MAME_DEBUG
#define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\
{ \
popmessage(_format_,_offset_,_data_);\
logerror("CPU #0 PC %06X : Warning, ",space.device().safe_pc()); \
logerror(_format_,_offset_,_data_);\
logerror("\n");\
}
#else
#define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\
{\
logerror("CPU #0 PC %06X : Warning, ",space.device().safe_pc()); \
logerror(_format_,_offset_,_data_); \
logerror("\n");\
}
#endif
VIDEO_START_MEMBER(megasys1_state,megasys1)
{
int i;
m_spriteram = &m_ram[0x8000/2];
m_buffer_objectram = std::make_unique<UINT16[]>(0x2000);
@ -230,47 +207,8 @@ VIDEO_START_MEMBER(megasys1_state,megasys1)
m_buffer2_objectram = std::make_unique<UINT16[]>(0x2000);
m_buffer2_spriteram16 = std::make_unique<UINT16[]>(0x2000);
create_tilemaps();
m_tmap[0] = m_tilemap[0][0][0];
m_tmap[1] = m_tilemap[1][0][0];
m_tmap[2] = m_tilemap[2][0][0];
m_active_layers = m_sprite_bank = m_screen_flag = m_sprite_flag = 0;
for (i = 0; i < 3; i ++)
{
m_scroll_flag[i] = m_scrollx[i] = m_scrolly[i] = 0;
}
m_bits_per_color_code = 4;
/*
The tile code of a specific layer is multiplied for a constant
depending on the tile mode (8x8 or 16x16)
The most reasonable arrangement seems a 1:1 mapping (meaning we
must multiply by 4 the tile code in 16x16 mode, since we decode
the graphics like 8x8)
However, this is probably a game specific thing, as Soldam uses
layer 1 in both modes, and even with 8x8 tiles the tile code must
be multiplied by 4! (for the High Score table)
AFAIK, the other games use a layer in one mode only (always 8x8 or
16x16) so it could be that the multiplication factor is constant
for each layer and hardwired to 1x or 4x for both tile sizes
*/
m_8x8_scroll_factor[0] = 1; m_16x16_scroll_factor[0] = 4;
m_8x8_scroll_factor[1] = 1; m_16x16_scroll_factor[1] = 4;
m_8x8_scroll_factor[2] = 1; m_16x16_scroll_factor[2] = 4;
if (strcmp(machine().system().name, "soldam") == 0 ||
strcmp(machine().system().name, "soldamj") == 0)
{
m_8x8_scroll_factor[1] = 4; m_16x16_scroll_factor[1] = 4;
}
m_hardware_type_z = 0;
if (strcmp(machine().system().name, "lomakai") == 0 ||
strcmp(machine().system().name, "makaiden") == 0)
@ -279,45 +217,6 @@ VIDEO_START_MEMBER(megasys1_state,megasys1)
m_screen->register_screen_bitmap(m_sprite_buffer_bitmap);
}
/***************************************************************************
Layers declarations:
* Read and write handlers for the layer
* Callbacks for the TileMap code
***************************************************************************/
#define TILES_PER_PAGE_X (0x20)
#define TILES_PER_PAGE_Y (0x20)
#define TILES_PER_PAGE (TILES_PER_PAGE_X * TILES_PER_PAGE_Y)
inline void megasys1_state::scrollram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int which)
{
COMBINE_DATA(&m_scrollram[which][offset]);
if (offset < 0x40000/2 && m_tmap[which])
{
if (m_scroll_flag[which] & 0x10) /* tiles are 8x8 */
{
m_tmap[which]->mark_tile_dirty(offset );
}
else
{
m_tmap[which]->mark_tile_dirty(offset*4 + 0);
m_tmap[which]->mark_tile_dirty(offset*4 + 1);
m_tmap[which]->mark_tile_dirty(offset*4 + 2);
m_tmap[which]->mark_tile_dirty(offset*4 + 3);
}
}
}
WRITE16_MEMBER(megasys1_state::megasys1_scrollram_0_w){ scrollram_w(offset, data, mem_mask, 0); }
WRITE16_MEMBER(megasys1_state::megasys1_scrollram_1_w){ scrollram_w(offset, data, mem_mask, 1); }
WRITE16_MEMBER(megasys1_state::megasys1_scrollram_2_w){ scrollram_w(offset, data, mem_mask, 2); }
/***************************************************************************
Video registers access
@ -325,277 +224,76 @@ WRITE16_MEMBER(megasys1_state::megasys1_scrollram_2_w){ scrollram_w(offset, data
***************************************************************************/
/* Tilemap Size (PagesX x PagesY)
Reg. Value 16 8 <- Tile Size
0 16 x 2 8 x 1
1 8 x 4 4 x 2
2 4 x 8 4 x 2
3 2 x 16 2 x 4
*/
TILEMAP_MAPPER_MEMBER(megasys1_state::megasys1_scan_8x8)
WRITE16_MEMBER(megasys1_state::active_layers_w)
{
return (col * TILES_PER_PAGE_Y) +
(row / TILES_PER_PAGE_Y) * TILES_PER_PAGE * (num_cols / TILES_PER_PAGE_X) +
(row % TILES_PER_PAGE_Y);
COMBINE_DATA(&m_active_layers);
m_screen->update_partial(m_screen->vpos());
}
TILEMAP_MAPPER_MEMBER(megasys1_state::megasys1_scan_16x16)
WRITE16_MEMBER(megasys1_state::sprite_bank_w)
{
return ( ((col / 2) * (TILES_PER_PAGE_Y / 2)) +
((row / 2) / (TILES_PER_PAGE_Y / 2)) * (TILES_PER_PAGE / 4) * (num_cols / TILES_PER_PAGE_X) +
((row / 2) % (TILES_PER_PAGE_Y / 2)) )*4 + (row&1) + (col&1)*2;
COMBINE_DATA(&m_sprite_bank);
}
TILE_GET_INFO_MEMBER(megasys1_state::megasys1_get_scroll_tile_info_8x8)
READ16_MEMBER(megasys1_state::sprite_flag_r)
{
int tmap = (FPTR)tilemap.user_data();
UINT16 code = m_scrollram[tmap][tile_index];
SET_TILE_INFO_MEMBER(tmap, (code & 0xfff) * m_8x8_scroll_factor[tmap], code >> (16 - m_bits_per_color_code), 0);
return m_sprite_flag;
}
TILE_GET_INFO_MEMBER(megasys1_state::megasys1_get_scroll_tile_info_16x16)
WRITE16_MEMBER(megasys1_state::sprite_flag_w)
{
int tmap = (FPTR)tilemap.user_data();
UINT16 code = m_scrollram[tmap][tile_index/4];
SET_TILE_INFO_MEMBER(tmap, (code & 0xfff) * m_16x16_scroll_factor[tmap] + (tile_index & 3), code >> (16 - m_bits_per_color_code), 0);
COMBINE_DATA(&m_sprite_flag);
}
void megasys1_state::create_tilemaps()
WRITE16_MEMBER(megasys1_state::screen_flag_w)
{
int layer, i;
COMBINE_DATA(&m_screen_flag);
for (layer = 0; layer < 3; layer++)
if (m_audiocpu.found())
{
/* 16x16 tilemaps */
m_tilemap[layer][0][0] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
m_tilemap[layer][0][1] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
m_tilemap[layer][0][2] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
m_tilemap[layer][0][3] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_16x16),this),
8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);
/* 8x8 tilemaps */
m_tilemap[layer][1][0] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
m_tilemap[layer][1][1] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
m_tilemap[layer][1][2] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
m_tilemap[layer][1][3] = &machine().tilemap().create(
*m_gfxdecode, tilemap_get_info_delegate(FUNC(megasys1_state::megasys1_get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_state::megasys1_scan_8x8),this),
8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);
/* set user data and transparency */
for (i = 0; i < 8; i++)
{
m_tilemap[layer][i/4][i%4]->set_user_data((void *)(FPTR)layer);
m_tilemap[layer][i/4][i%4]->set_transparent_pen(15);
}
if (m_screen_flag & 0x10)
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
else
m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
}
void megasys1_state::megasys1_set_vreg_flag(int which, int data)
WRITE16_MEMBER(megasys1_state::soundlatch_w)
{
if (m_scroll_flag[which] != data)
{
m_scroll_flag[which] = data;
m_tmap[which] = m_tilemap[which][(data >> 4) & 1][data & 3];
m_tmap[which]->mark_all_dirty();
}
m_soundlatch->write(space, 0, data, mem_mask);
m_audiocpu->set_input_line(4, HOLD_LINE);
}
/* Used by MS1-A/Z, B */
WRITE16_MEMBER(megasys1_state::megasys1_vregs_A_w)
WRITE16_MEMBER(megasys1_state::soundlatch_z_w)
{
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
if(((offset*2) & 0x300) == 0)
m_screen->update_partial(m_screen->vpos());
switch (offset)
{
case 0x000/2 : m_active_layers = new_data; break;
case 0x008/2+0 : m_scrollx[2] = new_data; break;
case 0x008/2+1 : m_scrolly[2] = new_data; break;
case 0x008/2+2 : megasys1_set_vreg_flag(2, new_data); break;
case 0x200/2+0 : m_scrollx[0] = new_data; break;
case 0x200/2+1 : m_scrolly[0] = new_data; break;
case 0x200/2+2 : megasys1_set_vreg_flag(0, new_data); break;
case 0x208/2+0 : m_scrollx[1] = new_data; break;
case 0x208/2+1 : m_scrolly[1] = new_data; break;
case 0x208/2+2 : megasys1_set_vreg_flag(1, new_data); break;
case 0x100/2 : m_sprite_flag = new_data; break;
case 0x300/2 : m_screen_flag = new_data;
if (m_audiocpu)
{
if (new_data & 0x10)
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
else
m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
break;
case 0x308/2 : if (!m_hardware_type_z)
{
m_soundlatch->write(space,0,new_data,0xffff);
m_audiocpu->set_input_line(4, HOLD_LINE);
}
else
{
m_soundlatch_z->write(space,0,new_data&0xff);
m_audiocpu->set_input_line(5, HOLD_LINE);
}
break;
default : SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
}
m_soundlatch_z->write(space, 0, data & 0xff);
m_audiocpu->set_input_line(5, HOLD_LINE);
}
/* Used by monkelf */
WRITE16_MEMBER(megasys1_state::megasys1_vregs_monkelf_w)
WRITE16_MEMBER(megasys1_state::soundlatch_c_w)
{
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
switch (offset)
{
case 0x000/2 : m_active_layers = new_data; break;
case 0x008/2+0 : m_scrollx[2] = new_data; break;
case 0x008/2+1 : m_scrolly[2] = new_data; break;
case 0x008/2+2 : megasys1_set_vreg_flag(2, new_data); break;
// code in routine $280 does this. protection?
case 0x200/2+0 : m_scrollx[0] = new_data - (((new_data & 0x0f) > 0x0d) ? 0x10 : 0); break;
case 0x200/2+1 : m_scrolly[0] = new_data; break;
case 0x200/2+2 : megasys1_set_vreg_flag(0, new_data); break;
// code in routine $280 does this. protection?
case 0x208/2+0 : m_scrollx[1] = new_data - (((new_data & 0x0f) > 0x0b) ? 0x10 : 0); break;
case 0x208/2+1 : m_scrolly[1] = new_data; break;
case 0x208/2+2 : megasys1_set_vreg_flag(1, new_data); break;
case 0x100/2 : m_sprite_flag = new_data; break;
case 0x300/2 : m_screen_flag = new_data;
if (m_audiocpu)
{
if (new_data & 0x10)
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
else
m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
break;
case 0x308/2 : m_soundlatch->write(space,0,new_data,0xffff);
m_audiocpu->set_input_line(4, HOLD_LINE);
break;
default : SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
}
// Cybattler reads sound latch on irq 2
m_soundlatch->write(space, 0, data, mem_mask);
m_audiocpu->set_input_line(2, HOLD_LINE);
}
/* Used by MS1-C only */
READ16_MEMBER(megasys1_state::megasys1_vregs_C_r)
WRITE16_MEMBER(megasys1_state::monkelf_scroll0_w)
{
switch (offset)
{
case 0x8000/2: return m_soundlatch2->read(space,0,0xffff);
default: return m_vregs[offset];
}
// code in routine $280 does this. protection?
if (offset == 0)
data = data - (((data & 0x0f) > 0x0d) ? 0x10 : 0);
m_tmap[0]->scroll_w(space, offset, data, mem_mask);
}
WRITE16_MEMBER(megasys1_state::megasys1_vregs_C_w)
WRITE16_MEMBER(megasys1_state::monkelf_scroll1_w)
{
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
switch (offset)
{
case 0x2000/2+0 : m_scrollx[0] = new_data; break;
case 0x2000/2+1 : m_scrolly[0] = new_data; break;
case 0x2000/2+2 : megasys1_set_vreg_flag(0, new_data); break;
case 0x2008/2+0 : m_scrollx[1] = new_data; break;
case 0x2008/2+1 : m_scrolly[1] = new_data; break;
case 0x2008/2+2 : megasys1_set_vreg_flag(1, new_data); break;
case 0x2100/2+0 : m_scrollx[2] = new_data; break;
case 0x2100/2+1 : m_scrolly[2] = new_data; break;
case 0x2100/2+2 : megasys1_set_vreg_flag(2, new_data); break;
case 0x2108/2 : m_sprite_bank = new_data; break;
case 0x2200/2 : m_sprite_flag = new_data; break;
case 0x2208/2 : m_active_layers = new_data; break;
case 0x2308/2 : m_screen_flag = new_data;
if (new_data & 0x10)
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
else
m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
break;
case 0x8000/2 : /* Cybattler reads sound latch on irq 2 */
m_soundlatch->write(space, 0, new_data, 0xffff);
m_audiocpu->set_input_line(2, HOLD_LINE);
break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X", offset * 2, data);
}
// code in routine $280 does this. protection?
if (offset == 0)
data = data - (((data & 0x0f) > 0x0b) ? 0x10 : 0);
m_tmap[1]->scroll_w(space, offset, data, mem_mask);
}
/* Used by MS1-D only */
WRITE16_MEMBER(megasys1_state::megasys1_vregs_D_w)
{
UINT16 new_data = COMBINE_DATA(&m_vregs[offset]);
switch (offset)
{
case 0x2000/2+0 : m_scrollx[0] = new_data; break;
case 0x2000/2+1 : m_scrolly[0] = new_data; break;
case 0x2000/2+2 : megasys1_set_vreg_flag(0, new_data); break;
case 0x2008/2+0 : m_scrollx[1] = new_data; break;
case 0x2008/2+1 : m_scrolly[1] = new_data; break;
case 0x2008/2+2 : megasys1_set_vreg_flag(1, new_data); break;
// case 0x2100/2+0 : m_scrollx[2] = new_data; break;
// case 0x2100/2+1 : m_scrolly[2] = new_data; break;
// case 0x2100/2+2 : megasys1_set_vreg_flag(2, new_data); break;
case 0x2108/2 : m_sprite_bank = new_data; break;
case 0x2200/2 : m_sprite_flag = new_data; break;
case 0x2208/2 : m_active_layers = new_data; break;
case 0x2308/2 : m_screen_flag = new_data; break;
default: SHOW_WRITE_ERROR("vreg %04X <- %04X",offset*2,data);
}
}
/***************************************************************************
Sprites Drawing
@ -624,7 +322,7 @@ WRITE16_MEMBER(megasys1_state::megasys1_vregs_D_w)
void megasys1_state::mix_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
gfx_element *decodegfx = m_gfxdecode->gfx(3);
gfx_element *decodegfx = m_gfxdecode->gfx(0);
UINT16 colorbase = decodegfx->colorbase();
for (int y = cliprect.min_y;y <= cliprect.max_y;y++)
@ -675,7 +373,7 @@ void megasys1_state::partial_clear_sprite_bitmap(screen_device &screen, bitmap_i
inline void megasys1_state::draw_16x16_priority_sprite(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, UINT8 mosaic, UINT8 mosaicsol, INT32 priority)
{
// if (sy >= nScreenHeight || sy < -15 || sx >= nScreenWidth || sx < -15) return;
gfx_element *decodegfx = m_gfxdecode->gfx(3);
gfx_element *decodegfx = m_gfxdecode->gfx(0);
sy = sy + 16;
const UINT8* gfx = decodegfx->get_data(code);
@ -815,7 +513,7 @@ void megasys1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
sx = 240-sx; sy = 240-sy;
}
m_gfxdecode->gfx(2)->prio_transpen(bitmap,cliprect,
m_gfxdecode->gfx(0)->prio_transpen(bitmap,cliprect,
code,
color,
flipx, flipy,
@ -1095,16 +793,12 @@ UINT32 megasys1_state::screen_update_megasys1(screen_device &screen, bitmap_ind1
active_layers |= 1 << ((pri & 0xf0000) >> 16); // bottom layer can't be disabled
}
machine().tilemap().set_flip_all((m_screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
for (i = 0;i < 3;i++)
for (i = 0; i < 3; i++)
{
if (m_tmap[i])
if (m_tmap[i].found())
{
m_tmap[i]->set_flip((m_screen_flag & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
m_tmap[i]->enable(active_layers & (1 << i));
m_tmap[i]->set_scrollx(0, m_scrollx[i]);
m_tmap[i]->set_scrolly(0, m_scrolly[i]);
}
}
@ -1123,7 +817,7 @@ UINT32 megasys1_state::screen_update_megasys1(screen_device &screen, bitmap_ind1
case 0:
case 1:
case 2:
if ((m_tmap[layer]) && (active_layers & (1 << layer)))
if (m_tmap[layer].found() && (active_layers & (1 << layer)))
{
m_tmap[layer]->draw(screen, bitmap, cliprect, flag, primask);
flag = 0;

308
src/mame/video/ms1_tmap.cpp Normal file
View File

@ -0,0 +1,308 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
/***************************************************************************
ms1_tmap.cpp
8x8/16x16 tilemap generator for Jaleco's Mega System 1 and driving
and mahjong games from the same period.
***************************************************************************/
#include "emu.h"
#include "video/ms1_tmap.h"
static constexpr int TILES_PER_PAGE_X = 0x20;
static constexpr int TILES_PER_PAGE_Y = 0x20;
static constexpr int TILES_PER_PAGE = TILES_PER_PAGE_X * TILES_PER_PAGE_Y;
/*
A page is 256x256, approximately the visible screen size. Each layer is
made up of 8 pages (8x8 tiles) or 32 pages (16x16 tiles). The number of
horizontal pages and the tiles size is selectable, using the layer's
control register. I think that when tiles are 16x16 a layer can be made
of 16x2, 8x4, 4x8 or 2x16 pages (see below). When tile size is 8x8 we
have two examples to guide the choice:
the copyright screen of p47j (0x12) should be 4x2 (unless it's been hacked :)
the ending sequence of 64th street (0x13) should be 2x4.
Mega System 1
Tile Format: Cisco Heat F1 GP Star
Colour fedc b--- ---- ---- fedc ---- ---- ----
Code ---- -a98 7654 3210 ---- ba98 7654 3210
*/
const device_type MEGASYS1_TILEMAP = &device_creator<megasys1_tilemap_device>;
megasys1_tilemap_device::megasys1_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MEGASYS1_TILEMAP, "Mega System 1 Tilemap", tag, owner, clock, "ms1_tmap", __FILE__),
device_gfx_interface(mconfig, *this),
m_scrollram(*this, DEVICE_SELF),
m_8x8_scroll_factor(1),
m_16x16_scroll_factor(4),
m_bits_per_color_code(4),
m_colorbase(0)
{
}
void megasys1_tilemap_device::static_set_8x8_scroll_factor(device_t &device, int scroll_factor)
{
downcast<megasys1_tilemap_device &>(device).m_8x8_scroll_factor = scroll_factor;
}
void megasys1_tilemap_device::static_set_16x16_scroll_factor(device_t &device, int scroll_factor)
{
downcast<megasys1_tilemap_device &>(device).m_16x16_scroll_factor = scroll_factor;
}
void megasys1_tilemap_device::static_set_bits_per_color_code(device_t &device, int bits)
{
downcast<megasys1_tilemap_device &>(device).m_bits_per_color_code = bits;
}
void megasys1_tilemap_device::static_set_colorbase(device_t &device, UINT16 colorbase)
{
downcast<megasys1_tilemap_device &>(device).m_colorbase = colorbase;
}
/*************************************
*
* Graphics definitions
*
*************************************/
static const gfx_layout tilelayout =
{
8,8,
RGN_FRAC(1,1),
4,
{ STEP4(0,1) },
{ STEP8(0,4) },
{ STEP8(0,4*8) },
8*8*4
};
GFXDECODE_MEMBER(megasys1_tilemap_device::gfxinfo)
GFXDECODE_DEVICE(DEVICE_SELF, 0, tilelayout, 0, 16)
GFXDECODE_END
//-------------------------------------------------
// device_start: Start up the device
//-------------------------------------------------
void megasys1_tilemap_device::device_start()
{
// decode our graphics
decode_gfx(gfxinfo);
gfx(0)->set_colorbase(m_colorbase);
gfx(0)->set_colors(1 << m_bits_per_color_code);
// create 16x16 tilemaps
m_tilemap[0][0] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_16x16),this),
8,8, TILES_PER_PAGE_X * 16, TILES_PER_PAGE_Y * 2);
m_tilemap[0][1] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_16x16),this),
8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 4);
m_tilemap[0][2] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_16x16),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 8);
m_tilemap[0][3] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_16x16),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_16x16),this),
8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 16);
// create 8x8 tilemaps
m_tilemap[1][0] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_8x8),this),
8,8, TILES_PER_PAGE_X * 8, TILES_PER_PAGE_Y * 1);
m_tilemap[1][1] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_8x8),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
m_tilemap[1][2] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_8x8),this),
8,8, TILES_PER_PAGE_X * 4, TILES_PER_PAGE_Y * 2);
m_tilemap[1][3] = &machine().tilemap().create(
*this, tilemap_get_info_delegate(FUNC(megasys1_tilemap_device::get_scroll_tile_info_8x8),this), tilemap_mapper_delegate(FUNC(megasys1_tilemap_device::scan_8x8),this),
8,8, TILES_PER_PAGE_X * 2, TILES_PER_PAGE_Y * 4);
// set transparency
for (int i = 0; i < 8; i++)
m_tilemap[i/4][i%4]->set_transparent_pen(15);
m_tmap = m_tilemap[0][0];
m_scroll_flag = m_scrollx = m_scrolly = 0;
save_item(NAME(m_scrollx));
save_item(NAME(m_scrolly));
save_item(NAME(m_scroll_flag));
}
void megasys1_tilemap_device::device_post_load()
{
m_tmap = m_tilemap[(m_scroll_flag >> 4) & 1][m_scroll_flag & 3];
}
/***************************************************************************
Layers declarations:
* Read and write handlers for the layer
* Callbacks for the TileMap code
***************************************************************************/
WRITE16_MEMBER(megasys1_tilemap_device::write)
{
COMBINE_DATA(&m_scrollram[offset]);
if (offset < 0x40000/2)
{
if (m_scroll_flag & 0x10)
{
// tiles are 8x8
m_tmap->mark_tile_dirty(offset);
}
else
{
// tiles are 16x16
m_tmap->mark_tile_dirty(offset*4 + 0);
m_tmap->mark_tile_dirty(offset*4 + 1);
m_tmap->mark_tile_dirty(offset*4 + 2);
m_tmap->mark_tile_dirty(offset*4 + 3);
}
}
}
/***************************************************************************
Video registers access
***************************************************************************/
/* Tilemap Size (PagesX x PagesY)
Reg. Value 16 8 <- Tile Size
0 16 x 2 8 x 1
1 8 x 4 4 x 2
2 4 x 8 4 x 2
3 2 x 16 2 x 4
*/
TILEMAP_MAPPER_MEMBER(megasys1_tilemap_device::scan_8x8)
{
return (col * TILES_PER_PAGE_Y) +
(row / TILES_PER_PAGE_Y) * TILES_PER_PAGE * (num_cols / TILES_PER_PAGE_X) +
(row % TILES_PER_PAGE_Y);
}
TILEMAP_MAPPER_MEMBER(megasys1_tilemap_device::scan_16x16)
{
return ( ((col / 2) * (TILES_PER_PAGE_Y / 2)) +
((row / 2) / (TILES_PER_PAGE_Y / 2)) * (TILES_PER_PAGE / 4) * (num_cols / TILES_PER_PAGE_X) +
((row / 2) % (TILES_PER_PAGE_Y / 2)) )*4 + (row&1) + (col&1)*2;
}
/*
The tile code of a specific layer is multiplied for a constant
depending on the tile mode (8x8 or 16x16)
The most reasonable arrangement seems a 1:1 mapping (meaning we
must multiply by 4 the tile code in 16x16 mode, since we decode
the graphics like 8x8)
However, this is probably a game specific thing, as Soldam uses
layer 1 in both modes, and even with 8x8 tiles the tile code must
be multiplied by 4! (for the High Score table)
AFAIK, the other games use a layer in one mode only (always 8x8 or
16x16) so it could be that the multiplication factor is constant
for each layer and hardwired to 1x or 4x for both tile sizes
*/
TILE_GET_INFO_MEMBER(megasys1_tilemap_device::get_scroll_tile_info_8x8)
{
UINT16 code = m_scrollram[tile_index];
SET_TILE_INFO_MEMBER(0, (code & 0xfff) * m_8x8_scroll_factor, code >> (16 - m_bits_per_color_code), 0);
}
TILE_GET_INFO_MEMBER(megasys1_tilemap_device::get_scroll_tile_info_16x16)
{
UINT16 code = m_scrollram[tile_index/4];
SET_TILE_INFO_MEMBER(0, (code & 0xfff) * m_16x16_scroll_factor + (tile_index & 3), code >> (16 - m_bits_per_color_code), 0);
}
READ16_MEMBER(megasys1_tilemap_device::scroll_r)
{
switch (offset)
{
case 0: return m_scrollx;
case 1: return m_scrolly;
case 2: return m_scroll_flag;
default: return 0xffff;
}
}
WRITE16_MEMBER(megasys1_tilemap_device::scroll_w)
{
switch (offset)
{
case 0:
{
COMBINE_DATA(&m_scrollx);
break;
}
case 1:
{
COMBINE_DATA(&m_scrolly);
break;
}
case 2:
{
if (((m_scroll_flag ^ data) & mem_mask) != 0)
{
COMBINE_DATA(&m_scroll_flag);
logerror("Setting scroll flag: %02X\n", m_scroll_flag);
m_tmap = m_tilemap[(m_scroll_flag >> 4) & 1][m_scroll_flag & 3];
m_tmap->mark_all_dirty();
}
break;
}
default:
{
logerror("vreg %04X <- %04X", offset, data);
break;
}
}
}
/***************************************************************************
Tilemap Drawing
***************************************************************************/
void megasys1_tilemap_device::draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority, UINT8 priority_mask)
{
m_tmap->set_scrollx(0, m_scrollx);
m_tmap->set_scrolly(0, m_scrolly);
m_tmap->draw(screen, dest, cliprect, flags, priority, priority_mask);
}
void megasys1_tilemap_device::enable(bool enable)
{
m_tmap->enable(enable);
}
void megasys1_tilemap_device::set_flip(UINT32 attributes)
{
m_tmap->set_flip(attributes);
}

101
src/mame/video/ms1_tmap.h Normal file
View File

@ -0,0 +1,101 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
/***************************************************************************
ms1_tmap.h
8x8/16x16 tilemap generator for Jaleco's Mega System 1 and driving
and mahjong games from the same period.
***************************************************************************/
#pragma once
#ifndef MAME_VIDEO_MEGASYS1_TILEMAP_DEVICE
#define MAME_VIDEO_MEGASYS1_TILEMAP_DEVICE
//**************************************************************************
// DEVICE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_MEGASYS1_TILEMAP_ADD(tag, palette_tag, colorbase) \
MCFG_DEVICE_ADD(tag, MEGASYS1_TILEMAP, 0) \
MCFG_GFX_PALETTE(palette_tag) \
MCFG_MEGASYS1_TILEMAP_COLORBASE(colorbase)
#define MCFG_MEGASYS1_TILEMAP_8X8_SCROLL_FACTOR(scroll_factor) \
megasys1_tilemap_device::static_set_8x8_scroll_factor(*device, scroll_factor);
#define MCFG_MEGASYS1_TILEMAP_16X16_SCROLL_FACTOR(scroll_factor) \
megasys1_tilemap_device::static_set_16x16_scroll_factor(*device, scroll_factor);
#define MCFG_MEGASYS1_TILEMAP_BITS_PER_COLOR_CODE(bits) \
megasys1_tilemap_device::static_set_bits_per_color_code(*device, bits);
#define MCFG_MEGASYS1_TILEMAP_COLORBASE(colorbase) \
megasys1_tilemap_device::static_set_colorbase(*device, colorbase);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> megasys1_tilemap_device
class megasys1_tilemap_device : public device_t, public device_gfx_interface
{
public:
// construction/destruction
megasys1_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// static configuration
static void static_set_8x8_scroll_factor(device_t &device, int scroll_factor);
static void static_set_16x16_scroll_factor(device_t &device, int scroll_factor);
static void static_set_bits_per_color_code(device_t &device, int bits);
static void static_set_colorbase(device_t &device, UINT16 colorbase);
// memory handlers
DECLARE_WRITE16_MEMBER(write);
DECLARE_READ16_MEMBER(scroll_r);
DECLARE_WRITE16_MEMBER(scroll_w);
// drawing and layer control
void draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, UINT32 flags, UINT8 priority = 0, UINT8 priority_mask = 0xff);
void enable(bool enable);
void set_flip(UINT32 attributes);
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_post_load() override;
private:
// shared memory finder
required_shared_ptr<UINT16> m_scrollram;
// configuration
int m_8x8_scroll_factor;
int m_16x16_scroll_factor;
int m_bits_per_color_code;
UINT16 m_colorbase;
// decoding info
DECLARE_GFXDECODE_MEMBER(gfxinfo);
// internal state
UINT16 m_scrollx;
UINT16 m_scrolly;
UINT16 m_scroll_flag;
tilemap_t *m_tmap;
tilemap_t *m_tilemap[2][4];
// helpers
TILEMAP_MAPPER_MEMBER(scan_8x8);
TILEMAP_MAPPER_MEMBER(scan_16x16);
TILE_GET_INFO_MEMBER(get_scroll_tile_info_8x8);
TILE_GET_INFO_MEMBER(get_scroll_tile_info_16x16);
};
// device type definition
extern const device_type MEGASYS1_TILEMAP;
#endif /* MAME_VIDEO_MEGASYS1_TILEMAP_DEVICE */