28
28
umipoker_state(const machine_config &mconfig, device_type type, const char *tag)
29
: driver_device(mconfig, type, tag) { }
29
: driver_device(mconfig, type, tag) ,
30
m_vram_0(*this, "vra0"),
31
m_vram_1(*this, "vra1"),
32
m_vram_2(*this, "vra2"),
33
m_vram_3(*this, "vra3"),
34
m_z80_wram(*this, "z80_wram"){ }
36
required_shared_ptr<UINT16> m_vram_0;
37
required_shared_ptr<UINT16> m_vram_1;
38
required_shared_ptr<UINT16> m_vram_2;
39
required_shared_ptr<UINT16> m_vram_3;
35
40
tilemap_t *m_tilemap_0;
36
41
tilemap_t *m_tilemap_1;
37
42
tilemap_t *m_tilemap_2;
38
43
tilemap_t *m_tilemap_3;
44
required_shared_ptr<UINT8> m_z80_wram;
40
45
int m_umipoker_scrolly[4];
46
DECLARE_READ8_MEMBER(z80_rom_readback_r);
47
DECLARE_READ8_MEMBER(z80_shared_ram_r);
48
DECLARE_WRITE8_MEMBER(z80_shared_ram_w);
49
DECLARE_WRITE16_MEMBER(umipoker_irq_ack_w);
50
DECLARE_WRITE16_MEMBER(umipoker_scrolly_0_w);
51
DECLARE_WRITE16_MEMBER(umipoker_scrolly_1_w);
52
DECLARE_WRITE16_MEMBER(umipoker_scrolly_2_w);
53
DECLARE_WRITE16_MEMBER(umipoker_scrolly_3_w);
54
DECLARE_WRITE16_MEMBER(umipoker_vram_0_w);
55
DECLARE_WRITE16_MEMBER(umipoker_vram_1_w);
56
DECLARE_WRITE16_MEMBER(umipoker_vram_2_w);
57
DECLARE_WRITE16_MEMBER(umipoker_vram_3_w);
58
DECLARE_WRITE16_MEMBER(lamps_w);
59
DECLARE_WRITE16_MEMBER(umi_counters_w);
60
DECLARE_WRITE16_MEMBER(saiyu_counters_w);
43
63
static TILE_GET_INFO( get_tile_info_0 )
130
static READ8_HANDLER( z80_rom_readback_r )
150
READ8_MEMBER(umipoker_state::z80_rom_readback_r)
132
UINT8 *ROM = space->machine().region("audiocpu")->base();
152
UINT8 *ROM = memregion("audiocpu")->base();
134
154
return ROM[offset];
137
static READ8_HANDLER( z80_shared_ram_r )
139
umipoker_state *state = space->machine().driver_data<umipoker_state>();
141
space->machine().scheduler().synchronize(); // force resync
143
return state->m_z80_wram[offset];
146
static WRITE8_HANDLER( z80_shared_ram_w )
148
umipoker_state *state = space->machine().driver_data<umipoker_state>();
150
space->machine().scheduler().synchronize(); // force resync
152
state->m_z80_wram[offset] = data;
155
static WRITE16_HANDLER( umipoker_irq_ack_w )
157
cputag_set_input_line(space->machine(), "maincpu", 6, CLEAR_LINE);
157
READ8_MEMBER(umipoker_state::z80_shared_ram_r)
160
machine().scheduler().synchronize(); // force resync
162
return m_z80_wram[offset];
165
WRITE8_MEMBER(umipoker_state::z80_shared_ram_w)
168
machine().scheduler().synchronize(); // force resync
170
m_z80_wram[offset] = data;
173
WRITE16_MEMBER(umipoker_state::umipoker_irq_ack_w)
175
cputag_set_input_line(machine(), "maincpu", 6, CLEAR_LINE);
159
177
/* shouldn't happen */
161
179
popmessage("%04x IRQ ACK, contact MAMEdev",data);
164
static WRITE16_HANDLER( umipoker_scrolly_0_w ) { umipoker_state *state = space->machine().driver_data<umipoker_state>(); COMBINE_DATA(&state->m_umipoker_scrolly[0]); }
165
static WRITE16_HANDLER( umipoker_scrolly_1_w ) { umipoker_state *state = space->machine().driver_data<umipoker_state>(); COMBINE_DATA(&state->m_umipoker_scrolly[1]); }
166
static WRITE16_HANDLER( umipoker_scrolly_2_w ) { umipoker_state *state = space->machine().driver_data<umipoker_state>(); COMBINE_DATA(&state->m_umipoker_scrolly[2]); }
167
static WRITE16_HANDLER( umipoker_scrolly_3_w ) { umipoker_state *state = space->machine().driver_data<umipoker_state>(); COMBINE_DATA(&state->m_umipoker_scrolly[3]); }
169
static WRITE16_HANDLER( umipoker_vram_0_w )
171
umipoker_state *state = space->machine().driver_data<umipoker_state>();
173
COMBINE_DATA(&state->m_vram_0[offset]);
174
state->m_tilemap_0->mark_tile_dirty(offset >> 1);
177
static WRITE16_HANDLER( umipoker_vram_1_w )
179
umipoker_state *state = space->machine().driver_data<umipoker_state>();
181
COMBINE_DATA(&state->m_vram_1[offset]);
182
state->m_tilemap_1->mark_tile_dirty(offset >> 1);
186
static WRITE16_HANDLER( umipoker_vram_2_w )
188
umipoker_state *state = space->machine().driver_data<umipoker_state>();
190
COMBINE_DATA(&state->m_vram_2[offset]);
191
state->m_tilemap_2->mark_tile_dirty(offset >> 1);
194
static WRITE16_HANDLER( umipoker_vram_3_w )
196
umipoker_state *state = space->machine().driver_data<umipoker_state>();
198
COMBINE_DATA(&state->m_vram_3[offset]);
199
state->m_tilemap_3->mark_tile_dirty(offset >> 1);
202
static WRITE16_HANDLER( lamps_w )
182
WRITE16_MEMBER(umipoker_state::umipoker_scrolly_0_w){ COMBINE_DATA(&m_umipoker_scrolly[0]); }
183
WRITE16_MEMBER(umipoker_state::umipoker_scrolly_1_w){ COMBINE_DATA(&m_umipoker_scrolly[1]); }
184
WRITE16_MEMBER(umipoker_state::umipoker_scrolly_2_w){ COMBINE_DATA(&m_umipoker_scrolly[2]); }
185
WRITE16_MEMBER(umipoker_state::umipoker_scrolly_3_w){ COMBINE_DATA(&m_umipoker_scrolly[3]); }
187
WRITE16_MEMBER(umipoker_state::umipoker_vram_0_w)
190
COMBINE_DATA(&m_vram_0[offset]);
191
m_tilemap_0->mark_tile_dirty(offset >> 1);
194
WRITE16_MEMBER(umipoker_state::umipoker_vram_1_w)
197
COMBINE_DATA(&m_vram_1[offset]);
198
m_tilemap_1->mark_tile_dirty(offset >> 1);
202
WRITE16_MEMBER(umipoker_state::umipoker_vram_2_w)
205
COMBINE_DATA(&m_vram_2[offset]);
206
m_tilemap_2->mark_tile_dirty(offset >> 1);
209
WRITE16_MEMBER(umipoker_state::umipoker_vram_3_w)
212
COMBINE_DATA(&m_vram_3[offset]);
213
m_tilemap_3->mark_tile_dirty(offset >> 1);
216
WRITE16_MEMBER(umipoker_state::lamps_w)
205
219
Umipoker buttons layout:
264
278
xxxx xxxx x--x xxx- Unknown / Not used.
267
coin_counter_w(space->machine(), 0, data & 0x20); /* COIN 1 */
268
coin_counter_w(space->machine(), 1, data & 0x40); /* COIN 2 */
269
coin_counter_w(space->machine(), 2, data & 0x01); /* PAYOUT */
281
coin_counter_w(machine(), 0, data & 0x20); /* COIN 1 */
282
coin_counter_w(machine(), 1, data & 0x40); /* COIN 2 */
283
coin_counter_w(machine(), 2, data & 0x01); /* PAYOUT */
272
static WRITE16_HANDLER( saiyu_counters_w )
286
WRITE16_MEMBER(umipoker_state::saiyu_counters_w)
275
289
0x0000 - Normal State (lamps off).
286
300
x--x xxx- xxxx xxxx Unknown / Not used.
289
coin_counter_w(space->machine(), 0, data & 0x2000); /* COIN 1 */
290
coin_counter_w(space->machine(), 1, data & 0x4000); /* COIN 2 */
291
coin_counter_w(space->machine(), 2, data & 0x0100); /* PAYOUT */
303
coin_counter_w(machine(), 0, data & 0x2000); /* COIN 1 */
304
coin_counter_w(machine(), 1, data & 0x4000); /* COIN 2 */
305
coin_counter_w(machine(), 2, data & 0x0100); /* PAYOUT */
295
static ADDRESS_MAP_START( umipoker_map, AS_PROGRAM, 16 )
309
static ADDRESS_MAP_START( umipoker_map, AS_PROGRAM, 16, umipoker_state )
296
310
ADDRESS_MAP_UNMAP_LOW
297
311
AM_RANGE(0x000000, 0x03ffff) AM_ROM
298
312
AM_RANGE(0x400000, 0x403fff) AM_RAM AM_SHARE("nvram")
299
AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) // Palette
300
AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(umipoker_vram_0_w) AM_BASE_MEMBER(umipoker_state, m_vram_0)
301
AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(umipoker_vram_1_w) AM_BASE_MEMBER(umipoker_state, m_vram_1)
302
AM_RANGE(0x804000, 0x805fff) AM_RAM_WRITE(umipoker_vram_2_w) AM_BASE_MEMBER(umipoker_state, m_vram_2)
303
AM_RANGE(0x806000, 0x807fff) AM_RAM_WRITE(umipoker_vram_3_w) AM_BASE_MEMBER(umipoker_state, m_vram_3)
313
AM_RANGE(0x600000, 0x6007ff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") // Palette
314
AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(umipoker_vram_0_w) AM_SHARE("vra0")
315
AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(umipoker_vram_1_w) AM_SHARE("vra1")
316
AM_RANGE(0x804000, 0x805fff) AM_RAM_WRITE(umipoker_vram_2_w) AM_SHARE("vra2")
317
AM_RANGE(0x806000, 0x807fff) AM_RAM_WRITE(umipoker_vram_3_w) AM_SHARE("vra3")
304
318
AM_RANGE(0xc00000, 0xc0ffff) AM_READ8(z80_rom_readback_r,0x00ff)
305
319
AM_RANGE(0xc1f000, 0xc1ffff) AM_READWRITE8(z80_shared_ram_r,z80_shared_ram_w,0x00ff)
306
320
AM_RANGE(0xe00000, 0xe00001) AM_READ_PORT("IN0")
307
321
AM_RANGE(0xe00004, 0xe00005) AM_READ_PORT("IN1") // unused?
308
322
AM_RANGE(0xe00008, 0xe00009) AM_READ_PORT("IN2")
309
323
// AM_RANGE(0xe0000c, 0xe0000d) AM_WRITE(lamps_w) -----> lamps only for saiyukip.
310
// AM_RANGE(0xe00010, 0xe00011) AM_WRITE(counters_w) --> coin counters for both games.
324
// AM_RANGE(0xe00010, 0xe00011) AM_WRITE_LEGACY(counters_w) --> coin counters for both games.
311
325
AM_RANGE(0xe00014, 0xe00015) AM_READ_PORT("DSW1-2")
312
326
AM_RANGE(0xe00018, 0xe00019) AM_READ_PORT("DSW3-4")
313
327
AM_RANGE(0xe00020, 0xe00021) AM_WRITE(umipoker_scrolly_0_w)
318
332
AM_RANGE(0xe0002e, 0xe0002f) AM_WRITE(umipoker_scrolly_3_w)
321
static ADDRESS_MAP_START( umipoker_audio_map, AS_PROGRAM, 8 )
335
static ADDRESS_MAP_START( umipoker_audio_map, AS_PROGRAM, 8, umipoker_state )
322
336
AM_RANGE(0x0000, 0x7fff) AM_ROM
323
AM_RANGE(0xf800, 0xffff) AM_READWRITE(z80_shared_ram_r,z80_shared_ram_w) AM_BASE_MEMBER(umipoker_state, m_z80_wram)
337
AM_RANGE(0xf800, 0xffff) AM_READWRITE(z80_shared_ram_r,z80_shared_ram_w) AM_SHARE("z80_wram")
326
static ADDRESS_MAP_START( umipoker_audio_io_map, AS_IO, 8 )
340
static ADDRESS_MAP_START( umipoker_audio_io_map, AS_IO, 8, umipoker_state )
327
341
ADDRESS_MAP_GLOBAL_MASK(0xff)
328
AM_RANGE(0x00, 0x00) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
329
AM_RANGE(0x10, 0x11) AM_DEVREADWRITE("ym", ym3812_r, ym3812_w)
342
AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("oki", okim6295_device, read, write)
343
AM_RANGE(0x10, 0x11) AM_DEVREADWRITE_LEGACY("ym", ym3812_r, ym3812_w)
735
749
static DRIVER_INIT( umipoker )
737
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe00010, 0xe00011, FUNC(umi_counters_w) );
751
umipoker_state *state = machine.driver_data<umipoker_state>();
752
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe00010, 0xe00011, write16_delegate(FUNC(umipoker_state::umi_counters_w), state));
740
755
static DRIVER_INIT( saiyukip )
742
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe00010, 0xe00011, FUNC(saiyu_counters_w) );
743
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0000c, 0xe0000d, FUNC(lamps_w) );
757
umipoker_state *state = machine.driver_data<umipoker_state>();
758
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe00010, 0xe00011, write16_delegate(FUNC(umipoker_state::saiyu_counters_w), state));
759
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0xe0000c, 0xe0000d, write16_delegate(FUNC(umipoker_state::lamps_w), state));