diff options
author | Diegoisawesome <Diegoisawesome@users.noreply.github.com> | 2019-08-17 22:38:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-17 22:38:28 -0500 |
commit | 40fa9ddbb853c4d825e4dd8eb6f5c5e40cd53dd3 (patch) | |
tree | f6ea0af0d9a8189d2a5cb67cd6c9823250c5e03a /src/scrcmd.c | |
parent | 4663564e028cd5a4f271ce34835ee2939593c99f (diff) | |
parent | 18dee141704daa10313f27890d0f97a2a083a496 (diff) |
Merge pull request #782 from tustin2121/trihard-giveback2
Giving back from TriHard Emerald development
Diffstat (limited to 'src/scrcmd.c')
-rw-r--r-- | src/scrcmd.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c index 57cd3edbe..e31be848a 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -62,7 +62,7 @@ static EWRAM_DATA u16 sMovingNpcMapBank = 0; static EWRAM_DATA u16 sMovingNpcMapId = 0; static EWRAM_DATA u16 sFieldEffectScriptId = 0; -static u8 gUnknown_03000F30; +static u8 gBrailleWindowId; extern const SpecialFunc gSpecials[]; extern const u8 *gStdScripts[]; @@ -466,6 +466,9 @@ bool8 ScrCmd_addvar(struct ScriptContext *ctx) { u16 *ptr = GetVarPointer(ScriptReadHalfword(ctx)); *ptr += ScriptReadHalfword(ctx); + // Note: addvar doesn't support adding from a variable in vanilla. If you were to + // add a VarGet() to the above, make sure you change the `addvar VAR_0x8006, 65535` + // in the contest scripts to `subvar VAR_0x8006, 1`, else contests will break. return FALSE; } @@ -1102,7 +1105,7 @@ bool8 ScrCmd_setobjectxyperm(struct ScriptContext *ctx) return FALSE; } -bool8 ScrCmd_moveobjectoffscreen(struct ScriptContext *ctx) +bool8 ScrCmd_copyobjectxytoperm(struct ScriptContext *ctx) { u16 localId = VarGet(ScriptReadHalfword(ctx)); @@ -1515,13 +1518,13 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) yText = (yText - yWindow - 1) * 8; winTemplate = CreateWindowTemplate(0, xWindow, yWindow + 1, width, height, 0xF, 0x1); - gUnknown_03000F30 = AddWindow(&winTemplate); - LoadUserWindowBorderGfx(gUnknown_03000F30, 0x214, 0xE0); - DrawStdWindowFrame(gUnknown_03000F30, 0); - PutWindowTilemap(gUnknown_03000F30); - FillWindowPixelBuffer(gUnknown_03000F30, PIXEL_FILL(1)); - AddTextPrinterParameterized(gUnknown_03000F30, 6, gStringVar4, xText, yText, 0xFF, 0x0); - CopyWindowToVram(gUnknown_03000F30, 3); + gBrailleWindowId = AddWindow(&winTemplate); + LoadUserWindowBorderGfx(gBrailleWindowId, 0x214, 0xE0); + DrawStdWindowFrame(gBrailleWindowId, 0); + PutWindowTilemap(gBrailleWindowId); + FillWindowPixelBuffer(gBrailleWindowId, PIXEL_FILL(1)); + AddTextPrinterParameterized(gBrailleWindowId, 6, gStringVar4, xText, yText, 0xFF, 0x0); + CopyWindowToVram(gBrailleWindowId, 3); return FALSE; } @@ -2254,8 +2257,8 @@ bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx) void sub_809BDB4(void) { - ClearStdWindowAndFrame(gUnknown_03000F30, 1); - RemoveWindow(gUnknown_03000F30); + ClearStdWindowAndFrame(gBrailleWindowId, 1); + RemoveWindow(gBrailleWindowId); } bool8 ScrCmd_buffertrainerclassname(struct ScriptContext *ctx) |