src/mess/drivers/scv.c
| r6868 | r6869 | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
| 219 | INLINE void draw_semi_graph( bitmap_t *bitmap, UINT8 x, UINT8 y, UINT8 data, UINT8 col ) |
| 220 | { |
| 221 | int i; |
| 222 | |
| 223 | if ( ! data ) |
| 224 | return; |
| 225 | |
| 226 | for ( i = 0; i < 4; i++ ) |
| 227 | { |
| 228 | *BITMAP_ADDR16(bitmap, y + i, x + 0) = col; |
| 229 | *BITMAP_ADDR16(bitmap, y + i, x + 1) = col; |
| 230 | *BITMAP_ADDR16(bitmap, y + i, x + 2) = col; |
| 231 | *BITMAP_ADDR16(bitmap, y + i, x + 3) = col; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | |
| 219 | 236 | static VIDEO_UPDATE( scv ) |
| 220 | 237 | { |
| 221 | 238 | int x, y; |
| 222 | | // UINT8 fg = scv_vram[0x1403] >> 4; |
| 239 | UINT8 fg = scv_vram[0x1403] >> 4; |
| 223 | 240 | UINT8 bg = scv_vram[0x1403] & 0x0f; |
| 224 | 241 | |
| 225 | 242 | /* Clear the screen */ |
| 226 | | for ( y = 0; y < 256; y++ ) |
| 227 | | for ( x = 0; x < 256; x++ ) |
| 228 | | *BITMAP_ADDR16( bitmap, y, x ) = bg; |
| 243 | bitmap_fill( bitmap, cliprect, bg ); |
| 229 | 244 | |
| 230 | 245 | /* Draw background */ |
| 246 | switch ( scv_vram[0x1400] & 0x03 ) |
| 247 | { |
| 248 | case 0x01: /* Semi graphics mode */ |
| 249 | for ( y = 0; y < 16; y++ ) |
| 250 | { |
| 251 | for ( x = 0; x < 32; x++ ) |
| 252 | { |
| 253 | UINT8 d = scv_vram[ 0x1000 + y * 32 + x ]; |
| 231 | 254 | |
| 232 | | /* Draw sprites */ |
| 255 | draw_semi_graph( bitmap, x * 8 , y * 16 , d & 0x80, fg ); |
| 256 | draw_semi_graph( bitmap, x * 8 + 4, y * 16 , d & 0x40, fg ); |
| 257 | draw_semi_graph( bitmap, x * 8 , y * 16 + 4, d & 0x20, fg ); |
| 258 | draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 4, d & 0x10, fg ); |
| 259 | draw_semi_graph( bitmap, x * 8 , y * 16 + 8, d & 0x08, fg ); |
| 260 | draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 8, d & 0x04, fg ); |
| 261 | draw_semi_graph( bitmap, x * 8 , y * 16 + 12, d & 0x02, fg ); |
| 262 | draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 12, d & 0x01, fg ); |
| 263 | } |
| 264 | } |
| 265 | break; |
| 266 | case 0x03: /* Block graphics mode */ |
| 267 | break; |
| 268 | default: /* Text mode */ |
| 269 | break; |
| 270 | } |
| 271 | |
| 272 | /* Draw sprites if enabled */ |
| 233 | 273 | if ( scv_vram[0x1400] & 0x10 ) |
| 234 | 274 | { |
| 235 | | static const UINT8 spr_2col_lut0[16] = { 0, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 1, 1 }; |
| 236 | | static const UINT8 spr_2col_lut1[16] = { 0, 1, 8, 11, 2, 3, 10, 9, 4, 5, 12, 13, 6, 7, 14, 15 }; |
| 237 | | |
| 238 | 275 | int i; |
| 239 | 276 | |
| 240 | 277 | for ( i = 0; i < 128; i++ ) |
| r6868 | r6869 | |
| 249 | 286 | if ( !col ) |
| 250 | 287 | continue; |
| 251 | 288 | |
| 289 | /* Check if 2 color sprites are enabled */ |
| 252 | 290 | if ( ( scv_vram[0x1400] & 0x20 ) && ( i & 0x20 ) ) |
| 253 | 291 | { |
| 254 | 292 | /* 2 color sprite handling */ |
| 255 | 293 | draw_sprite( bitmap, spr_x, spr_y, tile_idx, col ); |
| 256 | 294 | if ( x_32 || y_32 ) |
| 295 | { |
| 296 | static const UINT8 spr_2col_lut0[16] = { 0, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 1, 1 }; |
| 297 | static const UINT8 spr_2col_lut1[16] = { 0, 1, 8, 11, 2, 3, 10, 9, 4, 5, 12, 13, 6, 7, 14, 15 }; |
| 298 | |
| 257 | 299 | draw_sprite( bitmap, spr_x, spr_y, tile_idx + 8 * x_32 + y_32, ( i & 0x40 ) ? spr_2col_lut1[col] : spr_2col_lut0[col] ); |
| 300 | } |
| 258 | 301 | } |
| 259 | 302 | else |
| 260 | 303 | { |