summaryrefslogtreecommitdiff
path: root/src/home/empty_screen.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/home/empty_screen.asm')
-rw-r--r--src/home/empty_screen.asm39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/home/empty_screen.asm b/src/home/empty_screen.asm
new file mode 100644
index 0000000..060f19e
--- /dev/null
+++ b/src/home/empty_screen.asm
@@ -0,0 +1,39 @@
+; initialize the screen by emptying the tilemap. used during screen transitions
+EmptyScreen: ; 04a2 (0:04a2)
+ call DisableLCD
+ call FillTileMap
+ xor a
+ ld [wDuelDisplayedScreen], a
+ ld a, [wConsole]
+ cp CONSOLE_SGB
+ ret nz
+ call EnableLCD
+ ld hl, AttrBlkPacket_EmptyScreen
+ call SendSGB
+ call DisableLCD
+ ret
+
+AttrBlkPacket_EmptyScreen: ; 04bf (0:04bf)
+ sgb ATTR_BLK, 1 ; sgb_command, length
+ db 1 ; number of data sets
+ ; Control Code, Color Palette Designation, X1, Y1, X2, Y2
+ db ATTR_BLK_CTRL_INSIDE + ATTR_BLK_CTRL_LINE, 0 << 0 + 0 << 2, 0, 0, 19, 17 ; data set 1
+ ds 6 ; data set 2
+ ds 2 ; data set 3
+
+; returns v*BGMap0 + BG_MAP_WIDTH * c + b in de.
+; used to map coordinates at bc to a BGMap0 address.
+BCCoordToBGMap0Address: ; 04cf (0:04cf)
+ ld l, c
+ ld h, $0
+ add hl, hl
+ add hl, hl
+ add hl, hl
+ add hl, hl
+ add hl, hl
+ ld c, b
+ ld b, HIGH(v0BGMap0)
+ add hl, bc
+ ld e, l
+ ld d, h
+ ret