trunk/src/mame/drivers/overdriv.cpp
| r253068 | r253069 | |
| 70 | 70 | |
| 71 | 71 | TIMER_DEVICE_CALLBACK_MEMBER(overdriv_state::overdriv_cpuA_scanline) |
| 72 | 72 | { |
| 73 | const int timer_threshold = 160; |
| 73 | 74 | 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 |
| 78 | 84 | 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; |
| 80 | 90 | m_maincpu->set_input_line(5, HOLD_LINE); |
| 91 | } |
| 81 | 92 | } |
| 82 | 93 | |
| 83 | 94 | INTERRUPT_GEN_MEMBER(overdriv_state::cpuB_interrupt) |
| 84 | 95 | { |
| 85 | 96 | // this doesn't get turned on until the irq has happened? wrong irq? |
| 86 | 97 | 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 |
| 88 | 99 | } |
| 89 | 100 | |
| 90 | 101 | |
| r253068 | r253069 | |
| 138 | 149 | |
| 139 | 150 | WRITE16_MEMBER(overdriv_state::overdriv_cpuB_irq_y_w) |
| 140 | 151 | { |
| 141 | | m_subcpu->set_input_line(6, HOLD_LINE); // likely wrong |
| 142 | 152 | } |
| 143 | 153 | |
| 144 | 154 | static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state ) |
| r253068 | r253069 | |
| 203 | 213 | AM_RANGE(0x120000, 0x120001) AM_DEVREAD("k053246", k053247_device, k053246_word_r) |
| 204 | 214 | AM_RANGE(0x128000, 0x128001) AM_READWRITE(cpuB_ctrl_r, cpuB_ctrl_w) /* enable K053247 ROM reading, plus something else */ |
| 205 | 215 | AM_RANGE(0x130000, 0x130007) AM_DEVREADWRITE8("k053246", k053247_device, k053246_r,k053246_w,0xffff) |
| 216 | //AM_RANGE(0x140000, 0x140001) used in later stages |
| 206 | 217 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1") |
| 207 | 218 | AM_RANGE(0x208000, 0x20bfff) AM_RAM |
| 208 | 219 | AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("k053250_1", k053250_device, rom_r) |
| r253068 | r253069 | |
| 216 | 227 | |
| 217 | 228 | static ADDRESS_MAP_START( overdriv_sound_map, AS_PROGRAM, 8, overdriv_state ) |
| 218 | 229 | AM_RANGE(0x0000, 0x0000) AM_WRITE(sound_ack_w) |
| 230 | // 0x012 read during explosions |
| 219 | 231 | // 0x180 |
| 220 | 232 | AM_RANGE(0x0200, 0x0201) AM_DEVREADWRITE("ymsnd", ym2151_device,read,write) |
| 221 | 233 | AM_RANGE(0x0400, 0x042f) AM_DEVREADWRITE("k053260_1", k053260_device, read, write) |
| r253068 | r253069 | |
| 231 | 243 | |
| 232 | 244 | static INPUT_PORTS_START( overdriv ) |
| 233 | 245 | 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 |
| 235 | 247 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 236 | 248 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 237 | 249 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |