2020-10-23 09:38:07 -07:00
|
|
|
; DebugColor_GFX tile IDs
|
2018-01-31 08:38:45 -08:00
|
|
|
const_def $6a
|
2020-03-01 14:00:57 -08:00
|
|
|
const DEBUGTEST_TICKS_1 ; $6a
|
|
|
|
const DEBUGTEST_TICKS_2 ; $6b
|
|
|
|
const DEBUGTEST_WHITE ; $6c
|
|
|
|
const DEBUGTEST_LIGHT ; $6d
|
|
|
|
const DEBUGTEST_DARK ; $6e
|
|
|
|
const DEBUGTEST_BLACK ; $6f
|
|
|
|
const DEBUGTEST_0 ; $70
|
|
|
|
const DEBUGTEST_1 ; $71
|
|
|
|
const DEBUGTEST_2 ; $72
|
|
|
|
const DEBUGTEST_3 ; $73
|
|
|
|
const DEBUGTEST_4 ; $74
|
|
|
|
const DEBUGTEST_5 ; $75
|
|
|
|
const DEBUGTEST_6 ; $76
|
|
|
|
const DEBUGTEST_7 ; $77
|
|
|
|
const DEBUGTEST_8 ; $78
|
|
|
|
const DEBUGTEST_9 ; $79
|
|
|
|
const DEBUGTEST_A ; $7a
|
|
|
|
const DEBUGTEST_B ; $7b
|
|
|
|
const DEBUGTEST_C ; $7c
|
|
|
|
const DEBUGTEST_D ; $7d
|
|
|
|
const DEBUGTEST_E ; $7e
|
|
|
|
const DEBUGTEST_F ; $7f
|
2018-01-18 17:40:32 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
; DebugColorMain.Jumptable indexes
|
|
|
|
const_def
|
|
|
|
const DEBUGCOLORMAIN_INITSCREEN ; 0
|
|
|
|
const DEBUGCOLORMAIN_UPDATESCREEN ; 1
|
|
|
|
const DEBUGCOLORMAIN_UPDATEPALETTES ; 2
|
|
|
|
const DEBUGCOLORMAIN_JOYPAD ; 3
|
|
|
|
const DEBUGCOLORMAIN_INITTMHM ; 4
|
|
|
|
const DEBUGCOLORMAIN_TMHMJOYPAD ; 5
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
DebugColorPicker: ; unreferenced
|
2015-11-19 15:07:20 -08:00
|
|
|
; A debug menu to test monster and trainer palettes at runtime.
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hInMenu]
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, TRUE
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
call DisableLCD
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_InitVRAM
|
|
|
|
call DebugColor_LoadGFX
|
|
|
|
call DebugColor_InitPalettes
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_InitMonOrTrainerColor
|
2015-11-19 15:07:20 -08:00
|
|
|
call EnableLCD
|
|
|
|
ld de, MUSIC_NONE
|
|
|
|
call PlayMusic
|
2020-10-23 09:38:07 -07:00
|
|
|
|
|
|
|
xor a ; DEBUGCOLORMAIN_INITSCREEN
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugColorCurMon], a
|
|
|
|
ld [wDebugColorIsShiny], a
|
2020-10-06 10:50:02 -07:00
|
|
|
.loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
bit 7, a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .exit
|
|
|
|
call DebugColorMain
|
|
|
|
call DebugColor_PlaceCursor
|
2015-11-19 15:07:20 -08:00
|
|
|
call DelayFrame
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .loop
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.exit
|
2015-11-19 15:07:20 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hInMenu], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_InitMonOrTrainerColor:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorIsTrainer]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, DebugColor_InitTrainerColor
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, PokemonPalettes
|
2020-10-23 09:38:07 -07:00
|
|
|
; fallthrough
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_InitMonColor:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugOriginalColors
|
2015-11-19 15:07:20 -08:00
|
|
|
ld c, NUM_POKEMON + 1
|
2020-10-06 10:50:02 -07:00
|
|
|
.loop
|
2015-11-19 15:07:20 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_InitColor
|
2015-11-19 15:07:20 -08:00
|
|
|
pop hl
|
|
|
|
ld bc, 8
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec c
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_InitTrainerColor:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, TrainerPalettes
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugOriginalColors
|
2021-03-03 19:22:41 -08:00
|
|
|
ld c, NUM_TRAINER_CLASSES + 1
|
2020-10-06 10:50:02 -07:00
|
|
|
.loop
|
2015-11-19 15:07:20 -08:00
|
|
|
push bc
|
|
|
|
push hl
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_InitColor
|
2015-11-19 15:07:20 -08:00
|
|
|
pop hl
|
|
|
|
ld bc, 4
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec c
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_InitColor:
|
2020-10-23 13:04:15 -07:00
|
|
|
rept 3
|
2019-01-12 12:17:20 -08:00
|
|
|
ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetFarByte
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
inc hl
|
2020-10-23 13:04:15 -07:00
|
|
|
endr
|
2019-01-12 12:17:20 -08:00
|
|
|
ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetFarByte
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_InitVRAM:
|
2022-01-20 17:16:22 -08:00
|
|
|
ld a, $1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rVBK], a
|
2022-01-20 17:16:22 -08:00
|
|
|
ld hl, VRAM_Begin
|
|
|
|
ld bc, VRAM_End - VRAM_Begin
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2022-01-20 17:16:22 -08:00
|
|
|
ld a, $0
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rVBK], a
|
2022-01-20 17:16:22 -08:00
|
|
|
ld hl, VRAM_Begin
|
|
|
|
ld bc, VRAM_End - VRAM_Begin
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2020-02-13 09:30:13 -08:00
|
|
|
hlcoord 0, 0, wAttrmap
|
2015-11-19 15:07:20 -08:00
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
|
|
|
xor a
|
|
|
|
call ByteFill
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
call ClearSprites
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_LoadGFX:
|
|
|
|
ld hl, DebugColor_GFX
|
2020-03-01 14:00:57 -08:00
|
|
|
ld de, vTiles2 tile DEBUGTEST_TICKS_1
|
2018-01-18 17:40:32 -08:00
|
|
|
ld bc, 22 tiles
|
2015-11-19 15:07:20 -08:00
|
|
|
call CopyBytes
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
ld hl, DebugColor_UpArrowGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles0
|
2018-01-18 17:40:32 -08:00
|
|
|
ld bc, 1 tiles
|
2015-11-19 15:07:20 -08:00
|
|
|
call CopyBytes
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
; Invert the font colors.
|
2015-11-19 15:07:20 -08:00
|
|
|
call LoadStandardFont
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles1
|
2020-10-06 10:50:02 -07:00
|
|
|
ld bc, $80 tiles
|
|
|
|
.loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
xor $ff
|
|
|
|
ld [hli], a
|
|
|
|
dec bc
|
|
|
|
ld a, c
|
|
|
|
or b
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_InitPalettes:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals2)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2018-03-02 16:39:16 -08:00
|
|
|
ld hl, Palette_DebugBG
|
2018-01-01 06:08:21 -08:00
|
|
|
ld de, wBGPals2
|
2017-12-15 19:36:33 -08:00
|
|
|
ld bc, 16 palettes
|
2015-11-19 15:07:20 -08:00
|
|
|
call CopyBytes
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2018-01-01 10:43:02 -08:00
|
|
|
ld a, 1 << rBGPI_AUTO_INCREMENT
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rBGPI], a
|
2018-03-02 16:39:16 -08:00
|
|
|
ld hl, Palette_DebugBG
|
2018-01-01 10:43:02 -08:00
|
|
|
ld c, 8 palettes
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
2020-10-06 10:50:02 -07:00
|
|
|
.bg_loop
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rBGPD], a
|
2015-11-19 15:07:20 -08:00
|
|
|
dec c
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .bg_loop
|
|
|
|
|
2018-01-01 10:43:02 -08:00
|
|
|
ld a, 1 << rOBPI_AUTO_INCREMENT
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rOBPI], a
|
2018-03-02 16:39:16 -08:00
|
|
|
ld hl, Palette_DebugOB
|
2018-01-01 10:43:02 -08:00
|
|
|
ld c, 8 palettes
|
2020-10-06 10:50:02 -07:00
|
|
|
.ob_loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hli]
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rOBPD], a
|
2015-11-19 15:07:20 -08:00
|
|
|
dec c
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .ob_loop
|
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, LOW(palred 20 + palgreen 20 + palblue 20)
|
|
|
|
ld [wDebugLightColor + 0], a
|
|
|
|
ld a, HIGH(palred 20 + palgreen 20 + palblue 20)
|
|
|
|
ld [wDebugLightColor + 1], a
|
|
|
|
ld a, LOW(palred 10 + palgreen 10 + palblue 10)
|
|
|
|
ld [wDebugDarkColor + 0], a
|
|
|
|
ld a, HIGH(palred 10 + palgreen 10 + palblue 10)
|
|
|
|
ld [wDebugDarkColor + 1], a
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Palette_DebugBG:
|
2018-01-09 20:21:32 -08:00
|
|
|
INCLUDE "gfx/debug/bg.pal"
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
Palette_DebugOB:
|
2018-01-09 20:21:32 -08:00
|
|
|
INCLUDE "gfx/debug/ob.pal"
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColorMain:
|
2015-11-19 15:07:20 -08:00
|
|
|
call JoyTextDelay
|
|
|
|
ld a, [wJumptableIndex]
|
2020-10-23 09:38:07 -07:00
|
|
|
cp DEBUGCOLORMAIN_INITTMHM
|
2020-10-22 09:55:46 -07:00
|
|
|
jr nc, .no_start_select
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and SELECT
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .NextMon
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and START
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .PreviousMon
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-22 09:55:46 -07:00
|
|
|
.no_start_select
|
2020-10-23 09:38:07 -07:00
|
|
|
jumptable .Jumptable, wJumptableIndex
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.NextMon:
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_BackupSpriteColors
|
2020-10-23 09:38:07 -07:00
|
|
|
call .SetMaxNum
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
|
|
|
cp e
|
2020-10-06 10:50:02 -07:00
|
|
|
jr c, .SwitchMon
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .SwitchMon
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.PreviousMon:
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_BackupSpriteColors
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
dec a
|
2020-10-06 10:50:02 -07:00
|
|
|
cp -1
|
|
|
|
jr nz, .SwitchMon
|
2020-10-23 09:38:07 -07:00
|
|
|
call .SetMaxNum
|
2015-11-19 15:07:20 -08:00
|
|
|
dec a
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.SwitchMon:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugColorCurMon], a
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, DEBUGCOLORMAIN_INITSCREEN
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.SetMaxNum:
|
2015-11-19 15:07:20 -08:00
|
|
|
; Looping back around the pic set.
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorIsTrainer]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .trainer
|
2020-10-23 09:38:07 -07:00
|
|
|
; mon
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, NUM_POKEMON ; CELEBI
|
|
|
|
ret
|
2020-10-06 10:50:02 -07:00
|
|
|
.trainer
|
2021-03-03 19:22:41 -08:00
|
|
|
ld a, NUM_TRAINER_CLASSES ; MYSTICALMAN
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.Jumptable:
|
|
|
|
; entries correspond to DEBUGCOLORMAIN_* constants
|
2020-10-06 10:50:02 -07:00
|
|
|
dw DebugColor_InitScreen
|
2020-10-23 09:38:07 -07:00
|
|
|
dw DebugColor_UpdateScreen
|
|
|
|
dw DebugColor_UpdatePalettes
|
|
|
|
dw DebugColor_Joypad
|
|
|
|
dw DebugColor_InitTMHM
|
|
|
|
dw DebugColor_TMHMJoypad
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_InitScreen:
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_BLACK
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
|
|
|
hlcoord 1, 3
|
|
|
|
lb bc, 7, 18
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_WHITE
|
2020-06-21 15:33:31 -07:00
|
|
|
call DebugColor_FillBoxWithByte
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 11, 0
|
|
|
|
lb bc, 2, 3
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_LIGHT
|
2020-06-21 15:33:31 -07:00
|
|
|
call DebugColor_FillBoxWithByte
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 16, 0
|
|
|
|
lb bc, 2, 3
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_DARK
|
2020-06-21 15:33:31 -07:00
|
|
|
call DebugColor_FillBoxWithByte
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_LoadRGBMeter
|
|
|
|
call DebugColor_SetRGBMeter
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartySpecies], a
|
2020-12-23 13:29:30 -08:00
|
|
|
ld [wTextDecimalByte], a
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 0, 1
|
2020-12-23 13:29:30 -08:00
|
|
|
ld de, wTextDecimalByte
|
2015-11-19 15:07:20 -08:00
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
|
|
|
|
call PrintNum
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorIsTrainer]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .trainer
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
; mon
|
2020-10-06 10:50:02 -07:00
|
|
|
ld a, UNOWN_A
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wUnownLetter], a
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetPokemonName
|
|
|
|
hlcoord 4, 1
|
|
|
|
call PlaceString
|
|
|
|
xor a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 12, 3
|
|
|
|
call _PrepMonFrontpic
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $31
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetMonBackpic
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, $31
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hGraphicStartTile], a
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 4
|
|
|
|
lb bc, 6, 6
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceGraphic
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorIsShiny]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-23 09:38:07 -07:00
|
|
|
jr z, .normal
|
|
|
|
; shiny
|
|
|
|
ld de, .ShinyText
|
|
|
|
jr .place_text
|
|
|
|
.normal
|
|
|
|
ld de, .NormalText
|
|
|
|
.place_text
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 7, 17
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 0, 17
|
2020-10-23 09:38:07 -07:00
|
|
|
ld de, .SwitchText
|
2015-11-19 15:07:20 -08:00
|
|
|
call PlaceString
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.trainer
|
2020-12-23 13:29:30 -08:00
|
|
|
ld a, [wTextDecimalByte]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTrainerClass], a
|
2017-12-24 09:47:30 -08:00
|
|
|
callfar GetTrainerAttributes
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer1
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 4, 1
|
|
|
|
call PlaceString
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2
|
2018-01-16 11:30:10 -08:00
|
|
|
callfar GetTrainerPic
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempEnemyMonSpecies], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hGraphicStartTile], a
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 3
|
|
|
|
lb bc, 7, 7
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceGraphic
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.done
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, DEBUGCOLORMAIN_UPDATESCREEN
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.ShinyText:
|
2020-10-06 10:50:02 -07:00
|
|
|
db "レア", DEBUGTEST_BLACK, DEBUGTEST_BLACK, "@" ; Rare (shiny)
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.NormalText:
|
2020-10-06 10:50:02 -07:00
|
|
|
db "ノーマル@" ; Normal
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.SwitchText:
|
2020-10-06 10:50:02 -07:00
|
|
|
db DEBUGTEST_A, "きりかえ▶@" ; (A) Switches
|
|
|
|
|
|
|
|
DebugColor_LoadRGBMeter:
|
2020-02-13 09:30:13 -08:00
|
|
|
decoord 0, 11, wAttrmap
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 11
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, 1
|
|
|
|
call .load_meter
|
2020-02-13 09:30:13 -08:00
|
|
|
decoord 0, 13, wAttrmap
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 13
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, 2
|
|
|
|
call .load_meter
|
2020-02-13 09:30:13 -08:00
|
|
|
decoord 0, 15, wAttrmap
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 15
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, 3
|
|
|
|
.load_meter:
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2020-03-01 14:00:57 -08:00
|
|
|
ld a, DEBUGTEST_TICKS_1
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [hli], a
|
2020-10-06 10:50:02 -07:00
|
|
|
ld bc, 15
|
2020-03-01 14:00:57 -08:00
|
|
|
ld a, DEBUGTEST_TICKS_2
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
|
|
|
ld l, e
|
|
|
|
ld h, d
|
|
|
|
pop af
|
2020-10-06 10:50:02 -07:00
|
|
|
ld bc, 20 * 2
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_SetRGBMeter:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
|
|
|
ld l, a
|
2020-10-06 10:50:02 -07:00
|
|
|
ld h, 0
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, hl
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, hl
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugOriginalColors
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, de
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugMiddleColors
|
2015-11-19 15:07:20 -08:00
|
|
|
ld bc, 4
|
|
|
|
call CopyBytes
|
|
|
|
xor a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugColorRGBJumptableIndex], a
|
|
|
|
ld [wDebugColorCurColor], a
|
|
|
|
ld de, wDebugLightColor
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_CalculateRGB
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_UpdateScreen:
|
2020-10-06 10:50:02 -07:00
|
|
|
ld a, 2
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-11-19 15:07:20 -08:00
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
call DelayFrame
|
|
|
|
call WaitBGMap
|
2020-10-23 09:38:07 -07:00
|
|
|
|
|
|
|
ld a, DEBUGCOLORMAIN_UPDATEPALETTES
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_UpdatePalettes:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals2)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wBGPals2
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugMiddleColors
|
2020-10-23 09:38:07 -07:00
|
|
|
ld c, 1
|
|
|
|
call DebugColor_LoadPalettes_White_Col1_Col2_Black
|
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 2
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugLightColor
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintHexColor
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 15, 2
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugDarkColor
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintHexColor
|
|
|
|
|
2020-08-03 14:41:01 -07:00
|
|
|
ld a, TRUE
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hCGBPalUpdate], a
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, DEBUGCOLORMAIN_JOYPAD
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_PrintHexColor:
|
2015-11-19 15:07:20 -08:00
|
|
|
inc hl
|
2016-05-10 09:31:49 -07:00
|
|
|
inc hl
|
|
|
|
inc hl
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
2020-10-23 09:38:07 -07:00
|
|
|
call .place_tile
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
|
|
|
swap a
|
2020-10-23 09:38:07 -07:00
|
|
|
call .place_tile
|
2015-11-19 15:07:20 -08:00
|
|
|
inc de
|
|
|
|
ld a, [de]
|
2020-10-23 09:38:07 -07:00
|
|
|
call .place_tile
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
|
|
|
swap a
|
2020-10-23 09:38:07 -07:00
|
|
|
.place_tile:
|
2015-11-19 15:07:20 -08:00
|
|
|
and $f
|
2018-01-18 17:40:32 -08:00
|
|
|
add DEBUGTEST_0
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [hld], a
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_Joypad:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-19 15:07:20 -08:00
|
|
|
and B_BUTTON
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .tmhm
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-19 15:07:20 -08:00
|
|
|
and A_BUTTON
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .toggle_shiny
|
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorRGBJumptableIndex]
|
2020-10-23 09:38:07 -07:00
|
|
|
maskbits 4 ; .PointerTable length
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2020-10-23 09:38:07 -07:00
|
|
|
ld hl, .PointerTable
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.tmhm
|
|
|
|
; Enter the TM/HM checker.
|
|
|
|
ld a, DEBUGCOLORMAIN_INITTMHM
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.toggle_shiny
|
|
|
|
; Toggle between the normal and shiny mon colors.
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorIsTrainer]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
|
|
|
ret nz
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorIsShiny]
|
2020-10-06 10:50:02 -07:00
|
|
|
xor %00000100
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugColorIsShiny], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
ld hl, PokemonPalettes
|
|
|
|
add hl, bc
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_InitMonColor
|
|
|
|
|
|
|
|
ld a, DEBUGCOLORMAIN_INITSCREEN
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.PointerTable:
|
2020-10-06 10:50:02 -07:00
|
|
|
dw DebugColor_SelectColorBox
|
|
|
|
dw DebugColor_ChangeRedValue
|
|
|
|
dw DebugColor_ChangeGreenValue
|
|
|
|
dw DebugColor_ChangeBlueValue
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_SelectColorBox:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, DebugColor_NextRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_LEFT
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .light
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_RIGHT
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .dark
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.light
|
2020-10-23 13:04:15 -07:00
|
|
|
xor a ; FALSE
|
|
|
|
ld [wDebugColorCurColor], a
|
|
|
|
ld de, wDebugLightColor
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_CalculateRGB
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.dark
|
|
|
|
ld a, TRUE
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugColorCurColor], a
|
|
|
|
ld de, wDebugDarkColor
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_CalculateRGB
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_ChangeRedValue:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, DebugColor_NextRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, DebugColor_PreviousRGBColor
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugRedChannel
|
2020-10-23 09:38:07 -07:00
|
|
|
jr DebugColor_UpdateRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_ChangeGreenValue:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, DebugColor_NextRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, DebugColor_PreviousRGBColor
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugGreenChannel
|
2020-10-23 09:38:07 -07:00
|
|
|
jr DebugColor_UpdateRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_ChangeBlueValue:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, DebugColor_PreviousRGBColor
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugBlueChannel
|
|
|
|
; fallthrough
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_UpdateRGBColor:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-19 15:07:20 -08:00
|
|
|
and D_RIGHT
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .increment
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-19 15:07:20 -08:00
|
|
|
and D_LEFT
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .decrement
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.increment
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
2020-10-06 10:50:02 -07:00
|
|
|
cp 31
|
2015-11-19 15:07:20 -08:00
|
|
|
ret nc
|
|
|
|
inc [hl]
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.decrement
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec [hl]
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.done
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_CalculatePalette
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, DEBUGCOLORMAIN_UPDATEPALETTES
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_PreviousRGBColor:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugColorRGBJumptableIndex
|
2015-11-19 15:07:20 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_NextRGBColor:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugColorRGBJumptableIndex
|
2015-11-19 15:07:20 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_InitTMHM:
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 0, 10
|
2020-10-06 10:50:02 -07:00
|
|
|
ld bc, SCREEN_WIDTH * 8
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_BLACK
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
|
|
|
hlcoord 2, 12
|
2020-10-06 10:50:02 -07:00
|
|
|
ld de, DebugColor_AreYouFinishedString
|
2015-11-19 15:07:20 -08:00
|
|
|
call PlaceString
|
|
|
|
xor a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugColorCurTMHM], a
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintTMHMMove
|
|
|
|
ld a, DEBUGCOLORMAIN_TMHMJOYPAD
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_TMHMJoypad:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyPressed
|
|
|
|
ld a, [hl]
|
|
|
|
and B_BUTTON
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .cancel
|
2020-10-23 09:38:07 -07:00
|
|
|
call .scroll
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.cancel
|
2020-10-23 09:38:07 -07:00
|
|
|
ld a, DEBUGCOLORMAIN_INITSCREEN
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.exit ; unreferenced
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, wJumptableIndex
|
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.scroll:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .up
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .down
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.up
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurTMHM]
|
2020-10-06 10:50:02 -07:00
|
|
|
cp NUM_TM_HM_TUTOR - 1
|
|
|
|
jr z, .wrap_down
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.wrap_down
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.down
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurTMHM]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr z, .wrap_up
|
2015-11-19 15:07:20 -08:00
|
|
|
dec a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.wrap_up
|
|
|
|
ld a, NUM_TM_HM_TUTOR - 1
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.done
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugColorCurTMHM], a
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintTMHMMove
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_PrintTMHMMove:
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 11
|
2020-10-23 09:38:07 -07:00
|
|
|
call .ClearRow
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 12
|
2020-10-23 09:38:07 -07:00
|
|
|
call .ClearRow
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 13
|
2020-10-23 09:38:07 -07:00
|
|
|
call .ClearRow
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 14
|
2020-10-23 09:38:07 -07:00
|
|
|
call .ClearRow
|
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurTMHM]
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
2018-07-28 16:27:34 -07:00
|
|
|
ld [wTempTMHM], a
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetTMHMMove
|
2018-07-28 16:27:34 -07:00
|
|
|
ld a, [wTempTMHM]
|
2015-12-02 10:24:18 -08:00
|
|
|
ld [wPutativeTMHMMove], a
|
2015-11-19 15:07:20 -08:00
|
|
|
call GetMoveName
|
|
|
|
hlcoord 10, 12
|
|
|
|
call PlaceString
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurTMHM]
|
2020-10-23 09:38:07 -07:00
|
|
|
call .GetNumberedTMHM
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurItem], a
|
2018-01-16 11:30:10 -08:00
|
|
|
predef CanLearnTMHMMove
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, c
|
|
|
|
and a
|
2020-10-23 09:38:07 -07:00
|
|
|
ld de, .AbleText
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .place_string
|
2020-10-23 09:38:07 -07:00
|
|
|
ld de, .NotAbleText
|
2020-10-06 10:50:02 -07:00
|
|
|
.place_string
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 14
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.AbleText:
|
2020-10-06 10:50:02 -07:00
|
|
|
db "おぼえられる@" ; Learnable
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.NotAbleText:
|
2020-10-06 10:50:02 -07:00
|
|
|
db "おぼえられない@" ; Not learnable
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.GetNumberedTMHM:
|
2020-10-06 10:50:02 -07:00
|
|
|
cp NUM_TMS
|
|
|
|
jr c, .tm
|
2020-10-23 09:38:07 -07:00
|
|
|
; hm - skip two gap items
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
2016-05-04 08:46:23 -07:00
|
|
|
inc a
|
2020-10-06 10:50:02 -07:00
|
|
|
.tm
|
|
|
|
add TM01
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.ClearRow:
|
2018-01-18 17:40:32 -08:00
|
|
|
ld bc, 10
|
|
|
|
ld a, DEBUGTEST_BLACK
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_CalculatePalette:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugRedChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00011111
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugGreenChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00000111
|
2015-11-19 15:07:20 -08:00
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
or e
|
|
|
|
ld e, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugGreenChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00011000
|
2015-11-19 15:07:20 -08:00
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
ld d, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugBlueChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00011111
|
2015-11-19 15:07:20 -08:00
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
or d
|
|
|
|
ld d, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurColor]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-23 09:38:07 -07:00
|
|
|
jr z, .light
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
; dark
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, e
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugDarkColor + 0], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, d
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugDarkColor + 1], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.light
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, e
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugLightColor + 0], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, d
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugLightColor + 1], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_CalculateRGB:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00011111
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugRedChannel], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %11100000
|
2015-11-19 15:07:20 -08:00
|
|
|
swap a
|
|
|
|
srl a
|
|
|
|
ld b, a
|
|
|
|
inc de
|
|
|
|
ld a, [de]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00000011
|
2015-11-19 15:07:20 -08:00
|
|
|
swap a
|
|
|
|
srl a
|
|
|
|
or b
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugGreenChannel], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %01111100
|
2015-11-19 15:07:20 -08:00
|
|
|
srl a
|
|
|
|
srl a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugBlueChannel], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_BackupSpriteColors:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurMon]
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
|
|
|
ld l, a
|
2020-10-06 10:50:02 -07:00
|
|
|
ld h, 0
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, hl
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, hl
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugOriginalColors
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, de
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugMiddleColors
|
2015-11-19 15:07:20 -08:00
|
|
|
ld bc, 4
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_LoadPalettes_White_Col1_Col2_Black:
|
2020-10-06 10:50:02 -07:00
|
|
|
.loop
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, LOW(PALRGB_WHITE)
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [hli], a
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, HIGH(PALRGB_WHITE)
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [hli], a
|
2020-10-23 09:38:07 -07:00
|
|
|
rept 4
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
2020-10-23 09:38:07 -07:00
|
|
|
endr
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
2016-05-04 08:46:23 -07:00
|
|
|
ld [hli], a
|
2015-11-19 15:07:20 -08:00
|
|
|
dec c
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-06-21 15:33:31 -07:00
|
|
|
DebugColor_FillBoxWithByte:
|
2015-11-19 15:07:20 -08:00
|
|
|
; For some reason, we have another copy of FillBoxWithByte here
|
|
|
|
.row
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
.col
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .col
|
|
|
|
pop hl
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
|
|
|
jr nz, .row
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_PushSGBPals:
|
2020-10-28 10:35:39 -07:00
|
|
|
ld a, [wJoypadDisable]
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2020-10-28 10:35:39 -07:00
|
|
|
set JOYPAD_DISABLE_SGB_TRANSFER_F, a
|
|
|
|
ld [wJoypadDisable], a
|
2020-10-23 09:38:07 -07:00
|
|
|
call _DebugColor_PushSGBPals
|
2015-11-19 15:07:20 -08:00
|
|
|
pop af
|
2020-10-28 10:35:39 -07:00
|
|
|
ld [wJoypadDisable], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
_DebugColor_PushSGBPals:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and $7
|
|
|
|
ret z
|
|
|
|
ld b, a
|
2020-10-06 10:50:02 -07:00
|
|
|
.loop
|
2015-11-19 15:07:20 -08:00
|
|
|
push bc
|
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rJOYP], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, $30
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rJOYP], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld b, $10
|
2020-10-06 10:50:02 -07:00
|
|
|
.loop2
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, $8
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, a
|
2020-10-06 10:50:02 -07:00
|
|
|
.loop3
|
2015-11-19 15:07:20 -08:00
|
|
|
bit 0, d
|
|
|
|
ld a, $10
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .okay
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, $20
|
2020-10-06 10:50:02 -07:00
|
|
|
.okay
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rJOYP], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, $30
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rJOYP], a
|
2015-11-19 15:07:20 -08:00
|
|
|
rr d
|
|
|
|
dec e
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .loop3
|
2015-11-19 15:07:20 -08:00
|
|
|
dec b
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .loop2
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, $20
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rJOYP], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, $30
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rJOYP], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld de, 7000
|
2020-10-06 10:50:02 -07:00
|
|
|
.wait
|
2015-11-19 15:07:20 -08:00
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
dec de
|
|
|
|
ld a, d
|
|
|
|
or e
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .wait
|
2015-11-19 15:07:20 -08:00
|
|
|
pop bc
|
|
|
|
dec b
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .loop
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_PlaceCursor:
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_BLACK
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 0
|
|
|
|
ld [hl], a
|
|
|
|
hlcoord 15, 0
|
|
|
|
ld [hl], a
|
|
|
|
hlcoord 1, 11
|
|
|
|
ld [hl], a
|
|
|
|
hlcoord 1, 13
|
|
|
|
ld [hl], a
|
|
|
|
hlcoord 1, 15
|
|
|
|
ld [hl], a
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [wJumptableIndex]
|
2020-10-23 09:38:07 -07:00
|
|
|
cp DEBUGCOLORMAIN_JOYPAD
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .clearsprites
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorRGBJumptableIndex]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-22 09:55:46 -07:00
|
|
|
jr z, .place_cursor
|
2015-11-19 15:07:20 -08:00
|
|
|
dec a
|
|
|
|
hlcoord 1, 11
|
|
|
|
ld bc, 2 * SCREEN_WIDTH
|
|
|
|
call AddNTimes
|
2020-10-06 10:50:02 -07:00
|
|
|
ld [hl], "▶"
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-22 09:55:46 -07:00
|
|
|
.place_cursor
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugColorCurColor]
|
2015-11-19 15:07:20 -08:00
|
|
|
and a
|
2020-10-23 09:38:07 -07:00
|
|
|
jr z, .light
|
|
|
|
; dark
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 15, 0
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .place
|
2020-10-23 09:38:07 -07:00
|
|
|
.light
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 10, 0
|
2020-10-06 10:50:02 -07:00
|
|
|
.place
|
|
|
|
ld [hl], "▶"
|
2020-10-23 09:38:07 -07:00
|
|
|
|
|
|
|
ld b, $70 ; initial tile id
|
|
|
|
ld c, 5 ; initial palette
|
2022-07-09 14:18:22 -07:00
|
|
|
ld hl, wShadowOAM
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugRedChannel
|
2020-10-06 10:50:02 -07:00
|
|
|
call .placesprite
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugGreenChannel
|
2020-10-06 10:50:02 -07:00
|
|
|
call .placesprite
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugBlueChannel
|
2020-10-06 10:50:02 -07:00
|
|
|
call .placesprite
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.placesprite:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, b
|
2018-01-10 10:47:57 -08:00
|
|
|
ld [hli], a ; y
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [de]
|
|
|
|
add a
|
2016-05-04 08:46:23 -07:00
|
|
|
add a
|
2018-01-10 10:47:57 -08:00
|
|
|
add 3 * TILE_WIDTH
|
|
|
|
ld [hli], a ; x
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
2018-01-10 10:47:57 -08:00
|
|
|
ld [hli], a ; tile id
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, c
|
2018-01-10 10:47:57 -08:00
|
|
|
ld [hli], a ; attributes
|
|
|
|
ld a, 2 * TILE_WIDTH
|
2015-11-19 15:07:20 -08:00
|
|
|
add b
|
|
|
|
ld b, a
|
|
|
|
inc c
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.clearsprites:
|
2015-11-19 15:07:20 -08:00
|
|
|
call ClearSprites
|
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_AreYouFinishedString:
|
2020-10-23 09:38:07 -07:00
|
|
|
db "おわりますか?" ; Are you finished?
|
2018-01-18 17:40:32 -08:00
|
|
|
next "はい<DOT><DOT><DOT>", DEBUGTEST_A ; YES...(A)
|
2020-10-23 09:38:07 -07:00
|
|
|
next "いいえ<DOT><DOT>", DEBUGTEST_B ; NO..(B)
|
2015-11-19 15:07:20 -08:00
|
|
|
db "@"
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugColor_UpArrowGFX:
|
2020-03-01 14:00:57 -08:00
|
|
|
INCBIN "gfx/debug/up_arrow.2bpp"
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColor_GFX:
|
2015-11-19 15:07:20 -08:00
|
|
|
INCBIN "gfx/debug/color_test.2bpp"
|
|
|
|
|
2020-10-26 12:45:57 -07:00
|
|
|
TilesetColorPicker: ; unreferenced
|
2020-10-23 09:38:07 -07:00
|
|
|
; A debug menu to test tileset palettes at runtime.
|
2020-10-06 10:50:02 -07:00
|
|
|
; dummied out
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
|
|
|
ld [wJumptableIndex], a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld [wDebugTilesetCurPalette], a
|
|
|
|
ld [wDebugTilesetRGBJumptableIndex], a
|
|
|
|
ld [wDebugTilesetCurColor], a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hMapAnims], a
|
2015-11-19 15:07:20 -08:00
|
|
|
call ClearSprites
|
|
|
|
call OverworldTextModeSwitch
|
2015-12-11 13:59:40 -08:00
|
|
|
call WaitBGMap2
|
2015-11-19 15:07:20 -08:00
|
|
|
xor a
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2020-10-06 10:50:02 -07:00
|
|
|
ld de, DebugColor_GFX
|
2020-03-01 14:00:57 -08:00
|
|
|
ld hl, vTiles2 tile DEBUGTEST_TICKS_1
|
2020-10-06 10:50:02 -07:00
|
|
|
lb bc, BANK(DebugColor_GFX), 22
|
2015-11-19 15:07:20 -08:00
|
|
|
call Request2bpp
|
2020-10-23 09:38:07 -07:00
|
|
|
ld de, DebugColor_UpArrowGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld hl, vTiles1
|
2020-10-23 09:38:07 -07:00
|
|
|
lb bc, BANK(DebugColor_UpArrowGFX), 1
|
2015-11-19 15:07:20 -08:00
|
|
|
call Request2bpp
|
2017-12-28 04:32:33 -08:00
|
|
|
ld a, HIGH(vBGMap1)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_BLACK
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
2020-02-13 09:30:13 -08:00
|
|
|
hlcoord 0, 0, wAttrmap
|
2015-11-19 15:07:20 -08:00
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
2020-10-06 15:09:33 -07:00
|
|
|
ld a, PAL_BG_TEXT
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
2020-10-06 15:09:33 -07:00
|
|
|
decoord 1, 1, 0
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_WHITE
|
2020-10-06 15:09:33 -07:00
|
|
|
call DebugTileset_DrawColorSwatch
|
|
|
|
decoord 6, 1, 0
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_LIGHT
|
2020-10-06 15:09:33 -07:00
|
|
|
call DebugTileset_DrawColorSwatch
|
|
|
|
decoord 11, 1, 0
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_DARK
|
2020-10-06 15:09:33 -07:00
|
|
|
call DebugTileset_DrawColorSwatch
|
|
|
|
decoord 16, 1, 0
|
2018-01-18 17:40:32 -08:00
|
|
|
ld a, DEBUGTEST_BLACK
|
2020-10-06 15:09:33 -07:00
|
|
|
call DebugTileset_DrawColorSwatch
|
|
|
|
call DebugTileset_LoadRGBMeter
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugTileset_LoadPalettes
|
2015-12-11 13:59:40 -08:00
|
|
|
call WaitBGMap2
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ld a, $40
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hWY], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 15:09:33 -07:00
|
|
|
DebugTileset_DrawColorSwatch:
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 0, 0
|
2020-10-06 15:09:33 -07:00
|
|
|
call _DebugColor_DrawSwatch
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 15:09:33 -07:00
|
|
|
DebugColor_DrawAttributeSwatch:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetCurPalette]
|
2020-02-13 09:30:13 -08:00
|
|
|
hlcoord 0, 0, wAttrmap
|
2020-10-23 13:04:15 -07:00
|
|
|
; fallthrough
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 15:09:33 -07:00
|
|
|
_DebugColor_DrawSwatch:
|
|
|
|
; Fills a 4x3 box at de with byte a.
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, de
|
|
|
|
rept 4
|
|
|
|
ld [hli], a
|
|
|
|
endr
|
2020-10-06 15:09:33 -07:00
|
|
|
rept 2
|
|
|
|
ld bc, SCREEN_WIDTH - 4
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, bc
|
|
|
|
rept 4
|
|
|
|
ld [hli], a
|
|
|
|
endr
|
|
|
|
endr
|
|
|
|
ret
|
|
|
|
|
2020-10-06 15:09:33 -07:00
|
|
|
DebugTileset_LoadRGBMeter:
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 4
|
2020-10-06 10:50:02 -07:00
|
|
|
call .Place
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 6
|
2020-10-06 10:50:02 -07:00
|
|
|
call .Place
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 2, 8
|
2020-10-06 10:50:02 -07:00
|
|
|
.Place:
|
2020-03-01 14:00:57 -08:00
|
|
|
ld a, DEBUGTEST_TICKS_1
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [hli], a
|
2020-10-06 15:09:33 -07:00
|
|
|
ld bc, 15
|
2020-03-01 14:00:57 -08:00
|
|
|
ld a, DEBUGTEST_TICKS_2
|
2015-11-19 15:07:20 -08:00
|
|
|
call ByteFill
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_LoadPalettes:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals1)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-10-06 10:50:02 -07:00
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetCurPalette]
|
2015-11-19 15:07:20 -08:00
|
|
|
ld l, a
|
2020-10-06 10:50:02 -07:00
|
|
|
ld h, 0
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, hl
|
2016-05-10 09:31:49 -07:00
|
|
|
add hl, hl
|
|
|
|
add hl, hl
|
2018-01-01 06:08:21 -08:00
|
|
|
ld de, wBGPals1
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, de
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugPalette
|
2020-10-06 15:09:33 -07:00
|
|
|
ld bc, 1 palettes
|
2015-11-19 15:07:20 -08:00
|
|
|
call CopyBytes
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugPalette
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_CalculateRGB
|
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
DebugColorMain2: ; unreferenced
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and SELECT
|
2020-10-23 13:04:15 -07:00
|
|
|
jr nz, .next_palette
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and B_BUTTON
|
2020-10-06 15:09:33 -07:00
|
|
|
jr nz, .cancel
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugTileset_Joypad
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 13:04:15 -07:00
|
|
|
.next_palette
|
|
|
|
ld hl, wDebugTilesetCurPalette
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
inc a
|
2020-10-06 15:09:33 -07:00
|
|
|
and PALETTE_MASK
|
|
|
|
cp PAL_BG_TEXT
|
|
|
|
jr nz, .palette_ok
|
|
|
|
xor a ; PAL_BG_GRAY
|
|
|
|
.palette_ok
|
2015-11-19 15:07:20 -08:00
|
|
|
ld [hl], a
|
2020-10-06 15:09:33 -07:00
|
|
|
decoord 1, 1, 0
|
|
|
|
call DebugColor_DrawAttributeSwatch
|
|
|
|
decoord 6, 1, 0
|
|
|
|
call DebugColor_DrawAttributeSwatch
|
|
|
|
decoord 11, 1, 0
|
|
|
|
call DebugColor_DrawAttributeSwatch
|
|
|
|
decoord 16, 1, 0
|
|
|
|
call DebugColor_DrawAttributeSwatch
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals2)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wBGPals2
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetCurPalette]
|
2018-01-01 05:47:16 -08:00
|
|
|
ld bc, 1 palettes
|
2015-11-19 15:07:20 -08:00
|
|
|
call AddNTimes
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugPalette
|
2018-01-01 05:47:16 -08:00
|
|
|
ld bc, 1 palettes
|
2015-11-19 15:07:20 -08:00
|
|
|
call CopyBytes
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
ld a, 2
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld c, 3
|
|
|
|
call DelayFrames
|
2020-10-06 10:50:02 -07:00
|
|
|
ld a, 1
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hBGMapMode], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 15:09:33 -07:00
|
|
|
.cancel
|
2015-11-19 15:07:20 -08:00
|
|
|
call ClearSprites
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hWY]
|
2020-10-06 10:50:02 -07:00
|
|
|
xor %11010000
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hWY], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_UpdatePalettes:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [rSVBK]
|
2015-11-19 15:07:20 -08:00
|
|
|
push af
|
2018-01-03 16:12:45 -08:00
|
|
|
ld a, BANK(wBGPals2)
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2018-01-01 06:08:21 -08:00
|
|
|
ld hl, wBGPals2
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetCurPalette]
|
2018-01-01 05:47:16 -08:00
|
|
|
ld bc, 1 palettes
|
2015-11-19 15:07:20 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugPalette
|
2018-01-01 05:47:16 -08:00
|
|
|
ld bc, 1 palettes
|
2015-11-19 15:07:20 -08:00
|
|
|
call CopyBytes
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 1, 0
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugWhiteTileColor
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintHexColor
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 6, 0
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugLightTileColor
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintHexColor
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 11, 0
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugDarkTileColor
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintHexColor
|
2015-11-19 15:07:20 -08:00
|
|
|
hlcoord 16, 0
|
2020-10-23 13:04:15 -07:00
|
|
|
ld de, wDebugBlackTileColor
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugColor_PrintHexColor
|
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
pop af
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [rSVBK], a
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2020-08-03 14:41:01 -07:00
|
|
|
ld a, TRUE
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh [hCGBPalUpdate], a
|
2020-10-23 09:38:07 -07:00
|
|
|
|
2015-11-19 15:07:20 -08:00
|
|
|
call DelayFrame
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_Joypad:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetRGBJumptableIndex]
|
2020-10-23 09:38:07 -07:00
|
|
|
maskbits 4 ; .PointerTable length
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2020-10-06 10:50:02 -07:00
|
|
|
ld hl, .PointerTable
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 14:01:10 -07:00
|
|
|
jp hl
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.PointerTable:
|
2020-10-23 09:38:07 -07:00
|
|
|
dw DebugTileset_SelectColorBox
|
|
|
|
dw DebugTileset_ChangeRedValue
|
|
|
|
dw DebugTileset_ChangeGreenValue
|
|
|
|
dw DebugTileset_ChangeBlueValue
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_SelectColorBox:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, DebugTileset_NextRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_LEFT
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .left
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_RIGHT
|
2020-10-06 10:50:02 -07:00
|
|
|
jr nz, .right
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.left
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetCurColor]
|
2015-11-19 15:07:20 -08:00
|
|
|
dec a
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.right
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetCurColor]
|
2015-11-19 15:07:20 -08:00
|
|
|
inc a
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.done
|
2020-10-23 13:04:15 -07:00
|
|
|
maskbits NUM_PAL_COLORS
|
|
|
|
ld [wDebugTilesetCurColor], a
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, a
|
2020-10-06 10:50:02 -07:00
|
|
|
ld d, 0
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugPalette
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, de
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, de
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2020-10-06 10:50:02 -07:00
|
|
|
call DebugColor_CalculateRGB
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_ChangeRedValue:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, DebugTileset_NextRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, DebugTileset_PreviousRGBColor
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugRedChannel
|
2020-10-23 09:38:07 -07:00
|
|
|
jr DebugTileset_UpdateRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_ChangeGreenValue:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_DOWN
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, DebugTileset_NextRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, DebugTileset_PreviousRGBColor
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugGreenChannel
|
2020-10-23 09:38:07 -07:00
|
|
|
jr DebugTileset_UpdateRGBColor
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_ChangeBlueValue:
|
2015-11-19 15:07:20 -08:00
|
|
|
ld hl, hJoyLast
|
|
|
|
ld a, [hl]
|
|
|
|
and D_UP
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, DebugTileset_PreviousRGBColor
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugBlueChannel
|
|
|
|
; fallthrough
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_UpdateRGBColor:
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-19 15:07:20 -08:00
|
|
|
and D_RIGHT
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .increment
|
2018-08-25 11:28:22 -07:00
|
|
|
ldh a, [hJoyLast]
|
2015-11-19 15:07:20 -08:00
|
|
|
and D_LEFT
|
2020-10-23 09:38:07 -07:00
|
|
|
jr nz, .decrement
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.increment
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
2020-10-06 10:50:02 -07:00
|
|
|
cp 31
|
2015-11-19 15:07:20 -08:00
|
|
|
ret nc
|
|
|
|
inc [hl]
|
2020-10-06 10:50:02 -07:00
|
|
|
jr .done
|
2015-11-19 15:07:20 -08:00
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
.decrement
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec [hl]
|
|
|
|
|
2020-10-06 10:50:02 -07:00
|
|
|
.done
|
2020-10-23 09:38:07 -07:00
|
|
|
call DebugTileset_CalculatePalette
|
|
|
|
call DebugTileset_UpdatePalettes
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_PreviousRGBColor:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugTilesetRGBJumptableIndex
|
2015-11-19 15:07:20 -08:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_NextRGBColor:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugTilesetRGBJumptableIndex
|
2015-11-19 15:07:20 -08:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2020-10-23 09:38:07 -07:00
|
|
|
DebugTileset_CalculatePalette:
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugRedChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00011111
|
2015-11-19 15:07:20 -08:00
|
|
|
ld e, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugGreenChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %0000111
|
2015-11-19 15:07:20 -08:00
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
or e
|
|
|
|
ld e, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugGreenChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00011000
|
2015-11-19 15:07:20 -08:00
|
|
|
sla a
|
|
|
|
swap a
|
|
|
|
ld d, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugBlueChannel]
|
2020-10-06 10:50:02 -07:00
|
|
|
and %00011111
|
2015-11-19 15:07:20 -08:00
|
|
|
sla a
|
|
|
|
sla a
|
|
|
|
or d
|
|
|
|
ld d, a
|
2020-10-23 13:04:15 -07:00
|
|
|
ld a, [wDebugTilesetCurColor]
|
2015-11-19 15:07:20 -08:00
|
|
|
ld c, a
|
2020-10-06 10:50:02 -07:00
|
|
|
ld b, 0
|
2020-10-23 13:04:15 -07:00
|
|
|
ld hl, wDebugPalette
|
2015-11-19 15:07:20 -08:00
|
|
|
add hl, bc
|
2016-05-04 08:46:23 -07:00
|
|
|
add hl, bc
|
2015-11-19 15:07:20 -08:00
|
|
|
ld a, e
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], d
|
|
|
|
ret
|
|
|
|
|
2020-10-28 07:21:10 -07:00
|
|
|
.dummy1: ; unreferenced
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|
|
|
|
|
2020-10-28 07:21:10 -07:00
|
|
|
.dummy2: ; unreferenced
|
2015-11-19 15:07:20 -08:00
|
|
|
ret
|