Previous 199869 Revisions Next

r44557 Friday 29th January, 2016 at 01:01:43 UTC by Angelo Salese
Fixed gearbox input, flipped around irqs for testing.
[src/mame/drivers]overdriv.cpp
[src/mame/includes]overdriv.h

trunk/src/mame/drivers/overdriv.cpp
r253068r253069
7070
7171TIMER_DEVICE_CALLBACK_MEMBER(overdriv_state::overdriv_cpuA_scanline)
7272{
73   const int timer_threshold = 160;
7374   int scanline = param;
74
75   /* TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?) */
76   /*       this is a temporary solution to get rid of deprecat lib and the crashes, but also makes the game timer to be too slow */
77   if(scanline == 256 && m_screen->frame_number() & 1) // vblank-out irq
75   
76   m_fake_timer ++;
77   
78   // TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?)
79   //       this is a temporary solution to get rid of deprecat lib and the crashes, but also makes the game timer to be too slow.
80    //       Update: gameplay is actually too fast compared to timer, first attract mode shouldn't even surpass first blue car on right.
81   if(scanline == 256) // vblank-out irq
82   {
83      // m_screen->frame_number() & 1
7884      m_maincpu->set_input_line(4, HOLD_LINE);
79   else if((scanline % 128) == 0) // timer irq
85      m_subcpu->set_input_line(4, HOLD_LINE); // likely wrong
86   }
87   else if(m_fake_timer >= timer_threshold) // timer irq
88   {
89      m_fake_timer -= timer_threshold;
8090      m_maincpu->set_input_line(5, HOLD_LINE);
91   }
8192}
8293
8394INTERRUPT_GEN_MEMBER(overdriv_state::cpuB_interrupt)
8495{
8596   // this doesn't get turned on until the irq has happened? wrong irq?
8697   if (m_k053246->k053246_is_irq_enabled())
87      m_subcpu->set_input_line(4, HOLD_LINE); // likely wrong
98      m_subcpu->set_input_line(6, HOLD_LINE); // likely wrong
8899}
89100
90101
r253068r253069
138149
139150WRITE16_MEMBER(overdriv_state::overdriv_cpuB_irq_y_w)
140151{
141   m_subcpu->set_input_line(6, HOLD_LINE); // likely wrong
142152}
143153
144154static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state )
r253068r253069
203213   AM_RANGE(0x120000, 0x120001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
204214   AM_RANGE(0x128000, 0x128001) AM_READWRITE(cpuB_ctrl_r, cpuB_ctrl_w) /* enable K053247 ROM reading, plus something else */
205215   AM_RANGE(0x130000, 0x130007) AM_DEVREADWRITE8("k053246", k053247_device, k053246_r,k053246_w,0xffff)
216   //AM_RANGE(0x140000, 0x140001) used in later stages
206217   AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
207218   AM_RANGE(0x208000, 0x20bfff) AM_RAM
208219   AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
r253068r253069
216227
217228static ADDRESS_MAP_START( overdriv_sound_map, AS_PROGRAM, 8, overdriv_state )
218229   AM_RANGE(0x0000, 0x0000) AM_WRITE(sound_ack_w)
230   // 0x012 read during explosions
219231   // 0x180
220232   AM_RANGE(0x0200, 0x0201) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write)
221233   AM_RANGE(0x0400, 0x042f) AM_DEVREADWRITE("k053260_1", k053260_device, read, write)
r253068r253069
231243
232244static INPUT_PORTS_START( overdriv )
233245   PORT_START("INPUTS")
234   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_TOGGLE
246   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_TOGGLE
235247   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
236248   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
237249   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
trunk/src/mame/includes/overdriv.h
r253068r253069
5858   UINT32 screen_update_overdriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5959   INTERRUPT_GEN_MEMBER(cpuB_interrupt);
6060   TIMER_DEVICE_CALLBACK_MEMBER(overdriv_cpuA_scanline);
61
61   int m_fake_timer;
62   
6263   K051316_CB_MEMBER(zoom_callback_1);
6364   K051316_CB_MEMBER(zoom_callback_2);
6465   K053246_CB_MEMBER(sprite_callback);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team