Identify some more labels, mostly WRAM

This commit is contained in:
Rangi 2020-10-23 16:04:15 -04:00
parent 7991db972b
commit a2b6befd7d
4 changed files with 194 additions and 157 deletions

View File

@ -58,8 +58,8 @@ DebugColorPicker:
xor a ; DEBUGCOLORMAIN_INITSCREEN xor a ; DEBUGCOLORMAIN_INITSCREEN
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wcf66], a ld [wDebugColorCurMon], a
ld [wd003], a ld [wDebugColorIsShiny], a
.loop .loop
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
@ -75,14 +75,14 @@ DebugColorPicker:
ret ret
DebugColor_InitMonOrTrainerColor: DebugColor_InitMonOrTrainerColor:
ld a, [wd002] ld a, [wDebugColorIsTrainer]
and a and a
jr nz, DebugColor_InitTrainerColor jr nz, DebugColor_InitTrainerColor
ld hl, PokemonPalettes ld hl, PokemonPalettes
; fallthrough ; fallthrough
DebugColor_InitMonColor: DebugColor_InitMonColor:
ld de, wOverworldMapBlocks ld de, wDebugOriginalColors
ld c, NUM_POKEMON + 1 ld c, NUM_POKEMON + 1
.loop .loop
push bc push bc
@ -98,7 +98,7 @@ DebugColor_InitMonColor:
DebugColor_InitTrainerColor: DebugColor_InitTrainerColor:
ld hl, TrainerPalettes ld hl, TrainerPalettes
ld de, wOverworldMapBlocks ld de, wDebugOriginalColors
ld c, NUM_TRAINER_CLASSES ld c, NUM_TRAINER_CLASSES
.loop .loop
push bc push bc
@ -113,24 +113,13 @@ DebugColor_InitTrainerColor:
ret ret
DebugColor_InitColor: DebugColor_InitColor:
rept 3
ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes) ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte call GetFarByte
ld [de], a ld [de], a
inc de inc de
inc hl inc hl
endr
ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte
ld [de], a
inc de
inc hl
ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte
ld [de], a
inc de
inc hl
ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes) ld a, BANK(PokemonPalettes) ; aka BANK(TrainerPalettes)
call GetFarByte call GetFarByte
ld [de], a ld [de], a
@ -225,14 +214,14 @@ DebugColor_InitPalettes:
dec c dec c
jr nz, .ob_loop jr nz, .ob_loop
ld a, $94 ld a, LOW(palred 20 + palgreen 20 + palblue 20)
ld [wc608], a ld [wDebugLightColor + 0], a
ld a, $52 ld a, HIGH(palred 20 + palgreen 20 + palblue 20)
ld [wc608 + 1], a ld [wDebugLightColor + 1], a
ld a, $4a ld a, LOW(palred 10 + palgreen 10 + palblue 10)
ld [wc608 + 2], a ld [wDebugDarkColor + 0], a
ld a, $29 ld a, HIGH(palred 10 + palgreen 10 + palblue 10)
ld [wc608 + 3], a ld [wDebugDarkColor + 1], a
pop af pop af
ldh [rSVBK], a ldh [rSVBK], a
@ -264,7 +253,7 @@ DebugColorMain:
call DebugColor_BackupSpriteColors call DebugColor_BackupSpriteColors
call .SetMaxNum call .SetMaxNum
ld e, a ld e, a
ld a, [wcf66] ld a, [wDebugColorCurMon]
inc a inc a
cp e cp e
jr c, .SwitchMon jr c, .SwitchMon
@ -273,7 +262,7 @@ DebugColorMain:
.PreviousMon: .PreviousMon:
call DebugColor_BackupSpriteColors call DebugColor_BackupSpriteColors
ld a, [wcf66] ld a, [wDebugColorCurMon]
dec a dec a
cp -1 cp -1
jr nz, .SwitchMon jr nz, .SwitchMon
@ -281,14 +270,14 @@ DebugColorMain:
dec a dec a
.SwitchMon: .SwitchMon:
ld [wcf66], a ld [wDebugColorCurMon], a
ld a, DEBUGCOLORMAIN_INITSCREEN ld a, DEBUGCOLORMAIN_INITSCREEN
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
.SetMaxNum: .SetMaxNum:
; Looping back around the pic set. ; Looping back around the pic set.
ld a, [wd002] ld a, [wDebugColorIsTrainer]
and a and a
jr nz, .trainer jr nz, .trainer
; mon ; mon
@ -328,7 +317,7 @@ DebugColor_InitScreen:
call DebugColor_FillBoxWithByte call DebugColor_FillBoxWithByte
call DebugColor_LoadRGBMeter call DebugColor_LoadRGBMeter
call DebugColor_SetRGBMeter call DebugColor_SetRGBMeter
ld a, [wcf66] ld a, [wDebugColorCurMon]
inc a inc a
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wDeciramBuffer], a ld [wDeciramBuffer], a
@ -336,7 +325,7 @@ DebugColor_InitScreen:
ld de, wDeciramBuffer ld de, wDeciramBuffer
lb bc, PRINTNUM_LEADINGZEROS | 1, 3 lb bc, PRINTNUM_LEADINGZEROS | 1, 3
call PrintNum call PrintNum
ld a, [wd002] ld a, [wDebugColorIsTrainer]
and a and a
jr nz, .trainer jr nz, .trainer
@ -358,7 +347,7 @@ DebugColor_InitScreen:
lb bc, 6, 6 lb bc, 6, 6
predef PlaceGraphic predef PlaceGraphic
ld a, [wd003] ld a, [wDebugColorIsShiny]
and a and a
jr z, .normal jr z, .normal
; shiny ; shiny
@ -431,21 +420,21 @@ DebugColor_LoadRGBMeter:
ret ret
DebugColor_SetRGBMeter: DebugColor_SetRGBMeter:
ld a, [wcf66] ld a, [wDebugColorCurMon]
inc a inc a
ld l, a ld l, a
ld h, 0 ld h, 0
add hl, hl add hl, hl
add hl, hl add hl, hl
ld de, wOverworldMapBlocks ld de, wDebugOriginalColors
add hl, de add hl, de
ld de, wc608 ld de, wDebugMiddleColors
ld bc, 4 ld bc, 4
call CopyBytes call CopyBytes
xor a xor a
ld [wcf64], a ld [wDebugColorRGBJumptableIndex], a
ld [wcf65], a ld [wDebugColorCurColor], a
ld de, wc608 ld de, wDebugLightColor
call DebugColor_CalculateRGB call DebugColor_CalculateRGB
ret ret
@ -479,15 +468,15 @@ DebugColor_UpdatePalettes:
ldh [rSVBK], a ldh [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld de, wc608 ld de, wDebugMiddleColors
ld c, 1 ld c, 1
call DebugColor_LoadPalettes_White_Col1_Col2_Black call DebugColor_LoadPalettes_White_Col1_Col2_Black
hlcoord 10, 2 hlcoord 10, 2
ld de, wc608 ld de, wDebugLightColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
hlcoord 15, 2 hlcoord 15, 2
ld de, wc608 + 2 ld de, wDebugDarkColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
ld a, TRUE ld a, TRUE
@ -508,13 +497,13 @@ DebugColor_UpdatePalettes:
ld [hli], a ld [hli], a
ld a, HIGH(PALRGB_WHITE) ld a, HIGH(PALRGB_WHITE)
ld [hli], a ld [hli], a
ld a, [wc608] ld a, [wDebugLightColor + 0]
ld [hli], a ld [hli], a
ld a, [wc608 + 1] ld a, [wDebugLightColor + 1]
ld [hli], a ld [hli], a
ld a, [wc608 + 2] ld a, [wDebugDarkColor + 0]
ld [hli], a ld [hli], a
ld a, [wc608 + 3] ld a, [wDebugDarkColor + 1]
ld [hli], a ld [hli], a
xor a xor a
ld [hli], a ld [hli], a
@ -525,10 +514,10 @@ DebugColor_UpdatePalettes:
call DebugColor_PushSGBPals call DebugColor_PushSGBPals
hlcoord 10, 2 hlcoord 10, 2
ld de, wc608 ld de, wDebugLightColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
hlcoord 15, 2 hlcoord 15, 2
ld de, wc608 + 2 ld de, wDebugDarkColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
ld a, DEBUGCOLORMAIN_JOYPAD ld a, DEBUGCOLORMAIN_JOYPAD
@ -563,7 +552,7 @@ DebugColor_Joypad:
and A_BUTTON and A_BUTTON
jr nz, .toggle_shiny jr nz, .toggle_shiny
ld a, [wcf64] ld a, [wDebugColorRGBJumptableIndex]
maskbits 4 ; .PointerTable length maskbits 4 ; .PointerTable length
ld e, a ld e, a
ld d, 0 ld d, 0
@ -583,13 +572,13 @@ DebugColor_Joypad:
.toggle_shiny .toggle_shiny
; Toggle between the normal and shiny mon colors. ; Toggle between the normal and shiny mon colors.
ld a, [wd002] ld a, [wDebugColorIsTrainer]
and a and a
ret nz ret nz
ld a, [wd003] ld a, [wDebugColorIsShiny]
xor %00000100 xor %00000100
ld [wd003], a ld [wDebugColorIsShiny], a
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, PokemonPalettes ld hl, PokemonPalettes
@ -620,16 +609,16 @@ DebugColor_SelectColorBox:
ret ret
.light .light
xor a xor a ; FALSE
ld [wcf65], a ld [wDebugColorCurColor], a
ld de, wc608 ld de, wDebugLightColor
call DebugColor_CalculateRGB call DebugColor_CalculateRGB
ret ret
.dark .dark
ld a, TRUE ld a, TRUE
ld [wcf65], a ld [wDebugColorCurColor], a
ld de, wc608 + 2 ld de, wDebugDarkColor
call DebugColor_CalculateRGB call DebugColor_CalculateRGB
ret ret
@ -641,7 +630,7 @@ DebugColor_ChangeRedValue:
ld a, [hl] ld a, [hl]
and D_UP and D_UP
jr nz, DebugColor_PreviousRGBColor jr nz, DebugColor_PreviousRGBColor
ld hl, wc608 + 10 ld hl, wDebugRedChannel
jr DebugColor_UpdateRGBColor jr DebugColor_UpdateRGBColor
DebugColor_ChangeGreenValue: DebugColor_ChangeGreenValue:
@ -652,7 +641,7 @@ DebugColor_ChangeGreenValue:
ld a, [hl] ld a, [hl]
and D_UP and D_UP
jr nz, DebugColor_PreviousRGBColor jr nz, DebugColor_PreviousRGBColor
ld hl, wc608 + 11 ld hl, wDebugGreenChannel
jr DebugColor_UpdateRGBColor jr DebugColor_UpdateRGBColor
DebugColor_ChangeBlueValue: DebugColor_ChangeBlueValue:
@ -660,7 +649,8 @@ DebugColor_ChangeBlueValue:
ld a, [hl] ld a, [hl]
and D_UP and D_UP
jr nz, DebugColor_PreviousRGBColor jr nz, DebugColor_PreviousRGBColor
ld hl, wc608 + 12 ld hl, wDebugBlueChannel
; fallthrough
DebugColor_UpdateRGBColor: DebugColor_UpdateRGBColor:
ldh a, [hJoyLast] ldh a, [hJoyLast]
@ -691,12 +681,12 @@ DebugColor_UpdateRGBColor:
ret ret
DebugColor_PreviousRGBColor: DebugColor_PreviousRGBColor:
ld hl, wcf64 ld hl, wDebugColorRGBJumptableIndex
dec [hl] dec [hl]
ret ret
DebugColor_NextRGBColor: DebugColor_NextRGBColor:
ld hl, wcf64 ld hl, wDebugColorRGBJumptableIndex
inc [hl] inc [hl]
ret ret
@ -709,7 +699,7 @@ DebugColor_InitTMHM:
ld de, DebugColor_AreYouFinishedString ld de, DebugColor_AreYouFinishedString
call PlaceString call PlaceString
xor a xor a
ld [wd004], a ld [wDebugColorCurTMHM], a
call DebugColor_PrintTMHMMove call DebugColor_PrintTMHMMove
ld a, DEBUGCOLORMAIN_TMHMJOYPAD ld a, DEBUGCOLORMAIN_TMHMJOYPAD
ld [wJumptableIndex], a ld [wJumptableIndex], a
@ -744,7 +734,7 @@ DebugColor_TMHMJoypad:
ret ret
.up .up
ld a, [wd004] ld a, [wDebugColorCurTMHM]
cp NUM_TM_HM_TUTOR - 1 cp NUM_TM_HM_TUTOR - 1
jr z, .wrap_down jr z, .wrap_down
inc a inc a
@ -755,7 +745,7 @@ DebugColor_TMHMJoypad:
jr .done jr .done
.down .down
ld a, [wd004] ld a, [wDebugColorCurTMHM]
and a and a
jr z, .wrap_up jr z, .wrap_up
dec a dec a
@ -765,7 +755,7 @@ DebugColor_TMHMJoypad:
ld a, NUM_TM_HM_TUTOR - 1 ld a, NUM_TM_HM_TUTOR - 1
.done .done
ld [wd004], a ld [wDebugColorCurTMHM], a
call DebugColor_PrintTMHMMove call DebugColor_PrintTMHMMove
ret ret
@ -779,7 +769,7 @@ DebugColor_PrintTMHMMove:
hlcoord 10, 14 hlcoord 10, 14
call .ClearRow call .ClearRow
ld a, [wd004] ld a, [wDebugColorCurTMHM]
inc a inc a
ld [wTempTMHM], a ld [wTempTMHM], a
predef GetTMHMMove predef GetTMHMMove
@ -789,7 +779,7 @@ DebugColor_PrintTMHMMove:
hlcoord 10, 12 hlcoord 10, 12
call PlaceString call PlaceString
ld a, [wd004] ld a, [wDebugColorCurTMHM]
call .GetNumberedTMHM call .GetNumberedTMHM
ld [wCurItem], a ld [wCurItem], a
predef CanLearnTMHMMove predef CanLearnTMHMMove
@ -826,48 +816,48 @@ DebugColor_PrintTMHMMove:
ret ret
DebugColor_CalculatePalette: DebugColor_CalculatePalette:
ld a, [wc608 + 10] ld a, [wDebugRedChannel]
and %00011111 and %00011111
ld e, a ld e, a
ld a, [wc608 + 11] ld a, [wDebugGreenChannel]
and %00000111 and %00000111
sla a sla a
swap a swap a
or e or e
ld e, a ld e, a
ld a, [wc608 + 11] ld a, [wDebugGreenChannel]
and %00011000 and %00011000
sla a sla a
swap a swap a
ld d, a ld d, a
ld a, [wc608 + 12] ld a, [wDebugBlueChannel]
and %00011111 and %00011111
sla a sla a
sla a sla a
or d or d
ld d, a ld d, a
ld a, [wcf65] ld a, [wDebugColorCurColor]
and a and a
jr z, .light jr z, .light
; dark ; dark
ld a, e ld a, e
ld [wc608 + 2], a ld [wDebugDarkColor + 0], a
ld a, d ld a, d
ld [wc608 + 3], a ld [wDebugDarkColor + 1], a
ret ret
.light .light
ld a, e ld a, e
ld [wc608], a ld [wDebugLightColor + 0], a
ld a, d ld a, d
ld [wc608 + 1], a ld [wDebugLightColor + 1], a
ret ret
DebugColor_CalculateRGB: DebugColor_CalculateRGB:
ld a, [de] ld a, [de]
and %00011111 and %00011111
ld [wc608 + 10], a ld [wDebugRedChannel], a
ld a, [de] ld a, [de]
and %11100000 and %11100000
swap a swap a
@ -879,26 +869,26 @@ DebugColor_CalculateRGB:
swap a swap a
srl a srl a
or b or b
ld [wc608 + 11], a ld [wDebugGreenChannel], a
ld a, [de] ld a, [de]
and %01111100 and %01111100
srl a srl a
srl a srl a
ld [wc608 + 12], a ld [wDebugBlueChannel], a
ret ret
DebugColor_BackupSpriteColors: DebugColor_BackupSpriteColors:
ld a, [wcf66] ld a, [wDebugColorCurMon]
inc a inc a
ld l, a ld l, a
ld h, 0 ld h, 0
add hl, hl add hl, hl
add hl, hl add hl, hl
ld de, wOverworldMapBlocks ; MonPalette ld de, wDebugOriginalColors
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h
ld hl, wc608 ld hl, wDebugMiddleColors
ld bc, 4 ld bc, 4
call CopyBytes call CopyBytes
ret ret
@ -1013,7 +1003,7 @@ DebugColor_PlaceCursor:
cp DEBUGCOLORMAIN_JOYPAD cp DEBUGCOLORMAIN_JOYPAD
jr nz, .clearsprites jr nz, .clearsprites
ld a, [wcf64] ld a, [wDebugColorRGBJumptableIndex]
and a and a
jr z, .place_cursor jr z, .place_cursor
dec a dec a
@ -1023,7 +1013,7 @@ DebugColor_PlaceCursor:
ld [hl], "▶" ld [hl], "▶"
.place_cursor .place_cursor
ld a, [wcf65] ld a, [wDebugColorCurColor]
and a and a
jr z, .light jr z, .light
; dark ; dark
@ -1037,11 +1027,11 @@ DebugColor_PlaceCursor:
ld b, $70 ; initial tile id ld b, $70 ; initial tile id
ld c, 5 ; initial palette ld c, 5 ; initial palette
ld hl, wVirtualOAM ld hl, wVirtualOAM
ld de, wc608 + 10 ld de, wDebugRedChannel
call .placesprite call .placesprite
ld de, wc608 + 11 ld de, wDebugGreenChannel
call .placesprite call .placesprite
ld de, wc608 + 12 ld de, wDebugBlueChannel
call .placesprite call .placesprite
ret ret
@ -1086,9 +1076,9 @@ TilesetColorPicker:
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wcf64], a ld [wDebugTilesetCurPalette], a
ld [wcf65], a ld [wDebugTilesetRGBJumptableIndex], a
ld [wcf66], a ld [wDebugTilesetCurColor], a
ldh [hMapAnims], a ldh [hMapAnims], a
call ClearSprites call ClearSprites
call OverworldTextModeSwitch call OverworldTextModeSwitch
@ -1138,8 +1128,9 @@ DebugTileset_DrawColorSwatch:
call _DebugColor_DrawSwatch call _DebugColor_DrawSwatch
DebugColor_DrawAttributeSwatch: DebugColor_DrawAttributeSwatch:
ld a, [wcf64] ld a, [wDebugTilesetCurPalette]
hlcoord 0, 0, wAttrmap hlcoord 0, 0, wAttrmap
; fallthrough
_DebugColor_DrawSwatch: _DebugColor_DrawSwatch:
; Fills a 4x3 box at de with byte a. ; Fills a 4x3 box at de with byte a.
@ -1176,7 +1167,7 @@ DebugTileset_LoadPalettes:
ld a, BANK(wBGPals1) ld a, BANK(wBGPals1)
ldh [rSVBK], a ldh [rSVBK], a
ld a, [wcf64] ld a, [wDebugTilesetCurPalette]
ld l, a ld l, a
ld h, 0 ld h, 0
add hl, hl add hl, hl
@ -1184,10 +1175,10 @@ DebugTileset_LoadPalettes:
add hl, hl add hl, hl
ld de, wBGPals1 ld de, wBGPals1
add hl, de add hl, de
ld de, wc608 ld de, wDebugPalette
ld bc, 1 palettes ld bc, 1 palettes
call CopyBytes call CopyBytes
ld de, wc608 ld de, wDebugPalette
call DebugColor_CalculateRGB call DebugColor_CalculateRGB
pop af pop af
@ -1198,15 +1189,15 @@ DebugColorMain2: ; unreferenced
ld hl, hJoyLast ld hl, hJoyLast
ld a, [hl] ld a, [hl]
and SELECT and SELECT
jr nz, .loop7 jr nz, .next_palette
ld a, [hl] ld a, [hl]
and B_BUTTON and B_BUTTON
jr nz, .cancel jr nz, .cancel
call DebugTileset_Joypad call DebugTileset_Joypad
ret ret
.loop7 .next_palette
ld hl, wcf64 ld hl, wDebugTilesetCurPalette
ld a, [hl] ld a, [hl]
inc a inc a
and PALETTE_MASK and PALETTE_MASK
@ -1230,10 +1221,10 @@ DebugColorMain2: ; unreferenced
ldh [rSVBK], a ldh [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld a, [wcf64] ld a, [wDebugTilesetCurPalette]
ld bc, 1 palettes ld bc, 1 palettes
call AddNTimes call AddNTimes
ld de, wc608 ld de, wDebugPalette
ld bc, 1 palettes ld bc, 1 palettes
call CopyBytes call CopyBytes
@ -1262,26 +1253,26 @@ DebugTileset_UpdatePalettes:
ldh [rSVBK], a ldh [rSVBK], a
ld hl, wBGPals2 ld hl, wBGPals2
ld a, [wcf64] ld a, [wDebugTilesetCurPalette]
ld bc, 1 palettes ld bc, 1 palettes
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
ld hl, wc608 ld hl, wDebugPalette
ld bc, 1 palettes ld bc, 1 palettes
call CopyBytes call CopyBytes
hlcoord 1, 0 hlcoord 1, 0
ld de, wc608 ld de, wDebugWhiteTileColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
hlcoord 6, 0 hlcoord 6, 0
ld de, wc608 + 2 ld de, wDebugLightTileColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
hlcoord 11, 0 hlcoord 11, 0
ld de, wc608 + 4 ld de, wDebugDarkTileColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
hlcoord 16, 0 hlcoord 16, 0
ld de, wc608 + 6 ld de, wDebugBlackTileColor
call DebugColor_PrintHexColor call DebugColor_PrintHexColor
pop af pop af
@ -1294,7 +1285,7 @@ DebugTileset_UpdatePalettes:
ret ret
DebugTileset_Joypad: DebugTileset_Joypad:
ld a, [wcf65] ld a, [wDebugTilesetRGBJumptableIndex]
maskbits 4 ; .PointerTable length maskbits 4 ; .PointerTable length
ld e, a ld e, a
ld d, 0 ld d, 0
@ -1326,20 +1317,20 @@ DebugTileset_SelectColorBox:
ret ret
.left .left
ld a, [wcf66] ld a, [wDebugTilesetCurColor]
dec a dec a
jr .done jr .done
.right .right
ld a, [wcf66] ld a, [wDebugTilesetCurColor]
inc a inc a
.done .done
and $3 maskbits NUM_PAL_COLORS
ld [wcf66], a ld [wDebugTilesetCurColor], a
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, wc608 ld hl, wDebugPalette
add hl, de add hl, de
add hl, de add hl, de
ld e, l ld e, l
@ -1355,7 +1346,7 @@ DebugTileset_ChangeRedValue:
ld a, [hl] ld a, [hl]
and D_UP and D_UP
jr nz, DebugTileset_PreviousRGBColor jr nz, DebugTileset_PreviousRGBColor
ld hl, wc608 + 10 ld hl, wDebugRedChannel
jr DebugTileset_UpdateRGBColor jr DebugTileset_UpdateRGBColor
DebugTileset_ChangeGreenValue: DebugTileset_ChangeGreenValue:
@ -1366,7 +1357,7 @@ DebugTileset_ChangeGreenValue:
ld a, [hl] ld a, [hl]
and D_UP and D_UP
jr nz, DebugTileset_PreviousRGBColor jr nz, DebugTileset_PreviousRGBColor
ld hl, wc608 + 11 ld hl, wDebugGreenChannel
jr DebugTileset_UpdateRGBColor jr DebugTileset_UpdateRGBColor
DebugTileset_ChangeBlueValue: DebugTileset_ChangeBlueValue:
@ -1374,7 +1365,8 @@ DebugTileset_ChangeBlueValue:
ld a, [hl] ld a, [hl]
and D_UP and D_UP
jr nz, DebugTileset_PreviousRGBColor jr nz, DebugTileset_PreviousRGBColor
ld hl, wc608 + 12 ld hl, wDebugBlueChannel
; fallthrough
DebugTileset_UpdateRGBColor: DebugTileset_UpdateRGBColor:
ldh a, [hJoyLast] ldh a, [hJoyLast]
@ -1404,40 +1396,40 @@ DebugTileset_UpdateRGBColor:
ret ret
DebugTileset_PreviousRGBColor: DebugTileset_PreviousRGBColor:
ld hl, wcf65 ld hl, wDebugTilesetRGBJumptableIndex
dec [hl] dec [hl]
ret ret
DebugTileset_NextRGBColor: DebugTileset_NextRGBColor:
ld hl, wcf65 ld hl, wDebugTilesetRGBJumptableIndex
inc [hl] inc [hl]
ret ret
DebugTileset_CalculatePalette: DebugTileset_CalculatePalette:
ld a, [wc608 + 10] ld a, [wDebugRedChannel]
and %00011111 and %00011111
ld e, a ld e, a
ld a, [wc608 + 11] ld a, [wDebugGreenChannel]
and %0000111 and %0000111
sla a sla a
swap a swap a
or e or e
ld e, a ld e, a
ld a, [wc608 + 11] ld a, [wDebugGreenChannel]
and %00011000 and %00011000
sla a sla a
swap a swap a
ld d, a ld d, a
ld a, [wc608 + 12] ld a, [wDebugBlueChannel]
and %00011111 and %00011111
sla a sla a
sla a sla a
or d or d
ld d, a ld d, a
ld a, [wcf66] ld a, [wDebugTilesetCurColor]
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, wc608 ld hl, wDebugPalette
add hl, bc add hl, bc
add hl, bc add hl, bc
ld a, e ld a, e

View File

@ -321,7 +321,7 @@ _CGB_BillsPC:
ldh [hCGBPalUpdate], a ldh [hCGBPalUpdate], a
ret ret
Function9009: Function9009: ; unreferenced
ld hl, BillsPCOrangePalette ld hl, BillsPCOrangePalette
call LoadHLPaletteIntoDE call LoadHLPaletteIntoDE
jr .GotPalette jr .GotPalette

View File

@ -605,13 +605,14 @@ Function104d5e:
xor a xor a
ldh [rIF], a ldh [rIF], a
call Function104d96 call Function104d96
; runs for ~$40400 cycles
xor a xor a
ld b, a ld b, a
.asm_104d6d .busy_wait
inc a inc a
jr nz, .asm_104d6d jr nz, .busy_wait
inc b inc b
jr nz, .asm_104d6d jr nz, .busy_wait
ret ret
Function104d74: Function104d74:
@ -846,9 +847,9 @@ Function104ed6:
ld b, a ld b, a
ld a, $f4 ld a, $f4
ldh [rTMA], a ldh [rTMA], a
.asm_104eee .main_loop
inc b inc b
jr z, .asm_104f2e jr z, .done
ld a, $8 ld a, $8
ldh [hPrintNumBuffer + 3], a ldh [hPrintNumBuffer + 3], a
ld a, [hli] ld a, [hli]
@ -859,7 +860,7 @@ Function104ed6:
ldh a, [hPrintNumBuffer + 5] ldh a, [hPrintNumBuffer + 5]
adc 0 adc 0
ldh [hPrintNumBuffer + 5], a ldh [hPrintNumBuffer + 5], a
.asm_104f02 .inner_loop
xor a xor a
ldh [rIF], a ldh [rIF], a
halt halt
@ -869,26 +870,27 @@ Function104ed6:
ld a, e ld a, e
rlca rlca
ld e, a ld e, a
jr nc, .asm_104f13 jr nc, .wait
inc d inc d
.asm_104f13 .wait
ldh a, [rTIMA] ldh a, [rTIMA]
cp $f8 cp $f8
jr c, .asm_104f13 jr c, .wait
ld a, $c0 ld a, $c0
ldh [rRP], a ldh [rRP], a
dec d dec d
jr z, .asm_104f25 jr z, .no_halt
xor a xor a
ldh [rIF], a ldh [rIF], a
halt halt
.asm_104f25 .no_halt
ldh a, [hPrintNumBuffer + 3] ldh a, [hPrintNumBuffer + 3]
dec a dec a
jr z, .asm_104eee jr z, .main_loop
ldh [hPrintNumBuffer + 3], a ldh [hPrintNumBuffer + 3], a
jr .asm_104f02 jr .inner_loop
.asm_104f2e
.done
ld a, $fe ld a, $fe
ldh [rTMA], a ldh [rTMA], a
xor a xor a
@ -987,48 +989,50 @@ Function104faf:
xor a xor a
ldh [hMGPrevTIMA], a ldh [hMGPrevTIMA], a
call Function104d86 call Function104d86
.asm_104fd2 .main_loop
inc b inc b
jr z, .asm_10501a jr z, .done
ld a, $8 ld a, $8
ldh [hPrintNumBuffer + 3], a ldh [hPrintNumBuffer + 3], a
.asm_104fd9 .inner_loop
ld d, $0 ld d, $0
.asm_104fdb .wait_one
inc d inc d
jr z, .asm_104fe5 jr z, .got_one
ldh a, [c] ldh a, [c]
bit 1, a bit 1, a
jr z, .asm_104fdb jr z, .wait_one
ld d, $0 ld d, $0
.asm_104fe5 .got_one
.wait_zero
inc d inc d
jr z, .asm_104fed jr z, .got_zero
ldh a, [c] ldh a, [c]
bit 1, a bit 1, a
jr nz, .asm_104fe5 jr nz, .wait_zero
.asm_104fed .got_zero
ldh a, [hMGPrevTIMA] ldh a, [hMGPrevTIMA]
ld d, a ld d, a
ldh a, [rTIMA] ldh a, [rTIMA]
ldh [hMGPrevTIMA], a ldh [hMGPrevTIMA], a
sub d sub d
cp $12 cp $12
jr c, .asm_104ffd jr c, .zero
set 0, e set 0, e
jr .asm_104fff jr .ok
.asm_104ffd .zero
res 0, e res 0, e
.asm_104fff .ok
ldh a, [hPrintNumBuffer + 3] ldh a, [hPrintNumBuffer + 3]
dec a dec a
ldh [hPrintNumBuffer + 3], a ldh [hPrintNumBuffer + 3], a
jr z, .asm_10500b jr z, .continue
ld a, e ld a, e
rlca rlca
ld e, a ld e, a
jr .asm_104fd9 jr .inner_loop
.asm_10500b
.continue
ld a, e ld a, e
ld [hli], a ld [hli], a
ldh a, [hPrintNumBuffer + 4] ldh a, [hPrintNumBuffer + 4]
@ -1037,8 +1041,9 @@ Function104faf:
ldh a, [hPrintNumBuffer + 5] ldh a, [hPrintNumBuffer + 5]
adc 0 adc 0
ldh [hPrintNumBuffer + 5], a ldh [hPrintNumBuffer + 5], a
jr .asm_104fd2 jr .main_loop
.asm_10501a
.done
call Function104d74 call Function104d74
xor a xor a
ldh [rIF], a ldh [rIF], a

View File

@ -773,6 +773,24 @@ wOddEgg:: party_struct wOddEgg
wOddEggName:: ds MON_NAME_LENGTH wOddEggName:: ds MON_NAME_LENGTH
wOddEggOTName:: ds NAME_LENGTH wOddEggOTName:: ds NAME_LENGTH
NEXTU
; debug mon color picker
wDebugMiddleColors::
wDebugLightColor:: ds 2
wDebugDarkColor:: ds 2
ds 6
wDebugRedChannel:: db
wDebugGreenChannel:: db
wDebugBlueChannel:: db
NEXTU
; debug tileset color picker
wDebugPalette::
wDebugWhiteTileColor:: ds 2
wDebugLightTileColor:: ds 2
wDebugDarkTileColor:: ds 2
wDebugBlackTileColor:: ds 2
NEXTU NEXTU
wc608:: ds 16 wc608:: ds 16
wc618:: ds 37 wc618:: ds 37
@ -1015,6 +1033,10 @@ NEXTU
; Hall of Fame data ; Hall of Fame data
wHallOfFamePokemonList:: hall_of_fame wHallOfFamePokemonList wHallOfFamePokemonList:: hall_of_fame wHallOfFamePokemonList
NEXTU
; debug color picker
wDebugOriginalColors:: ds 256 * 4
NEXTU NEXTU
; raw link data ; raw link data
wLinkData:: ds $514 wLinkData:: ds $514
@ -1501,6 +1523,18 @@ wHoldingUnownPuzzlePiece:: db
wUnownPuzzleCursorPosition:: db wUnownPuzzleCursorPosition:: db
wUnownPuzzleHeldPiece:: db wUnownPuzzleHeldPiece:: db
NEXTU
; debug mon color picker
wDebugColorRGBJumptableIndex:: db
wDebugColorCurColor:: db
wDebugColorCurMon:: db
NEXTU
; debug tileset color picker
wDebugTilesetCurPalette:: db
wDebugTilesetRGBJumptableIndex:: db
wDebugTilesetCurColor:: db
NEXTU NEXTU
; battle tower ; battle tower
ds $2 ds $2
@ -1835,6 +1869,12 @@ wSuicuneFrame::
wStartFlypoint:: db wStartFlypoint:: db
wEndFlypoint:: db wEndFlypoint:: db
NEXTU
; debug color picker
wDebugColorIsTrainer:: db
wDebugColorIsShiny:: db
wDebugColorCurTMHM:: db
NEXTU NEXTU
; link battle record data ; link battle record data
wLinkBattleRecordName:: ds NAME_LENGTH wLinkBattleRecordName:: ds NAME_LENGTH