factored a little bit windows/out of windows
This commit is contained in:
parent
e1b4c479a5
commit
a639ae21a0
|
@ -590,38 +590,8 @@ INLINE BOOL renderline_checkWindowInside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
||||||
gpu->WINDOW_XDIM[0].bits.end,gpu->WINDOW_YDIM[0].bits.end
|
gpu->WINDOW_XDIM[0].bits.end,gpu->WINDOW_YDIM[0].bits.end
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
switch (bgnum) {
|
/* is drawing explicit set for this bg in this rectangle ? */
|
||||||
case 0:
|
*draw = gpu->WINDOW_INCNT.windows.win0_en & (1<<bgnum);
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN0_BG0_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 1:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN0_BG1_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 2:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN0_BG2_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 3:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN0_BG3_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 4:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN0_OBJ_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
*effect = gpu->WINDOW_INCNT.bits.WIN0_Effect_Enable ;
|
*effect = gpu->WINDOW_INCNT.bits.WIN0_Effect_Enable ;
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
}
|
}
|
||||||
|
@ -633,38 +603,8 @@ INLINE BOOL renderline_checkWindowInside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
||||||
gpu->WINDOW_XDIM[1].bits.end,gpu->WINDOW_YDIM[1].bits.end
|
gpu->WINDOW_XDIM[1].bits.end,gpu->WINDOW_YDIM[1].bits.end
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
switch (bgnum) {
|
/* is drawing explicit set for this bg in this rectangle ? */
|
||||||
case 0:
|
*draw = gpu->WINDOW_INCNT.windows.win1_en & (1<<bgnum);
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN1_BG0_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 1:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN1_BG1_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 2:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN1_BG2_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 3:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN1_BG3_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 4:
|
|
||||||
if (!gpu->WINDOW_INCNT.bits.WIN1_OBJ_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
*effect = gpu->WINDOW_INCNT.bits.WIN1_Effect_Enable ;
|
*effect = gpu->WINDOW_INCNT.bits.WIN1_Effect_Enable ;
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
}
|
}
|
||||||
|
@ -688,38 +628,8 @@ INLINE BOOL renderline_checkWindowOutside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
||||||
gpu->WINDOW_XDIM[0].bits.end,gpu->WINDOW_YDIM[0].bits.end
|
gpu->WINDOW_XDIM[0].bits.end,gpu->WINDOW_YDIM[0].bits.end
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
switch (bgnum) {
|
/* is drawing explicit set for this bg in this rectangle ? */
|
||||||
case 0:
|
*draw = gpu->WINDOW_OUTCNT.windows.win0_en & (1<<bgnum);
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN0_BG0_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 1:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN0_BG1_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 2:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN0_BG2_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 3:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN0_BG3_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 4:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN0_OBJ_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
*effect = gpu->WINDOW_OUTCNT.bits.WIN0_Effect_Enable ;
|
*effect = gpu->WINDOW_OUTCNT.bits.WIN0_Effect_Enable ;
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
}
|
}
|
||||||
|
@ -731,38 +641,8 @@ INLINE BOOL renderline_checkWindowOutside(GPU *gpu, u8 bgnum, u16 x, u16 y, BOOL
|
||||||
gpu->WINDOW_XDIM[1].bits.end,gpu->WINDOW_YDIM[1].bits.end
|
gpu->WINDOW_XDIM[1].bits.end,gpu->WINDOW_YDIM[1].bits.end
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
switch (bgnum) {
|
/* is drawing explicit set for this bg in this rectangle ? */
|
||||||
case 0:
|
*draw = gpu->WINDOW_OUTCNT.windows.win1_en & (1<<bgnum);
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN1_BG0_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 1:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN1_BG1_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 2:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN1_BG2_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 3:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN1_BG3_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
case 4:
|
|
||||||
if (!gpu->WINDOW_OUTCNT.bits.WIN1_OBJ_Enable)
|
|
||||||
*draw = FALSE ; /* drawing explicit disabled for thios bg in this rectangle */
|
|
||||||
else
|
|
||||||
*draw = TRUE ;
|
|
||||||
break ;
|
|
||||||
}
|
|
||||||
*effect = gpu->WINDOW_OUTCNT.bits.WIN1_Effect_Enable ;
|
*effect = gpu->WINDOW_OUTCNT.bits.WIN1_Effect_Enable ;
|
||||||
return TRUE ;
|
return TRUE ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,13 @@ typedef union windowcnt_t
|
||||||
unsigned char low ;
|
unsigned char low ;
|
||||||
unsigned char high ;
|
unsigned char high ;
|
||||||
} bytes ;
|
} bytes ;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned win0_en:5;
|
||||||
|
unsigned :3;
|
||||||
|
unsigned win1_en:5;
|
||||||
|
unsigned :3;
|
||||||
|
} windows ;
|
||||||
unsigned short val ;
|
unsigned short val ;
|
||||||
} windowcnt_t ;
|
} windowcnt_t ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue