@@ -786,9 +786,9 @@ void funcube_touchscreen_device::tra_callback()
786786
787787// Main CPU
788788
789- uint32_t funcube_state::debug_r ()
789+ uint16_t funcube_state::debug_r ()
790790{
791- uint32_t ret = m_in_debug->read ();
791+ uint16_t ret = m_in_debug->read ();
792792
793793 // This bits let you move the crosshair in the inputs / touch panel test with a joystick
794794 if (!(m_screen->frame_number () % 3 ))
@@ -802,28 +802,25 @@ void funcube_state::funcube_map(address_map &map)
802802 map (0x00000000 , 0x0007ffff ).rom ();
803803 map (0x00200000 , 0x0020ffff ).ram ();
804804
805- map (0x00400000 , 0x00400003 ).r (FUNC (funcube_state::debug_r));
806- map (0x00400004 , 0x00400007 ).r (" watchdog" , FUNC (watchdog_timer_device::reset32_r )).nopw ();
805+ map (0x00400002 , 0x00400003 ).r (FUNC (funcube_state::debug_r));
806+ map (0x00400006 , 0x00400007 ).r (" watchdog" , FUNC (watchdog_timer_device::reset16_r )).nopw ();
807807
808808 map (0x00500001 , 0x00500001 ).rw (m_oki, FUNC (okim9810_device::read_status), FUNC (okim9810_device::write_command));
809809 map (0x00500003 , 0x00500003 ).w (m_oki, FUNC (okim9810_device::write_tmp_register));
810810
811811 map (0x00800000 , 0x0083ffff ).rw (FUNC (funcube_state::spriteram_r), FUNC (funcube_state::spriteram_w));
812- map (0x00840000 , 0x0084ffff ).ram ().w (m_palette, FUNC (palette_device::write32 )).share (" palette" ); // Palette
812+ map (0x00840000 , 0x0084ffff ).ram ().w (m_palette, FUNC (palette_device::write16 )).share (" palette" ); // Palette
813813 map (0x00860000 , 0x0086003f ).rw (FUNC (funcube_state::vregs_r), FUNC (funcube_state::vregs_w));
814814
815815 map (0x00c00000 , 0x00c002ff ).rw (FUNC (funcube_state::nvram_r), FUNC (funcube_state::nvram_w)).umask32 (0x00ff00ff );
816-
817- map (0xf0000000 , 0xf00001ff ).rw (" maincpu_onboard" , FUNC (mcf5206e_peripheral_device::seta2_coldfire_regs_r), FUNC (mcf5206e_peripheral_device::seta2_coldfire_regs_w)); // technically this can be moved with MBAR
818- map (0xffffe000 , 0xffffffff ).ram (); // SRAM
819816}
820817
821818void funcube_state::funcube2_map (address_map &map)
822819{
823820 map (0x00000000 , 0x0007ffff ).rom ();
824821 map (0x00200000 , 0x0020ffff ).ram ();
825822
826- map (0x00500000 , 0x00500003 ).r (FUNC (funcube_state::debug_r));
823+ map (0x00500002 , 0x00500003 ).r (FUNC (funcube_state::debug_r));
827824 map (0x00500004 , 0x00500007 ).r (" watchdog" , FUNC (watchdog_timer_device::reset32_r)).nopw ();
828825
829826 map (0x00600001 , 0x00600001 ).rw (m_oki, FUNC (okim9810_device::read_status), FUNC (okim9810_device::write_command));
@@ -835,7 +832,7 @@ void funcube_state::funcube2_map(address_map &map)
835832
836833 map (0x00c00000 , 0x00c002ff ).rw (FUNC (funcube_state::nvram_r), FUNC (funcube_state::nvram_w)).umask32 (0x00ff00ff );
837834
838- map (0xf0000000 , 0xf00001ff ).rw (" maincpu_onboard" , FUNC (mcf5206e_peripheral_device::seta2_coldfire_regs_r), FUNC (mcf5206e_peripheral_device::seta2_coldfire_regs_w)); // technically this can be moved with MBAR
835+ // map(0xf0000000, 0xf00001ff).rw("maincpu_onboard", FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_r), FUNC(mcf5206e_peripheral_device::seta2_coldfire_regs_w)); // technically this can be moved with MBAR
839836 map (0xffffe000 , 0xffffffff ).ram (); // SRAM
840837}
841838
@@ -2433,17 +2430,6 @@ void seta2_state::telpacfl(machine_config &config)
24332430 Funcube series
24342431***************************************************************************/
24352432
2436- TIMER_DEVICE_CALLBACK_MEMBER (funcube_state::funcube_interrupt)
2437- {
2438- int scanline = param;
2439-
2440- if (scanline == 368 )
2441- m_maincpu->set_input_line (1 , HOLD_LINE);
2442-
2443- if (scanline == 0 )
2444- m_maincpu->set_input_line (2 , HOLD_LINE);
2445- }
2446-
24472433void funcube_state::machine_start ()
24482434{
24492435 seta2_state::machine_start ();
@@ -2462,11 +2448,12 @@ void funcube_state::machine_reset()
24622448 m_funcube_leds = 0 ;
24632449}
24642450
2451+ // original on EVA board, no Coldfire
24652452void funcube_state::funcube (machine_config &config)
24662453{
2467- MCF5206E (config, m_maincpu, XTAL (25'447'000 ));
2454+ // TODO: check exact type and clock
2455+ TMP68301 (config, m_maincpu, XTAL (50'000'000 )/3 );
24682456 m_maincpu->set_addrmap (AS_PROGRAM, &funcube_state::funcube_map);
2469- TIMER (config, " scantimer" ).configure_scanline (FUNC (funcube_state::funcube_interrupt), " screen" , 0 , 1 );
24702457
24712458 H83007 (config, m_sub, FUNCUBE_SUB_CPU_CLOCK);
24722459 m_sub->set_addrmap (AS_PROGRAM, &funcube_state::funcube_sub_map);
@@ -2476,8 +2463,6 @@ void funcube_state::funcube(machine_config &config)
24762463 m_sub->write_porta ().set (FUNC (funcube_state::outputs_w));
24772464 m_sub->write_portb ().set (FUNC (funcube_state::leds_w));
24782465
2479- MCF5206E_PERIPHERAL (config, " maincpu_onboard" , 0 , m_maincpu);
2480-
24812466 FUNCUBE_TOUCHSCREEN (config, " touchscreen" , 200 ).tx_cb ().set (m_sub, FUNC (h8_device::sci_rx_w<1 >));
24822467
24832468 NVRAM (config, " nvram" , nvram_device::DEFAULT_ALL_0);
@@ -2492,6 +2477,7 @@ void funcube_state::funcube(machine_config &config)
24922477 m_screen->set_visarea (0x0 +1 , 0x140 -1 +1 , 0x00 , 0xf0 -1 );
24932478 m_screen->set_screen_update (FUNC (funcube_state::screen_update));
24942479 m_screen->screen_vblank ().set (FUNC (funcube_state::screen_vblank));
2480+ m_screen->screen_vblank ().append_inputline (m_maincpu, 0 );
24952481 m_screen->set_palette (m_palette);
24962482
24972483 GFXDECODE (config, m_gfxdecode, m_palette, gfx_seta2);
@@ -2509,12 +2495,17 @@ void funcube_state::funcube(machine_config &config)
25092495void funcube_state::funcube2 (machine_config &config)
25102496{
25112497 funcube (config);
2498+ MCF5206E (config.replace (), m_maincpu, XTAL (25'447'000 ));
25122499 m_maincpu->set_addrmap (AS_PROGRAM, &funcube_state::funcube2_map);
25132500
25142501 m_sub->read_port4 ().set ([]() -> u8 { return 0 ; }); // unused
25152502
25162503 // video hardware
25172504 m_screen->set_visarea (0x0 , 0x140 -1 , 0x00 , 0xf0 -1 );
2505+ m_screen->screen_vblank ().set (FUNC (funcube_state::screen_vblank));
2506+ // TODO: check me in mcf5206e core
2507+ // should take autovector 0x64
2508+ m_screen->screen_vblank ().append_inputline (m_maincpu, 1 );
25182509}
25192510
25202511
@@ -2750,9 +2741,11 @@ ROM_END
27502741
27512742void funcube_state::init_funcube()
27522743{
2753- uint32_t *main_cpu = (uint32_t *) memregion (" maincpu" )->base ();
2744+ // uint16_t *main_cpu = (uint16_t *) memregion("maincpu")->base();
2745+ //
2746+ // main_cpu[0x064/2] = 0x0000;
2747+ // main_cpu[0x066/2] = 0x042a; // PIC protection?
27542748
2755- main_cpu[0x064 /4 ] = 0x0000042a ; // PIC protection?
27562749}
27572750
27582751void funcube_state::init_funcube2 ()
0 commit comments