trunk/src/emu/video/stvvdp2.c
| r21318 | r21319 | |
| 5933 | 5933 | return res/divider; |
| 5934 | 5934 | } |
| 5935 | 5935 | |
| 5936 | /* TODO: hblank position and hblank firing doesn't really match HW behaviour. */ |
| 5936 | 5937 | UINT8 saturn_state::get_hblank( void ) |
| 5937 | 5938 | { |
| 5938 | 5939 | const rectangle &visarea = machine().primary_screen->visible_area(); |
| r21318 | r21319 | |
| 5949 | 5950 | int cur_v,vblank; |
| 5950 | 5951 | cur_v = machine().primary_screen->vpos(); |
| 5951 | 5952 | |
| 5952 | | vblank = (m_vdp2.pal) ? 288 : 240; |
| 5953 | vblank = get_vblank_start_position() * get_ystep_count(); |
| 5953 | 5954 | |
| 5954 | | if((STV_VDP2_LSMD & 3) == 3) |
| 5955 | | vblank<<=1; |
| 5956 | | |
| 5957 | 5955 | if (cur_v >= vblank) |
| 5958 | 5956 | return 1; |
| 5959 | 5957 | |
| r21318 | r21319 | |
| 5973 | 5971 | |
| 5974 | 5972 | int saturn_state::get_vblank_start_position( void ) |
| 5975 | 5973 | { |
| 5974 | /* TODO: test says that second setting happens at 241, might need further investigation ... */ |
| 5975 | const int d_vres[4] = { 224, 240, 256, 256 }; |
| 5976 | int vres_mask; |
| 5976 | 5977 | int vblank_line; |
| 5977 | 5978 | |
| 5978 | | vblank_line = (m_vdp2.pal) ? 288 : 240; |
| 5979 | vres_mask = (m_vdp2.pal << 1)|1; //PAL uses mask 3, NTSC uses mask 1 |
| 5980 | vblank_line = d_vres[STV_VDP2_VRES & vres_mask]; |
| 5979 | 5981 | |
| 5980 | 5982 | return vblank_line; |
| 5981 | 5983 | } |
| r21318 | r21319 | |
| 6039 | 6041 | if((STV_VDP2_LSMD & 3) == 3) |
| 6040 | 6042 | return (vcount & ~1) | (machine().primary_screen->frame_number() & 1); |
| 6041 | 6043 | |
| 6042 | | return (vcount << 1); // Non-interlace |
| 6044 | /* docs says << 1, but according to HW tests it's a typo. */ |
| 6045 | return (vcount & 0x1ff); // Non-interlace |
| 6043 | 6046 | } |
| 6044 | 6047 | |
| 6045 | 6048 | void saturn_state::stv_vdp2_state_save_postload( void ) |