Comment and label the save file.

This commit is contained in:
yenatch 2015-08-19 21:14:15 -07:00
parent 9c84a3dd22
commit 860296f468
7 changed files with 581 additions and 436 deletions

View File

@ -33,6 +33,11 @@ HP_RED EQU 2
MONS_PER_BOX EQU 20 MONS_PER_BOX EQU 20
NUM_BOXES EQU 14 NUM_BOXES EQU 14
; hall of fame
HOF_MON_LENGTH = 1 + 2 + 2 + 1 + (PKMN_NAME_LENGTH +- 1) ; species, id, dvs, level, nick
HOF_LENGTH = 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; win count, party, terminator
NUM_HOF_TEAMS = 30
; flag manipulation ; flag manipulation
RESET_FLAG EQU 0 RESET_FLAG EQU 0

File diff suppressed because it is too large Load Diff

144
main.asm
View File

@ -209,7 +209,7 @@ _ResetWRAM: ; 5bae
call SetDefaultBoxNames call SetDefaultBoxNames
ld a, 1 ld a, BANK(sBoxCount)
call GetSRAMBank call GetSRAMBank
ld hl, sBoxCount ld hl, sBoxCount
call InitList call InitList
@ -239,9 +239,9 @@ _ResetWRAM: ; 5bae
ld [wRoamMon2MapNumber], a ld [wRoamMon2MapNumber], a
ld [wRoamMon3MapNumber], a ld [wRoamMon3MapNumber], a
ld a, 0 ld a, BANK(s0_abe2)
call GetSRAMBank call GetSRAMBank
ld hl, $abe2 ld hl, s0_abe2
xor a xor a
ld [hli], a ld [hli], a
dec a dec a
@ -28832,7 +28832,7 @@ Function28177: ; 28177
ld [wc2d7], a ld [wc2d7], a
pop af pop af
ld [Options], a ld [Options], a
callba Function1500c callba LoadPokemonData
jp Function28b22 jp Function28b22
.asm_283a9 .asm_283a9
@ -34330,12 +34330,12 @@ Function2c642: ; 2c642 (b:4642)
call Function2c6ac call Function2c6ac
ld [de], a ld [de], a
inc de inc de
ld a, $0 ld a, BANK(s0_abe4)
call GetSRAMBank call GetSRAMBank
ld a, [$abe4] ld a, [s0_abe4]
ld [de], a ld [de], a
inc de inc de
ld a, [$abe5] ld a, [s0_abe4 + 1]
ld [de], a ld [de], a
ld a, $14 ld a, $14
ld [wca00], a ld [wca00], a
@ -35637,9 +35637,9 @@ endr
jp Function3991b jp Function3991b
.cal2 .cal2
ld a, $0 ld a, BANK(sMysteryGiftTrainer)
call GetSRAMBank call GetSRAMBank
ld de, $ac0a ld de, sMysteryGiftTrainer
call TrainerType2 call TrainerType2
call CloseSRAM call CloseSRAM
jr .done jr .done
@ -37488,48 +37488,49 @@ GivePokeItem:: ; 446cc
jp CloseSRAM jp CloseSRAM
; 44725 ; 44725
Function44725: ; 44725 Function44725: ; 44725
ld a, $0 ld a, BANK(s0_a600)
call GetSRAMBank call GetSRAMBank
ld hl, $a600 ld hl, s0_a600
ld de, $a71a ld de, s0_a71a
ld bc, $011a ld bc, $11a
call CopyBytes call CopyBytes
ld hl, $a834 ld hl, s0_a834
ld de, $aa0b ld de, s0_aa0b
ld bc, $01d7 ld bc, $1d7
call CopyBytes call CopyBytes
jp CloseSRAM jp CloseSRAM
; 44745 ; 44745
Function44745: ; 44745 (11:4745) Function44745: ; 44745 (11:4745)
ld a, $0 ld a, BANK(s0_a600)
call GetSRAMBank call GetSRAMBank
ld hl, $a71a ld hl, s0_a71a
ld de, $a600 ld de, s0_a600
ld bc, $11a ld bc, $11a
call CopyBytes call CopyBytes
ld hl, $aa0b ld hl, s0_aa0b
ld de, $a834 ld de, s0_a834
ld bc, $1d7 ld bc, $1d7
call CopyBytes call CopyBytes
jp CloseSRAM jp CloseSRAM
Function44765: ; 44765 (11:4765) Function44765: ; 44765 (11:4765)
ld a, $0 ld a, BANK(s0_a600)
call GetSRAMBank call GetSRAMBank
xor a xor a
ld hl, $a600 ld hl, s0_a600
ld bc, $11a ld bc, $11a
call ByteFill call ByteFill
xor a xor a
ld hl, $a834 ld hl, s0_a834
ld bc, $1d7 ld bc, $1d7
call ByteFill call ByteFill
jp CloseSRAM jp CloseSRAM
; 44781 (11:4781) ; 44781 (11:4781)
Function44781: ; 44781 Function44781: ; 44781
ld a, [PartyCount] ld a, [PartyCount]
and a and a
@ -54451,15 +54452,17 @@ HallOfFame:: ; 0x8640e
set 6, [hl] ; hall of fame set 6, [hl] ; hall of fame
callba Function14da0 callba Function14da0
ld hl, wd95e ld hl, wd95e
ld a, [hl] ld a, [hl]
cp 200 cp 200
jr nc, .ok ; 0x86433 $1 jr nc, .ok
inc [hl] inc [hl]
.ok .ok
callba Function14b85 callba SaveGameData
call Function8653f call GetHallOfFameParty
callba Function14b5f callba AddHallOfFameEntry
xor a xor a
ld [wc2cd], a ld [wc2cd], a
call Function864c3 call Function864c3
@ -54565,7 +54568,7 @@ Function8650c: ; 8650c
decoord 6, 5 decoord 6, 5
ld c, $6 ld c, $6
predef Functiond066e predef Functiond066e
ld c, $3c ld c, 60
call DelayFrames call DelayFrames
and a and a
ret ret
@ -54576,9 +54579,9 @@ String_8652c:
; 8653f ; 8653f
Function8653f: ; 8653f GetHallOfFameParty: ; 8653f
ld hl, OverworldMap ld hl, OverworldMap
ld bc, $0062 ld bc, HOF_LENGTH
xor a xor a
call ByteFill call ByteFill
ld a, [wd95e] ld a, [wd95e]
@ -54587,31 +54590,34 @@ Function8653f: ; 8653f
inc de inc de
ld hl, PartySpecies ld hl, PartySpecies
ld c, 0 ld c, 0
.asm_86556 .next
ld a, [hli] ld a, [hli]
cp $ff cp $ff
jr z, .asm_865b1 jr z, .done
cp EGG cp EGG
jr nz, .asm_86562 jr nz, .mon
inc c inc c
jr .asm_86556 jr .next
.asm_86562 .mon
push hl push hl
push de push de
push bc push bc
ld a, c ld a, c
ld hl, PartyMon1Species ld hl, PartyMons
ld bc, PartyMon2 - PartyMon1 ld bc, PartyMon2 - PartyMon1
call AddNTimes call AddNTimes
ld c, l ld c, l
ld b, h ld b, h
ld hl, $0000
ld hl, PartyMon1Species - PartyMon1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [de], a ld [de], a
inc de inc de
ld hl, $0006
ld hl, PartyMon1ID - PartyMon1
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@ -54619,7 +54625,8 @@ Function8653f: ; 8653f
ld a, [hl] ld a, [hl]
ld [de], a ld [de], a
inc de inc de
ld hl, $0015
ld hl, PartyMon1DVs - PartyMon1
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
@ -54627,30 +54634,33 @@ Function8653f: ; 8653f
ld a, [hl] ld a, [hl]
ld [de], a ld [de], a
inc de inc de
ld hl, $001f
ld hl, PartyMon1Level - PartyMon1
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [de], a ld [de], a
inc de inc de
pop bc pop bc
push bc push bc
ld a, c ld a, c
ld hl, PartyMonNicknames ld hl, PartyMonNicknames
ld bc, $000b ld bc, PKMN_NAME_LENGTH
call AddNTimes call AddNTimes
ld bc, $000a ld bc, PKMN_NAME_LENGTH - 1
call CopyBytes call CopyBytes
pop bc pop bc
inc c inc c
pop de pop de
ld hl, $0010 ld hl, HOF_MON_LENGTH
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h
pop hl pop hl
jr .asm_86556 jr .next
.asm_865b1 .done
ld a, $ff ld a, $ff
ld [de], a ld [de], a
ret ret
@ -82434,7 +82444,7 @@ Functione3267: ; e3267
call Functione3316 call Functione3316
ld a, $1 ld a, $1
ld [wc2cd], a ld [wc2cd], a
callba Function14b85 callba SaveGameData
xor a xor a
ld [wc2cd], a ld [wc2cd], a
call Functione32fa call Functione32fa
@ -89618,7 +89628,7 @@ UnknownText_0x104a20: ; 104a20
Function104a25: ; 104a25 (41:4a25) Function104a25: ; 104a25 (41:4a25)
call Function105106 call Function105106
ld a, [$abe5] ld a, [s0_abe5]
cp $5 cp $5
jp CloseSRAM jp CloseSRAM
@ -89628,9 +89638,9 @@ Function104a30: ; 104a30 (41:4a30)
ld b, a ld b, a
ld a, [wc902] ld a, [wc902]
ld c, a ld c, a
ld a, [$abe5] ld a, [s0_abe5]
ld d, a ld d, a
ld hl, $abe6 ld hl, s0_abe6
.asm_104a42 .asm_104a42
ld a, d ld a, d
and a and a
@ -89652,10 +89662,10 @@ Function104a30: ; 104a30 (41:4a30)
Function104a56: ; 104a56 (41:4a56) Function104a56: ; 104a56 (41:4a56)
call Function105106 call Function105106
ld hl, $abe5 ld hl, s0_abe5
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
ld hl, $abe6 ld hl, s0_abe6
ld e, a ld e, a
ld d, $0 ld d, $0
rept 2 rept 2
@ -89670,9 +89680,9 @@ endr
Function104a71: ; 104a71 (41:4a71) Function104a71: ; 104a71 (41:4a71)
call Function105106 call Function105106
ld a, $1 ld a, $1
ld [$abfd], a ld [s0_abfd], a
ld hl, wc903 ld hl, wc903
ld de, $abfe ld de, s0_abfe
ld bc, $b ld bc, $b
call CopyBytes call CopyBytes
ld a, $1 ld a, $1
@ -90538,7 +90548,7 @@ Function105069: ; 105069 (41:5069)
call Function105106 call Function105106
ld d, $0 ld d, $0
ld b, $2 ld b, $2
ld hl, $abf0 ld hl, s0_abf0
predef_id FlagPredef predef_id FlagPredef
push hl push hl
push bc push bc
@ -90563,7 +90573,7 @@ Function105091: ; 105091 (41:5091)
push bc push bc
ld d, $0 ld d, $0
ld b, $2 ld b, $2
ld hl, $abf0 ld hl, s0_abf0
predef FlagPredef predef FlagPredef
ld a, c ld a, c
and a and a
@ -90575,31 +90585,29 @@ Function105091: ; 105091 (41:5091)
.asm_1050b0 .asm_1050b0
inc c inc c
ld a, c ld a, c
cp $2b cp $2a + 1
jr c, .asm_105096 jr c, .asm_105096
jp CloseSRAM jp CloseSRAM
Special_UnlockMysteryGift: ; 1050b9 Special_UnlockMysteryGift: ; 1050b9
call Function105106 call Function105106
ld hl, $abe3 ld hl, s0_abe3
ld a, [hl] ld a, [hl]
inc a inc a
jr nz, .ok jr nz, .ok
ld [hld], a ld [hld], a
ld [hl], a ld [hl], a
.ok .ok
jp CloseSRAM jp CloseSRAM
; 1050c8 ; 1050c8
Function1050c8: ; 1050c8 Function1050c8: ; 1050c8
call Function105106 call Function105106
ld a, [$abe5] ld a, [s0_abe5]
cp $ff cp $ff
jr z, .asm_1050d6 jr z, .asm_1050d6
xor a xor a
ld [$abe5], a ld [s0_abe5], a
.asm_1050d6 .asm_1050d6
jp CloseSRAM jp CloseSRAM
; 1050d9 ; 1050d9
@ -90607,8 +90615,8 @@ Function1050c8: ; 1050c8
Function1050d9: ; 1050d9 Function1050d9: ; 1050d9
call Function105106 call Function105106
ld hl, $abe2 ld hl, s0_abe2
ld de, $abe4 ld de, s0_abe4
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
@ -90620,8 +90628,8 @@ Function1050d9: ; 1050d9
Function1050ea: ; 1050ea (41:50ea) Function1050ea: ; 1050ea (41:50ea)
call Function105106 call Function105106
ld hl, $abe4 ld hl, s0_abe4
ld de, $abe2 ld de, s0_abe2
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
@ -90641,7 +90649,7 @@ Function1050fb: ; 1050fb (41:50fb)
Function105106: ; 105106 Function105106: ; 105106
ld a, $0 ld a, BANK(s0_abe4)
jp GetSRAMBank jp GetSRAMBank
; 10510b ; 10510b

View File

@ -401,7 +401,7 @@ Function1002c9: ; 1002c9
bit 0, [hl] bit 0, [hl]
ret z ret z
callba Function3f6d0 callba Function3f6d0
callba Function1500c callba LoadPokemonData
ret ret
; 1002dc ; 1002dc
@ -4036,7 +4036,7 @@ Function101a4f: ; 101a4f
xor a xor a
ld [wc2d7], a ld [wc2d7], a
callba Function3f6d0 callba Function3f6d0
callba Function1500c callba LoadPokemonData
call Function1013c0 call Function1013c0
ld a, [wcd25] ld a, [wcd25]
inc a inc a

View File

@ -16886,7 +16886,7 @@ Function11c1ca: ; 11c1ca
call EnableLCD call EnableLCD
callba Function104061 callba Function104061
callba Function8cf53 callba Function8cf53
callba Function1500c callba LoadPokemonData
callba Function40c30 callba Function40c30
ld a, [rSVBK] ld a, [rSVBK]
push af push af
@ -22846,7 +22846,7 @@ Function17024d: ; 17024d
call Function1702b7 call Function1702b7
call Function170bf7 call Function170bf7
predef StartBattle predef StartBattle
callba Function1500c callba LoadPokemonData
callba HealParty callba HealParty
ld a, [wd0ee] ld a, [wd0ee]
ld [ScriptVar], a ld [ScriptVar], a
@ -23591,7 +23591,7 @@ Function170729: ; 170729 (5c:4729)
ret ret
Function170737: ; 170737 (5c:4737) Function170737: ; 170737 (5c:4737)
callba SaveOptionsSelection callba SaveOptions
ret ret
Function17073e: ; 17073e (5c:473e) Function17073e: ; 17073e (5c:473e)

View File

@ -3060,7 +3060,7 @@ Function17e367: ; 17e367
push af push af
ld a, $1 ld a, $1
ld [rSVBK], a ld [rSVBK], a
callba Function14c10 callba SaveGameData_
pop af pop af
ld [rSVBK], a ld [rSVBK], a
ret ret
@ -3086,7 +3086,7 @@ Function17e395: ; 17e395
push af push af
ld a, $1 ld a, $1
ld [rSVBK], a ld [rSVBK], a
callba Function14e0c callba SaveBox
pop af pop af
ld [rSVBK], a ld [rSVBK], a
ret ret

149
wram.asm
View File

@ -69,6 +69,19 @@ battle_struct: MACRO
\1Type2:: db \1Type2:: db
ENDM ENDM
box: MACRO
\1::
\1Count:: ds 1
\1Species:: ds MONS_PER_BOX + 1
\1Mons::
\1Mon1:: box_struct \1Mon1
\1Mon2:: ds box_struct_length * (MONS_PER_BOX +- 1)
\1MonOT:: ds NAME_LENGTH * MONS_PER_BOX
\1MonNicknames:: ds PKMN_NAME_LENGTH * MONS_PER_BOX
\1MonNicknamesEnd::
\1End:: ds 2 ; padding
ENDM
channel_struct: MACRO channel_struct: MACRO
; Addreses are Channel1 (c101). ; Addreses are Channel1 (c101).
@ -428,6 +441,7 @@ TileMapEnd::
SECTION "Battle", WRAM0 SECTION "Battle", WRAM0
wMisc::
wBattle:: wBattle::
wc608:: wc608::
@ -864,6 +878,9 @@ IF DEF(CRYSTAL11)
wPokedexStatus:: wPokedexStatus::
ENDC ENDC
ds 3 ds 3
wMiscEnd::
wc7e8:: ds 24 wc7e8:: ds 24
@ -1295,6 +1312,7 @@ Options2:: ; cfd1
ds 2 ds 2
OptionsEnd:: OptionsEnd::
wcfd4:: ds 1 wcfd4:: ds 1
wcfd5:: ds 1 wcfd5:: ds 1
wcfd6:: ds 1 wcfd6:: ds 1
@ -1885,6 +1903,7 @@ wd466:: ds 6
wd46c:: ds 1 wd46c:: ds 1
wd46d:: ds 5 wd46d:: ds 5
wCrystalData::
PlayerGender:: ; d472 PlayerGender:: ; d472
; bit 0: ; bit 0:
; 0 male ; 0 male
@ -1896,8 +1915,12 @@ wd475:: ds 1
wd476:: ds 1 wd476:: ds 1
wd477:: ds 1 wd477:: ds 1
wd478:: ds 1 wd478:: ds 1
wCrystalDataEnd::
wd479:: ds 2 wd479:: ds 2
wPlayerData::
PlayerID:: ; d47b PlayerID:: ; d47b
ds 2 ds 2
@ -2124,7 +2147,7 @@ FarfetchdPosition:: ; d964
ds 13 ds 13
SECTION "Map Triggers", WRAMX, BANK [1] ;SECTION "Map Triggers", WRAMX, BANK [1]
wPokecenter2FTrigger:: ds 1 ; d972 wPokecenter2FTrigger:: ds 1 ; d972
wTradeCenterTrigger:: ds 1 ; d973 wTradeCenterTrigger:: ds 1 ; d973
@ -2209,7 +2232,7 @@ wMobileBattleRoomTrigger:: ds 1 ; d9c0
ds 49 ds 49
SECTION "Events", WRAMX, BANK [1] ;SECTION "Events", WRAMX, BANK [1]
wJackFightCount:: ds 1 wJackFightCount:: ds 1
ds 1 ds 1
@ -2374,6 +2397,11 @@ wdca0:: ds 1
wdca1:: ds 3 wdca1:: ds 3
wdca4:: ds 1 wdca4:: ds 1
wPlayerDataEnd::
wMapData::
VisitedSpawns:: ; dca5 VisitedSpawns:: ; dca5
flag_array 27 flag_array 27
@ -2409,9 +2437,13 @@ XCoord:: ; dcb8
wdcbf:: ds 1 wdcbf:: ds 1
ds 23 ds 23
wMapDataEnd::
SECTION "Party", WRAMX, BANK [1] SECTION "Party", WRAMX, BANK [1]
wPokemonData::
PartyCount:: ; dcd7 PartyCount:: ; dcd7
ds 1 ; number of Pokémon in party ds 1 ; number of Pokémon in party
PartySpecies:: ; dcd8 PartySpecies:: ; dcd8
@ -2436,8 +2468,6 @@ PartyMonNicknamesEnd::
ds 22 ds 22
SECTION "Pokedex", WRAMX, BANK [1]
PokedexCaught:: ; de99 PokedexCaught:: ; de99
flag_array NUM_POKEMON flag_array NUM_POKEMON
EndPokedexCaught:: EndPokedexCaught::
@ -2454,8 +2484,6 @@ UnlockedUnowns:: ; def3
wdef4:: ds 1 wdef4:: ds 1
SECTION "Daycare", WRAMX, BANK [1]
wDaycareMan:: ; def5 wDaycareMan:: ; def5
; bit 7: active ; bit 7: active
; bit 6: monsters are compatible ; bit 6: monsters are compatible
@ -2492,8 +2520,6 @@ wEggMon:: box_struct wEggMon ; df7b
wdf9b:: ds 1 wdf9b:: ds 1
SECTION "Misc Pokemon", WRAMX, BANK [1]
wdf9c:: wdf9c::
wContestMon:: party_struct wContestMon ; df9c wContestMon:: party_struct wContestMon ; df9c
@ -2528,6 +2554,8 @@ wdfec:: ds 1
ds 5 ds 5
wdff5:: wdff5::
wPokemonDataEnd::
SECTION "Pic Animations", WRAMX, BANK [2] SECTION "Pic Animations", WRAMX, BANK [2]
@ -2647,21 +2675,104 @@ w6_d600:: ds $600
SECTION "Scratch", SRAM, BANK [0] SECTION "Scratch", SRAM, BANK [0]
SECTION "SRAM Bank 0", SRAM [$a600], BANK [0]
s0_a600:: ds $11a
s0_a71a:: ds $11a
s0_a834:: ds $1d7
s0_aa0b:: ds $1d7
s0_abe2:: ds 1
s0_abe3:: ds 1
s0_abe4:: ds 1
s0_abe5:: ds 1
s0_abe6:: ds 10
s0_abf0:: ds $d
s0_abfd:: ds 1
s0_abfe:: ds 12
sMysteryGiftTrainer:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 1
ds 1
s0_abe4End::
ds $b200 - $ac30
sBackupOptions:: ds OptionsEnd - Options
s0_b208:: ds 1
sBackupGameData::
sBackupPlayerData:: ds wPlayerDataEnd - wPlayerData
sBackupMapData:: ds wMapDataEnd - wMapData
sBackupPokemonData:: ds wPokemonDataEnd - wPokemonData
sBackupGameDataEnd::
; bd83
ds $18a
; bf0d
sBackupChecksum:: ds 2
s0_bf0f:: ds 1
sStackTop:: ds 2
SECTION "SRAM Bank 1", SRAM, BANK [1] SECTION "SRAM Bank 1", SRAM, BANK [1]
SECTION "BoxMons", SRAM [$ad10], BANK [1] sOptions:: ds OptionsEnd - Options
sBoxCount:: ds 1 ; ad10 s1_a008:: ds 1
sBoxSpecies:: ds MONS_PER_BOX ; ad11
sGameData::
sPlayerData:: ds wPlayerDataEnd - wPlayerData
sMapData:: ds wMapDataEnd - wMapData
sPokemonData:: ds wPokemonDataEnd - wPokemonData
sGameDataEnd::
; ab83
ds $18a
; ad0d
sChecksum:: ds 2
s1_ad0f:: ds 1
; ad10
box sBox
; b160
ds $100
sLinkBattleStats:: ; b260
sLinkBattleWins:: ds 2
sLinkBattleLosses:: ds 2
sLinkBattleDraws:: ds 2
ds $5a
sLinkBattleStatsEnd::
sHallOfFame:: ; b2c0
ds HOF_LENGTH * NUM_HOF_TEAMS
sHallOfFameEnd::
; be3c
ds 1 ds 1
sCrystalData::
ds wCrystalDataEnd - wCrystalData
ds 1
s1_be45:: ds 1
sBoxMons:: ; ad26
sBoxMon1:: box_struct sBoxMon1
sBoxMon2::
ds box_struct_length * (MONS_PER_BOX +- 1)
sBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; afa6 SECTION "Boxes 1-7", SRAM, BANK [2]
box sBox1
box sBox2
box sBox3
box sBox4
box sBox5
box sBox6
box sBox7
sBoxMonNicknames:: ds PKMN_NAME_LENGTH * MONS_PER_BOX ; b082 SECTION "Boxes 8-14", SRAM, BANK [3]
sBoxMonNicknamesEnd:: box sBox8
; b15e box sBox9
box sBox10
box sBox11
box sBox12
box sBox13
box sBox14