diff options
-rwxr-xr-x | engine/bank7.asm | 8 | ||||
-rwxr-xr-x | engine/home.asm | 3 | ||||
-rwxr-xr-x | engine/overworldmap.asm | 5 | ||||
-rwxr-xr-x | main.asm | 1 | ||||
-rwxr-xr-x | wram.asm | 11 |
5 files changed, 24 insertions, 4 deletions
diff --git a/engine/bank7.asm b/engine/bank7.asm index 2885df8..e25220d 100755 --- a/engine/bank7.asm +++ b/engine/bank7.asm @@ -4,7 +4,7 @@ Func_1c056: ; 1c056 (7:4056) push hl push bc push de - ld a, [$d32f] + ld a, [wCurMap] add a ld c, a ld b, $0 @@ -14,9 +14,9 @@ Func_1c056: ; 1c056 (7:4056) ld h, [hl] ld l, a ld bc, $0005 - ld a, [$d330] + ld a, [wPlayerXCoord] ld d, a - ld a, [$d331] + ld a, [wPlayerYCoord] ld e, a .asm_1c072 ld a, [hli] @@ -303,7 +303,7 @@ Func_1c33b: ; 1c33b (7:433b) push hl push bc push de - ld a, [$d32f] + ld a, [wCurMap] add a ld c, a add a diff --git a/engine/home.asm b/engine/home.asm index f90dd3b..1bdad46 100755 --- a/engine/home.asm +++ b/engine/home.asm @@ -716,6 +716,8 @@ Func_0863: ; 0863 (0:0863) INCBIN "baserom.gbc",$0879,$09ae - $0879 +; this function affects the stack so that it returns to the pointer following the rst call +; similar to rst 28, except this always loads bank 1 RST18: ; 09ae (0:09ae) push hl push hl @@ -760,6 +762,7 @@ Func_09ce: ; 09ce (0:09ce) INCBIN "baserom.gbc",$09dc,$09e9 - $09dc +; this function affects the stack so that it returns to the three byte pointer following the rst call RST28: ; 09e9 (0:09e9) push hl push hl diff --git a/engine/overworldmap.asm b/engine/overworldmap.asm index 31f762c..1ed17ff 100755 --- a/engine/overworldmap.asm +++ b/engine/overworldmap.asm @@ -151,6 +151,11 @@ LoadOverworldMapSelection: ; 10f61 (4:4f61) pop hl ret +; each entry in the overworld map is four bytes +; 1: map id +; 2: player's x coordinate when entering the map +; 2: player's y coordinate when entering the map +; 4: 00 OverworldMapIndexes: ; 10f88 (4:4f88) db $00,$00,$00,$00 db MASON_LABORATORY, $0E,$1A,$00 @@ -1,5 +1,6 @@ INCLUDE "constants.asm" INCLUDE "macros.asm" +INCLUDE "wram.asm" INCLUDE "engine/home.asm" diff --git a/wram.asm b/wram.asm new file mode 100755 index 0000000..dea3b91 --- /dev/null +++ b/wram.asm @@ -0,0 +1,11 @@ +SECTION "WRAM1", WRAMX, BANK[1] + ds $32f + +wCurMap: ; d32f + ds 1 + +wPlayerXCoord: ; d330 + ds 1 + +wPlayerYCoord: ; d331 + ds 1
\ No newline at end of file |