2015-10-16 10:35:43 -07:00
|
|
|
SpecialHoOhChamber: ; 0x8addb
|
|
|
|
ld hl, PartySpecies
|
|
|
|
ld a, [hl]
|
|
|
|
cp HO_OH ; is Ho-oh the first Pokémon in the party?
|
|
|
|
jr nz, .done ; if not, we're done
|
|
|
|
call GetSecondaryMapHeaderPointer
|
|
|
|
ld de, EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
; 0x8adef
|
|
|
|
|
|
|
|
SpecialOmanyteChamber: ; 8adef
|
|
|
|
call GetSecondaryMapHeaderPointer
|
|
|
|
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
|
|
|
|
ld b, CHECK_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
jr nz, .nope
|
|
|
|
|
|
|
|
ld a, WATER_STONE
|
|
|
|
ld [CurItem], a
|
|
|
|
ld hl, NumItems
|
|
|
|
call CheckItem
|
|
|
|
jr c, .open
|
|
|
|
|
|
|
|
ld a, [PartyCount]
|
|
|
|
ld b, a
|
|
|
|
inc b
|
|
|
|
.loop
|
|
|
|
dec b
|
|
|
|
jr z, .nope
|
|
|
|
ld a, b
|
|
|
|
dec a
|
|
|
|
ld [CurPartyMon], a
|
|
|
|
push bc
|
2015-11-04 08:19:58 -08:00
|
|
|
ld a, MON_ITEM
|
2015-10-16 10:35:43 -07:00
|
|
|
call GetPartyParamLocation
|
|
|
|
pop bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp WATER_STONE
|
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
.open
|
|
|
|
call GetSecondaryMapHeaderPointer
|
|
|
|
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
|
|
|
|
.nope
|
|
|
|
ret
|
|
|
|
; 8ae30
|
|
|
|
|
|
|
|
SpecialAerodactylChamber: ; 8ae30
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
|
|
|
|
call GetSecondaryMapHeaderPointer
|
|
|
|
ld a, h
|
2017-12-25 10:40:10 -08:00
|
|
|
cp HIGH(RuinsOfAlphAerodactylChamber_SecondMapHeader)
|
2015-10-16 10:35:43 -07:00
|
|
|
jr nz, .nope
|
|
|
|
ld a, l
|
2017-12-25 10:40:10 -08:00
|
|
|
cp LOW(RuinsOfAlphAerodactylChamber_SecondMapHeader)
|
2015-10-16 10:35:43 -07:00
|
|
|
jr nz, .nope
|
|
|
|
|
|
|
|
ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
|
|
|
|
scf
|
|
|
|
jr .done
|
|
|
|
|
|
|
|
.nope
|
|
|
|
and a
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
; 8ae4e
|
|
|
|
|
|
|
|
SpecialKabutoChamber: ; 8ae4e
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
|
|
|
|
call GetSecondaryMapHeaderPointer
|
|
|
|
ld a, h
|
2017-12-25 10:40:10 -08:00
|
|
|
cp HIGH(RuinsOfAlphKabutoChamber_SecondMapHeader)
|
2015-10-16 10:35:43 -07:00
|
|
|
jr nz, .done
|
|
|
|
ld a, l
|
2017-12-25 10:40:10 -08:00
|
|
|
cp LOW(RuinsOfAlphKabutoChamber_SecondMapHeader)
|
2015-10-16 10:35:43 -07:00
|
|
|
jr nz, .done
|
|
|
|
|
|
|
|
ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 8ae68
|
|
|
|
|
|
|
|
Special_DisplayUnownWords: ; 8ae68
|
|
|
|
ld a, [ScriptVar]
|
2016-04-30 18:20:12 -07:00
|
|
|
ld hl, .MenuDataHeader_Escape
|
2015-10-16 10:35:43 -07:00
|
|
|
and a
|
2016-04-30 18:20:12 -07:00
|
|
|
jr z, .load
|
2015-10-16 10:35:43 -07:00
|
|
|
|
|
|
|
ld d, $0
|
|
|
|
ld e, $5
|
2016-04-30 18:20:12 -07:00
|
|
|
.loop
|
2015-10-16 10:35:43 -07:00
|
|
|
add hl, de
|
|
|
|
dec a
|
2016-04-30 18:20:12 -07:00
|
|
|
jr nz, .loop
|
2015-10-16 10:35:43 -07:00
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.load
|
2015-10-16 10:35:43 -07:00
|
|
|
call LoadMenuDataHeader
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
2015-11-04 11:02:11 -08:00
|
|
|
call MenuBox
|
2015-10-16 10:35:43 -07:00
|
|
|
call UpdateSprites
|
2015-11-25 07:16:29 -08:00
|
|
|
call ApplyTilemap
|
2015-11-10 13:53:37 -08:00
|
|
|
call MenuBoxCoord2Tile
|
2015-10-16 10:35:43 -07:00
|
|
|
inc hl
|
2016-04-30 18:20:12 -07:00
|
|
|
ld d, 0
|
|
|
|
ld e, SCREEN_WIDTH
|
|
|
|
add hl, de
|
2015-10-16 10:35:43 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [ScriptVar]
|
|
|
|
ld c, a
|
2016-04-30 18:20:12 -07:00
|
|
|
ld de, .UnownText
|
2015-10-16 10:35:43 -07:00
|
|
|
and a
|
2016-04-30 18:20:12 -07:00
|
|
|
jr z, .copy
|
|
|
|
.loop2
|
2015-10-16 10:35:43 -07:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
cp $ff
|
2016-04-30 18:20:12 -07:00
|
|
|
jr nz, .loop2
|
2015-10-16 10:35:43 -07:00
|
|
|
dec c
|
2016-04-30 18:20:12 -07:00
|
|
|
jr nz, .loop2
|
|
|
|
.copy
|
|
|
|
call .CopyWord
|
2015-10-16 10:35:43 -07:00
|
|
|
ld bc, AttrMap - TileMap
|
|
|
|
add hl, bc
|
2016-04-30 18:20:12 -07:00
|
|
|
call .FillAttr
|
2015-12-11 13:59:40 -08:00
|
|
|
call WaitBGMap2
|
2015-10-17 09:58:26 -07:00
|
|
|
call JoyWaitAorB
|
2015-10-16 10:35:43 -07:00
|
|
|
call PlayClickSFX
|
2015-12-24 19:58:42 -08:00
|
|
|
call CloseWindow
|
2015-10-16 10:35:43 -07:00
|
|
|
ret
|
|
|
|
; 8aebc
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.UnownText: ; 8aebc
|
|
|
|
|
|
|
|
unownwall: MACRO
|
|
|
|
rept _NARG
|
|
|
|
if \1 == "-"
|
|
|
|
x = $64
|
|
|
|
else
|
|
|
|
if \1 >= "Y"
|
|
|
|
x = 2 * (\1 - "Y") + $60
|
|
|
|
else
|
|
|
|
if \1 >= "Q"
|
|
|
|
x = 2 * (\1 - "Q") + $40
|
|
|
|
else
|
|
|
|
if \1 >= "I"
|
|
|
|
x = 2 * (\1 - "I") + $20
|
|
|
|
else
|
|
|
|
x = 2 * (\1 - "A")
|
|
|
|
endc
|
|
|
|
endc
|
|
|
|
endc
|
|
|
|
endc
|
|
|
|
db x
|
|
|
|
shift
|
|
|
|
endr
|
|
|
|
db $ff
|
|
|
|
endm
|
|
|
|
|
|
|
|
.UnownText_Escape:
|
|
|
|
; db $08, $44, $04, $00, $2e, $08, $ff
|
|
|
|
unownwall "E", "S", "C", "A", "P", "E"
|
|
|
|
.UnownText_Light:
|
|
|
|
; db $26, $20, $0c, $0e, $46, $ff
|
|
|
|
unownwall "L", "I", "G", "H", "T"
|
|
|
|
.UnownText_Water:
|
|
|
|
; db $4c, $00, $46, $08, $42, $ff
|
|
|
|
unownwall "W", "A", "T", "E", "R"
|
|
|
|
.UnownText_Ho_Oh:
|
|
|
|
; db $0e, $2c, $64, $2c, $0e, $ff
|
|
|
|
unownwall "H", "O", "-", "O", "H"
|
2015-10-16 10:35:43 -07:00
|
|
|
; 8aed5
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.MenuDataHeader_Escape: ; 0x8aed5
|
2015-10-16 10:35:43 -07:00
|
|
|
db $40 ; flags
|
|
|
|
db 04, 03 ; start coords
|
|
|
|
db 09, 16 ; end coords
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.MenuDataHeader_Light: ; 0x8aeda
|
2015-10-16 10:35:43 -07:00
|
|
|
db $40 ; flags
|
|
|
|
db 04, 04 ; start coords
|
|
|
|
db 09, 15 ; end coords
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.MenuDataHeader_Water: ; 0x8aedf
|
2015-10-16 10:35:43 -07:00
|
|
|
db $40 ; flags
|
|
|
|
db 04, 04 ; start coords
|
|
|
|
db 09, 15 ; end coords
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.MenuDataHeader_Ho_Oh: ; 0x8aee4
|
2015-10-16 10:35:43 -07:00
|
|
|
db $40 ; flags
|
|
|
|
db 04, 04 ; start coords
|
|
|
|
db 09, 15 ; end coords
|
|
|
|
; 8aee9
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.FillAttr: ; 8aee9
|
2015-10-16 10:35:43 -07:00
|
|
|
ld a, [de]
|
|
|
|
cp $ff
|
|
|
|
ret z
|
|
|
|
cp $60
|
2017-12-10 17:50:08 -08:00
|
|
|
ld a, VRAM_BANK_1 | PAL_BG_BROWN
|
2016-04-30 18:20:12 -07:00
|
|
|
jr c, .got_pal
|
|
|
|
ld a, PAL_BG_BROWN
|
2015-10-16 10:35:43 -07:00
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.got_pal
|
|
|
|
call .PlaceSquare
|
|
|
|
inc hl
|
2015-10-16 10:35:43 -07:00
|
|
|
inc hl
|
|
|
|
inc de
|
2016-04-30 18:20:12 -07:00
|
|
|
jr .FillAttr
|
2015-10-16 10:35:43 -07:00
|
|
|
; 8aefd
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.PlaceSquare: ; 8aefd
|
2015-10-16 10:35:43 -07:00
|
|
|
push hl
|
|
|
|
ld [hli], a
|
|
|
|
ld [hld], a
|
2016-04-30 18:20:12 -07:00
|
|
|
ld b, 0
|
|
|
|
ld c, SCREEN_WIDTH
|
2015-10-16 10:35:43 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 8af09
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.CopyWord: ; 8af09
|
2015-10-16 10:35:43 -07:00
|
|
|
push hl
|
|
|
|
push de
|
2016-04-30 18:20:12 -07:00
|
|
|
.word_loop
|
2015-10-16 10:35:43 -07:00
|
|
|
ld a, [de]
|
|
|
|
cp $ff
|
2016-04-30 18:20:12 -07:00
|
|
|
jr z, .word_done
|
2015-10-16 10:35:43 -07:00
|
|
|
ld c, a
|
2016-04-30 18:20:12 -07:00
|
|
|
call .ConvertChar
|
|
|
|
inc hl
|
2015-10-16 10:35:43 -07:00
|
|
|
inc hl
|
|
|
|
inc de
|
2016-04-30 18:20:12 -07:00
|
|
|
jr .word_loop
|
2015-10-16 10:35:43 -07:00
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.word_done
|
2015-10-16 10:35:43 -07:00
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 8af1c
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.ConvertChar: ; 8af1c
|
2015-10-16 10:35:43 -07:00
|
|
|
push hl
|
|
|
|
ld a, c
|
|
|
|
cp $60
|
2016-04-30 18:20:12 -07:00
|
|
|
jr z, .Tile60
|
2015-10-16 10:35:43 -07:00
|
|
|
cp $62
|
2016-04-30 18:20:12 -07:00
|
|
|
jr z, .Tile62
|
2015-10-16 10:35:43 -07:00
|
|
|
cp $64
|
2016-04-30 18:20:12 -07:00
|
|
|
jr z, .Tile64
|
2015-10-16 10:35:43 -07:00
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
ld [hld], a
|
|
|
|
dec a
|
2016-04-30 18:20:12 -07:00
|
|
|
ld b, 0
|
|
|
|
ld c, SCREEN_WIDTH
|
2015-10-16 10:35:43 -07:00
|
|
|
add hl, bc
|
|
|
|
ld c, $10
|
|
|
|
add c
|
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.Tile60:
|
2015-10-16 10:35:43 -07:00
|
|
|
ld [hl], $5b
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5c
|
2016-04-30 18:20:12 -07:00
|
|
|
ld bc, SCREEN_WIDTH - 1
|
2015-10-16 10:35:43 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $4d
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5d
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.Tile62:
|
2015-10-16 10:35:43 -07:00
|
|
|
ld [hl], $4e
|
|
|
|
inc hl
|
|
|
|
ld [hl], $4f
|
2016-04-30 18:20:12 -07:00
|
|
|
ld bc, SCREEN_WIDTH - 1
|
2015-10-16 10:35:43 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $5e
|
|
|
|
inc hl
|
|
|
|
ld [hl], $5f
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2016-04-30 18:20:12 -07:00
|
|
|
.Tile64:
|
2015-10-16 10:35:43 -07:00
|
|
|
ld [hl], $2
|
|
|
|
inc hl
|
|
|
|
ld [hl], $3
|
2016-04-30 18:20:12 -07:00
|
|
|
ld bc, SCREEN_WIDTH - 1
|
2015-10-16 10:35:43 -07:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $3
|
|
|
|
inc hl
|
|
|
|
ld [hl], $2
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 8af6b
|