diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c index 8160dda69e9..1ea8f4d2002 100644 --- a/src/mame/drivers/cdi.c +++ b/src/mame/drivers/cdi.c @@ -193,50 +193,43 @@ static MACHINE_START( cdi ) static DRIVER_INIT( quizrd12 ) { - scc68070_set_hack_base(0x26F39C); - scc68070_set_hack_value(0x021f); - scc68070_set_hack_ack(0x5a); + scc68070_set_quizard_mcu_value(machine, 0x021f); + scc68070_set_quizard_mcu_ack(machine, 0x5a); } static DRIVER_INIT( quizrd17 ) { - scc68070_set_hack_base(0x264B4A); - scc68070_set_hack_value(0x021f); - scc68070_set_hack_ack(0x5a); + scc68070_set_quizard_mcu_value(machine, 0x021f); + scc68070_set_quizard_mcu_ack(machine, 0x5a); } static DRIVER_INIT( quizrd22 ) { - scc68070_set_hack_base(0x26D9C2); - // 0x2b1: Italian // 0x001: French // 0x188: German - scc68070_set_hack_value(0x188); + scc68070_set_quizard_mcu_value(machine, 0x188); - scc68070_set_hack_ack(0x59); + scc68070_set_quizard_mcu_ack(machine, 0x59); } static DRIVER_INIT( quizrd32 ) { - scc68070_set_hack_base(0x266D30); - scc68070_set_hack_value(0x00ae); - scc68070_set_hack_ack(0x58); + scc68070_set_quizard_mcu_value(machine, 0x00ae); + scc68070_set_quizard_mcu_ack(machine, 0x58); } static DRIVER_INIT( quizrr41 ) { - scc68070_set_hack_base(0x267DB0); - scc68070_set_hack_value(0x011f); - scc68070_set_hack_ack(0x57); + scc68070_set_quizard_mcu_value(machine, 0x011f); + scc68070_set_quizard_mcu_ack(machine, 0x57); } static DRIVER_INIT( quizrr42 ) { - scc68070_set_hack_base(0x267DB0); - scc68070_set_hack_value(0x011f); - scc68070_set_hack_ack(0x57); + scc68070_set_quizard_mcu_value(machine, 0x011f); + scc68070_set_quizard_mcu_ack(machine, 0x57); } static MACHINE_RESET( cdi ) @@ -413,12 +406,12 @@ ROM_END // BIOS GAME( 1991, cdi, 0, cdi, cdi, 0, ROT0, "Philips", "CD-i (Mono-I) BIOS", GAME_IS_BIOS_ROOT ) -// Partially working -GAME( 1996, quizard, cdi, cdi, cdi, quizrd32, ROT0, "TAB Austria", "Quizard 3.2", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) -GAME( 1998, quizrr41, cdi, cdi, cdi, quizrr41, ROT0, "TAB Austria", "Quizard Rainbow 4.1", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) -GAME( 1998, quizrr42, cdi, cdi, cdi, quizrr42, ROT0, "TAB Austria", "Quizard Rainbow 4.2", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) - // Working GAME( 1995, quizrd12, cdi, cdi, cdi, quizrd12, ROT0, "TAB Austria", "Quizard 1.2", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) GAME( 1995, quizrd17, cdi, cdi, cdi, quizrd17, ROT0, "TAB Austria", "Quizard 1.7", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) GAME( 1995, quizrd22, cdi, cdi, cdi, quizrd22, ROT0, "TAB Austria", "Quizard 2.2", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) + +// Partially working +GAME( 1996, quizard, cdi, cdi, cdi, quizrd32, ROT0, "TAB Austria", "Quizard 3.2", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) +GAME( 1998, quizrr41, cdi, cdi, cdi, quizrr41, ROT0, "TAB Austria", "Quizard Rainbow 4.1", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) +GAME( 1998, quizrr42, cdi, cdi, cdi, quizrr42, ROT0, "TAB Austria", "Quizard Rainbow 4.2", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) diff --git a/src/mame/machine/cdi070.c b/src/mame/machine/cdi070.c index eec18d65d37..0fcfd2f0723 100644 --- a/src/mame/machine/cdi070.c +++ b/src/mame/machine/cdi070.c @@ -59,41 +59,20 @@ static void scc68070_set_timer_callback(scc68070_regs_t *scc68070, int channel) } } -static bool hack_active = false; -static UINT16 hack_value = 0; -static UINT32 hack_base = 0; -static UINT8 hack_ack = 0; - -void scc68070_set_hack_ack(UINT8 ack) +void scc68070_set_quizard_mcu_ack(running_machine *machine, UINT8 ack) { - hack_ack = ack; + cdi_state *state = machine->driver_data(); + scc68070_regs_t *scc68070 = &state->scc68070_regs; + + scc68070->mcu_ack = ack; } -void scc68070_set_hack_value(UINT16 value) +void scc68070_set_quizard_mcu_value(running_machine *machine, UINT16 value) { - hack_value = value; -} + cdi_state *state = machine->driver_data(); + scc68070_regs_t *scc68070 = &state->scc68070_regs; -void scc68070_set_hack_base(UINT32 base) -{ - hack_base = base; -} - -static void quizard_patch(running_machine *machine) -{ - address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); - - if(hack_active) - { - space->write_word(hack_base ,0x7001); - space->write_word(hack_base + 2,0x7001); - } -} - -void scc68070_set_hack_active(running_machine *machine, bool active) -{ - hack_active = active; - quizard_patch(machine); + scc68070->mcu_value = value; } TIMER_CALLBACK( scc68070_timer0_callback ) @@ -114,10 +93,6 @@ TIMER_CALLBACK( scc68070_timer0_callback ) } } -#if ENABLE_QUIZARD_HACK - quizard_patch(machine); -#endif - scc68070_set_timer_callback(&state->scc68070_regs, 0); } @@ -262,7 +237,7 @@ static void quizard_set_seeds(UINT8 *rx) static void quizard_calculate_state(running_machine *machine, scc68070_regs_t *scc68070) { - const UINT16 desired_bitfield = hack_value; + const UINT16 desired_bitfield = scc68070->mcu_value; const UINT16 field0 = 0x00ff; const UINT16 field1 = desired_bitfield ^ field0; @@ -316,10 +291,10 @@ static void quizard_handle_byte_tx(running_machine *machine, scc68070_regs_t *sc break; case 1: - if(tx == hack_ack) + if(tx == scc68070->mcu_ack) { ack_count++; - if(ack_count == 1) + if(ack_count == 2) { state++; quizard_set_seeds(rx); @@ -339,9 +314,9 @@ static void quizard_handle_byte_tx(running_machine *machine, scc68070_regs_t *sc break; case 2: - if(tx == hack_ack) + if(tx == 0x56) { - state = 0; + state = 1; } break; } @@ -756,37 +731,9 @@ WRITE16_HANDLER( scc68070_periphs_w ) case 0x2018/2: if(ACCESSING_BITS_0_7) { - static int count = 0; - verboselog(space->machine, 2, "scc68070_periphs_w: UART Transmit Holding Register: %04x & %04x: %c\n", data, mem_mask, (data >= 0x20 && data < 0x7f) ? (data & 0x00ff) : ' '); scc68070_uart_tx(space->machine, scc68070, data & 0x00ff); scc68070->uart.transmit_holding_register = data & 0x00ff; - - if((data & 0x00ff) == hack_ack) - { - count++; - if(count == 2) - { - static unsigned char check_array[9] = { 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - - for(int index = 0; index < 9; index++) - { - //scc68070_uart_rx(space->machine, scc68070, check_array[index]); - if(index > 0) - { - check_array[index]++; - } - } - count = 0; - - //hack_active = true; - //quizard_patch(space->machine); - } - } - else - { - count = 0; - } } else { diff --git a/src/mame/machine/cdi070.h b/src/mame/machine/cdi070.h index 15f564da92b..3560e3ec0ab 100644 --- a/src/mame/machine/cdi070.h +++ b/src/mame/machine/cdi070.h @@ -228,6 +228,9 @@ typedef struct scc68070_timer_regs_t timers; scc68070_dma_regs_t dma; scc68070_mmu_regs_t mmu; + + UINT16 mcu_value; + UINT8 mcu_ack; } scc68070_regs_t; // Member functions @@ -243,11 +246,9 @@ extern void scc68070_uart_rx(running_machine *machine, scc68070_regs_t *scc68070 extern void scc68070_uart_tx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data); extern void scc68070_register_globals(running_machine *machine, scc68070_regs_t *scc68070); -// Hacks for Quizard -extern void scc68070_set_hack_value(UINT16 value); -extern void scc68070_set_hack_base(UINT32 base); -extern void scc68070_set_hack_ack(UINT8 ack); -extern void scc68070_set_hack_active(running_machine *machine, bool active); +// UART Access for Quizard +extern void scc68070_set_quizard_mcu_value(running_machine *machine, UINT16 value); +extern void scc68070_set_quizard_mcu_ack(running_machine *machine, UINT8 ack); extern void scc68070_quizard_rx(running_machine *machine, scc68070_regs_t *scc68070, UINT8 data); #endif // _MACHINE_CDI070_H_ diff --git a/src/mame/machine/cdislave.c b/src/mame/machine/cdislave.c index e64ba430682..85bb3a0c75f 100644 --- a/src/mame/machine/cdislave.c +++ b/src/mame/machine/cdislave.c @@ -352,11 +352,6 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con m_in_index = 0; m_in_count = 0; break; - case 0xc0: // SetAttn (used as hack for Quizard) - scc68070_set_hack_active(&m_machine, true); - m_in_index = 0; - m_in_count = 0; - break; case 0xf0: // Set Front Panel LCD verboselog(&m_machine, 0, "slave_w: Channel %d: Set Front Panel LCD (0xf0)\n", offset ); m_in_count = 17;