Prepare to merge

This commit is contained in:
PikalaxALT 2015-11-01 18:13:31 -05:00
parent 31c407bb3d
commit 010b450834
15 changed files with 153 additions and 130 deletions

View File

@ -6,6 +6,9 @@ MAX_BALLS EQU 12
MAX_KEY_ITEMS EQU 25 MAX_KEY_ITEMS EQU 25
MAX_PC_ITEMS EQU 50 MAX_PC_ITEMS EQU 50
LO_NYBBLE EQU $0f
HI_NYBBLE EQU $f0
; strings ; strings
PLAYER_NAME_LENGTH EQU 8 PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11 PKMN_NAME_LENGTH EQU 11

View File

@ -43,43 +43,49 @@ GiveOddEgg: ; 1fb4b6
ld a, OddEgg2 - OddEgg1 ld a, OddEgg2 - OddEgg1
call AddNTimes call AddNTimes
ld de, wEnemyMoveStruct ld de, OddEggSpecies
ld bc, $0046 ld bc, party_struct_length + 2 * PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
ld a, EGG_TICKET ld a, EGG_TICKET
ld [CurItem], a ld [CurItem], a
ld a, $1 ld a, 1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld a, $ff ld a, -1
ld [wd107], a ld [ItemCountBuffer], a
ld hl, NumItems ld hl, NumItems
call TossItem call TossItem
; load species in wcd2a
ld a, EGG ld a, EGG
ld [wcd2a], a ld [wcd2a], a
; load pointer to wcd29 in wcd20
ld a, wcd29 % $100 ld a, wcd29 % $100
ld [CreditsPos], a ld [wcd20], a
ld a, wcd29 / $100 ld a, wcd29 / $100
ld [wcd21], a ld [wcd21], a
ld a, wEnemyMoveStruct % $100 ; load pointer to OddEggSpecies in wcd22
ld a, OddEggSpecies % $100
ld [wcd22], a ld [wcd22], a
ld a, wEnemyMoveStruct / $100 ld a, OddEggSpecies / $100
ld [wcd23], a ld [wcd23], a
; load Odd Egg Name in wcd2b
ld hl, .Odd ld hl, .Odd
ld de, wcd2b ld de, wcd2b
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
; load pointer to wcd2b in wcd24
ld a, wcd2b % $100 ld a, wcd2b % $100
ld [wcd24], a ld [wcd24], a
ld a, wcd2b / $100 ld a, wcd2b / $100
ld [wcd25], a ld [wcd25], a
ld a, BattleMonHappiness % $100 ; load pointer to wOddEggName in wcd26
ld a, wOddEggName % $100
ld [wcd26], a ld [wcd26], a
ld a, BattleMonHappiness / $100 ld a, wOddEggName / $100
ld [wcd27], a ld [wcd27], a
callba Function11b98f callba Function11b98f
ret ret

View File

@ -1,6 +1,12 @@
INCLUDE "predef/sgb.asm" INCLUDE "predef/sgb.asm"
SHINY_ATK_BIT EQU 5
SHINY_DEF_VAL EQU 10
SHINY_SPD_VAL EQU 10
SHINY_SPC_VAL EQU 10
LO_NYBBLE EQU $0f
HI_NYBBLE EQU $f0
CheckShininess: ; 8a68 CheckShininess: ; 8a68
; Check if a mon is shiny by DVs at bc. ; Check if a mon is shiny by DVs at bc.
@ -11,25 +17,25 @@ CheckShininess: ; 8a68
; Attack ; Attack
ld a, [hl] ld a, [hl]
and %0010 << 4 and 1 << SHINY_ATK_BIT
jr z, .NotShiny jr z, .NotShiny
; Defense ; Defense
ld a, [hli] ld a, [hli]
and %1111 and LO_NYBBLE
cp %1010 cp SHINY_DEF_VAL
jr nz, .NotShiny jr nz, .NotShiny
; Speed ; Speed
ld a, [hl] ld a, [hl]
and %1111 << 4 and HI_NYBBLE
cp %1010 << 4 cp SHINY_SPD_VAL << 4
jr nz, .NotShiny jr nz, .NotShiny
; Special ; Special
ld a, [hl] ld a, [hl]
and %1111 and LO_NYBBLE
cp %1010 cp SHINY_SPC_VAL
jr nz, .NotShiny jr nz, .NotShiny
.Shiny .Shiny
@ -53,7 +59,7 @@ CheckContestMon: ; 8a88
; Defense ; Defense
ld a, [hli] ld a, [hli]
and $f and LO_NYBBLE
cp 10 cp 10
jr c, .Bad jr c, .Bad
@ -64,7 +70,7 @@ CheckContestMon: ; 8a88
; Special ; Special
ld a, [hl] ld a, [hl]
and $f and LO_NYBBLE
cp 10 cp 10
jr c, .Bad jr c, .Bad

View File

@ -608,7 +608,7 @@ Script_verbosegiveitem2: ; 0x96f8e
call GetScriptByte call GetScriptByte
call GetVarAction call GetVarAction
ld a, [de] ld a, [de]
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem
ld a, 1 ld a, 1
@ -2344,7 +2344,7 @@ Script_giveitem: ; 0x977ca
.ok .ok
ld [CurItem], a ld [CurItem], a
call GetScriptByte call GetScriptByte
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem
jr nc, .full ; 0x977e3 $6 jr nc, .full ; 0x977e3 $6
@ -2368,7 +2368,7 @@ Script_takeitem: ; 0x977f0
call GetScriptByte call GetScriptByte
ld [CurItem], a ld [CurItem], a
call GetScriptByte call GetScriptByte
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld a, $ff ld a, $ff
ld [wd107], a ld [wd107], a
ld hl, NumItems ld hl, NumItems

View File

@ -333,7 +333,7 @@ Special_GetMysteryGiftItem: ; c309
ld a, [sMysteryGiftItem] ld a, [sMysteryGiftItem]
ld [CurItem], a ld [CurItem], a
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem
jr nc, .asm_c33d jr nc, .asm_c33d

View File

@ -108,7 +108,7 @@ SpecialBuenaPrize: ; 8afd4
push hl push hl
ld [CurItem], a ld [CurItem], a
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem
pop hl pop hl

View File

@ -47,7 +47,7 @@ Special_SelectApricornForKurt: ; 88018
call Kurt_SelectQuantity call Kurt_SelectQuantity
pop bc pop bc
jr nc, .loop jr nc, .loop
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [wKurtApricornQuantity], a ld [wKurtApricornQuantity], a
call Kurt_GiveUpSelectedQuantityOfSelectedApricorn call Kurt_GiveUpSelectedQuantityOfSelectedApricorn
@ -115,7 +115,7 @@ Kurt_SelectApricorn: ; 88055
ld [CurItem], a ld [CurItem], a
call Kurt_GetQuantityOfApricorn call Kurt_GetQuantityOfApricorn
ret z ret z
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [wcf75], a ld [wcf75], a
callba PlaceMenuItemQuantity callba PlaceMenuItemQuantity
ret ret
@ -126,10 +126,10 @@ Kurt_SelectQuantity: ; 880c2
ld [MenuSelection], a ld [MenuSelection], a
call Kurt_GetQuantityOfApricorn call Kurt_GetQuantityOfApricorn
jr z, .done jr z, .done
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [wd10d], a ld [wItemQuantityBuffer], a
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, .MenuDataHeader ld hl, .MenuDataHeader
call LoadMenuDataHeader call LoadMenuDataHeader
.loop .loop
@ -149,8 +149,8 @@ Kurt_SelectQuantity: ; 880c2
ld a, b ld a, b
cp -1 cp -1
jr z, .done jr z, .done
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [wd10c], a ; What is the point of this operation? ld [wItemQuantityChangeBuffer], a ; What is the point of this operation?
scf scf
.done .done
@ -181,7 +181,7 @@ PlaceApricornQuantity: ; 88126
add hl, de add hl, de
ld [hl], "×" ld [hl], "×"
inc hl inc hl
ld de, wd10c ld de, wItemQuantityChangeBuffer
lb bc, PRINTNUM_LEADINGZEROS | 1, 2 lb bc, PRINTNUM_LEADINGZEROS | 1, 2
jp PrintNum jp PrintNum
; 88139 ; 88139
@ -213,7 +213,7 @@ Kurt_GetQuantityOfApricorn: ; 88139
.done2 .done2
ld a, b ld a, b
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
and a and a
pop bc pop bc
ret ret
@ -325,7 +325,7 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
ld [ItemCountBuffer], a ld [ItemCountBuffer], a
call Kurt_GetRidOfItem call Kurt_GetRidOfItem
pop hl pop hl
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
and a and a
jr z, .done jr z, .done
push hl push hl
@ -348,7 +348,7 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
jr .loop4 jr .loop4
.done .done
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
and a and a
pop bc pop bc
pop de pop de
@ -389,7 +389,7 @@ endr
jr z, .done jr z, .done
cp c cp c
jr nz, .done jr nz, .done
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld c, a ld c, a
ld a, [hl] ld a, [hl]
sub c sub c
@ -402,14 +402,14 @@ endr
push bc push bc
ld hl, NumItems ld hl, NumItems
ld a, b ld a, b
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
call TossItem call TossItem
pop bc pop bc
ld a, c ld a, c
sub b sub b
.done .done
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
pop bc pop bc
ret ret
; 88248 ; 88248

View File

@ -720,7 +720,7 @@ endr
.toss .toss
ld hl, NumItems ld hl, NumItems
inc a inc a
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
jp TossItem jp TossItem
.used_park_ball .used_park_ball
@ -2944,7 +2944,7 @@ Functionf789: ; f789
Functionf795: ; f795 Functionf795: ; f795
ld hl, NumItems ld hl, NumItems
ld a, 1 ld a, 1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
jp TossItem jp TossItem
; f7a0 ; f7a0

View File

@ -6790,7 +6790,7 @@ PutItemInPocket: ; d29c
sub [hl] sub [hl]
add b add b
ld b, a ld b, a
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
cp b cp b
jr z, .ok jr z, .ok
jr c, .ok jr c, .ok
@ -6812,8 +6812,8 @@ PutItemInPocket: ; d29c
ld l, e ld l, e
ld a, [CurItem] ld a, [CurItem]
ld c, a ld c, a
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [wd10d], a ld [wItemQuantityBuffer], a
.loop2 .loop2
inc hl inc hl
ld a, [hli] ld a, [hli]
@ -6821,7 +6821,7 @@ PutItemInPocket: ; d29c
jr z, .terminator2 jr z, .terminator2
cp c cp c
jr nz, .loop2 jr nz, .loop2
ld a, [wd10d] ld a, [wItemQuantityBuffer]
add [hl] add [hl]
cp 100 cp 100
jr nc, .newstack jr nc, .newstack
@ -6831,14 +6831,14 @@ PutItemInPocket: ; d29c
.newstack .newstack
ld [hl], 99 ld [hl], 99
sub 99 sub 99
ld [wd10d], a ld [wItemQuantityBuffer], a
jr .loop2 jr .loop2
.terminator2 .terminator2
dec hl dec hl
ld a, [CurItem] ld a, [CurItem]
ld [hli], a ld [hli], a
ld a, [wd10d] ld a, [wItemQuantityBuffer]
ld [hli], a ld [hli], a
ld [hl], -1 ld [hl], -1
ld h, d ld h, d
@ -6855,9 +6855,9 @@ RemoveItemFromPocket: ; d2ff
ld e, l ld e, l
ld a, [hli] ld a, [hli]
ld c, a ld c, a
ld a, [wd107] ld a, [ItemCountBuffer]
cp c cp c
jr nc, .ok jr nc, .ok ; memory
ld c, a ld c, a
ld b, $0 ld b, $0
rept 2 rept 2
@ -6884,13 +6884,13 @@ endr
jr .loop jr .loop
.skip .skip
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld b, a ld b, a
ld a, [hl] ld a, [hl]
sub b sub b
jr c, .nope jr c, .nope
ld [hl], a ld [hl], a
ld [wd10d], a ld [wItemQuantityBuffer], a
and a and a
jr nz, .yup jr nz, .yup
dec hl dec hl
@ -7035,7 +7035,7 @@ ReceiveTMHM: ; d3c4
ld b, 0 ld b, 0
ld hl, TMsHMs ld hl, TMsHMs
add hl, bc add hl, bc
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
add [hl] add [hl]
cp 100 cp 100
jr nc, .toomany jr nc, .toomany
@ -7053,13 +7053,13 @@ TossTMHM: ; d3d8
ld b, 0 ld b, 0
ld hl, TMsHMs ld hl, TMsHMs
add hl, bc add hl, bc
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld b, a ld b, a
ld a, [hl] ld a, [hl]
sub b sub b
jr c, .nope jr c, .nope
ld [hl], a ld [hl], a
ld [wd10d], a ld [wItemQuantityBuffer], a
jr nz, .yup jr nz, .yup
ld a, [wd0e2] ld a, [wd0e2]
and a and a
@ -11932,7 +11932,7 @@ Function122f8: ; 122f8
ld a, [EngineBuffer1] ld a, [EngineBuffer1]
ld [CurItem], a ld [CurItem], a
ld a, [CurFruit] ld a, [CurFruit]
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem
ret nc ret nc
@ -13470,7 +13470,7 @@ GetPartyItemLocation: ; 12cd7
Function12cdf: ; 12cdf Function12cdf: ; 12cdf
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
jp ReceiveItem jp ReceiveItem
; 12cea ; 12cea
@ -13478,7 +13478,7 @@ Function12cdf: ; 12cdf
Function12cea: ; 12cea (4:6cea) Function12cea: ; 12cea (4:6cea)
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
jp TossItem jp TossItem
@ -18115,7 +18115,7 @@ Function157e9: ; 0x157e9
; items without quantity are always ×1 ; items without quantity are always ×1
ld a, 1 ld a, 1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
jr .withdraw jr .withdraw
.askquantity .askquantity
@ -18127,7 +18127,7 @@ Function157e9: ; 0x157e9
jr c, .done jr c, .done
.withdraw .withdraw
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [Buffer1], a ; quantity ld [Buffer1], a ; quantity
ld a, [wd107] ld a, [wd107]
ld [Buffer2], a ld [Buffer2], a
@ -18135,7 +18135,7 @@ Function157e9: ; 0x157e9
call ReceiveItem call ReceiveItem
jr nc, .PackFull jr nc, .PackFull
ld a, [Buffer1] ld a, [Buffer1]
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld a, [Buffer2] ld a, [Buffer2]
ld [wd107], a ld [wd107], a
ld hl, PCItems ld hl, PCItems
@ -18288,7 +18288,7 @@ Function1590a: ; 0x1590a
and a and a
jr z, .asm_1591d jr z, .asm_1591d
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
jr .asm_15933 jr .asm_15933
.asm_1591d .asm_1591d
@ -18302,7 +18302,7 @@ Function1590a: ; 0x1590a
jr c, .asm_1596c jr c, .asm_1596c
.asm_15933 .asm_15933
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [Buffer1], a ld [Buffer1], a
ld a, [wd107] ld a, [wd107]
ld [Buffer2], a ld [Buffer2], a
@ -18310,7 +18310,7 @@ Function1590a: ; 0x1590a
call ReceiveItem call ReceiveItem
jr nc, .asm_15965 jr nc, .asm_15965
ld a, [Buffer1] ld a, [Buffer1]
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld a, [Buffer2] ld a, [Buffer2]
ld [wd107], a ld [wd107], a
ld hl, NumItems ld hl, NumItems
@ -19010,7 +19010,7 @@ Function15cef: ; 15cef
Function15d83: ; 15d83 Function15d83: ; 15d83
ld a, $63 ld a, $63
ld [wd10d], a ld [wItemQuantityBuffer], a
ld a, $0 ld a, $0
call Function15c7d call Function15c7d
callba Function24fc9 callba Function24fc9
@ -19028,7 +19028,7 @@ Function15d97: ; 15d97
Function15da5: ; 15da5 Function15da5: ; 15da5
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld a, [wd107] ld a, [wd107]
ld e, a ld e, a
ld d, $0 ld d, $0
@ -19072,7 +19072,7 @@ Function15de2: ; 15de2
call Function15c7d call Function15c7d
call Function15df9 call Function15df9
ld a, $63 ld a, $63
ld [wd10d], a ld [wItemQuantityBuffer], a
callba Function24fcf callba Function24fcf
call ExitMenu call ExitMenu
ret ret
@ -23084,7 +23084,7 @@ MenuJoyAction: ; 24609
ld a, [MenuSelection] ld a, [MenuSelection]
ld [CurItem], a ld [CurItem], a
ld a, [wcf75] ld a, [wcf75]
ld [wd10d], a ld [wItemQuantityBuffer], a
call Function246fc call Function246fc
dec a dec a
ld [wcf77], a ld [wcf77], a
@ -24586,7 +24586,7 @@ Function24fe1: ; 24fe1
Function24ff9: ; 24ff9 Function24ff9: ; 24ff9
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
.asm_24ffe .asm_24ffe
call Function25072 call Function25072
call Function2500e call Function2500e
@ -24629,10 +24629,10 @@ Function2500e: ; 2500e
ret ret
.asm_25033 .asm_25033
ld hl, wd10c ld hl, wItemQuantityChangeBuffer
dec [hl] dec [hl]
jr nz, .asm_2503d jr nz, .asm_2503d
ld a, [wd10d] ld a, [wItemQuantityBuffer]
ld [hl], a ld [hl], a
.asm_2503d .asm_2503d
@ -24640,9 +24640,9 @@ Function2500e: ; 2500e
ret ret
.asm_2503f .asm_2503f
ld hl, wd10c ld hl, wItemQuantityChangeBuffer
inc [hl] inc [hl]
ld a, [wd10d] ld a, [wItemQuantityBuffer]
cp [hl] cp [hl]
jr nc, .asm_2504b jr nc, .asm_2504b
ld [hl], $1 ld [hl], $1
@ -24652,7 +24652,7 @@ Function2500e: ; 2500e
ret ret
.asm_2504d .asm_2504d
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
sub $a sub $a
jr c, .asm_25058 jr c, .asm_25058
jr z, .asm_25058 jr z, .asm_25058
@ -24662,22 +24662,22 @@ Function2500e: ; 2500e
ld a, $1 ld a, $1
.asm_2505a .asm_2505a
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
and a and a
ret ret
.asm_2505f .asm_2505f
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
add $a add $a
ld b, a ld b, a
ld a, [wd10d] ld a, [wItemQuantityBuffer]
cp b cp b
jr nc, .asm_2506c jr nc, .asm_2506c
ld b, a ld b, a
.asm_2506c .asm_2506c
ld a, b ld a, b
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
and a and a
ret ret
; 25072 ; 25072
@ -24689,7 +24689,7 @@ Function25072: ; 25072
add hl, de add hl, de
ld [hl], $f1 ld [hl], $f1
inc hl inc hl
ld de, wd10c ld de, wItemQuantityChangeBuffer
lb bc, PRINTNUM_LEADINGZEROS | 1, 2 lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum call PrintNum
ld a, [wcf86] ld a, [wcf86]
@ -24726,7 +24726,7 @@ Function250a9: ; 250a9
ld [hMultiplicand + 1], a ld [hMultiplicand + 1], a
ld a, [Buffer2] ld a, [Buffer2]
ld [hMultiplicand + 2], a ld [hMultiplicand + 2], a
ld a, [wd10c] ld a, [wItemQuantityChangeBuffer]
ld [hMultiplier], a ld [hMultiplier], a
push hl push hl
call Multiply call Multiply
@ -33392,7 +33392,7 @@ Function2c76f: ; 2c76f (b:476f)
ld b, $0 ld b, $0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd10d], a ld [wItemQuantityBuffer], a
call Function2c798 call Function2c798
scf scf
ret ret
@ -36628,7 +36628,7 @@ Function4484a: ; 0x4484a
dec a dec a
call .Function448bb call .Function448bb
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem
jr c, .asm_4489e jr c, .asm_4489e
@ -43907,6 +43907,10 @@ FindGreaterThanThatLevel: ; 4dc31
; 4dc56 ; 4dc56
FindThatSpecies: ; 4dc56 FindThatSpecies: ; 4dc56
; Find species b in your party.
; If you have no Pokemon, returns c = -1 and z.
; If that species is in your party, returns its location in c, and nz.
; Otherwise, returns z.
ld c, -1 ld c, -1
ld hl, PartySpecies ld hl, PartySpecies
.loop .loop
@ -77286,7 +77290,7 @@ Functionfd0c3: ; fd0c3
ld a, [hl] ld a, [hl]
ld [CurItem], a ld [CurItem], a
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld hl, PCItems ld hl, PCItems
call ReceiveItem call ReceiveItem
ret ret

View File

@ -16285,29 +16285,29 @@ Function11b93b: ; 11b93b
xor a xor a
ld [$a800], a ld [$a800], a
ld hl, $a823 ld hl, $a823
ld de, $c608 ld de, wEnemyMoveStruct
ld bc, $008f ld bc, $008f
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ld a, $8 ld a, wEnemyMoveStruct % $100
ld [BGMapBuffer], a ld [wcd20], a
ld a, $c6 ld a, wEnemyMoveStruct / $100
ld [wcd21], a ld [wcd21], a
ld a, $11 ld a, $c611 % $100
ld [CreditsTimer], a ld [wcd22], a
ld a, $c6 ld a, $c611 / $100
ld [wcd23], a ld [wcd23], a
ld a, $41 ld a, $c641 % $100
ld [wcd24], a ld [wcd24], a
ld a, $c6 ld a, $c641 / $100
ld [wcd25], a ld [wcd25], a
ld a, $46 ld a, $c646 % $100
ld [wcd26], a ld [wcd26], a
ld a, $c6 ld a, $c646 / $100
ld [wcd27], a ld [wcd27], a
ld a, $4b ld a, $c64b % $100
ld [wcd28], a ld [wcd28], a
ld a, $c6 ld a, $c64b / $100
ld [wcd29], a ld [wcd29], a
call Function11b98f call Function11b98f
callba Function14a58 callba Function14a58
@ -16319,17 +16319,17 @@ Function11b98f: ; 11b98f
ld a, [hl] ld a, [hl]
ld e, a ld e, a
inc [hl] inc [hl]
ld a, [BGMapBuffer] ld a, [wcd20]
ld l, a ld l, a
ld a, [wcd21] ld a, [wcd21]
ld h, a ld h, a
inc hl inc hl
ld bc, PartySpecies ld bc, PartySpecies
ld d, e ld d, e
.asm_11b9a2 .loop1
inc bc inc bc
dec d dec d
jr nz, .asm_11b9a2 jr nz, .loop1
ld a, e ld a, e
ld [CurPartyMon], a ld [CurPartyMon], a
ld a, [hl] ld a, [hl]
@ -16341,11 +16341,11 @@ Function11b98f: ; 11b98f
ld bc, PartyMon2 - PartyMon1 ld bc, PartyMon2 - PartyMon1
ld a, e ld a, e
ld [wcd2a], a ld [wcd2a], a
.asm_11b9ba .loop2
add hl, bc add hl, bc
dec a dec a
and a and a
jr nz, .asm_11b9ba jr nz, .loop2
ld e, l ld e, l
ld d, h ld d, h
ld a, [CreditsTimer] ld a, [CreditsTimer]
@ -16355,49 +16355,49 @@ Function11b98f: ; 11b98f
ld bc, PartyMon2 - PartyMon1 ld bc, PartyMon2 - PartyMon1
call CopyBytes call CopyBytes
ld hl, PartyMonOT ld hl, PartyMonOT
ld bc, $000b ld bc, NAME_LENGTH
ld a, [wcd2a] ld a, [wcd2a]
.asm_11b9d8 .loop3
add hl, bc add hl, bc
dec a dec a
and a and a
jr nz, .asm_11b9d8 jr nz, .loop3
ld e, l ld e, l
ld d, h ld d, h
ld a, [wcd24] ld a, [wcd24]
ld l, a ld l, a
ld a, [wcd25] ld a, [wcd25]
ld h, a ld h, a
ld bc, $000a ld bc, PKMN_NAME_LENGTH - 1
call CopyBytes call CopyBytes
ld a, $50 ld a, "@"
ld [de], a ld [de], a
ld hl, PartyMonNicknames ld hl, PartyMonNicknames
ld bc, $000b ld bc, PKMN_NAME_LENGTH
ld a, [wcd2a] ld a, [wcd2a]
.asm_11b9f9 .loop4
add hl, bc add hl, bc
dec a dec a
and a and a
jr nz, .asm_11b9f9 jr nz, .loop4
ld e, l ld e, l
ld d, h ld d, h
ld a, [wcd26] ld a, [wcd26]
ld l, a ld l, a
ld a, [wcd27] ld a, [wcd27]
ld h, a ld h, a
ld bc, $000a ld bc, PKMN_NAME_LENGTH - 1
call CopyBytes call CopyBytes
ld a, $50 ld a, "@"
ld [de], a ld [de], a
ld hl, $a600 ld hl, s0_a600
ld bc, $002f ld bc, party_struct_length - 1
ld a, [wcd2a] ld a, [wcd2a]
.asm_11ba1a .loop5
add hl, bc add hl, bc
dec a dec a
and a and a
jr nz, .asm_11ba1a jr nz, .loop5
ld a, $0 ld a, $0
call GetSRAMBank call GetSRAMBank
ld e, l ld e, l
@ -16406,7 +16406,7 @@ Function11b98f: ; 11b98f
ld l, a ld l, a
ld a, [wcd29] ld a, [wcd29]
ld h, a ld h, a
ld bc, $002f ld bc, party_struct_length - 1
call CopyBytes call CopyBytes
call CloseSRAM call CloseSRAM
ret ret
@ -23950,7 +23950,7 @@ endr
ld a, EGG_TICKET ld a, EGG_TICKET
ld [CurItem], a ld [CurItem], a
ld a, $1 ld a, $1
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
ld a, $ff ld a, $ff
ld [wd107], a ld [wd107], a
ld hl, NumItems ld hl, NumItems

View File

@ -2693,7 +2693,7 @@ Function17e0fd: ; 17e0fd
ld a, [hli] ld a, [hli]
ld [CurItem], a ld [CurItem], a
ld a, [hli] ld a, [hli]
ld [wd10c], a ld [wItemQuantityChangeBuffer], a
push hl push hl
ld hl, NumItems ld hl, NumItems
call ReceiveItem call ReceiveItem

View File

@ -5,8 +5,8 @@ sScratch::
SECTION "SRAM Bank 0", SRAM [$a600], BANK [0] SECTION "SRAM Bank 0", SRAM [$a600], BANK [0]
s0_a600:: ds $11a s0_a600:: ds 6 * (party_struct_length + PartyMon1 - PartyMon1Item)
s0_a71a:: ds $11a s0_a71a:: ds 6 * (party_struct_length + PartyMon1 - PartyMon1Item)
s0_a834:: ds 1 s0_a834:: ds 1
s0_a835:: ds 10 * (party_struct_length + PartyMon1 - PartyMon1Item) s0_a835:: ds 10 * (party_struct_length + PartyMon1 - PartyMon1Item)
s0_aa0b:: ds 1 s0_aa0b:: ds 1

View File

@ -708,7 +708,7 @@ UnknownText_0x1c0ba5: ; 1c0ba5
UnknownText_0x1c0bbb: ; 1c0bbb UnknownText_0x1c0bbb: ; 1c0bbb
text "Throw away @" text "Throw away @"
deciram wd10c, 1, 2 deciram wItemQuantityChangeBuffer, 1, 2
text "" text ""
line "@" line "@"
text_from_ram StringBuffer2 text_from_ram StringBuffer2
@ -1293,7 +1293,7 @@ _KrissPCHowManyWithdrawText: ; 1c1381
_KrissPCWithdrewItemsText: ; 1c13a4 _KrissPCWithdrewItemsText: ; 1c13a4
text "Withdrew @" text "Withdrew @"
deciram wd10c, 1, 2 deciram wItemQuantityChangeBuffer, 1, 2
text "" text ""
line "@" line "@"
text_from_ram StringBuffer2 text_from_ram StringBuffer2
@ -1320,7 +1320,7 @@ _KrissPCHowManyDepositText: ; 1c13ef
_KrissPCDepositItemsText: ; 1c1411 _KrissPCDepositItemsText: ; 1c1411
text "Deposited @" text "Deposited @"
deciram wd10c, 1, 2 deciram wItemQuantityChangeBuffer, 1, 2
text "" text ""
line "@" line "@"
text_from_ram StringBuffer2 text_from_ram StringBuffer2
@ -1610,7 +1610,7 @@ UnknownText_0x1c1a90: ; 1c1a90
UnknownText_0x1c1aad: ; 1c1aad UnknownText_0x1c1aad: ; 1c1aad
text "Throw away @" text "Throw away @"
deciram wd10c, 1, 2 deciram wItemQuantityChangeBuffer, 1, 2
text "" text ""
line "@" line "@"
text_from_ram StringBuffer2 text_from_ram StringBuffer2

View File

@ -537,7 +537,7 @@ UnknownText_0x1c4bfd: ; 0x1c4bfd
; 0x1c4c08 ; 0x1c4c08
UnknownText_0x1c4c08: ; 0x1c4c08 UnknownText_0x1c4c08: ; 0x1c4c08
deciram wd10c, 1, 2 deciram wItemQuantityChangeBuffer, 1, 2
text " @" text " @"
text_from_ram StringBuffer2 text_from_ram StringBuffer2
text "(S)" text "(S)"
@ -569,7 +569,7 @@ UnknownText_0x1c4ca3: ; 0x1c4ca3
; 0x1c4cae ; 0x1c4cae
UnknownText_0x1c4cae: ; 0x1c4cae UnknownText_0x1c4cae: ; 0x1c4cae
deciram wd10c, 1, 2 deciram wItemQuantityChangeBuffer, 1, 2
text " @" text " @"
text_from_ram StringBuffer2 text_from_ram StringBuffer2
text "(S)" text "(S)"
@ -666,7 +666,7 @@ UnknownText_0x1c4e7e: ; 0x1c4e7e
; 0x1c4e89 ; 0x1c4e89
UnknownText_0x1c4e89: ; 0x1c4e89 UnknownText_0x1c4e89: ; 0x1c4e89
deciram wd10c, 1, 2 deciram wItemQuantityChangeBuffer, 1, 2
text " @" text " @"
text_from_ram StringBuffer2 text_from_ram StringBuffer2
text "(S)" text "(S)"

View File

@ -432,12 +432,16 @@ TileMapEnd::
SECTION "Battle", WRAM0 SECTION "Battle", WRAM0
party_struct OddEgg
wOddEggName:: ds PKMN_NAME_LENGTH
wOddEggOTName:: ds PKMN_NAME_LENGTH
ds -70
wMisc:: wMisc::
wBattle:: wBattle::
wc608::
wBT_OTTempCopy:: ; used to copy the data of the BattleTower-Trainer and the 3 Pkmn wBT_OTTempCopy:: ; used to copy the data of the BattleTower-Trainer and the 3 Pkmn
wc608::
wEnemyMoveStruct:: ds MOVE_LENGTH ; c608 wEnemyMoveStruct:: ds MOVE_LENGTH ; c608
wc60f:: wc60f::
wPlayerMoveStruct:: ds MOVE_LENGTH ; c60f wPlayerMoveStruct:: ds MOVE_LENGTH ; c60f
@ -1035,7 +1039,7 @@ OverworldMapEnd::
SECTION "Video", WRAM0 SECTION "Video", WRAM0
CreditsPos:: CreditsPos::
BGMapBuffer:: ; cd20 BGMapBuffer:: ; cd20
ds 1 wcd20:: ds 1
wcd21:: ds 1 wcd21:: ds 1
wcd22:: wcd22::
CreditsTimer:: ; cd22 CreditsTimer:: ; cd22
@ -1557,8 +1561,8 @@ CurPartyMon:: ; d109
wd10a:: ds 1 wd10a:: ds 1
wd10b:: ds 1 wd10b:: ds 1
wd10c:: ds 1 wItemQuantityChangeBuffer:: ds 1
wd10d:: ds 1 wItemQuantityBuffer:: ds 1
wd10e:: wd10e::
TempMon:: TempMon::