Merged memory maps in Popper

This commit is contained in:
Angelo Salese 2009-04-25 17:37:31 +00:00
parent 0fd22bce0a
commit b92d43185b

View File

@ -97,12 +97,7 @@ WRITE8_HANDLER( popper_gfx_bank_w );
PALETTE_INIT( popper );
VIDEO_START( popper );
VIDEO_UPDATE( popper );
static UINT8 *popper_sharedram;
static READ8_HANDLER( popper_sharedram_r )
{
return popper_sharedram[offset];
}
//e000 e001 e002 e003
//76543210 76543210 76543210 76543210
@ -155,55 +150,39 @@ static READ8_HANDLER( popper_soundcpu_nmi_r )
return 0;
}
static WRITE8_HANDLER( popper_sharedram_w )
{
popper_sharedram[offset]=data;
}
static ADDRESS_MAP_START( popper_readmem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
AM_RANGE(0xc000, 0xd7ff) AM_READ(SMH_RAM)
AM_RANGE(0xd800, 0xdfff) AM_READ(SMH_RAM) //shared with sound cpu
static ADDRESS_MAP_START( popper_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x5fff) AM_ROM
AM_RANGE(0xc000, 0xc1bf) AM_RAM
AM_RANGE(0xc1c0, 0xc1ff) AM_RAM_WRITE(popper_ol_videoram_w) AM_BASE(&popper_ol_videoram)
AM_RANGE(0xc200, 0xc61f) AM_RAM_WRITE(popper_videoram_w) AM_BASE(&popper_videoram)
AM_RANGE(0xc620, 0xc9bf) AM_RAM
AM_RANGE(0xc9c0, 0xc9ff) AM_RAM_WRITE(popper_ol_attribram_w) AM_BASE(&popper_ol_attribram)
AM_RANGE(0xca00, 0xce1f) AM_RAM_WRITE(popper_attribram_w) AM_BASE(&popper_attribram)
AM_RANGE(0xce20, 0xcfff) AM_RAM
AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&popper_spriteram) AM_SIZE(&popper_spriteram_size)
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(1)
AM_RANGE(0xe000, 0xe007) AM_READ(popper_input_ports_r)
AM_RANGE(0xe000, 0xe000) AM_WRITE(interrupt_enable_w)
AM_RANGE(0xe001, 0xe001) AM_WRITE(popper_flipscreen_w)
AM_RANGE(0xe002, 0xe002) AM_WRITE(popper_e002_w) //?? seems to be graphic related
AM_RANGE(0xe003, 0xe003) AM_WRITE(popper_gfx_bank_w)
AM_RANGE(0xe004, 0xe007) AM_WRITENOP //?? range cleared once when the SP is set
AM_RANGE(0xe400, 0xe400) AM_READ(popper_soundcpu_nmi_r)
AM_RANGE(0xf800, 0xf800) AM_READNOP //?? read once at startup
AM_RANGE(0xfc00, 0xfc00) AM_READNOP //?? possibly watchdog
AM_RANGE(0xffff, 0xffff) AM_READNOP
ADDRESS_MAP_END
static ADDRESS_MAP_START( popper_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x5fff) AM_WRITE(SMH_ROM)
AM_RANGE(0xc000, 0xc1bf) AM_WRITE(SMH_RAM)
AM_RANGE(0xc1c0, 0xc1ff) AM_WRITE(popper_ol_videoram_w) AM_BASE(&popper_ol_videoram)
AM_RANGE(0xc200, 0xc61f) AM_WRITE(popper_videoram_w) AM_BASE(&popper_videoram)
AM_RANGE(0xc620, 0xc9bf) AM_WRITE(SMH_RAM)
AM_RANGE(0xc9c0, 0xc9ff) AM_WRITE(popper_ol_attribram_w) AM_BASE(&popper_ol_attribram)
AM_RANGE(0xca00, 0xce1f) AM_WRITE(popper_attribram_w) AM_BASE(&popper_attribram)
AM_RANGE(0xce20, 0xcfff) AM_WRITE(SMH_RAM)
AM_RANGE(0xd000, 0xd7ff) AM_WRITE(SMH_RAM) AM_BASE(&popper_spriteram) AM_SIZE(&popper_spriteram_size)
AM_RANGE(0xd800, 0xdfff) AM_WRITE(SMH_RAM) AM_BASE(&popper_sharedram) //shared with sound cpu
AM_RANGE(0xe000, 0xe000) AM_WRITE(interrupt_enable_w)
AM_RANGE(0xe001, 0xe001) AM_WRITE(popper_flipscreen_w)
AM_RANGE(0xe002, 0xe002) AM_WRITE(popper_e002_w) //?? seems to be graphic related
AM_RANGE(0xe003, 0xe003) AM_WRITE(popper_gfx_bank_w)
AM_RANGE(0xe004, 0xe007) AM_WRITENOP //?? range cleared once when the SP is set
ADDRESS_MAP_END
static ADDRESS_MAP_START( popper_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_ROM)
AM_RANGE(0x8002, 0x8002) AM_READNOP //?? all read once at startup and the
AM_RANGE(0x8003, 0x8003) AM_READNOP //?? result ignored, looks like part
AM_RANGE(0xa002, 0xa002) AM_READNOP //?? of AY8910 initialisation
AM_RANGE(0xd800, 0xdfff) AM_READ(popper_sharedram_r)
ADDRESS_MAP_END
static ADDRESS_MAP_START( popper_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_WRITE(SMH_ROM)
static ADDRESS_MAP_START( popper_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_address_data_w)
AM_RANGE(0x8002, 0x8002) AM_WRITENOP //?? same writes as 0x8000 (mostly)
AM_RANGE(0x8002, 0x8002) AM_READNOP //?? all read once at startup and the
AM_RANGE(0x8002, 0x8002) AM_WRITENOP //?? same writes as 0x8000 (mostly)
AM_RANGE(0x8003, 0x8003) AM_READNOP //?? result ignored, looks like part
AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ay2", ay8910_address_data_w)
AM_RANGE(0xa002, 0xa002) AM_WRITENOP //?? same writes as 0xa000
AM_RANGE(0xd800, 0xdfff) AM_WRITE(popper_sharedram_w)
AM_RANGE(0xa002, 0xa002) AM_READNOP //?? of AY8910 initialisation
AM_RANGE(0xa002, 0xa002) AM_WRITENOP //?? same writes as 0xa000
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(1)
ADDRESS_MAP_END
static INPUT_PORTS_START( popper )
@ -310,11 +289,11 @@ static MACHINE_DRIVER_START( popper )
/* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80,18432000/6)
MDRV_CPU_PROGRAM_MAP(popper_readmem,popper_writemem)
MDRV_CPU_PROGRAM_MAP(popper_map,0)
MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
MDRV_CPU_ADD("audiocpu", Z80,18432000/12)
MDRV_CPU_PROGRAM_MAP(popper_sound_readmem,popper_sound_writemem)
MDRV_CPU_PROGRAM_MAP(popper_sound_map,0)
MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4) //NMIs caused by the main CPU
MDRV_QUANTUM_TIME(HZ(1800))