196
198
#define VIDEO_MASTER_CLOCK XTAL_10MHz
198
/* IRQ states for 68k */
199
static UINT8 m6840_irq_state;
200
static UINT8 m6850_irq_state;
201
static UINT8 scn2674_irq_state;
203
/* UART source/sinks */
204
static UINT8 m68k_m6809_line;
205
static UINT8 m6809_m68k_line;
206
static UINT8 m68k_acia_cts;
207
static UINT8 m6809_acia_cts;
208
static UINT8 m6809_acia_rts;
209
static UINT8 m6809_acia_dcd;
211
/* SCN2674 AVDC stuff */
212
static int mpu4_gfx_index;
213
static UINT16 * mpu4_vid_vidram;
214
static UINT16 * mpu4_vid_mainram;
216
static UINT8 scn2674_IR[16];
217
static UINT8 scn2675_IR_pointer;
218
static UINT8 scn2674_screen1_l;
219
static UINT8 scn2674_screen1_h;
220
static UINT8 scn2674_cursor_l;
221
static UINT8 scn2674_cursor_h;
222
static UINT8 scn2674_screen2_l;
223
static UINT8 scn2674_screen2_h;
225
static UINT8 scn2674_irq_register = 0;
226
static UINT8 scn2674_status_register = 0;
227
static UINT8 scn2674_irq_mask = 0;
228
static UINT8 scn2674_gfx_enabled;
229
static UINT8 scn2674_display_enabled;
230
static UINT8 scn2674_cursor_enabled;
232
201
static READ16_HANDLER( characteriser16_r );
233
202
static WRITE16_HANDLER( characteriser16_w );
204
static READ16_HANDLER( bwb_characteriser16_r );
205
static WRITE16_HANDLER( bwb_characteriser16_w );
236
207
/*************************************
257
static void update_mpu68_interrupts(running_machine *machine)
228
static void update_mpu68_interrupts(running_machine &machine)
259
cputag_set_input_line(machine, "video", 1, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
260
cputag_set_input_line(machine, "video", 2, m6850_irq_state ? CLEAR_LINE : ASSERT_LINE);
261
cputag_set_input_line(machine, "video", 3, scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE);
230
mpu4_state *state = machine.driver_data<mpu4_state>();
231
cputag_set_input_line(machine, "video", 1, state->m_m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
232
cputag_set_input_line(machine, "video", 2, state->m_m6850_irq_state ? CLEAR_LINE : ASSERT_LINE);
233
cputag_set_input_line(machine, "video", 3, state->m_scn2674_irq_state ? ASSERT_LINE : CLEAR_LINE);
264
236
/* Communications with 6809 board */
265
/* Clock values are currently unknown, and are derived from the 68k board.*/
267
238
static READ_LINE_DEVICE_HANDLER( m6809_acia_rx_r )
269
return m68k_m6809_line;
240
mpu4_state *state = device->machine().driver_data<mpu4_state>();
241
return state->m_m68k_m6809_line;
272
244
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_tx_w )
274
m6809_m68k_line = state;
246
mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
247
drvstate->m_m6809_m68k_line = state;
277
250
static READ_LINE_DEVICE_HANDLER( m6809_acia_cts_r )
279
return m6809_acia_cts;
252
mpu4_state *state = device->machine().driver_data<mpu4_state>();
253
return state->m_m6809_acia_cts;
282
256
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_rts_w )
284
m6809_acia_rts = state;
258
mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
259
drvstate->m_m6809_acia_rts = state;
287
262
static READ_LINE_DEVICE_HANDLER( m6809_acia_dcd_r )
289
return m6809_acia_dcd;
264
mpu4_state *state = device->machine().driver_data<mpu4_state>();
265
return state->m_m6809_acia_dcd;
292
268
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_irq )
294
m68k_acia_cts = !state;
295
cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
270
mpu4_state *drvstate = device->machine().driver_data<mpu4_state>();
271
drvstate->m_m68k_acia_cts = !state;
272
cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
298
275
static ACIA6850_INTERFACE( m6809_acia_if )
461
static UINT8 IR0_scn2674_double_ht_wd;
462
static UINT8 IR0_scn2674_scanline_per_char_row;
463
static UINT8 IR0_scn2674_sync_select;
464
static UINT8 IR0_scn2674_buffer_mode_select;
465
static UINT8 IR1_scn2674_interlace_enable;
466
static UINT8 IR1_scn2674_equalizing_constant;
467
static UINT8 IR2_scn2674_row_table;
468
static UINT8 IR2_scn2674_horz_sync_width;
469
static UINT8 IR2_scn2674_horz_back_porch;
470
static UINT8 IR3_scn2674_vert_front_porch;
471
static UINT8 IR3_scn2674_vert_back_porch;
472
static UINT8 IR4_scn2674_rows_per_screen;
473
static UINT8 IR4_scn2674_character_blink_rate;
474
static UINT8 IR5_scn2674_character_per_row;
475
static UINT8 IR8_scn2674_display_buffer_first_address_LSB;
476
static UINT8 IR9_scn2674_display_buffer_first_address_MSB;
477
static UINT8 IR9_scn2674_display_buffer_last_address;
478
static UINT8 IR10_scn2674_display_pointer_address_lower;
479
static UINT8 IR11_scn2674_display_pointer_address_upper;
480
static UINT8 IR12_scn2674_scroll_start;
481
static UINT8 IR12_scn2674_split_register_1;
482
static UINT8 IR13_scn2674_scroll_end;
483
static UINT8 IR13_scn2674_split_register_2;
486
static VIDEO_UPDATE( mpu4_vid )
447
static SCREEN_UPDATE( mpu4_vid )
449
mpu4_state *state = screen->machine().driver_data<mpu4_state>();
488
450
int x, y/*, count = 0*/;
490
452
bitmap_fill(bitmap,cliprect,0);
572
static void scn2674_write_init_regs(UINT8 data)
536
static void scn2674_write_init_regs(mpu4_state *state, UINT8 data)
574
LOGSTUFF(("scn2674_write_init_regs %02x %02x\n",scn2675_IR_pointer,data));
576
scn2674_IR[scn2675_IR_pointer]=data;
579
switch ( scn2675_IR_pointer) /* display some debug info, set mame specific variables */
538
LOGSTUFF(("scn2674_write_init_regs %02x %02x\n",state->m_scn2675_IR_pointer,data));
540
state->m_scn2674_IR[state->m_scn2675_IR_pointer]=data;
543
switch ( state->m_scn2675_IR_pointer) /* display some debug info, set mame specific variables */
582
IR0_scn2674_double_ht_wd = (data & 0x80)>>7;
583
IR0_scn2674_scanline_per_char_row = (data & 0x78)>>3;
584
IR0_scn2674_sync_select = (data&0x04)>>2;
585
IR0_scn2674_buffer_mode_select = (data&0x03);
546
state->m_IR0_scn2674_double_ht_wd = (data & 0x80)>>7;
547
state->m_IR0_scn2674_scanline_per_char_row = (data & 0x78)>>3;
548
state->m_IR0_scn2674_sync_select = (data&0x04)>>2;
549
state->m_IR0_scn2674_buffer_mode_select = (data&0x03);
587
LOGSTUFF(("IR0 - Double Ht Wd %02x\n",IR0_scn2674_double_ht_wd));
588
LOGSTUFF(("IR0 - Scanlines per Character Row %02x\n",IR0_scn2674_scanline_per_char_row));
589
LOGSTUFF(("IR0 - Sync Select %02x\n",IR0_scn2674_sync_select));
590
LOGSTUFF(("IR0 - Buffer Mode Select %02x\n",IR0_scn2674_buffer_mode_select));
551
LOGSTUFF(("IR0 - Double Ht Wd %02x\n",state->m_IR0_scn2674_double_ht_wd));
552
LOGSTUFF(("IR0 - Scanlines per Character Row %02x\n",state->m_IR0_scn2674_scanline_per_char_row));
553
LOGSTUFF(("IR0 - Sync Select %02x\n",state->m_IR0_scn2674_sync_select));
554
LOGSTUFF(("IR0 - Buffer Mode Select %02x\n",state->m_IR0_scn2674_buffer_mode_select));
594
IR1_scn2674_interlace_enable = (data&0x80)>>7;
595
IR1_scn2674_equalizing_constant = (data&0x7f);
558
state->m_IR1_scn2674_interlace_enable = (data&0x80)>>7;
559
state->m_IR1_scn2674_equalizing_constant = (data&0x7f);
597
LOGSTUFF(("IR1 - Interlace Enable %02x\n",IR1_scn2674_interlace_enable));
598
LOGSTUFF(("IR1 - Equalizing Constant %02x\n",IR1_scn2674_equalizing_constant));
561
LOGSTUFF(("IR1 - Interlace Enable %02x\n",state->m_IR1_scn2674_interlace_enable));
562
LOGSTUFF(("IR1 - Equalizing Constant %02x\n",state->m_IR1_scn2674_equalizing_constant));
602
IR2_scn2674_row_table = (data&0x80)>>7;
603
IR2_scn2674_horz_sync_width = (data&0x78)>>3;
604
IR2_scn2674_horz_back_porch = (data&0x07);
566
state->m_IR2_scn2674_row_table = (data&0x80)>>7;
567
state->m_IR2_scn2674_horz_sync_width = (data&0x78)>>3;
568
state->m_IR2_scn2674_horz_back_porch = (data&0x07);
606
LOGSTUFF(("IR2 - Row Table %02x\n",IR2_scn2674_row_table));
607
LOGSTUFF(("IR2 - Horizontal Sync Width %02x\n",IR2_scn2674_horz_sync_width));
608
LOGSTUFF(("IR2 - Horizontal Back Porch %02x\n",IR2_scn2674_horz_back_porch));
570
LOGSTUFF(("IR2 - Row Table %02x\n",state->m_IR2_scn2674_row_table));
571
LOGSTUFF(("IR2 - Horizontal Sync Width %02x\n",state->m_IR2_scn2674_horz_sync_width));
572
LOGSTUFF(("IR2 - Horizontal Back Porch %02x\n",state->m_IR2_scn2674_horz_back_porch));
612
IR3_scn2674_vert_front_porch = (data&0xe0)>>5;
613
IR3_scn2674_vert_back_porch = (data&0x1f)>>0;
576
state->m_IR3_scn2674_vert_front_porch = (data&0xe0)>>5;
577
state->m_IR3_scn2674_vert_back_porch = (data&0x1f)>>0;
615
LOGSTUFF(("IR3 - Vertical Front Porch %02x\n",IR3_scn2674_vert_front_porch));
616
LOGSTUFF(("IR3 - Vertical Back Porch %02x\n",IR3_scn2674_vert_back_porch));
579
LOGSTUFF(("IR3 - Vertical Front Porch %02x\n",state->m_IR3_scn2674_vert_front_porch));
580
LOGSTUFF(("IR3 - Vertical Back Porch %02x\n",state->m_IR3_scn2674_vert_back_porch));
620
IR4_scn2674_rows_per_screen = data&0x7f;
621
IR4_scn2674_character_blink_rate = (data & 0x80)>>7;
584
state->m_IR4_scn2674_rows_per_screen = data&0x7f;
585
state->m_IR4_scn2674_character_blink_rate = (data & 0x80)>>7;
623
LOGSTUFF(("IR4 - Rows Per Screen %02x\n",IR4_scn2674_rows_per_screen));
624
LOGSTUFF(("IR4 - Character Blink Rate %02x\n",IR4_scn2674_character_blink_rate));
587
LOGSTUFF(("IR4 - Rows Per Screen %02x\n",state->m_IR4_scn2674_rows_per_screen));
588
LOGSTUFF(("IR4 - Character Blink Rate %02x\n",state->m_IR4_scn2674_character_blink_rate));
628
592
/* IR5 - Active Characters Per Row
630
594
c = Characters Per Row */
631
IR5_scn2674_character_per_row = data;
632
LOGSTUFF(("IR5 - Active Characters Per Row %02x\n",IR5_scn2674_character_per_row));
595
state->m_IR5_scn2674_character_per_row = data;
596
LOGSTUFF(("IR5 - Active Characters Per Row %02x\n",state->m_IR5_scn2674_character_per_row));
642
IR8_scn2674_display_buffer_first_address_LSB = data;
643
LOGSTUFF(("IR8 - Display Buffer First Address LSB %02x\n",IR8_scn2674_display_buffer_first_address_LSB));
606
state->m_IR8_scn2674_display_buffer_first_address_LSB = data;
607
LOGSTUFF(("IR8 - Display Buffer First Address LSB %02x\n",state->m_IR8_scn2674_display_buffer_first_address_LSB));
647
IR9_scn2674_display_buffer_first_address_MSB = data & 0x0f;
648
IR9_scn2674_display_buffer_last_address = (data & 0xf0)>>4;
649
LOGSTUFF(("IR9 - Display Buffer First Address MSB %02x\n",IR9_scn2674_display_buffer_first_address_MSB));
650
LOGSTUFF(("IR9 - Display Buffer Last Address %02x\n",IR9_scn2674_display_buffer_last_address));
611
state->m_IR9_scn2674_display_buffer_first_address_MSB = data & 0x0f;
612
state->m_IR9_scn2674_display_buffer_last_address = (data & 0xf0)>>4;
613
LOGSTUFF(("IR9 - Display Buffer First Address MSB %02x\n",state->m_IR9_scn2674_display_buffer_first_address_MSB));
614
LOGSTUFF(("IR9 - Display Buffer Last Address %02x\n",state->m_IR9_scn2674_display_buffer_last_address));
654
IR10_scn2674_display_pointer_address_lower = data;
655
LOGSTUFF(("IR10 - Display Pointer Address Lower %02x\n",IR10_scn2674_display_pointer_address_lower));
618
state->m_IR10_scn2674_display_pointer_address_lower = data;
619
LOGSTUFF(("IR10 - Display Pointer Address Lower %02x\n",state->m_IR10_scn2674_display_pointer_address_lower));
659
IR11_scn2674_display_pointer_address_upper= data&0x3f;
660
LOGSTUFF(("IR11 - Display Pointer Address Lower %02x\n",IR11_scn2674_display_pointer_address_upper));
623
state->m_IR11_scn2674_display_pointer_address_upper= data&0x3f;
624
LOGSTUFF(("IR11 - Display Pointer Address Lower %02x\n",state->m_IR11_scn2674_display_pointer_address_upper));
664
IR12_scn2674_scroll_start = (data & 0x80)>>7;
665
IR12_scn2674_split_register_1 = (data & 0x7f);
666
LOGSTUFF(("IR12 - Scroll Start %02x\n",IR12_scn2674_scroll_start));
667
LOGSTUFF(("IR12 - Split Register 1 %02x\n",IR12_scn2674_split_register_1));
628
state->m_IR12_scn2674_scroll_start = (data & 0x80)>>7;
629
state->m_IR12_scn2674_split_register_1 = (data & 0x7f);
630
LOGSTUFF(("IR12 - Scroll Start %02x\n",state->m_IR12_scn2674_scroll_start));
631
LOGSTUFF(("IR12 - Split Register 1 %02x\n",state->m_IR12_scn2674_split_register_1));
671
IR13_scn2674_scroll_end = (data & 0x80)>>7;
672
IR13_scn2674_split_register_2 = (data & 0x7f);
673
LOGSTUFF(("IR13 - Scroll End %02x\n",IR13_scn2674_scroll_end));
674
LOGSTUFF(("IR13 - Split Register 2 %02x\n",IR13_scn2674_split_register_2));
635
state->m_IR13_scn2674_scroll_end = (data & 0x80)>>7;
636
state->m_IR13_scn2674_split_register_2 = (data & 0x7f);
637
LOGSTUFF(("IR13 - Scroll End %02x\n",state->m_IR13_scn2674_scroll_end));
638
LOGSTUFF(("IR13 - Split Register 2 %02x\n",state->m_IR13_scn2674_split_register_2));
941
LOGSTUFF(("Read Irq Register %06x\n",cpu_get_pc(space->cpu)));
942
return scn2674_irq_register;
907
LOGSTUFF(("Read Irq Register %06x\n",cpu_get_pc(&space->device())));
908
return state->m_scn2674_irq_register;
945
LOGSTUFF(("Read Status Register %06x\n",cpu_get_pc(space->cpu)));
946
return scn2674_status_register;
911
LOGSTUFF(("Read Status Register %06x\n",cpu_get_pc(&space->device())));
912
return state->m_scn2674_status_register;
948
case 2: LOGSTUFF(("Read Screen1_l Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen1_l;
949
case 3: LOGSTUFF(("Read Screen1_h Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen1_h;
950
case 4: LOGSTUFF(("Read Cursor_l Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_cursor_l;
951
case 5: LOGSTUFF(("Read Cursor_h Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_cursor_h;
952
case 6: LOGSTUFF(("Read Screen2_l Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen2_l;
953
case 7: LOGSTUFF(("Read Screen2_h Register %06x\n",cpu_get_pc(space->cpu)));return scn2674_screen2_h;
914
case 2: LOGSTUFF(("Read Screen1_l Register %06x\n",cpu_get_pc(&space->device())));return state->m_scn2674_screen1_l;
915
case 3: LOGSTUFF(("Read Screen1_h Register %06x\n",cpu_get_pc(&space->device())));return state->m_scn2674_screen1_h;
916
case 4: LOGSTUFF(("Read Cursor_l Register %06x\n",cpu_get_pc(&space->device())));return state->m_scn2674_cursor_l;
917
case 5: LOGSTUFF(("Read Cursor_h Register %06x\n",cpu_get_pc(&space->device())));return state->m_scn2674_cursor_h;
918
case 6: LOGSTUFF(("Read Screen2_l Register %06x\n",cpu_get_pc(&space->device())));return state->m_scn2674_screen2_l;
919
case 7: LOGSTUFF(("Read Screen2_h Register %06x\n",cpu_get_pc(&space->device())));return state->m_scn2674_screen2_h;
979
scn2674_write_init_regs(data);
946
scn2674_write_init_regs(state, data);
983
scn2674_write_command(space->machine, data);
950
scn2674_write_command(space->machine(), data);
986
case 2: scn2674_screen1_l = data; break;
987
case 3: scn2674_screen1_h = data; break;
988
case 4: scn2674_cursor_l = data; break;
989
case 5: scn2674_cursor_h = data; break;
990
case 6: scn2674_screen2_l = data; break;
991
case 7: scn2674_screen2_h = data; break;
953
case 2: state->m_scn2674_screen1_l = data; break;
954
case 3: state->m_scn2674_screen1_h = data; break;
955
case 4: state->m_scn2674_cursor_l = data; break;
956
case 5: state->m_scn2674_cursor_h = data; break;
957
case 6: state->m_scn2674_screen2_l = data; break;
958
case 7: state->m_scn2674_screen2_h = data; break;
996
963
static VIDEO_START( mpu4_vid )
965
mpu4_state *state = machine.driver_data<mpu4_state>();
998
966
/* if anything uses tile sizes other than 8x8 we can't really do it this way.. we'll have to draw tiles by hand.
999
967
maybe we will anyway, but for now we don't need to */
1001
mpu4_vid_vidram = auto_alloc_array(machine, UINT16, 0x20000/2);
969
state->m_vid_vidram = auto_alloc_array(machine, UINT16, 0x20000/2);
1003
memset(mpu4_vid_vidram,0,0x20000);
971
memset(state->m_vid_vidram,0,0x20000);
1005
973
/* find first empty slot to decode gfx */
1006
for (mpu4_gfx_index = 0; mpu4_gfx_index < MAX_GFX_ELEMENTS; mpu4_gfx_index++)
1007
if (machine->gfx[mpu4_gfx_index] == 0)
974
for (state->m_gfx_index = 0; state->m_gfx_index < MAX_GFX_ELEMENTS; state->m_gfx_index++)
975
if (machine.gfx[state->m_gfx_index] == 0)
1010
assert(mpu4_gfx_index != MAX_GFX_ELEMENTS);
978
assert(state->m_gfx_index != MAX_GFX_ELEMENTS);
1012
980
/* create the char set (gfx will then be updated dynamically from RAM) */
1013
machine->gfx[mpu4_gfx_index+0] = gfx_element_alloc(machine, &mpu4_vid_char_8x8_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0);
1014
machine->gfx[mpu4_gfx_index+1] = gfx_element_alloc(machine, &mpu4_vid_char_8x16_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0);
1015
machine->gfx[mpu4_gfx_index+2] = gfx_element_alloc(machine, &mpu4_vid_char_16x8_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0);
1016
machine->gfx[mpu4_gfx_index+3] = gfx_element_alloc(machine, &mpu4_vid_char_16x16_layout, (UINT8 *)mpu4_vid_vidram, machine->total_colors() / 16, 0);
981
machine.gfx[state->m_gfx_index+0] = gfx_element_alloc(machine, &mpu4_vid_char_8x8_layout, (UINT8 *)state->m_vid_vidram, machine.total_colors() / 16, 0);
982
machine.gfx[state->m_gfx_index+1] = gfx_element_alloc(machine, &mpu4_vid_char_8x16_layout, (UINT8 *)state->m_vid_vidram, machine.total_colors() / 16, 0);
983
machine.gfx[state->m_gfx_index+2] = gfx_element_alloc(machine, &mpu4_vid_char_16x8_layout, (UINT8 *)state->m_vid_vidram, machine.total_colors() / 16, 0);
984
machine.gfx[state->m_gfx_index+3] = gfx_element_alloc(machine, &mpu4_vid_char_16x16_layout, (UINT8 *)state->m_vid_vidram, machine.total_colors() / 16, 0);
1018
scn2675_IR_pointer = 0;
986
state->m_scn2675_IR_pointer = 0;
1879
1914
static void video_reset(device_t *device)
1881
device->machine->device("6840ptm_68k")->reset();
1882
device->machine->device("acia6850_1")->reset();
1916
device->machine().device("6840ptm_68k")->reset();
1917
device->machine().device("acia6850_1")->reset();
1885
1920
/* machine start (called only once) */
1886
1921
static MACHINE_START( mpu4_vid )
1923
mpu4_state *state = machine.driver_data<mpu4_state>();
1888
1924
mpu4_config_common(machine);
1926
state->m_mod_number=4; //No AY chip
1890
1927
/* setup communications */
1891
serial_card_connected = 1;
1928
state->m_link7a_connected = 1;
1893
1930
/* setup 8 mechanical meters */
1896
/* setup 4 reels (for hybrid machines) */
1897
stepper_config(machine, 0, &barcrest_reel_interface);
1898
stepper_config(machine, 1, &barcrest_reel_interface);
1899
stepper_config(machine, 2, &barcrest_reel_interface);
1900
stepper_config(machine, 3, &barcrest_reel_interface);
1931
MechMtr_config(machine,8);
1902
1933
/* setup the standard oki MSC1937 display */
1903
1934
ROC10937_init(0, MSC1937, 0);
1905
1936
/* Hook the reset line */
1906
m68k_set_reset_callback(machine->device("video"), video_reset);
1937
m68k_set_reset_callback(machine.device("video"), video_reset);
1909
1940
static MACHINE_RESET( mpu4_vid )
1942
mpu4_state *state = machine.driver_data<mpu4_state>();
1911
1943
ROC10937_reset(0);
1913
mpu4_stepper_reset();
1945
mpu4_stepper_reset(state);
1947
state->m_lamp_strobe = 0;
1948
state->m_lamp_strobe2 = 0;
1949
state->m_led_strobe = 0;
1951
state->m_IC23GC = 0;
1952
state->m_IC23GB = 0;
1953
state->m_IC23GA = 0;
1954
state->m_IC23G1 = 1;
1955
state->m_IC23G2A = 0;
1956
state->m_IC23G2B = 0;
1958
state->m_prot_col = 0;
1929
static ADDRESS_MAP_START( mpu4_68k_map, ADDRESS_SPACE_PROGRAM, 16 )
1961
static ADDRESS_MAP_START( mpu4_68k_map, AS_PROGRAM, 16 )
1930
1962
AM_RANGE(0x000000, 0x7fffff) AM_ROM
1931
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE(&mpu4_vid_mainram)
1963
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER(mpu4_state, m_vid_mainram)
1932
1964
AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff)
1933
1965
AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff)
1934
1966
AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w)
1976
2008
/* AM_RANGE(0xffd000, 0xffd00f) AM_READWRITE(characteriser16_r, characteriser16_w) Word-based version of old CHR??? */
1977
2009
ADDRESS_MAP_END
2011
static ADDRESS_MAP_START( bwbvid_6809_map, AS_PROGRAM, 8 )
2012
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
2013
AM_RANGE(0x0800, 0x0800) AM_DEVREADWRITE("acia6850_0", acia6850_stat_r, acia6850_ctrl_w)
2014
AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("acia6850_0", acia6850_data_r, acia6850_data_w)
2015
AM_RANGE(0x0880, 0x0881) //AM_NOP //Read/write here
2016
AM_RANGE(0x0900, 0x0907) AM_DEVREADWRITE("ptm_ic2", ptm6840_read, ptm6840_write)
2017
AM_RANGE(0x0a00, 0x0a03) AM_DEVREADWRITE("pia_ic3", pia6821_r, pia6821_w)
2018
AM_RANGE(0x0b00, 0x0b03) AM_DEVREADWRITE("pia_ic4", pia6821_r, pia6821_w)
2019
AM_RANGE(0x0c00, 0x0c03) AM_DEVREADWRITE("pia_ic5", pia6821_r, pia6821_w)
2020
AM_RANGE(0x0d00, 0x0d03) AM_DEVREADWRITE("pia_ic6", pia6821_r, pia6821_w)
2021
AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_r, pia6821_w)
2022
AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_r, pia6821_w)
2023
AM_RANGE(0x4000, 0x7fff) AM_RAM
2024
AM_RANGE(0xbe00, 0xbfff) AM_RAM
2025
AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("maincpu",0) /* 64k EPROM on board, only this region read */
2028
static ADDRESS_MAP_START( bwbvid_68k_map, AS_PROGRAM, 16 )
2029
AM_RANGE(0x000000, 0x7fffff) AM_ROM
2030
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER(mpu4_state, m_vid_mainram)
2031
AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */
2032
AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff)
2033
AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff)
2034
AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w)
2035
// AM_RANGE(0xa00000, 0xa0000f) AM_READWRITE(bt471_r,bt471_w) //Some games use this
2036
/* AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */
2037
AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w)
2038
AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(mpu4_vid_vidram_r, mpu4_vid_vidram_w)
2039
AM_RANGE(0xe00000, 0xe00001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff)
2040
AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff)
2041
AM_RANGE(0xe01000, 0xe0100f) AM_DEVREADWRITE8("6840ptm_68k", ptm6840_read, ptm6840_write, 0xff)
2042
//AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(bwb_characteriser16_r, bwb_characteriser16_w)//AM_READWRITE(adpcm_r, adpcm_w) CHR ?
2045
static ADDRESS_MAP_START( bwbvid5_68k_map, AS_PROGRAM, 16 )
2046
AM_RANGE(0x000000, 0x7fffff) AM_ROM
2047
AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_BASE_MEMBER(mpu4_state, m_vid_mainram)
2048
AM_RANGE(0x810000, 0x81ffff) AM_RAM /* ? */
2049
AM_RANGE(0x900000, 0x900001) AM_DEVWRITE8("saa", saa1099_data_w, 0x00ff)
2050
AM_RANGE(0x900002, 0x900003) AM_DEVWRITE8("saa", saa1099_control_w, 0x00ff)
2051
AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(ef9369_r, ef9369_w)
2052
//AM_RANGE(0xa00000, 0xa00003) AM_READWRITE(bt471_r,bt471_w) Some games use this
2053
/* AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(mpu4_vid_unmap_r, mpu4_vid_unmap_w) */
2054
AM_RANGE(0xb00000, 0xb0000f) AM_READWRITE(mpu4_vid_scn2674_r, mpu4_vid_scn2674_w)
2055
AM_RANGE(0xc00000, 0xc1ffff) AM_READWRITE(mpu4_vid_vidram_r, mpu4_vid_vidram_w)
2056
AM_RANGE(0xe00000, 0xe00001) AM_DEVREADWRITE8("acia6850_1", acia6850_stat_r, acia6850_ctrl_w, 0xff)
2057
AM_RANGE(0xe00002, 0xe00003) AM_DEVREADWRITE8("acia6850_1", acia6850_data_r, acia6850_data_w, 0xff)
2058
AM_RANGE(0xe01000, 0xe0100f) AM_DEVREADWRITE8("6840ptm_68k", ptm6840_read, ptm6840_write, 0xff)
2059
AM_RANGE(0xe02000, 0xe02007) AM_DEVREADWRITE8("pia_ic4ss", pia6821_r, pia6821_w, 0xff)
2060
AM_RANGE(0xe03000, 0xe0300f) AM_DEVREADWRITE8("6840ptm_ic3ss", ptm6840_read, ptm6840_write, 0xff)
2061
AM_RANGE(0xa00004, 0xa0000f) AM_READWRITE(bwb_characteriser16_r, bwb_characteriser16_w)//AM_READWRITE(adpcm_r, adpcm_w) CHR ?
1981
2065
/* Deal 'Em was designed as an enhanced gamecard, to fit into an existing MPU4 cabinet
1982
2066
It's an unoffical addon, and does all its work through the existing 6809 CPU.
1983
2067
Although given unofficial status, Barcrest's patent on the MPU4 Video hardware (GB1596363) describes
1984
the Deal 'Em board design, rather than the one they ultimately used, suggesting some sort of licensing deal. */
2068
the Deal 'Em board design, rather than the one they ultimately used, suggesting some sort of licensing deal.
2069
Perhaps this was the (seemingly very rare) MPU3 Video card design? */
1986
2071
static const gfx_layout dealemcharlayout =
2124
2209
AM_RANGE(0x0e00, 0x0e03) AM_DEVREADWRITE("pia_ic7", pia6821_r, pia6821_w) /* PIA6821 IC7 */
2125
2210
AM_RANGE(0x0f00, 0x0f03) AM_DEVREADWRITE("pia_ic8", pia6821_r, pia6821_w) /* PIA6821 IC8 */
2127
AM_RANGE(0x1000, 0x2fff) AM_RAM AM_BASE(&dealem_videoram)
2212
AM_RANGE(0x1000, 0x2fff) AM_RAM AM_BASE_MEMBER(mpu4_state, m_dealem_videoram)
2128
2213
AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITENOP/* 64k paged ROM (4 pages) */
2129
2214
ADDRESS_MAP_END
2131
static int rowcounter = 0;
2132
static int linecounter = 0;
2135
2218
static TIMER_DEVICE_CALLBACK( scanline_timer_callback )
2220
mpu4_state *state = timer.machine().driver_data<mpu4_state>();
2137
2221
int current_scanline=param;
2138
timer_call_after_resynch(timer.machine, NULL, 0, 0);
2222
timer.machine().scheduler().synchronize();
2141
2225
if (current_scanline==0)
2143
2227
// these will be used to track which row / line we're on eventually
2144
2228
// and used by the renderer to render the correct data
2145
rowcounter = 0; linecounter = 0;
2147
// scn2674_status_register &= ~0x10; // clear vblank
2149
scn2674_status_register |= 0x02;
2229
state->m_rowcounter = 0; state->m_linecounter = 0;
2231
// state->m_scn2674_status_register &= ~0x10; // clear vblank
2233
state->m_scn2674_status_register |= 0x02;
2150
2234
/* Ready - this triggers for the first scanline of the screen */
2151
if (scn2674_irq_mask&0x02)
2235
if (state->m_scn2674_irq_mask&0x02)
2153
2237
LOGSTUFF(("SCN2674 Ready\n"));
2154
scn2674_irq_state = 1;
2155
scn2674_irq_register |= 0x02;
2156
update_mpu68_interrupts(timer.machine);
2238
state->m_scn2674_irq_state = 1;
2239
state->m_scn2674_irq_register |= 0x02;
2240
update_mpu68_interrupts(timer.machine());
2160
2244
// should be triggered at the start of each ROW (line zero for that row)
2161
2245
if ((current_scanline%8 == 7) && (current_scanline<296))
2163
scn2674_status_register |= 0x08;
2164
if (scn2674_irq_mask&0x08)
2247
state->m_scn2674_status_register |= 0x08;
2248
if (state->m_scn2674_irq_mask&0x08)
2166
2250
LOGSTUFF(("SCN2674 Line Zero\n"));
2167
scn2674_irq_state = 1;
2168
scn2674_irq_register |= 0x08;
2169
update_mpu68_interrupts(timer.machine);
2251
state->m_scn2674_irq_state = 1;
2252
state->m_scn2674_irq_register |= 0x08;
2253
update_mpu68_interrupts(timer.machine());
2173
2257
// this is ROWS not scanlines!!
2174
if (current_scanline == IR12_scn2674_split_register_1*8)
2258
if (current_scanline == state->m_IR12_scn2674_split_register_1*8)
2175
2259
/* Split Screen 1 */
2177
if (scn2674_screen2_h & 0x40)
2261
if (state->m_scn2674_screen2_h & 0x40)
2179
2263
popmessage("Split screen 1 address shift required, contact MAMEDEV");
2181
scn2674_status_register |= 0x04;
2182
if (scn2674_irq_mask&0x04)
2265
state->m_scn2674_status_register |= 0x04;
2266
if (state->m_scn2674_irq_mask&0x04)
2184
2268
LOGSTUFF(("SCN2674 Split Screen 1\n"));
2185
scn2674_irq_state = 1;
2186
update_mpu68_interrupts(timer.machine);
2187
timer.machine->primary_screen->update_partial(timer.machine->primary_screen->vpos());
2269
state->m_scn2674_irq_state = 1;
2270
update_mpu68_interrupts(timer.machine());
2271
timer.machine().primary_screen->update_partial(timer.machine().primary_screen->vpos());
2189
scn2674_irq_register |= 0x04;
2273
state->m_scn2674_irq_register |= 0x04;
2193
2277
// this is in ROWS not scanlines!!!
2194
if (current_scanline == IR13_scn2674_split_register_2*8)
2278
if (current_scanline == state->m_IR13_scn2674_split_register_2*8)
2195
2279
/* Split Screen 2 */
2197
if (scn2674_screen2_h & 0x80)
2281
if (state->m_scn2674_screen2_h & 0x80)
2199
2283
popmessage("Split screen 2 address shift required, contact MAMEDEV");
2201
scn2674_status_register |= 0x01;
2202
if (scn2674_irq_mask&0x01)
2285
state->m_scn2674_status_register |= 0x01;
2286
if (state->m_scn2674_irq_mask&0x01)
2204
2288
LOGSTUFF(("SCN2674 Split Screen 2 irq\n"));
2205
scn2674_irq_state = 1;
2206
scn2674_irq_register |= 0x01;
2207
update_mpu68_interrupts(timer.machine);
2208
timer.machine->primary_screen->update_partial(timer.machine->primary_screen->vpos());
2289
state->m_scn2674_irq_state = 1;
2290
state->m_scn2674_irq_register |= 0x01;
2291
update_mpu68_interrupts(timer.machine());
2292
timer.machine().primary_screen->update_partial(timer.machine().primary_screen->vpos());
2214
2298
if (current_scanline == 300)
2216
/* if (scn2674_display_enabled) ? */
2300
/* if (state->m_scn2674_display_enabled) ? */
2218
if (scn2674_irq_mask&0x10)
2302
state->m_scn2674_status_register |= 0x10;
2303
if (state->m_scn2674_irq_mask&0x10)
2220
2305
LOGSTUFF(("vblank irq\n"));
2221
scn2674_irq_state = 1;
2222
update_mpu68_interrupts(timer.machine);
2224
scn2674_irq_register |= 0x10;
2306
state->m_scn2674_irq_state = 1;
2307
state->m_scn2674_irq_register |= 0x10;
2308
update_mpu68_interrupts(timer.machine());
2227
scn2674_status_register |= 0x10;
2230
2313
// printf("scanline %d\n",current_scanline);
2234
static MACHINE_CONFIG_START( mpu4_vid, driver_device )
2317
static MACHINE_CONFIG_START( mpu4_vid, mpu4_state )
2235
2318
MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4 )
2236
2319
MCFG_CPU_PROGRAM_MAP(mpu4_6809_map)
2237
MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, HZ(100))
2320
MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100))
2239
2322
MCFG_NVRAM_ADD_0FILL("nvram") /* confirm */
2242
MCFG_PTM6840_ADD("6840ptm", ptm_ic2_intf)
2325
MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf)
2244
2327
MCFG_PIA6821_ADD("pia_ic3", pia_ic3_intf)
2245
2328
MCFG_PIA6821_ADD("pia_ic4", pia_ic4_intf)
2302
2379
MCFG_CPU_PROGRAM_MAP(vp_68k_map)
2303
2380
MACHINE_CONFIG_END
2382
static MACHINE_CONFIG_START( bwbvid, mpu4_state )
2383
MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4 )
2384
MCFG_CPU_PROGRAM_MAP(bwbvid_6809_map)
2385
MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100))
2387
MCFG_NVRAM_ADD_0FILL("nvram") /* confirm */
2390
MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf)
2392
MCFG_PIA6821_ADD("pia_ic3", pia_ic3_intf)
2393
MCFG_PIA6821_ADD("pia_ic4", pia_ic4_intf)
2394
MCFG_PIA6821_ADD("pia_ic5", pia_ic5_intf)
2395
MCFG_PIA6821_ADD("pia_ic6", pia_ic6_intf)
2396
MCFG_PIA6821_ADD("pia_ic7", pia_ic7_intf)
2397
MCFG_PIA6821_ADD("pia_ic8", pia_ic8_intf)
2399
/* video hardware */
2400
MCFG_SCREEN_ADD("screen", RASTER)
2401
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
2402
MCFG_SCREEN_SIZE(64*8, 40*8) // note this directly affects the scanline counters used below, and thus the timing of everything
2403
MCFG_SCREEN_VISIBLE_AREA(0*8, 63*8-1, 0*8, 37*8-1)
2404
MCFG_SCREEN_REFRESH_RATE(50)
2405
MCFG_SCREEN_UPDATE(mpu4_vid)
2407
MCFG_CPU_ADD("video", M68000, VIDEO_MASTER_CLOCK )
2408
MCFG_CPU_PROGRAM_MAP(bwbvid_68k_map)
2410
MCFG_QUANTUM_TIME(attotime::from_hz(960))
2412
MCFG_MACHINE_START(mpu4_vid)
2413
MCFG_MACHINE_RESET(mpu4_vid)
2414
MCFG_VIDEO_START (mpu4_vid)
2416
MCFG_PALETTE_LENGTH(16)
2418
MCFG_PTM6840_ADD("6840ptm_68k", ptm_vid_intf)
2420
/* Present on all video cards */
2421
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
2422
MCFG_SOUND_ADD("saa", SAA1099, 8000000)
2423
MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
2424
MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
2426
MCFG_ACIA6850_ADD("acia6850_0", m6809_acia_if)
2427
MCFG_ACIA6850_ADD("acia6850_1", m68k_acia_if)
2429
// for the video timing
2430
MCFG_TIMER_ADD_SCANLINE("scan_timer", scanline_timer_callback, "screen", 0, 1)
2433
static MACHINE_CONFIG_DERIVED( bwbvid5, bwbvid )
2434
MCFG_CPU_MODIFY("video")
2435
MCFG_CPU_PROGRAM_MAP(bwbvid5_68k_map)
2437
MCFG_PTM6840_ADD("6840ptm_ic3ss", ptm_ic3ss_intf)
2438
MCFG_PIA6821_ADD("pia_ic4ss", pia_ic4ss_intf)
2440
MCFG_SOUND_ADD("msm6376", OKIM6376, 64000) //?
2441
MCFG_SOUND_ROUTE(0, "lspeaker", 0.5)
2442
MCFG_SOUND_ROUTE(1, "rspeaker", 0.5)
2307
2446
/* machine driver for Zenitone Deal 'Em board */
2308
static MACHINE_CONFIG_START( dealem, driver_device )
2447
static MACHINE_CONFIG_START( dealem, mpu4_state )
2309
2448
MCFG_MACHINE_START(mpu4mod2) /* main mpu4 board initialisation */
2310
2449
MCFG_MACHINE_RESET(mpu4_vid)
2311
2450
MCFG_CPU_ADD("maincpu", M6809, MPU4_MASTER_CLOCK/4)
2312
2451
MCFG_CPU_PROGRAM_MAP(dealem_memmap)
2314
MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, HZ(100))
2453
MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100))
2316
MCFG_PTM6840_ADD("6840ptm", ptm_ic2_intf)
2455
MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf)
2318
2457
MCFG_PIA6821_ADD("pia_ic3", pia_ic3_intf)
2319
2458
MCFG_PIA6821_ADD("pia_ic4", pia_ic4_intf)
2394
2534
static READ16_HANDLER( characteriser16_r )
2396
LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(space->cpu),offset,mpu4_current_chr_table[prot_col].response));
2536
mpu4_state *state = space->machine().driver_data<mpu4_state>();
2537
LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(&space->device()),offset,state->m_current_chr_table[state->m_prot_col].response));
2397
2538
LOG_CHR(("Characteriser read offset %02X \n",offset));
2398
LOG_CHR(("Characteriser read data %02X \n",mpu4_current_chr_table[prot_col].response));
2539
LOG_CHR(("Characteriser read data %02X \n",state->m_current_chr_table[state->m_prot_col].response));
2400
if (!mpu4_current_chr_table)
2401
fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(space->cpu));
2541
if (!state->m_current_chr_table)
2542
fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space->device()));
2404
2545
/* hack for 'invalid questions' error on time machine.. I guess it wants them to decode properly for startup check? */
2405
if (cpu_get_previouspc(space->cpu)==0x283a)
2546
if (cpu_get_previouspc(&space->device())==0x283a)
2410
return mpu4_current_chr_table[prot_col].response;
2551
return state->m_current_chr_table[state->m_prot_col].response;
2556
BwB Characteriser (CHR)
2558
The BwB method of protection is considerably different to the Barcrest one, with any
2559
incorrect behaviour manifesting in ridiculously large payouts.
2561
In fact, the software seems deliberately designed to mislead, but is (fortunately for
2562
us) prone to similar weaknesses that allow a per game solution.
2567
static WRITE16_HANDLER( bwb_characteriser16_w )
2569
mpu4_state *state = space->machine().driver_data<mpu4_state>();
2571
int call=data &0xff;
2572
LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X \n", cpu_get_previouspc(&space->device()),offset,data));
2573
if (!state->m_current_chr_table)
2574
fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space->device()));
2576
if (offset == 0)//initialisation is always at 0x800
2581
state->m_init_col =0;
2585
for (x = state->m_init_col; x < 64; x++)
2587
if (state->m_current_chr_table[(x)].call == call)
2589
state->m_init_col = x;
2590
LOG_CHR_FULL(("BwB Characteriser init column %02X\n",state->m_init_col));
2599
for (x = state->m_prot_col; x < 64;)
2602
if (state->m_current_chr_table[(x)].call == call)
2604
state->m_prot_col = x;
2605
LOG_CHR(("BwB Characteriser init column %02X\n",state->m_prot_col));
2612
static READ16_HANDLER( bwb_characteriser16_r )
2614
mpu4_state *state = space->machine().driver_data<mpu4_state>();
2615
if (!state->m_current_chr_table)
2616
fatalerror("No Characteriser Table @ %04x\n", cpu_get_previouspc(&space->device()));
2618
LOG_CHR(("Characteriser read offset %02X \n",offset));
2623
LOG_CHR(("Characteriser read data %02X \n",state->m_current_chr_table[state->m_init_col].response));
2624
return state->m_current_chr_table[state->m_init_col].response;
2628
LOG_CHR(("Characteriser read BwB data %02X \n",state->m_current_chr_table[state->m_prot_col].response));
2629
return state->m_current_chr_table[state->m_prot_col].response;
2414
2633
static const mpu4_chr_table adders_data[64] = {
2415
2634
{0x00, 0x00}, {0x1A, 0x8C}, {0x04, 0x64}, {0x10, 0x84}, {0x18, 0x84}, {0x0F, 0xC4}, {0x13, 0x84}, {0x1B, 0x84},
2554
2773
{0x0D, 0x04}, {0x1F, 0x64}, {0x16, 0x24}, {0x05, 0x64}, {0x13, 0x24}, {0x1C, 0x64}, {0x02, 0x74}, {0x00, 0x00}
2776
static const mpu4_chr_table prizeinv_data[72] = {
2777
{0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x00, 0x00},{0x2e, 0x36},{0x20, 0x42},
2778
{0x0f, 0x27},{0x24, 0x42},{0x3c, 0x09},{0x2c, 0x01},{0x01, 0x1d},{0x1d, 0x40},{0x40, 0xd2},{0xd2, 0x01},
2779
{0x01, 0xf9},{0xb1, 0x41},{0x41, 0x1c},{0x1c, 0x01},{0x01, 0xf9},{0x04, 0x54},{0x54, 0x02},{0x02, 0x00},
2780
{0x00, 0x00},{0x00, 0x2e},{0x2e, 0x20},{0x20, 0x0f},{0x0f, 0x24},{0x24, 0x3c},{0x3c, 0x39},{0x3c, 0xc9},
2781
{0xc9, 0x05},{0x05, 0x04},{0x04, 0x54},{0x54, 0x02},{0x02, 0x00},{0x00, 0x00},{0x00, 0x2e},{0x2e, 0x20},
2782
{0x20, 0x0f},{0x0f, 0x24},{0x24, 0x3c},{0x3c, 0x39},{0x3c, 0x36},{0x36, 0x00},{0x42, 0x04},{0x27, 0x04},
2783
{0x42, 0x0c},{0x09, 0x0c},{0x42, 0x1c},{0x27, 0x14},{0x42, 0x2c},{0x42, 0x5c},{0x09, 0x2c},
2784
//All this may be garbage - the ROM table seems endless
2786
{0x31, 0x20},{0x34, 0x90}, {0x1e, 0x40},{0x04, 0x90},{0x01, 0xe4},{0x0c, 0xf4},{0x18, 0x64},{0x19, 0x10},
2787
{0x00, 0x00},{0x01, 0x00},{0x04, 0x00},{0x09, 0x00},{0x10, 0x00},{0x19, 0x10},{0x24, 0x00},{0x31, 0x00}
2557
2790
static DRIVER_INIT (adders)
2559
mpu4_current_chr_table = adders_data;
2792
mpu4_state *state = machine.driver_data<mpu4_state>();
2793
state->m_current_chr_table = adders_data;
2562
2796
static DRIVER_INIT (crmaze)
2564
mpu4_current_chr_table = crmaze_data;
2798
mpu4_state *state = machine.driver_data<mpu4_state>();
2799
state->m_current_chr_table = crmaze_data;
2567
2802
static DRIVER_INIT (crmazea)
2569
mpu4_current_chr_table = crmazea_data;
2804
mpu4_state *state = machine.driver_data<mpu4_state>();
2805
state->m_current_chr_table = crmazea_data;
2572
2808
static DRIVER_INIT (crmaze2)
2574
mpu4_current_chr_table = crmaze2_data;
2810
mpu4_state *state = machine.driver_data<mpu4_state>();
2811
state->m_current_chr_table = crmaze2_data;
2577
2814
static DRIVER_INIT (crmaze3)
2579
mpu4_current_chr_table = crmaze3_data;
2816
mpu4_state *state = machine.driver_data<mpu4_state>();
2817
state->m_reel_mux = FLUTTERBOX;
2818
state->m_current_chr_table = crmaze3_data;
2582
2821
static DRIVER_INIT (crmaze3a)
2584
mpu4_current_chr_table = crmaze3a_data;
2823
mpu4_state *state = machine.driver_data<mpu4_state>();
2824
state->m_reel_mux = FLUTTERBOX;
2825
state->m_current_chr_table = crmaze3a_data;
2587
2828
static DRIVER_INIT (mating)
2589
address_space *space = cputag_get_address_space(machine, "video", ADDRESS_SPACE_PROGRAM);
2590
device_t *device = machine->device("oki");
2830
mpu4_state *state = machine.driver_data<mpu4_state>();
2831
address_space *space = machine.device("video")->memory().space(AS_PROGRAM);
2832
device_t *device = machine.device("oki");
2592
2834
/* The Mating Game has an extra 256kB RAM on the program card */
2593
memory_install_ram(space, 0x600000, 0x63ffff, 0, 0, NULL);
2835
space->install_ram(0x600000, 0x63ffff);
2595
2837
/* There is also an OKIM6376 present on the program card */
2596
memory_install_readwrite16_device_handler(space, device, 0xffa040, 0xffa0ff, 0, 0, oki_r, oki_w );
2838
space->install_legacy_readwrite_handler(*device, 0xffa040, 0xffa0ff, FUNC(oki_r), FUNC(oki_w) );
2598
mpu4_current_chr_table = mating_data;
2840
state->m_current_chr_table = mating_data;
2602
2843
static DRIVER_INIT (skiltrek)
2604
mpu4_current_chr_table = skiltrek_data;
2845
mpu4_state *state = machine.driver_data<mpu4_state>();
2846
state->m_current_chr_table = skiltrek_data;
2607
2849
static DRIVER_INIT (timemchn)
2609
mpu4_current_chr_table = timemchn_data;
2851
mpu4_state *state = machine.driver_data<mpu4_state>();
2852
state->m_current_chr_table = timemchn_data;
2612
2855
static DRIVER_INIT (strikeit)
2614
mpu4_current_chr_table = strikeit_data;
2857
mpu4_state *state = machine.driver_data<mpu4_state>();
2858
state->m_current_chr_table = strikeit_data;
2617
2861
static DRIVER_INIT (turnover)
2619
mpu4_current_chr_table = turnover_data;
2863
mpu4_state *state = machine.driver_data<mpu4_state>();
2864
state->m_current_chr_table = turnover_data;
2622
2867
static DRIVER_INIT (eyesdown)
2624
mpu4_current_chr_table = eyesdown_data;
2869
mpu4_state *state = machine.driver_data<mpu4_state>();
2870
state->m_current_chr_table = eyesdown_data;
2627
2873
static DRIVER_INIT (quidgrid)
2629
mpu4_current_chr_table = quidgrid_data;
2875
mpu4_state *state = machine.driver_data<mpu4_state>();
2876
state->m_current_chr_table = quidgrid_data;
2879
static DRIVER_INIT (prizeinv)
2881
mpu4_state *state = machine.driver_data<mpu4_state>();
2882
state->m_current_chr_table = prizeinv_data;
2634
2885
ROM_START( dealem )
2635
2886
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
2696
2947
ROM_LOAD16_BYTE( "blxv___2.0_6", 0x040001, 0x10000, CRC(a3d92b5b) SHA1(1e7042d5eae4a19a01a3ef7d806c434886dc9f4d) )
2950
ROM_START( bwbtetrs )
2951
ROM_REGION( 0x10000, "maincpu", 0 )
2952
ROM_LOAD("tetris22.p0", 0x00000, 0x04000, CRC(b711c7ae) SHA1(767b17ddf9021fdf79ff6c52f04a5d8ea60cf30e) )
2954
ROM_REGION( 0x800000, "video", 0 )
2955
ROM_LOAD16_BYTE( "tetris22.p1", 0x000000, 0x10000, CRC(e81dd182) SHA1(28b460224abf6fe24b637542ccd1c84040674555) )
2956
ROM_LOAD16_BYTE( "tetris22.p2", 0x000001, 0x10000, CRC(68aa4f15) SHA1(4e4511a64391fc64e5f5b7ccb46a78fd2e1d94d6) )
2957
ROM_LOAD16_BYTE( "tetris22.p3", 0x020000, 0x10000, CRC(b38b4763) SHA1(d28e77fdd6869cb5b5ec40ed1f300a2a947e0482) )
2958
ROM_LOAD16_BYTE( "tetris22.p4", 0x020001, 0x10000, CRC(1649f604) SHA1(ca4ac303391a0969d41c8f988b8e81cfcee1a21c) )
2959
ROM_LOAD16_BYTE( "tetris22.p5", 0x040001, 0x10000, CRC(02859676) SHA1(5293c767021a6b5253eecab0b0568aa082ea7084) )
2960
ROM_LOAD16_BYTE( "tetris22.p6", 0x040001, 0x10000, CRC(40d24c82) SHA1(7ac3cf148af84ad93eaf11ce3420abbe45d986e2) )
2963
/* Vegas Poker Prototype dumped by HIGHWAYMAN */
2964
ROM_START( vgpoker )
2965
ROM_REGION( 0x10000, "maincpu", 0 )
2966
ROM_LOAD("comms-v2.0.bin", 0x00000, 0x10000, CRC(1717581f) SHA1(40f8cae39a2ab0c89d2bbfd8a37725aaae229c96))
2968
ROM_REGION( 0x800000, "video", 0 )
2969
ROM_LOAD16_BYTE("video-1.bin", 0x000000, 0x010000, CRC(7ba2396c) SHA1(eb24b802b984315fc2eba4f15c208e2c1925c1c8))
2970
ROM_LOAD16_BYTE("video-2.bin", 0x000001, 0x010000, CRC(4f9e830b) SHA1(f17bebb289c3620bf4c88b2b358a9dab87ac214f))
2971
ROM_LOAD16_BYTE("video-3.bin", 0x020000, 0x010000, CRC(607e0baa) SHA1(9f64a46ef3b9a854e939b5e7f0d1e6e925735922))
2972
ROM_LOAD16_BYTE("video-4.bin", 0x020001, 0x010000, CRC(2019f5d3) SHA1(d183b3b92d03be9f9d57b5df1a621cbfe955ed93))
2973
ROM_LOAD16_BYTE("video-5.bin", 0x040000, 0x010000, CRC(c029202e) SHA1(b08bb2678c2ff62a58ef67d5440c326d0fadc34e))
2974
ROM_LOAD16_BYTE("video-6.bin", 0x040001, 0x010000, CRC(3287ae4e) SHA1(3b05a036de3ca7ec644bfbf04934e44e631d1e28))
2975
ROM_LOAD16_BYTE("video-7.bin", 0x060000, 0x010000, CRC(231cf163) SHA1(02b28ef0e1661a82d0fba2ecc5474c79651fa9e7))
2976
ROM_LOAD16_BYTE("video-8.bin", 0x060001, 0x010000, CRC(076efdc8) SHA1(bef0a1d8f0e7486ee5dc7407ce5c96854cefa5cf))
2980
ROM_START( renoreel )
2981
ROM_REGION( 0x10000, "maincpu", 0 )
2982
ROM_LOAD("rr_27s__.a60", 0x00000, 0x10000, CRC(44c9ff47) SHA1(93a3155144b233c113aa3b49bd4eb5969e400a68))
2984
ROM_REGION( 0x800000, "video", 0 )
2985
ROM_LOAD16_BYTE( "rr______.a_1", 0x000000, 0x80000, CRC(ff27d0ba) SHA1(85cce36495f00a05c1806ecde37274212680e466) )
2986
ROM_LOAD16_BYTE( "rr______.a_2", 0x000001, 0x80000, CRC(519b9ae1) SHA1(8ccfe8de0f2c85923df81af8cba6f20af43d2fe2) )
2988
ROM_REGION( 0x200000, "msm6376", 0 )
2989
ROM_LOAD( "renosnda.bin", 0x000000, 0x080000, CRC(a72a5e1b) SHA1(a0d5338a400345a55484848a7612119405f617b1) )
2990
ROM_LOAD( "renosndb.bin", 0x080000, 0x080000, CRC(46e9a32f) SHA1(d45835a82368992597e44b3c5b9d00d8b901e733) )
2994
ROM_START( redhtpkr )
2995
ROM_REGION( 0x10000, "maincpu", 0 )
2996
ROM_LOAD("rp_20s__.3_0", 0x00000, 0x10000, CRC(b7d02d22) SHA1(f9da1c6dde064bc39d0c48a165dac7acde933397))
2998
ROM_REGION( 0x800000, "video", 0 )
2999
ROM_LOAD16_BYTE("rp______.3_1", 0x000000, 0x010000, CRC(b987406d) SHA1(8c4d386570c0c6298b1cabf50295021b3b0cf625))
3000
ROM_LOAD16_BYTE("rp______.3_2", 0x000001, 0x010000, CRC(73e3c12e) SHA1(19e3ed7255fa0c3bfa14b6a4b705c0c3e1a237b6))
3001
ROM_LOAD16_BYTE("rp______.3_3", 0x020000, 0x010000, CRC(05a30183) SHA1(302f4926073bf7335da7f0b1e6399b64ea9bbae4))
3002
ROM_LOAD16_BYTE("rp______.3_4", 0x020001, 0x010000, CRC(6b122765) SHA1(72cd0fda322790bed8cdc7697306ec01efc43789))
3003
ROM_LOAD16_BYTE("rp______.3_5", 0x040000, 0x010000, CRC(d9fd05d0) SHA1(330ef58c012b5d5fd018bea54b3ae315b3e45cfd))
3004
ROM_LOAD16_BYTE("rp______.3_6", 0x040001, 0x010000, CRC(eeea91ff) SHA1(cc7870a68f62d4dd70c13713a432a61a091821ef))
2699
3008
ROM_START( crmaze )
2700
3009
ROM_REGION( 0x10000, "maincpu", 0 )
3124
/* Vegas Poker Prototype dumped by HIGHWAYMAN */
3125
ROM_START( vgpoker )
3126
ROM_REGION( 0x10000, "maincpu", 0 )
3127
ROM_LOAD("comms-v2.0.bin", 0x00000, 0x10000, CRC(1717581f) SHA1(40f8cae39a2ab0c89d2bbfd8a37725aaae229c96))
3129
ROM_REGION( 0x800000, "video", 0 )
3130
ROM_LOAD16_BYTE("video-1.bin", 0x000000, 0x010000, CRC(7ba2396c) SHA1(eb24b802b984315fc2eba4f15c208e2c1925c1c8))
3131
ROM_LOAD16_BYTE("video-2.bin", 0x000001, 0x010000, CRC(4f9e830b) SHA1(f17bebb289c3620bf4c88b2b358a9dab87ac214f))
3132
ROM_LOAD16_BYTE("video-3.bin", 0x020000, 0x010000, CRC(607e0baa) SHA1(9f64a46ef3b9a854e939b5e7f0d1e6e925735922))
3133
ROM_LOAD16_BYTE("video-4.bin", 0x020001, 0x010000, CRC(2019f5d3) SHA1(d183b3b92d03be9f9d57b5df1a621cbfe955ed93))
3134
ROM_LOAD16_BYTE("video-5.bin", 0x040000, 0x010000, CRC(c029202e) SHA1(b08bb2678c2ff62a58ef67d5440c326d0fadc34e))
3135
ROM_LOAD16_BYTE("video-6.bin", 0x040001, 0x010000, CRC(3287ae4e) SHA1(3b05a036de3ca7ec644bfbf04934e44e631d1e28))
3136
ROM_LOAD16_BYTE("video-7.bin", 0x060000, 0x010000, CRC(231cf163) SHA1(02b28ef0e1661a82d0fba2ecc5474c79651fa9e7))
3137
ROM_LOAD16_BYTE("video-8.bin", 0x060001, 0x010000, CRC(076efdc8) SHA1(bef0a1d8f0e7486ee5dc7407ce5c96854cefa5cf))
3139
3433
/*Deal 'Em was a conversion kit designed to make early MPU4 machines into video games by replacing the top glass
3140
3434
and reel assembly with this kit and a supplied monitor.
3141
3435
The real Deal 'Em ran on Summit Coin hardware, and was made by someone else.
3155
3449
GAME( 1993, crmazea, crmaze, crmaze, crmaze, crmazea, ROT0, "Barcrest", "The Crystal Maze (v0.1, AMLD)", GAME_NOT_WORKING )//SWP 0.9
3157
3451
GAME( 1993, crmaze2, bctvidbs, crmaze, crmaze, crmaze2, ROT0, "Barcrest", "The New Crystal Maze Featuring Ocean Zone (v2.2)", GAME_NOT_WORKING )//SWP 1.0
3158
GAME( 1993, crmaze2d, crmaze2, crmaze, crmaze, crmaze2, ROT0, "Barcrest", "The New Crystal Maze Featuring Ocean Zone (v2.2d)", GAME_NOT_WORKING )//SWP 1.0D
3452
GAME( 1993, crmaze2d, crmaze2, crmaze, crmaze, crmaze2, ROT0, "Barcrest", "The New Crystal Maze Featuring Ocean Zone (v2.2, Datapak)", GAME_NOT_WORKING )//SWP 1.0D
3159
3453
GAME( 1993, crmaze2a, crmaze2, crmaze, crmaze, 0, ROT0, "Barcrest", "The New Crystal Maze Featuring Ocean Zone (v0.1, AMLD)", GAME_NOT_WORKING )//SWP 1.0 /* unprotected? bootleg? */
3161
3455
GAME( 1994, crmaze3, bctvidbs, crmaze, crmaze, crmaze3, ROT0, "Barcrest", "The Crystal Maze Team Challenge (v0.9)", GAME_NOT_WORKING )//SWP 0.7
3191
3485
GAME( 199?, quidgrid2, quidgrid, mpu4_vid, mpu4, quidgrid, ROT0, "Barcrest", "Ten Quid Grid (v2.4)", GAME_NOT_WORKING )
3192
3486
GAME( 199?, quidgrid2d,quidgrid, mpu4_vid, mpu4, quidgrid, ROT0, "Barcrest", "Ten Quid Grid (v2.4, Datapak)", GAME_NOT_WORKING )
3194
/* Games below are newer BwB games and use their own BIOS ROMs */
3488
/* Games below are newer BwB games and use their own BIOS ROMs and hardware setups*/
3195
3489
GAME( 199?, vgpoker, 0, vgpoker, mpu4, 0, ROT0, "BwB", "Vegas Poker (prototype, release 2)", GAME_NOT_WORKING )
3196
GAME( 199?, prizeinv, 0, mpu4_vid, mpu4, 0, ROT0, "BwB", "Prize Space Invaders (20\" v1.1)", GAME_NOT_WORKING )
3197
GAME( 199?, blox, 0, mpu4_vid, mpu4, 0, ROT0, "BwB", "Blox (v2.0)", GAME_NOT_WORKING )
3198
GAME( 199?, bloxd, blox, mpu4_vid, mpu4, 0, ROT0, "BwB", "Blox (v2.0, Datapak)", GAME_NOT_WORKING )
3490
GAME( 199?, prizeinv, 0, bwbvid, mpu4, prizeinv, ROT0, "BwB", "Prize Space Invaders (20\" v1.1)", GAME_NOT_WORKING )
3491
GAME( 199?, blox, 0, bwbvid, mpu4, 0, ROT0, "BwB", "Blox (v2.0)", GAME_NOT_WORKING )
3492
GAME( 199?, bloxd, blox, bwbvid, mpu4, 0, ROT0, "BwB", "Blox (v2.0, Datapak)", GAME_NOT_WORKING )
3493
GAME( 1996, renoreel, 0, bwbvid5, mpu4, 0, ROT0, "BwB", "Reno Reels (20p/10GBP Cash, release A)", GAME_NOT_WORKING )
3494
GAME( 199?, redhtpkr, 0, bwbvid, mpu4, 0, ROT0, "BwB", "Red Hot Poker (20p/10GBP Cash, release 3)", GAME_NOT_WORKING )
3495
GAME( 199?, bwbtetrs, 0, bwbvid, mpu4, 0, ROT0, "BwB", "BwB Tetris v 2.2", GAME_NOT_WORKING )