Fix marts using hard-coded bank number

This commit is contained in:
PikalaxALT
2016-01-27 12:25:12 -05:00
parent d02c9e39dd
commit b272c0c375
17 changed files with 286 additions and 824 deletions

View File

@@ -120,7 +120,7 @@ Function8c2cf: ; 8c2cf
ld [rSVBK], a
push hl
ld hl, wDecompressScratch
ld bc, $28 * $10
ld bc, $28 tiles
.loop
ld [hl], -1
@@ -568,7 +568,7 @@ StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
ld a, [OtherTrainerClass]
and a
jp z, .nextscene
jp z, .nextscene ; don't need to be here if wild
xor a
ld [hBGMapMode], a
@@ -579,6 +579,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
jr .enter_loop_midway
.loop
; set all pals to 7
ld a, [hl]
or %00000111
ld [hli], a
@@ -588,7 +589,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
dec b
jr nz, .loop
call .loadpokeballgfx ; load a, [OtherTrainerClass] \ ld de, PokeBallTransition
call .loadpokeballgfx ; ld a, [OtherTrainerClass] \ ld de, PokeBallTransition \ ret
hlcoord 2, 1
ld b, SCREEN_WIDTH - 4
@@ -605,7 +606,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
jr z, .done
sla a
jr nc, .no_load
ld [hl], $fe ; "8"
ld [hl], $fe
.no_load
inc hl
jr .loop4
@@ -650,12 +651,12 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
ld [rSVBK], a
call .copypals
push hl
ld de, UnknBGPals + 8 * 7
ld bc, $8
ld de, UnknBGPals + 7 palettes
ld bc, 1 palettes
call CopyBytes
pop hl
ld de, BGPals + 8 * 7
ld bc, $8
ld de, BGPals + 7 palettes
ld bc, 1 palettes
call CopyBytes
pop af
ld [rSVBK], a
@@ -669,21 +670,21 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
ret
.copypals: ; 8c677 (23:4677)
ld de, UnknBGPals + 8 * 7
ld de, UnknBGPals + 7 palettes
call .copy
ld de, BGPals + 8 * 7
ld de, BGPals + 7 palettes
call .copy
ld de, UnknOBPals + 8 * 6
ld de, UnknOBPals + 6 palettes
call .copy
ld de, OBPals + 8 * 6
ld de, OBPals + 6 palettes
call .copy
ld de, UnknOBPals + 8 * 7
ld de, UnknOBPals + 7 palettes
call .copy
ld de, OBPals + 8 * 7
ld de, OBPals + 7 palettes
.copy: ; 8c698 (23:4698)
push hl
ld bc, $8
ld bc, 1 palettes
call CopyBytes
pop hl
ret

View File

@@ -4,7 +4,7 @@ ReturnFromMapSetupScript:: ; b8000
; For some reson, GameFreak chose to use a callba here instead of just falling through.
; No other function in the game references the function at 2E:400A, here labeled
; ReturnFromMapSetupScript.inefficientcallba.
callba .inefficientcallba ; this is a waste of 6 ROM bytes and 2 stack bytes
callba .inefficientcallba ; this is a waste of 6 ROM bytes and 6 stack bytes
ret
; b800a

View File

@@ -139,7 +139,7 @@ GetMart: ; 15b31
ld a, e
cp (MartsEnd - Marts) / 2
jr c, .IsAMart
ld b, $5
ld b, BANK(DefaultMart)
ld de, DefaultMart
ret
@@ -151,7 +151,7 @@ endr
ld e, [hl]
inc hl
ld d, [hl]
ld b, $5
ld b, BANK(Marts)
ret
; 15b47

View File

@@ -971,7 +971,7 @@ BoxNameInputLower:
db "1 2 3 4 5 6 7 8 9"
db "UPPER DEL END "
NameInputUpper: ; Unreferenced?
NameInputUpper:
db "A B C D E F G H I"
db "J K L M N O P Q R"
db "S T U V W X Y Z "

View File

@@ -446,7 +446,7 @@ DoPlayerMovement:: ; 80000
db $70, $78, $76, $7e
; 8025f
.DoStep: ; 8025f
.DoStep
ld e, a
ld d, 0
ld hl, .Steps