diff options
Diffstat (limited to 'main.asm')
-rwxr-xr-x | main.asm | 62 |
1 files changed, 31 insertions, 31 deletions
@@ -1642,39 +1642,39 @@ DisplayTwoOptionMenu: ; 7559 (1:7559) ; The bottom and right edges of the menu may remain after the function returns. TwoOptionMenu_SaveScreenTiles: ; 763e (1:763e) - ld de, wHPBarMaxHP - ld bc, $506 -.asm_7644 + ld de, wBuffer + lb bc, 5, 6 +.loop ld a, [hli] ld [de], a inc de dec c - jr nz, .asm_7644 + jr nz, .loop push bc - ld bc, 14 + ld bc, SCREEN_WIDTH - 6 add hl, bc pop bc ld c, $6 dec b - jr nz, .asm_7644 + jr nz, .loop ret TwoOptionMenu_RestoreScreenTiles: ; 7656 (1:7656) - ld de, wHPBarMaxHP - ld bc, $506 -.asm_765c + ld de, wBuffer + lb bc, 5, 6 +.loop ld a, [de] inc de ld [hli], a dec c - jr nz, .asm_765c + jr nz, .loop push bc - ld bc, $e + ld bc, SCREEN_WIDTH - 6 add hl, bc pop bc - ld c, $6 + ld c, 6 dec b - jr nz, .asm_765c + jr nz, .loop call UpdateSprites ret @@ -3167,9 +3167,9 @@ RedrawMapView: ; eedc (3:6edc) and $3 or $98 ld a, l - ld [wHPBarMaxHP], a + ld [wBuffer], a ld a, h - ld [wHPBarMaxHP + 1], a + ld [wBuffer + 1], a ; this copy of the address is not used ld a, 2 ld [$ffbe], a ld c, 9 ; number of rows of 2x2 tiles (this covers the whole screen) @@ -3177,25 +3177,25 @@ RedrawMapView: ; eedc (3:6edc) push bc push hl push hl - ld hl, wTileMap - 2 * 20 - ld de, 20 + ld hl, wTileMap - 2 * SCREEN_WIDTH + ld de, SCREEN_WIDTH ld a, [$ffbe] -.asm_ef1a +.calcWRAMAddrLoop add hl, de dec a - jr nz, .asm_ef1a + jr nz, .calcWRAMAddrLoop call CopyToScreenEdgeTiles pop hl ld de, $20 ld a, [$ffbe] ld c, a -.asm_ef28 +.calcVRAMAddrLoop add hl, de ld a, h and $3 or $98 dec c - jr nz, .asm_ef28 + jr nz, .calcVRAMAddrLoop ld [H_SCREENEDGEREDRAWADDR + 1], a ld a, l ld [H_SCREENEDGEREDRAWADDR], a @@ -3301,7 +3301,7 @@ InitializeMissableObjectsFlags: ; f175 (3:7175) call FillMemory ; clear missable objects flags ld hl, MapHS00 xor a - ld [wd048], a + ld [wMissableObjectCounter], a .missableObjectsLoop ld a, [hli] cp $ff ; end of list @@ -3310,14 +3310,14 @@ InitializeMissableObjectsFlags: ; f175 (3:7175) inc hl ld a, [hl] cp Hide - jr nz, .asm_f19d + jr nz, .skip ld hl, W_MISSABLEOBJECTFLAGS - ld a, [wd048] + ld a, [wMissableObjectCounter] ld c, a ld b, FLAG_SET - call MissableObjectFlagAction ; set flag iff Item is hidden -.asm_f19d - ld hl, wd048 + call MissableObjectFlagAction ; set flag if Item is hidden +.skip + ld hl, wMissableObjectCounter inc [hl] pop hl inc hl @@ -3351,21 +3351,21 @@ IsObjectHidden: ; f1a6 (3:71a6) ret ; adds missable object (items, leg. pokemon, etc.) to the map -; [wcc4d]: index of the missable object to be added (global index) +; [wMissableObjectIndex]: index of the missable object to be added (global index) ShowObject: ; f1c8 (3:71c8) ShowObject2: ld hl, W_MISSABLEOBJECTFLAGS - ld a, [wcc4d] + ld a, [wMissableObjectIndex] ld c, a ld b, FLAG_RESET call MissableObjectFlagAction ; reset "removed" flag jp UpdateSprites ; removes missable object (items, leg. pokemon, etc.) from the map -; [wcc4d]: index of the missable object to be removed (global index) +; [wMissableObjectIndex]: index of the missable object to be removed (global index) HideObject: ; f1d7 (3:71d7) ld hl, W_MISSABLEOBJECTFLAGS - ld a, [wcc4d] + ld a, [wMissableObjectIndex] ld c, a ld b, FLAG_SET call MissableObjectFlagAction ; set "removed" flag |