28
28
that as well to be 100% accurate.
31
UINT8 *ROM = space->machine().region("user1")->base();
32
UINT8 *prom1 = space->machine().region("proms")->base() + (data & 0xf0);
33
UINT8 *prom2 = space->machine().region("proms")->base() + 0x100 + ((data & 0x0f) << 4);
31
UINT8 *ROM = memregion("user1")->base();
32
UINT8 *prom1 = memregion("proms")->base() + (data & 0xf0);
33
UINT8 *prom2 = memregion("proms")->base() + 0x100 + ((data & 0x0f) << 4);
35
35
for (i = 0x05;i < 0x10;i++)
39
39
/* bit 2 of prom1 selects ROM or RAM - not supported */
41
41
sprintf(bankname, "%04x", i*0x1000);
42
memory_set_bankptr(space->machine(), bankname,&ROM[bank*0x1000]);
42
membank(bankname)->set_base(&ROM[bank*0x1000]);
48
48
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
49
49
/* initialize banked ROM pointers */
50
srumbler_bankswitch_w(space,0,0);
50
srumbler_state *state = machine.driver_data<srumbler_state>();
51
state->srumbler_bankswitch_w(*space,0,0);
53
54
static TIMER_DEVICE_CALLBACK( srumbler_interrupt )
72
73
Ignore the warnings about writing to unmapped memory.
75
static ADDRESS_MAP_START( srumbler_map, AS_PROGRAM, 8 )
76
static ADDRESS_MAP_START( srumbler_map, AS_PROGRAM, 8, srumbler_state )
76
77
AM_RANGE(0x0000, 0x1dff) AM_RAM /* RAM (of 1 sort or another) */
77
AM_RANGE(0x1e00, 0x1fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram)
78
AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(srumbler_background_w) AM_BASE_MEMBER(srumbler_state, m_backgroundram)
78
AM_RANGE(0x1e00, 0x1fff) AM_RAM AM_SHARE("spriteram")
79
AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(srumbler_background_w) AM_SHARE("backgroundram")
79
80
AM_RANGE(0x4008, 0x4008) AM_READ_PORT("SYSTEM") AM_WRITE(srumbler_bankswitch_w)
80
81
AM_RANGE(0x4009, 0x4009) AM_READ_PORT("P1") AM_WRITE(srumbler_4009_w)
81
82
AM_RANGE(0x400a, 0x400a) AM_READ_PORT("P2")
82
83
AM_RANGE(0x400b, 0x400b) AM_READ_PORT("DSW1")
83
84
AM_RANGE(0x400c, 0x400c) AM_READ_PORT("DSW2")
84
85
AM_RANGE(0x400a, 0x400d) AM_WRITE(srumbler_scroll_w)
85
AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_w)
86
AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000") AM_WRITE(srumbler_foreground_w) AM_BASE_MEMBER(srumbler_state, m_foregroundram) /* Banked ROM */
86
AM_RANGE(0x400e, 0x400e) AM_WRITE(soundlatch_byte_w)
87
AM_RANGE(0x5000, 0x5fff) AM_ROMBANK("5000") AM_WRITE(srumbler_foreground_w) AM_SHARE("foregroundram") /* Banked ROM */
87
88
AM_RANGE(0x6000, 0x6fff) AM_ROMBANK("6000") /* Banked ROM */
88
89
AM_RANGE(0x6000, 0x6fff) AM_WRITENOP /* Video RAM 2 ??? (not used) */
89
90
AM_RANGE(0x7000, 0x7fff) AM_ROMBANK("7000") /* Banked ROM */
90
AM_RANGE(0x7000, 0x73ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE_GENERIC(paletteram)
91
AM_RANGE(0x7000, 0x73ff) AM_WRITE(paletteram_RRRRGGGGBBBBxxxx_byte_be_w) AM_SHARE("paletteram")
91
92
AM_RANGE(0x8000, 0x8fff) AM_ROMBANK("8000") /* Banked ROM */
92
93
AM_RANGE(0x9000, 0x9fff) AM_ROMBANK("9000") /* Banked ROM */
93
94
AM_RANGE(0xa000, 0xafff) AM_ROMBANK("a000") /* Banked ROM */
98
99
AM_RANGE(0xf000, 0xffff) AM_ROMBANK("f000") /* Banked ROM */
101
static ADDRESS_MAP_START( srumbler_sound_map, AS_PROGRAM, 8 )
102
static ADDRESS_MAP_START( srumbler_sound_map, AS_PROGRAM, 8, srumbler_state )
102
103
AM_RANGE(0x0000, 0x7fff) AM_ROM
103
AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ym1", ym2203_w)
104
AM_RANGE(0xa000, 0xa001) AM_DEVWRITE("ym2", ym2203_w)
104
AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("ym1", ym2203_w)
105
AM_RANGE(0xa000, 0xa001) AM_DEVWRITE_LEGACY("ym2", ym2203_w)
105
106
AM_RANGE(0xc000, 0xc7ff) AM_RAM
106
AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_r)
107
AM_RANGE(0xe000, 0xe000) AM_READ(soundlatch_byte_r)
248
249
MCFG_MACHINE_START(srumbler)
250
251
/* video hardware */
251
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
252
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
253
254
MCFG_SCREEN_ADD("screen", RASTER)
254
255
MCFG_SCREEN_REFRESH_RATE(60)
256
257
MCFG_SCREEN_SIZE(64*8, 32*8)
257
258
MCFG_SCREEN_VISIBLE_AREA(10*8, (64-10)*8-1, 1*8, 31*8-1 )
258
259
MCFG_SCREEN_UPDATE_STATIC(srumbler)
259
MCFG_SCREEN_VBLANK_STATIC(srumbler)
260
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
261
262
MCFG_GFXDECODE(srumbler)
262
263
MCFG_PALETTE_LENGTH(512)