added 8bit component writes for window dimensions, fixed false abort in windowing
This commit is contained in:
parent
5599c9ee15
commit
a806f55c47
|
@ -533,11 +533,33 @@ void GPU_setWINDOW_XDIM(GPU *gpu, u16 v, u8 num)
|
|||
gpu->WINDOW_XDIM[num].val = v ;
|
||||
}
|
||||
|
||||
void GPU_setWINDOW_XDIM_Component(GPU *gpu, u8 v, u8 num) /* write start/end seperately */
|
||||
{
|
||||
if (num & 1)
|
||||
{
|
||||
gpu->WINDOW_XDIM[num >> 1].bitfield.start = v ;
|
||||
} else
|
||||
{
|
||||
gpu->WINDOW_XDIM[num >> 1].bitfield.end = v ;
|
||||
}
|
||||
}
|
||||
|
||||
void GPU_setWINDOW_YDIM(GPU *gpu, u16 v, u8 num)
|
||||
{
|
||||
gpu->WINDOW_YDIM[num].val = v ;
|
||||
}
|
||||
|
||||
void GPU_setWINDOW_YDIM_Component(GPU *gpu, u8 v, u8 num) /* write start/end seperately */
|
||||
{
|
||||
if (num & 1)
|
||||
{
|
||||
gpu->WINDOW_YDIM[num >> 1].bitfield.start = v ;
|
||||
} else
|
||||
{
|
||||
gpu->WINDOW_YDIM[num >> 1].bitfield.end = v ;
|
||||
}
|
||||
}
|
||||
|
||||
void GPU_setWINDOW_INCNT(GPU *gpu, u16 v)
|
||||
{
|
||||
gpu->WINDOW_INCNT.val = v ;
|
||||
|
@ -577,19 +599,19 @@ INLINE BOOL renderline_checkWindowInside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
|||
*draw = TRUE ;
|
||||
break ;
|
||||
case 2:
|
||||
if (!gpu->WINDOW_INCNT.bitfield.WIN0_BG2_Enable)
|
||||
if (!gpu->WINDOW_INCNT.bitfield.WIN0_BG2_Enable)
|
||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
||||
else
|
||||
*draw = TRUE ;
|
||||
break ;
|
||||
case 3:
|
||||
if (!gpu->WINDOW_INCNT.bitfield.WIN0_BG3_Enable)
|
||||
if (!gpu->WINDOW_INCNT.bitfield.WIN0_BG3_Enable)
|
||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
||||
else
|
||||
*draw = TRUE ;
|
||||
break ;
|
||||
case 4:
|
||||
if (!gpu->WINDOW_INCNT.bitfield.WIN0_OBJ_Enable)
|
||||
if (!gpu->WINDOW_INCNT.bitfield.WIN0_OBJ_Enable)
|
||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
||||
else
|
||||
*draw = TRUE ;
|
||||
|
@ -600,7 +622,7 @@ INLINE BOOL renderline_checkWindowInside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (gpu->dispCnt.bitfield.Win1_Enable) /* mid priority */
|
||||
if (gpu->dispCnt.bitfield.Win1_Enable) /* mid priority */
|
||||
{
|
||||
if ((gpu->WINDOW_XDIM[1].val) && (gpu->WINDOW_YDIM[1].val))
|
||||
{
|
||||
|
@ -644,7 +666,7 @@ INLINE BOOL renderline_checkWindowInside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ((gpu->dispCnt.bitfield.WinOBJ_Enable) && (bgnum==4)) /* low priority, but only applies to OBJ */
|
||||
if ((gpu->dispCnt.bitfield.WinOBJ_Enable) && (bgnum==4)) /* low priority, but only applies to OBJ */
|
||||
{
|
||||
}
|
||||
/* we have no rule, so allow everything for now */
|
||||
|
@ -700,7 +722,7 @@ INLINE BOOL renderline_checkWindowOutside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (gpu->dispCnt.bitfield.Win1_Enable) /* mid priority */
|
||||
if (gpu->dispCnt.bitfield.Win1_Enable) /* mid priority */
|
||||
{
|
||||
if (!((gpu->WINDOW_XDIM[1].val) && (gpu->WINDOW_YDIM[1].val)))
|
||||
{
|
||||
|
@ -744,7 +766,7 @@ INLINE BOOL renderline_checkWindowOutside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ((gpu->dispCnt.bitfield.WinOBJ_Enable) && (bgnum==4)) /* low priority, but only applies to OBJ */
|
||||
if ((gpu->dispCnt.bitfield.WinOBJ_Enable) && (bgnum==4)) /* low priority, but only applies to OBJ */
|
||||
{
|
||||
}
|
||||
/* we have no rule, so allow everything for now */
|
||||
|
|
|
@ -333,7 +333,10 @@ static INLINE void GPU_ligne(Screen * screen, u16 l)
|
|||
u8 i8;
|
||||
u16 i16;
|
||||
u32 c;
|
||||
|
||||
/* initialize the scanline black */
|
||||
/* not doing this causes invalid colors when all active BGs are prevented to draw at some place */
|
||||
memset(dst,0,256*2) ;
|
||||
|
||||
// This could almost be changed to use function pointers
|
||||
switch (gpu->dispMode)
|
||||
{
|
||||
|
@ -521,6 +524,9 @@ void GPU_setMOSAIC(GPU *gpu, u16 v) ;
|
|||
|
||||
void GPU_setWINDOW_XDIM(GPU *gpu, u16 v, u8 num) ;
|
||||
void GPU_setWINDOW_YDIM(GPU *gpu, u16 v, u8 num) ;
|
||||
void GPU_setWINDOW_XDIM_Component(GPU *gpu, u8 v, u8 num) ;
|
||||
void GPU_setWINDOW_YDIM_Component(GPU *gpu, u8 v, u8 num) ;
|
||||
|
||||
void GPU_setWINDOW_INCNT(GPU *gpu, u16 v) ;
|
||||
void GPU_setWINDOW_INCNT(GPU *gpu, u16 v) ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue