mirror of https://github.com/zeldaret/tmc.git
Merge pull request #234 from hatal175/dispCtrlSet
Tried to decompile dispCtrlSet
This commit is contained in:
commit
8b6601525f
|
|
@ -5,10 +5,10 @@
|
|||
#include "fade.h"
|
||||
|
||||
typedef struct {
|
||||
u16 displayControl;
|
||||
u8 filler2[0x2];
|
||||
u16 unk4;
|
||||
u16 displayControlMask;
|
||||
/*0x00*/ u16 displayControl;
|
||||
/*0x02*/ u8 filler2[0x2];
|
||||
/*0x04*/ u16 unk4;
|
||||
/*0x06*/ u16 displayControlMask;
|
||||
} LcdControls;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -28,22 +28,19 @@ typedef struct {
|
|||
} BgAffSettings;
|
||||
|
||||
typedef struct {
|
||||
u16 bg2dx;
|
||||
u16 bg2dmx;
|
||||
u16 bg2dy;
|
||||
u16 bg2dmy;
|
||||
u16 bg2xPointLeastSig;
|
||||
u16 bg2xPointMostSig;
|
||||
u16 bg2yPointLeastSig;
|
||||
u16 bg2yPointMostSig;
|
||||
u16 bg3dx;
|
||||
u16 bg3dmx;
|
||||
u16 bg3dy;
|
||||
u16 bg3dmy;
|
||||
u16 bg3xPointLeastSig;
|
||||
u16 bg3xPointMostSig;
|
||||
u16 bg3yPointLeastSig;
|
||||
u16 bg3yPointMostSig;
|
||||
u16 dx;
|
||||
u16 dmx;
|
||||
u16 dy;
|
||||
u16 dmy;
|
||||
u16 xPointLeastSig;
|
||||
u16 xPointMostSig;
|
||||
u16 yPointLeastSig;
|
||||
u16 yPointMostSig;
|
||||
} BgTransformationSettings;
|
||||
|
||||
typedef struct {
|
||||
BgTransformationSettings bg2;
|
||||
BgTransformationSettings bg3;
|
||||
u16 window0HorizontalDimensions;
|
||||
u16 window1HorizontalDimensions;
|
||||
u16 window0VerticalDimensions;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,55 @@ void sub_08016CA8(BgSettings* bg) {
|
|||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/dispCtrlSet.s", void DispCtrlSet(void));
|
||||
NONMATCH("asm/non_matching/dispCtrlSet.inc", void DispCtrlSet(void)) {
|
||||
BgControls* controls;
|
||||
u16 tmp = gScreen.lcd.displayControl & gScreen.lcd.displayControlMask;
|
||||
REG_DISPCNT = tmp;
|
||||
|
||||
REG_BG0CNT = gScreen.bg0.control;
|
||||
REG_BG1CNT = gScreen.bg1.control;
|
||||
REG_BG2CNT = gScreen.bg2.control;
|
||||
REG_BG3CNT = gScreen.bg3.control;
|
||||
REG_BG0HOFS = gScreen.bg0.xOffset;
|
||||
REG_BG0VOFS = gScreen.bg0.yOffset;
|
||||
REG_BG1HOFS = gScreen.bg1.xOffset;
|
||||
REG_BG1VOFS = gScreen.bg1.yOffset;
|
||||
REG_BG2HOFS = gScreen.bg2.xOffset;
|
||||
REG_BG2VOFS = gScreen.bg2.yOffset;
|
||||
REG_BG3HOFS = gScreen.bg3.xOffset;
|
||||
REG_BG3VOFS = gScreen.bg3.yOffset;
|
||||
|
||||
controls = &(gScreen.controls);
|
||||
REG_BG2PA = controls->bg2.dx;
|
||||
REG_BG2PB = controls->bg2.dmx;
|
||||
REG_BG2PC = controls->bg2.dy;
|
||||
REG_BG2PD = controls->bg2.dmy;
|
||||
REG_BG2X_L = controls->bg2.xPointLeastSig;
|
||||
REG_BG2X_H = controls->bg2.xPointMostSig;
|
||||
REG_BG2Y_L = controls->bg2.yPointLeastSig;
|
||||
REG_BG2Y_H = controls->bg2.yPointMostSig;
|
||||
|
||||
REG_BG3PA = controls->bg3.dx;
|
||||
REG_BG3PB = controls->bg3.dmx;
|
||||
REG_BG3PC = controls->bg3.dy;
|
||||
REG_BG3PD = controls->bg3.dmy;
|
||||
REG_BG3X_L = controls->bg3.xPointLeastSig;
|
||||
REG_BG3X_H = controls->bg3.xPointMostSig;
|
||||
REG_BG3Y_L = controls->bg3.yPointLeastSig;
|
||||
REG_BG3Y_H = controls->bg3.yPointMostSig;
|
||||
|
||||
REG_WIN0H = controls->window0HorizontalDimensions;
|
||||
REG_WIN1H = controls->window1HorizontalDimensions;
|
||||
REG_WIN0V = controls->window0VerticalDimensions;
|
||||
REG_WIN1V = controls->window1VerticalDimensions;
|
||||
REG_WININ = controls->windowInsideControl;
|
||||
REG_WINOUT = controls->windowOutsideControl;
|
||||
REG_MOSAIC = controls->mosaicSize;
|
||||
REG_BLDCNT = controls->layerFXControl;
|
||||
REG_BLDALPHA = controls->alphaBlend;
|
||||
REG_BLDY = controls->layerBrightness;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// Load any resources that were requested with LoadResourceAsync
|
||||
void LoadResources(void) {
|
||||
|
|
|
|||
|
|
@ -237,14 +237,14 @@ void sub_08058BC8(ManagerC* this) {
|
|||
tmp++;
|
||||
} while (++tmp3 < 0xA0u);
|
||||
tmp = &gUnk_02017BA0[gUnk_03003DE4[0] * 0xA0];
|
||||
gScreen.controls.bg2dx = tmp->pa;
|
||||
gScreen.controls.bg2dmx = tmp->pb;
|
||||
gScreen.controls.bg2dy = tmp->pc;
|
||||
gScreen.controls.bg2dmy = tmp->pd;
|
||||
gScreen.controls.bg2xPointLeastSig = ((union SplitWord*)&tmp->dx)->HALF.LO;
|
||||
gScreen.controls.bg2xPointMostSig = ((union SplitWord*)&tmp->dx)->HALF.HI;
|
||||
gScreen.controls.bg2yPointLeastSig = ((union SplitWord*)&tmp->dy)->HALF.LO;
|
||||
gScreen.controls.bg2yPointMostSig = ((union SplitWord*)&tmp->dy)->HALF.HI;
|
||||
gScreen.controls.bg2.dx = tmp->pa;
|
||||
gScreen.controls.bg2.dmx = tmp->pb;
|
||||
gScreen.controls.bg2.dy = tmp->pc;
|
||||
gScreen.controls.bg2.dmy = tmp->pd;
|
||||
gScreen.controls.bg2.xPointLeastSig = ((union SplitWord*)&tmp->dx)->HALF.LO;
|
||||
gScreen.controls.bg2.xPointMostSig = ((union SplitWord*)&tmp->dx)->HALF.HI;
|
||||
gScreen.controls.bg2.yPointLeastSig = ((union SplitWord*)&tmp->dy)->HALF.LO;
|
||||
gScreen.controls.bg2.yPointMostSig = ((union SplitWord*)&tmp->dy)->HALF.HI;
|
||||
}
|
||||
|
||||
const u16 gUnk_08108300[4] = { 0xA4, 0x4C, 0xF4, 0x9C };
|
||||
|
|
|
|||
Loading…
Reference in New Issue