This commit is contained in:
PikalaxALT
2016-01-10 17:44:09 -05:00
parent 8360a1a2e8
commit 3dcbe0ff55
21 changed files with 1455 additions and 1318 deletions

View File

@@ -109,7 +109,7 @@ endr
.spawn_object
depixel 6, 3, 4, 4
ld a, SPRITE_ANIM_INDEX_0C
ld a, SPRITE_ANIM_INDEX_COMPOSE_MAIL_CURSOR
call _InitSpriteAnimStruct
ld a, 5
ld [wDummyGameNumberTriesRemaining], a

View File

@@ -454,7 +454,7 @@ DoMapTrigger: ; 968ec
ld h, [hl]
ld l, a
rept 4
add hl,de
add hl, de
endr
call GetMapScriptHeaderBank
@@ -1031,7 +1031,7 @@ DoPlayerEvent: ; 96beb
ld b, 0
ld hl, PlayerEventScriptPointers
rept 3
add hl,bc
add hl, bc
endr
ld a, [hli]
ld [ScriptBank], a

View File

@@ -19,7 +19,7 @@ HealMachineAnim: ; 12324
.DoJumptableFunctions: ; 1233e
xor a
ld [wd1ec], a
ld [Buffer3], a
.jumpable_loop
ld a, [Buffer1]
ld e, a
@@ -31,10 +31,10 @@ endr
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wd1ec]
ld a, [Buffer3]
ld e, a
inc a
ld [wd1ec], a
ld [Buffer3], a
add hl, de
ld a, [hl]
cp 5
@@ -81,14 +81,14 @@ endr
.PC_LoadBallsOntoMachine: ; 12393
ld hl, Sprites + $80
ld de, .PC_ElmsLab_TileMap
ld de, .PC_ElmsLab_OAM
call .PlaceHealingMachineTile
call .PlaceHealingMachineTile
jr .LoadBallsOntoMachine
.HOF_LoadBallsOntoMachine: ; 123a1
ld hl, Sprites + $80
ld de, .HOF_TileMap
ld de, .HOF_OAM
.LoadBallsOntoMachine: ; 123a7
ld a, [PartyCount]
@@ -126,28 +126,28 @@ endr
ret
; 123dc
.PC_ElmsLab_TileMap: ; 123dc
db $20, $22, $7c, $16
db $20, $26, $7c, $16
db $26, $20, $7d, $16
db $26, $28, $7d, $36
db $2b, $20, $7d, $16
db $2b, $28, $7d, $36
db $30, $20, $7d, $16
db $30, $28, $7d, $36
.PC_ElmsLab_OAM: ; 123dc
dsprite 4, 0, 4, 2, $7c, $16
dsprite 4, 0, 4, 6, $7c, $16
dsprite 4, 6, 4, 0, $7d, $16
dsprite 4, 6, 5, 0, $7d, $36 ; xflip
dsprite 5, 3, 4, 0, $7d, $16
dsprite 5, 3, 5, 0, $7d, $36 ; xflip
dsprite 6, 0, 4, 0, $7d, $16
dsprite 6, 0, 5, 0, $7d, $36 ; xflip
; 123fc
.HealMachineGFX: ; 123fc
INCBIN "gfx/unknown/0123fc.2bpp"
; 1241c
.HOF_TileMap: ; 1241c
db $3c, $51, $7d, $16
db $3c, $56, $7d, $16
db $3b, $4d, $7d, $16
db $3b, $5a, $7d, $16
db $39, $49, $7d, $16
db $39, $5d, $7d, $16
.HOF_OAM: ; 1241c
dsprite 7, 4, 10, 1, $7d, $16
dsprite 7, 4, 10, 6, $7d, $16
dsprite 7, 3, 9, 5, $7d, $16
dsprite 7, 3, 11, 2, $7d, $16
dsprite 7, 1, 9, 1, $7d, $16
dsprite 7, 1, 11, 5, $7d, $16
; 12434
.LoadPalettes: ; 12434
@@ -241,10 +241,10 @@ endr
.PlaceHealingMachineTile: ; 124a3
push bc
ld a, [Buffer1]
lb bc, $10, $20
bcpixel 2, 4
cp $1 ; ElmsLab
jr z, .okay
lb bc, $00, $00
bcpixel 0, 0
.okay
ld a, [de]

File diff suppressed because it is too large Load Diff

219
engine/prof_oaks_pc.asm Executable file
View File

@@ -0,0 +1,219 @@
ProfOaksPC: ; 0x265d3
ld hl, OakPCText1
call MenuTextBox
call YesNoBox
jr c, .shutdown
call ProfOaksPCBoot ; player chose "yes"?
.shutdown
ld hl, OakPCText4
call PrintText
call JoyWaitAorB
call ExitMenu
ret
ProfOaksPCBoot ; 0x265ee
ld hl, OakPCText2
call PrintText
call Rate
call PlaySFX ; sfx loaded by previous Rate function call
call JoyWaitAorB
call WaitSFX
ret
ProfOaksPCRating: ; 0x26601
call Rate
push de
ld de, MUSIC_NONE
call PlayMusic
pop de
call PlaySFX
call JoyWaitAorB
call WaitSFX
ret
Rate: ; 0x26616
; calculate Seen/Owned
ld hl, PokedexSeen
ld b, EndPokedexSeen - PokedexSeen
call CountSetBits
ld [wd002], a
ld hl, PokedexCaught
ld b, EndPokedexCaught - PokedexCaught
call CountSetBits
ld [wd003], a
; print appropriate rating
call .UpdateRatingBuffers
ld hl, OakPCText3
call PrintText
call JoyWaitAorB
ld a, [wd003]
ld hl, OakRatings
call FindOakRating
push de
call PrintText
pop de
ret
.UpdateRatingBuffers: ; 0x26647
ld hl, StringBuffer3
ld de, wd002
call .UpdateRatingBuffer
ld hl, StringBuffer4
ld de, wd003
call .UpdateRatingBuffer
ret
.UpdateRatingBuffer: ; 0x2665a
push hl
ld a, "@"
ld bc, ITEM_NAME_LENGTH
call ByteFill
pop hl
lb bc, PRINTNUM_RIGHTALIGN | 1, 3
call PrintNum
ret
FindOakRating: ; 0x2666b
; return sound effect in de
; return text pointer in hl
nop
ld c, a
.loop
ld a, [hli]
cp c
jr nc, .match
rept 4
inc hl
endr
jr .loop
.match
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld a, [hli]
ld h, [hl]
ld l, a
ret
OakRatings: ; 0x2667f
oakrating: MACRO
db \1
dw \2, \3
endm
; if you caught at most this many, play this sound, load this text
oakrating 9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01
oakrating 19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02
oakrating 34, SFX_DEX_FANFARE_20_49, OakRating03
oakrating 49, SFX_DEX_FANFARE_20_49, OakRating04
oakrating 64, SFX_DEX_FANFARE_50_79, OakRating05
oakrating 79, SFX_DEX_FANFARE_50_79, OakRating06
oakrating 94, SFX_DEX_FANFARE_80_109, OakRating07
oakrating 109, SFX_DEX_FANFARE_80_109, OakRating08
oakrating 124, SFX_CAUGHT_MON, OakRating09
oakrating 139, SFX_CAUGHT_MON, OakRating10
oakrating 154, SFX_DEX_FANFARE_140_169, OakRating11
oakrating 169, SFX_DEX_FANFARE_140_169, OakRating12
oakrating 184, SFX_DEX_FANFARE_170_199, OakRating13
oakrating 199, SFX_DEX_FANFARE_170_199, OakRating14
oakrating 214, SFX_DEX_FANFARE_200_229, OakRating15
oakrating 229, SFX_DEX_FANFARE_200_229, OakRating16
oakrating 239, SFX_DEX_FANFARE_230_PLUS, OakRating17
oakrating 248, SFX_DEX_FANFARE_230_PLUS, OakRating18
oakrating 255, SFX_DEX_FANFARE_230_PLUS, OakRating19
OakPCText1: ; 0x266de
text_jump _OakPCText1
db "@"
OakPCText2: ; 0x266e3
text_jump _OakPCText2
db "@"
OakPCText3: ; 0x266e8
text_jump _OakPCText3
db "@"
OakRating01:
text_jump _OakRating01
db "@"
OakRating02:
text_jump _OakRating02
db "@"
OakRating03:
text_jump _OakRating03
db "@"
OakRating04:
text_jump _OakRating04
db "@"
OakRating05:
text_jump _OakRating05
db "@"
OakRating06:
text_jump _OakRating06
db "@"
OakRating07:
text_jump _OakRating07
db "@"
OakRating08:
text_jump _OakRating08
db "@"
OakRating09:
text_jump _OakRating09
db "@"
OakRating10:
text_jump _OakRating10
db "@"
OakRating11:
text_jump _OakRating11
db "@"
OakRating12:
text_jump _OakRating12
db "@"
OakRating13:
text_jump _OakRating13
db "@"
OakRating14:
text_jump _OakRating14
db "@"
OakRating15:
text_jump _OakRating15
db "@"
OakRating16:
text_jump _OakRating16
db "@"
OakRating17:
text_jump _OakRating17
db "@"
OakRating18:
text_jump _OakRating18
db "@"
OakRating19:
text_jump _OakRating19
db "@"
OakPCText4: ; 0x2674c
text_jump _OakPCText4
db "@"

View File

@@ -19,14 +19,14 @@ DoAnimFrame: ; 8d24b
dw .two ; bouncing mon icon, selected
dw .three ; bouncing mon icon, menu open
dw .four
dw .five
dw .namingscreencursor
dw .GameFreakLogo ; Game Freak logo
dw .seven
dw .eight
dw .SlotsGolem ; Something to do with slots
dw .SlotsChansey ; Something to do with slots
dw .SlotsChanseyEgg ; Something to do with slots
dw .twelve ; blinking cursor
dw .mailcompositioncursor ; blinking cursor
dw .thirteen
dw .fourteen
dw .fifteen
@@ -217,11 +217,11 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
.five: ; 8d36c (23:536c)
.namingscreencursor: ; 8d36c (23:536c)
callab NamingScreen_AnimateCursor
ret
.twelve: ; 8d373 (23:5373)
.mailcompositioncursor: ; 8d373 (23:5373)
callab ComposeMail_AnimateCursor
ret
@@ -409,7 +409,7 @@ DoAnimFrame: ; 8d24b
ret
.fifteen: ; 8d475 (23:5475)
callab Function90d41
callab AnimatePokegearModeIndicatorArrow
ret
.fourteen: ; 8d47c (23:547c)

View File

@@ -393,7 +393,7 @@ endr
ld hl, StatusFlags2
bit 2, [hl] ; bug catching contest
ret z
callba Function24bdc
callba StartMenu_DrawBugContestStatusBox
ret
; 128de
@@ -403,7 +403,7 @@ endr
jr nz, .contest
ret
.contest
callba Function24be7
callba StartMenu_PrintBugContestStatus
ret
; 128ed

View File

@@ -200,11 +200,9 @@ CheckPokerusTick:: ; 114e7
call CalcDaysSince
call GetDaysSince
and a
jr z, .done
jr z, .done ; not even a day has passed since game start
ld b, a
callba ApplyPokerusTick
.done
xor a
ret
@@ -229,13 +227,13 @@ CheckUnusedTwoDayTimer: ; 1150c
ret
; 1151c
Function1151c: ; unreferenced
; XXX
ld hl, DailyFlags
set 2, [hl]
ret
; 11522
Function11522: ; unreferenced
; XXX
and a
ld hl, DailyFlags
bit 2, [hl]