Fix more static banks (trainers, mobile graphics).

This commit is contained in:
yenatch 2014-12-29 10:23:22 -08:00
parent 133e2fb7a7
commit 4781d9a809
4 changed files with 94 additions and 92 deletions

View File

@ -1,22 +1,17 @@
INCLUDE "includes.asm" INCLUDE "includes.asm"
SECTION "Pic Pointers", ROMX, BANK[PIC_POINTERS] ; Unown pic pointers are assumed to start at the same address in a different bank.
PicPointers:: SECTION "Pic Pointers", ROMX[$4000], BANK[PIC_POINTERS]
INCLUDE "gfx/pics/pic_pointers.asm" PicPointers:: INCLUDE "gfx/pics/pic_pointers.asm"
SECTION "Unown Pic Pointers", ROMX[$4000], BANK[UNOWN_PIC_POINTERS]
SECTION "Unown Pic Pointers", ROMX, BANK[UNOWN_PIC_POINTERS] UnownPicPointers:: INCLUDE "gfx/pics/unown_pic_pointers.asm"
UnownPicPointers::
INCLUDE "gfx/pics/unown_pic_pointers.asm"
SECTION "Trainer Pic Pointers", ROMX, BANK[TRAINER_PIC_POINTERS] SECTION "Trainer Pic Pointers", ROMX, BANK[TRAINER_PIC_POINTERS]
TrainerPicPointers:: INCLUDE "gfx/pics/trainer_pic_pointers.asm"
TrainerPicPointers::
INCLUDE "gfx/pics/trainer_pic_pointers.asm"

164
main.asm
View File

@ -7977,7 +7977,7 @@ SpecialsPointers: ; c029
dbw BANK(Function71ac), Function71ac dbw BANK(Function71ac), Function71ac
dbw BANK(Function2a4ab), Function2a4ab dbw BANK(Function2a4ab), Function2a4ab
dbw BANK(Function2a51f), Function2a51f dbw BANK(Function2a51f), Function2a51f
dbw BANK(Function2a567), Function2a567 dbw BANK(RandomPhoneMon), RandomPhoneMon
dbw BANK(Function14209), Function14209 dbw BANK(Function14209), Function14209
dbw BANK(Functionfb841), Functionfb841 dbw BANK(Functionfb841), Functionfb841
dbw BANK(SpecialSnorlaxAwake),SpecialSnorlaxAwake dbw BANK(SpecialSnorlaxAwake),SpecialSnorlaxAwake
@ -14051,7 +14051,7 @@ Functione3de: ; e3de
pop hl pop hl
ld de, StringBuffer1 ld de, StringBuffer1
call InitName call InitName
ld a, $4 ld a, $4 ; XXX could this be in bank 4 in pokered?
ld hl, Function2b4d ld hl, Function2b4d
rst FarCall rst FarCall
ret ret
@ -41079,80 +41079,86 @@ Function2a51f: ; 2a51f
jp CopyBytes jp CopyBytes
; 2a567 ; 2a567
Function2a567: ; 2a567 RandomPhoneMon: ; 2a567
; Get a random monster owned by the trainer who's calling.
callba Function90439 callba Function90439
ld hl, $5999 ld hl, TrainerGroups
ld a, d ld a, d
dec a dec a
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
add hl, bc add hl, bc
ld a, $e ld a, BANK(TrainerGroups)
call GetFarHalfword call GetFarHalfword
.asm_2a57c
.skip_trainer
dec e dec e
jr z, .asm_2a58b jr z, .skipped
.asm_2a57f .skip
ld a, $e ld a, BANK(Trainers)
call GetFarByte call GetFarByte
inc hl inc hl
cp $ff cp -1
jr nz, .asm_2a57f jr nz, .skip
jr .asm_2a57c jr .skip_trainer
.skipped
.asm_2a58b .skip_name
ld a, $e ld a, BANK(Trainers)
call GetFarByte call GetFarByte
inc hl inc hl
cp $50 cp "@"
jr nz, .asm_2a58b jr nz, .skip_name
ld a, $e
call GetFarByte
inc hl
ld bc, $0002
cp $0
jr z, .asm_2a5b3
ld bc, $0006
cp $1
jr z, .asm_2a5b3
ld bc, $0003
cp $2
jr z, .asm_2a5b3
ld bc, $0007
.asm_2a5b3 ld a, BANK(Trainers)
ld e, $0 call GetFarByte
inc hl
ld bc, 2
cp 0
jr z, .got_mon_length
ld bc, 2 + NUM_MOVES
cp 1
jr z, .got_mon_length
ld bc, 2 + 1
cp 2
jr z, .got_mon_length
ld bc, 2 + 1 + NUM_MOVES
.got_mon_length
ld e, 0
push hl push hl
.asm_2a5b6 .count_mon
inc e inc e
add hl, bc add hl, bc
ld a, $e ld a, BANK(Trainers)
call GetFarByte call GetFarByte
cp $ff cp -1
jr nz, .asm_2a5b6 jr nz, .count_mon
pop hl pop hl
.asm_2a5c2
call Random
and $7
cp e
jr nc, .asm_2a5c2
inc a
.asm_2a5cb
dec a
jr z, .asm_2a5d1
add hl, bc
jr .asm_2a5cb
.asm_2a5d1 .rand
inc hl call Random
ld a, $e and 7
cp e
jr nc, .rand
inc a
.get_mon
dec a
jr z, .got_mon
add hl, bc
jr .get_mon
.got_mon
inc hl ; species
ld a, BANK(Trainers)
call GetFarByte call GetFarByte
ld [$d265], a ld [$d265], a
call GetPokemonName call GetPokemonName
ld hl, StringBuffer1 ld hl, StringBuffer1
ld de, StringBuffer4 ld de, StringBuffer4
ld bc, $000b ld bc, PKMN_NAME_LENGTH
jp CopyBytes jp CopyBytes
; 2a5e9 ; 2a5e9
@ -46293,15 +46299,15 @@ Function41a2c: ; 41a2c
call GetSRAMBank call GetSRAMBank
ld hl, UnownFont ld hl, UnownFont
ld de, $a188 ld de, $a188
ld bc, $0270 ld bc, $270
ld a, BANK(UnownFont) ld a, BANK(UnownFont)
call FarCopyBytes call FarCopyBytes
ld hl, $a188 ld hl, $a188
ld bc, $01b0 ld bc, $1b0
call Function41504 call Function41504
ld de, $a188 ld de, $a188
ld hl, $9400 ld hl, $9400
lb bc, $10, $1b lb bc, BANK(Function41a2c), $1b
call Request2bpp call Request2bpp
call CloseSRAM call CloseSRAM
ret ret
@ -64624,7 +64630,7 @@ Function84785: ; 84785
inc hl inc hl
ld d, [hl] ld d, [hl]
hlcoord 1, 7 hlcoord 1, 7
ld a, $77 ld a, BANK(GBPrinterStrings)
call FarString call FarString
hlcoord 2, 15 hlcoord 2, 15
ld de, String_847f5 ld de, String_847f5
@ -66839,14 +66845,14 @@ INCBIN "baserom.gbc",$8940b,$8942b - $8940b
Function8942b: ; 8942b (22:542b) Function8942b: ; 8942b (22:542b)
ld de, $8020 ld de, $8020
ld hl, $61bf ld hl, MobileAdapterGFX + $7d0
ld bc, $80 ld bc, $80
ld a, $5e ld a, BANK(MobileAdapterGFX)
call FarCopyBytes call FarCopyBytes
ld de, $80a0 ld de, $80a0
ld hl, $664f ld hl, MobileAdapterGFX + $c60
ld bc, $40 ld bc, $40
ld a, $5e ld a, BANK(MobileAdapterGFX)
call FarCopyBytes call FarCopyBytes
ret ret
@ -66863,23 +66869,23 @@ Function89448: ; 89448 (22:5448)
ret ret
Function89455: ; 89455 (22:5455) Function89455: ; 89455 (22:5455)
ld hl, $61bf ld hl, MobileAdapterGFX + $7d0
ld de, $90c0 ld de, $90c0
ld bc, $490 ld bc, $490
ld a, $5e ld a, BANK(MobileAdapterGFX)
call FarCopyBytes call FarCopyBytes
ret ret
Function89464: ; 89464 Function89464: ; 89464
ld hl, $59ef ld hl, MobileAdapterGFX
ld de, VTiles2 ld de, VTiles2
ld bc, $0200 ld bc, $200
ld a, $5e ld a, BANK(MobileAdapterGFX)
call FarCopyBytes call FarCopyBytes
ld hl, $604f ld hl, MobileAdapterGFX + $660
ld de, $9200 ld de, $9200
ld bc, $0170 ld bc, $170
ld a, $5e ld a, BANK(MobileAdapterGFX)
call FarCopyBytes call FarCopyBytes
ret ret
; 89481 ; 89481
@ -67547,16 +67553,16 @@ Function897d5: ; 897d5
Function89807: ; 89807 (22:5807) Function89807: ; 89807 (22:5807)
ld hl, $5bef ld hl, MobileAdapterGFX + $200
ld a, [PlayerGender] ; $d472 ld a, [PlayerGender] ; $d472
bit 0, a bit 0, a
jr z, .asm_89814 jr z, .asm_89814
ld hl, $5e1f ld hl, MobileAdapterGFX + $200 + $230
.asm_89814 .asm_89814
call DisableLCD call DisableLCD
ld de, $9370 ld de, $9370
ld bc, $230 ld bc, $230
ld a, $5e ld a, BANK(MobileAdapterGFX)
call FarCopyBytes call FarCopyBytes
call EnableLCD call EnableLCD
call DelayFrame call DelayFrame
@ -72277,20 +72283,20 @@ Function8b677: ; 8b677
; 8b690 ; 8b690
Function8b690: ; 8b690 Function8b690: ; 8b690
ld hl, $74b9 ld hl, GFX_17afa5 + $514
ld de, VTiles2 ld de, VTiles2
ld bc, $0160 ld bc, $160
ld a, $5e ld a, BANK(GFX_17afa5)
call FarCopyBytes call FarCopyBytes
ld hl, $7609 ld hl, GFX_17afa5 + $514 + $160 - $10
ld de, $9610 ld de, $9610
ld bc, $0010 ld bc, $10
ld a, $5e ld a, BANK(GFX_17afa5)
call FarCopyBytes call FarCopyBytes
ld hl, $7619 ld hl, GFX_17afa5 + $514 + $160
ld de, $8ee0 ld de, $8ee0
ld bc, $0010 ld bc, $10
ld a, $5e ld a, BANK(GFX_17afa5)
call FarCopyBytes call FarCopyBytes
ret ret
; 8b6bb ; 8b6bb

View File

@ -3,7 +3,7 @@ INCLUDE "includes.asm"
SECTION "Misc Crystal", ROMX, BANK[MISC_CRYSTAL] SECTION "Misc Crystal", ROMX, BANK[MISC_CRYSTAL]
MobileAdapterGFX: MobileAdapterGFX::
INCBIN "gfx/misc/mobile_adapter.2bpp" INCBIN "gfx/misc/mobile_adapter.2bpp"
@ -817,5 +817,5 @@ INCBIN "baserom.gbc",$17acd5,$17ae3d - $17acd5
Tilemap_17ae3d: ; 17ae3d Tilemap_17ae3d: ; 17ae3d
INCBIN "baserom.gbc",$17ae3d,$17afa5 - $17ae3d INCBIN "baserom.gbc",$17ae3d,$17afa5 - $17ae3d
GFX_17afa5: ; 17afa5 GFX_17afa5:: ; 17afa5
INCBIN "baserom.gbc",$17afa5,$17b7a5 - $17afa5 INCBIN "baserom.gbc",$17afa5,$17b7a5 - $17afa5

View File

@ -1,3 +1,4 @@
Trainers:
; All trainers follow a basic structure: ; All trainers follow a basic structure:
; Name ; Name