199
199
UINT8 m_vid[multfish_VIDRAM_SIZE];
200
DECLARE_WRITE8_MEMBER(multfish_vid_w);
201
DECLARE_WRITE8_MEMBER(multfish_bank_w);
202
DECLARE_READ8_MEMBER(bankedram_r);
203
DECLARE_WRITE8_MEMBER(bankedram_w);
204
DECLARE_WRITE8_MEMBER(multfish_rambank_w);
205
DECLARE_READ8_MEMBER(ray_r);
206
DECLARE_WRITE8_MEMBER(multfish_hopper_w);
207
DECLARE_WRITE8_MEMBER(rollfr_hopper_w);
208
DECLARE_WRITE8_MEMBER(multfish_lamps1_w);
209
DECLARE_WRITE8_MEMBER(multfish_lamps2_w);
210
DECLARE_WRITE8_MEMBER(multfish_lamps3_w);
211
DECLARE_WRITE8_MEMBER(multfish_counters_w);
212
DECLARE_WRITE8_MEMBER(multfish_f3_w);
213
DECLARE_WRITE8_MEMBER(multfish_dispenable_w);
214
DECLARE_CUSTOM_INPUT_MEMBER(multfish_hopper_r);
202
217
static TILE_GET_INFO( get_multfish_tile_info )
270
static WRITE8_HANDLER( multfish_vid_w )
285
WRITE8_MEMBER(multfish_state::multfish_vid_w)
272
multfish_state *state = space->machine().driver_data<multfish_state>();
274
state->m_vid[offset]=data;
276
290
// 0x0000 - 0x1fff is normal tilemap
277
291
if (offset < 0x2000)
279
state->m_tilemap->mark_tile_dirty((offset&0xfff)/2);
293
m_tilemap->mark_tile_dirty((offset&0xfff)/2);
282
296
// 0x2000 - 0x2fff is for the reels
283
297
else if (offset < 0x4000)
285
state->m_reel_tilemap->mark_tile_dirty((offset&0x1fff)/2);
299
m_reel_tilemap->mark_tile_dirty((offset&0x1fff)/2);
287
301
else if (offset < 0x6000)
292
coldat = state->m_vid[(offset&0xfffe)] | (state->m_vid[(offset&0xfffe)^1] << 8);
306
coldat = m_vid[(offset&0xfffe)] | (m_vid[(offset&0xfffe)^1] << 8);
294
308
/* xor and bitswap palette */
295
switch (state->m_xor_paltype) {
309
switch (m_xor_paltype) {
297
coldat ^= state->m_xor_palette;
311
coldat ^= m_xor_palette;
298
312
coldat ^= ((coldat&0x2) >>1) | ((coldat&0x80) >>3) ;
299
313
coldat = BITSWAP16(coldat,10,15,5,13,8,12,11,2,0,4,7,14,9,3,1,6);
302
coldat ^= state->m_xor_palette;
316
coldat ^= m_xor_palette;
303
317
coldat ^= ((coldat&0x0001) <<1) ^ ((coldat&0x0010) <<1) ^ ((coldat&0x0010) <<2) ^ ((coldat&0x0020) <<1) ^ ((coldat&0x0080) >>1);
304
318
coldat = BITSWAP16(coldat,4,10,13,14,8,11,15,12,2,6,5,0,7,3,1,9);
332
346
timekeeper_w(device, offset + 0x6000, data);
335
static READ8_HANDLER( bankedram_r )
337
multfish_state *state = space->machine().driver_data<multfish_state>();
339
if ((state->m_rambk & 0x80) == 0x00)
341
return timekeeper_r(space->machine().device("m48t35"), offset + 0x2000*(state->m_rambk & 0x03));
345
return state->m_vid[offset+0x2000*(state->m_rambk & 0x03)];
350
static WRITE8_HANDLER( bankedram_w )
352
multfish_state *state = space->machine().driver_data<multfish_state>();
354
if ((state->m_rambk & 0x80) == 0x00)
356
timekeeper_w(space->machine().device("m48t35"), offset + 0x2000*(state->m_rambk & 0x03), data);
360
multfish_vid_w(space, offset+0x2000*(state->m_rambk & 0x03), data);
364
static WRITE8_HANDLER( multfish_rambank_w )
366
multfish_state *state = space->machine().driver_data<multfish_state>();
368
state->m_rambk = data;
372
static READ8_HANDLER( ray_r )
349
READ8_MEMBER(multfish_state::bankedram_r)
352
if ((m_rambk & 0x80) == 0x00)
354
return timekeeper_r(machine().device("m48t35"), offset + 0x2000*(m_rambk & 0x03));
358
return m_vid[offset+0x2000*(m_rambk & 0x03)];
363
WRITE8_MEMBER(multfish_state::bankedram_w)
366
if ((m_rambk & 0x80) == 0x00)
368
timekeeper_w(machine().device("m48t35"), offset + 0x2000*(m_rambk & 0x03), data);
372
multfish_vid_w(space, offset+0x2000*(m_rambk & 0x03), data);
376
WRITE8_MEMBER(multfish_state::multfish_rambank_w)
383
READ8_MEMBER(multfish_state::ray_r)
374
385
// the games read the raster beam position as part of the hardware checks..
375
386
// with a 6mhz clock and 640x480 resolution this seems to give the right results.
376
return space->machine().primary_screen->vpos();
387
return machine().primary_screen->vpos();
379
static CUSTOM_INPUT( multfish_hopper_r )
390
CUSTOM_INPUT_MEMBER(multfish_state::multfish_hopper_r)
381
multfish_state *state = field.machine().driver_data<multfish_state>();
383
if ( state->m_hopper_motor != 0 )
393
if ( m_hopper_motor != 0 )
386
return state->m_hopper>>4;
400
410
---- -X-- Bill Acceptor Lock 24B
401
411
---X ---- Hopper Motor 33B
403
multfish_state *state = space->machine().driver_data<multfish_state>();
405
state->m_hopper_motor = data & 0x10;
406
coin_lockout_w(space->machine(), 0, data & 0x01);
407
coin_lockout_w(space->machine(), 1, data & 0x01);
408
coin_lockout_w(space->machine(), 2, data & 0x01);
409
coin_lockout_w(space->machine(), 3, data & 0x01);
410
coin_lockout_w(space->machine(), 4, data & 0x04);
411
coin_lockout_w(space->machine(), 5, data & 0x04);
412
coin_lockout_w(space->machine(), 6, data & 0x04);
413
coin_lockout_w(space->machine(), 7, data & 0x04);
415
m_hopper_motor = data & 0x10;
416
coin_lockout_w(machine(), 0, data & 0x01);
417
coin_lockout_w(machine(), 1, data & 0x01);
418
coin_lockout_w(machine(), 2, data & 0x01);
419
coin_lockout_w(machine(), 3, data & 0x01);
420
coin_lockout_w(machine(), 4, data & 0x04);
421
coin_lockout_w(machine(), 5, data & 0x04);
422
coin_lockout_w(machine(), 6, data & 0x04);
423
coin_lockout_w(machine(), 7, data & 0x04);
416
static WRITE8_HANDLER( rollfr_hopper_w )
426
WRITE8_MEMBER(multfish_state::rollfr_hopper_w)
419
429
By default RollFruit use inverted coinlock bit.
421
multfish_state *state = space->machine().driver_data<multfish_state>();
423
state->m_hopper_motor = data & 0x10;
424
coin_lockout_w(space->machine(), 0, !data & 0x01);
425
coin_lockout_w(space->machine(), 1, !data & 0x01);
426
coin_lockout_w(space->machine(), 2, !data & 0x01);
427
coin_lockout_w(space->machine(), 3, !data & 0x01);
428
coin_lockout_w(space->machine(), 4, data & 0x04);
429
coin_lockout_w(space->machine(), 5, data & 0x04);
430
coin_lockout_w(space->machine(), 6, data & 0x04);
431
coin_lockout_w(space->machine(), 7, data & 0x04);
433
m_hopper_motor = data & 0x10;
434
coin_lockout_w(machine(), 0, !data & 0x01);
435
coin_lockout_w(machine(), 1, !data & 0x01);
436
coin_lockout_w(machine(), 2, !data & 0x01);
437
coin_lockout_w(machine(), 3, !data & 0x01);
438
coin_lockout_w(machine(), 4, data & 0x04);
439
coin_lockout_w(machine(), 5, data & 0x04);
440
coin_lockout_w(machine(), 6, data & 0x04);
441
coin_lockout_w(machine(), 7, data & 0x04);
434
444
DRIVER_INIT( customl )
668
678
ent_decode(machine, 0x22, 0x44, 0x44, 0xbb, 0x24240);
671
static ADDRESS_MAP_START( multfish_map, AS_PROGRAM, 8 )
681
static ADDRESS_MAP_START( multfish_map, AS_PROGRAM, 8, multfish_state )
672
682
AM_RANGE(0x0000, 0x7fff) AM_ROM AM_WRITE(multfish_vid_w)
673
683
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
674
AM_RANGE(0xc000, 0xdfff) AM_DEVREADWRITE("m48t35", multfish_timekeeper_r, multfish_timekeeper_w)
684
AM_RANGE(0xc000, 0xdfff) AM_DEVREADWRITE_LEGACY("m48t35", multfish_timekeeper_r, multfish_timekeeper_w)
675
685
AM_RANGE(0xe000, 0xffff) AM_READWRITE(bankedram_r, bankedram_w)
694
704
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) // unused?
696
706
PORT_START("IN1")
697
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM ( multfish_hopper_r, NULL )// Hopper SW (22 B)
707
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, multfish_state,multfish_hopper_r, NULL )// Hopper SW (22 B)
698
708
PORT_DIPNAME( 0x02, 0x02, "BK Door (17 A)" )
699
709
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
700
710
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
787
797
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
789
799
PORT_START("IN1")
790
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM ( multfish_hopper_r, NULL )// Hopper SW (22 B)
800
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, multfish_state,multfish_hopper_r, NULL )// Hopper SW (22 B)
791
801
PORT_DIPNAME( 0x02, 0x02, "BK Door (17 A)" )
792
802
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
793
803
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
882
892
-X-- ---- Key Out Counter 27A
883
893
X--- ---- Total Bet Counter 28B
885
coin_counter_w(space->machine(), 0, data & 0x01);
886
coin_counter_w(space->machine(), 1, data & 0x02);
887
coin_counter_w(space->machine(), 2, data & 0x04);
888
coin_counter_w(space->machine(), 3, data & 0x10);
889
coin_counter_w(space->machine(), 4, data & 0x40);
890
coin_counter_w(space->machine(), 5, data & 0x80);
895
coin_counter_w(machine(), 0, data & 0x01);
896
coin_counter_w(machine(), 1, data & 0x02);
897
coin_counter_w(machine(), 2, data & 0x04);
898
coin_counter_w(machine(), 3, data & 0x10);
899
coin_counter_w(machine(), 4, data & 0x40);
900
coin_counter_w(machine(), 5, data & 0x80);
893
static WRITE8_HANDLER( multfish_f3_w )
903
WRITE8_MEMBER(multfish_state::multfish_f3_w)
895
905
//popmessage("multfish_f3_w %02x",data);
898
static WRITE8_HANDLER( multfish_dispenable_w )
908
WRITE8_MEMBER(multfish_state::multfish_dispenable_w)
900
multfish_state *state = space->machine().driver_data<multfish_state>();
901
910
//popmessage("multfish_f4_w %02x",data); // display enable?
902
state->m_disp_enable = data;
911
m_disp_enable = data;
905
static ADDRESS_MAP_START( multfish_portmap, AS_IO, 8 )
914
static ADDRESS_MAP_START( multfish_portmap, AS_IO, 8, multfish_state )
906
915
ADDRESS_MAP_GLOBAL_MASK(0xff)
907
916
AM_RANGE(0x10, 0x10) AM_READ_PORT("IN0")
908
917
AM_RANGE(0x11, 0x11) AM_READ_PORT("IN1")
916
925
/* Write ports not hooked up yet */
917
926
AM_RANGE(0x30, 0x30) AM_WRITE(multfish_lamps1_w)
918
927
AM_RANGE(0x31, 0x31) AM_WRITE(multfish_counters_w)
919
// AM_RANGE(0x32, 0x32) AM_WRITE(multfish_port32_w)
928
// AM_RANGE(0x32, 0x32) AM_WRITE_LEGACY(multfish_port32_w)
920
929
AM_RANGE(0x33, 0x33) AM_WRITE(multfish_hopper_w)
921
930
AM_RANGE(0x34, 0x34) AM_WRITE(multfish_lamps2_w)
922
931
AM_RANGE(0x35, 0x35) AM_WRITE(multfish_lamps3_w)
923
// AM_RANGE(0x36, 0x36) AM_WRITE(multfish_port36_w)
932
// AM_RANGE(0x36, 0x36) AM_WRITE_LEGACY(multfish_port36_w)
924
933
AM_RANGE(0x37, 0x37) AM_WRITE(watchdog_reset_w)
925
AM_RANGE(0x38, 0x38) AM_DEVWRITE("aysnd", ay8910_address_w)
926
AM_RANGE(0x39, 0x39) AM_DEVWRITE("aysnd", ay8910_data_w)
927
AM_RANGE(0x3a, 0x3a) AM_DEVREAD("aysnd", ay8910_r)
934
AM_RANGE(0x38, 0x38) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_w)
935
AM_RANGE(0x39, 0x39) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
936
AM_RANGE(0x3a, 0x3a) AM_DEVREAD_LEGACY("aysnd", ay8910_r)
929
938
AM_RANGE(0x60, 0x60) AM_WRITE(multfish_dispenable_w) // display enable mirror for lottery sets