diff options
author | Andrew Martinek <andrewrmartinek@gmail.com> | 2019-09-23 12:37:41 -0400 |
---|---|---|
committer | Andrew Martinek <andrewrmartinek@gmail.com> | 2019-09-23 12:37:41 -0400 |
commit | 1b2d7cbaa7aba718b8ef1e9ae0cbe1f349d673be (patch) | |
tree | 48789680c10e3259140bdf146cc368ded8912f1a /src | |
parent | f3f374e6b7e26bc93c8428c8cb7b8c210223b2f4 (diff) |
Fix style, remove excess comments
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/bank03.asm | 4 | ||||
-rw-r--r-- | src/engine/bank20.asm | 55 | ||||
-rw-r--r-- | src/engine/home.asm | 22 | ||||
-rw-r--r-- | src/wram.asm | 1 |
4 files changed, 37 insertions, 45 deletions
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm index d7f3496..f873953 100644 --- a/src/engine/bank03.asm +++ b/src/engine/bank03.asm @@ -2889,11 +2889,11 @@ OWScript_JumpIfFlagZero1: ; d460 (3:5460) jr z, OWScript_JumpIfFlagZero1.passTryJump .fail - call SetScriptControlByteFail ; 0 out wScriptControlByte + call SetScriptControlByteFail jp IncreaseOWScriptPointerBy4 .passTryJump - call SetScriptControlBytePass ; ff wScriptControlByte + call SetScriptControlBytePass call GetOWSArgs2AfterPointer jr z, .noJumpTarget jp SetOWScriptPointer diff --git a/src/engine/bank20.asm b/src/engine/bank20.asm index 967ffb0..1502ea4 100644 --- a/src/engine/bank20.asm +++ b/src/engine/bank20.asm @@ -2,7 +2,7 @@ Func_80000: ; 80000 (20:4000) INCROM $80000, $80028 Func_80028: ; 80028 (20:4028) - call Func_801f1 ; Clears the first x800 bytes of S1:a000 + call Func_801f1 ld bc, $0000 call Func_80077 farcall $3, $49c7 @@ -13,7 +13,6 @@ Func_80028: ; 80028 (20:4028) INCROM $8003d, $80077 -; loads the background it seems. Also includes background tile permissions? Func_80077: ; 80077 (20:4077) ld a, $1 ld [wd292], a @@ -26,30 +25,30 @@ Func_80077: ; 80077 (20:4077) push hl push bc push de - call BCCoordToBGMap0Address ; de + call BCCoordToBGMap0Address ld hl, wd4c2 ld [hl], e inc hl ld [hl], d - call Func_803b9 ; load more d4c* stuff from mapdatapointers + call Func_803b9 ld a, [wd4c6] - ld [wd23d], a ; copies the bank of the data we loaded to wd23d + ld [wd23d], a ld de, wd23e ld bc, $0006 - call CopyBankedDataToDE ; copies 6 bytes to wd23e+ + call CopyBankedDataToDE ld l, e - ld h, d ; then copies that data into various other places? + ld h, d ld a, [hli] - ld [wd12f], a ; just happens to correspond to size of room + ld [wd12f], a ld a, [hli] - ld [wd130], a ; hmmm + ld [wd130], a ld a, [hli] - ld [wd23a], a ; these 3 are before this data and after room collision + ld [wd23a], a ld a, [hli] ld [wd23b], a ld a, [hli] ld [wd23c], a - call Func_800bd ; moves the background data to some place vblank knows about + call Func_800bd pop de pop bc pop hl @@ -59,17 +58,17 @@ Func_800bd: ; 800bd (20:40bd) push hl push bc push de - ld a, [wd4c4] ; these are still the copy locations + ld a, [wd4c4] add $05 ld e, a ld a, [wd4c5] adc $00 - ld d, a ; de = [wd4c4/5] + 5 - ld b, $c0 ; b = c0 + ld d, a + ld b, $c0 call Func_08bf ld a, [wd4c2] ld e, a - ld a, [wd4c3] ; bg map coord from earlier + ld a, [wd4c3] ld d, a call Func_800e0 pop de @@ -77,7 +76,6 @@ Func_800bd: ; 800bd (20:40bd) pop hl ret -; de is a bg map coord Func_800e0: ; 800e0 (20:40e0) push hl ld hl, $d28e @@ -86,7 +84,7 @@ Func_800e0: ; 800e0 (20:40e0) ld a, [wd23c] or a jr z, .asm_800f0 - sla [hl] ; if wd23c is nonzero, double d28e + sla [hl] .asm_800f0 ld c, $40 ld hl, wd23e @@ -94,16 +92,16 @@ Func_800e0: ; 800e0 (20:40e0) .asm_800f6 ld [hli], a dec c - jr nz, .asm_800f6 ; clear out wd23e-40+ + jr nz, .asm_800f6 ld a, [wd130] ld c, a .asm_800fe - push bc ; push the height of this map - push de ; push the destination of this map + push bc + push de ld b, $00 ld a, [$d28e] - ld c, a ; bc is now the width - ld de, wd23e ; wd23e is the place we copied map data to (The 6 bytes) before + ld c, a + ld de, wd23e call Func_3be4 ld a, [wd12f] ld b, a @@ -287,18 +285,17 @@ GetMapDataPointer: ; 8020f (20:420f) ld c, [hl] inc hl ld b, [hl] - pop af ; bc = [MapDataPointers+l] + pop af ld l, a ld h, $0 sla l rl h sla l rl h - add hl, bc ; hl = [MapDataPointers+l] + 4*a + add hl, bc pop bc ret -; These vars are used as a copy source for something about drawing the background? Func_80229: ; 80229 (20:4229) ld a, [hli] ld [wd4c4], a @@ -391,11 +388,11 @@ Func_802bb: ; 802bb (20:42bb) Func_803b9: ; 803b9 (20:43b9) ld l, $00 - ld a, [wd131] ; current screen/state/almost room? + ld a, [wd131] call GetMapDataPointer - call Func_80229 ; basically get pointer to background tilemap? + call Func_80229 ld a, [hl] - ld [$d239], a ; the final value in mapDataPointer goes to this mystery + ld [$d239], a ret ; 0x803c9 @@ -498,8 +495,6 @@ Unknown_80e5a: ; 80e5a (20:4e5a) INCROM $80e5a, $80e5d ; might be closer to "screen specific data" than map data -; ex: one thing is reading from something that changes multipl times in loading -; of screens, and changes in duels (4d131) MapDataPointers: ; 80e5d (20:4e5d) dw MapDataPointers_80e67 dw MapDataPointers_8100f diff --git a/src/engine/home.asm b/src/engine/home.asm index 62eaa62..8545b3d 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -1537,39 +1537,37 @@ UpdateRNGSources: ; 089b (0:089b) pop hl ret -; ld d, a ; de = wd4c4/5 + 5 -; ld b, $c0 ; b = c0 Func_08bf: ; 08bf (0:08bf) ld hl, wcad6 ld [hl], e inc hl - ld [hl], d ; load wcad6/7 with [wd4c4]+5 + ld [hl], d ld hl, wcad8 ld [hl], $1 - inc hl ; wcad8 is 1, a bunch of things after it are 0 + inc hl xor a ld [hli], a ld [hli], a ld [hli], a ld [hli], a - ld [hl], b ; then wcad i think is set to c0 + ld [hl], b inc hl ld [hli], a ; 0 - ld [hl], $ef ; and ef + ld [hl], $ef ld h, b - ld l, $0 ; hl is now c000, first byte of wram, first card collection or no name + ld l, $0 xor a .asm_8d9 - ld [hl], a ; 0 out ff bytes - inc l ; inc the first ff bytes of wram (was an arg so could be other stuff) + ld [hl], a + inc l jr nz, .asm_8d9 ret Func_08de: ; 08de (0:08de) - push hl ; wd23e + 40 i think? - push de ; 6 mdp bytes + push hl + push de .asm_8e0 - push bc ; as of first run, bc is the width + push bc call Func_08ef ld [de], a inc de diff --git a/src/wram.asm b/src/wram.asm index a689451..4d71b86 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -1898,7 +1898,6 @@ wd12f:: ; d12f wd130:: ; d130 ds $1 -; current screen, at least for some purpose -- changed multiple times on loads and changes when screen changes in battle? wd131:: ; d131 ds $1 |