-
Notifications
You must be signed in to change notification settings - Fork 12
Reveal Breakable Tiles #154
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
Merged
biosp4rk
merged 11 commits into
MetroidAdvRandomizerSystem:main
from
cluekitty:feat/reveal-hidden-tiles
Feb 23, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
229aed1
feat: start work for unhidden breakable blocks.
cluekitty 35fe1ed
start block replacement
cluekitty ab08f60
check all breakable except tanks, fix some bugs, cleanup some comment…
cluekitty 52bc059
ensure flag for unhidden breakable tiles is in a consistent spot in ROM
cluekitty a1b044b
Merge branch 'MetroidAdvRandomizerSystem:main' into feat/reveal-hidde…
cluekitty 24aa0c9
change flag name to better represent functionality
cluekitty f6589b2
move room-names to autoregion and load room name changes last to avoi…
cluekitty fa62f58
Handle bomb chain tile data when hidden tiles are revealed
cluekitty 364c397
set reveal hidden blocks flag to false by default
cluekitty 998fc6c
clean up todo
cluekitty 39c8e6a
Remove assembler flag for unhidden tiles.
cluekitty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| .org RemoveNeverReformBlocksAndCollectedTanks | ||
| .area 08064AEBh-08064ADCh, 0 | ||
| push { lr } | ||
| bl @RemoveMiscTilesFromRoom | ||
| pop { r0 } | ||
| bx r0 | ||
| .endarea | ||
|
|
||
| .autoregion | ||
| .align 2 | ||
| .func @RemoveMiscTilesFromRoom | ||
| push { lr } | ||
| bl RemoveNeverReformBlocks | ||
| bl RemoveCollectedTanks | ||
| bl RevealHiddenBreakableTiles | ||
| pop { r0 } | ||
| bx r0 | ||
| .endfunc | ||
| .endautoregion | ||
|
|
||
| .org RevealHiddenTilesFlag | ||
| .area 1 | ||
| .db 00h | ||
| .endarea | ||
|
|
||
| .org 0806B962h ; Editing UpdateBlockAnimation, case 07h | ||
| .area 0806B968h-0806B962h, 0 | ||
| bl @BreakStateIfRevealed | ||
| .endarea | ||
|
|
||
| .autoregion | ||
| .align 2 | ||
| .func @BreakStateIfRevealed | ||
| push { r4, lr } | ||
| ldr r4, =RevealHiddenTilesFlag | ||
| ldrb r4, [r4] | ||
| cmp r4, 0 | ||
| bne @@if_revealed | ||
| @@if_vanilla: | ||
| add r0, #01h | ||
| b @@return | ||
| @@if_revealed: | ||
| sub r0, #05h | ||
| @@return: | ||
| lsl r0, r0, #10h | ||
| lsr r5, r0, #10h | ||
| pop { r4, lr } | ||
| .pool | ||
| .endfunc | ||
| .endautoregion | ||
|
|
||
| .autoregion | ||
| .align 2 | ||
| .func RevealHiddenBreakableTiles | ||
| push { r4-r7, lr } | ||
| ldr r0, =RevealHiddenTilesFlag | ||
| ldrb r0, [r0] | ||
| cmp r0, #0 | ||
| beq @@return | ||
| b @@load_room_info | ||
|
|
||
| @@load_room_info: | ||
| ldr r7, =LevelLayers + LevelLayers_Clipdata | ||
| ldrh r6, [r7, LevelLayer_Rows] ; height | ||
| ldrh r5, [r7, LevelLayer_Stride] ; width | ||
| ldr r7, [r7] | ||
| sub sp, #8 | ||
| str r5, [sp] | ||
| str r6, [sp, #4] | ||
| mov r5, #0 | ||
| mov r6, #0 | ||
| @@loop: | ||
| mov r1, r7 | ||
| ldr r3, [sp] | ||
| mov r2, r6 | ||
| mul r2, r3 ; height * room width | ||
| add r2, r2, r5 ; + width | ||
| lsl r2, #1 | ||
| add r0, r1, r2 | ||
| ldr r1, =3001h | ||
| cmp r1, r2 ; don't read past Clipdata RAM | ||
| beq @@return | ||
| ldrh r0, [r7, r2] | ||
| cmp r0, #ClipdataTile_Air | ||
| beq @@inc_width | ||
| cmp r0, #ClipdataTile_Solid | ||
| beq @@inc_width | ||
| cmp r0, #ClipdataTile_DoorTransition | ||
| beq @@inc_width | ||
| bl @SearchForHiddenBlocks | ||
| mov r1, #0 | ||
| mvn r1, r1 | ||
| lsl r1, #10h | ||
| lsr r1, #10h | ||
| cmp r1, r0 ; if not FFFF | ||
| bne @@reveal_hidden_block | ||
| b @@inc_width | ||
| @@reveal_hidden_block: | ||
| ; r0 should contain value of new tile | ||
| mov r1, r6 ; Y Pos | ||
| mov r2, r5 ; X Pos | ||
| bl SetSpecialBg1Tile | ||
| @@inc_width: | ||
| add r5, #1 | ||
| ldr r0, [sp] | ||
| cmp r5, r0 | ||
| ble @@loop | ||
| @@inc_height: | ||
| add r6, #1 | ||
| ldr r0, [sp, #4] | ||
| cmp r6, r0 | ||
| beq @@return | ||
| mov r5, #1 | ||
| b @@loop | ||
| @@return: | ||
| add sp, #8 | ||
| pop { r4-r7 } | ||
| pop { r0 } | ||
| bx r0 | ||
| .pool | ||
| .endfunc | ||
| .endautoregion | ||
|
|
||
| .autoregion | ||
| .align 2 | ||
| @ClipDataReplacements: | ||
| ;.db Clip to check, replacement clip | ||
| .dh ClipdataTile_Crumble, ClipdataRevealed_Crumble | ||
| .dh ClipdataTile_WeakReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_BombNeverReform, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_BombReform, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_SpeedNoReform, ClipdataRevealed_Speed | ||
| .dh ClipdataTile_SpeedReform, ClipdataRevealed_Speed | ||
| .dh ClipdataTile_MissileNeverReform, ClipdataRevealed_Missile | ||
| .dh ClipdataTile_MissileNoReform, ClipdataRevealed_Missile | ||
| .dh ClipdataTile_PBomb, ClipdataRevealed_PBomb | ||
| .dh ClipdataTile_ScrewAttack, ClipdataRevealed_ScrewAttack | ||
| ; Not revealing tanks at this time | ||
| ;.dh ClipdataTile_MissileTankHidden, 801Ch | ||
| ;.dh ClipdataTile_EngergyTankHidden, 801Dh | ||
| ;.dh ClipdataTile_PBombTankHidden, 801Eh | ||
| .dh ClipdataTile_2x2TopLeftNeverReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_2x2TopRightNeverReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_WeakNeverReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_WeakNoReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_2x2TopLeftNoReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_2x2TopRightNoReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_2x2BottomLeftNeverReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_2x2BottomRightNeverReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_2x2BottomLeftNoReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_2x2BottomRightNoReform, ClipdataRevealed_Weak | ||
| .dh ClipdataTile_VerticalBombChain1, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_VerticalBombChain2, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_VerticalBombChain3, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_VerticalBombChain4, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_HorizontalBombChain1, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_HorizontalBombChain2, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_HorizontalBombChain3, ClipdataRevealed_Bomb | ||
| .dh ClipdataTile_HorizontalBombChain4, ClipdataRevealed_Bomb | ||
| .dh 0FFFFh, 0FFFFh | ||
| .endautoregion | ||
|
|
||
|
|
||
| .autoregion | ||
| ; input | ||
| ; r0 = Block to Search For | ||
| ; output | ||
| ; r0 = Replacement Tile, or None (0FFFFh) | ||
| .align 2 | ||
| .func @SearchForHiddenBlocks | ||
| push { r1-r4, lr } | ||
| sub sp, #4 | ||
| mov r3, #0 | ||
| str r3, [sp] | ||
| @@search: | ||
| ldr r3, [sp] | ||
| lsl r3, #2 | ||
| ldr r4, =@ClipDataReplacements | ||
| add r4, r4, r3 | ||
| ldrh r2, [r4] | ||
| mov r1, #0 | ||
| mvn r1, r1 | ||
| lsl r1, r1, 10h | ||
| lsr r1, r1, 10h | ||
| cmp r2, r1 | ||
| beq @@return_none | ||
| cmp r0, r2 | ||
| beq @@return_replacement | ||
| ; increment counter | ||
| lsr r3, #2 | ||
| add r3, #1 | ||
| str r3, [sp] | ||
| b @@search | ||
| @@return_replacement: | ||
| ldr r2, =@ClipDataReplacements+2 | ||
| add r2, r2, r3 | ||
| ldrh r0, [r2, #0] | ||
| add sp, #4 | ||
| pop { r1-r4, pc } | ||
| @@return_none: | ||
| ldr r0, =0FFFFh | ||
| add sp, #4 | ||
| pop { r1-r4, pc } | ||
| .pool | ||
| .endfunc | ||
| .endautoregion |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.