You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Merge pull request #503 from Rangi42/master
Factor wMisc into meaningful parts; move most code out of home.asm
This commit is contained in:
@@ -1081,7 +1081,7 @@ HandleNoise: ; e858c
|
|||||||
ret z
|
ret z
|
||||||
; are we in a sfx channel?
|
; are we in a sfx channel?
|
||||||
ld a, [wCurChannel]
|
ld a, [wCurChannel]
|
||||||
bit 2, a ; sfx
|
bit NOISE_CHAN_F, a
|
||||||
jr nz, .next
|
jr nz, .next
|
||||||
; is ch8 on? (noise)
|
; is ch8 on? (noise)
|
||||||
ld hl, wChannel8Flags
|
ld hl, wChannel8Flags
|
||||||
@@ -1330,7 +1330,7 @@ GetNoiseSample: ; e86c5
|
|||||||
call SetNoteDuration
|
call SetNoteDuration
|
||||||
; check current channel
|
; check current channel
|
||||||
ld a, [wCurChannel]
|
ld a, [wCurChannel]
|
||||||
bit 2, a ; are we in a sfx channel?
|
bit NOISE_CHAN_F, a
|
||||||
jr nz, .sfx
|
jr nz, .sfx
|
||||||
ld hl, wChannel8Flags
|
ld hl, wChannel8Flags
|
||||||
bit SOUND_CHANNEL_ON, [hl] ; is ch8 on? (noise)
|
bit SOUND_CHANNEL_ON, [hl] ; is ch8 on? (noise)
|
||||||
|
@@ -31,6 +31,8 @@ NUM_NOISE_CHANS EQU const_value
|
|||||||
const CHAN8 ; 7
|
const CHAN8 ; 7
|
||||||
NUM_CHANNELS EQU const_value
|
NUM_CHANNELS EQU const_value
|
||||||
|
|
||||||
|
NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7
|
||||||
|
|
||||||
; Flags1
|
; Flags1
|
||||||
const_def
|
const_def
|
||||||
const SOUND_CHANNEL_ON ; 0
|
const SOUND_CHANNEL_ON ; 0
|
||||||
|
@@ -157,7 +157,7 @@ SLP EQU %111 ; 0-7 turns
|
|||||||
const FRZ
|
const FRZ
|
||||||
const PAR
|
const PAR
|
||||||
|
|
||||||
ALL_STATUS EQU (1 << PSN) + (1 << BRN) + (1 << FRZ) + (1 << PAR) + SLP
|
ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP
|
||||||
|
|
||||||
; wPlayerSubStatus1 or wEnemySubStatus1 bit flags
|
; wPlayerSubStatus1 or wEnemySubStatus1 bit flags
|
||||||
enum_start 7, -1
|
enum_start 7, -1
|
||||||
@@ -248,3 +248,7 @@ SUBSTATUS_CURLED EQU 0
|
|||||||
const WIN
|
const WIN
|
||||||
const LOSE
|
const LOSE
|
||||||
const DRAW
|
const DRAW
|
||||||
|
|
||||||
|
BATTLERESULT_CAUGHT_CELEBI EQU 6
|
||||||
|
BATTLERESULT_BOX_FULL EQU 7
|
||||||
|
BATTLERESULT_BITMASK EQU (1 << BATTLERESULT_CAUGHT_CELEBI) | (1 << BATTLERESULT_BOX_FULL)
|
||||||
|
@@ -16,8 +16,12 @@ SCREEN_HEIGHT_PX EQU SCREEN_HEIGHT * TILE_WIDTH ; pixels
|
|||||||
|
|
||||||
BG_MAP_WIDTH EQU 32 ; tiles
|
BG_MAP_WIDTH EQU 32 ; tiles
|
||||||
BG_MAP_HEIGHT EQU 32 ; tiles
|
BG_MAP_HEIGHT EQU 32 ; tiles
|
||||||
WMISC_WIDTH EQU 6 * 4
|
|
||||||
WMISC_HEIGHT EQU 5 * 4
|
METATILE_WIDTH EQU 4 ; tiles
|
||||||
|
SCREEN_META_WIDTH EQU 6 ; metatiles
|
||||||
|
SCREEN_META_HEIGHT EQU 5 ; metatiles
|
||||||
|
SURROUNDING_WIDTH EQU SCREEN_META_WIDTH * METATILE_WIDTH ; tiles
|
||||||
|
SURROUNDING_HEIGHT EQU SCREEN_META_HEIGHT * METATILE_WIDTH ; tiles
|
||||||
|
|
||||||
|
|
||||||
HP_BAR_LENGTH EQU 6 ; tiles
|
HP_BAR_LENGTH EQU 6 ; tiles
|
||||||
|
@@ -15,11 +15,15 @@ ENDM
|
|||||||
|
|
||||||
; map group ids
|
; map group ids
|
||||||
; `newgroup` indexes are for:
|
; `newgroup` indexes are for:
|
||||||
; - MapGroupPointers (see data/maps/definitions.asm)
|
; - MapGroupPointers (see data/maps/maps.asm)
|
||||||
; - MapGroupRoofs (see data/maps/roofs.asm)
|
; - MapGroupRoofs (see data/maps/roofs.asm)
|
||||||
; - OutdoorSprites (see data/maps/outdoor_sprites.asm)
|
; - OutdoorSprites (see data/maps/outdoor_sprites.asm)
|
||||||
; - RoofPals (see gfx/tilesets/roofs.pal)
|
; - RoofPals (see gfx/tilesets/roofs.pal)
|
||||||
; `map_const` indexes are for the sub-tables of MapGroupPointers (see data/maps/definitions.asm)
|
; `map_const` indexes are for the sub-tables of MapGroupPointers (see data/maps/maps.asm)
|
||||||
|
; Each map also has associated data:
|
||||||
|
; - attributes (see data/maps/attributes.asm)
|
||||||
|
; - blocks (see data/maps/blocks.asm)
|
||||||
|
; - scripts and events (see data/maps/scripts.asm)
|
||||||
const_def
|
const_def
|
||||||
|
|
||||||
newgroup ; 1
|
newgroup ; 1
|
||||||
|
@@ -2,20 +2,14 @@ unownwall: MACRO
|
|||||||
rept _NARG
|
rept _NARG
|
||||||
if \1 == "-"
|
if \1 == "-"
|
||||||
x = $64
|
x = $64
|
||||||
else
|
elif \1 >= "Y"
|
||||||
if \1 >= "Y"
|
|
||||||
x = 2 * (\1 - "Y") + $60
|
x = 2 * (\1 - "Y") + $60
|
||||||
else
|
elif \1 >= "Q"
|
||||||
if \1 >= "Q"
|
|
||||||
x = 2 * (\1 - "Q") + $40
|
x = 2 * (\1 - "Q") + $40
|
||||||
else
|
elif \1 >= "I"
|
||||||
if \1 >= "I"
|
|
||||||
x = 2 * (\1 - "I") + $20
|
x = 2 * (\1 - "I") + $20
|
||||||
else
|
else
|
||||||
x = 2 * (\1 - "A")
|
x = 2 * (\1 - "A")
|
||||||
endc
|
|
||||||
endc
|
|
||||||
endc
|
|
||||||
endc
|
endc
|
||||||
db x
|
db x
|
||||||
shift
|
shift
|
||||||
@@ -25,16 +19,16 @@ ENDM
|
|||||||
|
|
||||||
UnownWalls: ; 8aebc
|
UnownWalls: ; 8aebc
|
||||||
; UNOWNWORDS_ESCAPE
|
; UNOWNWORDS_ESCAPE
|
||||||
; db $08, $44, $04, $00, $2e, $08, $ff
|
; db $08, $44, $04, $00, $2e, $08, -1
|
||||||
unownwall "E", "S", "C", "A", "P", "E"
|
unownwall "E", "S", "C", "A", "P", "E"
|
||||||
; UNOWNWORDS_LIGHT
|
; UNOWNWORDS_LIGHT
|
||||||
; db $26, $20, $0c, $0e, $46, $ff
|
; db $26, $20, $0c, $0e, $46, -1
|
||||||
unownwall "L", "I", "G", "H", "T"
|
unownwall "L", "I", "G", "H", "T"
|
||||||
; UNOWNWORDS_WATER
|
; UNOWNWORDS_WATER
|
||||||
; db $4c, $00, $46, $08, $42, $ff
|
; db $4c, $00, $46, $08, $42, -1
|
||||||
unownwall "W", "A", "T", "E", "R"
|
unownwall "W", "A", "T", "E", "R"
|
||||||
; UNOWNWORDS_HO_OH
|
; UNOWNWORDS_HO_OH
|
||||||
; db $0e, $2c, $64, $2c, $0e, $ff
|
; db $0e, $2c, $64, $2c, $0e, -1
|
||||||
unownwall "H", "O", "-", "O", "H"
|
unownwall "H", "O", "-", "O", "H"
|
||||||
; 8aed5
|
; 8aed5
|
||||||
|
|
||||||
|
@@ -27,39 +27,39 @@ connection: MACRO
|
|||||||
if "\1" == "north"
|
if "\1" == "north"
|
||||||
map_id \3
|
map_id \3
|
||||||
dw \2_Blocks + \3_WIDTH * (\3_HEIGHT - 3) + \5
|
dw \2_Blocks + \3_WIDTH * (\3_HEIGHT - 3) + \5
|
||||||
dw wOverworldMap + \4 + 3
|
dw wOverworldMapBlocks + \4 + 3
|
||||||
db \6
|
db \6
|
||||||
db \3_WIDTH
|
db \3_WIDTH
|
||||||
db \3_HEIGHT * 2 - 1
|
db \3_HEIGHT * 2 - 1
|
||||||
db (\4 - \5) * -2
|
db (\4 - \5) * -2
|
||||||
dw wOverworldMap + \3_HEIGHT * (\3_WIDTH + 6) + 1
|
dw wOverworldMapBlocks + \3_HEIGHT * (\3_WIDTH + 6) + 1
|
||||||
elif "\1" == "south"
|
elif "\1" == "south"
|
||||||
map_id \3
|
map_id \3
|
||||||
dw \2_Blocks + \5
|
dw \2_Blocks + \5
|
||||||
dw wOverworldMap + (CURRENT_MAP_HEIGHT + 3) * (CURRENT_MAP_WIDTH + 6) + \4 + 3
|
dw wOverworldMapBlocks + (CURRENT_MAP_HEIGHT + 3) * (CURRENT_MAP_WIDTH + 6) + \4 + 3
|
||||||
db \6
|
db \6
|
||||||
db \3_WIDTH
|
db \3_WIDTH
|
||||||
db 0
|
db 0
|
||||||
db (\4 - \5) * -2
|
db (\4 - \5) * -2
|
||||||
dw wOverworldMap + \3_WIDTH + 7
|
dw wOverworldMapBlocks + \3_WIDTH + 7
|
||||||
elif "\1" == "west"
|
elif "\1" == "west"
|
||||||
map_id \3
|
map_id \3
|
||||||
dw \2_Blocks + (\3_WIDTH * \5) + \3_WIDTH - 3
|
dw \2_Blocks + (\3_WIDTH * \5) + \3_WIDTH - 3
|
||||||
dw wOverworldMap + (CURRENT_MAP_WIDTH + 6) * (\4 + 3)
|
dw wOverworldMapBlocks + (CURRENT_MAP_WIDTH + 6) * (\4 + 3)
|
||||||
db \6
|
db \6
|
||||||
db \3_WIDTH
|
db \3_WIDTH
|
||||||
db (\4 - \5) * -2
|
db (\4 - \5) * -2
|
||||||
db \3_WIDTH * 2 - 1
|
db \3_WIDTH * 2 - 1
|
||||||
dw wOverworldMap + \3_WIDTH * 2 + 6
|
dw wOverworldMapBlocks + \3_WIDTH * 2 + 6
|
||||||
elif "\1" == "east"
|
elif "\1" == "east"
|
||||||
map_id \3
|
map_id \3
|
||||||
dw \2_Blocks + (\3_WIDTH * \5)
|
dw \2_Blocks + (\3_WIDTH * \5)
|
||||||
dw wOverworldMap + (CURRENT_MAP_WIDTH + 6) * (\4 + 3 + 1) - 3
|
dw wOverworldMapBlocks + (CURRENT_MAP_WIDTH + 6) * (\4 + 3 + 1) - 3
|
||||||
db \6
|
db \6
|
||||||
db \3_WIDTH
|
db \3_WIDTH
|
||||||
db (\4 - \5) * -2
|
db (\4 - \5) * -2
|
||||||
db 0
|
db 0
|
||||||
dw wOverworldMap + \3_WIDTH + 7
|
dw wOverworldMapBlocks + \3_WIDTH + 7
|
||||||
endc
|
endc
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
@@ -949,18 +949,18 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
|||||||
add 3
|
add 3
|
||||||
ld hl, wEnemyMonLevel
|
ld hl, wEnemyMonLevel
|
||||||
cp [hl]
|
cp [hl]
|
||||||
jr nc, .okay
|
jr nc, .not_stronger
|
||||||
set 0, e
|
set TRANS_STRONGER_F, e
|
||||||
.okay
|
.not_stronger
|
||||||
ld a, [wEnvironment]
|
ld a, [wEnvironment]
|
||||||
cp CAVE
|
cp CAVE
|
||||||
jr z, .okay2
|
jr z, .cave
|
||||||
cp ENVIRONMENT_5
|
cp ENVIRONMENT_5
|
||||||
jr z, .okay2
|
jr z, .cave
|
||||||
cp DUNGEON
|
cp DUNGEON
|
||||||
jr z, .okay2
|
jr z, .cave
|
||||||
set 1, e
|
set TRANS_NO_CAVE_F, e
|
||||||
.okay2
|
.cave
|
||||||
ld hl, .StartingPoints
|
ld hl, .StartingPoints
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@@ -969,8 +969,11 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
|||||||
; 8c38f (23:438f)
|
; 8c38f (23:438f)
|
||||||
|
|
||||||
.StartingPoints: ; 8c38f
|
.StartingPoints: ; 8c38f
|
||||||
db 1, 9
|
; entries correspond to TRANS_* constants
|
||||||
db 16, 24
|
db BATTLETRANSITION_CAVE
|
||||||
|
db BATTLETRANSITION_CAVE_STRONGER
|
||||||
|
db BATTLETRANSITION_NO_CAVE
|
||||||
|
db BATTLETRANSITION_NO_CAVE_STRONGER
|
||||||
; 8c393
|
; 8c393
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
; BattleTransitionJumptable.Jumptable indexes
|
||||||
|
BATTLETRANSITION_CAVE EQU $01
|
||||||
|
BATTLETRANSITION_CAVE_STRONGER EQU $09
|
||||||
|
BATTLETRANSITION_NO_CAVE EQU $10
|
||||||
|
BATTLETRANSITION_NO_CAVE_STRONGER EQU $18
|
||||||
|
BATTLETRANSITION_FINISH EQU $20
|
||||||
|
BATTLETRANSITION_END EQU $80
|
||||||
|
|
||||||
DoBattleTransition: ; 8c20f
|
DoBattleTransition: ; 8c20f
|
||||||
call .InitGFX
|
call .InitGFX
|
||||||
ld a, [rBGP]
|
ld a, [rBGP]
|
||||||
@@ -14,7 +22,7 @@ DoBattleTransition: ; 8c20f
|
|||||||
|
|
||||||
.loop
|
.loop
|
||||||
ld a, [wJumptableIndex]
|
ld a, [wJumptableIndex]
|
||||||
bit 7, a
|
bit 7, a ; BATTLETRANSITION_END?
|
||||||
jr nz, .done
|
jr nz, .done
|
||||||
call BattleTransitionJumptable
|
call BattleTransitionJumptable
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
@@ -145,13 +153,13 @@ INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp"
|
|||||||
|
|
||||||
|
|
||||||
BattleTransitionJumptable: ; 8c314
|
BattleTransitionJumptable: ; 8c314
|
||||||
jumptable .dw, wJumptableIndex
|
jumptable .Jumptable, wJumptableIndex
|
||||||
; 8c323
|
; 8c323
|
||||||
|
|
||||||
.dw ; 8c323 (23:4323)
|
.Jumptable ; 8c323 (23:4323)
|
||||||
dw StartTrainerBattle_DetermineWhichAnimation ; 00
|
dw StartTrainerBattle_DetermineWhichAnimation ; 00
|
||||||
|
|
||||||
; Animation 1: cave
|
; BATTLETRANSITION_CAVE
|
||||||
dw StartTrainerBattle_LoadPokeBallGraphics ; 01
|
dw StartTrainerBattle_LoadPokeBallGraphics ; 01
|
||||||
dw StartTrainerBattle_SetUpBGMap ; 02
|
dw StartTrainerBattle_SetUpBGMap ; 02
|
||||||
dw StartTrainerBattle_Flash ; 03
|
dw StartTrainerBattle_Flash ; 03
|
||||||
@@ -161,7 +169,7 @@ BattleTransitionJumptable: ; 8c314
|
|||||||
dw StartTrainerBattle_SetUpForWavyOutro ; 07
|
dw StartTrainerBattle_SetUpForWavyOutro ; 07
|
||||||
dw StartTrainerBattle_SineWave ; 08
|
dw StartTrainerBattle_SineWave ; 08
|
||||||
|
|
||||||
; Animation 2: cave, stronger
|
; BATTLETRANSITION_CAVE_STRONGER
|
||||||
dw StartTrainerBattle_LoadPokeBallGraphics ; 09
|
dw StartTrainerBattle_LoadPokeBallGraphics ; 09
|
||||||
dw StartTrainerBattle_SetUpBGMap ; 0a
|
dw StartTrainerBattle_SetUpBGMap ; 0a
|
||||||
dw StartTrainerBattle_Flash ; 0b
|
dw StartTrainerBattle_Flash ; 0b
|
||||||
@@ -171,7 +179,7 @@ BattleTransitionJumptable: ; 8c314
|
|||||||
; There is no setup for this one
|
; There is no setup for this one
|
||||||
dw StartTrainerBattle_ZoomToBlack ; 0f
|
dw StartTrainerBattle_ZoomToBlack ; 0f
|
||||||
|
|
||||||
; Animation 3: no cave
|
; BATTLETRANSITION_NO_CAVE
|
||||||
dw StartTrainerBattle_LoadPokeBallGraphics ; 10
|
dw StartTrainerBattle_LoadPokeBallGraphics ; 10
|
||||||
dw StartTrainerBattle_SetUpBGMap ; 11
|
dw StartTrainerBattle_SetUpBGMap ; 11
|
||||||
dw StartTrainerBattle_Flash ; 12
|
dw StartTrainerBattle_Flash ; 12
|
||||||
@@ -181,7 +189,7 @@ BattleTransitionJumptable: ; 8c314
|
|||||||
dw StartTrainerBattle_SetUpForSpinOutro ; 16
|
dw StartTrainerBattle_SetUpForSpinOutro ; 16
|
||||||
dw StartTrainerBattle_SpinToBlack ; 17
|
dw StartTrainerBattle_SpinToBlack ; 17
|
||||||
|
|
||||||
; Animation 4: no cave, stronger
|
; BATTLETRANSITION_NO_CAVE_STRONGER
|
||||||
dw StartTrainerBattle_LoadPokeBallGraphics ; 18
|
dw StartTrainerBattle_LoadPokeBallGraphics ; 18
|
||||||
dw StartTrainerBattle_SetUpBGMap ; 19
|
dw StartTrainerBattle_SetUpBGMap ; 19
|
||||||
dw StartTrainerBattle_Flash ; 1a
|
dw StartTrainerBattle_Flash ; 1a
|
||||||
@@ -191,9 +199,19 @@ BattleTransitionJumptable: ; 8c314
|
|||||||
dw StartTrainerBattle_SetUpForRandomScatterOutro ; 1e
|
dw StartTrainerBattle_SetUpForRandomScatterOutro ; 1e
|
||||||
dw StartTrainerBattle_SpeckleToBlack ; 1f
|
dw StartTrainerBattle_SpeckleToBlack ; 1f
|
||||||
|
|
||||||
; All animations jump to here.
|
; BATTLETRANSITION_FINISH
|
||||||
dw StartTrainerBattle_Finish ; 20
|
dw StartTrainerBattle_Finish ; 20
|
||||||
|
|
||||||
|
; transition animations
|
||||||
|
const_def
|
||||||
|
const TRANS_CAVE
|
||||||
|
const TRANS_CAVE_STRONGER
|
||||||
|
const TRANS_NO_CAVE
|
||||||
|
const TRANS_NO_CAVE_STRONGER
|
||||||
|
|
||||||
|
; transition animation bits
|
||||||
|
TRANS_STRONGER_F EQU 0 ; bit set in TRANS_CAVE_STRONGER and TRANS_NO_CAVE_STRONGER
|
||||||
|
TRANS_NO_CAVE_F EQU 1 ; bit set in TRANS_NO_CAVE and TRANS_NO_CAVE_STRONGER
|
||||||
|
|
||||||
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
||||||
; The screen flashes a different number of times depending on the level of
|
; The screen flashes a different number of times depending on the level of
|
||||||
@@ -205,18 +223,18 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
|||||||
add 3
|
add 3
|
||||||
ld hl, wEnemyMonLevel
|
ld hl, wEnemyMonLevel
|
||||||
cp [hl]
|
cp [hl]
|
||||||
jr nc, .okay
|
jr nc, .not_stronger
|
||||||
set 0, e
|
set TRANS_STRONGER_F, e
|
||||||
.okay
|
.not_stronger
|
||||||
ld a, [wEnvironment]
|
ld a, [wEnvironment]
|
||||||
cp CAVE
|
cp CAVE
|
||||||
jr z, .okay2
|
jr z, .cave
|
||||||
cp ENVIRONMENT_5
|
cp ENVIRONMENT_5
|
||||||
jr z, .okay2
|
jr z, .cave
|
||||||
cp DUNGEON
|
cp DUNGEON
|
||||||
jr z, .okay2
|
jr z, .cave
|
||||||
set 1, e
|
set TRANS_NO_CAVE_F, e
|
||||||
.okay2
|
.cave
|
||||||
ld hl, .StartingPoints
|
ld hl, .StartingPoints
|
||||||
add hl, de
|
add hl, de
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@@ -225,13 +243,16 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
|
|||||||
; 8c38f (23:438f)
|
; 8c38f (23:438f)
|
||||||
|
|
||||||
.StartingPoints: ; 8c38f
|
.StartingPoints: ; 8c38f
|
||||||
db 1, 9
|
; entries correspond to TRANS_* constants
|
||||||
db 16, 24
|
db BATTLETRANSITION_CAVE
|
||||||
|
db BATTLETRANSITION_CAVE_STRONGER
|
||||||
|
db BATTLETRANSITION_NO_CAVE
|
||||||
|
db BATTLETRANSITION_NO_CAVE_STRONGER
|
||||||
; 8c393
|
; 8c393
|
||||||
|
|
||||||
StartTrainerBattle_Finish: ; 8c393 (23:4393)
|
StartTrainerBattle_Finish: ; 8c393 (23:4393)
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
ld a, $80
|
ld a, BATTLETRANSITION_END
|
||||||
ld [wJumptableIndex], a
|
ld [wJumptableIndex], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -322,7 +343,7 @@ StartTrainerBattle_SineWave: ; 8c408 (23:4408)
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.end
|
.end
|
||||||
ld a, $20
|
ld a, BATTLETRANSITION_FINISH
|
||||||
ld [wJumptableIndex], a
|
ld [wJumptableIndex], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -394,7 +415,7 @@ endr
|
|||||||
call DelayFrame
|
call DelayFrame
|
||||||
xor a
|
xor a
|
||||||
ld [hBGMapMode], a
|
ld [hBGMapMode], a
|
||||||
ld a, $20
|
ld a, BATTLETRANSITION_FINISH
|
||||||
ld [wJumptableIndex], a
|
ld [wJumptableIndex], a
|
||||||
ret
|
ret
|
||||||
; 8c490 (23:4490)
|
; 8c490 (23:4490)
|
||||||
@@ -406,6 +427,10 @@ endr
|
|||||||
const LOWER_LEFT
|
const LOWER_LEFT
|
||||||
const LOWER_RIGHT
|
const LOWER_RIGHT
|
||||||
|
|
||||||
|
; quadrant bits
|
||||||
|
RIGHT_QUADRANT_F EQU 0 ; bit set in UPPER_RIGHT and LOWER_RIGHT
|
||||||
|
LOWER_QUADRANT_F EQU 1 ; bit set in LOWER_LEFT and LOWER_RIGHT
|
||||||
|
|
||||||
.spintable ; 8c490
|
.spintable ; 8c490
|
||||||
spintable_entry: MACRO
|
spintable_entry: MACRO
|
||||||
db \1
|
db \1
|
||||||
@@ -451,7 +476,7 @@ ENDM
|
|||||||
.loop1
|
.loop1
|
||||||
ld [hl], $ff
|
ld [hl], $ff
|
||||||
ld a, [wcf65]
|
ld a, [wcf65]
|
||||||
bit 0, a
|
bit RIGHT_QUADRANT_F, a
|
||||||
jr z, .leftside
|
jr z, .leftside
|
||||||
inc hl
|
inc hl
|
||||||
jr .okay1
|
jr .okay1
|
||||||
@@ -462,7 +487,7 @@ ENDM
|
|||||||
jr nz, .loop1
|
jr nz, .loop1
|
||||||
pop hl
|
pop hl
|
||||||
ld a, [wcf65]
|
ld a, [wcf65]
|
||||||
bit 1, a
|
bit LOWER_QUADRANT_F, a
|
||||||
ld bc, SCREEN_WIDTH
|
ld bc, SCREEN_WIDTH
|
||||||
jr z, .upper
|
jr z, .upper
|
||||||
ld bc, -SCREEN_WIDTH
|
ld bc, -SCREEN_WIDTH
|
||||||
@@ -477,7 +502,7 @@ ENDM
|
|||||||
ld c, a
|
ld c, a
|
||||||
.loop2
|
.loop2
|
||||||
ld a, [wcf65]
|
ld a, [wcf65]
|
||||||
bit 0, a
|
bit RIGHT_QUADRANT_F, a
|
||||||
jr z, .leftside2
|
jr z, .leftside2
|
||||||
dec hl
|
dec hl
|
||||||
jr .okay2
|
jr .okay2
|
||||||
@@ -530,7 +555,7 @@ StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
|
|||||||
call DelayFrame
|
call DelayFrame
|
||||||
xor a
|
xor a
|
||||||
ld [hBGMapMode], a
|
ld [hBGMapMode], a
|
||||||
ld a, $20
|
ld a, BATTLETRANSITION_FINISH
|
||||||
ld [wJumptableIndex], a
|
ld [wJumptableIndex], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -778,7 +803,7 @@ StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)
|
|||||||
jr .loop
|
jr .loop
|
||||||
|
|
||||||
.done
|
.done
|
||||||
ld a, $20
|
ld a, BATTLETRANSITION_FINISH
|
||||||
ld [wJumptableIndex], a
|
ld [wJumptableIndex], a
|
||||||
ret
|
ret
|
||||||
; 8c792 (23:4792)
|
; 8c792 (23:4792)
|
||||||
|
@@ -119,8 +119,8 @@ DoBattle: ; 3c000
|
|||||||
WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5
|
WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5
|
||||||
call Call_LoadTempTileMapToTileMap
|
call Call_LoadTempTileMapToTileMap
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
add $2
|
add DRAW
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
ld a, [wLinkMode]
|
ld a, [wLinkMode]
|
||||||
and a
|
and a
|
||||||
@@ -128,8 +128,8 @@ WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5
|
|||||||
jr z, .print_text
|
jr z, .print_text
|
||||||
|
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a ; WIN
|
||||||
ld hl, BattleText_EnemyFled
|
ld hl, BattleText_EnemyFled
|
||||||
call CheckMobileBattleError
|
call CheckMobileBattleError
|
||||||
jr nc, .print_text
|
jr nc, .print_text
|
||||||
@@ -575,8 +575,8 @@ CheckContestBattleOver: ; 3c3f5
|
|||||||
and a
|
and a
|
||||||
jr nz, .contest_not_over
|
jr nz, .contest_not_over
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
add $2
|
add DRAW
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
@@ -2199,8 +2199,8 @@ UpdateBattleStateAndExperienceAfterEnemyFaint: ; 3ce01
|
|||||||
call EmptyBattleTextBox
|
call EmptyBattleTextBox
|
||||||
call LoadTileMapToTempTileMap
|
call LoadTileMapToTempTileMap
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a ; WIN
|
||||||
call IsAnyMonHoldingExpShare
|
call IsAnyMonHoldingExpShare
|
||||||
jr z, .skip_exp
|
jr z, .skip_exp
|
||||||
ld hl, wEnemyMonBaseStats
|
ld hl, wEnemyMonBaseStats
|
||||||
@@ -2745,8 +2745,8 @@ PlayerMonFaintHappinessMod: ; 3d1aa
|
|||||||
ld [wCurPartyMon], a
|
ld [wCurPartyMon], a
|
||||||
callfar ChangeHappiness
|
callfar ChangeHappiness
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and %11000000
|
and BATTLERESULT_BITMASK
|
||||||
add $1
|
add LOSE
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
ld a, [wWhichMonFaintedFirst]
|
ld a, [wWhichMonFaintedFirst]
|
||||||
and a
|
and a
|
||||||
@@ -3050,8 +3050,8 @@ LostBattle: ; 3d38e
|
|||||||
jr nz, .not_tied
|
jr nz, .not_tied
|
||||||
ld hl, TiedAgainstText
|
ld hl, TiedAgainstText
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
add 2
|
add DRAW
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
jr .text
|
jr .text
|
||||||
|
|
||||||
@@ -3928,11 +3928,11 @@ TryToRunAwayFromBattle: ; 3d8b3
|
|||||||
cp BATTLEACTION_FORFEIT
|
cp BATTLEACTION_FORFEIT
|
||||||
ld a, DRAW
|
ld a, DRAW
|
||||||
jr z, .fled
|
jr z, .fled
|
||||||
dec a
|
dec a ; LOSE
|
||||||
.fled
|
.fled
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
add b
|
add b
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
call StopDangerSound
|
call StopDangerSound
|
||||||
@@ -5180,8 +5180,8 @@ BattleMenu_Pack: ; 3e1c7
|
|||||||
xor a
|
xor a
|
||||||
ld [wWildMon], a
|
ld [wWildMon], a
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a ; WIN
|
||||||
call ClearWindowData
|
call ClearWindowData
|
||||||
call SetPalettes
|
call SetPalettes
|
||||||
scf
|
scf
|
||||||
@@ -8607,9 +8607,10 @@ DisplayLinkBattleResult: ; 3f77c
|
|||||||
.proceed
|
.proceed
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $f
|
and $f
|
||||||
cp $1
|
cp LOSE
|
||||||
jr c, .victory
|
jr c, .victory ; WIN
|
||||||
jr z, .loss
|
jr z, .loss ; LOSE
|
||||||
|
; DRAW
|
||||||
farcall StubbedTrainerRankings_ColosseumDraws
|
farcall StubbedTrainerRankings_ColosseumDraws
|
||||||
ld de, .Draw
|
ld de, .Draw
|
||||||
jr .store_result
|
jr .store_result
|
||||||
@@ -8841,7 +8842,7 @@ BattleEnd_HandleRoamMons: ; 3f998
|
|||||||
jr nz, .not_roaming
|
jr nz, .not_roaming
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $f
|
and $f
|
||||||
jr z, .caught_or_defeated_roam_mon
|
jr z, .caught_or_defeated_roam_mon ; WIN
|
||||||
call GetRoamMonHP
|
call GetRoamMonHP
|
||||||
ld a, [wEnemyMonHP + 1]
|
ld a, [wEnemyMonHP + 1]
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
@@ -9001,11 +9002,12 @@ AddLastMobileBattleToLinkRecord: ; 3fa42
|
|||||||
.StoreResult: ; 3faa0
|
.StoreResult: ; 3faa0
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $f
|
and $f
|
||||||
cp $1
|
cp LOSE
|
||||||
ld bc, sLinkBattleWins + 1 - sLinkBattleResults
|
ld bc, sLinkBattleWins + 1 - sLinkBattleResults
|
||||||
jr c, .okay
|
jr c, .okay ; WIN
|
||||||
ld bc, sLinkBattleLosses + 1 - sLinkBattleResults
|
ld bc, sLinkBattleLosses + 1 - sLinkBattleResults
|
||||||
jr z, .okay
|
jr z, .okay ; LOSE
|
||||||
|
; DRAW
|
||||||
ld bc, sLinkBattleDraws + 1 - sLinkBattleResults
|
ld bc, sLinkBattleDraws + 1 - sLinkBattleResults
|
||||||
.okay
|
.okay
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
@@ -5390,8 +5390,8 @@ INCLUDE "engine/battle/move_effects/teleport.asm"
|
|||||||
|
|
||||||
SetBattleDraw: ; 36804
|
SetBattleDraw: ; 36804
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $c0
|
and BATTLERESULT_BITMASK
|
||||||
or $2
|
or DRAW
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@@ -41,20 +41,20 @@ DetermineLinkBattleResult: ; 2b930
|
|||||||
.victory
|
.victory
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $f0
|
and $f0
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a ; WIN
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.defeat
|
.defeat
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $f0
|
and $f0
|
||||||
add $1
|
add LOSE
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.drawn
|
.drawn
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $f0
|
and $f0
|
||||||
add $2
|
add DRAW
|
||||||
ld [wBattleResult], a
|
ld [wBattleResult], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@@ -123,16 +123,16 @@ DetermineLinkBattleResult: ; 2b930
|
|||||||
jr nz, .finish ; we have a pokemon that's neither fainted nor at full health
|
jr nz, .finish ; we have a pokemon that's neither fainted nor at full health
|
||||||
ld hl, wOTPartyMon1HP
|
ld hl, wOTPartyMon1HP
|
||||||
call .CheckFaintedOrFullHealth
|
call .CheckFaintedOrFullHealth
|
||||||
ld e, $1
|
ld e, $1 ; victory
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.finish
|
.finish
|
||||||
ld hl, wOTPartyMon1HP
|
ld hl, wOTPartyMon1HP
|
||||||
call .CheckFaintedOrFullHealth
|
call .CheckFaintedOrFullHealth
|
||||||
ld e, $0
|
ld e, $0 ; drawn
|
||||||
ret nz ; we both have pokemon that are neither fainted nor at full health
|
ret nz ; we both have pokemon that are neither fainted nor at full health
|
||||||
ld e, $2
|
ld e, $2 ; defeat
|
||||||
ld a, $1
|
ld a, $1 ; not drawn
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ Function170114: ; 170114
|
|||||||
ld a, $5
|
ld a, $5
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
ld hl, $a948
|
ld hl, $a948
|
||||||
ld de, wMisc
|
ld de, wc608
|
||||||
ld bc, $f6 ; 246
|
ld bc, $f6 ; 246
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
@@ -90,11 +90,11 @@ Function170139: ; 170139
|
|||||||
ld b, $0
|
ld b, $0
|
||||||
add hl, bc
|
add hl, bc
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
; Store that number in wMisc
|
; Store that number in wc608
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wMisc], a
|
ld [wc608], a
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wMisc + 1], a
|
ld [wc608 + 1], a
|
||||||
ld hl, wBT_OTTempMon1DVs
|
ld hl, wBT_OTTempMon1DVs
|
||||||
ld a, [wPlayerID]
|
ld a, [wPlayerID]
|
||||||
ld [hli], a
|
ld [hli], a
|
||||||
@@ -161,7 +161,7 @@ Function170139: ; 170139
|
|||||||
ld hl, $a894
|
ld hl, $a894
|
||||||
ld bc, NAME_LENGTH_JAPANESE
|
ld bc, NAME_LENGTH_JAPANESE
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
ld hl, wMisc
|
ld hl, wc608
|
||||||
ld de, $a948
|
ld de, $a948
|
||||||
ld bc, $f6
|
ld bc, $f6
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
@@ -254,7 +254,7 @@ RunBattleTowerTrainer: ; 17024d
|
|||||||
farcall HealParty
|
farcall HealParty
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
ld [wScriptVar], a
|
ld [wScriptVar], a
|
||||||
and a
|
and a ; WIN?
|
||||||
jr nz, .lost
|
jr nz, .lost
|
||||||
ld a, BANK(sNrOfBeatenBattleTowerTrainers)
|
ld a, BANK(sNrOfBeatenBattleTowerTrainers)
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
@@ -674,7 +674,7 @@ Function1704e1: ; 1704e1
|
|||||||
call CopyBytes
|
call CopyBytes
|
||||||
|
|
||||||
ld hl, $a8b2
|
ld hl, $a8b2
|
||||||
ld de, wMisc
|
ld de, wc608
|
||||||
ld bc, $0096
|
ld bc, $0096
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
|
|
||||||
@@ -793,7 +793,7 @@ Function1704e1: ; 1704e1
|
|||||||
call .PlaceUpDownArrows
|
call .PlaceUpDownArrows
|
||||||
ld a, $50
|
ld a, $50
|
||||||
ld [wcd4e], a
|
ld [wcd4e], a
|
||||||
ld hl, wMisc
|
ld hl, wc608
|
||||||
ld a, [wNrOfBeatenBattleTowerTrainers]
|
ld a, [wNrOfBeatenBattleTowerTrainers]
|
||||||
ld c, a
|
ld c, a
|
||||||
xor a
|
xor a
|
||||||
@@ -1441,7 +1441,7 @@ Function1709bb: ; 1709bb (5c:49bb) BattleTowerAction $10
|
|||||||
ld a, $5
|
ld a, $5
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
ld hl, $b023
|
ld hl, $b023
|
||||||
ld de, wMisc
|
ld de, wc608
|
||||||
ld bc, $0069
|
ld bc, $0069
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
ld a, [$a825]
|
ld a, [$a825]
|
||||||
@@ -1460,14 +1460,14 @@ Function1709bb: ; 1709bb (5c:49bb) BattleTowerAction $10
|
|||||||
ld a, $0
|
ld a, $0
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
ld hl, wRTC
|
ld hl, wRTC
|
||||||
ld de, wMisc
|
ld de, wc608
|
||||||
ld bc, $0004
|
ld bc, $0004
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
ld a, $5
|
ld a, $5
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
ld hl, $b08c
|
ld hl, $b08c
|
||||||
ld de, wMisc
|
ld de, wc608
|
||||||
ld c, $4
|
ld c, $4
|
||||||
.compare_loop
|
.compare_loop
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
|
@@ -7,7 +7,7 @@ DisplayCaughtContestMonStats: ; cc000
|
|||||||
ld hl, wOptions
|
ld hl, wOptions
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
push af
|
push af
|
||||||
set 4, [hl]
|
set NO_TEXT_SCROLL, [hl]
|
||||||
|
|
||||||
hlcoord 0, 0
|
hlcoord 0, 0
|
||||||
ld b, 4
|
ld b, 4
|
||||||
|
@@ -325,15 +325,15 @@ CelebiEvent_SetBattleType: ; 49bf3
|
|||||||
|
|
||||||
CheckCaughtCelebi: ; 49bf9
|
CheckCaughtCelebi: ; 49bf9
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
bit 6, a
|
bit BATTLERESULT_CAUGHT_CELEBI, a
|
||||||
jr z, .false
|
jr z, .false
|
||||||
ld a, $1
|
ld a, TRUE
|
||||||
ld [wScriptVar], a
|
ld [wScriptVar], a
|
||||||
jr .done
|
jr .done
|
||||||
|
|
||||||
|
|
||||||
.false
|
.false
|
||||||
xor a
|
xor a ; FALSE
|
||||||
ld [wScriptVar], a
|
ld [wScriptVar], a
|
||||||
|
|
||||||
.done
|
.done
|
||||||
|
@@ -143,12 +143,12 @@ AnimateHallOfFame: ; 864c3
|
|||||||
|
|
||||||
|
|
||||||
GetHallOfFameParty: ; 8653f
|
GetHallOfFameParty: ; 8653f
|
||||||
ld hl, wOverworldMap
|
ld hl, wHallOfFamePokemonList
|
||||||
ld bc, HOF_LENGTH
|
ld bc, wHallOfFamePokemonListEnd - wHallOfFamePokemonList + 1
|
||||||
xor a
|
xor a
|
||||||
call ByteFill
|
call ByteFill
|
||||||
ld a, [wHallOfFameCount]
|
ld a, [wHallOfFameCount]
|
||||||
ld de, wOverworldMap
|
ld de, wHallOfFamePokemonList
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
ld hl, wPartySpecies
|
ld hl, wPartySpecies
|
||||||
@@ -216,7 +216,7 @@ GetHallOfFameParty: ; 8653f
|
|||||||
pop bc
|
pop bc
|
||||||
inc c
|
inc c
|
||||||
pop de
|
pop de
|
||||||
ld hl, HOF_MON_LENGTH
|
ld hl, wHallOfFamePokemonListMon1End - wHallOfFamePokemonListMon1
|
||||||
add hl, de
|
add hl, de
|
||||||
ld e, l
|
ld e, l
|
||||||
ld d, h
|
ld d, h
|
||||||
@@ -224,7 +224,7 @@ GetHallOfFameParty: ; 8653f
|
|||||||
jr .next
|
jr .next
|
||||||
|
|
||||||
.done
|
.done
|
||||||
ld a, $ff
|
ld a, -1
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ret
|
ret
|
||||||
; 865b5
|
; 865b5
|
||||||
@@ -422,7 +422,7 @@ LoadHOFTeam: ; 8671c
|
|||||||
cp NUM_HOF_TEAMS
|
cp NUM_HOF_TEAMS
|
||||||
jr nc, .invalid
|
jr nc, .invalid
|
||||||
ld hl, sHallOfFame
|
ld hl, sHallOfFame
|
||||||
ld bc, HOF_LENGTH
|
ld bc, wHallOfFameTempEnd - wHallOfFameTemp + 1
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld a, BANK(sHallOfFame)
|
ld a, BANK(sHallOfFame)
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
@@ -430,7 +430,7 @@ LoadHOFTeam: ; 8671c
|
|||||||
and a
|
and a
|
||||||
jr z, .absent
|
jr z, .absent
|
||||||
ld de, wHallOfFameTemp
|
ld de, wHallOfFameTemp
|
||||||
ld bc, HOF_LENGTH
|
ld bc, wHallOfFameTempEnd - wHallOfFameTemp + 1
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
and a
|
and a
|
||||||
|
@@ -179,7 +179,7 @@ CheckMapForSomethingToCut: ; c7ce
|
|||||||
farcall CheckCutCollision
|
farcall CheckCutCollision
|
||||||
pop de
|
pop de
|
||||||
jr nc, .fail
|
jr nc, .fail
|
||||||
; Get the location of the current block in wOverworldMap.
|
; Get the location of the current block in wOverworldMapBlocks.
|
||||||
call GetBlockLocation
|
call GetBlockLocation
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
; See if that block contains something that can be cut.
|
; See if that block contains something that can be cut.
|
||||||
@@ -188,7 +188,7 @@ CheckMapForSomethingToCut: ; c7ce
|
|||||||
call CheckOverworldTileArrays
|
call CheckOverworldTileArrays
|
||||||
pop hl
|
pop hl
|
||||||
jr nc, .fail
|
jr nc, .fail
|
||||||
; Back up the wOverworldMap address to wBuffer3
|
; Back up the wOverworldMapBlocks address to wBuffer3
|
||||||
ld a, l
|
ld a, l
|
||||||
ld [wBuffer3], a
|
ld [wBuffer3], a
|
||||||
ld a, h
|
ld a, h
|
||||||
|
@@ -12,7 +12,7 @@ RotateUnownFrontpic: ; e0000
|
|||||||
ld de, wd002
|
ld de, wd002
|
||||||
call .Copy
|
call .Copy
|
||||||
call .Rotate
|
call .Rotate
|
||||||
ld hl, UnownPrinter_OverworldMapRectangle
|
ld hl, UnownPrinter_GBPrinterRectangle
|
||||||
pop bc
|
pop bc
|
||||||
add hl, bc
|
add hl, bc
|
||||||
add hl, bc
|
add hl, bc
|
||||||
@@ -30,7 +30,7 @@ RotateUnownFrontpic: ; e0000
|
|||||||
cp 7 * 7
|
cp 7 * 7
|
||||||
jr c, .loop
|
jr c, .loop
|
||||||
|
|
||||||
ld hl, wOverworldMap
|
ld hl, wGameboyPrinterRAM
|
||||||
ld de, sScratch
|
ld de, sScratch
|
||||||
ld bc, 7 * 7 tiles
|
ld bc, 7 * 7 tiles
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
@@ -95,17 +95,17 @@ RotateUnownFrontpic: ; e0000
|
|||||||
jr nz, .loop_count
|
jr nz, .loop_count
|
||||||
ret
|
ret
|
||||||
|
|
||||||
overworldmaprect: MACRO
|
gbprinterrect: MACRO
|
||||||
y = 0
|
y = 0
|
||||||
rept \1
|
rept \1
|
||||||
x = \1 * (\2 + -1) + y
|
x = \1 * (\2 + -1) + y
|
||||||
rept \2
|
rept \2
|
||||||
dw wOverworldMap tile x
|
dw wGameboyPrinterRAM tile x
|
||||||
x = x + -\2
|
x = x + -\2
|
||||||
endr
|
endr
|
||||||
y = y + 1
|
y = y + 1
|
||||||
endr
|
endr
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
UnownPrinter_OverworldMapRectangle: ; e008b
|
UnownPrinter_GBPrinterRectangle: ; e008b
|
||||||
overworldmaprect 7, 7
|
gbprinterrect 7, 7
|
||||||
|
@@ -12,7 +12,7 @@ ret_e00ed: ; e00ed (38:40ed)
|
|||||||
|
|
||||||
_CardFlip: ; e00ee (38:40ee)
|
_CardFlip: ; e00ee (38:40ee)
|
||||||
ld hl, wOptions
|
ld hl, wOptions
|
||||||
set 4, [hl]
|
set NO_TEXT_SCROLL, [hl]
|
||||||
call ClearBGPalettes
|
call ClearBGPalettes
|
||||||
call ClearTileMap
|
call ClearTileMap
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
|
@@ -14,8 +14,8 @@ _UnownPuzzle: ; e1190
|
|||||||
xor a
|
xor a
|
||||||
ld [hBGMapMode], a
|
ld [hBGMapMode], a
|
||||||
call DisableLCD
|
call DisableLCD
|
||||||
ld hl, wMisc ; includes wPuzzlePieces
|
ld hl, wc608 ; includes wPuzzlePieces
|
||||||
ld bc, wMiscEnd - wMisc
|
ld bc, wc7e8 - wc608
|
||||||
xor a
|
xor a
|
||||||
call ByteFill
|
call ByteFill
|
||||||
ld hl, UnownPuzzleCursorGFX
|
ld hl, UnownPuzzleCursorGFX
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user