2015-11-16 13:01:45 -08:00
|
|
|
PALPACKET_LENGTH EQU $10
|
2013-09-15 15:02:02 -07:00
|
|
|
INCLUDE "predef/sgb.asm"
|
|
|
|
|
2015-11-01 15:13:31 -08:00
|
|
|
SHINY_ATK_BIT EQU 5
|
|
|
|
SHINY_DEF_VAL EQU 10
|
|
|
|
SHINY_SPD_VAL EQU 10
|
|
|
|
SHINY_SPC_VAL EQU 10
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
CheckShininess:
|
2013-09-15 15:02:02 -07:00
|
|
|
; Check if a mon is shiny by DVs at bc.
|
|
|
|
; Return carry if shiny.
|
|
|
|
|
|
|
|
ld l, c
|
|
|
|
ld h, b
|
|
|
|
|
|
|
|
; Attack
|
|
|
|
ld a, [hl]
|
2015-11-01 15:13:31 -08:00
|
|
|
and 1 << SHINY_ATK_BIT
|
2013-09-15 15:02:02 -07:00
|
|
|
jr z, .NotShiny
|
|
|
|
|
|
|
|
; Defense
|
|
|
|
ld a, [hli]
|
2016-04-02 06:28:46 -07:00
|
|
|
and $f
|
2015-11-01 15:13:31 -08:00
|
|
|
cp SHINY_DEF_VAL
|
2013-09-15 15:02:02 -07:00
|
|
|
jr nz, .NotShiny
|
|
|
|
|
|
|
|
; Speed
|
|
|
|
ld a, [hl]
|
2016-04-02 06:28:46 -07:00
|
|
|
and $f0
|
2015-11-01 15:13:31 -08:00
|
|
|
cp SHINY_SPD_VAL << 4
|
2013-09-15 15:02:02 -07:00
|
|
|
jr nz, .NotShiny
|
|
|
|
|
|
|
|
; Special
|
|
|
|
ld a, [hl]
|
2016-04-02 06:28:46 -07:00
|
|
|
and $f
|
2015-11-01 15:13:31 -08:00
|
|
|
cp SHINY_SPC_VAL
|
2013-09-15 15:02:02 -07:00
|
|
|
jr nz, .NotShiny
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Shiny:
|
2013-09-15 15:02:02 -07:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.NotShiny:
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
CheckContestMon:
|
2013-09-15 15:02:02 -07:00
|
|
|
; Check a mon's DVs at hl in the bug catching contest.
|
|
|
|
; Return carry if its DVs are good enough to place in the contest.
|
|
|
|
|
|
|
|
; Attack
|
|
|
|
ld a, [hl]
|
|
|
|
cp 10 << 4
|
|
|
|
jr c, .Bad
|
|
|
|
|
|
|
|
; Defense
|
|
|
|
ld a, [hli]
|
2016-04-02 06:28:46 -07:00
|
|
|
and $f
|
2013-09-15 15:02:02 -07:00
|
|
|
cp 10
|
|
|
|
jr c, .Bad
|
|
|
|
|
|
|
|
; Speed
|
|
|
|
ld a, [hl]
|
|
|
|
cp 10 << 4
|
|
|
|
jr c, .Bad
|
|
|
|
|
|
|
|
; Special
|
|
|
|
ld a, [hl]
|
2016-04-02 06:28:46 -07:00
|
|
|
and $f
|
2013-09-15 15:02:02 -07:00
|
|
|
cp 10
|
|
|
|
jr c, .Bad
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Good:
|
2013-09-15 15:02:02 -07:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Bad:
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function8aa4:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
2013-09-15 15:02:02 -07:00
|
|
|
push de
|
|
|
|
push bc
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2015-11-16 13:01:45 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyBytes
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
ld a, c
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, b
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, e
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, d
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2016-05-11 06:49:03 -07:00
|
|
|
call PushSGBPals_
|
2014-03-01 18:43:16 -08:00
|
|
|
ld hl, BlkPacket_9a86
|
2016-05-11 06:49:03 -07:00
|
|
|
call PushSGBPals_
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
InitPartyMenuPalettes:
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9c56 + 1
|
2015-10-21 07:43:42 -07:00
|
|
|
call CopyFourPalettes
|
2015-12-28 07:57:04 -08:00
|
|
|
call InitPartyMenuOBPals
|
2015-12-16 18:57:42 -08:00
|
|
|
call WipeAttrMap
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
SGB_ApplyPartyMenuHPPals: ; 8ade SGB layout $fc
|
|
|
|
ld hl, wHPPals
|
2015-12-22 15:03:00 -08:00
|
|
|
ld a, [wSGBPals]
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
ld a, [de]
|
|
|
|
and a
|
|
|
|
ld e, $5
|
2015-12-22 15:03:00 -08:00
|
|
|
jr z, .okay
|
2013-09-15 15:02:02 -07:00
|
|
|
dec a
|
|
|
|
ld e, $a
|
2015-12-22 15:03:00 -08:00
|
|
|
jr z, .okay
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, $f
|
2015-12-22 15:03:00 -08:00
|
|
|
.okay
|
2013-09-15 15:02:02 -07:00
|
|
|
push de
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, wSGBPals + 10
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, $6
|
2015-12-22 15:03:00 -08:00
|
|
|
ld a, [wSGBPals]
|
2013-09-15 15:02:02 -07:00
|
|
|
call AddNTimes
|
|
|
|
pop de
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function8b07:
|
2016-01-04 05:43:55 -08:00
|
|
|
; Unreferenced
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
|
|
|
ret z
|
2016-05-05 12:07:37 -07:00
|
|
|
; CGB only
|
2016-01-04 05:43:55 -08:00
|
|
|
ld hl, .BGPal
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknBGPals
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, 1 palettes
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
|
|
|
|
2016-01-04 05:43:55 -08:00
|
|
|
ld hl, .OBPal
|
|
|
|
ld de, UnknOBPals
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, 1 palettes
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
|
|
|
|
2015-12-16 18:57:42 -08:00
|
|
|
call ApplyPals
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $1
|
|
|
|
ld [hCGBPalUpdate], a
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.BGPal:
|
2013-09-15 15:02:02 -07:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 18, 23, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.OBPal:
|
2013-09-15 15:02:02 -07:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 12
|
|
|
|
RGB 08, 16, 28
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function8b3f:
|
2016-01-04 05:43:55 -08:00
|
|
|
; Unreferenced
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
|
|
|
ret nz
|
|
|
|
ld a, [hSGB]
|
|
|
|
and a
|
|
|
|
ret z
|
2014-03-01 18:43:16 -08:00
|
|
|
ld hl, BlkPacket_9a86
|
2016-05-11 06:49:03 -07:00
|
|
|
jp PushSGBPals_
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function8b4d:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
2016-01-04 05:43:55 -08:00
|
|
|
jr nz, .cgb
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hSGB]
|
|
|
|
and a
|
|
|
|
ret z
|
2015-01-01 20:59:08 -08:00
|
|
|
ld hl, PalPacket_9c26
|
2016-05-11 06:49:03 -07:00
|
|
|
jp PushSGBPals_
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-01-04 05:43:55 -08:00
|
|
|
.cgb
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknOBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $3b
|
2015-12-22 15:03:00 -08:00
|
|
|
call GetPredefPal
|
2015-10-21 07:43:42 -07:00
|
|
|
jp LoadHLPaletteIntoDE
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function8b67:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
2016-01-04 05:43:55 -08:00
|
|
|
jr nz, .cgb
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hSGB]
|
|
|
|
and a
|
|
|
|
ret z
|
2015-01-01 20:59:08 -08:00
|
|
|
ld hl, PalPacket_9c36
|
2016-05-11 06:49:03 -07:00
|
|
|
jp PushSGBPals_
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-01-04 05:43:55 -08:00
|
|
|
.cgb
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknOBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $3c
|
2015-12-22 15:03:00 -08:00
|
|
|
call GetPredefPal
|
2015-10-21 07:43:42 -07:00
|
|
|
jp LoadHLPaletteIntoDE
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function8b81:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
2016-05-11 06:49:03 -07:00
|
|
|
jr nz, .cgb
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hSGB]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld a, c
|
|
|
|
push af
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2015-11-16 13:01:45 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyBytes
|
|
|
|
pop af
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetMonPalettePointer_
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hl]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2016-05-11 06:49:03 -07:00
|
|
|
jp PushSGBPals_
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.cgb
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknOBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, c
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetMonPalettePointer_
|
|
|
|
call LoadPalette_White_Col1_Col2_Black
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
LoadTrainerClassPaletteAsNthBGPal:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [TrainerClass]
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetTrainerPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, e
|
2016-05-11 06:49:03 -07:00
|
|
|
jr got_palette_pointer_8bd7
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
LoadMonPaletteAsNthBGPal:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [CurPartySpecies]
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetMonPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, e
|
|
|
|
bit 7, a
|
2016-05-11 06:49:03 -07:00
|
|
|
jr z, got_palette_pointer_8bd7
|
2013-09-15 15:02:02 -07:00
|
|
|
and $7f
|
|
|
|
inc hl
|
2016-05-11 06:49:03 -07:00
|
|
|
inc hl
|
|
|
|
inc hl
|
|
|
|
inc hl
|
2015-02-05 23:59:50 -08:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
got_palette_pointer_8bd7
|
2013-09-15 15:02:02 -07:00
|
|
|
push hl
|
2015-11-20 12:15:32 -08:00
|
|
|
ld hl, UnknBGPals
|
2016-05-11 06:49:03 -07:00
|
|
|
ld de, 1 palettes
|
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
2016-05-11 06:49:03 -07:00
|
|
|
jr z, .got_addr
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, de
|
|
|
|
dec a
|
2016-05-11 06:49:03 -07:00
|
|
|
jr .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.got_addr
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
pop hl
|
2015-12-16 18:57:42 -08:00
|
|
|
call LoadPalette_White_Col1_Col2_Black
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function8bec:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
2016-05-11 06:49:03 -07:00
|
|
|
jr nz, .cgb
|
2013-09-15 15:02:02 -07:00
|
|
|
ld hl, PlayerLightScreenCount
|
2016-05-11 06:49:03 -07:00
|
|
|
jp PushSGBPals_
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.cgb
|
|
|
|
ld a, [EnemyLightScreenCount] ; col
|
2013-09-15 15:02:02 -07:00
|
|
|
ld c, a
|
2016-05-11 06:49:03 -07:00
|
|
|
ld a, [EnemyReflectCount] ; row
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0, AttrMap
|
2016-05-11 06:49:03 -07:00
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
2016-05-11 06:49:03 -07:00
|
|
|
jr z, .done
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, de
|
|
|
|
dec a
|
2016-05-11 06:49:03 -07:00
|
|
|
jr .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.done
|
2013-09-15 15:02:02 -07:00
|
|
|
ld b, $0
|
|
|
|
add hl, bc
|
2015-10-21 07:43:42 -07:00
|
|
|
lb bc, 6, 4
|
2016-05-11 06:49:03 -07:00
|
|
|
ld a, [EnemySafeguardCount] ; value
|
2013-09-15 15:02:02 -07:00
|
|
|
and $3
|
2015-11-12 21:49:27 -08:00
|
|
|
call FillBoxCGB
|
2015-11-20 08:47:52 -08:00
|
|
|
call LoadEDTile
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
ApplyMonOrTrainerPals:
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
|
|
|
ret z
|
|
|
|
ld a, e
|
|
|
|
and a
|
2015-12-26 15:11:55 -08:00
|
|
|
jr z, .get_trainer
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [CurPartySpecies]
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetMonPalettePointer_
|
2015-12-26 15:11:55 -08:00
|
|
|
jr .load_palettes
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2015-12-26 15:11:55 -08:00
|
|
|
.get_trainer
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [TrainerClass]
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetTrainerPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2015-12-26 15:11:55 -08:00
|
|
|
.load_palettes
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknBGPals
|
2015-12-16 18:57:42 -08:00
|
|
|
call LoadPalette_White_Col1_Col2_Black
|
|
|
|
call WipeAttrMap
|
|
|
|
call ApplyAttrMap
|
|
|
|
call ApplyPals
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
ApplyHPBarPals:
|
2015-12-26 15:11:55 -08:00
|
|
|
ld a, [wWhichHPBar]
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
2015-12-26 15:11:55 -08:00
|
|
|
jr z, .Enemy
|
2013-09-15 15:02:02 -07:00
|
|
|
cp $1
|
2015-12-26 15:11:55 -08:00
|
|
|
jr z, .Player
|
2013-09-15 15:02:02 -07:00
|
|
|
cp $2
|
2015-12-26 15:11:55 -08:00
|
|
|
jr z, .PartyMenu
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Enemy:
|
2015-12-09 15:25:44 -08:00
|
|
|
ld de, BGPals + 2 palettes + 2
|
2015-12-26 15:11:55 -08:00
|
|
|
jr .okay
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Player:
|
2015-12-09 15:25:44 -08:00
|
|
|
ld de, BGPals + 3 palettes + 2
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2015-12-26 15:11:55 -08:00
|
|
|
.okay
|
2013-09-15 15:02:02 -07:00
|
|
|
ld l, c
|
|
|
|
ld h, $0
|
|
|
|
add hl, hl
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, hl
|
2014-03-01 18:43:16 -08:00
|
|
|
ld bc, Palettes_a8be
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, bc
|
2015-12-26 15:11:55 -08:00
|
|
|
ld bc, 4
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
|
|
|
ld a, $1
|
|
|
|
ld [hCGBPalUpdate], a
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.PartyMenu:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, c
|
|
|
|
inc e
|
2015-02-10 14:16:31 -08:00
|
|
|
hlcoord 11, 1, AttrMap
|
2015-12-26 15:11:55 -08:00
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [CurPartyMon]
|
2015-12-26 15:11:55 -08:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
2015-12-26 15:11:55 -08:00
|
|
|
jr z, .done
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, bc
|
|
|
|
dec a
|
2015-12-26 15:11:55 -08:00
|
|
|
jr .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2015-12-26 15:11:55 -08:00
|
|
|
.done
|
2015-10-21 07:43:42 -07:00
|
|
|
lb bc, 2, 8
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, e
|
2015-11-12 21:49:27 -08:00
|
|
|
call FillBoxCGB
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
LoadStatsScreenPals:
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
|
|
|
ret z
|
2015-12-22 19:19:33 -08:00
|
|
|
ld hl, StatsScreenPals
|
2014-03-02 13:02:55 -08:00
|
|
|
ld b, 0
|
2013-09-15 15:02:02 -07:00
|
|
|
dec c
|
|
|
|
add hl, bc
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, bc
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld a, [hli]
|
2015-11-20 12:15:32 -08:00
|
|
|
ld [UnknBGPals], a
|
|
|
|
ld [UnknBGPals + 8 * 2], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hl]
|
2015-11-20 12:15:32 -08:00
|
|
|
ld [UnknBGPals + 1], a
|
|
|
|
ld [UnknBGPals + 8 * 2 + 1], a
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
2015-12-16 18:57:42 -08:00
|
|
|
call ApplyPals
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $1
|
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
LoadMailPalettes:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld l, e
|
2014-03-02 13:02:55 -08:00
|
|
|
ld h, 0
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, hl
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2016-05-11 06:49:03 -07:00
|
|
|
ld de, .MailPals
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, de
|
|
|
|
call CheckCGB
|
2016-05-11 06:49:03 -07:00
|
|
|
jr nz, .cgb
|
2013-09-15 15:02:02 -07:00
|
|
|
push hl
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9ce6
|
2015-12-22 15:03:00 -08:00
|
|
|
ld de, wSGBPals
|
2015-11-16 13:01:45 -08:00
|
|
|
ld bc, PALPACKET_LENGTH
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyBytes
|
|
|
|
pop hl
|
|
|
|
inc hl
|
2015-12-26 18:59:03 -08:00
|
|
|
inc hl
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 3], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 4], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 5], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
2015-12-22 15:03:00 -08:00
|
|
|
ld [wSGBPals + 6], a
|
|
|
|
ld hl, wSGBPals
|
2016-05-11 06:49:03 -07:00
|
|
|
call PushSGBPals_
|
2014-03-01 18:43:16 -08:00
|
|
|
ld hl, BlkPacket_9a86
|
2016-05-11 06:49:03 -07:00
|
|
|
call PushSGBPals_
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.cgb
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknBGPals
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, 1 palettes
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
2015-12-16 18:57:42 -08:00
|
|
|
call ApplyPals
|
|
|
|
call WipeAttrMap
|
|
|
|
call ApplyAttrMap
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.MailPals:
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 20, 31, 11
|
|
|
|
RGB 31, 19, 00
|
|
|
|
RGB 31, 10, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 30, 26, 00
|
|
|
|
RGB 31, 12, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 24, 17, 31
|
|
|
|
RGB 30, 26, 00
|
|
|
|
RGB 08, 11, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 25, 17
|
|
|
|
RGB 31, 18, 04
|
|
|
|
RGB 28, 12, 05
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 19, 26, 31
|
|
|
|
RGB 31, 05, 08
|
|
|
|
RGB 31, 09, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 19, 28
|
|
|
|
RGB 31, 21, 00
|
|
|
|
RGB 12, 22, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 19, 17, 23
|
|
|
|
RGB 30, 26, 00
|
|
|
|
RGB 31, 12, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 07, 26, 31
|
|
|
|
RGB 26, 26, 27
|
|
|
|
RGB 31, 11, 11
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 21, 31, 21
|
|
|
|
RGB 30, 26, 00
|
|
|
|
RGB 31, 12, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 07, 26, 31
|
|
|
|
RGB 31, 31, 00
|
|
|
|
RGB 00, 21, 00
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2013-09-15 15:02:02 -07:00
|
|
|
INCLUDE "predef/cgb.asm"
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function95f0:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
|
|
|
ld hl, .Palette
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknBGPals
|
2015-10-21 07:43:42 -07:00
|
|
|
ld bc, 8
|
2014-03-01 18:43:16 -08:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
2015-12-16 18:57:42 -08:00
|
|
|
call ApplyPals
|
|
|
|
call WipeAttrMap
|
|
|
|
call ApplyAttrMap
|
2014-03-01 18:43:16 -08:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.Palette:
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 09, 31, 31
|
|
|
|
RGB 10, 12, 31
|
|
|
|
RGB 00, 03, 19
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
CopyFourPalettes:
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknBGPals
|
2013-09-15 15:02:02 -07:00
|
|
|
ld c, $4
|
2013-12-24 14:11:52 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
CopyPalettes:
|
2015-10-21 07:43:42 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
push bc
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
2015-12-22 15:03:00 -08:00
|
|
|
call GetPredefPal
|
2015-10-21 07:43:42 -07:00
|
|
|
call LoadHLPaletteIntoDE
|
2013-09-15 15:02:02 -07:00
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec c
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetPredefPal:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
|
|
|
add hl, hl
|
2016-05-05 12:07:37 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2014-03-02 13:02:55 -08:00
|
|
|
ld bc, Palettes_9df6
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
LoadHLPaletteIntoDE:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
|
|
|
ld c, $8
|
2015-10-21 07:43:42 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
LoadPalette_White_Col1_Col2_Black:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
2015-12-16 18:57:42 -08:00
|
|
|
|
|
|
|
ld a, $7fff % $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [de], a
|
|
|
|
inc de
|
2015-12-16 18:57:42 -08:00
|
|
|
ld a, $7fff / $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [de], a
|
|
|
|
inc de
|
2015-12-16 18:57:42 -08:00
|
|
|
|
|
|
|
ld c, 2 * 2
|
2015-10-21 07:43:42 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .loop
|
2015-12-16 18:57:42 -08:00
|
|
|
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
2015-12-16 18:57:42 -08:00
|
|
|
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
FillBoxCGB:
|
2015-10-21 07:43:42 -07:00
|
|
|
.row
|
2013-09-15 15:02:02 -07:00
|
|
|
push bc
|
|
|
|
push hl
|
2015-10-21 07:43:42 -07:00
|
|
|
.col
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .col
|
2013-09-15 15:02:02 -07:00
|
|
|
pop hl
|
2015-10-21 07:43:42 -07:00
|
|
|
ld bc, SCREEN_WIDTH
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .row
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
ResetBGPals:
|
2013-09-15 15:02:02 -07:00
|
|
|
push af
|
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push hl
|
2016-05-11 06:49:03 -07:00
|
|
|
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
2016-05-11 06:49:03 -07:00
|
|
|
|
2015-11-20 12:15:32 -08:00
|
|
|
ld hl, UnknBGPals
|
|
|
|
ld c, 8
|
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $ff
|
|
|
|
ld [hli], a
|
2016-05-11 06:49:03 -07:00
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
2016-05-11 06:49:03 -07:00
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hli], a
|
2013-09-15 15:02:02 -07:00
|
|
|
dec c
|
2015-11-20 12:15:32 -08:00
|
|
|
jr nz, .loop
|
2016-05-11 06:49:03 -07:00
|
|
|
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
2016-05-11 06:49:03 -07:00
|
|
|
|
2013-09-15 15:02:02 -07:00
|
|
|
pop hl
|
|
|
|
pop de
|
|
|
|
pop bc
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
WipeAttrMap:
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0, AttrMap
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
ApplyPals:
|
2015-11-20 12:15:32 -08:00
|
|
|
ld hl, UnknBGPals
|
2015-02-10 14:16:31 -08:00
|
|
|
ld de, BGPals
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, 16 palettes
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
ApplyAttrMap:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rLCDC]
|
|
|
|
bit 7, a
|
2015-12-16 18:57:42 -08:00
|
|
|
jr z, .UpdateVBank1
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hBGMapMode]
|
|
|
|
push af
|
|
|
|
ld a, $2
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
pop af
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.UpdateVBank1:
|
2015-07-22 12:57:02 -07:00
|
|
|
hlcoord 0, 0, AttrMap
|
2015-11-20 08:47:52 -08:00
|
|
|
debgcoord 0, 0
|
2015-12-16 18:57:42 -08:00
|
|
|
ld b, SCREEN_HEIGHT
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $1
|
|
|
|
ld [rVBK], a
|
2015-12-16 18:57:42 -08:00
|
|
|
.row
|
|
|
|
ld c, SCREEN_WIDTH
|
|
|
|
.col
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-12-16 18:57:42 -08:00
|
|
|
jr nz, .col
|
|
|
|
ld a, BG_MAP_WIDTH - SCREEN_WIDTH
|
2013-09-15 15:02:02 -07:00
|
|
|
add e
|
2015-12-16 18:57:42 -08:00
|
|
|
jr nc, .okay
|
2013-09-15 15:02:02 -07:00
|
|
|
inc d
|
2015-12-16 18:57:42 -08:00
|
|
|
.okay
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, a
|
|
|
|
dec b
|
2015-12-16 18:57:42 -08:00
|
|
|
jr nz, .row
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $0
|
|
|
|
ld [rVBK], a
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
CGB_ApplyPartyMenuHPPals: ; 96f3 CGB layout $fc
|
|
|
|
ld hl, wHPPals
|
2015-12-22 15:03:00 -08:00
|
|
|
ld a, [wSGBPals]
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, a
|
|
|
|
ld d, $0
|
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
ld a, [de]
|
|
|
|
inc a
|
|
|
|
ld e, a
|
2015-02-10 14:16:31 -08:00
|
|
|
hlcoord 11, 2, AttrMap
|
2015-12-22 19:19:33 -08:00
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
2015-12-22 15:03:00 -08:00
|
|
|
ld a, [wSGBPals]
|
2015-12-22 19:19:33 -08:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr z, .done
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, bc
|
|
|
|
dec a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr .loop
|
|
|
|
.done
|
2015-10-21 07:43:42 -07:00
|
|
|
lb bc, 2, 8
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, e
|
2015-11-12 21:49:27 -08:00
|
|
|
call FillBoxCGB
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
InitPartyMenuOBPals:
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, Palettes_b681
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknOBPals
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, 2 palettes
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetBattlemonBackpicPalettePointer:
|
2013-09-15 15:02:02 -07:00
|
|
|
push de
|
2015-11-06 13:42:38 -08:00
|
|
|
callba GetPartyMonDVs
|
2013-09-15 15:02:02 -07:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
ld a, [TempBattleMonSpecies]
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetPlayerOrMonPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetEnemyFrontpicPalettePointer:
|
2013-09-15 15:02:02 -07:00
|
|
|
push de
|
2015-11-06 13:42:38 -08:00
|
|
|
callba GetEnemyMonDVs
|
2013-09-15 15:02:02 -07:00
|
|
|
ld c, l
|
|
|
|
ld b, h
|
|
|
|
ld a, [TempEnemyMonSpecies]
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetFrontpicPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetPlayerOrMonPalettePointer:
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
2015-12-16 18:57:42 -08:00
|
|
|
jp nz, GetMonNormalOrShinyPalettePointer
|
2015-10-24 07:34:19 -07:00
|
|
|
ld a, [wPlayerSpriteSetupFlags]
|
2015-11-16 13:01:45 -08:00
|
|
|
bit 2, a ; transformed to male
|
2015-10-24 07:34:19 -07:00
|
|
|
jr nz, .male
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [PlayerGender]
|
|
|
|
and a
|
2015-10-24 07:34:19 -07:00
|
|
|
jr z, .male
|
2014-03-01 18:43:16 -08:00
|
|
|
ld hl, KrisPalette
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2015-10-24 07:34:19 -07:00
|
|
|
.male
|
2014-03-01 18:43:16 -08:00
|
|
|
ld hl, PlayerPalette
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetFrontpicPalettePointer:
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
2015-12-16 18:57:42 -08:00
|
|
|
jp nz, GetMonNormalOrShinyPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [TrainerClass]
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetTrainerPalettePointer:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld l, a
|
2014-03-01 18:43:16 -08:00
|
|
|
ld h, 0
|
2016-05-11 06:49:03 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2014-03-01 18:43:16 -08:00
|
|
|
ld bc, TrainerPalettes
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetMonPalettePointer_:
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetMonPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function9779: mobile
|
2014-03-01 18:43:16 -08:00
|
|
|
call CheckCGB
|
|
|
|
ret z
|
|
|
|
ld hl, Palettes_979c
|
|
|
|
ld a, $90
|
|
|
|
ld [rOBPI], a
|
2015-12-16 18:57:42 -08:00
|
|
|
ld c, 6 palettes
|
|
|
|
.loop
|
2014-03-01 18:43:16 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [rOBPD], a
|
|
|
|
dec c
|
2015-12-16 18:57:42 -08:00
|
|
|
jr nz, .loop
|
2014-03-01 18:43:16 -08:00
|
|
|
ld hl, Palettes_979c
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknOBPals + 8 * 2
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, 2 palettes
|
2014-03-01 18:43:16 -08:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_979c:
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 25, 25, 25
|
|
|
|
RGB 13, 13, 13
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 07
|
|
|
|
RGB 31, 16, 01
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 19, 24
|
|
|
|
RGB 30, 10, 06
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 12, 25, 01
|
|
|
|
RGB 05, 14, 00
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 08, 12, 31
|
|
|
|
RGB 01, 04, 31
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 18, 07
|
|
|
|
RGB 20, 15, 03
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function97cc:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
2014-03-01 18:43:16 -08:00
|
|
|
call CheckCGB
|
|
|
|
ret z
|
|
|
|
ld a, $90
|
|
|
|
ld [rOBPI], a
|
|
|
|
ld a, $1c
|
2015-12-22 15:03:00 -08:00
|
|
|
call GetPredefPal
|
2016-05-11 06:49:03 -07:00
|
|
|
call .PushPalette
|
2014-03-01 18:43:16 -08:00
|
|
|
ld a, $21
|
2015-12-22 15:03:00 -08:00
|
|
|
call GetPredefPal
|
2016-05-11 06:49:03 -07:00
|
|
|
call .PushPalette
|
2014-03-01 18:43:16 -08:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.PushPalette:
|
2015-12-16 18:57:42 -08:00
|
|
|
ld c, 1 palettes
|
2015-10-21 07:43:42 -07:00
|
|
|
.loop
|
2014-03-01 18:43:16 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [rOBPD], a
|
|
|
|
dec c
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .loop
|
2014-03-01 18:43:16 -08:00
|
|
|
ret
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetMonPalettePointer:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld l, a
|
|
|
|
ld h, $0
|
|
|
|
add hl, hl
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2015-02-06 21:07:35 -08:00
|
|
|
ld bc, PokemonPalettes
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, bc
|
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
GetMonNormalOrShinyPalettePointer:
|
2013-09-15 15:02:02 -07:00
|
|
|
push bc
|
2015-12-16 18:57:42 -08:00
|
|
|
call GetMonPalettePointer
|
2013-09-15 15:02:02 -07:00
|
|
|
pop bc
|
|
|
|
push hl
|
|
|
|
call CheckShininess
|
|
|
|
pop hl
|
|
|
|
ret nc
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 4
|
2013-09-15 15:02:02 -07:00
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
PushSGBPals_:
|
2015-02-10 14:16:31 -08:00
|
|
|
ld a, [wcfbe]
|
2013-09-15 15:02:02 -07:00
|
|
|
push af
|
|
|
|
set 7, a
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wcfbe], a
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wcfbe], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
PushSGBPals:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hl]
|
|
|
|
and $7
|
|
|
|
ret z
|
|
|
|
ld b, a
|
2015-10-21 07:43:42 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
push bc
|
|
|
|
xor a
|
|
|
|
ld [rJOYP], a
|
|
|
|
ld a, $30
|
|
|
|
ld [rJOYP], a
|
|
|
|
ld b, $10
|
2015-10-21 07:43:42 -07:00
|
|
|
.loop2
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, $8
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, a
|
2015-10-21 07:43:42 -07:00
|
|
|
.loop3
|
2013-09-15 15:02:02 -07:00
|
|
|
bit 0, d
|
|
|
|
ld a, $10
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .okay
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $20
|
2015-10-21 07:43:42 -07:00
|
|
|
.okay
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [rJOYP], a
|
|
|
|
ld a, $30
|
|
|
|
ld [rJOYP], a
|
|
|
|
rr d
|
|
|
|
dec e
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .loop3
|
2013-09-15 15:02:02 -07:00
|
|
|
dec b
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .loop2
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $20
|
|
|
|
ld [rJOYP], a
|
|
|
|
ld a, $30
|
|
|
|
ld [rJOYP], a
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
2013-09-15 15:02:02 -07:00
|
|
|
pop bc
|
|
|
|
dec b
|
2015-10-21 07:43:42 -07:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-05 12:07:37 -07:00
|
|
|
InitSGBBorder:
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
|
|
|
ret nz
|
2016-05-05 12:07:37 -07:00
|
|
|
; SGB/DMG only
|
2013-09-15 15:02:02 -07:00
|
|
|
di
|
2015-02-10 14:16:31 -08:00
|
|
|
ld a, [wcfbe]
|
2013-09-15 15:02:02 -07:00
|
|
|
push af
|
|
|
|
set 7, a
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wcfbe], a
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
ld [rJOYP], a
|
|
|
|
ld [hSGB], a
|
2016-05-11 06:49:03 -07:00
|
|
|
call PushSGBBorderPalsAndWait
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nc, .skip
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $1
|
|
|
|
ld [hSGB], a
|
2016-05-11 06:49:03 -07:00
|
|
|
call _InitSGBBorderPals
|
|
|
|
call SGBBorder_PushBGPals
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
2016-05-11 06:49:03 -07:00
|
|
|
call SGB_ClearVRAM
|
|
|
|
call PushSGBBorder
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
2016-05-11 06:49:03 -07:00
|
|
|
call SGB_ClearVRAM
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d66
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-05 12:07:37 -07:00
|
|
|
.skip
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wcfbe], a
|
2013-09-15 15:02:02 -07:00
|
|
|
ei
|
|
|
|
ret
|
|
|
|
|
2016-05-05 12:07:37 -07:00
|
|
|
InitCGBPals::
|
2013-09-15 15:02:02 -07:00
|
|
|
call CheckCGB
|
|
|
|
ret z
|
2016-05-05 12:07:37 -07:00
|
|
|
; CGB only
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $1
|
|
|
|
ld [rVBK], a
|
|
|
|
ld hl, VTiles0
|
2016-01-04 05:43:55 -08:00
|
|
|
ld bc, $200 tiles
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
ld a, $0
|
|
|
|
ld [rVBK], a
|
|
|
|
ld a, $80
|
|
|
|
ld [rBGPI], a
|
2016-01-04 05:43:55 -08:00
|
|
|
ld c, 4 * 8
|
|
|
|
.bgpals_loop
|
|
|
|
ld a, $7fff % $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [rBGPD], a
|
2016-01-04 05:43:55 -08:00
|
|
|
ld a, $7fff / $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [rBGPD], a
|
|
|
|
dec c
|
2016-01-04 05:43:55 -08:00
|
|
|
jr nz, .bgpals_loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $80
|
|
|
|
ld [rOBPI], a
|
2016-01-04 05:43:55 -08:00
|
|
|
ld c, 4 * 8
|
|
|
|
.obpals_loop
|
|
|
|
ld a, $7fff % $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [rOBPD], a
|
2016-01-04 05:43:55 -08:00
|
|
|
ld a, $7fff / $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [rOBPD], a
|
|
|
|
dec c
|
2016-01-04 05:43:55 -08:00
|
|
|
jr nz, .obpals_loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
2015-11-20 12:15:32 -08:00
|
|
|
ld hl, UnknBGPals
|
2016-01-04 05:43:55 -08:00
|
|
|
call .LoadWhitePals
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, BGPals
|
2016-01-04 05:43:55 -08:00
|
|
|
call .LoadWhitePals
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
ret
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.LoadWhitePals:
|
2016-01-04 05:43:55 -08:00
|
|
|
ld c, 4 * 16
|
2015-11-20 12:15:32 -08:00
|
|
|
.loop
|
2016-01-04 05:43:55 -08:00
|
|
|
ld a, $7fff % $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [hli], a
|
2016-01-04 05:43:55 -08:00
|
|
|
ld a, $7fff / $100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-11-20 12:15:32 -08:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
_InitSGBBorderPals:
|
2016-01-04 05:43:55 -08:00
|
|
|
ld hl, .PalPacketPointerTable
|
|
|
|
ld c, 9
|
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
push bc
|
|
|
|
ld a, [hli]
|
|
|
|
push hl
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
pop hl
|
|
|
|
inc hl
|
|
|
|
pop bc
|
|
|
|
dec c
|
2016-01-04 05:43:55 -08:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
.PalPacketPointerTable:
|
2014-03-02 13:02:55 -08:00
|
|
|
dw PalPacket_9d56
|
|
|
|
dw PalPacket_9d76
|
|
|
|
dw PalPacket_9d86
|
|
|
|
dw PalPacket_9d96
|
|
|
|
dw PalPacket_9da6
|
|
|
|
dw PalPacket_9db6
|
|
|
|
dw PalPacket_9dc6
|
|
|
|
dw PalPacket_9dd6
|
|
|
|
dw PalPacket_9de6
|
2014-03-01 18:43:16 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Function9911:
|
2016-05-11 06:49:03 -07:00
|
|
|
; XXX
|
2014-03-01 18:43:16 -08:00
|
|
|
di
|
|
|
|
xor a
|
|
|
|
ld [rJOYP], a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d56
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2016-05-11 06:49:03 -07:00
|
|
|
call PushSGBBorder
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
2016-05-11 06:49:03 -07:00
|
|
|
call SGB_ClearVRAM
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d66
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2014-03-01 18:43:16 -08:00
|
|
|
ei
|
|
|
|
ret
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
PushSGBBorder:
|
2016-01-04 05:43:55 -08:00
|
|
|
call .LoadSGBBorderPointers
|
2013-09-15 15:02:02 -07:00
|
|
|
push de
|
2016-05-11 06:49:03 -07:00
|
|
|
call SGBBorder_YetMorePalPushing
|
2013-09-15 15:02:02 -07:00
|
|
|
pop hl
|
2016-05-11 06:49:03 -07:00
|
|
|
call SGBBorder_MorePalPushing
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
.LoadSGBBorderPointers:
|
2013-12-13 17:49:01 -08:00
|
|
|
ld hl, SGBBorder
|
2014-03-01 18:43:16 -08:00
|
|
|
ld de, SGBBorderMap
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
SGB_ClearVRAM:
|
2013-09-15 15:02:02 -07:00
|
|
|
ld hl, VTiles0
|
|
|
|
ld bc, $2000
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
PushSGBBorderPalsAndWait:
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d26
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rJOYP]
|
|
|
|
and $3
|
|
|
|
cp $3
|
2016-05-11 06:49:03 -07:00
|
|
|
jr nz, .carry
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $20
|
|
|
|
ld [rJOYP], a
|
|
|
|
ld a, [rJOYP]
|
2015-12-26 18:59:03 -08:00
|
|
|
ld a, [rJOYP]
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
|
|
|
call SGBDelayCycles
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $30
|
|
|
|
ld [rJOYP], a
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
|
|
|
call SGBDelayCycles
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $10
|
|
|
|
ld [rJOYP], a
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 6
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rJOYP]
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
|
|
|
call SGBDelayCycles
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $30
|
|
|
|
ld [rJOYP], a
|
|
|
|
ld a, [rJOYP]
|
2016-05-10 09:31:49 -07:00
|
|
|
ld a, [rJOYP]
|
|
|
|
ld a, [rJOYP]
|
2015-12-22 19:19:33 -08:00
|
|
|
call SGBDelayCycles
|
|
|
|
call SGBDelayCycles
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rJOYP]
|
|
|
|
and $3
|
|
|
|
cp $3
|
2016-05-11 06:49:03 -07:00
|
|
|
jr nz, .carry
|
|
|
|
call .FinalPush
|
2013-09-15 15:02:02 -07:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.carry
|
|
|
|
call .FinalPush
|
2013-09-15 15:02:02 -07:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
.FinalPush:
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d16
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2015-12-22 19:19:33 -08:00
|
|
|
jp SGBDelayCycles
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
SGBBorder_PushBGPals:
|
2013-09-15 15:02:02 -07:00
|
|
|
call DisableLCD
|
2016-05-05 12:07:37 -07:00
|
|
|
ld a, %11100100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [rBGP], a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, Palettes_9df6
|
2013-09-15 15:02:02 -07:00
|
|
|
ld de, VTiles1
|
|
|
|
ld bc, $1000
|
|
|
|
call CopyData
|
|
|
|
call DrawDefaultTiles
|
|
|
|
ld a, $e3
|
|
|
|
ld [rLCDC], a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d06
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
ld [rBGP], a
|
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
SGBBorder_MorePalPushing:
|
2013-09-15 15:02:02 -07:00
|
|
|
call DisableLCD
|
|
|
|
ld a, $e4
|
|
|
|
ld [rBGP], a
|
|
|
|
ld de, VTiles1
|
2015-11-16 13:01:45 -08:00
|
|
|
ld bc, 20 tiles
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyData
|
2016-01-04 05:43:55 -08:00
|
|
|
ld b, 18
|
2016-05-11 06:49:03 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
push bc
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, $c
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyData
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, $28
|
2013-09-15 15:02:02 -07:00
|
|
|
call ClearBytes
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, $c
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyData
|
|
|
|
pop bc
|
|
|
|
dec b
|
2016-05-11 06:49:03 -07:00
|
|
|
jr nz, .loop
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, $140
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyData
|
|
|
|
ld bc, Start
|
|
|
|
call ClearBytes
|
2015-12-09 15:25:44 -08:00
|
|
|
ld bc, 16 palettes
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyData
|
|
|
|
call DrawDefaultTiles
|
|
|
|
ld a, $e3
|
|
|
|
ld [rLCDC], a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d46
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
ld [rBGP], a
|
|
|
|
ret
|
|
|
|
|
2016-05-11 06:49:03 -07:00
|
|
|
SGBBorder_YetMorePalPushing:
|
2013-09-15 15:02:02 -07:00
|
|
|
call DisableLCD
|
2016-01-04 05:43:55 -08:00
|
|
|
ld a, %11100100
|
2013-09-15 15:02:02 -07:00
|
|
|
ld [rBGP], a
|
|
|
|
ld de, VTiles1
|
|
|
|
ld b, $80
|
2016-05-11 06:49:03 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
push bc
|
2016-01-04 05:43:55 -08:00
|
|
|
ld bc, 1 tiles
|
2013-09-15 15:02:02 -07:00
|
|
|
call CopyData
|
2016-01-04 05:43:55 -08:00
|
|
|
ld bc, 1 tiles
|
2013-09-15 15:02:02 -07:00
|
|
|
call ClearBytes
|
|
|
|
pop bc
|
|
|
|
dec b
|
2016-05-11 06:49:03 -07:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
call DrawDefaultTiles
|
|
|
|
ld a, $e3
|
|
|
|
ld [rLCDC], a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld hl, PalPacket_9d36
|
2016-01-04 05:43:55 -08:00
|
|
|
call PushSGBPals
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
ld [rBGP], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
CopyData: ; 0x9a52
|
|
|
|
; copy bc bytes of data from hl to de
|
2016-05-05 12:07:37 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec bc
|
|
|
|
ld a, c
|
|
|
|
or b
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
; 0x9a5b
|
|
|
|
|
|
|
|
ClearBytes: ; 0x9a5b
|
|
|
|
; clear bc bytes of data starting from de
|
2016-05-05 12:07:37 -07:00
|
|
|
.loop
|
2013-09-15 15:02:02 -07:00
|
|
|
xor a
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec bc
|
|
|
|
ld a, c
|
|
|
|
or b
|
2016-05-05 12:07:37 -07:00
|
|
|
jr nz, .loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
; 0x9a64
|
|
|
|
|
|
|
|
DrawDefaultTiles: ; 0x9a64
|
|
|
|
; Draw 240 tiles (2/3 of the screen) from tiles in VRAM
|
2015-11-20 08:47:52 -08:00
|
|
|
hlbgcoord 0, 0 ; BG Map 0
|
2016-01-04 05:43:55 -08:00
|
|
|
ld de, BG_MAP_WIDTH - SCREEN_WIDTH
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $80 ; starting tile
|
|
|
|
ld c, 12 + 1
|
|
|
|
.line
|
|
|
|
ld b, 20
|
|
|
|
.tile
|
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
dec b
|
|
|
|
jr nz, .tile
|
|
|
|
; next line
|
|
|
|
add hl, de
|
|
|
|
dec c
|
|
|
|
jr nz, .line
|
|
|
|
ret
|
|
|
|
; 0x9a7a
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
SGBDelayCycles:
|
2015-12-22 19:19:33 -08:00
|
|
|
ld de, 7000
|
|
|
|
.wait
|
2013-09-15 15:02:02 -07:00
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
dec de
|
|
|
|
ld a, d
|
|
|
|
or e
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nz, .wait
|
2013-09-15 15:02:02 -07:00
|
|
|
ret
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9a86:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $01, $03, $00, $00, $00, $13, $11, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9a96:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $01, $07, $05, $00, $0a, $13, $0d, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9aa6:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $22, $05, $07, $0a, $00, $0c, $13, $11, $03, $05, $01, $00, $0a, $03, $03, $00
|
|
|
|
db $0a, $08, $13, $0a, $03, $0a, $00, $04, $08, $0b, $03, $0f, $0b, $00, $13, $07
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9ac6:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $01, $07, $05, $00, $01, $07, $07, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9ad6:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $01, $07, $05, $0b, $01, $13, $02, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9ae6:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $01, $07, $05, $01, $01, $08, $08, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9af6:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $01, $07, $05, $07, $05, $0d, $0b, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9b06:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $22, $05, $03, $05, $00, $00, $13, $0b, $03, $0a, $00, $04, $13, $09, $02, $0f
|
|
|
|
db $00, $06, $13, $07, $03, $00, $04, $04, $0f, $09, $03, $00, $00, $0c, $13, $11
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9b26:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $23, $07, $07, $10, $00, $00, $02, $0c, $02, $00, $0c, $00, $12, $01, $02, $00
|
|
|
|
db $0c, $02, $12, $03, $02, $00, $0c, $04, $12, $05, $02, $00, $0c, $06, $12, $07
|
|
|
|
db $02, $00, $0c, $08, $12, $09, $02, $00, $0c, $0a, $12, $0b, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9b56:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $22, $03, $07, $20, $00, $00, $13, $04, $03, $0f, $00, $06, $13, $11, $03, $05
|
|
|
|
db $0f, $01, $12, $04, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9b76:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $01, $07, $10, $00, $00, $13, $05, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
BlkPacket_9b86:
|
2014-03-01 18:43:16 -08:00
|
|
|
db $21, $02, $07, $0a, $00, $04, $13, $0d, $03, $05, $00, $06, $13, $0b, $00, $00
|
2015-11-16 13:01:45 -08:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
PalPacket_9b96: db $51, $48, $00, $49, $00, $4a, $00, $4b, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9ba6: db $51, $2b, $00, $24, $00, $20, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9bb6: db $51, $41, $00, $42, $00, $43, $00, $44, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9bc6: db $51, $4c, $00, $4c, $00, $4c, $00, $4c, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9bd6: db $51, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9be6: db $51, $36, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9bf6: db $51, $37, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c06: db $51, $38, $00, $39, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c16: db $51, $3a, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c26: db $51, $3b, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c36: db $51, $3c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c46: db $51, $39, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c56: db $51, $2e, $00, $2f, $00, $30, $00, $31, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c66: db $51, $1a, $00, $1a, $00, $1a, $00, $1a, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c76: db $51, $32, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c86: db $51, $3c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9c96: db $51, $3d, $00, $3e, $00, $3f, $00, $40, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9ca6: db $51, $33, $00, $34, $00, $1b, $00, $1f, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9cb6: db $51, $1b, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9cc6: db $51, $1c, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9cd6: db $51, $35, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9ce6: db $01, $ff, $7f, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9cf6: db $09, $ff, $7f, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d06: db $59, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d16: db $89, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d26: db $89, $01, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d36: db $99, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d46: db $a1, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d56: db $b9, $01, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d66: db $b9, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d76: db $79, $5d, $08, $00, $0b, $8c, $d0, $f4, $60, $00, $00, $00, $00, $00, $00, $00
|
|
|
|
PalPacket_9d86: db $79, $52, $08, $00, $0b, $a9, $e7, $9f, $01, $c0, $7e, $e8, $e8, $e8, $e8, $e0
|
|
|
|
PalPacket_9d96: db $79, $47, $08, $00, $0b, $c4, $d0, $16, $a5, $cb, $c9, $05, $d0, $10, $a2, $28
|
|
|
|
PalPacket_9da6: db $79, $3c, $08, $00, $0b, $f0, $12, $a5, $c9, $c9, $c8, $d0, $1c, $a5, $ca, $c9
|
|
|
|
PalPacket_9db6: db $79, $31, $08, $00, $0b, $0c, $a5, $ca, $c9, $7e, $d0, $06, $a5, $cb, $c9, $7e
|
|
|
|
PalPacket_9dc6: db $79, $26, $08, $00, $0b, $39, $cd, $48, $0c, $d0, $34, $a5, $c9, $c9, $80, $d0
|
|
|
|
PalPacket_9dd6: db $79, $1b, $08, $00, $0b, $ea, $ea, $ea, $ea, $ea, $a9, $01, $cd, $4f, $0c, $d0
|
|
|
|
PalPacket_9de6: db $79, $10, $08, $00, $0b, $4c, $20, $08, $ea, $ea, $ea, $ea, $ea, $60, $ea, $ea
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_9df6:
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 22, 25, 19
|
|
|
|
RGB 16, 21, 30
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 27, 28, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 28, 19
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 24, 24
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 23, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 21, 27
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 24, 16
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 25, 30, 26
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 25, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 20, 19
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 26, 19
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 27, 28, 27
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 30, 23
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 29, 24, 29
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 26, 23, 29
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 25, 23, 20
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 29, 26, 18
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 21, 18
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 26, 25, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 22, 21, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 22, 25, 21
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 21, 22
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 20, 20
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 26, 26, 26
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 14, 09
|
|
|
|
RGB 15, 20, 20
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 12, 28, 22
|
|
|
|
RGB 15, 20, 20
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 07, 07, 07
|
|
|
|
RGB 02, 03, 03
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 22, 17
|
|
|
|
RGB 16, 14, 19
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 18, 20, 27
|
|
|
|
RGB 11, 15, 23
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 20, 10
|
|
|
|
RGB 26, 10, 06
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 25, 29
|
|
|
|
RGB 14, 19, 25
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 27, 22, 24
|
|
|
|
RGB 21, 15, 23
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 28, 20, 15
|
|
|
|
RGB 21, 14, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 20, 26, 16
|
|
|
|
RGB 09, 20, 11
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 22, 24
|
|
|
|
RGB 28, 15, 21
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 28, 14
|
|
|
|
RGB 26, 20, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 26, 21, 22
|
|
|
|
RGB 15, 15, 18
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 23, 19, 13
|
|
|
|
RGB 14, 12, 17
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 16, 18, 21
|
|
|
|
RGB 10, 12, 18
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 22, 15, 16
|
|
|
|
RGB 17, 02, 05
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 15, 20, 20
|
|
|
|
RGB 05, 16, 16
|
|
|
|
RGB 00, 00, 00
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 23, 15, 19
|
|
|
|
RGB 14, 04, 12
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 20, 17, 18
|
|
|
|
RGB 18, 13, 11
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 23, 21, 16
|
|
|
|
RGB 12, 12, 10
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 25, 29
|
|
|
|
RGB 30, 22, 24
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 26, 23, 16
|
|
|
|
RGB 29, 14, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 10, 10, 10
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 26, 15
|
|
|
|
RGB 00, 23, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 26, 15
|
|
|
|
RGB 31, 23, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 26, 15
|
|
|
|
RGB 31, 00, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 29, 26, 19
|
|
|
|
RGB 27, 20, 14
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 20, 10
|
|
|
|
RGB 21, 00, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 20, 10
|
|
|
|
RGB 21, 00, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 26, 16
|
|
|
|
RGB 16, 12, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 15, 28, 26
|
|
|
|
RGB 12, 22, 26
|
|
|
|
RGB 03, 16, 14
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 15, 28, 26
|
|
|
|
RGB 23, 24, 24
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 24
|
|
|
|
RGB 07, 27, 19
|
|
|
|
RGB 26, 20, 10
|
|
|
|
RGB 19, 12, 08
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 28, 14
|
|
|
|
RGB 31, 13, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 16, 18, 21
|
|
|
|
RGB 10, 12, 18
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 23, 21, 16
|
|
|
|
RGB 12, 12, 10
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 14, 00
|
|
|
|
RGB 07, 11, 15
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 26, 21, 22
|
|
|
|
RGB 26, 10, 06
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 27, 04
|
|
|
|
RGB 24, 20, 11
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 13, 25
|
|
|
|
RGB 24, 20, 11
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 16, 19, 29
|
|
|
|
RGB 24, 20, 11
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 22, 24
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 16, 10, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 25, 29
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 16, 10, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 20, 26, 16
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 16, 10, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 28, 14
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 16, 10, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 26, 10, 06
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 22, 24
|
|
|
|
RGB 28, 15, 21
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 26, 20, 00
|
|
|
|
RGB 16, 19, 29
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 16, 02, 30
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 16, 13, 04
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 28, 04, 02
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 18, 23, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 20, 11
|
|
|
|
RGB 18, 13, 11
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 25, 30, 00
|
|
|
|
RGB 25, 30, 00
|
|
|
|
|
|
|
|
RGB 00, 00, 00
|
|
|
|
RGB 08, 11, 11
|
|
|
|
RGB 21, 21, 21
|
|
|
|
RGB 31, 31, 31
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
SGBBorderMap:
|
2016-05-11 06:49:03 -07:00
|
|
|
db $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $14, $14, $15, $14, $16, $14, $17, $14, $17, $54, $16, $54, $15, $54, $14, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14
|
|
|
|
db $01, $14, $02, $14, $03, $14, $03, $54, $02, $54, $01, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $24, $14, $25, $14, $26, $14, $07, $14, $07, $54, $26, $54, $25, $54, $24, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $54, $01, $14, $02, $14, $03, $14, $03, $54, $02, $54, $01, $54
|
|
|
|
db $11, $14, $12, $14, $13, $14, $13, $54, $12, $54, $11, $54, $10, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $24, $14, $34, $14, $35, $14, $35, $54, $34, $54, $33, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $10, $14, $11, $14, $12, $14, $13, $14, $13, $54, $12, $54, $11, $54
|
|
|
|
db $21, $14, $22, $14, $23, $14, $23, $54, $22, $54, $21, $54, $20, $54, $07, $14, $08, $14, $09, $14, $0a, $14, $0b, $14, $0c, $14, $0d, $14, $07, $14, $07, $14, $18, $14, $09, $14, $1a, $14, $1b, $14, $0d, $14, $0c, $14, $1c, $14, $29, $14, $07, $14, $20, $14, $21, $14, $22, $14, $23, $14, $23, $54, $22, $54, $21, $54
|
|
|
|
db $31, $14, $32, $14, $07, $14, $07, $14, $32, $54, $36, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $38, $10, $27, $10, $32, $14, $07, $54, $07, $54, $32, $54, $31, $54
|
|
|
|
db $05, $14, $06, $14, $07, $14, $07, $54, $06, $54, $1f, $10, $37, $10, $06, $14, $07, $14, $07, $54, $06, $54, $05, $54
|
|
|
|
db $15, $14, $16, $14, $17, $14, $17, $54, $16, $54, $1f, $10, $37, $10, $16, $14, $17, $14, $17, $54, $16, $54, $15, $54
|
|
|
|
db $25, $14, $26, $14, $07, $14, $07, $54, $26, $54, $1f, $10, $37, $10, $26, $14, $07, $14, $07, $54, $26, $54, $25, $54
|
|
|
|
db $33, $14, $34, $14, $35, $14, $35, $54, $34, $54, $1f, $10, $37, $10, $34, $14, $35, $14, $35, $54, $34, $54, $33, $54
|
|
|
|
db $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14
|
|
|
|
db $02, $54, $01, $54, $07, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $07, $14, $01, $14, $02, $14
|
|
|
|
db $12, $54, $11, $54, $10, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $10, $14, $11, $14, $12, $14
|
|
|
|
db $22, $54, $21, $54, $20, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $20, $14, $21, $14, $22, $14
|
|
|
|
db $32, $54, $31, $54, $30, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $30, $14, $31, $14, $32, $14
|
|
|
|
db $06, $54, $05, $54, $04, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $04, $14, $05, $14, $06, $14
|
|
|
|
db $16, $54, $15, $54, $14, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $14, $14, $15, $14, $16, $14
|
|
|
|
db $26, $54, $25, $54, $24, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $24, $14, $25, $14, $26, $14
|
|
|
|
db $34, $54, $33, $54, $07, $54, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $07, $14, $33, $14, $34, $14
|
|
|
|
db $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $1f, $10, $37, $10, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14
|
|
|
|
db $01, $14, $02, $14, $03, $14, $03, $54, $02, $54, $1f, $10, $37, $10, $02, $14, $03, $14, $03, $54, $02, $54, $01, $54
|
|
|
|
db $11, $14, $12, $14, $13, $14, $13, $54, $12, $54, $1f, $10, $37, $10, $12, $14, $13, $14, $13, $54, $12, $54, $11, $54
|
|
|
|
db $21, $14, $22, $14, $23, $14, $23, $54, $22, $54, $1f, $10, $37, $10, $22, $14, $23, $14, $23, $54, $22, $54, $21, $54
|
|
|
|
db $31, $14, $32, $14, $07, $14, $07, $14, $32, $54, $1f, $10, $37, $10, $32, $14, $07, $54, $07, $54, $32, $54, $31, $54
|
|
|
|
db $05, $14, $06, $14, $07, $14, $07, $54, $06, $54, $2e, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2f, $10, $2d, $10, $06, $14, $07, $14, $07, $54, $06, $54, $05, $54
|
|
|
|
db $15, $14, $16, $14, $17, $14, $17, $54, $16, $54, $15, $54, $14, $54, $07, $14, $07, $14, $39, $14, $0e, $14, $09, $14, $0f, $14, $28, $14, $07, $14, $19, $14, $0c, $14, $1c, $14, $29, $14, $2a, $14, $2b, $14, $2c, $14, $39, $14, $07, $14, $07, $14, $14, $14, $15, $14, $16, $14, $17, $14, $17, $54, $16, $54, $15, $54
|
|
|
|
db $25, $14, $26, $14, $07, $14, $07, $54, $26, $54, $25, $54, $24, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $01, $14, $02, $14, $03, $14, $03, $54, $02, $54, $01, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $24, $14, $25, $14, $26, $14, $07, $14, $07, $54, $26, $54, $25, $54
|
|
|
|
db $33, $14, $34, $14, $35, $14, $35, $54, $34, $54, $24, $54, $07, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $10, $14, $11, $14, $12, $14, $13, $14, $13, $54, $12, $54, $11, $54, $10, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $24, $14, $34, $14, $35, $14, $35, $54, $34, $54, $33, $54
|
|
|
|
db $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $20, $14, $21, $14, $22, $14, $23, $14, $23, $54, $22, $54, $21, $54, $20, $54, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14, $07, $14
|
2014-03-01 18:43:16 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
SGBBorderPalettes:
|
2014-03-01 22:22:33 -08:00
|
|
|
RGB 24, 06, 06
|
|
|
|
RGB 24, 24, 26
|
|
|
|
RGB 14, 15, 20
|
|
|
|
RGB 04, 07, 10
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 18, 24, 18
|
|
|
|
RGB 31, 26, 15
|
|
|
|
RGB 26, 19, 10
|
|
|
|
RGB 12, 07, 05
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 18, 06, 31
|
|
|
|
RGB 31, 31, 29
|
|
|
|
RGB 31, 12, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 12, 31, 06
|
|
|
|
RGB 22, 26, 30
|
|
|
|
RGB 16, 17, 21
|
|
|
|
RGB 00, 03, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
|
|
|
RGB 31, 31, 25
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
SGBBorder:
|
2013-09-15 15:02:02 -07:00
|
|
|
INCBIN "gfx/misc/sgb_border.2bpp"
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_a8be:
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 30, 26, 15
|
|
|
|
RGB 00, 23, 00
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 30, 26, 15
|
|
|
|
RGB 31, 21, 00
|
2013-09-15 15:02:02 -07:00
|
|
|
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 30, 26, 15
|
|
|
|
RGB 31, 00, 00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_a8ca:
|
2014-03-01 18:43:16 -08:00
|
|
|
RGB 30, 26, 15
|
|
|
|
RGB 04, 17, 31
|
|
|
|
|
|
|
|
INCLUDE "gfx/pics/palette_pointers.asm"
|
2013-09-15 15:02:02 -07:00
|
|
|
|
|
|
|
INCLUDE "gfx/trainers/palette_pointers.asm"
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
LoadMapPals:
|
2015-11-12 08:10:19 -08:00
|
|
|
callba LoadSpecialMapPalette
|
2015-12-22 15:03:00 -08:00
|
|
|
jr c, .got_pals
|
2015-06-23 10:46:51 -07:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
; Which palette group is based on whether we're outside or inside
|
2015-07-20 21:02:21 -07:00
|
|
|
ld a, [wPermission]
|
2014-03-01 22:22:33 -08:00
|
|
|
and 7
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, a
|
2014-03-01 22:22:33 -08:00
|
|
|
ld d, 0
|
2015-12-22 15:03:00 -08:00
|
|
|
ld hl, .TilesetColorsPointers
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, de
|
2015-12-26 18:59:03 -08:00
|
|
|
add hl, de
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2016-04-02 06:28:46 -07:00
|
|
|
; Futher refine by time of day
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [TimeOfDayPal]
|
2014-03-01 22:22:33 -08:00
|
|
|
and 3
|
2013-09-15 15:02:02 -07:00
|
|
|
add a
|
2016-04-02 06:28:46 -07:00
|
|
|
add a
|
|
|
|
add a
|
2013-09-15 15:02:02 -07:00
|
|
|
ld e, a
|
2014-03-01 22:22:33 -08:00
|
|
|
ld d, 0
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2016-04-02 06:28:46 -07:00
|
|
|
; Switch to palettes WRAM bank
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [rSVBK]
|
|
|
|
push af
|
|
|
|
ld a, $5
|
|
|
|
ld [rSVBK], a
|
2015-11-20 12:15:32 -08:00
|
|
|
ld hl, UnknBGPals
|
2015-12-22 15:03:00 -08:00
|
|
|
ld b, 8
|
|
|
|
.outer_loop
|
2016-04-02 06:28:46 -07:00
|
|
|
ld a, [de] ; lookup index for TilesetBGPalette
|
2013-09-15 15:02:02 -07:00
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
ld l, a
|
2014-03-01 22:22:33 -08:00
|
|
|
ld h, 0
|
2016-04-02 06:28:46 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2015-06-23 10:46:51 -07:00
|
|
|
ld de, TilesetBGPalette
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
|
|
|
pop hl
|
2015-12-22 15:03:00 -08:00
|
|
|
ld c, 1 palettes
|
|
|
|
.inner_loop
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2015-12-22 15:03:00 -08:00
|
|
|
jr nz, .inner_loop
|
2013-09-15 15:02:02 -07:00
|
|
|
pop de
|
|
|
|
inc de
|
|
|
|
dec b
|
2015-12-22 15:03:00 -08:00
|
|
|
jr nz, .outer_loop
|
2013-09-15 15:02:02 -07:00
|
|
|
pop af
|
|
|
|
ld [rSVBK], a
|
|
|
|
|
2015-12-22 15:03:00 -08:00
|
|
|
.got_pals
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [TimeOfDayPal]
|
2014-03-01 22:22:33 -08:00
|
|
|
and 3
|
2015-12-22 15:03:00 -08:00
|
|
|
ld bc, 8 palettes
|
2015-06-23 10:46:51 -07:00
|
|
|
ld hl, MapObjectPals
|
2013-09-15 15:02:02 -07:00
|
|
|
call AddNTimes
|
2015-11-20 12:15:32 -08:00
|
|
|
ld de, UnknOBPals
|
2015-12-22 15:03:00 -08:00
|
|
|
ld bc, 8 palettes
|
2015-11-20 12:15:32 -08:00
|
|
|
ld a, $5 ; BANK(UnknOBPals)
|
2013-09-15 15:02:02 -07:00
|
|
|
call FarCopyWRAM
|
2015-06-23 10:46:51 -07:00
|
|
|
|
2015-07-20 21:02:21 -07:00
|
|
|
ld a, [wPermission]
|
2015-12-22 15:03:00 -08:00
|
|
|
cp TOWN
|
|
|
|
jr z, .outside
|
|
|
|
cp ROUTE
|
2013-09-15 15:02:02 -07:00
|
|
|
ret nz
|
2015-12-22 15:03:00 -08:00
|
|
|
.outside
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, [MapGroup]
|
|
|
|
ld l, a
|
2014-03-02 13:02:55 -08:00
|
|
|
ld h, 0
|
2016-05-11 06:49:03 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2015-06-23 10:46:51 -07:00
|
|
|
ld de, RoofPals
|
2013-09-15 15:02:02 -07:00
|
|
|
add hl, de
|
|
|
|
ld a, [TimeOfDayPal]
|
2014-03-02 13:02:55 -08:00
|
|
|
and 3
|
2015-06-23 10:46:51 -07:00
|
|
|
cp NITE
|
2015-12-22 15:03:00 -08:00
|
|
|
jr c, .morn_day
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 4
|
2013-09-15 15:02:02 -07:00
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2015-12-22 15:03:00 -08:00
|
|
|
.morn_day
|
|
|
|
ld de, UnknBGPals + 6 palettes + 2
|
2015-06-23 10:46:51 -07:00
|
|
|
ld bc, 4
|
2013-09-15 15:02:02 -07:00
|
|
|
ld a, $5
|
|
|
|
call FarCopyWRAM
|
|
|
|
ret
|
2016-04-02 06:28:46 -07:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.TilesetColorsPointers:
|
2016-04-02 06:28:46 -07:00
|
|
|
dw .OutdoorColors ; unused
|
|
|
|
dw .OutdoorColors ; TOWN
|
|
|
|
dw .OutdoorColors ; ROUTE
|
|
|
|
dw .IndoorColors ; INDOOR
|
|
|
|
dw .DungeonColors ; CAVE
|
|
|
|
dw .Perm5Colors ; PERM_5
|
|
|
|
dw .IndoorColors ; GATE
|
|
|
|
dw .DungeonColors ; DUNGEON
|
|
|
|
|
|
|
|
; Valid indices: $00 - $29
|
2016-04-10 11:42:14 -07:00
|
|
|
.OutdoorColors:
|
2016-04-02 06:28:46 -07:00
|
|
|
db $00, $01, $02, $28, $04, $05, $06, $07 ; morn
|
|
|
|
db $08, $09, $0a, $28, $0c, $0d, $0e, $0f ; day
|
|
|
|
db $10, $11, $12, $29, $14, $15, $16, $17 ; nite
|
|
|
|
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.IndoorColors:
|
2016-04-02 06:28:46 -07:00
|
|
|
db $20, $21, $22, $23, $24, $25, $26, $07 ; morn
|
|
|
|
db $20, $21, $22, $23, $24, $25, $26, $07 ; day
|
|
|
|
db $10, $11, $12, $13, $14, $15, $16, $07 ; nite
|
|
|
|
db $18, $19, $1a, $1b, $1c, $1d, $1e, $07 ; dark
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.DungeonColors:
|
2016-04-02 06:28:46 -07:00
|
|
|
db $00, $01, $02, $03, $04, $05, $06, $07 ; morn
|
|
|
|
db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day
|
|
|
|
db $10, $11, $12, $13, $14, $15, $16, $17 ; nite
|
|
|
|
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.Perm5Colors:
|
2016-04-02 06:28:46 -07:00
|
|
|
db $00, $01, $02, $03, $04, $05, $06, $07 ; morn
|
|
|
|
db $08, $09, $0a, $0b, $0c, $0d, $0e, $0f ; day
|
|
|
|
db $10, $11, $12, $13, $14, $15, $16, $17 ; nite
|
|
|
|
db $18, $19, $1a, $1b, $1c, $1d, $1e, $1f ; dark
|
2014-03-01 22:22:33 -08:00
|
|
|
|
2015-12-26 15:11:55 -08:00
|
|
|
Palette_b309: ; b309 mobile
|
2014-03-01 22:22:33 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 19, 24
|
|
|
|
RGB 30, 10, 06
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2015-12-26 15:11:55 -08:00
|
|
|
Palette_b311: ; b311 not mobile
|
2014-03-01 22:22:33 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 17, 19, 31
|
|
|
|
RGB 14, 16, 31
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
TilesetBGPalette:
|
2015-06-23 10:46:51 -07:00
|
|
|
INCLUDE "tilesets/bg.pal"
|
2014-03-02 13:02:55 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
MapObjectPals::
|
2015-06-23 10:46:51 -07:00
|
|
|
INCLUDE "tilesets/ob.pal"
|
2014-03-02 13:02:55 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
RoofPals:
|
2015-06-23 10:46:51 -07:00
|
|
|
INCLUDE "tilesets/roof.pal"
|
2014-03-02 13:02:55 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_b641:
|
2014-03-02 13:02:55 -08:00
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 21, 21, 21
|
|
|
|
RGB 13, 13, 13
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 07, 06
|
|
|
|
RGB 20, 02, 03
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 10, 31, 09
|
|
|
|
RGB 04, 14, 01
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 08, 12, 31
|
|
|
|
RGB 01, 04, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 31, 07
|
|
|
|
RGB 31, 16, 01
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 22, 16, 08
|
|
|
|
RGB 13, 07, 01
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 15, 31, 31
|
|
|
|
RGB 05, 17, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 11, 11, 19
|
|
|
|
RGB 07, 07, 12
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_b681:
|
2014-03-02 13:02:55 -08:00
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 31, 07, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 10, 14, 20
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 31, 07, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 31, 07, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 31, 07, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 31, 07, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 31, 07, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 27, 31, 27
|
|
|
|
RGB 31, 19, 10
|
|
|
|
RGB 31, 07, 04
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 21, 21
|
|
|
|
RGB 13, 13, 13
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 07
|
|
|
|
RGB 31, 16, 01
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 19, 24
|
|
|
|
RGB 30, 10, 06
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 12, 25, 01
|
|
|
|
RGB 05, 14, 00
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 08, 12, 31
|
|
|
|
RGB 01, 04, 31
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 18, 07
|
|
|
|
RGB 20, 15, 03
|
|
|
|
RGB 07, 07, 07
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_b6f1:
|
2014-03-02 13:02:55 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 18, 23, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 22, 00, 31
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 00, 00
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 25, 22, 00
|
|
|
|
RGB 15, 20, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 23, 26, 31
|
|
|
|
RGB 18, 23, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_b719:
|
2014-03-02 13:02:55 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 07, 06, 03
|
|
|
|
RGB 07, 06, 03
|
|
|
|
RGB 07, 06, 03
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 00
|
|
|
|
RGB 26, 22, 00
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
MalePokegearPals:
|
2014-03-01 22:22:33 -08:00
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 21, 21, 21
|
|
|
|
RGB 13, 13, 13
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 00, 00, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 15, 07, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 31, 15, 00
|
|
|
|
RGB 15, 07, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 00, 00, 31
|
|
|
|
RGB 31, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 15, 07, 00
|
|
|
|
RGB 31, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
FemalePokegearPals:
|
2014-03-01 22:22:33 -08:00
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 21, 21, 21
|
|
|
|
RGB 13, 13, 13
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 00, 00, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 15, 07, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 10, 18, 31
|
|
|
|
RGB 13, 06, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 00, 00, 31
|
|
|
|
RGB 31, 00, 00
|
|
|
|
|
|
|
|
RGB 28, 31, 20
|
|
|
|
RGB 00, 31, 00
|
|
|
|
RGB 15, 07, 00
|
|
|
|
RGB 31, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_b789:
|
2014-03-01 22:22:33 -08:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 22, 24
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 10, 11, 31
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 12, 31, 11
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 29, 26, 05
|
|
|
|
RGB 18, 18, 18
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|
2016-04-02 06:28:46 -07:00
|
|
|
Palettes_b7a9:
|
2013-09-15 15:02:02 -07:00
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 24, 25, 28
|
|
|
|
RGB 24, 24, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 10, 06
|
|
|
|
RGB 24, 24, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 15, 31, 00
|
|
|
|
RGB 24, 24, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 15, 31
|
|
|
|
RGB 24, 24, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 15, 21, 31
|
|
|
|
RGB 24, 24, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 11
|
|
|
|
RGB 31, 31, 06
|
|
|
|
RGB 24, 24, 09
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 16, 19, 29
|
|
|
|
RGB 25, 22, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 21, 21, 21
|
|
|
|
RGB 13, 13, 13
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 30, 10, 06
|
|
|
|
RGB 31, 00, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 12, 25, 01
|
|
|
|
RGB 05, 14, 00
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 12, 25, 01
|
|
|
|
RGB 30, 10, 06
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 06
|
|
|
|
RGB 20, 15, 03
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 06
|
|
|
|
RGB 15, 21, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 06
|
|
|
|
RGB 20, 15, 03
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 24, 21
|
|
|
|
RGB 31, 13, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 31, 31, 31
|
|
|
|
RGB 00, 00, 00
|
|
|
|
RGB 00, 00, 00
|
2015-12-09 15:25:44 -08:00
|
|
|
|