diff options
author | Daniel Harding <33dannye@gmail.com> | 2021-09-19 00:21:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-19 00:21:14 -0500 |
commit | df67aac83b466dadf5f74c881bf84dd9ef19bdfc (patch) | |
tree | 47501aced2d256052b8f78bc97328d5af5703add /src/home/empty_screen.asm | |
parent | e4bce9b7ee5e89f8edfd921de2379f0fa06af206 (diff) | |
parent | 8dee6b7a11e85d6d4b9f8ec9fb9d53a499fd37dc (diff) |
Merge pull request #110 from ElectroDeoxys/master
Split Home bank
Diffstat (limited to 'src/home/empty_screen.asm')
-rw-r--r-- | src/home/empty_screen.asm | 39 |
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..6eeea50 --- /dev/null +++ b/src/home/empty_screen.asm @@ -0,0 +1,39 @@ +; initialize the screen by emptying the tilemap. used during screen transitions +EmptyScreen: + 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: + 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: + 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 |