trunk/src/emu/video/stvvdp2.c
| r21010 | r21011 | |
| 5962 | 5962 | /* latch h/v signals through HV latch*/ |
| 5963 | 5963 | if(!STV_VDP2_EXLTEN) |
| 5964 | 5964 | { |
| 5965 | | /* TODO: handle various h/v settings. */ |
| 5966 | 5965 | if(!space.debugger_access()) |
| 5967 | 5966 | { |
| 5968 | | m_vdp2.h_count = space.machine().primary_screen->hpos() & 0x3ff; |
| 5969 | | m_vdp2.v_count = space.machine().primary_screen->vpos() & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff); |
| 5967 | m_vdp2.h_count = get_hcounter(); |
| 5968 | m_vdp2.v_count = get_vcounter(); |
| 5970 | 5969 | /* latch flag */ |
| 5971 | 5970 | m_vdp2.exltfg |= 1; |
| 5972 | 5971 | } |
| r21010 | r21011 | |
| 6253 | 6252 | return machine().primary_screen->frame_number() & 1; |
| 6254 | 6253 | } |
| 6255 | 6254 | |
| 6255 | /* TODO: these needs to be checked via HW tests! */ |
| 6256 | int saturn_state::get_hcounter( void ) |
| 6257 | { |
| 6258 | int hcount; |
| 6259 | |
| 6260 | hcount = machine().primary_screen->hpos(); |
| 6261 | |
| 6262 | switch(STV_VDP2_HRES & 6) |
| 6263 | { |
| 6264 | /* Normal */ |
| 6265 | case 0: |
| 6266 | hcount &= 0x1ff; |
| 6267 | hcount <<= 1; |
| 6268 | break; |
| 6269 | /* Hi-Res */ |
| 6270 | case 2: |
| 6271 | hcount &= 0x3ff; |
| 6272 | break; |
| 6273 | /* Exclusive Normal*/ |
| 6274 | case 4: |
| 6275 | hcount &= 0x1ff; |
| 6276 | break; |
| 6277 | /* Exclusive Hi-Res */ |
| 6278 | case 6: |
| 6279 | hcount >>= 1; |
| 6280 | hcount &= 0x1ff; |
| 6281 | break; |
| 6282 | } |
| 6283 | |
| 6284 | return hcount; |
| 6285 | } |
| 6286 | |
| 6287 | int saturn_state::get_vcounter( void ) |
| 6288 | { |
| 6289 | int vcount; |
| 6290 | |
| 6291 | vcount = machine().primary_screen->vpos(); |
| 6292 | |
| 6293 | /* Exclusive Monitor */ |
| 6294 | if(STV_VDP2_HRES & 4) |
| 6295 | return vcount & 0x3ff; |
| 6296 | |
| 6297 | /* Double Density Interlace */ |
| 6298 | if((STV_VDP2_LSMD & 3) == 3) |
| 6299 | return (vcount & ~1) | (machine().primary_screen->frame_number() & 1); |
| 6300 | |
| 6301 | return (vcount << 1); // Non-interlace |
| 6302 | } |
| 6303 | |
| 6256 | 6304 | void saturn_state::stv_vdp2_state_save_postload( void ) |
| 6257 | 6305 | { |
| 6258 | 6306 | UINT8 *gfxdata = m_vdp2.gfx_decode; |