Document macros/map.asm

Rename MORN/DAY/NITE to MORN_F/DAY_F/NITE_F; use MORN/DAY/NITE for shifted values (cleaner for person_events)
Prefix FLOOR to the `elevfloor` constants
This commit is contained in:
Remy Oukaour
2017-12-11 01:02:28 -05:00
parent c6fefd0fe8
commit 41acb0667a
22 changed files with 219 additions and 179 deletions

View File

@@ -1948,7 +1948,7 @@ LoadMapPals:
call AddNTimes
ld de, UnknOBPals
ld bc, 8 palettes
ld a, $5 ; BANK(UnknOBPals)
ld a, BANK(UnknOBPals)
call FarCopyWRAM
ld a, [wPermission]
@@ -1967,13 +1967,13 @@ LoadMapPals:
add hl, de
ld a, [TimeOfDayPal]
and 3
cp NITE
cp NITE_F
jr c, .morn_day
rept 4
inc hl
endr
.morn_day
ld de, UnknBGPals + 6 palettes + 2
ld de, UnknBGPals palette PAL_BG_ROOF + 2
ld bc, 4
ld a, $5
call FarCopyWRAM
@@ -1983,10 +1983,10 @@ endr
dw .OutdoorColors ; unused
dw .OutdoorColors ; TOWN
dw .OutdoorColors ; ROUTE
dw .IndoorColors ; INDOOR
dw .IndoorColors ; INDOOR
dw .DungeonColors ; CAVE
dw .Perm5Colors ; PERM_5
dw .IndoorColors ; GATE
dw .Perm5Colors ; PERM_5
dw .IndoorColors ; GATE
dw .DungeonColors ; DUNGEON
; Valid indices: $00 - $29

View File

@@ -133,13 +133,13 @@ EvolveAfterBattle_MasterLoop
; TR_NITE
ld a, [TimeOfDay]
cp NITE
cp NITE_F
jp nz, .dont_evolve_3
jr .proceed
.happiness_daylight
ld a, [TimeOfDay]
cp NITE
cp NITE_F
jp z, .dont_evolve_3
jr .proceed

View File

@@ -81,7 +81,7 @@ endr
ld a, [TimeOfDay]
and 3
cp NITE
cp NITE_F
jr c, .time_species
inc hl
inc hl

View File

@@ -165,7 +165,7 @@ CheckPhoneContactTimeOfDay: ; 900ad (24:40ad)
callba CheckTime
pop af
and (1 << MORN) + (1 << DAY) + (1 << NITE)
and MORN + DAY + NITE
and c
pop de

View File

@@ -51,11 +51,11 @@ GetTimeOfDay:: ; 14032
TimesOfDay: ; 14044
; hours for the time of day
; 04-09 morn | 10-17 day | 18-03 nite
db 04, NITE
db 10, MORN
db 18, DAY
db 24, NITE
db -1, MORN
db 04, NITE_F
db 10, MORN_F
db 18, DAY_F
db 24, NITE_F
db -1, MORN_F
; 1404e
Unknown_1404e: ; Unreferenced

View File

@@ -362,18 +362,18 @@ OakText_ResponseToSetTime: ; 0x908b8
ld c, l
ld a, [wInitHourBuffer]
cp 4
jr c, .NITE
jr c, .nite
cp 11
jr c, .MORN
jr c, .morn
cp 18
jr c, .DAY
.NITE:
jr c, .day
.nite:
ld hl, .sodark
ret
.MORN:
.morn:
ld hl, .overslept
ret
.DAY:
.day:
ld hl, .yikes
ret
; 908ec (24:48ec)
@@ -738,19 +738,19 @@ GetTimeOfDayString: ; 90b58 (24:4b58)
cp 18
jr c, .day
.nite
ld de, .NITE
ld de, .nite_string
ret
.morn
ld de, .MORN
ld de, .morn_string
ret
.day
ld de, .DAY
ld de, .day_string
ret
; 90b71 (24:4b71)
.NITE: db "NITE@"
.MORN: db "MORN@"
.DAY: db "DAY@"
.nite_string: db "NITE@"
.morn_string: db "MORN@"
.day_string: db "DAY@"
; 90b7f
AdjustHourForAMorPM: