trunk/src/mame/drivers/stv.c
| r21086 | r21087 | |
| 658 | 658 | |
| 659 | 659 | */ |
| 660 | 660 | |
| 661 | | READ32_MEMBER(saturn_state::astrass_hack_r) |
| 662 | | { |
| 663 | | if(space.device().safe_pc() == 0x60011ba) return 0x00000000; |
| 664 | | |
| 665 | | return m_workram_h[0x000770/4]; |
| 666 | | } |
| 667 | | |
| 668 | 661 | DRIVER_INIT_MEMBER(saturn_state,astrass) |
| 669 | 662 | { |
| 670 | 663 | sh2drc_add_pcflush(machine().device("maincpu"), 0x60011ba); |
| 671 | 664 | sh2drc_add_pcflush(machine().device("maincpu"), 0x605b9da); |
| 672 | 665 | |
| 673 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x06000770, 0x06000773, read32_delegate(FUNC(saturn_state::astrass_hack_r),this)); |
| 674 | | |
| 675 | 666 | install_astrass_protection(machine()); |
| 676 | 667 | |
| 677 | 668 | DRIVER_INIT_CALL(stv); |
trunk/src/mame/drivers/saturn.c
| r21086 | r21087 | |
| 1520 | 1520 | TIMER_DEVICE_CALLBACK_MEMBER(saturn_state::saturn_scanline) |
| 1521 | 1521 | { |
| 1522 | 1522 | int scanline = param; |
| 1523 | | int max_y = machine().primary_screen->height(); |
| 1524 | 1523 | int y_step,vblank_line; |
| 1525 | 1524 | |
| 1526 | | y_step = 2; |
| 1525 | vblank_line = get_vblank_start_position(); |
| 1526 | y_step = get_ystep_count(); |
| 1527 | 1527 | |
| 1528 | | if((max_y == 263 && m_vdp2.pal == 0) || (max_y == 313 && m_vdp2.pal == 1)) |
| 1529 | | y_step = 1; |
| 1530 | | |
| 1531 | | vblank_line = (m_vdp2.pal) ? 288 : 240; |
| 1532 | | |
| 1533 | 1528 | //popmessage("%08x %d T0 %d T1 %d %08x",m_scu.ism ^ 0xffffffff,max_y,m_scu_regs[36],m_scu_regs[37],m_scu_regs[38]); |
| 1534 | 1529 | |
| 1535 | 1530 | if(scanline == (0)*y_step) |
trunk/src/mame/includes/stv.h
| r21086 | r21087 | |
| 151 | 151 | DECLARE_WRITE32_MEMBER(magzun_ioga_w32); |
| 152 | 152 | DECLARE_READ32_MEMBER(magzun_hef_hack_r); |
| 153 | 153 | DECLARE_READ32_MEMBER(magzun_rx_hack_r); |
| 154 | | DECLARE_READ32_MEMBER(astrass_hack_r); |
| 155 | 154 | DECLARE_INPUT_CHANGED_MEMBER(key_stroke); |
| 156 | 155 | DECLARE_INPUT_CHANGED_MEMBER(nmi_reset); |
| 157 | 156 | DECLARE_INPUT_CHANGED_MEMBER(tray_open); |
| r21086 | r21087 | |
| 381 | 380 | int get_pixel_clock( void ); |
| 382 | 381 | UINT8 get_odd_bit( void ); |
| 383 | 382 | void stv_vdp2_dynamic_res_change( void ); |
| 383 | int get_vblank_start_position( void ); |
| 384 | int get_ystep_count( void ); |
| 384 | 385 | |
| 385 | 386 | void refresh_palette_data( void ); |
| 386 | 387 | int stv_vdp2_window_process(int x,int y); |
trunk/src/emu/machine/smpc.c
| r21086 | r21087 | |
| 155 | 155 | #define LOG_SMPC 0 |
| 156 | 156 | #define LOG_PAD_CMD 0 |
| 157 | 157 | |
| 158 | | #if 0 |
| 159 | | /* TODO: move this into video functions */ |
| 160 | | static int vblank_line(running_machine &machine) |
| 161 | | { |
| 162 | | saturn_state *state = machine.driver_data<saturn_state>(); |
| 163 | | int max_y = machine.primary_screen->height(); |
| 164 | | int y_step,vblank_line; |
| 165 | 158 | |
| 166 | | y_step = 2; |
| 167 | | |
| 168 | | if((max_y == 263 && state->m_vdp2.pal == 0) || (max_y == 313 && state->m_vdp2.pal == 1)) |
| 169 | | y_step = 1; |
| 170 | | |
| 171 | | vblank_line = (state->m_vdp2.pal) ? 288 : 240; |
| 172 | | |
| 173 | | return vblank_line*y_step; |
| 174 | | } |
| 175 | | #endif |
| 176 | | |
| 177 | | |
| 178 | 159 | /******************************************** |
| 179 | 160 | * |
| 180 | 161 | * Bankswitch code for ST-V Multi Cart mode |
| r21086 | r21087 | |
| 273 | 254 | state->m_vdp2.dotsel = param ^ 1; |
| 274 | 255 | state->stv_vdp2_dynamic_res_change(); |
| 275 | 256 | |
| 257 | state->m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); |
| 276 | 258 | if(!state->m_NMI_reset) |
| 277 | 259 | state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 260 | state->m_slave->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); |
| 278 | 261 | state->m_slave->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| 262 | state->m_audiocpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); |
| 279 | 263 | |
| 280 | 264 | /* put issued command in OREG31 */ |
| 281 | 265 | state->m_smpc.OREG[31] = 0x0e + param; |
| r21086 | r21087 | |
| 721 | 705 | if(LOG_SMPC) printf ("SMPC: Change Clock to %s (%d %d)\n",data & 1 ? "320" : "352",space.machine().primary_screen->hpos(),space.machine().primary_screen->vpos()); |
| 722 | 706 | |
| 723 | 707 | /* on ST-V timing of this is pretty fussy, you get 2 credits at start-up otherwise |
| 724 | | sokyugurentai threshold is 74 lines |
| 725 | | shanhigw threshold is 90 lines |
| 726 | | I assume that it needs ~100 lines, so 6666,(6) usecs. Obviously needs HW tests ... */ |
| 708 | My current theory is that SMPC first stops all CPUs until it executes the whole snippet for this, |
| 709 | and restarts them when the screen is again ready for use. I really don't think that the system |
| 710 | can do an usable mid-frame clock switching anyway. |
| 711 | */ |
| 727 | 712 | |
| 728 | | space.machine().scheduler().timer_set(attotime::from_usec(6666), FUNC(smpc_change_clock),data & 1); |
| 713 | state->m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 714 | state->m_slave->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 715 | state->m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 716 | |
| 717 | space.machine().scheduler().timer_set(space.machine().primary_screen->time_until_pos(state->get_vblank_start_position()*state->get_ystep_count(), 0), FUNC(smpc_change_clock),data & 1); |
| 729 | 718 | break; |
| 730 | 719 | /*"Interrupt Back"*/ |
| 731 | 720 | case 0x10: |