[SNES]: added OBJ interlace support

This commit is contained in:
Angelo Salese 2009-08-20 19:53:05 +00:00
parent dd46ee883a
commit 14aeb37220
3 changed files with 6 additions and 1 deletions

View File

@ -493,7 +493,7 @@ struct SNES_PPU_STRUCT /* once all the regs are saved in this structure, it woul
UINT8 bg3_priority_bit;
UINT8 direct_color;
UINT8 ppu_last_scroll; /* as per Anomie's doc and Theme Park, all scroll regs shares (but mode 7 ones) the same
'previous' scroll value */
'previous' scroll value */
UINT8 mode7_last_scroll; /* as per Anomie's doc mode 7 scroll regs use a different value, shared with mode 7 matrix! */
UINT8 main_bg_enabled[5]; // these would probably better fit the layer struct, but it would make worse the code in snes_update_mode_X()
@ -508,6 +508,7 @@ struct SNES_PPU_STRUCT /* once all the regs are saved in this structure, it woul
UINT8 update_offsets;
UINT8 mode;
UINT8 interlace; //doubles the visible resolution
UINT8 obj_interlace;
};
struct snes_cart_info

View File

@ -1162,6 +1162,7 @@ WRITE8_HANDLER( snes_w_io )
case SETINI: /* Screen mode/video select */
/* FIXME: We only support line count and interlace here */
snes_ppu.interlace = (data & 1) ? 2 : 1;
snes_ppu.obj_interlace = (data & 2) ? 2 : 1;
snes_ppu.beam.last_visible_line = (data & 0x4) ? 240 : 225;
snes_dynamic_res_change(space->machine);
#ifdef SNES_DBG_REG_W
@ -1892,6 +1893,7 @@ MACHINE_RESET( snes )
snes_htmult = 1;
snes_ppu.interlace = 1;
snes_ppu.obj_interlace = 1;
}

View File

@ -768,6 +768,7 @@ static void snes_update_objects( UINT8 screen, UINT8 priority_tbl, UINT16 curlin
widemode = 1;
curline/=snes_ppu.interlace;
curline*=snes_ppu.obj_interlace;
oam = 0x1ff;
oam_extra = oam + 0x20;
@ -789,6 +790,7 @@ static void snes_update_objects( UINT8 screen, UINT8 priority_tbl, UINT16 curlin
extra <<= 1;
x |= ((extra & 0x80) << 1);
extra <<= 1;
y*=snes_ppu.obj_interlace;
/* Adjust if past maximum position */
if( y >= snes_ppu.beam.last_visible_line*snes_ppu.interlace )