@@ -7,18 +7,22 @@ F1 Dream (C) 1988 Capcom
77
88cloned hardware:
99Pushman (C) 1990 Comad
10- Bouncing Balls (c ) 1991 Comad
10+ Bouncing Balls (C ) 1991 Comad
1111
1212Please contact Phil Stroffolino (phil@maya.com) if there are any questions
1313regarding this driver.
1414
15+ Video timing: measured 60.08Hz on Tiger Road, and 60.096Hz with 260 scanlines
16+ on F1 Dream. Pixel clock is 6MHz like other Capcom games.
17+
1518TODO:
16- - F1 Dream throws an address error if player wins all the races (i.e. when the
17- game is supposed to give an ending ):
19+ - F1 Dream throws an address error if player wins all the races in the highest
20+ tier (when the game is supposed to show the ranking and highscore table ):
1821 010C68: 102E 001C move.b ($1c,A6), D0 ; reads 0xf from work RAM (misaligned)
1922 010C6C: 207B 000E movea.l ($e,PC,D0.w), A0 ; table from 0x10c7c onward
2023 010C70: 4E90 jsr (A0) ; throws address error here
21- None of the available 5 vectors seems to fit here, btanb?
24+ None of the available 5 vectors seems to fit here.
25+ - what's up with the OBJ RAM test going up to 0xfe1807? address mirror?
2226
2327BTANB:
2428- race track fg tiles have priority over minimap in f1dream
@@ -32,7 +36,7 @@ Memory Overview:
3236 0xfe4002 protection (F1 Dream only)
3337 0xfe8000 scroll registers
3438 0xff8200 palette
35- 0xffC000 working RAM
39+ 0xffc000 working RAM
3640
3741**************************************************************************
3842
@@ -71,36 +75,41 @@ void tigeroad_state::msm5205_w(u8 data)
7175 m_msm->data_w (data & 0xf );
7276}
7377
74- void f1dream_state::out3_w (u8 data)
78+
79+ // F1 Dream protection
80+
81+ u8 f1dream_state::mcu_shared_r (offs_t offset)
82+ {
83+ if (!BIT (m_mcu_p3, 5 ))
84+ return m_maincpu->space (AS_PROGRAM).read_byte (0xffffe0 | offset << 1 | 1 );
85+ else
86+ return 0xff ;
87+ }
88+
89+ void f1dream_state::mcu_shared_w (offs_t offset, u8 data)
90+ {
91+ if (!BIT (m_mcu_p3, 5 ))
92+ m_maincpu->space (AS_PROGRAM).write_byte (0xffffe0 | offset << 1 | 1 , data);
93+ }
94+
95+ void f1dream_state::mcu_out3_w (u8 data)
7596{
76- if ((m_old_p3 & 0x20 ) != (data & 0x20 ))
77- {
78- // toggles at the start and end of interrupt
79- }
80-
81- if ((m_old_p3 & 0x01 ) != (data & 0x01 ))
82- {
83- // toggles at the end of interrupt
84- if (!(data & 0x01 ))
85- {
86- m_maincpu->resume (SUSPEND_REASON_HALT);
87- }
88- }
89-
90- m_old_p3 = data;
97+ // toggles at the end of interrupt
98+ if (m_mcu_p3 & ~data & 1 )
99+ m_maincpu->resume (SUSPEND_REASON_HALT);
100+
101+ m_mcu_p3 = data;
91102}
92103
93104void f1dream_state::to_mcu_w (u16 data)
94105{
95106 m_mcu->set_input_line (MCS51_INT0_LINE, HOLD_LINE);
96107
97- /* after triggering this address there are one or two NOPs in the 68k code, then it expects the response to be ready
98- the MCU isn't that fast, so either the CPU is suspended on write, or when bit 0x20 of MCU Port 3 toggles in the
99- MCU interrupt code, however no combination of increasing the clock / boosting interleave etc. allows the MCU code
100- to get there in time before the 68k is already expecting a result */
108+ // after triggering this address there are one or two NOPs in the 68k code, then it expects the response to be ready
101109 m_maincpu->suspend (SUSPEND_REASON_HALT, true );
102110}
103111
112+
104113/* **************************************************************************/
105114
106115void tigeroad_state::main_map (address_map &map)
@@ -115,37 +124,25 @@ void tigeroad_state::main_map(address_map &map)
115124 map (0xfe4002 , 0xfe4002 ).w (" soundlatch" , FUNC (generic_latch_8_device::write));
116125 map (0xfe4004 , 0xfe4005 ).portr (" DSW" );
117126 map (0xfe8000 , 0xfe8003 ).w (FUNC (tigeroad_state::scroll_w));
118- map (0xfe800e , 0xfe800f ).nopw (); // fe800e = watchdog or IRQ acknowledge
127+ map (0xfe800e , 0xfe800f ).nopw (); // fe800e = watchdog or IRQ acknowledge or sprite DMA
119128 map (0xfec000 , 0xfec7ff ).ram ().w (FUNC (tigeroad_state::videoram_w)).share (" videoram" );
120129
121130 map (0xff8000 , 0xff87ff ).ram ().w (m_palette, FUNC (palette_device::write16)).share (" palette" );
122- map (0xffc000 , 0xffffff ).ram ().share (" ram16" );
123- }
124-
125-
126- u8 f1dream_state::mcu_shared_r (offs_t offset)
127- {
128- u8 ret = m_ram16[(0x3fe0 / 2 ) + offset];
129- return ret;
130- }
131-
132- void f1dream_state::mcu_shared_w (offs_t offset, u8 data)
133- {
134- m_ram16[(0x3fe0 / 2 ) + offset] = (m_ram16[(0x3fe0 / 2 ) + offset] & 0xff00 ) | data;
131+ map (0xffc000 , 0xffffff ).ram ();
135132}
136133
137134void f1dream_state::f1dream_map (address_map &map)
138135{
139136 main_map (map);
140- map (0xfe4002 , 0xfe4003 ).portr ( " SYSTEM " ). w (FUNC (f1dream_state::to_mcu_w));
137+ map (0xfe4002 , 0xfe4003 ).w (FUNC (f1dream_state::to_mcu_w));
141138}
142139
143140void f1dream_state::f1dream_mcu_data (address_map &map)
144141{
142+ // never accesses under 0x7f0
145143 map (0x7f0 , 0x7ff ).rw (FUNC (f1dream_state::mcu_shared_r), FUNC (f1dream_state::mcu_shared_w));
146144}
147145
148-
149146void pushman_state::pushman_map (address_map &map)
150147{
151148 main_map (map);
@@ -172,7 +169,7 @@ void pushman_state::bballs_map(address_map &map)
172169 map (0xec000 , 0xec7ff ).ram ().w (FUNC (pushman_state::videoram_w)).share (" videoram" );
173170
174171 map (0xf8000 , 0xf87ff ).ram ().w (m_palette, FUNC (palette_device::write16)).share (" palette" );
175- map (0xfc000 , 0xfffff ).ram (). share ( " ram16 " ) ;
172+ map (0xfc000 , 0xfffff ).ram ();
176173}
177174
178175// Capcom games ONLY
@@ -637,9 +634,8 @@ void tigeroad_state::tigeroad(machine_config &config)
637634 // video hardware
638635 BUFFERED_SPRITERAM16 (config, " spriteram" );
639636
640- // Timings may be different, driver originally had 60.08Hz vblank.
641637 screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_RASTER));
642- screen.set_raw (24_MHz_XTAL / 4 , 384 , 0 , 256 , 262 , 16 , 240 ); // hsync is 306..333 (offset by 128), vsync is 251..253 (offset by 6)
638+ screen.set_raw (24_MHz_XTAL / 4 , 384 , 0 , 256 , 260 , 16 , 240 );
643639 screen.set_screen_update (FUNC (tigeroad_state::screen_update));
644640 screen.screen_vblank ().set (" spriteram" , FUNC (buffered_spriteram16_device::vblank_copy_rising));
645641 screen.set_palette (m_palette);
@@ -668,7 +664,7 @@ void tigeroad_state::tigeroad(machine_config &config)
668664
669665void f1dream_state::machine_start ()
670666{
671- save_item (NAME (m_old_p3 ));
667+ save_item (NAME (m_mcu_p3 ));
672668}
673669
674670void f1dream_state::f1dream (machine_config &config)
@@ -677,10 +673,10 @@ void f1dream_state::f1dream(machine_config &config)
677673
678674 m_maincpu->set_addrmap (AS_PROGRAM, &f1dream_state::f1dream_map);
679675
680- I8751 (config, m_mcu, 10_MHz_XTAL ); // 8MHz rated chip, 10MHz or 6MHz(24/4)?
676+ I8751 (config, m_mcu, 24_MHz_XTAL / 4 ); // 6MHz
681677 m_mcu->set_addrmap (AS_DATA, &f1dream_state::f1dream_mcu_data);
682678 m_mcu->port_out_cb <1 >().set (" soundlatch" , FUNC (generic_latch_8_device::write));
683- m_mcu->port_out_cb <3 >().set (FUNC (f1dream_state::out3_w ));
679+ m_mcu->port_out_cb <3 >().set (FUNC (f1dream_state::mcu_out3_w ));
684680}
685681
686682// same as above but with additional Z80 for samples playback
@@ -717,7 +713,7 @@ void tigeroad_state::f1dream_comad(machine_config &config) // COMAD-01 PCB with
717713 BUFFERED_SPRITERAM16 (config, " spriteram" );
718714
719715 screen_device &screen (SCREEN (config, " screen" , SCREEN_TYPE_RASTER));
720- screen.set_raw (24_MHz_XTAL / 4 , 384 , 0 , 256 , 262 , 16 , 240 ); // hsync is 306..333 (offset by 128), vsync is 251..253 (offset by 6)
716+ screen.set_raw (24_MHz_XTAL / 4 , 384 , 0 , 256 , 260 , 16 , 240 ); // assume same as tigeroad
721717 screen.set_screen_update (FUNC (tigeroad_state::screen_update));
722718 screen.screen_vblank ().set (" spriteram" , FUNC (buffered_spriteram16_device::vblank_copy_rising));
723719 screen.set_palette (m_palette);
0 commit comments