src/mess/video/smsvdp.c
| r1273 | r1274 | |
| 40 | 40 | #include "video/smsvdp.h" |
| 41 | 41 | #include "includes/sms.h" |
| 42 | 42 | #include "video/generic.h" |
| 43 | | #include "cpu/z80/z80.h" |
| 44 | 43 | |
| 45 | 44 | #define IS_SMS1_VDP ( features & MODEL_315_5124 ) |
| 46 | 45 | #define IS_SMS2_VDP ( features & MODEL_315_5246 ) |
| r1273 | r1274 | |
| 224 | 223 | return (0); |
| 225 | 224 | } |
| 226 | 225 | |
| 226 | static TIMER_CALLBACK(smsvdp_set_irq) { |
| 227 | irqState = 1; |
| 228 | if ( int_callback ) { |
| 229 | int_callback( ASSERT_LINE ); |
| 230 | } |
| 231 | } |
| 232 | |
| 227 | 233 | static TIMER_CALLBACK(smsvdp_display_callback) |
| 228 | 234 | { |
| 229 | 235 | rectangle rec; |
| r1273 | r1274 | |
| 255 | 261 | if ( lineCountDownCounter == 0x00 ) { |
| 256 | 262 | lineCountDownCounter = reg[0x0A]; |
| 257 | 263 | statusReg |= STATUS_HINT; |
| 258 | | irqState = 1; |
| 259 | 264 | if ( reg[0x00] & 0x10 ) { |
| 260 | | if ( int_callback ) { |
| 261 | | int_callback( ASSERT_LINE ); |
| 262 | | } |
| 265 | /* Delay triggering of interrupt to allow software to read the status bit before the irq */ |
| 266 | mame_timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), 0, smsvdp_set_irq ); |
| 263 | 267 | } |
| 264 | 268 | } |
| 265 | 269 | |
| 266 | 270 | } |
| 267 | 271 | if ( vpos == vpos_limit + 1 ) { |
| 268 | 272 | statusReg |= STATUS_VINT; |
| 269 | | irqState = 1; |
| 270 | 273 | if ( reg[0x01] & 0x20 ) { |
| 271 | | if ( int_callback ) { |
| 272 | | int_callback( ASSERT_LINE ); |
| 273 | | } |
| 274 | /* Delay triggering of interrupt to allow software to read the status bit before the irq */ |
| 275 | mame_timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), 0, smsvdp_set_irq ); |
| 274 | 276 | } |
| 275 | 277 | } |
| 276 | 278 | if ( video_skip_this_frame() ) { |
| r1273 | r1274 | |
| 303 | 305 | if ( lineCountDownCounter == 0x00 ) { |
| 304 | 306 | lineCountDownCounter = reg[0x0A]; |
| 305 | 307 | statusReg |= STATUS_HINT; |
| 306 | | irqState = 1; |
| 307 | 308 | if ( reg[0x00] & 0x10 ) { |
| 308 | | if ( int_callback ) { |
| 309 | | int_callback( ASSERT_LINE ); |
| 310 | | } |
| 309 | /* Delay triggering of interrupt to allow software to read the status bit before the irq */ |
| 310 | mame_timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), 0, smsvdp_set_irq ); |
| 311 | 311 | } |
| 312 | 312 | } else { |
| 313 | 313 | lineCountDownCounter -= 1; |