factored a little bit windows/out of windows

This commit is contained in:
damdoum 2007-01-16 14:20:11 +00:00
parent e1b4c479a5
commit a639ae21a0
2 changed files with 37 additions and 150 deletions

View File

@ -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
))
{
switch (bgnum) {
case 0:
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 ;
}
/* is drawing explicit set for this bg in this rectangle ? */
*draw = gpu->WINDOW_INCNT.windows.win0_en & (1<<bgnum);
*effect = gpu->WINDOW_INCNT.bits.WIN0_Effect_Enable ;
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
))
{
switch (bgnum) {
case 0:
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 ;
}
/* is drawing explicit set for this bg in this rectangle ? */
*draw = gpu->WINDOW_INCNT.windows.win1_en & (1<<bgnum);
*effect = gpu->WINDOW_INCNT.bits.WIN1_Effect_Enable ;
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
))
{
switch (bgnum) {
case 0:
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 ;
}
/* is drawing explicit set for this bg in this rectangle ? */
*draw = gpu->WINDOW_OUTCNT.windows.win0_en & (1<<bgnum);
*effect = gpu->WINDOW_OUTCNT.bits.WIN0_Effect_Enable ;
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
))
{
switch (bgnum) {
case 0:
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 ;
}
/* is drawing explicit set for this bg in this rectangle ? */
*draw = gpu->WINDOW_OUTCNT.windows.win1_en & (1<<bgnum);
*effect = gpu->WINDOW_OUTCNT.bits.WIN1_Effect_Enable ;
return TRUE ;
}

View File

@ -305,6 +305,13 @@ typedef union windowcnt_t
unsigned char low ;
unsigned char high ;
} bytes ;
struct
{
unsigned win0_en:5;
unsigned :3;
unsigned win1_en:5;
unsigned :3;
} windows ;
unsigned short val ;
} windowcnt_t ;