Move enum to bg.h

This commit is contained in:
MCboy 2022-01-14 13:48:46 +03:30 committed by GitHub
parent 998900bd1b
commit 1a33187bad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 18 deletions

View File

@ -776,17 +776,6 @@ void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dis
SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle); SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle);
} }
enum
{
MOSAIC_SET_HV,
MOSAIC_SET_H,
MOSAIC_ADD_H,
MOSAIC_SUB_H,
MOSAIC_SET_V,
MOSAIC_ADD_V,
MOSAIC_SUB_V,
};
u8 Unused_AdjustBgMosaic(u8 val, u8 mode) u8 Unused_AdjustBgMosaic(u8 val, u8 mode)
{ {
u16 mosaic = GetGpuReg(REG_OFFSET_MOSAIC); u16 mosaic = GetGpuReg(REG_OFFSET_MOSAIC);
@ -797,15 +786,15 @@ u8 Unused_AdjustBgMosaic(u8 val, u8 mode)
switch (mode) switch (mode)
{ {
case MOSAIC_SET_HV: case BG_MOSAIC_SET_HV:
default: default:
bgH = val & 0xF; bgH = val & 0xF;
bgV = val >> 0x4; bgV = val >> 0x4;
break; break;
case MOSAIC_SET_H: case BG_MOSAIC_SET_H:
bgH = val & 0xF; bgH = val & 0xF;
break; break;
case MOSAIC_ADD_H: case BG_MOSAIC_ADD_H:
if ((bgH + val) > 0xF) if ((bgH + val) > 0xF)
{ {
bgH = 0xF; bgH = 0xF;
@ -815,7 +804,7 @@ u8 Unused_AdjustBgMosaic(u8 val, u8 mode)
bgH += val; bgH += val;
} }
break; break;
case MOSAIC_SUB_H: case BG_MOSAIC_SUB_H:
if ((bgH - val) < 0) if ((bgH - val) < 0)
{ {
bgH = 0x0; bgH = 0x0;
@ -825,10 +814,10 @@ u8 Unused_AdjustBgMosaic(u8 val, u8 mode)
bgH -= val; bgH -= val;
} }
break; break;
case MOSAIC_SET_V: case BG_MOSAIC_SET_V:
bgV = val & 0xF; bgV = val & 0xF;
break; break;
case MOSAIC_ADD_V: case BG_MOSAIC_ADD_V:
if ((bgV + val) > 0xF) if ((bgV + val) > 0xF)
{ {
bgV = 0xF; bgV = 0xF;
@ -838,7 +827,7 @@ u8 Unused_AdjustBgMosaic(u8 val, u8 mode)
bgV += val; bgV += val;
} }
break; break;
case MOSAIC_SUB_V: case BG_MOSAIC_SUB_V:
if ((bgV - val) < 0) if ((bgV - val) < 0)
{ {
bgV = 0x0; bgV = 0x0;

View File

@ -28,6 +28,17 @@ enum {
BG_COORD_SUB, BG_COORD_SUB,
}; };
// Modes for Unused_AdjustBgMosaic
enum {
BG_MOSAIC_SET_HV,
BG_MOSAIC_SET_H,
BG_MOSAIC_ADD_H,
BG_MOSAIC_SUB_H,
BG_MOSAIC_SET_V,
BG_MOSAIC_ADD_V,
BG_MOSAIC_SUB_V,
};
struct BgTemplate struct BgTemplate
{ {
u16 bg:2; // 0x1, 0x2 -> 0x3 u16 bg:2; // 0x1, 0x2 -> 0x3