33 Commits

Author SHA1 Message Date
482381fe53 Add lower-layer headers to doors/stairs in IP tile theme 2026-01-27 21:21:23 -06:00
2b3b50fc5c Initialize $72 before loading palette for OW map 2026-01-27 00:19:56 -06:00
b7c32fdfb1 Bump GK Rom version 2026-01-25 21:48:20 -06:00
ec1083a2e5 Fix reference to now-removed UWSpritesPointer 2026-01-25 21:31:39 -06:00
53d2a7606a Merge remote-tracking branch 'codemann/OWMain' into codemann_OWMain 2026-01-25 21:15:13 -06:00
37ee113f9d Merge in dungeon map changes (#1)
known issues:
- in-room stairs in door shuffle draw slightly bugged sometimes
- entrance sprites in non-doors are sometimes drawn on the wrong floor
- in some modes, sanctuary will open HC map instead of sewers/HC2 map

Reviewed-on: #1
Co-authored-by: Kara Alexandra <ardnaxelarak@gmail.com>
Co-committed-by: Kara Alexandra <ardnaxelarak@gmail.com>
2026-01-25 22:43:02 +00:00
codemann8
781431f633 Fixes issue not able to screen transition if bumped by enemy in water 2026-01-19 15:21:03 -06:00
codemann8
e02f98e6c5 Fixed L/R map swap while in special world 2026-01-17 13:58:18 -06:00
codemann8
7898e2149f Fixed issue with Old Man follower infinite pit fall 2026-01-17 00:51:26 -06:00
5831117e36 Fix light cone not showing after torches extinguish 2026-01-16 18:28:21 -06:00
codemann8
3c41d7ff39 Change key total display based on seen by player 2026-01-16 15:30:06 -06:00
codemann8
ab0f37b7ba Merge branch 'OWMain' of https://github.com/codemann8/z3randomizer into OWMain 2026-01-16 14:30:04 -06:00
codemann8
343d61a976 Fixing key totals marking MapCountDisplay flag 2026-01-16 14:30:01 -06:00
codemann8
804e72395b Fixing key totals marking MapCountDisplay flag 2026-01-16 14:19:48 -06:00
codemann8
e8e6120a9e Some added labeling 2026-01-13 23:51:42 -06:00
codemann8
b0dfcdcae6 Fixed screen drawing issue on Pyramid screen 2026-01-13 15:29:04 -06:00
codemann8
920212d1b8 Removed sprite pointer label since value can shift via generator 2026-01-13 11:26:28 -06:00
codemann8
b7e123a7cf Removed hardcoded sprite data 2026-01-13 11:25:41 -06:00
codemann8
ce7f35ac7b Fixed screen drawing issue on HC screen 2026-01-13 11:24:37 -06:00
codemann8
a090f95659 Hold L/R during Grid OW map check to see opposite world 2026-01-12 22:35:07 -06:00
Catobat
9cbc202b62 Move dynamically positioned sprites on overworld map to match custom layout 2026-01-11 21:45:42 +01:00
Catobat
2ee7be56fc Overworld map fog 2026-01-11 21:45:42 +01:00
Catobat
fe5c936c7c Draw arbitrary layouts on the overworld map 2026-01-11 21:45:42 +01:00
Catobat
afa0f95072 Overworld edges are disabled if the destination is set to 0xFF 2026-01-11 21:45:42 +01:00
codemann8
ead6a30aa5 Fixed boss icons not showing on dungeon map check 2026-01-11 01:59:44 -06:00
codemann8
d532ac2f4a Fixed bonk drops duplicate counting and potentially writing bad values 2026-01-11 00:38:24 -06:00
codemann8
71ebc09270 Fix bonk drops updating HUD on collection 2026-01-11 00:06:52 -06:00
codemann8
0fef82981a Fixed bonk drops double counting and potentially writing bad values 2026-01-11 00:06:19 -06:00
codemann8
7d45a5cf66 Merge branch 'OWMain' of https://github.com/codemann8/z3randomizer into OWMain 2026-01-08 19:47:22 -06:00
codemann8
5af2fdc51e Fix psuedoboots ability to open Kings Tomb 2026-01-08 19:47:06 -06:00
codemann8
bff1da4330 Fix psuedoboots ability to open Kings Tomb 2026-01-08 16:16:33 -06:00
codemann8
0dba4601fc Fix issue with zoomed-in map check displaying icons from off-screen 2026-01-05 23:57:19 -06:00
codemann8
e30e5107c6 Implement more accurate map check coordinates 2026-01-05 22:38:53 -06:00
52 changed files with 1252 additions and 1260 deletions

View File

@@ -74,6 +74,8 @@ function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<
!FLAG_OW_MIXED = $04 !FLAG_OW_MIXED = $04
!FLAG_OW_CROSSED = $02 !FLAG_OW_CROSSED = $02
!FLAG_OW_BONKDROP = $02 !FLAG_OW_BONKDROP = $02
!FLAG_OW_CUSTOM_MAP = $02
!FLAG_OW_ADJUST_DYNAMIC_MAP_SPRITE_POSITION = $04
incsrc hooks.asm incsrc hooks.asm
incsrc spriteswap.asm incsrc spriteswap.asm
@@ -203,19 +205,22 @@ incsrc menu/hudalpha.asm
warnpc $A38000 warnpc $A38000
org $B98000 org $B98000
incsrc crystalswitchbook.asm incsrc gk/crystalswitchbook.asm
incsrc mimicdash.asm incsrc gk/mimicdash.asm
incsrc gloom.asm incsrc gk/gloom.asm
incsrc special_weapons.asm incsrc gk/special_weapons.asm
incsrc variable_ganon_vulnerability.asm incsrc gk/variable_ganon_vulnerability.asm
incsrc pseudoflute.asm incsrc gk/pseudoflute.asm
incsrc dungeon_map/main.asm incsrc gk/fast_junk.asm
incsrc gk/dungeon_maps.asm
print "End of B9: ", pc print "End of B9: ", pc
warnpc $B9E000 ; $E000 - EFFF reserved for custom door rando map data warnpc $B9EE00
org $B9EE00
incsrc gk_meta.asm
org $B9F000 org $B9F000
incsrc dungeon_map/settings.asm incsrc gk/settings.asm
org $A38000 org $A38000
incsrc stats/credits.asm ; Statically mapped incsrc stats/credits.asm ; Statically mapped
@@ -329,6 +334,8 @@ DungeonMapDoorConnectors:
incbin "menu/door_connectors.3bppc" incbin "menu/door_connectors.3bppc"
MapSheetD4: MapSheetD4:
incbin "menu/map_sheet_d4.3bppc" incbin "menu/map_sheet_d4.3bppc"
DRSheet14:
incbin "menu/dr_sheet_14.3bppc"
org $8CD7DF org $8CD7DF
incsrc data/playernamecharmap.asm incsrc data/playernamecharmap.asm

View File

@@ -28,16 +28,19 @@ AddBonkTremors:
JSL AddDashTremor : JSL Player_ApplyRumbleToSprites ; things we wrote over JSL AddDashTremor : JSL Player_ApplyRumbleToSprites ; things we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
BonkBreakableWall: ValidDashCheck:
PHX : PHP PHP
SEP #$30 ; set 8-bit accumulator and index registers SEP #$20
LDA.l BootsModifier : CMP.b #$01 : BEQ + LDA.l BootsModifier : CMP.b #$01 : BEQ +
LDA.l BootsEquipment : BNE + ; Check for Boots LDA.l BootsEquipment : BEQ .exit
PLP : PLX : LDA.w #$0000 : RTL + LDA.w LinkDashing
+ .exit
PLP : PLX BEQ +
LDA.w LinkDashing : AND.w #$00FF ; things we wrote over PLP : REP #$02
RTL RTL
+
PLP : SEP #$02
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
BonkRockPile: BonkRockPile:
LDA.l BootsModifier : CMP.b #$01 : BEQ + LDA.l BootsModifier : CMP.b #$01 : BEQ +
@@ -48,10 +51,7 @@ BonkRockPile:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GravestoneHook: GravestoneHook:
LDA.l BootsModifier : CMP.b #$01 : BEQ + JSL ValidDashCheck : BEQ .done ; things we wrote over
LDA.l BootsEquipment : BEQ .done ; Check for Boots
+
LDA.w LinkDashing : BEQ .done ; things we wrote over
JML moveGravestone JML moveGravestone
.done .done
JML GravestoneHook_continue JML GravestoneHook_continue

View File

@@ -17,15 +17,14 @@ DoDungeonMapBossIcon:
ASL ASL
TAX TAX
; get sprite pointer table
LDA.l $89C298 : STA.b Scrap00
LDA.w #$0089 : STA.b Scrap02
TXY
; get sprite pointer for room ; get sprite pointer for room
LDA.l UWSpritesPointers,X LDA.b [Scrap00], Y
STA.b Scrap00 ; pointer in $00 STA.b Scrap00 ; pointer in $00
if !FEATURE_FIX_BASEROM LDA.w #bank(UWSpritesData) : STA.b Scrap02
LDA.w #$0089
else
LDA.w #$0028 ; set the bank to 28 for now
endif
STA.b Scrap02
LDY.w #$0001 ; to skip the "sort" LDY.w #$0001 ; to skip the "sort"
; get first byte to make sure it isn't an empty room ; get first byte to make sure it isn't an empty room

View File

@@ -238,6 +238,18 @@ FixJingleGlitch:
.exit .exit
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FixSwimBump:
LDA.b LinkIncapacitatedTimer : BEQ .normal
LDA.b LinkJumping : BNE .normal
INC.b LinkJumping
BRA .not_diving
.normal
LDA.b LinkJumping : BNE .continue ; what we wrote over
.not_diving
PLA : PLA : PEA.w $87964E ; skip ahead, not diving
.continue
RTL
;--------------------------------------------------------------------------------
; Fix spawning with more hearts than capacity when less than 3 heart containers ; Fix spawning with more hearts than capacity when less than 3 heart containers
pushpc pushpc
org $09F4AC ; <- module_death.asm:331 org $09F4AC ; <- module_death.asm:331
@@ -278,76 +290,3 @@ ParadoxCaveGfxFix:
LDX.w #$00C0 : STX.w DAS0L LDX.w #$00C0 : STX.w DAS0L
BRA .uploadLine BRA .uploadLine
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetItemRiseTimer:
LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest
LDA.b #$38 : STA.w AncillaTimer, X
RTL
.not_from_chest
JSL.l ItemIsJunk
BEQ .default
.junk
LDA.l JunkItemTimer : AND.b #$3F : STA.w AncillaTimer, X
RTL
.default
TYA : STA.w AncillaTimer, X ; What we wrote over
RTL
;--------------------------------------------------------------------------------
ItemIsJunk:
PHX
LDA.l JunkItemTimer : BIT.b #$3F : BEQ .not_junk
BIT.b #$80 : BNE .check
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .check
LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .check
BRA .not_junk
.check
LDA.l JunkItemTimer : AND.b #$40
BEQ +
LDA.b #JunkItems_triforce_end-JunkItems_end
+
CLC : ADC.b #JunkItems_end-JunkItems-1
LDA.w AncillaGet, X
TAX
-
CMP.l JunkItems, X : BEQ .junk
DEX : BPL -
.not_junk
PLX
LDA.b #$00
RTL
.junk
PLX
LDA.b #$01
RTL
RTL
JunkItems:
db $27 ; Bomb
db $28 ; 3 bombs
db $31 ; 10 bombs
db $34 ; 1 rupee
db $35 ; 5 rupees
db $36 ; 20 rupees
db $40 ; 100 rupees
db $41 ; 50 rupees
db $42 ; Heart
db $43 ; Arrow
db $44 ; 10 arrows
db $45 ; Small magic
db $46 ; 300 rupees
db $47 ; 20 rupees green
db $59 ; Rupoor
db $D1 ; Apples
db $D2 ; Fairy
db $D3 ; Chicken
db $D4 ; Big Magic
db $D5 ; 5 Arrows
db $D6 ; Good Bee
.end
db $6B ; Power Star
db $6C ; Triforce Piece
.triforce_end
;--------------------------------------------------------------------------------

View File

@@ -125,101 +125,100 @@ dw $0000, $0000, $0000, $0000, $000a, $000a, $000a, $0014, $000a, $0014, $0000,
DrHudDungeonItemsAdditions: DrHudDungeonItemsAdditions:
{ {
jsl DrawHUDDungeonItems jsl DrawHUDDungeonItems
lda.l DRMode : cmp.b #$02 : beq + : rtl : + lda.l DRMode : cmp.b #$02 : beq + : rtl : +
phx : phy : php phx : phy : php
rep #$30 rep #$30
lda.w #$24f5 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624 lda.w #$24f5 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624
sta.w $1644 : sta.w $164a : sta.w $1652 : sta.w $1662 : sta.w $1684 : sta.w $16c4 sta.w $1644 : sta.w $164a : sta.w $1652 : sta.w $1662 : sta.w $1684 : sta.w $16c4
ldx.w #$0000 ldx.w #$0000
- sta.w $1704, x : sta.w $170e, x : sta.w $1718, x - sta.w $1704, x : sta.w $170e, x : sta.w $1718, x
inx #2 : cpx.w #$0008 : !BLT - inx #2 : cpx.w #$0008 : !BLT -
lda.l HudFlag : and.w #$0020 : beq + : JMP ++ : + lda.l HudFlag : and.w #$0020 : beq + : JMP ++ : +
lda.l HUDDungeonItems : and.w #$0007 : bne + : JMP ++ : + lda.l HUDDungeonItems : and.w #$001F : bne + : JMP ++ : +
; bk symbols ; bk symbols
lda.w #$2811 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624 lda.w #$2811 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624
; sm symbols ; sm symbols
lda.w #$2810 : sta.w $160a : sta.w $1614 : sta.w $161e : sta.w $16e4 lda.w #$2810 : sta.w $160a : sta.w $1614 : sta.w $161e : sta.w $16e4
; blank out stuff ; blank out stuff
lda.w #$24f5 : sta.w $1724 lda.w #$24f5 : sta.w $1724
ldx.w #$0002 ldx.w #$0002
- lda.w #$0000 : !ADD.l RowOffsets,x : !ADD.l ColumnOffsets, x : tay - lda.w #$0000 : !ADD.l RowOffsets,x : !ADD.l ColumnOffsets, x : tay
lda.l DungeonReminderTable, x : sta.w $1644, y : iny #2 JSR BossStatus : STA.w $1644, Y
lda.w #$24f5 : sta.w $1644, y INY #2
lda.l MapField : and.l DungeonMask, x : beq + ; must have map lda.w #$24f5 : sta.w $1644, y
jsr BkStatus : sta.w $1644, y : bra .smallKey ; big key status lda.l MapField : and.l DungeonMask, x : beq + ; must have map
+ lda.l BigKeyField : and.l DungeonMask, x : beq .smallKey jsr BkStatus : sta.w $1644, y : bra .smallKey ; big key status
lda.w #$2826 : sta.w $1644, y + lda.l BigKeyField : and.l DungeonMask, x : beq .smallKey
.smallKey lda.w #$2826 : sta.w $1644, y
+ iny #2 .smallKey
+ iny #2
cpx.w #$001a : bne + cpx.w #$001a : bne +
tya : !ADD.w #$003c : tay tya : !ADD.w #$003c : tay
+ stx.b Scrap00 + stx.b Scrap00
txa : lsr : tax txa : lsr : tax
lda.w #$24f5 : sta.w $1644, y lda.w #$24f5 : sta.w $1644, y
lda.l GenericKeys : and.w #$00FF : bne + lda.l GenericKeys : and.w #$00FF : bne +
lda.l DungeonKeys, x : and.w #$00FF : beq + lda.l DungeonKeys, x : and.w #$00FF : beq +
jsr ConvertToDisplay2 : sta.w $1644, y jsr ConvertToDisplay2 : sta.w $1644, y
+ iny #2 : lda.w #$24f5 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y
phx : ldx.b Scrap00 phx : ldx.b Scrap00
LDA.l CompassMode : BIT.w #$0002 : BNE .skip_map_check LDA.l MapField : ORA.l MapCountDisplay : AND.l DungeonMask, x : BEQ .key_info_done ; must have map
LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map
.skip_map_check
plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02
lda.l GenericKeys : bne +++ lda.l GenericKeys : bne +++
lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02
+++ lda.b Scrap02 +++ lda.b Scrap02
rep #$30 rep #$30
jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals
bra .skipStack bra .skipStack
.key_info_done .key_info_done
plx plx
.skipStack iny #2 .skipStack iny #2
cpx.w #$000d : beq + cpx.w #$000d : beq +
lda.w #$24f5 : sta.w $1644, y lda.w #$24f5 : sta.w $1644, y
+ +
ldx.b Scrap00 ldx.b Scrap00
+ inx #2 : cpx.w #$001b : bcs ++ : JMP - + inx #2 : cpx.w #$001b : bcs ++ : JMP -
++ ++
lda.l HudFlag : and.w #$0020 : bne + : JMP ++ : + lda.l HudFlag : and.w #$0020 : bne + : JMP ++ : +
; map symbols ; map symbols
lda.w #$2821 : sta.w $1606 : sta.w $1610 : sta.w $161a lda.w #$2821 : sta.w $1606 : sta.w $1610 : sta.w $161a
; compass symbols ; compass symbols
lda.w #$2c20 : sta.w $160a : sta.w $1614 : sta.w $161e : sta.w $16e4 lda.w #$2c20 : sta.w $160a : sta.w $1614 : sta.w $161e : sta.w $16e4
; blank out a couple thing from old hud ; blank out a couple thing from old hud
lda.w #$24f5 : sta.w $1624 : sta.w $1724 lda.w #$24f5 : sta.w $1624 : sta.w $1724
ldx.w #$0002 ldx.w #$0002
- lda.w #$0000 ; start of hud area - lda.w #$0000 ; start of hud area
!ADD.l RowOffsets, x : !ADD.l ColumnOffsets, x : tay !ADD.l RowOffsets, x : !ADD.l ColumnOffsets, x : tay
lda.l DungeonReminderTable, x : sta.w $1644, y JSR BossStatus : STA.w $1644, Y
iny #2 INY #2
lda.w #$24f5 : sta.w $1644, y ; blank out map spot lda.w #$24f5 : sta.w $1644, y ; blank out map spot
lda.l MapField : ora.l MapCountDisplay : ora.l MapOverlay lda.l MapField : ora.l MapCountDisplay : ora.l MapOverlay
and.l DungeonMask, x : beq + ; must have map and.l DungeonMask, x : beq + ; must have map
JSR MapIndicatorShort : STA.w $1644, Y JSR MapIndicatorShort : STA.w $1644, Y
+ iny #2 + iny #2
cpx.w #$001a : bne + cpx.w #$001a : bne +
tya : !ADD.w #$003c : tay tya : !ADD.w #$003c : tay
+ lda.l CompassField : ora.l CompassCountDisplay + lda.l CompassField : ora.l CompassCountDisplay
and.l DungeonMask, x : beq + ; must have compass and.l DungeonMask, x : beq + ; must have compass
phx ; total chest counts phx ; total chest counts
LDA.l CompassTotalsWRAM, x : !SUB.l DungeonLocationsChecked, x LDA.l CompassTotalsWRAM, x : !SUB.l DungeonLocationsChecked, x
SEP #$30 : JSR HudHexToDec2DigitCopy : REP #$30 SEP #$30 : JSR HudHexToDec2DigitCopy : REP #$30
lda.b Scrap06 : jsr ConvertToDisplay2 : sta.w $1644, y : iny #2 lda.b Scrap06 : jsr ConvertToDisplay2 : sta.w $1644, y : iny #2
lda.b Scrap07 : jsr ConvertToDisplay2 : sta.w $1644, y lda.b Scrap07 : jsr ConvertToDisplay2 : sta.w $1644, y
plx plx
bra .skipBlanks bra .skipBlanks
+ lda.w #$24f5 : sta.w $1644, y : iny #2 : sta.w $1644, y + lda.w #$24f5 : sta.w $1644, y : iny #2 : sta.w $1644, y
.skipBlanks iny #2 .skipBlanks iny #2
cpx.w #$001a : beq + cpx.w #$001a : beq +
lda.w #$24f5 : sta.w $1644, y ; blank out spot lda.w #$24f5 : sta.w $1644, y ; blank out spot
+ inx #2 : cpx.w #$001b : !BGE ++ : JMP - + inx #2 : cpx.w #$001b : !BGE ++ : JMP -
++ ++
plp : ply : plx : rtl plp : ply : plx : rtl
} }
MapIndicatorLong: MapIndicatorLong:
@@ -259,6 +258,40 @@ BkStatus:
+ lda.w #$24f5 : rts ; black otherwise + lda.w #$24f5 : rts ; black otherwise
+++ lda.w #$2826 : rts ; check mark +++ lda.w #$2826 : rts ; check mark
BossStatus:
LDA.l HUDDungeonItems : BIT.w #$0010 : BEQ .normal
PHX
LDA.l DungeonMapBossRooms, X
CMP.w #$000F
BEQ .no_boss
ASL A
TAX
LDA.l SaveDataWRAM, X
PLX
BIT.w #$0800
BEQ .boss_alive
.boss_dead
LDA.l HudFlag : BIT.w #$0020 : BNE .skull
; palette 3 - white
LDA.l DungeonReminderTable, X : AND.w #$E3FF : ORA.w #$0C00 : RTS
.skull
LDA.w #$280F : RTS
.no_boss
PLX
; palette 0 - light gray
LDA.l DungeonReminderTable, X : AND.w #$E3FF : RTS
.boss_alive
; palette 4 - gray
LDA.l DungeonReminderTable, X : AND.w #$E3FF : ORA.w #$1000 : RTS
.normal
; default palette 3 - white
LDA.l DungeonReminderTable, X : RTS
ConvertToDisplay: ConvertToDisplay:
and.w #$00ff : cmp.w #$000a : !BLT + and.w #$00ff : cmp.w #$000a : !BLT +
!ADD.w #$2519 : rts !ADD.w #$2519 : rts

View File

@@ -1,39 +0,0 @@
File.open("supertile_shapes.asm", "r") do |file|
bytes = []
while line = file.gets
m = line.match(/dw \$(\h+), \$(\h+), \$(\h+), \$(\h+)/)
bytes += m.captures if m
break if bytes.length >= 4 * 0xE0
end
counts = []
for byte in bytes do
value = byte.to_i(16)
next if value == 0xFFFF
value = (value & 0x03FF) - 0x340
if not counts[value]
counts[value] = 0
end
counts[value] += 1
end
print(" ")
for col in 0...16
printf(" x%X", col)
end
puts
for row in 0...0xC
printf("%Xx", row + 4)
for col in 0...16
printf("%4d", counts[row * 16 + col] || 0)
end
puts
end
printf("Unused:")
for i in 0...0x80
printf(" %2X", i) unless counts[i]
end
puts
end

View File

@@ -1,474 +0,0 @@
MapDrawingData:
.floor_data_offset
dw $0000, $0000
dw $0019, $000C
dw $0032, $0018
dw $004B, $0024
dw $0064, $0030
dw $007D, $003C
dw $0096, $0048
dw $00AF, $0054
dw $00C8, $0060
.row_data_offset
dw $0000, $0000
dw $0005, $0004
dw $000A, $0008
dw $000F, $000C
dw $0014, $0010
.corner_tile_address
dw $00E2, $0160
dw $00F8, $0178
dw $03A2, $03A0
dw $03B8, $03B8
.row_tile_address
dw $00E4, $0162
dw $03A4, $03A2
.row_tile_length
dw $0014, $0016
.column_tile_address
dw $0122, $01A0
dw $0138, $01B8
.column_tile_length
dw $0280, $0200
.floor_label_address
dw $035E, $035C
.row_start_address
dw $0124, $01A2
dw $01A4, $0262
dw $0224, $0322
dw $02A4, $03D2
dw $0324, $04A2
.column_count
dw $0005, $0004
.column_spacing
dw $0004, $0006
.row_count
dw $0005, $0003
.bg1_grid_start
dw $1091, $10D1
.sprite_offset_x_base
dw $0090, $0088
.sprite_offset_y_base
dw $001F, $002F
dw $007F, $008F
.entrance_sprite_offset_y_base
dw $0087, $0097
.supertile_pixel_spacing
dw $0010, $0018
.floor_pixel_column_wrap
dw $0040, $0048
.floor_pixel_row_wrap
dw $0040, $0030
CustomMapDrawingData:
.column_wrap
dw $0003
.column_count
dw $0004
.row_wrap
dw $0002
.floor_connection_data_offset
dw $0000
dw $0011
dw $0022
dw $0033
dw $0044
dw $0055
dw $0066
dw $0077
dw $0088
.row_connection_data_offset
dw $0000
dw $0007
dw $000E
dw $0015
macro LDA_MapMode()
LDA.l DungeonMapMode
ASL A
endmacro
macro LDX_MapMode()
%LDA_MapMode()
TAX
endmacro
macro LDY_MapMode()
%LDA_MapMode()
TAY
endmacro
macro ADD_MapMode()
CLC : ADC.l DungeonMapMode
ASL A
TAX
endmacro
macro Map_LDA(addr, label)
pushpc
org <addr>
JSR LDA_<label>
pullpc
if not(defined("LDA_<label>"))
!LDA_<label> = 1
LDA_<label>:
PHX
%LDX_MapMode()
LDA.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_LDAY(addr, label)
pushpc
org <addr>
JSR LDA_Y_<label>
pullpc
if not(defined("LDA_Y_<label>"))
!LDA_Y_<label> = 1
LDA_Y_<label>:
PHX
TYA
%ADD_MapMode()
LDA.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_LDAX(addr, label)
pushpc
org <addr>
JSR LDA_X_<label>
pullpc
if not(defined("LDA_X_<label>"))
!LDA_X_<label> = 1
LDA_X_<label>:
PHX
TXA
%ADD_MapMode()
LDA.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_CMP(addr, label)
pushpc
org <addr>
JSR CMP_<label>
pullpc
if not(defined("CMP_<label>"))
!CMP_<label> = 1
CMP_<label>:
PHX
PHA
%LDX_MapMode()
PLA
CMP.l MapDrawingData_<label>, X
BEQ .z_flag_set
.z_flag_clear
PLX
REP #$02
RTS
.z_flag_set
PLX
SEP #$02
RTS
endif
endmacro
macro Map_ADD(addr, label)
pushpc
org <addr>
JSR ADD_<label>
pullpc
if not(defined("ADD_<label>"))
!ADD_<label> = 1
ADD_<label>:
PHX
PHA
%LDX_MapMode()
PLA
CLC : ADC.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_ADDY(addr, label)
pushpc
org <addr>
JSR ADD_Y_<label>
pullpc
if not(defined("ADD_Y_<label>"))
!ADD_Y_<label> = 1
ADD_Y_<label>:
PHX
PHA
TYA
%ADD_MapMode()
PLA
CLC : ADC.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
pushpc
org $8AE5DA
ADC.b $02 ; swap position of load and add for ease
org $8AE652 ; steal some space from the old map-drawing code we're no longer using
LoadDungeonMapRoomPointer_0A:
JSL LoadDungeonMapRoomPointer
RTS
%Map_LDAY($8AE45F, corner_tile_address)
%Map_LDAY($8AE489, row_tile_address)
%Map_CMP($8AE4B0, row_tile_length)
%Map_LDAY($8AE4C1, column_tile_address)
%Map_CMP($8AE4EA, column_tile_length)
%Map_LDA($8AE54A, floor_label_address)
%Map_LDAX($8AE5D7, row_data_offset)
%Map_LDAY($8AE5F7, floor_data_offset)
%Map_CMP($8AE5A2, row_count)
%Map_CMP($8AE7FA, column_count)
%Map_ADD($8AE896, sprite_offset_x_base)
%Map_ADDY($8AE8B5, sprite_offset_y_base)
%Map_ADD($8AE952, sprite_offset_y_base)
%Map_ADDY($8AEBDB, sprite_offset_y_base)
warnpc $8AE7F6
padbyte $EA
pad $8AE7F6
pullpc
incsrc data/doors_connections.asm
LoadDungeonMapRoomPointer:
LDA.l DungeonMapMode
BEQ .normal
LDA.w #bank(CustomMapPointers)
STA.b $74
LDA.l CustomMapPointers, X
RTL
.normal
LDA.w #bank(DungeonMapRoomPointers)
STA.b $74
LDA.l DungeonMapRoomPointers, X
RTL
PrepDrawRow:
%ADD_MapMode()
LDA.l MapDrawingData_row_start_address, X
CLC : ADC.b $06
AND.w #$0FFF
TAX
LDA.l DungeonMapMode
BEQ .done
JSR DrawRowOfRoomConnections
.done
RTL
ClearAdjacentConnections:
; Left
LDA.b $02
BEQ +
LDA.b $0E
BIT.w #$000A
BNE +
LDA.w #$0F00
STA.l $7F0000-$02, X
STA.l $7F0040-$02, X
+
; Top
LDA.b $00
BEQ +
LDA.b $0E
BIT.w #$000C
BNE +
LDA.w #$0F00
STA.l $7F0000-$40, X
STA.l $7F0002-$40, X
+
; Right
LDA.b $02
CMP.l CustomMapDrawingData_column_wrap
BCS +
LDA.b $0E
BIT.w #$0005
BNE +
LDA.w #$0F00
STA.l $7F0000+$04, X
STA.l $7F0040+$04, X
+
; Bottom
LDA.b $00
CMP.l CustomMapDrawingData_row_wrap
BCS +
LDA.b $0E
BIT.w #$0003
BNE +
LDA.w #$0F00
STA.l $7F0000+$80, X
STA.l $7F0002+$80, X
+
RTL
DrawRowOfRoomConnections:
PHB : PHK : PLB
PHX
LDX.w DungeonID
LDA.l DoorConnectionPointers, X
STA.b $04
LDA.l DungeonMapFloorCountData, X
AND.w #$000F
CLC : ADC.w DungeonMapCurrentFloor
AND.w #$00FF
ASL A
TAX
LDA.l CustomMapDrawingData_floor_connection_data_offset, X
CLC : ADC.b $04
STA.b $04
LDA.b $00
ASL A
TAX
LDA.l CustomMapDrawingData_row_connection_data_offset, X
CLC : ADC.b $04
STA.b $04
STZ.b $02
PLX : PHX
LDY.w #$0000
.next_horizontal
LDA.b ($04), Y
AND.w #$00FF
JSR DrawHorizontalConnector
INY
INX #6
INC.b $02
LDA.b $02
CMP.l CustomMapDrawingData_column_wrap
BCC .next_horizontal
LDA.b $00
CMP.l CustomMapDrawingData_row_wrap
BCS .done
PLX : PHX
STZ.b $02
.next_vertical
LDA.b ($04), Y
AND.w #$00FF
JSR DrawVerticalConnector
INY
INX #6
INC.b $02
LDA.b $02
CMP.l CustomMapDrawingData_column_count
BCC .next_vertical
.done
PLX
PLB
RTS
; A = connector index
; X = address
DrawHorizontalConnector:
PHY
ASL A : ASL A
TAY
LDA.w DoorConnectionTiles+0, Y
BEQ +
ORA.w #$1404
STA.l $7F0004, X
+
LDA.w DoorConnectionTiles+2, Y
BEQ +
ORA.w #$1404
STA.l $7F0044, X
+
PLY
RTS
; A = connector index
; X = address
DrawVerticalConnector:
PHY
ASL A : ASL A
TAY
LDA.w DoorConnectionTiles+0, Y
BEQ +
ORA.w #$1400
STA.l $7F0080, X
+
LDA.w DoorConnectionTiles+2, Y
BEQ +
ORA.w #$1400
STA.l $7F0082, X
+
PLY
RTS
GetLocationMarkerLeft:
LDA.b LinkQuadrantH
BEQ +
LDA.b #$F8
+
CLC : ADC.w $0215
AND.b #$F8
RTL

View File

@@ -23,7 +23,7 @@ JSL SpritePrep_OldManFollower : NOP #2 : db $F0 ; BEQ
org $9DFF18 org $9DFF18
JSL SpriteDraw_OldManFollower JSL SpriteDraw_OldManFollower
org $9EE9BC org $9EE9BC
JSL Follower_CheckMessageCollision JSL OldMan_WaitForCollision
org $9EE9CC org $9EE9CC
JSL OldMan_BecomeFollower : NOP #2 JSL OldMan_BecomeFollower : NOP #2
@@ -631,6 +631,15 @@ SpriteDraw_OldManFollower:
dw 0, 0 : db $AC, $00, $00, $02 dw 0, 0 : db $AC, $00, $00, $02
dw 0, 8 : db $AE, $00, $00, $02 dw 0, 8 : db $AE, $00, $00, $02
OldMan_WaitForCollision:
PHA
LDA.w LinkIFrames : BEQ +
PLA : CLC
RTL
+
PLA
JML Follower_CheckMessageCollision
OldMan_BecomeFollower: OldMan_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BCC .set_follower_and_despawn LDA.l FollowerTravelAllowed : CMP.b #$02 : BCC .set_follower_and_despawn
PLA : PLA PLA : PLA

View File

@@ -22,8 +22,6 @@ StartDoubleWrite:
; what we wrote over ; what we wrote over
LDA.l DRMode LDA.l DRMode
BEQ .draw BEQ .draw
LDA.l DungeonMapMode
BNE .draw
INC.w $020D ; next subsubmode INC.w $020D ; next subsubmode
PLA : PLA : PLA ; pull our jump to here off the stack PLA : PLA : PLA ; pull our jump to here off the stack

View File

@@ -247,6 +247,7 @@ CheckPots:
LDA.b [$04], Y LDA.b [$04], Y
CMP.w #$FFFF : BEQ .done CMP.w #$FFFF : BEQ .done
INX : INY : INY INX : INY : INY
BIT.w #$4000 : BNE .multi_item ; marked as multi item
BIT.w #$8000 : BNE .major_item ; marked as major item BIT.w #$8000 : BNE .major_item ; marked as major item
LDA.b [$04], Y LDA.b [$04], Y
AND.w #$00FF AND.w #$00FF
@@ -266,8 +267,19 @@ CheckPots:
INY INY
BRA .mask_set BRA .mask_set
.multi_item
LDA.b [$04], Y
PHX
AND.w #$00FF
ASL A
TAX
LDA.l PotMultiWorldTable, X
PLX
BRA .item_id_set
.major_item .major_item
LDA.b [$04], Y LDA.b [$04], Y
.item_id_set
PHA PHA
PHX PHX
INY INY
@@ -356,7 +368,13 @@ CheckEnemies:
ASL A ASL A
TAX TAX
LDA.l UWSpritesPointers, X
; get sprite pointer table
LDA.l $89C298 : STA.b $04
LDA.w #$0089 : STA.b $06
TXY
; get sprite pointer for room
LDA.b [$04], Y
INC A ; skip the layered/unlayered indicator INC A ; skip the layered/unlayered indicator
STA.b $04 STA.b $04
LDA.w #bank(UWSpritesData) LDA.w #bank(UWSpritesData)

261
gk/data/junk_items.asm Normal file
View File

@@ -0,0 +1,261 @@
db $00 ; 00 - Fighter Sword and Shield
db $00 ; 01 - Master Sword
db $00 ; 02 - Tempered Sword
db $00 ; 03 - Butter Sword
db $00 ; 04 - Fighter Shield
db $00 ; 05 - Fire Shield
db $00 ; 06 - Mirror Shield
db $00 ; 07 - Fire Rod
db $00 ; 08 - Ice Rod
db $00 ; 09 - Hammer
db $00 ; 0A - Hookshot
db $00 ; 0B - Bow
db $00 ; 0C - Boomerang
db $00 ; 0D - Powder
db $00 ; 0E - Bottle Refill (bee)
db $00 ; 0F - Bombos
db $00 ; 10 - Ether
db $00 ; 11 - Quake
db $00 ; 12 - Lamp
db $00 ; 13 - Shovel
db $00 ; 14 - Flute
db $00 ; 15 - Somaria
db $00 ; 16 - Bottle
db $00 ; 17 - Heartpiece
db $00 ; 18 - Byrna
db $00 ; 19 - Cape
db $00 ; 1A - Mirror
db $00 ; 1B - Glove
db $00 ; 1C - Mitts
db $00 ; 1D - Book
db $00 ; 1E - Flippers
db $00 ; 1F - Pearl
db $00 ; 20 - Crystal
db $00 ; 21 - Net
db $00 ; 22 - Blue Mail
db $00 ; 23 - Red Mail
db $00 ; 24 - Small Key
db $00 ; 25 - Compass
db $00 ; 26 - Heart Container from 4/4
db $01 ; 27 - Bomb
db $01 ; 28 - 3 bombs
db $00 ; 29 - Mushroom
db $00 ; 2A - Red boomerang
db $00 ; 2B - Full bottle (red)
db $00 ; 2C - Full bottle (green)
db $00 ; 2D - Full bottle (blue)
db $00 ; 2E - Potion refill (red)
db $00 ; 2F - Potion refill (green)
db $00 ; 30 - Potion refill (blue)
db $01 ; 31 - 10 bombs
db $00 ; 32 - Big key
db $00 ; 33 - Map
db $01 ; 34 - 1 rupee
db $01 ; 35 - 5 rupees
db $01 ; 36 - 20 rupees
db $00 ; 37 - Green pendant
db $00 ; 38 - Blue pendant
db $00 ; 39 - Red pendant
db $00 ; 3A - Tossed bow
db $00 ; 3B - Silvers
db $00 ; 3C - Full bottle (bee)
db $00 ; 3D - Full bottle (fairy)
db $00 ; 3E - Boss heart
db $00 ; 3F - Sanc heart
db $01 ; 40 - 100 rupees
db $01 ; 41 - 50 rupees
db $01 ; 42 - Heart
db $01 ; 43 - Arrow
db $01 ; 44 - 10 arrows
db $01 ; 45 - Small magic
db $01 ; 46 - 300 rupees
db $01 ; 47 - 20 rupees green
db $00 ; 48 - Full bottle (good bee)
db $00 ; 49 - Tossed fighter sword
db $00 ; 4A - Active Flute
db $00 ; 4B - Boots
db $00 ; 4C - Bomb capacity (50)
db $00 ; 4D - Arrow capacity (70)
db $00 ; 4E - 1/2 magic
db $00 ; 4F - 1/4 magic
db $00 ; 50 - Safe master sword
db $00 ; 51 - Bomb capacity (+5)
db $00 ; 52 - Bomb capacity (+10)
db $00 ; 53 - Arrow capacity (+5)
db $00 ; 54 - Arrow capacity (+10)
db $00 ; 55 - Programmable item 1
db $00 ; 56 - Programmable item 2
db $00 ; 57 - Programmable item 3
db $00 ; 58 - Upgrade-only silver arrows
db $01 ; 59 - Rupoor
db $01 ; 5A - Nothing
db $00 ; 5B - Red clock
db $00 ; 5C - Blue clock
db $00 ; 5D - Green clock
db $00 ; 5E - Progressive sword
db $00 ; 5F - Progressive shield
db $00 ; 60 - Progressive armor
db $00 ; 61 - Progressive glove
db $00 ; 62 - RNG pool item (single)
db $00 ; 63 - RNG pool item (multi)
db $00 ; 64 - Progressive bow
db $00 ; 65 - Progressive bow
db $00 ; 66 -
db $00 ; 67 -
db $00 ; 68 -
db $00 ; 69 -
db $00 ; 6A - Triforce
db $01 ; 6B - Power star
db $01 ; 6C - Triforce Piece
db $00 ; 6D - Server request item
db $00 ; 6E - Server request item (dungeon drop)
db $00 ; 6F -
db $00 ; 70 - Map of Light World
db $00 ; 71 - Map of Dark World
db $00 ; 72 - Map of Ganon's Tower
db $00 ; 73 - Map of Turtle Rock
db $00 ; 74 - Map of Thieves' Town
db $00 ; 75 - Map of Tower of Hera
db $00 ; 76 - Map of Ice Palace
db $00 ; 77 - Map of Skull Woods
db $00 ; 78 - Map of Misery Mire
db $00 ; 79 - Map of Dark Palace
db $00 ; 7A - Map of Swamp Palace
db $00 ; 7B - Map of Agahnim's Tower
db $00 ; 7C - Map of Desert Palace
db $00 ; 7D - Map of Eastern Palace
db $00 ; 7E - Map of Hyrule Castle
db $00 ; 7F - Map of Sewers
db $00 ; 80 - Compass of Light World
db $00 ; 81 - Compass of Dark World
db $00 ; 82 - Compass of Ganon's Tower
db $00 ; 83 - Compass of Turtle Rock
db $00 ; 84 - Compass of Thieves' Town
db $00 ; 85 - Compass of Tower of Hera
db $00 ; 86 - Compass of Ice Palace
db $00 ; 87 - Compass of Skull Woods
db $00 ; 88 - Compass of Misery Mire
db $00 ; 89 - Compass of Dark Palace
db $00 ; 8A - Compass of Swamp Palace
db $00 ; 8B - Compass of Agahnim's Tower
db $00 ; 8C - Compass of Desert Palace
db $00 ; 8D - Compass of Eastern Palace
db $00 ; 8E - Compass of Hyrule Castle
db $00 ; 8F - Compass of Sewers
db $00 ; 90 - Skull key
db $00 ; 91 - Reserved
db $00 ; 92 - Big key of Ganon's Tower
db $00 ; 93 - Big key of Turtle Rock
db $00 ; 94 - Big key of Thieves' Town
db $00 ; 95 - Big key of Tower of Hera
db $00 ; 96 - Big key of Ice Palace
db $00 ; 97 - Big key of Skull Woods
db $00 ; 98 - Big key of Misery Mire
db $00 ; 99 - Big key of Dark Palace
db $00 ; 9A - Big key of Swamp Palace
db $00 ; 9B - Big key of Agahnim's Tower
db $00 ; 9C - Big key of Desert Palace
db $00 ; 9D - Big key of Eastern Palace
db $00 ; 9E - Big key of Hyrule Castle
db $00 ; 9F - Big key of Sewers
db $00 ; A0 - Small key of Sewers
db $00 ; A1 - Small key of Hyrule Castle
db $00 ; A2 - Small key of Eastern Palace
db $00 ; A3 - Small key of Desert Palace
db $00 ; A4 - Small key of Agahnim's Tower
db $00 ; A5 - Small key of Swamp Palace
db $00 ; A6 - Small key of Dark Palace
db $00 ; A7 - Small key of Misery Mire
db $00 ; A8 - Small key of Skull Woods
db $00 ; A9 - Small key of Ice Palace
db $00 ; AA - Small key of Tower of Hera
db $00 ; AB - Small key of Thieves' Town
db $00 ; AC - Small key of Turtle Rock
db $00 ; AD - Small key of Ganon's Tower
db $00 ; AE - Reserved
db $00 ; AF - Generic small key
db $00 ; B0 - Crystal 6
db $00 ; B1 - Crystal 1
db $00 ; B2 - Crystal 5
db $00 ; B3 - Crystal 7
db $00 ; B4 - Crystal 2
db $00 ; B5 - Crystal 4
db $00 ; B6 - Crystal 3
db $00 ; B7 - Reserved
db $00 ; B8 -
db $00 ; B9 -
db $00 ; BA -
db $00 ; BB -
db $00 ; BC -
db $00 ; BD -
db $00 ; BE -
db $00 ; BF -
db $00 ; C0 -
db $00 ; C1 -
db $00 ; C2 -
db $00 ; C3 -
db $00 ; C4 -
db $00 ; C5 -
db $00 ; C6 -
db $00 ; C7 -
db $00 ; C8 -
db $00 ; C9 -
db $00 ; CA -
db $00 ; CB -
db $00 ; CC -
db $00 ; CD -
db $00 ; CE -
db $00 ; CF -
db $01 ; D0 - Bee trap
db $01 ; D1 - Apples
db $01 ; D2 - Fairy
db $01 ; D3 - Chicken
db $01 ; D4 - Big Magic
db $01 ; D5 - 5 Arrows
db $01 ; D6 - Good Bee
db $00 ; D7 -
db $00 ; D8 -
db $00 ; D9 -
db $00 ; DA -
db $00 ; DB -
db $00 ; DC -
db $00 ; DD -
db $00 ; DE -
db $00 ; DF -
db $00 ; E0 -
db $00 ; E1 -
db $00 ; E2 -
db $00 ; E3 -
db $00 ; E4 -
db $00 ; E5 -
db $00 ; E6 -
db $00 ; E7 -
db $00 ; E8 -
db $00 ; E9 -
db $00 ; EA -
db $00 ; EB -
db $00 ; EC -
db $00 ; ED -
db $00 ; EE -
db $00 ; EF -
db $00 ; F0 -
db $00 ; F1 -
db $00 ; F2 -
db $00 ; F3 -
db $00 ; F4 -
db $00 ; F5 -
db $00 ; F6 -
db $00 ; F7 -
db $00 ; F8 -
db $00 ; F9 -
db $00 ; FA -
db $00 ; FB -
db $00 ; FC -
db $00 ; FD -
db $00 ; FE - Server request (async)
db $00 ; FF -

View File

@@ -26,7 +26,7 @@ db $01, $00, $05 ; ($0A) Single Staircase at Top of Bottom Left Quadrant
db $01, $00, $04 ; ($0D) Moldorm db $01, $00, $04 ; ($0D) Moldorm
db $02, $01, $00, $00, $02 ; ($10) Pod Basement db $02, $01, $00, $00, $02 ; ($10) Pod Basement
db $03, $01, $0A, $02, $01, $00, $0B ; ($15) GT Entrance db $03, $01, $0A, $02, $01, $00, $0B ; ($15) GT Entrance
db $02, $00, $03, $01, $04 ; ($1C) Hera Below Moldorm db $02, $01, $03, $00, $04 ; ($1C) Hera Below Moldorm
db $02, $00, $01, $01, $0B ; ($21) PoD Bridge db $02, $00, $01, $01, $0B ; ($21) PoD Bridge
db $01, $00, $08 ; ($26) GT Ice Armos db $01, $00, $08 ; ($26) GT Ice Armos
db $03, $00, $01, $01, $0B, $02, $09 ; ($29) Swamp Statue db $03, $00, $01, $01, $0B, $02, $09 ; ($29) Swamp Statue

View File

@@ -39,7 +39,7 @@ SplitRooms:
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.6a) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) %d(.no) : %d(.no) : %d(.6a) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.75) : %d(.no) : %d(.no) %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.74) : %d(.75) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.7b) : %d(.7c) : %d(.7d) : %d(.no) : %d(.no) %d(.no) : %d(.no) : %d(.no) : %d(.7b) : %d(.7c) : %d(.7d) : %d(.no) : %d(.no)
; 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F ; 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F

View File

@@ -112,7 +112,7 @@ dw $FFFF, $838E, $FFFF, $FFFF ; 6E
dw $FFFF, $FFFF, $FFFF, $FFFF ; 6F - unused dw $FFFF, $FFFF, $FFFF, $FFFF ; 6F - unused
dw $43BA, $FFFF, $FFFF, $FFFF ; 70 dw $43BA, $FFFF, $FFFF, $FFFF ; 70
dw $039A, $FFFF, $4365, $438D ; 71 dw $039A, $FFFF, $4365, $438D ; 71
dw $437A, $037A, $8386, $0342 ; 72 - slight cheating I guess... dw $437A, $037A, $03C1, $0342 ; 72 - slight cheating I guess...
dw $038F, $038F, $839B, $0366 ; 73 dw $038F, $038F, $839B, $0366 ; 73
dw $43B2, $03B2, $43A8, $03A8 ; 74 dw $43B2, $03B2, $43A8, $03A8 ; 74
dw $038F, $83B4, $0365, $03B5 ; 75 dw $038F, $83B4, $0365, $03B5 ; 75

View File

@@ -541,7 +541,9 @@ DrawStairs:
LDA.w SpiralProps, Y LDA.w SpiralProps, Y
AND.w #$00FF AND.w #$00FF
STA.b $06 STA.b $06
BEQ .done BNE +
JMP .done
+
STZ.b $02 STZ.b $02
INY INY
@@ -578,11 +580,14 @@ DrawStairs:
STA.b $CA STA.b $CA
JSR GetSpecificRoomVisibility JSR GetSpecificRoomVisibility
AND.w #$00FF
BNE + BNE +
LDA.b $0E LDA.b $0E
AND.w #$000F AND.w #$000F
BNE + BEQ .ply_skip
BRA .ply_skip LDA.b $0B
AND.w #$00FF
BEQ .ply_skip
+ +
TYX TYX
@@ -619,32 +624,70 @@ GetCurrentRoomVisibility:
GetSpecificRoomVisibility: GetSpecificRoomVisibility:
PHX PHX
LDA.l ShowRooms_default
; figure out if room is dark without lamp
LDA.b $CA
AND.w #$00FF AND.w #$00FF
ASL A
TAX
LDA.l RoomHeaderPointers, X
TAX
LDA.l bank(RoomHeaders)<<16, X
AND.w #$0001
BEQ .not_dark
SEP #$20
JSL LampCheck
REP #$20
BNE .not_dark
LDA.l LampCone
BIT.w #$0020 ; all rooms are lit
BNE .not_dark
LDA.l ShowRooms_dark_room_cap
AND.w #$00FF
CMP.w #$0006
BCS .not_dark
XBA
STA.b $0A
BRA .check_visibility
.not_dark
LDA.w #$0600
STA.b $0A STA.b $0A
.check_visibility
SEP #$20
LDA.l ShowRooms_default
STA.b $0A
REP #$20
LDX.w DungeonID LDX.w DungeonID
LDA.l MapField LDA.l MapField
AND.l DungeonMask, X AND.l DungeonMask, X
BEQ + BEQ +
SEP #$20
LDA.l ShowRooms_have_map LDA.l ShowRooms_have_map
AND.w #$00FF
CMP.b $0A CMP.b $0A
BCC + BCC +
STA.b $0A STA.b $0A
+ +
REP #$20
LDX.w DungeonID LDX.w DungeonID
LDA.l CompassField LDA.l CompassField
AND.l DungeonMask, X AND.l DungeonMask, X
BEQ + BEQ +
SEP #$20
LDA.l ShowRooms_have_compass LDA.l ShowRooms_have_compass
AND.w #$00FF
CMP.b $0A CMP.b $0A
BCC + BCC +
STA.b $0A STA.b $0A
+ +
REP #$20
LDA.b $CA LDA.b $CA
AND.w #$00FF AND.w #$00FF
ASL A ASL A
@@ -653,13 +696,20 @@ GetSpecificRoomVisibility:
AND.w #$000F AND.w #$000F
STA.b $0E STA.b $0E
BEQ + BEQ +
SEP #$20
LDA.l ShowRooms_visited_tile LDA.l ShowRooms_visited_tile
AND.w #$00FF
CMP.b $0A CMP.b $0A
BCC + BCC +
CMP.b $0B
BCS .too_dark
STA.b $0A
BRA +
.too_dark
LDA.b $0B
STA.b $0A STA.b $0A
+ +
REP #$20
PLX PLX
LDA.b $0A LDA.b $0A
RTS RTS
@@ -705,6 +755,7 @@ DrawDropOrWarp:
STA.b $CA STA.b $CA
JSR GetSpecificRoomVisibility JSR GetSpecificRoomVisibility
AND.w #$00FF
BNE + BNE +
LDA.b $0E LDA.b $0E
AND.w #$000F AND.w #$000F
@@ -1491,8 +1542,9 @@ DoorsMapNextEntrance:
STA.b $CA STA.b $CA
JSR GetSpecificRoomVisibility JSR GetSpecificRoomVisibility
AND.w #$00FF
BNE .acceptable BNE .acceptable
BEQ .done JMP .done
+ +
TYX TYX
@@ -1509,6 +1561,7 @@ DoorsMapNextEntrance:
STA.b $CA STA.b $CA
JSR GetSpecificRoomVisibility JSR GetSpecificRoomVisibility
AND.w #$00FF
BNE .acceptable BNE .acceptable
LDA.w #$0001 LDA.w #$0001
@@ -1538,6 +1591,9 @@ DoorsMapNextEntrance:
LDA.b $00 LDA.b $00
AND.b $0E AND.b $0E
BEQ .check_next BEQ .check_next
LDA.b $0B
AND.w #$00FF
BEQ .check_next
.acceptable .acceptable
PHX PHX
@@ -1597,6 +1653,7 @@ FindFirstEntrance:
STA.b $CA STA.b $CA
JSR GetSpecificRoomVisibility JSR GetSpecificRoomVisibility
AND.w #$00FF
BNE .acceptable BNE .acceptable
LDA.w #$0001 LDA.w #$0001
@@ -1626,6 +1683,9 @@ FindFirstEntrance:
LDA.b $00 LDA.b $00
AND.b $0E AND.b $0E
BEQ .check_next BEQ .check_next
LDA.b $0B
AND.w #$00FF
BEQ .check_next
.acceptable .acceptable
PLP PLP
@@ -1867,6 +1927,7 @@ DrawDoorsEntrances:
BMI .check_dropdown BMI .check_dropdown
JSR GetSpecificRoomVisibility JSR GetSpecificRoomVisibility
AND.w #$00FF
BNE .draw_entrance BNE .draw_entrance
PHX PHX
@@ -1876,6 +1937,9 @@ DrawDoorsEntrances:
PLX PLX
AND.b $0E AND.b $0E
BEQ .check_dropdown BEQ .check_dropdown
LDA.b $0B
AND.w #$00FF
BEQ .check_dropdown
.draw_entrance .draw_entrance
SEP #$30 SEP #$30
@@ -1906,6 +1970,7 @@ DrawDoorsEntrances:
BMI .next_room BMI .next_room
JSR GetSpecificRoomVisibility JSR GetSpecificRoomVisibility
AND.w #$00FF
BNE .draw_dropdown BNE .draw_dropdown
PHX PHX
@@ -1914,7 +1979,13 @@ DrawDoorsEntrances:
LDA.l DropdownQuadrantMasks, X LDA.l DropdownQuadrantMasks, X
PLX PLX
AND.b $0E AND.b $0E
BEQ .next_room BEQ .goto_next_room
LDA.b $0B
AND.w #$00FF
BNE .draw_dropdown
.goto_next_room
JMP .next_room
.draw_dropdown .draw_dropdown
SEP #$30 SEP #$30
@@ -1964,7 +2035,6 @@ DrawDoorsStairs:
INX : INX INX : INX
LDA.l SpiralProps, X LDA.l SpiralProps, X
PHX PHX
ASL A ASL A
TAX TAX
@@ -1996,6 +2066,10 @@ DrawDoorsStairs:
AND.b $0E AND.b $0E
BEQ .skip BEQ .skip
LDA.b $0B
CMP.b #$04
BCC .skip
.draw .draw
LDY.b $00 LDY.b $00
LDA.b #$00 LDA.b #$00

View File

@@ -30,18 +30,15 @@ DrawLoot:
STA.w $021B STA.w $021B
LDA.l DRMode LDA.l DRMode
BEQ + BNE .skip
LDA.l DungeonMapMode
BNE +
BRA .skip
+
REP #$30 REP #$30
PHX : PHY PHX : PHY
STZ.b $0E STZ.b $0E
LDX.w DungeonID LDX.w DungeonID
JSL LoadDungeonMapRoomPointer LDA.l DungeonMapRoomPointers, X
STA.b $72 STA.b $72
SEP #$20 SEP #$20
@@ -73,65 +70,52 @@ DrawLoot:
DrawSingleFloorLoot: DrawSingleFloorLoot:
REP #$20 REP #$20
AND.w #$00FF AND.w #$00FF
INC A
ASL A ASL A
%ADD_MapMode() TAX
LDA.l MapDrawingData_floor_data_offset, X LDA.l DungeonMapFloorToDataOffset, X
DEC A CLC : ADC.w #$0018 ; get to end of floor
TAY TAY
%LDX_MapMode()
SEP #$20 SEP #$20
LDA.l MapDrawingData_column_count, X LDA.b #$04
DEC A
STA.b $06 STA.b $06
LDA.l MapDrawingData_row_count, X LDA.b #$04
DEC A
STA.b $07 STA.b $07
.next_row .next_row
REP #$20 REP #$20
LDA.w GFXStripes LDA.w GFXStripes
TAX TAX
CLC : ADC.w #$0034 CLC : ADC.w #$0030
STA.w GFXStripes STA.w GFXStripes
PHX
%LDX_MapMode()
SEP #$20 SEP #$20
LDA.b $07 LDA.b $07
CPX.w #$0002
BNE +
ASL A
+
CLC : ADC.b $07 CLC : ADC.b $07
REP #$20 REP #$20
AND.w #$00FF AND.w #$00FF
ASL #5 ASL #5
CLC : ADC.l MapDrawingData_bg1_grid_start, X CLC : ADC.w #$1092
ADC.b $0E ADC.b $0E
XBA XBA
PLX
STA.w GFXStripes+$02, X STA.w GFXStripes+$02, X
CLC : ADC.w #$2000 CLC : ADC.w #$2000
STA.w GFXStripes+$1A, X
LDA.w #$1300
STA.w GFXStripes+$04, X
STA.w GFXStripes+$1C, X STA.w GFXStripes+$1C, X
LDA.w #$1500
STA.w GFXStripes+$04, X
STA.w GFXStripes+$1E, X
TXA TXA
CLC : ADC.w #$0018 CLC : ADC.w #$0016
TAX TAX
.next_room .next_room
REP #$20 REP #$20
LDA.b [$72], Y ; get room id LDA.b ($72), Y ; get room id
PHY PHY
AND.w #$00FF AND.w #$00FF
@@ -153,49 +137,24 @@ DrawSingleFloorLoot:
LDA.l LootTypeIcons+2, X LDA.l LootTypeIcons+2, X
STA.w GFXStripes+$02, Y STA.w GFXStripes+$02, Y
LDA.l LootTypeIcons+4, X LDA.l LootTypeIcons+4, X
STA.w GFXStripes+$1A, Y STA.w GFXStripes+$18, Y
LDA.l LootTypeIcons+6, X LDA.l LootTypeIcons+6, X
STA.w GFXStripes+$1C, Y STA.w GFXStripes+$1A, Y
TYX TYX
PLY PLY
DEY : DEX #4 DEY : DEX #4
LDA.l DungeonMapMode
BEQ +
LDA.b $06
AND.w #$00FF
BEQ +
; skip a column if in 4x3 mode and it's not the last column
LDA.w #$0300
STA.w GFXStripes+$02, X
STA.w GFXStripes+$1C, X
DEX : DEX
+
SEP #$20 SEP #$20
DEC.b $06 DEC.b $06
BPL .next_room BPL .next_room
LDA.l DungeonMapMode
BNE +
; draw an extra empty tile at the end to make up for width differences between modes
LDA.b #$03
STZ.w GFXStripes+$02, X
STA.w GFXStripes+$03, X
STZ.w GFXStripes+$1C, X
STA.w GFXStripes+$1D, X
+
DEC.b $07 DEC.b $07
BMI .done BMI .done
LDA.b #$00 LDA.b #$00
XBA XBA
%LDX_MapMode() LDA.b #$04
LDA.l MapDrawingData_column_count, X
DEC A
STA.b $06 STA.b $06
JMP .next_row JMP .next_row

View File

@@ -5,18 +5,49 @@ DrawNonexistentRoom:
STA.l $7F0002, X STA.l $7F0002, X
STA.l $7F0040, X STA.l $7F0040, X
STA.l $7F0042, X STA.l $7F0042, X
JML $8AE7F2
FinishRoom: GetVisibilityProps:
PHX PHX
%LDX_MapMode() ASL A : ASL A
PLA
CLC : ADC.l MapDrawingData_column_spacing, X
TAX TAX
JML $8AE7F6 LDA.b $0C
AND.l .visibility_props, X
ORA.l .visibility_props+2, X
STA.b $0C
PLX
RTS
.visibility_props:
dw $0000, $0F00
dw $C000, $174F
dw $C000, $174F
dw $0000, $1400
dw $0000, $1000
dw $0000, $0C00
dw $0000, $0800
; A = room shape
; $0C = visibility props
GetQuadrantTile:
PHA
LDA.b $0C
AND.w #$03FF
BNE .square
PLA
ORA.b $0C
RTS
.square
PLA
LDA.b $0C
RTS
NormalDrawDungeonMapRoom: NormalDrawDungeonMapRoom:
JSL DrawDungeonMapRoom JSL DrawDungeonMapRoom
JMP FinishRoom JML $8AE7F2
; $CA has room_id ; $CA has room_id
; $0E has quadrant flags ; $0E has quadrant flags
@@ -26,62 +57,7 @@ DrawDungeonMapRoom:
PHB : PHK : PLB ; need to keep this in same bank as data, or else specify bank PHB : PHK : PLB ; need to keep this in same bank as data, or else specify bank
LDA.b $0A : PHA LDA.b $0A : PHA
LDA.l ShowRooms_default JSR GetSpecificRoomVisibility
AND.w #$00FF
STA.b $0A
PHX
LDX.w DungeonID
LDA.l MapField
AND.l DungeonMask, X
BEQ +
LDA.l ShowRooms_have_map
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
LDX.w DungeonID
LDA.l CompassField
AND.l DungeonMask, X
BEQ +
LDA.l ShowRooms_have_compass
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
LDA.b $0E
AND.w #$000F
BEQ +
LDA.l ShowRooms_visited_tile
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
PLX
LDA.l DungeonMapMode
BEQ +
LDA.b $0A
CMP.w #$0003
BCS +
JSL ClearAdjacentConnections
+
LDA.b $0A : BNE + : LDA.w #$0F00 : BRA ++
+ DEC A : BNE + : LDA.w #$174F : BRA ++
+ DEC A : BNE + : LDA.w #$174F : BRA ++
+ DEC A : BNE + : LDA.w #$1400 : BRA ++
+ DEC A : BNE + : LDA.w #$1000 : BRA ++
+ DEC A : BNE + : LDA.w #$0C00 : BRA ++
+ LDA.w #$0800
++ STA.b $0C
LDA.b $CA LDA.b $CA
AND.w #$00FF AND.w #$00FF
@@ -89,49 +65,44 @@ DrawDungeonMapRoom:
TAY TAY
macro DrawQuadrant(quadrant, writeOffset) macro DrawQuadrant(quadrant, writeOffset)
?DrawQuadrant: .draw_quadrant_<quadrant>:
LDA.w SupertileRoomShapes+(2*<quadrant>), Y LDA.w #(3-<quadrant>)<<14
CMP.w #$FFFF : BEQ ?.empty STA.b $0C
PHA
LDA.b $0E
AND.w #1<<(3-<quadrant>)
BNE ?.visited
?.unvisited LDA.b $0E
LDA.b $0A BIT.w #1<<(3-<quadrant>)
CMP.w #$0003 BNE ..visited
BCS ?.shape
?.square LDA.b $0A
PLA BRA ..continue
LDA.b $0C
EOR.w #(3-<quadrant>)<<14
BRA ?.write
?.shape ..visited
PLA LDA.b $0B
ORA.b $0C
BRA ?.write
?.visited ..continue
PLA AND.w #$00FF
ORA.w #$0800 JSR GetVisibilityProps
BRA ?.write
?.empty LDA.w SupertileRoomShapes+(2*<quadrant>), Y
LDA.b $0A CMP.w #$FFFF : BNE ..get_quadrant
CMP.w #$0001 LDA.b $0A
BEQ ?.full_square AND.w #$00FF
LDA.w #$0F00 CMP.w #$0001
BRA ?.write BNE ..empty
?.full_square ..full_square
LDA.w #$174F LDA.b $0C
EOR.w #(3-<quadrant>)<<14 BRA ..write
?.write ..get_quadrant
STA.l $7F0000+<writeOffset>, X JSR GetQuadrantTile
?.done BRA ..write
..empty
LDA.w #$0F00
..write
STA.l $7F0000+<writeOffset>, X
endmacro endmacro
%DrawQuadrant(0, $00) %DrawQuadrant(0, $00)
@@ -150,7 +121,7 @@ DrawEntrances:
LDA.b $06 : PHA LDA.b $06 : PHA
LDX.w DungeonID LDX.w DungeonID
JSL LoadDungeonMapRoomPointer LDA.l DungeonMapRoomPointers, X
STA.b $72 STA.b $72
SEP #$20 SEP #$20
@@ -181,23 +152,18 @@ DrawSingleFloorEntrances:
ASL A ASL A
TAX TAX
%ADD_MapMode() LDA.l DungeonMapFloorToDataOffset, X
LDA.l MapDrawingData_floor_data_offset, X
TAY TAY
STZ.b $06 STZ.b $06
%LDX_MapMode()
.next_room .next_room
REP #$20 REP #$20
LDA.b [$72], Y ; get room id LDA.b ($72), Y ; get room id
AND.w #$00FF AND.w #$00FF
CMP.w #$000F ; $0F = empty room CMP.w #$000F ; $0F = empty room
BEQ + BEQ +
PHX
JSR DrawSingleRoomEntrances JSR DrawSingleRoomEntrances
PLX
+ +
INY INY
@@ -205,13 +171,13 @@ DrawSingleFloorEntrances:
SEP #$20 SEP #$20
INC.b $06 INC.b $06
LDA.b $06 LDA.b $06
CMP.l MapDrawingData_column_count, X CMP.b #$05
BCC .next_room BCC .next_room
STZ.b $06 STZ.b $06
- INC.b $07 - INC.b $07
LDA.b $07 LDA.b $07
CMP.l MapDrawingData_row_count, X CMP.b #$05
BCC .next_room BCC .next_room
.done .done
@@ -233,8 +199,7 @@ macro DrawSingleEntrance(offset)
?+ ?+
CLC : ADC.b $06 CLC : ADC.b $06
ASL #3 ASL #3
CLC : ADC.b #<offset> CLC : ADC.b #$90+<offset>
CLC : ADC.l MapDrawingData_sprite_offset_x_base, X
STA.w OAMBuffer+0, Y STA.w OAMBuffer+0, Y
PHX PHX
@@ -245,13 +210,10 @@ macro DrawSingleEntrance(offset)
?+ ?+
CLC : ADC.b $07 CLC : ADC.b $07
ASL #3 ASL #3
PHA
LDA.b $02 LDX.b $02
%ADD_MapMode()
PLA CLC : ADC.l DungeonMapRoomMarkerYBase, X
CLC : ADC.l MapDrawingData_sprite_offset_y_base, X
PLX PLX
CLC : ADC.b #$08 CLC : ADC.b #$08
CLC : ADC.w $0213 CLC : ADC.w $0213
@@ -271,8 +233,6 @@ DrawSingleRoomEntrances:
STA.b $0E STA.b $0E
PHY PHY
%LDY_MapMode()
SEP #$10 SEP #$10
LDX.b #$FE LDX.b #$FE

View File

@@ -14,24 +14,14 @@ org $8AE12B
LDA.b #$20 LDA.b #$20
; dungeon map sheets ; dungeon map sheets
org $80DD97 org $80DDD3 ; slot $8F
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62 db $61, $56, $57, $62
; always use $8F in dungeon map
org $8AE122
NOP #4
LDA.b #$8F
; unused chest data ; unused chest data
org $81E9A5 org $81E9A5
dw $000F ; freezor room, second chest (only one chest in supertile) dw $000F ; freezor room, second chest (only one chest in supertile)
@@ -177,61 +167,16 @@ org $8AE21C
JSL DrawMountain JSL DrawMountain
BRA + : NOP #9 : + BRA + : NOP #9 : +
;================================================================================
; Custom Door Rando Maps
;--------------------------------------------------------------------------------
org $8AE590
JSL PrepDrawRow
BRA + : NOP #5 : +
org $8AE5F2
JSR LoadDungeonMapRoomPointer_0A
STA.b $72
org $8AE600
LDA.b [$72], Y
org $8AE634
JSR LoadDungeonMapRoomPointer_0A
STA.b $72
org $8AE63B
LDA.b [$72], Y
org $8AE867
JSR LoadDungeonMapRoomPointer_0A
STA.b $72
org $8AE872
LDA.b [$72], Y
org $8AE8DD
JSR LoadDungeonMapRoomPointer_0A
org $8AE8E4
STA.b $72
org $8AE8F9
LDA.b [$72], Y
org $8AEBC6
JSL GetLocationMarkerLeft
NOP
;================================================================================ ;================================================================================
; Draw Wacky Door Rando Layouts ; Draw Wacky Door Rando Layouts
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $8AE3D7 org $8AE3D7
LDA.l DungeonMapMode
BNE .normal
LDA.l DRMode LDA.l DRMode
BEQ .normal BEQ +
JSL DrawWackyDoorRandoStuff
JSL DrawWackyDoorRandoStuff JMP.w $8AE422
JMP.w $8AE422 NOP
NOP +
.normal
warnpc $8AE3EB warnpc $8AE3EB
org $8AE439 org $8AE439

View File

@@ -1,5 +1,5 @@
pushpc pushpc
incsrc hooks.asm incsrc dungeon_map_hooks.asm
macro WriteGFXSheetPointer(sheet, location) macro WriteGFXSheetPointer(sheet, location)
pushpc pushpc
@@ -24,10 +24,11 @@ endmacro
%WriteGFXSheetPointer($62, DungeonMapIcons5) %WriteGFXSheetPointer($62, DungeonMapIcons5)
%WriteGFXSheetPointer($63, DungeonMapIcons6) %WriteGFXSheetPointer($63, DungeonMapIcons6)
%WriteGFXSheetPointer($14, DRSheet14)
pullpc pullpc
incsrc mappable_doors.asm incsrc doors_dungeon_map.asm
incsrc current_room_map.asm
incsrc draw_rooms.asm incsrc draw_rooms.asm
incsrc map_bg3.asm incsrc map_bg3.asm
incsrc dungeon_switch.asm incsrc dungeon_switch.asm
@@ -38,3 +39,4 @@ incsrc data/doors_display.asm
incsrc data/spiral_stairs.asm incsrc data/spiral_stairs.asm
incsrc data/fall_warps.asm incsrc data/fall_warps.asm
incsrc data/split_room.asm incsrc data/split_room.asm
incsrc data/doors_connections.asm

View File

@@ -1,8 +1,6 @@
CheckSwitchMap: CheckSwitchMap:
LDA.l DRMode LDA.l DRMode
BEQ .not_fancy_door_map BEQ .not_fancy_door_map
LDA.l DungeonMapMode
BNE .not_fancy_door_map
; fancy door map ; fancy door map
SEP #$20 SEP #$20
@@ -160,10 +158,6 @@ SkipMapSprites:
LDA.l DRMode LDA.l DRMode
BEQ + BEQ +
LDA.l DungeonMapMode
BEQ .no_vanilla_draw
JML $8AEADE
.no_vanilla_draw
JSL DrawDoorsMapSprites JSL DrawDoorsMapSprites
JML $8AEAFC JML $8AEAFC
+ +
@@ -181,19 +175,6 @@ CacheCurrentDungeon:
STA.l CachedDungeonID STA.l CachedDungeonID
LDA.b CurrentFloor LDA.b CurrentFloor
STA.l CachedCurrentFloor STA.l CachedCurrentFloor
LDA.l DRMode
BEQ +
LDA.w DungeonID
PHX
ASL A
TAX
LDA.l DungeonMapData.floor, X
STA.b $A4
PLX
+
REP #$20 REP #$20
RTL RTL
@@ -278,10 +259,7 @@ DrawDungeonLabel:
TAY TAY
LDA.l DRMode LDA.l DRMode
BEQ .not_doors BNE .doors
LDA.l DungeonMapMode
BEQ .doors
.not_doors
JMP .skip_doors JMP .skip_doors
.doors .doors
@@ -360,30 +338,25 @@ StartCurrentRoomSearch:
RTL RTL
FindCurrentRoom: FindCurrentRoom:
PHX LDA.w DungeonMapFloorToDataOffset, Y
TYA
%ADD_MapMode()
LDA.l MapDrawingData_floor_data_offset, X
STA.b $0C STA.b $0C
LDY.w #$0000 LDY.w #$0000
%LDX_MapMode()
SEP #$20 SEP #$20
.next_room_check .next_room_check
CPY.b $0C CPY.b $0C
BCS .not_found BCS .not_found
LDA.b [$72], Y LDA.b ($04), Y
INY INY
CMP.b $0E CMP.b $0E
BEQ .found BEQ .found
LDA.b $00 LDA.b $00
CMP.l MapDrawingData_floor_pixel_column_wrap, X CMP.b #$40
BCS .next_row BCS .next_row
CLC : ADC.l MapDrawingData_supertile_pixel_spacing, X
CLC : ADC.b #$10
STA.b $00 STA.b $00
BRA .next_room_check BRA .next_room_check
@@ -391,9 +364,9 @@ FindCurrentRoom:
STZ.b $00 STZ.b $00
LDA.b $02 LDA.b $02
CMP.l MapDrawingData_floor_pixel_row_wrap, X CMP.b #$40
BCS .next_floor BCS .next_floor
CLC : ADC.l MapDrawingData_supertile_pixel_spacing, X CLC : ADC.b #$10
STA.b $02 STA.b $02
BRA .next_room_check BRA .next_room_check
@@ -402,9 +375,7 @@ FindCurrentRoom:
BRA .next_room_check BRA .next_room_check
.found .found
PLX
JML $8AE891 JML $8AE891
.not_found .not_found
PLX
JML $8AE8CD JML $8AE8CD

67
gk/fast_junk.asm Normal file
View File

@@ -0,0 +1,67 @@
;--------------------------------------------------------------------------------
SetItemRiseTimer:
LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest
LDA.b #$38 : STA.w AncillaTimer, X
RTL
.not_from_chest
JSL ItemIsJunk
BEQ .default
.junk
LDA.l JunkItemTimer : AND.b #$3F : STA.w AncillaTimer, X
RTL
.default
TYA : STA.w AncillaTimer, X ; What we wrote over
RTL
;--------------------------------------------------------------------------------
ItemIsJunk:
PHX
LDA.l JunkItemTimer : BIT.b #$3F : BEQ .not_junk
BIT.b #$80 : BNE .check
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .check
LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .check
BRA .not_junk
.check
LDA.w AncillaGet, X
TAX
LDA.l JunkTable, X
PLX
CMP.b #$00
RTL
.not_junk
PLX
LDA.b #$00
RTL
;--------------------------------------------------------------------------------
; A = item id being collected
ItemGetAlternateSFX:
PEA.w $C567 ; SNES to RTS to in bank 08
LDA.w AncillaGet, X : CMP.b #$4A : BNE +
; collecting pre-activated flute
LDA.b #$13 : JML Ancilla_SFX2_Near
+
JSL ItemIsJunk : BEQ .normal
LDA.b #$3B : JML Ancilla_SFX3_Near
.normal
LDA.b #$0F : JML Ancilla_SFX3_Near
;--------------------------------------------------------------------------------
; A = item id being collected
ItemGetOverworldAlternateSFX:
CPY.b #$4A : BNE +
; pre-activated flute
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2
RTL
+
JSL ItemIsJunk : BEQ .normal
.junk
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$3B : STA.w SFX3
RTL
.normal
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3
RTL
;--------------------------------------------------------------------------------

View File

@@ -11,8 +11,6 @@ LoadStripes:
RTL RTL
.dungeon_map .dungeon_map
LDA.l DungeonMapMode
BNE .4x3
LDA.l DRMode LDA.l DRMode
BNE .6x6 BNE .6x6
@@ -25,15 +23,6 @@ LoadStripes:
STA.b $02 STA.b $02
RTL RTL
.4x3
LDA.b #BG3DungeonMap4x3Stripes>>0
STA.b $00
LDA.b #BG3DungeonMap4x3Stripes>>8
STA.b $01
LDA.b #BG3DungeonMap4x3Stripes>>16
STA.b $02
RTL
.6x6 .6x6
LDA.b #BG3DungeonMap6x6Stripes>>0 LDA.b #BG3DungeonMap6x6Stripes>>0
STA.b $00 STA.b $00
@@ -57,33 +46,30 @@ LoadLastHUDPalette:
SEP #$20 SEP #$20
RTL RTL
macro VanillaCommonMapStripes()
dw $4260, $0100, $2100
dw $4360, $0E40, $2101
dw $4B60, $0100, $6100
dw $6260, $2EC0, $2110
dw $6B60, $2EC0, $6110
dw $6263, $0100, $A100
dw $6363, $0E40, $A101
dw $6B63, $0100, $E100
dw $8460, $0B00, $2102, $2103, $2104, $2105, $2106, $2107
dw $A460, $0B00, $2112, $2113, $2114, $2115, $2116, $2117
dw $5D60, $0100, $6100
dw $7D60, $2EC0, $6110
dw $7D63, $0100, $E100
dw $0060, $7E40, $2111
dw $8063, $3E41, $2111
dw $0060, $3EC0, $2111
dw $0160, $3EC0, $2111
dw $0C60, $3EC0, $2111
dw $0D60, $3EC0, $2111
dw $1E60, $3EC0, $2111
dw $1F60, $3EC0, $2111
endmacro
BG3DungeonMap5x5Stripes: BG3DungeonMap5x5Stripes:
%VanillaCommonMapStripes() ; vanilla stuff
dw $4260, $0100, $2100
dw $4360, $0E40, $2101
dw $4B60, $0100, $6100
dw $6260, $2EC0, $2110
dw $6B60, $2EC0, $6110
dw $6263, $0100, $A100
dw $6363, $0E40, $A101
dw $6B63, $0100, $E100
dw $8460, $0B00, $2102, $2103, $2104, $2105, $2106, $2107
dw $A460, $0B00, $2112, $2113, $2114, $2115, $2116, $2117
dw $5D60, $0100, $6100
dw $7D60, $2EC0, $6110
dw $7D63, $0100, $E100
dw $0060, $7E40, $2111
dw $8063, $3E41, $2111
dw $0060, $3EC0, $2111
dw $0160, $3EC0, $2111
dw $0C60, $3EC0, $2111
dw $0D60, $3EC0, $2111
dw $1E60, $3EC0, $2111
dw $1F60, $3EC0, $2111
; left edge of map border, from vanilla ; left edge of map border, from vanilla
dw $4E60, $0100, $2100 dw $4E60, $0100, $2100
dw $4F60, $1A40, $2101 dw $4F60, $1A40, $2101
@@ -133,59 +119,6 @@ endmacro
db $FF db $FF
BG3DungeonMap4x3Stripes:
%VanillaCommonMapStripes()
; left edge of map border, adjusted from vanilla
dw $4D60, $0100, $2100
dw $4E60, $1C40, $2101
dw $6D60, $2EC0, $2110
dw $6D63, $0100, $A100
dw $6E63, $1C40, $A101
; horizontal borders
dw $B160, $1440, $1D11
dw $1161, $1440, $1D11
dw $7161, $1440, $1D11
dw $D161, $1440, $1D11
dw $3162, $1440, $1D11
dw $9162, $1440, $1D11
dw $F162, $1440, $1D11
dw $5163, $1440, $1D11
; vertical borders
dw $B060, $12C0, $1D11
dw $BC60, $12C0, $1D11
dw $3062, $12C0, $1D11
dw $3C62, $12C0, $1D11
macro TopOfDoorSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $15
dw $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C
endmacro
macro BottomOfDoorSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $15
dw $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C
endmacro
macro FullDoorRow(start)
%TopOfDoorSquares(<start>)
%BottomOfDoorSquares(<start>+$20)
endmacro
; top grid
%FullDoorRow($60D1)
%FullDoorRow($6131)
%FullDoorRow($6191)
%FullDoorRow($6251)
%FullDoorRow($62B1)
%FullDoorRow($6311)
db $FF
BG3DungeonMap6x6Stripes: BG3DungeonMap6x6Stripes:
; vanilla ; vanilla
dw $4260, $0100, $2100 dw $4260, $0100, $2100

View File

@@ -115,7 +115,9 @@ RTL
CheckTransitionOverworld: CheckTransitionOverworld:
STA.b $8A STA.b $8A
STA.w $040A ; what we wrote over STA.w $040A ; what we wrote over
JML MaybeMarkFluteSpotVisited JSL MaybeMarkFluteSpotVisited
LDA.b $8A
RTL
CheckFlute: CheckFlute:
LDA.l FluteBitfield LDA.l FluteBitfield

View File

@@ -1,4 +1,4 @@
; $B9F000 org $B9F000
SupertileRoomShapes: SupertileRoomShapes:
incsrc data/supertile_shapes.asm incsrc data/supertile_shapes.asm
warnpc $B9F800 warnpc $B9F800
@@ -62,7 +62,7 @@ dw $29ED, $69ED, $29FD, $69FD ; 0B - important inventory item - big chest
dw $29CC, $29CD, $29DC, $69DC ; 0C - pendant dw $29CC, $29CD, $29DC, $69DC ; 0C - pendant
dw $2DC9, $69C9, $A9C9, $EDC9 ; 0D - crystal dw $2DC9, $69C9, $A9C9, $EDC9 ; 0D - crystal
dw $29E9, $69E9, $29F9, $69F9 ; 0E - triforce piece dw $29E9, $69E9, $29F9, $69F9 ; 0E - triforce piece
dw $29EA, $69EA, $29EB, $69EB ; 0F - triforce dw $29EA, $69EA, $29FA, $69FA ; 0F - triforce
warnpc $B9F900 warnpc $B9F900
org $B9F900 org $B9F900
@@ -147,8 +147,12 @@ dw $25A4, $25A4 ; Reserved
; $B9FB40 ; $B9FB40
warnpc $B9FF00 warnpc $B9FE00
org $B9FE00
JunkTable:
incsrc data/junk_items.asm
warnpc $B9FF00
org $B9FF00 org $B9FF00
; $00 - do not show anything ; $00 - do not show anything
; $01 - show presence of supertile as dark square ; $01 - show presence of supertile as dark square
@@ -167,7 +171,9 @@ ShowRooms:
.visited_tile .visited_tile
db $04 db $04
.reserved .reserved
skip 4 skip 3
.dark_room_cap
db $01
warnpc $B9FF08 warnpc $B9FF08
org $B9FF08 org $B9FF08
@@ -200,9 +206,3 @@ ItemSources:
; $B9FF11 ; $B9FF11
AlwaysShowCompass: AlwaysShowCompass:
db $01 db $01
; $B9FF12
; $0000 - vanilla 5x5 maps
; $0001 - special DR 4x3 maps
DungeonMapMode:
dw $0000

25
gk_meta.asm Normal file
View File

@@ -0,0 +1,25 @@
org $B9EE00
;================================================================================
warnpc $B9EEE0
org $B9EEE0
;--------------------------------------------------------------------------------
B9Source:
; $01 = GK Baserom
; $FF = GK Adjuster Patch
db $01
;--------------------------------------------------------------------------------
GKRomVersion:
; $01 = Dungeon Maps
; .., $01 = Dark rooms don't show on map from visition
; .., $02 = OW Fog and Grid modes
db $01, $02, $00
;--------------------------------------------------------------------------------
;================================================================================
warnpc $B9EEF0
org $B9EEF0
GKRandomizerVersion:
padbyte $00
pad $B9EF00
;--------------------------------------------------------------------------------

View File

@@ -40,14 +40,14 @@ RTL
dw .crystals dw .crystals
dw .pendant_bosses dw .pendant_bosses
dw .crystal_bosses dw .crystal_bosses
dw .bosses dw .prize_bosses
dw .agahnim_defeated dw .agahnim_defeated
dw .agahnim2_defeated dw .agahnim2_defeated
dw .goal_item dw .goal_item
dw .collection_rate dw .collection_rate
dw .custom_goal dw .custom_goal
dw .bingo dw .bingo
dw .success dw .all_bosses
dw .success dw .success
dw .success dw .success
dw .success dw .success
@@ -70,19 +70,24 @@ RTL
CMP.b #$07 : RTS CMP.b #$07 : RTS
.pendant_bosses .pendant_bosses
PHP PHP
LDA.b #$02 LDA.b #$20
JSR CheckForBossesDefeated : PLP : BCC + JSR CheckForBossesDefeated : PLP : BCC +
CMP.b #$03 : RTS CMP.b #$03 : RTS
.crystal_bosses .crystal_bosses
PHP PHP
LDA.b #$01 LDA.b #$10
JSR CheckForBossesDefeated : PLP : BCC + JSR CheckForBossesDefeated : PLP : BCC +
CMP.b #$07 : RTS CMP.b #$07 : RTS
.bosses .all_bosses
PHP
LDA.b #$30
JSR CheckForBossesDefeated : PLP : BCC +
CMP.b #$10 : RTS
.prize_bosses
PHP PHP
LDA.b #$00 LDA.b #$00
JSR CheckForBossesDefeated : PLP : BCC + JSR CheckForBossesDefeated : PLP : BCC +
CMP.b #$10 : RTS CMP.b #$0A : RTS
+ CMP.b [Scrap00], Y : INY : RTS + CMP.b [Scrap00], Y : INY : RTS
.agahnim_defeated .agahnim_defeated
LDA.l ProgressIndicator : CMP.b #$03 : RTS LDA.l ProgressIndicator : CMP.b #$03 : RTS
@@ -346,7 +351,7 @@ CheckTowerOpen:
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
CheckAgaForPed: CheckAgaForPed:
REP #$20 REP #$20
; seems light_speed option to force blue balls is unused for now ; seems light_speed option to force blue balls is unused for now
BRA .vanilla BRA .vanilla
.light_speed .light_speed
@@ -368,12 +373,38 @@ CheckAgaForPed:
RTL RTL
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
BossPrizeFlags:
; $00 = all prize bosses
db $00
db $01, $01, $01, $01, $01, $01, $01 ; crystals
db $01, $01, $01 ; pendants
db $00, $00, $00, $00, $00 ; padding
; $10 = all crystal bosses
db $00
db $01, $01, $01, $01, $01, $01, $01 ; crystals
db $00, $00, $00 ; pendants
db $00, $00, $00, $00, $00 ; padding
; $20 = all pendant bosses
db $00
db $00, $00, $00, $00, $00, $00, $00 ; crystals
db $01, $01, $01 ; pendants
db $00, $00, $00, $00, $00 ; padding
; $30 = all bosses
db $01 ; agas
db $01, $01, $01, $01, $01, $01, $01 ; crystals
db $01, $01, $01 ; pendants
db $00, $00, $00, $00, $00 ; padding
CheckForBossesDefeated: CheckForBossesDefeated:
PHB : PHX : PHY PHB : PHX : PHY
STA.b Scrap04 ; 0 = check all, 1 = check crystals, 2 = check pendants ; $00 = check prize bosses
; $10 = check crystal bosses
; $20 = check pendant bosses
; $30 = check all bosses
STA.b Scrap04
LDA.b #CrystalPendantFlags_3>>16 LDA.b #bank(CrystalPendantFlags_3)
PHA : PLB PHA : PLB
STZ.b Scrap03 ; count of number of bosses killed STZ.b Scrap03 ; count of number of bosses killed
@@ -381,22 +412,22 @@ CheckForBossesDefeated:
REP #$30 REP #$30
LDY.w #10 LDY.w #11
.next_check .next_check
LDA.w CrystalPendantFlags_3+2,Y : AND.w #$00FF : BEQ .skip SEP #$30
CMP.w #$0008 ; C set = pendant, C clear = crystal LDA.w CrystalPendantFlags_3+2, Y
LDA.b Scrap04 : BEQ .proceed CLC : ADC.b Scrap04
PHP : ROR : BCC + TAX
PLP : BCS .skip : BRA .proceed LDA.l BossPrizeFlags, X
+ PLP : BCC .skip REP #$30
BEQ .skip
.proceed TYA : ASL A : TAX
TYA : ASL : TAX
LDA.l DungeonMapBossRooms+4,X LDA.l DungeonMapBossRooms+4, X
ASL : TAX ASL A : TAX
LDA.l RoomDataWRAM.l,X LDA.l RoomDataWRAM.l, X
AND.w #$0800 : BEQ .skip AND.w #$0800 : BEQ .skip
INC.b Scrap03 INC.b Scrap03

View File

@@ -120,7 +120,7 @@ JSL AddBonkTremors : NOP #4
; Bonk Breakable Walls ; Bonk Breakable Walls
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $81CF8E ; CF8E <- Bank01.asm : 11641 (LDA $0372 : AND.w #$00FF) org $81CF8E ; CF8E <- Bank01.asm : 11641 (LDA $0372 : AND.w #$00FF)
JSL BonkBreakableWall : NOP #2 JSL ValidDashCheck : NOP #2
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
@@ -139,6 +139,11 @@ GravestoneHook_continue:
org $87C106 org $87C106
moveGravestone: moveGravestone:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $899A30
JSL ValidDashCheck : NOP #2
org $899A3A
JSL ValidDashCheck : NOP #2
;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
; Jump Down Ledge ; Jump Down Ledge
@@ -2102,6 +2107,11 @@ JSL FlipperScrollWarp
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;org $878F51 ; <- 38F51 - Bank07.asm:2444 (JSR $AE54 ; $3AE54 IN ROM) ;org $878F51 ; <- 38F51 - Bank07.asm:2444 (JSR $AE54 ; $3AE54 IN ROM)
;JSL OnEnterWater : NOP ;JSL OnEnterWater : NOP
;--------------------------------------------------------------------------------
; Fixes getting bumped while swimming, unable to screen transition
org $879632
LinkState_Swimming:
JSL FixSwimBump
;================================================================================ ;================================================================================
; Floodgate Softlock Fix ; Floodgate Softlock Fix
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -792,45 +792,13 @@ RTL
} }
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MaybePlaySelectSFX: MaybePlaySelectSFX:
LDA.w DungeonID : BMI .not_dungeon LDA.w DungeonID : BMI .not_dungeon
.play .play
LDA.b #$20 : STA.w SFX3 ; menu select sound LDA.b #$20 : STA.w SFX3 ; menu select sound
RTL
.not_dungeon
LDA.l HUDDungeonItems : BIT.b #$13 : BEQ .dont_play
BIT.b #$0C : BEQ .dont_play
BRA .play
.dont_play
RTL
;--------------------------------------------------------------------------------
; A = item id being collected
ItemGetAlternateSFX:
PEA.w $C567 ; SNES to RTS to in bank 08
LDA.w AncillaGet, X : CMP.b #$4A : BNE +
; collecting pre-activated flute
LDA.b #$13 : JML Ancilla_SFX2_Near
+ ; not pre-activated flute
JSL.l ItemIsJunk : BEQ .normal
.junk
LDA.b #$3B : JML Ancilla_SFX3_Near ; what we wrote over
.normal
LDA.b #$0F : JML Ancilla_SFX3_Near ; what we wrote over
; A = item id being collected
ItemGetOverworldAlternateSFX:
CPY.b #$4A : BNE +
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2
RTL RTL
+ ; normal itemget sfx .not_dungeon
JSL.l ItemIsJunk : BEQ .normal LDA.l HUDDungeonItems : BIT.b #$13 : BEQ .dont_play
BIT.b #$0C : BEQ .dont_play
.junk BRA .play
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$3B : STA.w SFX3 .dont_play
RTL RTL
.normal
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over
RTL
;--------------------------------------------------------------------------------

View File

@@ -89,7 +89,8 @@ org $80FDEE
InitializeMirrorHDMA: InitializeMirrorHDMA:
org $89D62E org $89D62E
UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers ;commenting out since this address can move
;UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
if !FEATURE_FIX_BASEROM if !FEATURE_FIX_BASEROM
org $81DB67 org $81DB67

View File

@@ -43,7 +43,6 @@ RTL
;================================================================================ ;================================================================================
SetOverlayIfLamp: SetOverlayIfLamp:
JSL LampCheck JSL LampCheck
CMP.b #$00
BEQ + BEQ +
LDA.b #$01 LDA.b #$01
+ +

BIN
menu/dr_sheet_14.3bpp Normal file

Binary file not shown.

BIN
menu/dr_sheet_14.3bppc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -40,7 +40,7 @@ dw $0000
warnpc $8ABE2E warnpc $8ABE2E
org $8ABE2E org $8ABE2E
; located posx/posy, dislocated posx/posy, prize pox/posy ; located posx/posy, dislocated posx/posy, prize posx/posy
; located = proper location of icon (default: if you have map) ; located = proper location of icon (default: if you have map)
; dislocated = location of icon if proper location is hidden from player ; dislocated = location of icon if proper location is hidden from player
; highest bit on first posx indicates which world it should show in ; highest bit on first posx indicates which world it should show in
@@ -49,27 +49,27 @@ WorldMapIcon_pos:
.hc .hc
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00 dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00
.ep .ep
dw $0F31, $0620, $FF00, $FF00, $0F31, $0620 dw $0F30, $06E0, $FF00, $FF00, $0F30, $06E0
.dp .dp
dw $0108, $0D70, $FF00, $FF00, $0108, $0D70 dw $0170, $0E50, $FF00, $FF00, $0170, $0E50
.at .at
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00 dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00
.sp .sp
dw $8759, $0ED0, $FF00, $FF00, $8759, $0ED0 dw $8790, $0FD0, $FF00, $FF00, $8790, $0FD0
.pod .pod
dw $8F40, $0620, $FF00, $FF00, $8F40, $0620 dw $8F30, $06E0, $FF00, $FF00, $8F30, $06E0
.mm .mm
dw $8100, $0CA0, $FF00, $FF00, $8100, $0CA0 dw $8160, $0D80, $FF00, $FF00, $8160, $0D80
.sw .sw
dw $8082, $00B0, $FF00, $FF00, $8082, $00B0 dw $80F0, $0160, $FF00, $FF00, $80F0, $0160
.ip .ip
dw $8CA0, $0DA0, $FF00, $FF00, $8CA0, $0DA0 dw $8CB0, $0E80, $FF00, $FF00, $8CB0, $0E80
.toh .toh
dw $08D0, $0080, $FF00, $FF00, $08D0, $0080 dw $0900, $0130, $FF00, $FF00, $0900, $0130
.tt .tt
dw $81D0, $0780, $FF00, $FF00, $81D0, $0780 dw $8240, $0840, $FF00, $FF00, $8240, $0840
.tr .tr
dw $8F11, $0103, $FF00, $FF00, $8F11, $0103 dw $8F30, $01B0, $FF00, $FF00, $8F30, $01B0
.gt .gt
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00 dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00
@@ -324,21 +324,34 @@ WorldMap_DrawTile:
SEP #$20 SEP #$20
LDX.b Scrap0B : TXA : STA.b (OAMPtr+2) LDX.b Scrap0B : TXA : STA.b (OAMPtr+2)
INC.b OAMPtr+2 INC.b OAMPtr+2
JSR WorldMap_CalculateOAMCoordinates
LDX.b Scrap0A : BEQ +
LDA.b Scrap0E : CLC : ADC.b #$04 : STA.b Scrap0E
LDA.b Scrap0F : CLC : ADC.b #$04 : STA.b Scrap0F
+
LDX.b Scrap0B : BEQ +
LDA.b Scrap0E : SEC : SBC.b #$04 : STA.b Scrap0E
LDA.b Scrap0F : SEC : SBC.b #$04 : STA.b Scrap0F
+
REP #$20 REP #$20
PLA : STA.b Scrap00 LDA.l $7EC10A : BIT.w #$4000 : SEP #$20 : BNE .raw_coords ; use raw OAM coordinates
JSR WorldMap_CalculateOAMCoordinates
BCS .apply_offsets
REP #$20
BRA .exit
.raw_coords
STA.b Scrap0E
LDA.l $7EC108 : STA.b Scrap0F
.apply_offsets
LDX.b Scrap0A : BNE .aligned ; prize number/overlay: no offset
LDX.b Scrap0B : BEQ +
; 16x16 sprite: -8 pixels
LDA.b Scrap0E : SEC : SBC.b #$08 : STA.b Scrap0E
LDA.b Scrap0F : SBC.b #$08 : STA.b Scrap0F
BRA .aligned
+
; 8x8 sprite: -4 pixels
LDA.b Scrap0E : SEC : SBC.b #$04 : STA.b Scrap0E
LDA.b Scrap0F : SBC.b #$04 : STA.b Scrap0F
.aligned
REP #$20
LDA.b Scrap0E : STA.b (OAMPtr) LDA.b Scrap0E : STA.b (OAMPtr)
INC.b OAMPtr : INC.b OAMPtr INC.b OAMPtr : INC.b OAMPtr
LDA.b Scrap0C : STA.b (OAMPtr) LDA.b Scrap0C : STA.b (OAMPtr)
INC.b OAMPtr : INC.b OAMPtr INC.b OAMPtr : INC.b OAMPtr
.exit
PLA : STA.b Scrap00
RTS RTS
; Y - dungeon index ; Y - dungeon index
@@ -423,6 +436,78 @@ WorldMap_CheckPrizeCollected:
RTS RTS
warnpc $8AC3B1 warnpc $8AC3B1
org $8AC3B6
; ---------------------------------------------------------------------------------------------------
; Y coordinate calculation: Quadratic approximation
; Formula: Y_oam = 0x16 + (Y * 118 >> 12) + ((Y>>4)^2 * 49 >> 8)
; Accurate to within ±1.5 pixels across entire range
; ---------------------------------------------------------------------------------------------------
REP #$20
LDA.l $7EC108 : ASL #4 ; world Y coordinate
PHA
; calculate linear term: (Y * 118) >> 12
SEP #$20
LDA.b #$76
JSR WorldMap_MultiplyAxB ; (Y>>4) * 118
REP #$20
STA.b Scrap00 ; linear term stored at high byte (Scrap01)
; calculate quadratic term: ((Y>>4)^2 * 49) >> 8
LDA.b 1,S
SEP #$20
XBA : TAX : XBA : TXA
JSR WorldMap_MultiplyAxB ; (Y>>4) ^ 2
LDA.b #$31
JSR WorldMap_MultiplyAxB ; multiply by 49
XBA ; quadratic term
; combine: 0x16 + linear_term + quadratic_term
CLC : ADC.b Scrap01 ; add linear term
ADC.b #$16 ; add fixed offset
STA.b Scrap0F
REP #$20
PLA ; world Y coordinate
; ---------------------------------------------------------------------------------------------------
; Calculate half_width for perspective: 91 + (Y_shifted * 28 / 256)
; The world map appears wider at the bottom than at the top, simulating perspective
; Top (Y=0): X range 0x26-0xDC (half-width: 91), Bottom (Y=FFF): X range 0x08-0xF6 (half-width: 119)
; ---------------------------------------------------------------------------------------------------
SEP #$20
LDA.b #$1C ; width increase factor
JSR WorldMap_MultiplyAxB
XBA : CLC : ADC.b #$5B ; add fixed half-width
STA.b Scrap00
; ---------------------------------------------------------------------------------------------------
; Calculate X offset: X_offset = (X_from_center * half_width * 2) / 256
; where X_from_center = (world_X >> 4) - 128
; The center X is at 129 (0x81)
; ---------------------------------------------------------------------------------------------------
REP #$20
LDA.l $7EC10A : LSR #4 ; world X coordinate
SEP #$20
SEC : SBC.b #$80 ; subtract 128 (center point)
PHP ; preserve carry
BPL + : EOR.b #$FF : INC : + ; absolute value
PHA
LDA.b Scrap00 : ASL : XBA ; half-width x 2
PLA
JSR WorldMap_MultiplyAxB
XBA
PLP : BCS +
STA.b Scrap00
LDA.b #$81 : SEC : SBC.b Scrap00 ; center X position - offset
BRA .store_and_exit
+ CLC : ADC.b #$81 ; center X position + offset
.store_and_exit
STA.b Scrap0E
SEP #$30
JMP WorldMap_CalculateOAMCoordinates_exit_successfully
warnpc $8AC433
pullpc pullpc
WorldMap_LoadChrHalfSlot: WorldMap_LoadChrHalfSlot:

View File

@@ -1190,7 +1190,7 @@ MaybeFlagCompassTotalPickup:
RTL RTL
MaybeFlagMapTotalPickup: MaybeFlagMapTotalPickup:
; LDA.l MapHUDMode : AND.b #$0F : BEQ .done LDA.l MapHUDMode : AND.b #$0F : BEQ .done
LDA.w DungeonID : BMI .done LDA.w DungeonID : BMI .done
LDA.w ItemReceiptID : CMP.b #$33 : BEQ .set_flag LDA.w ItemReceiptID : CMP.b #$33 : BEQ .set_flag
REP #$20 REP #$20
@@ -1212,7 +1212,7 @@ MaybeFlagDungeonTotalsEntrance:
LDA.l CompassMode : AND.w #$000F : BEQ .maps ; Skip if we're not showing compass counts LDA.l CompassMode : AND.w #$000F : BEQ .maps ; Skip if we're not showing compass counts
JSR FlagCompassCount JSR FlagCompassCount
.maps .maps
LDA.l MapHUDMode : AND.w #$000F LDA.l MapHUDMode : AND.w #$000F : BEQ .done
LDX.w DungeonID LDX.w DungeonID
JSR FlagMapCount JSR FlagMapCount
.done .done

View File

@@ -6,18 +6,18 @@ OWFlags:
dw 0 dw 0
OWReserved: OWReserved:
dw 0 dw 0
OWFog:
db 0 ; 0: disabled - 1: fog clears after visiting either world version of a screen - 2: fog clears after visiting the current world version of a screen
org $aa8010 org $aa8010
OWVersionInfo: OWVersionInfo:
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000 dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
;Hooks ;Hooks
org $82a929 org $82a92C
OWDetectTransitionReturn: JSL OWDetectEdgeTransition ; JSL Link_CheckForEdgeScreenTransition
org $82a939 org $82a936
OverworldHandleTransitions_SpecialTrigger: OverworldHandleTransitions_PerformEdgeTransition:
JSL OWDetectEdgeTransition
BCS OWDetectTransitionReturn
org $82a999 org $82a999
jsl OWEdgeTransition : nop #4 ;LDA $02A4E3,X : ORA $7EF3CA jsl OWEdgeTransition : nop #4 ;LDA $02A4E3,X : ORA $7EF3CA
@@ -106,20 +106,34 @@ jsl OWOldManSpeed
org $8aba6c ; < ? - Bank0a.asm:474 () org $8aba6c ; < ? - Bank0a.asm:474 ()
jsl OWMapWorldCheck16 : nop jsl OWMapWorldCheck16 : nop
; Mixed Overworld Map ; Custom Overworld Map
org $8ABA99 org $8ABA99
WorldMap_LoadDarkWorldMap: WorldMap_LoadDarkWorldMap:
LDA.b GameMode : CMP.b #$14 ; attract module LDA.b GameMode : CMP.b #$14 ; attract module
BEQ .vanilla_light BEQ .vanilla_light
LDA.l OWMode+1 : AND.b #!FLAG_OW_MIXED : BNE .mixed LDA.l OWFlags : AND.b #!FLAG_OW_CUSTOM_MAP : BNE .custom
LDA.b OverworldIndex : AND.b #$40 LDA.b OverworldIndex : AND.b #$40
BEQ .vanilla_light BEQ .vanilla_light
.mixed .custom
PHB : PHK : PLB STZ.b ScrapBuffer72 ; clear tile swap flag
JSL LoadMapDarkOrMixed JSL LoadMapDarkOrCustom_long
PLB NOP #2
warnpc $8ABAB5
.vanilla_light ; $0ABAB5 .vanilla_light ; $0ABAB5
org $8ABB32
JSL LoadMapOppositeWorld
org $8ABF78
JSL WorldMap_SkipHandleSprites
org $8ABA22
JSL MoveLinkMapSprite
org $8ABFF0
JSL MoveMirrorPortalMapSprite
; Could insert similar hooks at $8AB860 and $8AB8AC for flute spots
;(replacing -> LDA $8A : AND.b #$40) ;(replacing -> LDA $8A : AND.b #$40)
org $80d8c4 ; < ? - Bank00.asm:4068 () org $80d8c4 ; < ? - Bank00.asm:4068 ()
jsl OWWorldCheck jsl OWWorldCheck
@@ -227,6 +241,7 @@ OWMapWorldCheck16:
{ {
lda.b GameMode : cmp.w #$0014 : beq .return ; attract module, return with Z flag cleared lda.b GameMode : cmp.w #$0014 : beq .return ; attract module, return with Z flag cleared
jsl OWWorldCheck16 jsl OWWorldCheck16
eor.b ScrapBuffer72 ; apply tile swap flag
.return .return
rtl rtl
} }
@@ -387,51 +402,110 @@ OWMarkVisited:
RTL RTL
} }
LoadMapDarkOrMixed: LoadMapDarkOrCustom:
{ {
CMP.b #!FLAG_OW_MIXED : REP #$30 : BEQ .mixed CMP.b #!FLAG_OW_CUSTOM_MAP : REP #$30 : BEQ .custom
LDX.w #$03FE ; draw vanilla Dark World (what we wrote over) LDX.w #$03FE ; draw vanilla Dark World (what we wrote over)
.copy_next .copy_next
LDA.w WorldMap_DarkWorldTilemap,X : STA.w GFXStripes,X LDA.w WorldMap_DarkWorldTilemap,X : STA.w GFXStripes,X
DEX : DEX : BPL .copy_next DEX : DEX : BPL .copy_next
BRL .end BRL .end
.mixed .custom
LDX.b OverworldIndex LDX.b OverworldIndex
LDA.l OWTileWorldAssoc,X LDA.l OWTileWorldAssoc,X
STA.b Scrap00
LDY.w #$139C
LDX.w #$003F
.next_screen
PHX
LDA.l OWTileWorldAssoc,X
EOR.b Scrap00
AND.w #$0040 AND.w #$0040
BEQ .light EOR.b ScrapBuffer72 ; apply tile swap flag
TYX : BRA .copy_screen BEQ .draw_lw
.light LDA.w #OWMapGridDark
TXA : AND.w #$0024 : LSR : TAX BRA .draw_dw
TYA : SEC : SBC.l LWQuadrantOffsets,X .draw_lw
TYX : TAY LDA.w #OWMapGridLight
.copy_screen ; more efficient to have X on the right side .draw_dw
LDA.w $C739+$00,Y : STA.b $00,X STA.b Scrap00
LDA.w $C739+$02,Y : STA.b $02,X LDA.w #OWMapGridLight>>16 ; current program bank
LDA.w $C739+$20,Y : STA.b $20,X STA.b Scrap02
LDA.w $C739+$22,Y : STA.b $22,X LDX.w #$139C
LDA.w $C739+$40,Y : STA.b $40,X LDY.w #$003F
LDA.w $C739+$42,Y : STA.b $42,X .next_cell
LDA.w $C739+$60,Y : STA.b $60,X PHY
LDA.w $C739+$62,Y : STA.b $62,X JSR GetOWMapTilemapOffsetToCopy
TXY : PLX .copy_cell ; more efficient to have X on the right side
DEY : DEY : DEY : DEY ; move one screen left TAY
TXA : AND.w #$0007 : BNE .same_row LDA.w WorldMap_LightWorldTilemap+$00,Y : STA.b $00,X
TYA : SEC : SBC.w #$0060 : TAY ; move one screen row up LDA.w WorldMap_LightWorldTilemap+$02,Y : STA.b $02,X
LDA.w WorldMap_LightWorldTilemap+$20,Y : STA.b $20,X
LDA.w WorldMap_LightWorldTilemap+$22,Y : STA.b $22,X
LDA.w WorldMap_LightWorldTilemap+$40,Y : STA.b $40,X
LDA.w WorldMap_LightWorldTilemap+$42,Y : STA.b $42,X
LDA.w WorldMap_LightWorldTilemap+$60,Y : STA.b $60,X
LDA.w WorldMap_LightWorldTilemap+$62,Y : STA.b $62,X
PLY
DEX : DEX : DEX : DEX ; move one screen left
TYA : AND.w #$0007 : BNE .same_row
TXA : SEC : SBC.w #$0060 : TAX ; move one screen row up
.same_row .same_row
DEX DEY
BPL .next_screen BPL .next_cell
.end .end
SEP #$30 SEP #$30
LDA.b #$15 : STA.b NMIINCR ; what we wrote over LDA.b #$15 : STA.b NMIINCR ; what we wrote over
RTL RTS
}
GetOWMapTilemapOffsetToCopy:
{
LDA.l OWFog : AND.w #$00FF
CMP.w #$0001 : BEQ .parallel_fog
CMP.w #$0002 : BNE .no_fog
LDA.b [Scrap00],Y : AND.w #$00FF
PHX
TAX
BIT.w #$0040
BEQ .light_fog
LDA.l Overworld_ActualScreenID-$40,X : ORA.w #$0040
BRA .dark_fog
.light_fog
LDA.l Overworld_ActualScreenID,X
.dark_fog
AND.w #$00FF
TAX
LDA.l OverworldEventDataWRAM,X
.check_visited_flag
PLX
AND.w #$0080 : BNE .no_fog
LDA.w #($D350-$C739)
RTS
.parallel_fog
LDA.b [Scrap00],Y : AND.w #$003F
PHX
TAX
LDA.l Overworld_ActualScreenID,X
AND.w #$00FF
TAX
LDA.l OverworldEventDataWRAM,X
ORA.l OverworldEventDataWRAM+$40,X
BRA .check_visited_flag
.no_fog
LDA.b [Scrap00],Y : AND.w #$0038 : ASL : ASL : ASL : ASL
STA.b Scrap03
LDA.b [Scrap00],Y
BIT.w #$0040
BEQ .light
AND.w #$0007
ASL : ASL : ADC.w #$1000 : ADC.b Scrap03
RTS
.light
PHX
AND.w #$0024 : LSR : TAX
LDA.b [Scrap00],Y
AND.w #$0007
ASL : ASL : ADC.w #$1000 : ADC.b Scrap03
SEC : SBC.l LWQuadrantOffsets,X
PLX
RTS
LWQuadrantOffsets: LWQuadrantOffsets:
dw $1000-$0210 ; top left dw $1000-$0210 ; top left
@@ -441,6 +515,92 @@ LoadMapDarkOrMixed:
dw $0400+$0210 ; bottom right dw $0400+$0210 ; bottom right
} }
LoadMapDarkOrCustom_long:
{
PHB : LDA.b #WorldMap_DarkWorldTilemap>>16 : PHA : PLB
LDA.l OWFlags : AND.b #!FLAG_OW_CUSTOM_MAP
JSR LoadMapDarkOrCustom
PLB
RTL
}
LoadMapOppositeWorld:
{
LDA.l OWFlags : AND.b #!FLAG_OW_ADJUST_DYNAMIC_MAP_SPRITE_POSITION : BEQ .vanilla
LDA.b ScrapBuffer72 : BEQ +
LDA.b Joy1B_All : AND.b #$30 : BNE .vanilla
STZ.b ScrapBuffer72 ; clear tile swap flag
BRA .new_tiles
+ LDA.b Joy1B_New : AND.b #$30 : BEQ .vanilla
LDA.b #$40 : STA.b ScrapBuffer72 ; set tile swap flag
.new_tiles
JSL OverworldMap_InitGfx+$10 ; load palette
DEC.w SubModuleInterface
LDA.b #$0F : STA.b INIDISPQ
JSL LoadMapDarkOrCustom_long
LDA.b #$24 : STA.w SFX3
PLA : PLA : PEA.w $BBAF ; skip everything upon return
.vanilla
LDA.b Joy1B_New : AND.b #$70 ; what we wrote over
RTL
}
WorldMap_SkipHandleSprites:
{
LDA.l OWFlags : AND.b #!FLAG_OW_ADJUST_DYNAMIC_MAP_SPRITE_POSITION : BEQ .vanilla
LDA.b ScrapBuffer72 : BEQ .vanilla ; skip draw if no tile swap
PLA : PLA : PEA.w $C3AF ; exit without drawing sprites
RTL
.vanilla
LDA.b FrameCounter : AND.b #$10 ; what we wrote over
RTL
}
MoveLinkMapSprite:
{
STA.l $7EC10A ; what we overwrote
SEP #$20
STZ.b ScrapBuffer72
JSR MoveMapSprite
REP #$20
RTL
}
MoveMirrorPortalMapSprite:
{
STA.l $7EC109 ; what we overwrote
JSR MoveMapSprite
RTL
}
MoveMapSprite:
{
LDA.l OWFlags : AND.b #!FLAG_OW_ADJUST_DYNAMIC_MAP_SPRITE_POSITION : BEQ .return
LDA.l $7EC10B : AND.b #$0E : LSR
STA.b Scrap00
LDA.l $7EC109 : AND.b #$0E : ASL : ASL
ADC.b Scrap00
STA.b Scrap00
LDX.b OverworldIndex
LDA.l OWTileWorldAssoc,X
LDX.b Scrap00
AND.b #$40
BEQ .light
LDA.l OWMapGridDarkPositionByAbsolutePosition,X
BRA .dark
.light
LDA.l OWMapGridLightPositionByAbsolutePosition,X
.dark
TAX
AND.b #$07 : ASL
STA.b Scrap00
LDA.l $7EC10B : AND.b #$01 : ORA.b Scrap00 : STA.l $7EC10B
TXA
AND.b #$38 : LSR : LSR
STA.b Scrap00
LDA.l $7EC109 : AND.b #$01 : ORA.b Scrap00 : STA.l $7EC109
.return
RTS
}
OWBonkDropPrepSprite: OWBonkDropPrepSprite:
{ {
LDA.b IndoorsFlag : BEQ + LDA.b IndoorsFlag : BEQ +
@@ -609,27 +769,26 @@ OWBonkDrops:
JSL OWBonkSpritePrep JSL OWBonkSpritePrep
.mark_collected ; S = Collected, FlagBitmask, X (row + 2) .mark_collected ; S = Collected, FlagBitmask, X (row + 2)
PLA : BNE + ; S = FlagBitmask, X (row + 2) PLA : BEQ + : - : JMP .return : + ; S = FlagBitmask, X (row + 2)
TYX : JSL Sprite_IsOnscreen : BCC + TYX : JSL Sprite_IsOnscreen : BCC -
LDA.b IndoorsFlag : BEQ ++ LDA.b IndoorsFlag : BEQ +
LDA.l RoomDataWRAM[$0120].high : ORA.b 1,S : STA.l RoomDataWRAM[$0120].high LDA.l RoomDataWRAM[$0120].high : ORA.b 1,S : STA.l RoomDataWRAM[$0120].high
LDA.w $0400 : ORA.b 1,S : STA.w $0400 LDA.w $0400 : ORA.b 1,S : STA.w $0400
BRA .increment_collection BRA .increment_collection
++ +
LDA.b OverworldIndex LDA.b OverworldIndex
BIT.b #$40 : BEQ + BIT.b #$40 : BEQ +
LDA.l ProgressIndicator : CMP.b #$02 LDA.l ProgressIndicator : CMP.b #$02
LDA.b OverworldIndex : BCS ++ : AND.b #$BF LDA.b OverworldIndex : BCS + : AND.b #$BF
++
+ +
TAX : LDA.l OverworldEventDataWRAM,X : ORA.b 1,S : STA.l OverworldEventDataWRAM,X TAX : LDA.l OverworldEventDataWRAM,X : ORA.b 1,S : STA.l OverworldEventDataWRAM,X
.increment_collection .increment_collection
REP #$20 REP #$20
LDA.l TotalItemCounter : INC : STA.l TotalItemCounter LDA.l TotalItemCounter : INC : STA.l TotalItemCounter
INC.w UpdateHUDFlag
SEP #$20 SEP #$20
+ BRA .return LDA.b #$01 : STA.l UpdateHUDFlag
BRA .return
; spawn itemget item ; spawn itemget item
.spawn_item ; A = item id ; Y = bonk sprite slot ; S = Collected, FlagBitmask, X (row + 2) .spawn_item ; A = item id ; Y = bonk sprite slot ; S = Collected, FlagBitmask, X (row + 2)
@@ -738,20 +897,29 @@ OWBonkSpritePrep:
org $aa9000 org $aa9000
OWDetectEdgeTransition: OWDetectEdgeTransition:
{ {
JSL OWDestroyItemSprites JSL Link_CheckForEdgeScreenTransition ; what we wrote over
BCS .return
STZ.w RandoOverworldWalkDist STZ.w RandoOverworldWalkDist
LDA.l OWMode : ORA.l OWMode+1 : BEQ .vanilla LDA.l OWMode : ORA.l OWMode+1 : BEQ .vanilla
PHY
JSR OWShuffle JSR OWShuffle
LDA.w RandoOverworldTargetEdge : BMI .special PLY
LDA.w RandoOverworldTargetEdge : BMI .specialOrDisabled
.vanilla .vanilla
REP #$31 : LDX.b Scrap02 : LDA.b OverworldMap16Buffer ; what we wrote over CLC ; allow transition
RTL RTL
.specialOrDisabled
CMP.b #$FF : BNE .special
STZ.w RandoOverworldTargetEdge
PHB
JML Link_CheckForEdgeScreenTransition_prevent_transition
.special .special
REP #$30 REP #$30
AND.w #$0003 : TAY : ASL : TAX AND.w #$0003 : TAY : ASL : TAX
LDA.w #$007F : STA.w RandoOverworldTargetEdge LDA.w #$007F : STA.w RandoOverworldTargetEdge
JSR OWLoadSpecialArea JSR OWLoadSpecialArea
SEC SEC
.return
RTL RTL
} }
OWDetectSpecialTransition: OWDetectSpecialTransition:
@@ -761,17 +929,23 @@ OWDetectSpecialTransition:
TXA : AND.w #$0002 : LSR TXA : AND.w #$0002 : LSR
STA.w RandoOverworldTerrain STA.w RandoOverworldTerrain
LDA.l OWSpecialDestIndex,X : BIT.w #$0080 : BEQ .switch_to_edge LDA.l OWSpecialDestIndex,X : BIT.w #$0080 : BEQ .switch_to_edge
AND.w #$00FF : CMP.w #$00FF : BEQ .disabled
AND.w #$0003 : TAY : ASL : TAX AND.w #$0003 : TAY : ASL : TAX
.normal .normal
JSR OWLoadSpecialArea JSR OWLoadSpecialArea
.return .return
RTL RTL
.disabled
SEP #$30
STZ.w RandoOverworldTargetEdge
RTL
.switch_to_edge .switch_to_edge
STA.w RandoOverworldTargetEdge STA.w RandoOverworldTargetEdge
LDA.l OWEdgeDataOffset,X : STA.w RandoOverworldEdgeAddr LDA.l OWEdgeDataOffset,X : STA.w RandoOverworldEdgeAddr
PLA : SEP #$30 : PLA ; delete 3 bytes from stack PLA : SEP #$30 : PLA ; delete 3 bytes from stack
JSL Link_CheckForEdgeScreenTransition : BCS .return ; Link_CheckForEdgeScreenTransition JSL Link_CheckForEdgeScreenTransition : BCS .return
LDA.l Overworld_CheckForSpecialOverworldTrigger_Direction,X : STA.b Scrap00 : CMP.b #$08 : BNE .hobo LDA.l Overworld_CheckForSpecialOverworldTrigger_Direction,X : STA.b Scrap00 : CMP.b #$08 : BNE .hobo
LSR : STA.b LinkPosY : STZ.b BG2V ; move Link and camera to edge LSR : STA.b LinkPosY : STZ.b BG2V ; move Link and camera to edge
LDA.b #$06 : STA.b Scrap02 LDA.b #$06 : STA.b Scrap02
@@ -790,16 +964,15 @@ OWDetectSpecialTransition:
LDA.b #$FF : STA.b LinkRecoilZ : STA.b $C7 LDA.b #$FF : STA.b LinkRecoilZ : STA.b $C7
STZ.b $3D : STZ.b LinkSpeed : STZ.w $032B : STZ.w LinkDashing : STZ.b LinkState STZ.b $3D : STZ.b LinkSpeed : STZ.w $032B : STZ.w LinkDashing : STZ.b LinkState
.not_dashing .not_dashing
PLA : REP #$31 : PLA ; delete 3 bytes from stack PLA : PLA : PLA ; delete 3 bytes from stack
LDX.b Scrap02 JML OverworldHandleTransitions_PerformEdgeTransition
LDA.b OverworldMap16Buffer
JML OverworldHandleTransitions_SpecialTrigger+6
} }
OWEdgeTransition: OWEdgeTransition:
{ {
LDA.l OWMode : ORA.l OWMode+1 : BEQ .unshuffled LDA.l OWMode : ORA.l OWMode+1 : BEQ .unshuffled
LDY.w RandoOverworldTargetEdge : STZ.w RandoOverworldTargetEdge LDY.w RandoOverworldTargetEdge : STZ.w RandoOverworldTargetEdge
CPY.b #$7F : BEQ .unshuffled CPY.b #$7F : BEQ .unshuffled
JSL OWDestroyItemSprites
REP #$10 REP #$10
LDX.w RandoOverworldEdgeAddr LDX.w RandoOverworldEdgeAddr
PHB : PHK : PLB PHB : PHK : PLB
@@ -1488,7 +1661,7 @@ dw $0b28, $0b38, $0010, $0b30, $1515, $1018, $0001, $000e
dw $0b70, $0ba0, $0030, $0b88, $1515, $1020, $0000, $000f dw $0b70, $0ba0, $0030, $0b88, $1515, $1020, $0000, $000f
dw $0a40, $0b10, $00d0, $0aa8, $1d1d, $1006, $0000, $0010 dw $0a40, $0b10, $00d0, $0aa8, $1d1d, $1006, $0000, $0010
dw $0350, $0390, $0040, $0370, $1821, $2060, $0000, $0011 dw $0350, $0390, $0040, $0370, $1821, $2060, $0000, $0011
dw $0670, $06a8, $0038, $068c, $1b23, $2002, $0000, $0012 dw $0670, $06a8, $0038, $068c, $1b23, $2004, $0000, $0012
dw $0898, $09b0, $0118, $0924, $1b24, $2054, $0000, $0013 dw $0898, $09b0, $0118, $0924, $1b24, $2054, $0000, $0013
dw $0a40, $0ba0, $0160, $0af0, $2525, $100e, $0000, $0014 dw $0a40, $0ba0, $0160, $0af0, $2525, $100e, $0000, $0014
dw $0c70, $0c90, $0020, $0c80, $1e26, $2002, $0000, $0015 dw $0c70, $0c90, $0020, $0c80, $1e26, $2002, $0000, $0015
@@ -1520,7 +1693,7 @@ dw $0b28, $0b38, $0010, $0b30, $5555, $1018, $0001, $002e
dw $0b70, $0ba0, $0030, $0b88, $5555, $1020, $0000, $002f dw $0b70, $0ba0, $0030, $0b88, $5555, $1020, $0000, $002f
dw $0a40, $0b10, $00d0, $0aa8, $5d5d, $1006, $0000, $0030 dw $0a40, $0b10, $00d0, $0aa8, $5d5d, $1006, $0000, $0030
dw $0350, $0390, $0040, $0370, $5861, $2060, $0000, $0031 dw $0350, $0390, $0040, $0370, $5861, $2060, $0000, $0031
dw $0670, $06a8, $0038, $068c, $5b63, $2002, $0000, $0032 dw $0670, $06a8, $0038, $068c, $5b63, $2004, $0000, $0032
dw $0898, $09b0, $0118, $0924, $5b64, $2054, $0000, $0033 dw $0898, $09b0, $0118, $0924, $5b64, $2054, $0000, $0033
dw $0a40, $0ba0, $0160, $0af0, $6565, $100e, $0000, $0034 dw $0a40, $0ba0, $0160, $0af0, $6565, $100e, $0000, $0034
dw $0c70, $0c90, $0020, $0c80, $5e66, $2002, $0000, $0035 dw $0c70, $0c90, $0020, $0c80, $5e66, $2002, $0000, $0035
@@ -1827,16 +2000,42 @@ db $74, $4e, $10, $b1, $00, $1c
UWBonkPrizeData: UWBonkPrizeData:
db $ff, $00, $02, $b5, $00, $08 db $ff, $00, $02, $b5, $00, $08
; temporary fix - murahdahla replaces one of the bonk tree prizes org $AABC80 ;PC 153C80
; so we copy the sprite table here and update the pointer OWMapGridLight:
; longterm solution should be to spawn in murahdahla separately db $00, $01, $02, $03, $04, $05, $06, $07
org $89AE2A db $08, $09, $0A, $0B, $0C, $0D, $0E, $0F
Overworld_Sprites_Screen1A_2: db $10, $11, $12, $13, $14, $15, $16, $17
db $08, $0F, $41 ; yx:{ 0x080, 0x0F0 } db $18, $19, $1A, $1B, $1C, $1D, $1E, $1F
db $0E, $0C, $41 ; yx:{ 0x0E0, 0x0C0 } db $20, $21, $22, $23, $24, $25, $26, $27
db $11, $0D, $E3 ; yx:{ 0x110, 0x0D0 } db $28, $29, $2A, $2B, $2C, $2D, $2E, $2F
db $18, $0A, $D8 ; yx:{ 0x180, 0x0A0 } db $30, $31, $32, $33, $34, $35, $36, $37
db $18, $0F, $45 ; yx:{ 0x180, 0x0F0 } db $38, $39, $3A, $3B, $3C, $3D, $3E, $3F
db $FF ; END OWMapGridDark:
org $89CA55 db $40, $41, $42, $43, $44, $45, $46, $47
dw Overworld_Sprites_Screen1A_2&$FFFF db $48, $49, $4A, $4B, $4C, $4D, $4E, $4F
db $50, $51, $52, $53, $54, $55, $56, $57
db $58, $59, $5A, $5B, $5C, $5D, $5E, $5F
db $60, $61, $62, $63, $64, $65, $66, $67
db $68, $69, $6A, $6B, $6C, $6D, $6E, $6F
db $70, $71, $72, $73, $74, $75, $76, $77
db $78, $79, $7A, $7B, $7C, $7D, $7E, $7F
org $AABD00 ;PC 153D00
OWMapGridLightPositionByAbsolutePosition:
db $00, $01, $02, $03, $04, $05, $06, $07
db $08, $09, $0A, $0B, $0C, $0D, $0E, $0F
db $10, $11, $12, $13, $14, $15, $16, $17
db $18, $19, $1A, $1B, $1C, $1D, $1E, $1F
db $20, $21, $22, $23, $24, $25, $26, $27
db $28, $29, $2A, $2B, $2C, $2D, $2E, $2F
db $30, $31, $32, $33, $34, $35, $36, $37
db $38, $39, $3A, $3B, $3C, $3D, $3E, $3F
OWMapGridDarkPositionByAbsolutePosition:
db $00, $01, $02, $03, $04, $05, $06, $07
db $08, $09, $0A, $0B, $0C, $0D, $0E, $0F
db $10, $11, $12, $13, $14, $15, $16, $17
db $18, $19, $1A, $1B, $1C, $1D, $1E, $1F
db $20, $21, $22, $23, $24, $25, $26, $27
db $28, $29, $2A, $2B, $2C, $2D, $2E, $2F
db $30, $31, $32, $33, $34, $35, $36, $37
db $38, $39, $3A, $3B, $3C, $3D, $3E, $3F

View File

@@ -235,6 +235,8 @@ CurrentYItem = $7E0303 ;
AButtonAct = $7E0308 ; Bitfield for A-actions. $80 = Carry/toss | $02 Prayer | $01 = Tree pull AButtonAct = $7E0308 ; Bitfield for A-actions. $80 = Carry/toss | $02 Prayer | $01 = Tree pull
CarryAct = $7E0309 ; Bitfield for carrying. $02 = Tossing | $01 = Lifting CarryAct = $7E0309 ; Bitfield for carrying. $02 = Tossing | $01 = Lifting
; ;
LinkIFrames = $7E031F ; Countdown for Link's invincibility frames after taking damage.
;
LinkSwimDirection = $7E0340 ; Bitfield for swim direction. (.... udlr) LinkSwimDirection = $7E0340 ; Bitfield for swim direction. (.... udlr)
; ;
LinkDeepWater = $7E0345 ; Set when Link is in deep water. LinkDeepWater = $7E0345 ; Set when Link is in deep water.
@@ -874,6 +876,8 @@ endmacro
%assertRAM(UseY1, $7E0301) %assertRAM(UseY1, $7E0301)
%assertRAM(CurrentYItem, $7E0303) %assertRAM(CurrentYItem, $7E0303)
%assertRAM(AButtonAct, $7E0308) %assertRAM(AButtonAct, $7E0308)
%assertRAM(CarryAct, $7E0309)
%assertRAM(LinkIFrames, $7E031F)
%assertRAM(LinkSwimDirection, $7E0340) %assertRAM(LinkSwimDirection, $7E0340)
%assertRAM(LinkDeepWater, $7E0345) %assertRAM(LinkDeepWater, $7E0345)
%assertRAM(TileActIce, $7E0348) %assertRAM(TileActIce, $7E0348)

View File

@@ -464,10 +464,9 @@ db $00 ; #$00 = Original Behavior (default) - #$01 = Book can flip crystal switc
; 0x1800A7 - 0x1800AE (unused) ; 0x1800A7 - 0x1800AE (unused)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x1800AF ; 0x1800AF
; mtff ffff ; m-ff ffff
; ;
; m - 0 = only shorten timer on multiworld items, 1 = shorten all items ; m - 0 = only shorten timer on multiworld items, 1 = shorten all items
; t - 0 = triforce pieces considered important, 1 = triforce pieces considered junk
; f - number of frames to show items ; f - number of frames to show items
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B080AF ; PC 0x1800AF org $B080AF ; PC 0x1800AF
@@ -1585,6 +1584,7 @@ dw $0000
; STAIRS3 ; STAIRS3
; STAIRS4 ; STAIRS4
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B0DA00
RoomHeaders: RoomHeaders:
org $B0DA00 : RoomHeader_0000: ; pc 0x185A00 org $B0DA00 : RoomHeader_0000: ; pc 0x185A00
db $41, $21, $13, $22, $07, $3D, $00, $00, $00, $10, $C0, $00, $00, $04 db $41, $21, $13, $22, $07, $3D, $00, $00, $00, $10, $C0, $00, $00, $04
@@ -2664,7 +2664,7 @@ db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00,
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B0EFE0 ; PC 0x186FE0-0x186FEF org $B0EFE0 ; PC 0x186FE0-0x186FEF
CrystalPendantFlags_3: CrystalPendantFlags_3:
db $00 ; Sewers db $00 ; Sewers
db $00 ; Hyrule Castle db $00 ; Hyrule Castle
db $08 ; Eastern Palace db $08 ; Eastern Palace
db $09 ; Desert Palace db $09 ; Desert Palace
@@ -2672,7 +2672,7 @@ CrystalPendantFlags_3:
db $02 ; Swamp Palace db $02 ; Swamp Palace
db $01 ; Palace of Darkness db $01 ; Palace of Darkness
db $06 ; Misery Mire db $06 ; Misery Mire
db $03 ; Skull Woods db $03 ; Skull Woods
db $05 ; Ice Palace db $05 ; Ice Palace
db $0A ; Tower of Hera db $0A ; Tower of Hera
db $04 ; Thieves' Town db $04 ; Thieves' Town

View File

@@ -99,6 +99,7 @@ HandleFollowersAfterMirroring = $87AA8B
LinkHop_FindArbitraryLandingSpot = $87E359 LinkHop_FindArbitraryLandingSpot = $87E359
Link_HandleMovingAnimation_FullLongEntry = $87E68F Link_HandleMovingAnimation_FullLongEntry = $87E68F
Link_CheckForEdgeScreenTransition = $87F413 Link_CheckForEdgeScreenTransition = $87F413
Link_CheckForEdgeScreenTransition_prevent_transition = $87F42C
Sprite_CheckIfPlayerPreoccupied = $87F4AA Sprite_CheckIfPlayerPreoccupied = $87F4AA
FlashGanonTowerPalette_next_thunder = $87FA81 FlashGanonTowerPalette_next_thunder = $87FA81
FlashGanonTowerPalette_bright_white = $87FAAC FlashGanonTowerPalette_bright_white = $87FAAC
@@ -221,6 +222,8 @@ Ancilla29_MilestoneItemReceipt_skip_crystal_sfx = $88CAE5
Ancilla29_MilestoneItemReceipt_no_sparkle = $88CB2E Ancilla29_MilestoneItemReceipt_no_sparkle = $88CB2E
Ancilla_SetOAM_XY = $88F6F3 Ancilla_SetOAM_XY = $88F6F3
Ancilla_AddAncilla = $899CCE Ancilla_AddAncilla = $899CCE
WorldMap_CalculateOAMCoordinates_exit_successfully = $8AC51F
WorldMap_MultiplyAxB = $8AC57F
UpdateHUD = $8DDFA9 UpdateHUD = $8DDFA9
UpdateEquippedItem = $8DDFAF UpdateEquippedItem = $8DDFAF
DrawProgressIcons = $8DE9C8 DrawProgressIcons = $8DE9C8
@@ -288,13 +291,16 @@ EntranceData_layer = $82D2F9
EntranceData_song = $82D592 EntranceData_song = $82D592
SpawnPointData_room_id = $82D8D2 SpawnPointData_room_id = $82D8D2
Overworld_CheckForSpecialOverworldTrigger_Direction = $84E879 Overworld_CheckForSpecialOverworldTrigger_Direction = $84E879
RoomHeaderPointers = $84F1E2
Sprite_ShowSolicitedMessage_Direction = $85E1A3 Sprite_ShowSolicitedMessage_Direction = $85E1A3
FluteMenuNumbers_bits = $8AB7A3 FluteMenuNumbers_bits = $8AB7A3
WorldMap_RedXChars = $8ABF70 WorldMap_RedXChars = $8ABF70
WorldMap_CalculateOAMCoordinates = $8AC3B1 WorldMap_CalculateOAMCoordinates = $8AC3B1
WorldMap_HandleSpriteBlink = $8AC52E WorldMap_HandleSpriteBlink = $8AC52E
WorldMapIcon_AdjustCoordinate = $8AC59B WorldMapIcon_AdjustCoordinate = $8AC59B
WorldMap_LightWorldTilemap = $8AC739
WorldMap_DarkWorldTilemap = $8AD739 WorldMap_DarkWorldTilemap = $8AD739
DungeonMapRoomMarkerYBase = $8AE803
DungeonMapBossRooms = $8AE817 DungeonMapBossRooms = $8AE817
DungeonMapFloorCountData = $8AF5E9 DungeonMapFloorCountData = $8AF5E9
DungeonMapFloorToDataOffset = $8AF605 DungeonMapFloorToDataOffset = $8AF605