summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotyourav <65437533+notyourav@users.noreply.github.com>2023-06-06 15:20:43 -0700
committerGitHub <noreply@github.com>2023-06-06 15:20:43 -0700
commiteb233b05cdd259fe52737c8287fbdfc8e4bd7870 (patch)
tree19d55caf526b52dc1f746473cdd06a6f9c8f3b15
parent79bbd540a8846e48f97b77ea03d28828bdcca0ae (diff)
parentc07357747879e9b4af3c73d3b190996b2d2e757b (diff)
Merge pull request #613 from nonmatch/patch-74
-rw-r--r--asm/non_matching/DispCtrlSet.inc131
-rw-r--r--src/interrupts.c67
2 files changed, 37 insertions, 161 deletions
diff --git a/asm/non_matching/DispCtrlSet.inc b/asm/non_matching/DispCtrlSet.inc
deleted file mode 100644
index cadf64af..00000000
--- a/asm/non_matching/DispCtrlSet.inc
+++ /dev/null
@@ -1,131 +0,0 @@
- .syntax unified
- ldr r3, _08016DF0 @ =gScreen
- ldrh r1, [r3]
- ldrh r0, [r3, #6]
- ands r0, r1
- movs r1, #0x80
- lsls r1, r1, #0x13
- strh r0, [r1]
- adds r1, #8
- ldrh r0, [r3, #8]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x14]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x20]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x2c]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0xa]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0xc]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x16]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x18]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x22]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x24]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x2e]
- strh r0, [r1]
- adds r1, #2
- ldrh r0, [r3, #0x30]
- strh r0, [r1]
- adds r1, r3, #0
- adds r1, #0x38
- ldr r2, _08016DF4 @ =0x04000020
- ldrh r0, [r3, #0x38]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #2]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #4]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #6]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #8]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xa]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xc]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xe]
- strh r0, [r2]
- adds r1, #0x10
- adds r2, #2
- ldrh r0, [r1]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #2]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #4]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #6]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #8]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xa]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xc]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xe]
- strh r0, [r2]
- adds r1, #0x10
- adds r2, #2
- ldrh r0, [r1]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #2]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #4]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #6]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #8]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xa]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0xc]
- strh r0, [r2]
- adds r2, #4
- ldrh r0, [r1, #0xe]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0x10]
- strh r0, [r2]
- adds r2, #2
- ldrh r0, [r1, #0x12]
- strh r0, [r2]
- bx lr
- .align 2, 0
-_08016DF0: .4byte gScreen
-_08016DF4: .4byte 0x04000020
- .syntax divided
diff --git a/src/interrupts.c b/src/interrupts.c
index 23934487..69a0f137 100644
--- a/src/interrupts.c
+++ b/src/interrupts.c
@@ -94,8 +94,10 @@ void sub_08016CA8(BgSettings* bg) {
}
}
-NONMATCH("asm/non_matching/DispCtrlSet.inc", void DispCtrlSet(void)) {
+void DispCtrlSet(void) {
+ u16* tmp2;
BgControls* controls;
+ BgTransformationSettings* bgTfSettings;
u16 tmp = gScreen.lcd.displayControl & gScreen.lcd.displayControlMask;
REG_DISPCNT = tmp;
@@ -113,36 +115,41 @@ NONMATCH("asm/non_matching/DispCtrlSet.inc", void DispCtrlSet(void)) {
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;
+ bgTfSettings = &controls->bg2;
+
+ REG_BG2PA = bgTfSettings->dx;
+ REG_BG2PB = bgTfSettings->dmx;
+ REG_BG2PC = bgTfSettings->dy;
+ REG_BG2PD = bgTfSettings->dmy;
+ REG_BG2X_L = bgTfSettings->xPointLeastSig;
+ REG_BG2X_H = bgTfSettings->xPointMostSig;
+ REG_BG2Y_L = bgTfSettings->yPointLeastSig;
+ REG_BG2Y_H = bgTfSettings->yPointMostSig;
+
+ bgTfSettings = &controls->bg3;
+
+ REG_BG3PA = bgTfSettings->dx;
+ REG_BG3PB = bgTfSettings->dmx;
+ REG_BG3PC = bgTfSettings->dy;
+ REG_BG3PD = bgTfSettings->dmy;
+ REG_BG3X_L = bgTfSettings->xPointLeastSig;
+ REG_BG3X_H = bgTfSettings->xPointMostSig;
+ REG_BG3Y_L = bgTfSettings->yPointLeastSig;
+ REG_BG3Y_H = bgTfSettings->yPointMostSig;
+
+ tmp2 = &controls->window0HorizontalDimensions;
+ REG_WIN0H = tmp2[0];
+ // REG_WIN0H = *tmp2;
+ REG_WIN1H = tmp2[1];
+ REG_WIN0V = tmp2[2];
+ REG_WIN1V = tmp2[3];
+ REG_WININ = tmp2[4];
+ REG_WINOUT = tmp2[5];
+ REG_MOSAIC = tmp2[6];
+ REG_BLDCNT = tmp2[7];
+ REG_BLDALPHA = tmp2[8];
+ REG_BLDY = tmp2[9];
}
-END_NONMATCH
// Load any resources that were requested with LoadResourceAsync
void LoadResources(void) {