diff options
-rw-r--r-- | engine/gfx/cgb_layouts.asm | 43 | ||||
-rw-r--r-- | engine/gfx/color.asm | 28 | ||||
-rw-r--r-- | engine/gfx/load_pics.asm | 6 | ||||
-rw-r--r-- | engine/gfx/sprite_anims.asm | 18 | ||||
-rw-r--r-- | engine/gfx/sprites.asm | 2 | ||||
-rw-r--r-- | engine/items/item_effects.asm | 13 | ||||
-rw-r--r-- | engine/items/tmhm2.asm | 4 | ||||
-rw-r--r-- | engine/pokedex/pokedex_2.asm | 4 | ||||
-rw-r--r-- | engine/rtc/print_hours_mins.asm | 6 | ||||
-rw-r--r-- | home/gfx.asm | 2 |
10 files changed, 66 insertions, 60 deletions
diff --git a/engine/gfx/cgb_layouts.asm b/engine/gfx/cgb_layouts.asm index f368468f..0fb65851 100644 --- a/engine/gfx/cgb_layouts.asm +++ b/engine/gfx/cgb_layouts.asm @@ -113,9 +113,9 @@ _CGB_BattleColors: ld [wSGBPredef], a call ApplyPals _CGB_FinishBattleScreenLayout: - ld hl, TilesetBGPalette + 7 * 8 + ld hl, TilesetBGPalette palette 7 ld de, wBGPals1 palette 7 - ld bc, $8 + ld bc, 1 palettes call CopyBytes hlcoord 0, 0, wAttrmap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT @@ -282,15 +282,15 @@ _CGB_BillsPC: ld a, [wCurPartySpecies] cp $ff jr nz, .GetMonPalette - ld hl, .BillsPCOrangePalette + ld hl, BillsPCOrangePalette call LoadHLPaletteIntoDE - jr .Resume + jr .GotPalette .GetMonPalette: ld bc, wTempMonDVs call GetPlayerOrMonPalettePointer call LoadPalette_White_Col1_Col2_Black -.Resume: +.GotPalette: call WipeAttrmap hlcoord 1, 4, wAttrmap lb bc, 7, 7 @@ -303,16 +303,16 @@ _CGB_BillsPC: ldh [hCGBPalUpdate], a ret -.Function9009: - ld hl, .BillsPCOrangePalette +Function9009: + ld hl, BillsPCOrangePalette call LoadHLPaletteIntoDE - jr .asm_95b1 + jr .GotPalette -.unused +.GetMonPalette: ld bc, wTempMonDVs call GetPlayerOrMonPalettePointer call LoadPalette_White_Col1_Col2_Black -.asm_95b1 +.GotPalette: call WipeAttrmap hlcoord 1, 1, wAttrmap lb bc, 7, 7 @@ -325,7 +325,7 @@ _CGB_BillsPC: ldh [hCGBPalUpdate], a ret -.BillsPCOrangePalette: +BillsPCOrangePalette: INCLUDE "gfx/pc/orange.pal" _CGB_PokedexUnownMode: @@ -624,11 +624,12 @@ _CGB_TrainerCard: ; card border hlcoord 0, 0, wAttrmap ld bc, SCREEN_WIDTH * SCREEN_HEIGHT - ld a, $1 ; FALKNER + ld a, $1 ; falkner call ByteFill + ; trainer sprite area hlcoord 14, 1, wAttrmap lb bc, 7, 5 - xor a ; CHRIS + xor a ; chris call FillBoxCGB ; top-right corner still uses the border's palette hlcoord 18, 1, wAttrmap @@ -863,3 +864,19 @@ _CGB_TrainerOrMonFrontpicPals: call ApplyAttrmap call ApplyPals ret + +_CGB_MysteryGift: + ld hl, .MysteryGiftPalette + ld de, wBGPals1 + ld bc, 1 palettes + call CopyBytes + call ApplyPals + call WipeAttrmap + call ApplyAttrmap + ret + +.MysteryGiftPalette: + RGB 31, 31, 31 + RGB 09, 31, 31 + RGB 10, 12, 31 + RGB 00, 03, 19 diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index f8fcffc2..01e5acb7 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -264,7 +264,7 @@ Unreferenced_Function91b4: jr .loop .done - ld b, $0 + ld b, 0 add hl, bc lb bc, 6, 4 ld a, [wBetaPokerSGBAttr] @@ -409,22 +409,6 @@ INCLUDE "gfx/mail/mail.pal" INCLUDE "engine/gfx/cgb_layouts.asm" -_CGB_MysteryGift: - ld hl, .Palette - ld de, wBGPals1 - ld bc, 1 palettes - call CopyBytes - call ApplyPals - call WipeAttrmap - call ApplyAttrmap - ret - -.Palette: - RGB 31, 31, 31 - RGB 09, 31, 31 - RGB 10, 12, 31 - RGB 00, 03, 19 - CopyFourPalettes: ld de, wBGPals1 ld c, 4 @@ -908,7 +892,7 @@ PushSGBBorder: ret .LoadSGBBorderPointers: - ld hl, SGBBorder + ld hl, SGBBorderGFX ld de, SGBBorderMap ret @@ -1108,18 +1092,22 @@ INCLUDE "gfx/sgb/predef.pal" IF DEF(_GOLD) SGBBorderMap: +; interleaved tile ids and palette ids, without the center 20x18 screen area INCBIN "gfx/sgb/gold_border.sgb.tilemap" SGBBorderPalettes: +; assumed to come after SGBBorderMap INCLUDE "gfx/sgb/gold_border.pal" -SGBBorder: +SGBBorderGFX: INCBIN "gfx/sgb/gold_border.2bpp" ELIF DEF(_SILVER) SGBBorderMap: +; interleaved tile ids and palette ids, without the center 20x18 screen area INCBIN "gfx/sgb/silver_border.sgb.tilemap" SGBBorderPalettes: +; assumed to come after SGBBorderMap INCLUDE "gfx/sgb/silver_border.pal" -SGBBorder: +SGBBorderGFX: INCBIN "gfx/sgb/silver_border.2bpp" ENDC diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index 869dc988..9109a7f9 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -283,6 +283,8 @@ GetTrainerPic: ret DecompressGet2bpp: +; Decompress lz data from b:hl to sDecompressBuffer, then copy it to address de. + push de push bc ld a, BANK(sDecompressBuffer) @@ -385,12 +387,12 @@ PadFrontpic: rept 4 srl c endr -.loop +.fill_loop rept 16 ld [hli], a endr dec c - jr nz, .loop + jr nz, .fill_loop ret LoadOrientedFrontpic: diff --git a/engine/gfx/sprite_anims.asm b/engine/gfx/sprite_anims.asm index b32a3d27..0cb4f67f 100644 --- a/engine/gfx/sprite_anims.asm +++ b/engine/gfx/sprite_anims.asm @@ -775,7 +775,7 @@ IF DEF(_GOLD) ld a, [hl] sla a sla a - ld d, 2 + ld d, $2 ld hl, SPRITEANIMSTRUCT_0C add hl, bc @@ -840,11 +840,11 @@ ENDC IF DEF(_GOLD) inc a ld [hl], a - ld d, 2 + ld d, $2 ELIF DEF(_SILVER) dec a ld [hl], a - ld d, 8 + ld d, $8 ENDC call .Sprites_Sine @@ -1086,9 +1086,9 @@ ENDC callfar Slots_AnimateChansey ld hl, wce64 ld a, [hl] - cp 2 + cp $2 ret nz - ld [hl], 3 + ld [hl], $3 ld a, SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY_2 call _ReinitSpriteAnimFrame ret @@ -1099,7 +1099,7 @@ ENDC ld a, [hl] dec [hl] ld e, a - and 1 + and $1 jr z, .move_vertical ld hl, SPRITEANIMSTRUCT_XCOORD @@ -1108,7 +1108,7 @@ ENDC cp 15 * 8 jr c, .move_right call DeinitializeSprite - ld a, 4 + ld a, $4 ld [wce64], a ld de, SFX_PLACE_PUZZLE_PIECE_DOWN call PlaySFX @@ -1450,7 +1450,7 @@ ENDC ld d, a and a jr z, .asm_8dbce - sub 2 + sub $2 ld [hl], a .asm_8dbce ld hl, SPRITEANIMSTRUCT_0E @@ -1465,7 +1465,7 @@ ENDC ret .AnonymousJumptable: - ld hl, sp+$0 + ld hl, sp+0 ld e, [hl] inc hl ld d, [hl] diff --git a/engine/gfx/sprites.asm b/engine/gfx/sprites.asm index 2e671002..adec8755 100644 --- a/engine/gfx/sprites.asm +++ b/engine/gfx/sprites.asm @@ -306,7 +306,7 @@ AddOrSubtractY: bit OAM_Y_FLIP, [hl] jr z, .ok ; -8 - a - add $8 + add 8 xor $ff inc a diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 35a7cd6c..b9755cb8 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -747,7 +747,7 @@ HeavyBallMultiplier: add hl, de rlca rlca - and %11 + maskbits NUM_DEX_ENTRY_BANKS add BANK("Pokedex Entries 001-064") ld d, a ld a, BANK(PokedexDataPointerTable) @@ -2069,16 +2069,15 @@ XAccuracyEffect: PokeDollEffect: ld a, [wBattleMode] - dec a - jr nz, .asm_f4f6 - inc a + dec a ; WILD_BATTLE? + jr nz, .not_wild + inc a ; TRUE ld [wForcedSwitch], a - ; set battle draw - inc a + inc a ; DRAW ld [wBattleResult], a jp UseItemText -.asm_f4f6 +.not_wild xor a ld [wItemEffectSucceeded], a ret diff --git a/engine/items/tmhm2.asm b/engine/items/tmhm2.asm index eb3eb58e..0c2ef8de 100644 --- a/engine/items/tmhm2.asm +++ b/engine/items/tmhm2.asm @@ -14,11 +14,11 @@ CanLearnTMHMMove: and a jr z, .end cp b - jr z, .asm_11a45 + jr z, .found inc c jr .loop -.asm_11a45 +.found pop hl ld b, CHECK_FLAG push de diff --git a/engine/pokedex/pokedex_2.asm b/engine/pokedex/pokedex_2.asm index 3d5f51b7..a6eeef0a 100644 --- a/engine/pokedex/pokedex_2.asm +++ b/engine/pokedex/pokedex_2.asm @@ -125,7 +125,7 @@ DisplayDexEntry: push hl push de ; Print the height, with two of the four digits in front of the decimal point - ld hl, sp+$0 + ld hl, sp+0 ld d, h ld e, l hlcoord 12, 7 @@ -151,7 +151,7 @@ DisplayDexEntry: jr z, .skip_weight push de ; Print the weight, with four of the five digits in front of the decimal point - ld hl, sp+$0 + ld hl, sp+0 ld d, h ld e, l hlcoord 11, 9 diff --git a/engine/rtc/print_hours_mins.asm b/engine/rtc/print_hours_mins.asm index faa69756..41ad2009 100644 --- a/engine/rtc/print_hours_mins.asm +++ b/engine/rtc/print_hours_mins.asm @@ -4,7 +4,7 @@ Unreferenced_Function1c0a0d: ld c, a push bc push de - ld hl, sp+$2 + ld hl, sp+2 ld d, h ld e, l pop hl @@ -30,7 +30,7 @@ PrintHoursMins: ld b, a ; Crazy stuff happening with the stack push bc - ld hl, sp+$1 + ld hl, sp+1 push de push hl pop de @@ -42,7 +42,7 @@ PrintHoursMins: inc hl ld d, h ld e, l - ld hl, sp+$0 + ld hl, sp+0 push de push hl pop de diff --git a/home/gfx.asm b/home/gfx.asm index 1a01b6c5..9be62597 100644 --- a/home/gfx.asm +++ b/home/gfx.asm @@ -281,7 +281,7 @@ Unreferenced_Copy2bpp:: add hl, hl ld b, h ld c, l - pop de + pop de pop hl jp FarCopyBytes |