ref: dc18e188b2948ede03328c0c0cf7ab423cacc861
parent: 8bf76af5a7360d9e86a24e3d9750329f354b3ac3
author: Rangi <[email protected]>
date: Wed Mar 24 06:24:52 EDT 2021
Sync some files with pokegold
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -1729,7 +1729,7 @@
```diff
.CheckWarp:
-; Bug: Since no case is made for STANDING here, it will check
--; [.edgewarps + $ff]. This resolves to $3e at $8035a.
+-; [.EdgeWarps + $ff]. This resolves to $3e.
-; This causes wWalkingIntoEdgeWarp to be nonzero when standing on tile $3e,
-; making bumps silent.
-
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -2746,9 +2746,9 @@
.fill
ld a, [wVramState]
bit 1, a
- ld b, OBJECT_LENGTH * SPRITEOAMSTRUCT_LENGTH
+ ld b, NUM_SPRITE_OAM_STRUCTS * SPRITEOAMSTRUCT_LENGTH
jr z, .ok
- ld b, 28 * SPRITEOAMSTRUCT_LENGTH
+ ld b, (NUM_SPRITE_OAM_STRUCTS - 12) * SPRITEOAMSTRUCT_LENGTH
.ok
ldh a, [hUsedSpriteIndex]
cp b
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -392,7 +392,7 @@
.CheckWarp:
; Bug: Since no case is made for STANDING here, it will check
-; [.edgewarps + $ff]. This resolves to $3e at $8035a.
+; [.EdgeWarps + $ff]. This resolves to $3e.
; This causes wWalkingIntoEdgeWarp to be nonzero when standing on tile $3e,
; making bumps silent.
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -2360,5 +2360,5 @@
ld [wScriptVar], a
ret
-.gs_version
+.gs_version:
db GS_VERSION
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -1718,6 +1718,7 @@
NoRadioStation:
call NoRadioMusic
call NoRadioName
+; no radio channel
xor a
ld [wPokegearRadioChannelBank], a
ld [wPokegearRadioChannelAddr], a
@@ -2739,7 +2740,7 @@
ld c, 4 ; # tiles
call Request2bpp
; Walking icon
- ld hl, $c0
+ ld hl, 12 tiles
add hl, de
ld d, h
ld e, l
--- a/engine/pokemon/mon_submenu.asm
+++ b/engine/pokemon/mon_submenu.asm
@@ -41,7 +41,7 @@
.loop
ld a, MENU_UNUSED_3 | MENU_BACKUP_TILES_2 ; flags
ld [wMenuDataFlags], a
- ld a, [wMonSubmenuCount] ; items
+ ld a, [wMonSubmenuCount]
ld [wMenuDataItems], a
call InitVerticalMenuCursor
ld hl, w2DMenuFlags1
--- a/engine/printer/printer.asm
+++ b/engine/printer/printer.asm
@@ -71,7 +71,7 @@
ld hl, hVBlank
ld a, [hl]
push af
- ld [hl], 4
+ ld [hl], 4 ; vblank mode that calls AskSerial
ld a, 8 ; 16 rows
ld [wPrinterQueueLength], a
@@ -146,7 +146,7 @@
ld hl, hVBlank
ld a, [hl]
push af
- ld [hl], $4
+ ld [hl], 4 ; vblank mode that calls AskSerial
xor a
ldh [hBGMapMode], a
@@ -212,9 +212,11 @@
PrintUnownStamp:
ld a, [wPrinterQueueLength]
push af
+
xor a
ldh [hPrinter], a
call Printer_PlayMusic
+
ldh a, [rIE]
push af
xor a
@@ -221,10 +223,12 @@
ldh [rIF], a
ld a, (1 << SERIAL) | (1 << VBLANK)
ldh [rIE], a
+
ld hl, hVBlank
ld a, [hl]
push af
- ld [hl], $4
+ ld [hl], 4 ; vblank mode that calls AskSerial
+
xor a
ldh [hBGMapMode], a
call LoadTilemapToTempTilemap
@@ -233,6 +237,7 @@
call Printer_PrepareTilemapForPrint
call SafeLoadTempTilemapToTilemap
call Printer_ResetJoypadRegisters
+
ld a, 18 / 2
ld [wPrinterQueueLength], a
.loop
@@ -260,10 +265,12 @@
ldh [hVBlank], a
call Printer_CleanUpAfterSend
call SafeLoadTempTilemapToTilemap
+
xor a
ldh [rIF], a
pop af
ldh [rIE], a
+
pop af
ld [wPrinterQueueLength], a
ret
@@ -295,7 +302,7 @@
ld hl, hVBlank
ld a, [hl]
push af
- ld [hl], $4
+ ld [hl], 4 ; vblank mode that calls AskSerial
ld a, 18 / 2
ld [wPrinterQueueLength], a
@@ -338,7 +345,7 @@
ld hl, hVBlank
ld a, [hl]
push af
- ld [hl], $4
+ ld [hl], 4 ; vblank mode that calls AskSerial
ld a, 16 / 2
ld [wPrinterQueueLength], a
@@ -396,7 +403,7 @@
ld hl, hVBlank
ld a, [hl]
push af
- ld [hl], $4
+ ld [hl], 4 ; vblank mode that calls AskSerial
ln a, 1, 0 ; to be loaded to wPrinterMargins
call Printer_PrepareTilemapForPrint
--- a/engine/tilesets/tileset_anims.asm
+++ b/engine/tilesets/tileset_anims.asm
@@ -93,7 +93,7 @@
dw NULL, DoneTileAnimation
UnusedTilesetAnim1: ; unreferenced
-; Scrolls tile $03 like water, but also has the standard $03 flower tile.
+; Scrolls tile $03 like cave water, but also has the standard $03 flower tile.
dw vTiles2 tile $03, ReadTileToAnimBuffer
dw wTileAnimBuffer, ScrollTileRightLeft
dw vTiles2 tile $03, WriteTileFromAnimBuffer