src/mess/video/odyssey2.c
| r14686 | r14687 | |
| 2 | 2 | |
| 3 | 3 | video/odyssey2.c |
| 4 | 4 | |
| 5 | 2012-02-04 DanBoris |
| 6 | - Changed color of background grid color 0 to match sprite color 0 (Fixes KTAA title screen) |
| 7 | - Fixed Odyssey2_video_w so that m_o2_vdc.reg[] is always updated (Fixes Blockout) |
| 8 | - Changed quad character generation so character height is always taken from 4th character (KTAA level 2) |
| 9 | |
| 10 | |
| 5 | 11 | ***************************************************************************/ |
| 6 | 12 | |
| 7 | 13 | #include "emu.h" |
| r14686 | r14687 | |
| 47 | 53 | 0xFF,0xFF,0xFF, |
| 48 | 54 | |
| 49 | 55 | /* Character,Sprite colors */ |
| 50 | | 0x71,0x71,0x71, /* Dark Grey */ |
| 56 | 0x80,0x80,0x80, /* Dark Grey */ |
| 51 | 57 | 0xFF,0x80,0x80, /* Red */ |
| 52 | 58 | 0x00,0xC0,0x00, /* Green */ |
| 53 | 59 | 0xff,0x9b,0x60, /* Orange */ |
| r14686 | r14687 | |
| 204 | 210 | if( offset >= 0xa7 && offset <= 0xaa ) |
| 205 | 211 | state->m_sh_channel->update(); |
| 206 | 212 | |
| 207 | | if (offset == 0xa0) |
| 208 | | { |
| 213 | if (offset == 0xa0) { |
| 214 | |
| 215 | |
| 209 | 216 | if ( state->m_o2_vdc.s.control & VDC_CONTROL_REG_STROBE_XY |
| 210 | 217 | && !(data & VDC_CONTROL_REG_STROBE_XY)) |
| 211 | 218 | { |
| r14686 | r14687 | |
| 221 | 228 | } |
| 222 | 229 | |
| 223 | 230 | state->m_y_beam_pos = space->machine().primary_screen->vpos() - state->m_start_vpos; |
| 224 | | |
| 225 | | /* This is wrong but more games work with it, TODO: Figure |
| 226 | | * out correct change. Maybe update the screen here?? |
| 227 | | * It seems what happens is 0x0 is written to $A0 just before |
| 228 | | * VLBANK (video update) so no screen updates happen. |
| 229 | | */ |
| 230 | | |
| 231 | | return; |
| 232 | 231 | } |
| 233 | 232 | } |
| 234 | 233 | |
| r14686 | r14687 | |
| 398 | 397 | int x = state->m_o2_vdc.s.quad[i].single[0].x; |
| 399 | 398 | int j; |
| 400 | 399 | |
| 400 | // Charaecter height is always determined by the height of the 4th character |
| 401 | int char_height = 8 - ( ( ( y >> 1 ) + state->m_o2_vdc.s.quad[i].single[3].ptr ) & 7 ); |
| 402 | |
| 401 | 403 | for ( j = 0; j < ARRAY_LENGTH( state->m_o2_vdc.s.quad[0].single ); j++, x += 8 ) |
| 402 | 404 | { |
| 403 | | int char_height = 8 - ( ( ( y >> 1 ) + state->m_o2_vdc.s.quad[i].single[j].ptr ) & 7 ); |
| 405 | |
| 406 | |
| 407 | /* char_height = 8; */ |
| 408 | |
| 409 | logerror("char_height: %d, y: %d, m_start_vpos: %d\n",char_height,y, state->m_start_vpos); |
| 410 | |
| 411 | |
| 404 | 412 | if ( y <= ( vpos - state->m_start_vpos ) && ( vpos - state->m_start_vpos ) < y + char_height * 2 ) |
| 405 | 413 | { |
| 406 | | UINT16 color = 16 + ( ( state->m_o2_vdc.s.quad[i].single[j].color & 0x0E ) >> 1 ); |
| 414 | |
| 415 | UINT16 color = 16 + ( ( state->m_o2_vdc.s.quad[i].single[j].color & 0x0E ) >> 1 ); |
| 416 | |
| 417 | |
| 407 | 418 | int offset = ( state->m_o2_vdc.s.quad[i].single[j].ptr | ( ( state->m_o2_vdc.s.quad[i].single[j].color & 0x01 ) << 8 ) ) + ( y >> 1 ) + ( ( vpos - state->m_start_vpos - y ) >> 1 ); |
| 419 | |
| 408 | 420 | UINT8 chr = ((char*)o2_shape)[ offset & 0x1FF ]; |
| 421 | |
| 422 | |
| 423 | logerror("vpos: %d, object: %d, Inst: %d, offset: %d, chr: %x \n",vpos,i,j,offset,chr); |
| 424 | |
| 409 | 425 | UINT8 m; |
| 410 | 426 | for ( m = 0x80; m > 0; m >>= 1, x++ ) |
| 411 | 427 | { |