Add some naming screen stuff.

This commit is contained in:
IIMarckus 2013-05-12 18:36:40 -06:00
parent 5419d34a21
commit e7208f1964
3 changed files with 136 additions and 27 deletions

View File

@ -402,7 +402,7 @@ ParkBall: ; e8a2
pop hl pop hl
ld de, StringBuffer1 ld de, StringBuffer1
call $2ef9 call InitString
jp $6be2 jp $6be2
@ -466,7 +466,7 @@ ParkBall: ; e8a2
ld hl, $b082 ld hl, $b082
ld de, StringBuffer1 ld de, StringBuffer1
call $2ef9 call InitString
call CloseSRAM call CloseSRAM

147
main.asm
View File

@ -2421,7 +2421,36 @@ ObjectEventText:
db "@" db "@"
; 0x26f7 ; 0x26f7
INCBIN "baserom.gbc", $26f7, $2bed-$26f7 INCBIN "baserom.gbc", $26f7, $2b74-$26f7
Function2b74: ; 0x2b74
push af
ld a, $1
ld [$c2ce], a
call WhiteBGMap
call ClearSprites
call $2bae
ld hl, $c590 ; tile 0, 12
ld bc, $0412
call TextBox
ld hl, VramState
set 0, [hl]
call $1ad2
call $3200
ld b, $9
call GetSGBLayout
ld a, $12
ld hl, $5409
rst $8
call $0485
call DelayFrame
ld a, $1
ld [$ffde], a
pop af
ret
; 0x2bae
INCBIN "baserom.gbc", $2bae, $2bed-$2bae
GetMapHeaderPointer: ; 0x2bed GetMapHeaderPointer: ; 0x2bed
; Prior to calling this function, you must have switched banks so that ; Prior to calling this function, you must have switched banks so that
@ -2707,7 +2736,54 @@ BitTableFunc: ; 0x2e76
ret ret
; 0x2ead ; 0x2ead
INCBIN "baserom.gbc", $2ead, $2f8c - $2ead INCBIN "baserom.gbc", $2ead, $2ed3 - $2ead
Function2ed3: ; 0x2ed3
; disables overworld sprite updating?
xor a
ld [$ffde], a
ld a, [VramState]
res 0, a
ld [VramState], a
ld a, $0
ld [$c2ce], a
ret
; 0x2ee4
INCBIN "baserom.gbc", $2ee4, $2ef9 - $2ee4
InitString: ; 0x2ef9
; if the string pointed to by hl is empty (defined as "zero or more spaces
; followed by a null"), then initialize it to the string pointed to by de.
;
; Intended for names, so this function is limited to ten characters.
push hl
ld c, 10
push bc
.loop
ld a, [hli]
cp "@"
jr z, .blank
cp " "
jr nz, .notblank
dec c
jr nz, .loop
.blank
pop bc
ld l, e
ld h, d
pop de
ld b, $0
inc c
call CopyBytes
ret
.notblank
pop bc
pop hl
ret
; 0x2f17
INCBIN "baserom.gbc", $2f17, $2f8c - $2f17
RNG: ; 2f8c RNG: ; 2f8c
; Two random numbers are generated by adding and subtracting ; Two random numbers are generated by adding and subtracting
@ -4623,7 +4699,7 @@ OakSpeech: ; 0x5f99
ld [$d123], a ld [$d123], a
ld [$d124], a ld [$d124], a
ld b, $1c ld b, $1c
call $3340 call GetSGBLayout
call $6182 call $6182
ld hl, OakText2 ld hl, OakText2
call PrintText call PrintText
@ -4637,7 +4713,7 @@ OakSpeech: ; 0x5f99
ld [TrainerClass], a ld [TrainerClass], a
call $619c call $619c
ld b, $1c ld b, $1c
call $3340 call GetSGBLayout
call $616a call $616a
ld hl, OakText5 ld hl, OakText5
call PrintText call PrintText
@ -4649,7 +4725,7 @@ OakSpeech: ; 0x5f99
ld hl, $4874 ld hl, $4874
rst $8 rst $8
ld b, $1c ld b, $1c
call $3340 call GetSGBLayout
call $616a call $616a
ld hl, OakText6 ld hl, OakText6
call PrintText call PrintText
@ -5429,7 +5505,7 @@ SpecialsPointers: ; 0xc029
dbw $0b, $4547 dbw $0b, $4547
dbw $05, $6218 dbw $05, $6218
dbw $23, $4c04 dbw $23, $4c04
dbw $03, $429d dbw BANK(SpecialNameRival), SpecialNameRival
dbw $24, $4913 dbw $24, $4913
dbw $03, $42c0 dbw $03, $42c0
dbw $03, $42cd dbw $03, $42cd
@ -5445,7 +5521,7 @@ SpecialsPointers: ; 0xc029
dbw $23, $4079 dbw $23, $4079
dbw $23, $40ab dbw $23, $40ab
dbw $00, $0d91 dbw $00, $0d91
dbw $00, $31f3 dbw BANK(WhiteBGMap), WhiteBGMap
dbw $00, $0485 dbw $00, $0485
dbw BANK(ClearTileMap), ClearTileMap dbw BANK(ClearTileMap), ClearTileMap
dbw $00, $1ad2 dbw $00, $1ad2
@ -5563,7 +5639,25 @@ SpecialsPointers: ; 0xc029
dbw $24, $4a88 dbw $24, $4a88
dbw $03, $4224 dbw $03, $4224
INCBIN "baserom.gbc", $c224, $c3e2 - $c224 INCBIN "baserom.gbc", $c224, $c29d - $c224
SpecialNameRival: ; 0xc29d
ld b, $2 ; rival
ld de, WRivalName
ld a, BANK(Function116b7)
ld hl, Function116b7
rst $8
; default to "SILVER"
ld hl, WRivalName
ld de, DefaultRivalName
call InitString
ret
; 0xc2b2
DefaultRivalName: ; 0xc2b2
db "SILVER@"
INCBIN "baserom.gbc", $c2b9, $c3e2 - $c2b9
ScriptReturnCarry: ; c3e2 ScriptReturnCarry: ; c3e2
jr c, .carry jr c, .carry
@ -6354,7 +6448,16 @@ TechnicalMachines: ; 0x1167a
db WHIRLPOOL db WHIRLPOOL
db WATERFALL db WATERFALL
INCBIN "baserom.gbc", $116b3, $11ce7 - $116b3 INCBIN "baserom.gbc", $116b3, $116b7 - $116b3
Function116b7: ; 0x116b7
call Function2ed3
call $56c1
call $2b74
ret
; 0x116c1
INCBIN "baserom.gbc", $116c1, $11ce7 - $116c1
NameInputLower: NameInputLower:
db "a b c d e f g h i" db "a b c d e f g h i"
@ -6691,7 +6794,7 @@ OpenPartyMenu: ; $12976
.choosemenu ; 1297f .choosemenu ; 1297f
xor a xor a
ld [PartyMenuActionText], a ; Choose a POKéMON. ld [PartyMenuActionText], a ; Choose a POKéMON.
call $31f3 ; this is also a predef/special, something with delayframe call WhiteBGMap
.menu ; 12986 .menu ; 12986
ld a, $14 ld a, $14
ld hl, $404f ld hl, $404f
@ -6790,7 +6893,7 @@ INCBIN "baserom.gbc", $12aec, $12e00 - $12aec
OpenPartyStats: ; 12e00 OpenPartyStats: ; 12e00
call $1d6e call $1d6e
call $300b call ClearSprites
xor a xor a
ld [MonType], a ; partymon ld [MonType], a ; partymon
call LowVolume call LowVolume
@ -10122,7 +10225,7 @@ StatsScreenInit: ; 4dc8a
ld c, a ld c, a
push bc push bc
push hl push hl
call $31f3 call WhiteBGMap
call ClearTileMap call ClearTileMap
call $1ad2 call $1ad2
ld a, $3e ld a, $3e
@ -10130,7 +10233,7 @@ StatsScreenInit: ; 4dc8a
rst FarCall ; this loads graphics rst FarCall ; this loads graphics
pop hl pop hl
call JpHl call JpHl
call $31f3 call WhiteBGMap
call ClearTileMap call ClearTileMap
pop bc pop bc
; restore old values ; restore old values
@ -10361,7 +10464,7 @@ PartyMenuSelect: ; 0x50457
PrintPartyMenuText: ; 5049a PrintPartyMenuText: ; 5049a
ld hl, $c5b8 ld hl, $c5b8
ld bc, $0212 ld bc, $0212
call $0fe8 ; related to TextBoxBorder call TextBox
ld a, [PartyCount] ld a, [PartyCount]
and a and a
jr nz, .haspokemon jr nz, .haspokemon
@ -11249,7 +11352,7 @@ HallOfFame3: ; 0x8640e
push af push af
ld a, $1 ld a, $1
ld [$c2cd], a ld [$c2cd], a
call $2ed3 call Function2ed3
ld a, $1 ld a, $1
ld [$d4b5], a ld [$d4b5], a
@ -17033,8 +17136,8 @@ Function117a94: ; 0x117a94
ld [$cf64], a ld [$cf64], a
ld [$cf65], a ld [$cf65], a
ld [$cf66], a ld [$cf66], a
call $31f3 call WhiteBGMap
call $300b call ClearSprites
ld a, $5c ld a, $5c
ld hl, $6e78 ld hl, $6e78
rst FarCall rst FarCall
@ -17045,8 +17148,8 @@ Function117a94: ; 0x117a94
; 0x117ab4 ; 0x117ab4
Function117ab4: ; 0x117ab4 Function117ab4: ; 0x117ab4
call $31f3 call WhiteBGMap
call $300b call ClearSprites
ld a, $5c ld a, $5c
ld hl, $6e78 ld hl, $6e78
rst FarCall rst FarCall
@ -17070,8 +17173,8 @@ Function117acd: ; 0x117acd
rst FarCall rst FarCall
jr Function117acd jr Function117acd
.asm_117ae2 .asm_117ae2
call $31f3 call WhiteBGMap
call $300b call ClearSprites
ret ret
Function117ae9: ; 0x117ae9 Function117ae9: ; 0x117ae9
@ -17194,7 +17297,7 @@ Function117bb6:
ld a, $46 ld a, $46
ld hl, $4284 ld hl, $4284
rst FarCall rst FarCall
call $300b call ClearSprites
ld a, [$c300] ld a, [$c300]
and a and a
jr z, .asm_117be7 ; 0x117bca $1b jr z, .asm_117be7 ; 0x117bca $1b

View File

@ -1408,9 +1408,15 @@ PlayerID: ; d47b
ds 2 ds 2
PlayerName: ; d47d PlayerName: ; d47d
ds 11 ds 11
PlayerNameEnd: ; d478 PlayerNameEnd: ; d488
ds 46 ds 11
WRivalName: ; d493
ds 11
WRivalNameEnd: ; d49e
ds 24
; init time set at newgame ; init time set at newgame
StartDay: ; d4b6 StartDay: ; d4b6