Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-11-01 pokered update #6

Merged
merged 11 commits into from
Nov 12, 2024
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- name: Install rgbds
working-directory: rgbds
run: |
sudo apt-get install -yq libpng-dev
sudo make install

- name: Remove rgbds
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ To set up the repository, see [**INSTALL.md**](INSTALL.md).

- [**Wiki**][wiki] (includes [tutorials][tutorials])
- [**Symbols**][symbols]
- [**Tools**][tools]
- **Discord:** [pret][discord]
- **IRC:** [libera#pret][irc]

Expand Down Expand Up @@ -42,6 +43,7 @@ Other disassembly projects:
[wiki]: https://github.com/pret/pokered/wiki
[tutorials]: https://github.com/pret/pokered/wiki/Tutorials
[symbols]: https://github.com/pret/pokered/tree/symbols
[tools]: https://github.com/pret/gb-asm-tools
[discord]: https://discord.gg/d5dubZ3
[irc]: https://web.libera.chat/?#pret
[ci]: https://github.com/einstein95/pokered-fr/actions
Expand Down
6 changes: 6 additions & 0 deletions audio/wave_samples.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@

; duty 5 reads from sfx data
.wave5
; in audio 1: (used by audio/music/lavender.asm)
; dn 2, 1, 14, 2, 3, 3, 2, 8, 14, 1, 2, 2, 15, 15, 14, 10, 1, 0, 1, 4, 13, 12, 1, 0, 14, 3, 4, 1, 5, 1, 7, 3
; in audio 2:
; dn 14, 12, 0, 2, 2, 0, 9, 1, 0, 7, 12, 0, 2, 0, 8, 1, 0, 7, 13, 0, 2, 0, 9, 1, 0, 7, 12, 0, 2, 12, 10, 1
; in audio 3: (used by audio/music/pokemontower.asm)
; dn 2, 1, 14, 2, 3, 3, 2, 8, 14, 1, 2, 2, 15, 15, 2, 2, 15, 7, 2, 4, 2, 2, 15, 7, 3, 4, 2, 4, 15, 7, 4, 4
2 changes: 1 addition & 1 deletion engine/movie/oak_speech/init_player_data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DEF START_MONEY EQU $3000

ld hl, wObtainedBadges
ld [hli], a

assert wObtainedBadges + 1 == wUnusedObtainedBadges
ld [hl], a

ld hl, wPlayerCoins
Expand Down
72 changes: 41 additions & 31 deletions engine/movie/trade.asm
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Trade_AnimateBallEnteringLinkCable:
.moveBallInsideLinkCableLoop
push bc
xor a
ld de, Trade_BallInsideLinkCableOAM
ld de, Trade_BallInsideLinkCableOAMBlock
call WriteOAMBlock
ld a, [wLinkCableAnimBulgeToggle]
xor $1
Expand Down Expand Up @@ -345,9 +345,11 @@ Trade_AnimateBallEnteringLinkCable:
ldh [hAutoBGTransferEnabled], a
ret

Trade_BallInsideLinkCableOAM:
dbsprite 0, 15, 0, 6, $7e, OAM_HFLIP
dbsprite 8, 15, 0, 6, $7e, OAM_HFLIP | OAM_VFLIP
Trade_BallInsideLinkCableOAMBlock:
db $7e, 0
db $7e, OAM_HFLIP
db $7e, OAM_VFLIP
db $7e, OAM_HFLIP | OAM_VFLIP

Trade_ShowEnemyMon:
ld a, TRADE_BALL_TILT_ANIM
Expand Down Expand Up @@ -616,7 +618,7 @@ Trade_AnimCircledMon:

Trade_WriteCircledMonOAM:
farcall WriteMonPartySpriteOAMBySpecies
call Trade_WriteCircleOAM
call Trade_WriteCircleOAMBlock

Trade_AddOffsetsToOAMCoords:
ld hl, wShadowOAM
Expand Down Expand Up @@ -670,11 +672,11 @@ Trade_AnimMonMoveVertical:
jr nz, .loop
ret

Trade_WriteCircleOAM:
Trade_WriteCircleOAMBlock:
; Writes the OAM blocks for the circle around the traded mon as it passes
; the link cable.
ld hl, Trade_CircleOAMPointers
ld c, $4
ld hl, Trade_CircleOAMBlocks
ld c, 4
xor a
.loop
push bc
Expand All @@ -697,33 +699,41 @@ Trade_WriteCircleOAM:
jr nz, .loop
ret

MACRO trade_circle_oam
MACRO trade_circle_oam_block
; oam block pointer, upper-left x coord, upper-left y coord
dw \1
db \2, \3
ENDM

Trade_CircleOAMPointers:
; oam pointer, upper-left x coord, upper-left y coord
trade_circle_oam Trade_CircleOAM0, $08, $08
trade_circle_oam Trade_CircleOAM1, $18, $08
trade_circle_oam Trade_CircleOAM2, $08, $18
trade_circle_oam Trade_CircleOAM3, $18, $18

Trade_CircleOAM0:
dbsprite 2, 7, 0, 0, ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1
dbsprite 2, 7, 0, 2, ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1

Trade_CircleOAM1:
dbsprite 6, 7, 0, 1, ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP
dbsprite 6, 7, 0, 3, ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP

Trade_CircleOAM2:
dbsprite 10, 7, 0, 2, ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_VFLIP
dbsprite 10, 7, 0, 0, ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_VFLIP

Trade_CircleOAM3:
dbsprite 14, 7, 0, 3, ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
dbsprite 14, 7, 0, 1, ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
Trade_CircleOAMBlocks:
trade_circle_oam_block .OAMBlock0, 8, 8
trade_circle_oam_block .OAMBlock1, 24, 8
trade_circle_oam_block .OAMBlock2, 8, 24
trade_circle_oam_block .OAMBlock3, 24, 24

.OAMBlock0:
db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1
db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1
db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1
db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1

.OAMBlock1:
db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_HFLIP
db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP
db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_HFLIP
db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP

.OAMBlock2:
db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_VFLIP

.OAMBlock3:
db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP

; a = species
Trade_LoadMonSprite:
Expand Down
6 changes: 3 additions & 3 deletions engine/overworld/auto_movement.asm
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ RLEList_PewterGymGuy:
db NPC_MOVEMENT_RIGHT, 3
db -1 ; end

FreezeEnemyTrainerSprite::
SetEnemyTrainerToStayAndFaceAnyDirection::
ld a, [wCurMap]
cp POKEMON_TOWER_7F
ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them
ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't set them
ld hl, RivalIDs
ld a, [wEngagedTrainerClass]
ld b, a
Expand All @@ -278,7 +278,7 @@ FreezeEnemyTrainerSprite::
cp -1
jr z, .notRival
cp b
ret z ; the rival leaves after battling, so don't freeze him
ret z ; the rival leaves after battling, so don't set him
jr .loop
.notRival
ld a, [wSpriteIndex]
Expand Down
11 changes: 7 additions & 4 deletions engine/overworld/cut.asm
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,15 @@ LoadCutGrassAnimationTilePattern:
WriteCutOrBoulderDustAnimationOAMBlock:
call GetCutOrBoulderDustAnimationOffsets
ld a, $9
ld de, CutOrBoulderDustAnimationTilesAndAttributes
ld de, .OAMBlock
jp WriteOAMBlock

CutOrBoulderDustAnimationTilesAndAttributes:
dbsprite 2, -1, 0, 4, $fd, OAM_OBP1
dbsprite 2, -1, 0, 6, $ff, OAM_OBP1
.OAMBlock:
; tile ID, attributes
db $fc, OAM_OBP1
db $fd, OAM_OBP1
db $fe, OAM_OBP1
db $ff, OAM_OBP1

GetCutOrBoulderDustAnimationOffsets:
ld hl, wSpritePlayerStateData1YPixels
Expand Down
11 changes: 7 additions & 4 deletions engine/overworld/emotion_bubbles.asm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ EmotionBubble:
add $8
ld c, a

ld de, EmotionBubblesOAM
ld de, EmotionBubblesOAMBlock
xor a
call WriteOAMBlock
ld c, 60
Expand All @@ -67,9 +67,12 @@ EmotionBubblesPointerTable:
dw QuestionEmote
dw HappyEmote

EmotionBubblesOAM:
dbsprite 0, -1, 0, 0, $f9, 0
dbsprite 0, -1, 0, 2, $fb, 0
EmotionBubblesOAMBlock:
; tile ID, attributes
db $f8, 0
db $f9, 0
db $fa, 0
db $fb, 0

EmotionBubbles:
ShockEmote: INCBIN "gfx/emotes/shock.2bpp"
Expand Down
11 changes: 7 additions & 4 deletions engine/overworld/ledges.asm
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ LoadHoppingShadowOAM:
call CopyVideoDataDouble
ld a, $9
lb bc, $54, $48 ; b, c = y, x coordinates of shadow
ld de, LedgeHoppingShadowOAM
ld de, LedgeHoppingShadowOAMBlock
call WriteOAMBlock
ret

LedgeHoppingShadow:
INCBIN "gfx/overworld/shadow.1bpp"
LedgeHoppingShadowEnd:

LedgeHoppingShadowOAM:
dbsprite 2, -1, 0, 7, $ff, OAM_HFLIP
dbsprite 8, -1, 0, 7, $ff, OAM_HFLIP | OAM_VFLIP
LedgeHoppingShadowOAMBlock:
; tile ID, attributes
db $ff, OAM_OBP1
db $ff, OAM_HFLIP
db $ff, OAM_VFLIP
db $ff, OAM_HFLIP | OAM_VFLIP
4 changes: 2 additions & 2 deletions home/map_objects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ SetSpriteMovementBytesToFE::
SetSpriteMovementBytesToFF::
push hl
call GetSpriteMovementByte1Pointer
ld [hl], $FF
ld [hl], STAY
call GetSpriteMovementByte2Pointer
ld [hl], $FF ; prevent person from walking?
ld [hl], NONE
pop hl
ret

Expand Down
2 changes: 1 addition & 1 deletion home/trainers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ PrintEndBattleText::
pop af
ldh [hLoadedROMBank], a
ld [MBC1RomBank], a
farcall FreezeEnemyTrainerSprite
farcall SetEnemyTrainerToStayAndFaceAnyDirection
jp WaitForSoundToFinish

GetSavedEndBattleTextPointer::
Expand Down
11 changes: 7 additions & 4 deletions ram/wram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,13 @@ wPlayerMonMinimized:: db

ds 13

; number of hits by enemy in attacks like Double Slap, etc.
wEnemyNumHits:: ; db
UNION
; the amount of damage accumulated by the enemy while biding
wEnemyBideAccumulatedDamage:: dw
NEXTU
; number of hits by enemy in attacks like Double Slap, etc.
wEnemyNumHits:: db
ENDU

ds 8
wMiscBattleDataEnd::
Expand Down Expand Up @@ -1749,7 +1752,7 @@ wOptions:: db

wObtainedBadges:: flag_array NUM_BADGES

ds 1
wUnusedObtainedBadges:: db

wLetterPrintingDelayFlags:: db

Expand Down Expand Up @@ -2143,7 +2146,7 @@ wSerialEnemyDataBlock:: ; ds $1a8

ds 9

wEnemyPartyCount:: ds 1
wEnemyPartyCount:: db
wEnemyPartySpecies:: ds PARTY_LENGTH + 1

wEnemyMons::
Expand Down
2 changes: 1 addition & 1 deletion scripts/VermilionDock.asm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ VermilionDock_EmitSmokePuff:
ret

VermilionDockOAMBlock:
; tile id, attribute
; tile ID, attributes
db $fc, $10
db $fd, $10
db $fe, $10
Expand Down
5 changes: 1 addition & 4 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ all: $(tools)
clean:
$(RM) $(tools)

gfx: common.h
scan_includes: common.h

%: %.c
%: %.c common.h
$(CC) $(CFLAGS) -o $@ $<
56 changes: 0 additions & 56 deletions tools/consts.py

This file was deleted.

Loading