40 Commits

Author SHA1 Message Date
802188c906 Update credits 2025-03-26 15:57:04 -05:00
086ec3f6c1 Fix credits spacing for sprite name 2025-03-08 12:21:26 -06:00
612db53323 Update credits 2025-03-06 13:00:28 -06:00
785bd05f58 Add mirror scroll 2025-03-05 18:12:28 -06:00
89cf2e29ff Minor bug fixes:
- single-entrance teleporting was borked
- glove palettes
- updating HUD on changing item
2024-11-28 03:04:46 -06:00
7a21eaa62a 50 rupees at start, show mirror message only on second mirror 2024-11-27 16:21:03 -06:00
2d1b5116ec Open GT by killing deadrocks 2024-11-25 12:28:08 -06:00
ae54371cdb Show crossed-out glove for no glove 2024-11-25 04:48:38 -06:00
f0d76f9918 Upgradeable mirror can mirror from light world 2024-11-25 02:23:13 -06:00
30122cfa3d Per-Item improved magic consumption 2024-11-25 00:03:09 -06:00
a949230f34 Variable I-Frames 2024-11-24 22:08:05 -06:00
00487370b3 Zoom on carry, slip on sword, crystal switch changes 2024-11-24 14:37:23 -06:00
799e47443d Mess with mothula 2024-11-23 00:51:10 -06:00
8477fbe623 Show correct glove icon on file select 2024-11-23 00:50:46 -06:00
07af59720f Rewind -> warp 2024-11-22 07:40:40 -06:00
87249343ed Add weak glove and rewind clocks 2024-11-21 20:53:42 -06:00
Lexi Rose
86f641b710 Merge pull request #217 from hiimcody1/pseudoboots-visibility
Add indicator for pseudoboots to File Select screen
2024-06-13 13:36:07 -07:00
Lexi Rose
cc309ecb48 Merge pull request #215 from ardnaxelarak/use_text_table
Replace long sequences of dbs with strings using a text table
2024-06-10 08:07:46 -07:00
hiimcody1
474cfba250 Add indicator for pseudoboots to File Select screen 2024-06-08 21:29:20 -04:00
29d241bcbe Replace long strings of dbs with using a text table 2024-02-20 23:04:25 -06:00
Lexi Rose
dcb0a2b42d Merge pull request #214 from crossedstaves/master
Bomb count fix
2024-02-18 08:41:39 -08:00
crossedstaves
de8703e13f Update retro.asm
Fix to erroneous infinite bomb count
2024-02-17 16:27:42 -06:00
sporchia
2daa8daaae some register issues 2024-02-17 14:24:25 -06:00
Lexi Rose
ce8497e3d2 Merge pull request #213 from spannerisms/fixes
MSU, etc fix
2024-01-15 21:29:34 -06:00
spannerisms
014b3a719a fix things 2024-01-04 06:45:57 -05:00
Lexi Rose
85581b6813 Merge pull request #212 from cassidoxa/bonkkey
Update HUD when picking up bonk key
2024-01-02 11:33:56 -06:00
cassidoxa
cec4e0430b Fix narrow heart piece sprite shadow flickering 2024-01-02 00:26:12 -05:00
cassidoxa
d81a19c367 Update HUD when picking up bonk key 2024-01-01 22:29:14 -05:00
Lexi Rose
88ef1f385d Merge pull request #211 from cassidoxa/prize_ancilla
Fix dungeon prize ancilla spawn regression
2023-12-28 03:36:58 -06:00
cassidoxa
7001767c9b Fix dungeon prize ancilla spawn regression 2023-12-27 11:39:00 -05:00
Lexi Rose
7116cb6557 Merge pull request #210 from cassidoxa/bonkkey
Fix bonk key double count
2023-11-30 02:29:03 -06:00
cassidoxa
85e338ad67 Fix bonk key double count 2023-11-30 00:42:55 -05:00
Lexi Rose
032d15fba6 Merge pull request #209 from tcprescott/patreon
Names for Patreon Supporters
2023-09-22 23:43:22 -05:00
Thomas Prescott
f133ce7159 add some extra space 2023-09-22 23:09:35 -05:00
Thomas Prescott
c5d8c69396 fix PC addresses for patrons 2023-09-22 22:49:57 -05:00
Thomas Prescott
f71759754e patreon fields 2023-09-22 21:49:50 -05:00
Lexi Rose
507ba379cf Merge pull request #208 from cassidoxa/v31.2.0-fixes
Don't increment highest mail on final stats prep
2023-09-17 13:30:02 -05:00
cassidoxa
334f721a29 Don't increment highest mail on final stats prep 2023-09-17 12:02:54 -04:00
Lexi Rose
0fdb6ed133 Merge pull request #207 from cassidoxa/v31.2.0-fixes
Add time stamp for tossed fighter sword item
2023-09-10 01:31:32 -05:00
cassidoxa
cc36ccc0b1 Add time stamp for tossed fighter sword item 2023-09-10 00:55:03 -04:00
43 changed files with 1353 additions and 381 deletions

31
2waymirror.asm Normal file
View File

@@ -0,0 +1,31 @@
pushpc
org $8DF7E9
dw $28DE, $28DF, $28EE, $28EF ; Scroll
dw $2C62, $2C63, $2C72, $2C73 ; Mirror
dw $2C62, $2C63, $2C72, $2D11 ; 2-Way Mirror
org $87A93F
JSL.l CheckMirrorWorld
org $87A955
JSL.l BlockEraseFix
NOP #2
pullpc
CheckMirrorWorld:
LDA.l MirrorEquipment
BEQ + ; just scroll, so don't allow
DEC
BNE +
LDA.b $8A
AND.b #$40
+ RTL
BlockEraseFix:
LDA.l MirrorEquipment
BEQ +
STZ.w $05FC
STZ.w $05FD
+ RTL

View File

@@ -157,6 +157,15 @@ incsrc msu.asm
incsrc dungeonmap.asm
incsrc hextodec.asm
incsrc textrenderer.asm
incsrc rewind.asm
incsrc lift.asm
; incsrc mothula.asm
incsrc switches.asm
incsrc zoom_on_carry.asm
incsrc iframes.asm
incsrc improve_items.asm
incsrc 2waymirror.asm
incsrc deadrocks.asm
warnpc $A58000
org $A28000

View File

@@ -65,11 +65,10 @@ GiveBonkItem:
PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key
LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
JSL CountBonkItem
LDA.b #$01 : STA.l UpdateHUDFlag
RTL
.notKey
PHY : TAY : JSL.l Link_ReceiveItem : PLY
JSL CountBonkItem
RTL
;--------------------------------------------------------------------------------
LoadBonkItem:

View File

@@ -2,4 +2,4 @@
rm ../working.sfc
cp ../alttp.sfc ../working.sfc
./bin/linux/asar LTTP_RND_GeneralBugfixes.asm ../working.sfc
./bin/linux/asar -DFEATURE_PATREON_SUPPORTERS=1 LTTP_RND_GeneralBugfixes.asm ../working.sfc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

61
data/textbytecharmap.txt Normal file
View File

@@ -0,0 +1,61 @@
'=9D
A=AA
B=AB
C=AC
D=AD
E=AE
F=AF
G=B0
H=B1
I=B2
J=B3
K=B4
L=B5
M=B6
N=B7
O=B8
P=B9
Q=BA
R=BB
S=BC
T=BD
U=BE
V=BF
W=C0
X=C1
Y=C2
Z=C3
?=C6
!=C7
,=C8
-=C9
.=CD
~=CE
a=D0
b=D1
c=D2
d=D3
e=D4
f=D5
g=D6
h=D7
i=D8
j=D9
k=DA
l=DB
m=DC
n=DD
o=DE
p=DF
q=E0
r=E1
s=E2
t=E3
u=E4
v=E5
w=E6
x=E7
y=E8
z=E9
:=EA
=FF

61
data/textwordcharmap.txt Normal file
View File

@@ -0,0 +1,61 @@
'=9D00
A=AA00
B=AB00
C=AC00
D=AD00
E=AE00
F=AF00
G=B000
H=B100
I=B200
J=B300
K=B400
L=B500
M=B600
N=B700
O=B800
P=B900
Q=BA00
R=BB00
S=BC00
T=BD00
U=BE00
V=BF00
W=C000
X=C100
Y=C200
Z=C300
?=C600
!=C700
,=C800
-=C900
.=CD00
~=CE00
a=D000
b=D100
c=D200
d=D300
e=D400
f=D500
g=D600
h=D700
i=D800
j=D900
k=DA00
l=DB00
m=DC00
n=DD00
o=DE00
p=DF00
q=E000
r=E100
s=E200
t=E300
u=E400
v=E500
w=E600
x=E700
y=E800
z=E900
:=EA00
=FF00

50
deadrocks.asm Normal file
View File

@@ -0,0 +1,50 @@
pushpc
org $86EDD1
JSL CheckTransform
BRA + : NOP : +
org $86EF9A
JSL SpriteDeath
NOP
pullpc
CheckTransform:
CMP.b #$8F
BNE .skip
LDA.w $0E20, X
PHA
LDA.b #$8F
STA.w $0E20, X
JSL.l $8DB818
PLA
STA.w $0DE0, X
LDA.b #$8F
RTL
.skip
STA.w $0E20, X
JSL.l $8DB818
RTL
SpriteDeath:
LDA.w $0E20, X
CMP.b #$8F
BNE .done; not blob
LDA.w $0DE0, X
CMP.b #$27
BNE .done; blob that was formerly not a deadrock
LDA.l DeadrockCounter
CMP.b #$FF
BEQ .done ; deadrock counter maxed
INC
STA.l DeadrockCounter
.done
; what we wrote over
LDY.w $0E20, X
CPY.b #$1B
RTL

View File

@@ -61,7 +61,7 @@ LoadDialogAddressIndirect:
RTL
;--------------------------------------------------------------------------------
FreeDungeonItemNotice:
STA.w ScratchBufferV
STA.l ScratchBufferV
PHA : PHX : PHY
PHP
@@ -70,59 +70,59 @@ FreeDungeonItemNotice:
REP #$10 ; set 16-bit index registers
PEI.b (Scrap00)
LDA.b Scrap02 : PHA
LDA.w ScratchBufferNV : PHA
LDA.w ScratchBufferNV+1 : PHA
LDA.l ScratchBufferNV : PHA
LDA.l ScratchBufferNV+1 : PHA
;--------------------------------
LDA.l FreeItemText : BNE + : JMP .skip : +
LDA.b #$00 : STA.w ScratchBufferNV ; initialize scratch
LDA.b #$00 : STA.l ScratchBufferNV ; initialize scratch
LDA.l FreeItemText : AND.b #$01 : BEQ + ; show message for general small key
LDA.w ScratchBufferV : CMP.b #$24 : BNE + ; general small key
LDA.l ScratchBufferV : CMP.b #$24 : BNE + ; general small key
%CopyDialog(Notice_SmallKeyOf)
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
JMP .done
+ : LDA.l FreeItemText : AND.b #$02 : BEQ + ; show message for general compass
LDA.w ScratchBufferV : CMP.b #$25 : BNE + ; general compass
LDA.l ScratchBufferV : CMP.b #$25 : BNE + ; general compass
%CopyDialog(Notice_CompassOf)
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
JMP .done
+ : LDA.l FreeItemText : AND.b #$04 : BEQ + ; show message for general map
LDA.w ScratchBufferV : CMP.b #$33 : BNE + ; general map
LDA.l ScratchBufferV : CMP.b #$33 : BNE + ; general map
%CopyDialog(Notice_MapOf)
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
JMP .done
+ : LDA.l FreeItemText : AND.b #$08 : BEQ + ; show message for general big key
LDA.w ScratchBufferV : CMP.b #$32 : BNE + ; general big key
LDA.l ScratchBufferV : CMP.b #$32 : BNE + ; general big key
%CopyDialog(Notice_BigKeyOf)
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
JMP .done
+
LDA.l FreeItemText : AND.b #$04 : BEQ + ; show message for dungeon map
LDA.w ScratchBufferV : AND.b #$F0 ; looking at high bits only
LDA.l ScratchBufferV : AND.b #$F0 ; looking at high bits only
CMP.b #$70 : BNE + ; map of...
%CopyDialog(Notice_MapOf)
JMP .dungeon
+ : LDA.l FreeItemText : AND.b #$02 : BEQ + ; show message for dungeon compass
LDA.w ScratchBufferV : AND.b #$F0 : CMP.b #$80 : BNE + ; compass of...
LDA.l ScratchBufferV : AND.b #$F0 : CMP.b #$80 : BNE + ; compass of...
%CopyDialog(Notice_CompassOf)
JMP .dungeon
+ : LDA.l FreeItemText : AND.b #$08 : BEQ + ; show message for dungeon big key
LDA.w ScratchBufferV : AND.b #$F0 : CMP.b #$90 : BNE + ; big key of...
LDA.l ScratchBufferV : AND.b #$F0 : CMP.b #$90 : BNE + ; big key of...
%CopyDialog(Notice_BigKeyOf)
JMP .dungeon
+ : LDA.l FreeItemText : AND.b #$01 : BEQ + ; show message for dungeon small key
LDA.w ScratchBufferV : AND.b #$F0 : CMP.b #$A0 : BNE + ; small key of...
LDA.w ScratchBufferV : CMP.b #$AF : BNE ++ : JMP .skip : ++
LDA.l ScratchBufferV : AND.b #$F0 : CMP.b #$A0 : BNE + ; small key of...
LDA.l ScratchBufferV : CMP.b #$AF : BNE ++ : JMP .skip : ++
%CopyDialog(Notice_SmallKeyOf)
LDA.b #$01 : STA.w ScratchBufferNV ; set up a flip for small keys
LDA.b #$01 : STA.l ScratchBufferNV ; set up a flip for small keys
BRA .dungeon
+ : LDA.l FreeItemText : AND.b #$20 : BEQ + ; show message for crystal
LDA.w ScratchBufferV : CMP.b #$B0 : !BLT + ; crystal #
LDA.l ScratchBufferV : CMP.b #$B0 : !BLT + ; crystal #
CMP.b #$B7 : !BGE +
%CopyDialog(Notice_Crystal)
JMP .crystal
@@ -131,14 +131,14 @@ FreeDungeonItemNotice:
.dungeon
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
LDA.w ScratchBufferV
LDA.l ScratchBufferV
AND.b #$0F
STA.w ScratchBufferNV+1
LDA.w ScratchBufferNV : BEQ +
LDA.w ScratchBufferNV
LDA.b #$0F : !SUB.w ScratchBufferNV+1 : STA.w ScratchBufferNV+1 ; flip the values for small keys
STA.l ScratchBufferNV+1
LDA.l ScratchBufferNV : BEQ +
LDA.l ScratchBufferNV
LDA.b #$0F : !SUB.l ScratchBufferNV+1 : STA.l ScratchBufferNV+1 ; flip the values for small keys
+
LDA.w ScratchBufferNV+1
LDA.l ScratchBufferNV+1
ASL : TAX
REP #$20
LDA.l DungeonItemIDMap,X : CMP.w #$0003 : BCC .hc_sewers
@@ -152,7 +152,7 @@ FreeDungeonItemNotice:
JMP.w .done
+
SEP #$20
LDA.w ScratchBufferNV+1
LDA.l ScratchBufferNV+1
CMP.b #$00 : BNE + ; ...light world
%CopyDialog(Notice_LightWorld) : JMP .done
+ : CMP.b #$01 : BNE + ; ...dark world
@@ -190,7 +190,7 @@ FreeDungeonItemNotice:
.crystal
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
LDA.w ScratchBufferV
LDA.l ScratchBufferV
AND.b #$0F ; looking at low bits only
CMP.b #$00 : BNE +
%CopyDialog(Notice_Six) : JMP .done
@@ -216,8 +216,8 @@ FreeDungeonItemNotice:
;--------------------------------
.skip
PLA : STA.w ScratchBufferNV+1
PLA : STA.w ScratchBufferNV
PLA : STA.l ScratchBufferNV+1
PLA : STA.l ScratchBufferNV
PLA : STA.b Scrap02
REP #$20
PLA : STA.b Scrap00
@@ -234,7 +234,12 @@ RTL
;--------------------------------------------------------------------------------
DialogItemReceive:
BCS .nomessage ; if doubling the item value overflowed it must be a rando item
CPY.b #$98 : BCC ++ ;if the item is $4C or greater it must be a rando item
CPY.b #$98 : BCS .nomessage ; if the item is $4C or greater it must be a rando item
CPY.b #$34 : BEQ .mirror
BRA ++
.mirror
LDA.l MirrorEquipment : AND.w #$00FF
CMP.w #$0002 : BEQ ++
.nomessage
LDA.w #$FFFF

View File

@@ -3,6 +3,9 @@
;--------------------------------------------------------------------------------
SpawnDungeonPrize:
PHX : PHB
TAX
LDA.b $06,S : STA.b ScrapBuffer72 ; Store current RoomTag index
TXA
JSL.l AttemptItemSubstitution
JSL.l ResolveLootIDLong
STA.w ItemReceiptID
@@ -14,6 +17,7 @@ SpawnDungeonPrize:
LDA.w ItemReceiptID
STA.w AncillaGet,X : STA.w SpriteID,X
JSR.w AddDungeonPrizeAncilla
LDX.b ScrapBuffer72 : STZ.b RoomTag,X
.failed_spawn
PLB : PLX
RTL

View File

@@ -155,7 +155,7 @@ JML.l AllowStartFromExitReturn
STZ.b SubSubModule
STZ.w DeathReloadFlag
STZ.w RespawnFlag
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
JSL Equipment_SearchForEquippedItemLong
JSL HUD_RebuildLong2

View File

@@ -22,7 +22,7 @@ JML.l ReturnFromOnDrawHud
OnDungeonEntrance:
STA.l PegColor ; thing we wrote over
JSL MaybeFlagDungeonTotalsEntrance
INC.w UpdateHUDFlag
LDA.w #$0001 : STA.l UpdateHUDFlag
RTL
;--------------------------------------------------------------------------------
OnDungeonBossExit:
@@ -46,7 +46,7 @@ OnDungeonExit:
STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over
PHA : PHP
INC.w UpdateHUDFlag
LDA.w #$0001 : STA.l UpdateHUDFlag
JSL.l HUD_RebuildLong
JSL.l FloodGateResetInner
JSL.l SetSilverBowMode
@@ -123,6 +123,12 @@ OnFileCreation:
MVN CartridgeSRAM>>16, InitSRAMTable>>16
PLB
; initialize rewind table and IFrames
LDA.w #$0014
STA.l IFramesSRAM ; low byte i-frames, high byte rewind trigger
LDA.w #$FFFF
STA.l RewindRoomIdSRAM
; Resolve instant post-aga if standard
SEP #$20
LDA.l InitProgressIndicator : BIT #$80 : BEQ +
@@ -163,6 +169,15 @@ OnFileLoad:
JSL.l RefreshRainAmmo
JSL.l SetEscapeAssist
REP #$20
LDA.l CurrentRupees
CMP.w #50
BCS +
LDA.w #50
STA.l CurrentRupees
+
SEP #$20
LDA.l IsEncrypted : CMP.b #01 : BNE +
JSL LoadStaticDecryptionKey
+
@@ -226,7 +241,7 @@ OnOWTransition:
PHP
SEP #$20 ; set 8-bit accumulator
LDA.b #$FF : STA.l RNGLockIn ; clear lock-in
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
PLP
RTL
;--------------------------------------------------------------------------------
@@ -290,6 +305,16 @@ PostItemAnimation:
INC.b NMICGRAM
SEP #$20
LDA.l RewindTrigger
BEQ +
LDA.b #$19
STA.b $11
STZ.b $B0
LDA.b #$33
STA.w $012E
+
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
PLB
RTL

View File

@@ -299,7 +299,15 @@ DrawPlayerFileShared:
%fs_drawItemBasic(EquipmentSRAM+$12,9,18,FileSelectItems_cape)
; Mirror
%fs_drawItemBasic(EquipmentSRAM+$13,9,20,FileSelectItems_mirror)
LDA.l EquipmentSRAM+$13 : AND.w #$00FF : BNE +
%fs_drawItemGray(9,20,FileSelectItems_mirror)
BRA ++
+ : DEC : BNE +
%fs_drawItem(9,20,FileSelectItems_mirror)
BRA ++
+
%fs_drawItem(9,20,FileSelectItems_mirror_2)
++
; Bottles
%fs_drawBottle(EquipmentSRAM+$1C,3,23)
@@ -390,12 +398,21 @@ DrawPlayerFileShared:
LDA.l HexToDecDigit5 : AND.w #$00FF : ORA.w #!FS_COLOR_BW|$02E0 : %fs_draw8x8(11,27)
; Boots
%fs_drawItemBasic(EquipmentSRAM+$15,3,28,FileSelectItems_boots)
LDA.l EquipmentSRAM+$15 : AND.w #$00FF : BNE +
LDA.l FakeBoots : AND.w #$00FF : BEQ +
%fs_drawItem(3,28,FileSelectItems_fakeBoots)
BRA ++
+
%fs_drawItemBasic(EquipmentSRAM+$15,3,28,FileSelectItems_boots)
++
; Gloves
LDA.l EquipmentSRAM+$14 : AND.w #$00FF : BNE +
%fs_drawItemGray(5,28,FileSelectItems_gloves)
BRA ++
+ : DEC : BNE +
%fs_drawItem(5,28,FileSelectItems_weak_gloves)
BRA ++
+ : DEC : BNE +
%fs_drawItem(5,28,FileSelectItems_gloves)
BRA ++
@@ -537,12 +554,16 @@ FileSelectItems:
dw #$0288|!FS_COLOR_RED, #$0289|!FS_COLOR_RED, #$0298|!FS_COLOR_RED, #$0299|!FS_COLOR_RED
.mirror
dw #$028A|!FS_COLOR_BLUE, #$028B|!FS_COLOR_BLUE, #$029A|!FS_COLOR_BLUE, #$029B|!FS_COLOR_BLUE
.mirror_2
dw #$028A|!FS_COLOR_BLUE, #$028B|!FS_COLOR_BLUE, #$029A|!FS_COLOR_BLUE, #$02E2|!FS_COLOR_BLUE
.flippers
dw #$024E|!FS_COLOR_BLUE, #$024F|!FS_COLOR_BLUE, #$025F|!FS_COLOR_BLUE|!FS_HFLIP, #$025F|!FS_COLOR_BLUE
.boots
dw #$028C|!FS_COLOR_BOOTS, #$028D|!FS_COLOR_BOOTS, #$029C|!FS_COLOR_BOOTS, #$029D|!FS_COLOR_BOOTS
.fakeBoots
dw #$028C|!FS_COLOR_BLUE, #$028D|!FS_COLOR_BLUE, #$029C|!FS_COLOR_BLUE, #$029D|!FS_COLOR_BLUE
.pearl
dw #$02A4|!FS_COLOR_RED, #$02A5|!FS_COLOR_RED, #$02B4|!FS_COLOR_RED, #$02B5|!FS_COLOR_RED
@@ -556,6 +577,8 @@ FileSelectItems:
.red_pendant
dw #$02C5|!FS_COLOR_RED, #$02C6|!FS_COLOR_RED, #$02D5|!FS_COLOR_RED, #$02D6|!FS_COLOR_RED
.weak_gloves
dw #$02A0|!FS_COLOR_GREEN, #$02A1|!FS_COLOR_GREEN, #$02B0|!FS_COLOR_GREEN, #$02B1|!FS_COLOR_GREEN
.gloves
dw #$028E|!FS_COLOR_BROWN, #$028F|!FS_COLOR_BROWN, #$029E|!FS_COLOR_BROWN, #$029F|!FS_COLOR_BROWN
.mitts

View File

@@ -45,9 +45,11 @@ DrawHeartPieceGFX:
LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X
PLA
JSL.l DrawDynamicTile
REP #$21
LDA.b Scrap00
CLC : ADC.b #$04
ADC.w #$0004
STA.b Scrap00
SEP #$20
JSL.l Sprite_DrawShadowLong
BRA .done
+

View File

@@ -1000,7 +1000,7 @@ org $81C517 : JSL.l CheckDungeonCompletion
org $81C523 : JSL.l CheckDungeonCompletion
org $81C710 : JSL.l CheckSpawnPrize
BCS RoomTag_GetHeartForPrize_spawn_prize : BRA RoomTag_GetHeartForPrize_delete_tag
org $81C742 : JSL.l SpawnDungeonPrize
org $81C742 : JSL.l SpawnDungeonPrize : PLA : RTS
org $8799EA : JML.l SetItemPose
org $88C415 : JSL.l PendantMusicCheck
BCS Ancilla22_ItemReceipt_is_pendant : BRA Ancilla22_ItemReceipt_wait_for_music
@@ -1385,9 +1385,9 @@ ReturnFromOnDrawHud:
SEP #$30
LDX.b #$FF ; vanilla hud code ends with #$FF in X, and it's required for unknown reasons.
org $8DFC37 ; <- 6FC37 - headsup_display.asm : 828 (LDA.w #$28F7)
org $8DFC2B ; <- 6FC37 - headsup_display.asm : 828 (LDA.w #$28F7)
JSL DrawMagicHeader
BRA + : NOP #15 : +
BRA + : NOP #27 : +
;--------------------------------------------------------------------------------
org $81CF67 ; <- CF67 - Bank01.asm : 11625 (STA $7EF36F)
JSL DecrementSmallKeys
@@ -1420,7 +1420,7 @@ RebuildHUD_update_long:
JSR.w RebuildHUD_update : RTL
RefreshIcon_UpdateHUD:
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
JSR.w RebuildHUD
JSR.w UpdateEquippedItem
RTS
@@ -1487,8 +1487,9 @@ JSL SpiralStairsPreCheck
org $829069 ; <- A21C A5A0 - Bank02.asm:3081 (LDX.b #$1C : LDA $A0)
JSL SpiralStairsPostCheck
org $82D6E8 ; <- 9C0A01 - Bank02.asm:10811 (STZ $010A)
NOP #3
; this is covered by a hook in rewind.asm
; org $82D6E8 ; <- 9C0A01 - Bank02.asm:10811 (STZ $010A)
; NOP #3
org $88C421 ; <- AD4021 F005 - ancilla_receive_item.asm:108 (LDA $2140 : BEQ .wait_for_music)
JML PendantFanfareWait : NOP

45
iframes.asm Normal file
View File

@@ -0,0 +1,45 @@
pushpc
org $8780B9
JSL CalcIFrames
NOP
pullpc
CalcIFrames:
LDA.l IFrames
STA.w $031F
RTL
DrawIFrames:
LDA.l IFrames
AND.w #$00FF
JSL HexToDec
LDY.w #$16EE
LDA.w #$253B
STA.w $0000, Y
LDA.w #$253C
STA.w $0002, Y
LDA.l HexToDecDigit3
AND.w #$00FF
BEQ +
CLC : ADC.w #$2416
STA.w $003E, Y
+
LDA.l HexToDecDigit4
AND.w #$00FF
BNE +
LDA.w #$0011
+ CLC : ADC.w #$2416
STA.w $0040, Y
LDA.l HexToDecDigit5
AND.w #$00FF
BNE +
LDA.w #$0011
+ CLC : ADC.w #$2416
STA.w $0042, Y
RTL

116
improve_items.asm Normal file
View File

@@ -0,0 +1,116 @@
pushpc
org $8DE4FE
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE514
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE52A
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE540
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE556
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE56C
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE5FF
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE615
JSR.w ItemMenu_DrawEnhanced_Short
org $8DE62B
JSR.w ItemMenu_DrawEnhanced_Short
org $8DFB63
JSL.l GetItemLevelForHud
org $8DFFFB
ItemMenu_DrawEnhanced_Short:
JSL.l ItemMenu_DrawEnhanced
RTS
pullpc
ItemMenu_DrawEnhanced:
LDA.b $02
BEQ +
LDA.w #$0008
+ TAY
LDX.b $00
LDA.b ($04),Y
STA.w $0000,X
INY : INY
LDA.b ($04),Y
STA.w $0002,X
INY : INY
LDA.b ($04),Y
STA.w $0040,X
INY : INY
LDA.b ($04),Y
STA.w $0042,X
RTL
AddMagicMarker:
LDA.w ItemCursor : AND.w #$00FF ; load item value
PHX
TAX
LDA.l CanReduceMagic, X : AND.w #$00FF
BEQ .done
LDA.l EquipmentWRAM-1, X : AND.w #$00FF
DEC : DEC
BMI .done
BEQ .half
.quarter
LDA.w #$3D4C
BRA .write
.half
LDA.w #$3D3F
.write
STA.w $FFC2, Y
LDA.w #$3D37
STA.w $FFC0, Y
.done
PLX
RTL
GetItemLevelForHud:
LDA.l CanReduceMagic, X : AND.w #$00FF
BNE + ; it's already $0001, so we can return
LDA.l EquipmentWRAM-1, X ; normal, what we wrote over
+ RTL
CheckMagicLevel:
PHP : SEP #$30
LDA.w ItemCursor ; load item value
TAX
LDA.l CanReduceMagic, X
BEQ .normal
LDA.l EquipmentWRAM-1, X
DEC : DEC
BMI .normal
BEQ .half
.quarter
LDA.b #$02
BRA .write
.half
LDA.b #$01
BRA .write
.normal
LDA.b #$00
.write
STA.l MagicConsumption
PLP
RTL
CanReduceMagic:
db $00
db $00, $00, $00, $00, $00
db $01, $01, $01, $01, $01
db $01, $00, $00, $00, $00
db $00, $01, $01, $01, $00

View File

@@ -245,10 +245,9 @@ StampItem:
LDA.b [Scrap0B] : BNE .skip
INC.b Scrap0B : INC.b Scrap0B
LDA.b [Scrap0B] : BNE .skip
LDA.l NMIFrames+2 : STA.b [Scrap0B]
DEC.b Scrap0B : DEC.b Scrap0B
LDA.l NMIFrames : STA.b [Scrap0B]
INC.b Scrap0B : INC.b Scrap0B
LDA.l NMIFrames+2 : STA.b [Scrap0B]
.skip
SEP #$20
RTS
@@ -365,7 +364,7 @@ Link_ReceiveItem_HUDRefresh:
+
JSL.l HUD_RefreshIconLong ; thing we wrote over
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
JSL.l PostItemGet
RTL
;--------------------------------------------------------------------------------
@@ -380,7 +379,7 @@ HandleBombAbsorbtion:
LDA.b #$04 : STA.w ItemCursor ; set selected item to bombs
LDA.b #$01 : STA.w CurrentYItem ; set selected item to bombs
JSL.l HUD_RebuildLong
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
+
RTL
;--------------------------------------------------------------------------------
@@ -419,6 +418,8 @@ AddYMarker:
.drawTile
STA.w $FFC4, Y
JSL AddMagicMarker
RTL
;--------------------------------------------------------------------------------
@@ -651,16 +652,24 @@ RTL
; DrawMagicHeader:
;--------------------------------------------------------------------------------
DrawMagicHeader:
LDA.l MagicConsumption : AND.w #$00FF : CMP.w #$0002 : BEQ .quarterMagic
.halfMagic
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2851 : STA.l HUDTileMapBuffer+$06
LDA.w #$28FA : STA.l HUDTileMapBuffer+$08
RTL
.quarterMagic
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2800 : STA.l HUDTileMapBuffer+$06
LDA.w #$2801 : STA.l HUDTileMapBuffer+$08
LDA.l MagicConsumption : AND.w #$00FF
CMP.w #$0000 : BEQ .normalMagic
CMP.w #$0001 : BEQ .halfMagic
BRA .quarterMagic
.normalMagic
LDA.w #$2850 : STA.l HUDTileMapBuffer+$04
LDA.w #$A856 : STA.l HUDTileMapBuffer+$06
LDA.w #$2852 : STA.l HUDTileMapBuffer+$08
RTL
.halfMagic
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2851 : STA.l HUDTileMapBuffer+$06
LDA.w #$28FA : STA.l HUDTileMapBuffer+$08
RTL
.quarterMagic
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2800 : STA.l HUDTileMapBuffer+$06
LDA.w #$2801 : STA.l HUDTileMapBuffer+$08
RTL
;--------------------------------------------------------------------------------

View File

@@ -143,28 +143,28 @@ endmacro
%ReceiptProps($04, -5, 4, $2D, $F35A, $01, fighter_shield, skip) ; 04 - Fighter shield
%ReceiptProps($05, -4, 0, $20, $F35A, $02, red_shield, skip) ; 05 - Fire shield
%ReceiptProps($06, -4, 0, $2E, $F35A, $03, mirror_shield, skip) ; 06 - Mirror shield
%ReceiptProps($07, -5, 4, $09, $F345, $01, skip, skip) ; 07 - Fire rod
%ReceiptProps($08, -5, 4, $09, $F346, $01, skip, skip) ; 08 - Ice rod
%ReceiptProps($07, -5, 4, $09, $F345, $FF, magic_item, skip) ; 07 - Fire rod
%ReceiptProps($08, -5, 4, $09, $F346, $FF, magic_item, skip) ; 08 - Ice rod
%ReceiptProps($09, -4, 4, $0A, $F34B, $01, skip, skip) ; 09 - Hammer
%ReceiptProps($0A, -4, 4, $08, $F342, $01, skip, skip) ; 0A - Hookshot
%ReceiptProps($0B, -4, 4, $05, $F340, $01, bow, skip) ; 0B - Bow
%ReceiptProps($0C, -2, 5, $10, $F341, $01, blue_boomerang, skip) ; 0C - Blue Boomerang
%ReceiptProps($0D, -4, 0, $0B, $F344, $02, powder, skip) ; 0D - Powder
%ReceiptProps($0E, -4, 0, $2C, $F35C, $FF, skip, skip) ; 0E - Bottle refill (bee)
%ReceiptProps($0F, -4, 0, $1B, $F347, $01, skip, skip) ; 0F - Bombos
%ReceiptProps($10, -4, 0, $1A, $F348, $01, skip, skip) ; 10 - Ether
%ReceiptProps($11, -4, 0, $1C, $F349, $01, skip, skip) ; 11 - Quake
%ReceiptProps($12, -4, 0, $14, $F34A, $01, skip, skip) ; 12 - Lamp
%ReceiptProps($0F, -4, 0, $1B, $F347, $FF, magic_item, skip) ; 0F - Bombos
%ReceiptProps($10, -4, 0, $1A, $F348, $FF, magic_item, skip) ; 10 - Ether
%ReceiptProps($11, -4, 0, $1C, $F349, $FF, magic_item, skip) ; 11 - Quake
%ReceiptProps($12, -4, 0, $14, $F34A, $FF, magic_item, skip) ; 12 - Lamp
%ReceiptProps($13, -4, 4, $19, $F34C, $01, shovel, skip) ; 13 - Shovel
%ReceiptProps($14, -4, 0, $0C, $F34C, $02, flute_inactive, skip) ; 14 - Flute
%ReceiptProps($15, -4, 4, $07, $F350, $01, skip, skip) ; 15 - Somaria
%ReceiptProps($15, -4, 4, $07, $F350, $FF, magic_item, skip) ; 15 - Somaria
%ReceiptProps($16, -4, 0, $1D, $F35C, $FF, skip, bottles) ; 16 - Bottle
%ReceiptProps($17, -4, 0, $2F, $F36B, $FF, skip, skip) ; 17 - Heart piece
%ReceiptProps($18, -4, 4, $07, $F351, $01, skip, skip) ; 18 - Byrna
%ReceiptProps($19, -4, 0, $15, $F352, $01, skip, skip) ; 19 - Cape
%ReceiptProps($1A, -4, 0, $12, $F353, $02, skip, skip) ; 1A - Mirror
%ReceiptProps($1B, -4, 0, $0D, $F354, $01, skip, skip) ; 1B - Glove
%ReceiptProps($1C, -4, 0, $0D, $F354, $02, skip, skip) ; 1C - Mitts
%ReceiptProps($18, -4, 4, $07, $F351, $FF, magic_item, skip) ; 18 - Byrna
%ReceiptProps($19, -4, 0, $15, $F352, $FF, magic_item, skip) ; 19 - Cape
%ReceiptProps($1A, -4, 0, $12, $F353, $FF, mirror, skip) ; 1A - Mirror
%ReceiptProps($1B, -4, 0, $0D, $F354, $02, skip, skip) ; 1B - Glove
%ReceiptProps($1C, -4, 0, $0D, $F354, $03, skip, skip) ; 1C - Mitts
%ReceiptProps($1D, -4, 0, $0E, $F34E, $01, skip, skip) ; 1D - Book
%ReceiptProps($1E, -4, 0, $11, $F356, $01, skip, skip) ; 1E - Flippers
%ReceiptProps($1F, -4, 0, $17, $F357, $01, skip, skip) ; 1F - Pearl
@@ -238,7 +238,7 @@ endmacro
%ReceiptProps($63, -4, 0, $FF, $F36A, $FF, skip, rng_multi) ; 63 - RNG pool item (multi)
%ReceiptProps($64, -4, 0, $FF, $F340, $FF, skip, progressive_bow) ; 64 - Progressive bow
%ReceiptProps($65, -4, 0, $FF, $F340, $FF, skip, progressive_bow_2) ; 65 - Progressive bow
%ReceiptProps($66, -4, 0, $FF, $F36A, $FF, skip, skip) ; 66 -
%ReceiptProps($66, -4, 0, $51, $F354, $01, skip, skip) ; 66 - Weak Glove
%ReceiptProps($67, -4, 0, $FF, $F36A, $FF, skip, skip) ; 67 -
%ReceiptProps($68, -4, 0, $FF, $F36A, $FF, skip, skip) ; 68 -
%ReceiptProps($69, -4, 0, $FF, $F36A, $FF, skip, skip) ; 69 -
@@ -320,8 +320,8 @@ endmacro
%ReceiptProps($B5, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B5 - Crystal 4
%ReceiptProps($B6, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B6 - Crystal 3
%ReceiptProps($B7, -4, 0, $49, $F36A, $FF, skip, skip) ; B7 - Reserved
%ReceiptProps($B8, -4, 0, $49, $F36A, $FF, skip, skip) ; B8 -
%ReceiptProps($B9, -4, 0, $49, $F36A, $FF, skip, skip) ; B9 -
%ReceiptProps($B8, -4, 0, $52, $F36A, $FF, teleporter, skip) ; B8 - Teleporter
%ReceiptProps($B9, -4, 0, $53, $F36A, $FF, i_frames, skip) ; B9 - 10 IFrames
%ReceiptProps($BA, -4, 0, $49, $F36A, $FF, skip, skip) ; BA -
%ReceiptProps($BB, -4, 0, $49, $F36A, $FF, skip, skip) ; BB -
%ReceiptProps($BC, -4, 0, $49, $F36A, $FF, skip, skip) ; BC -
@@ -517,7 +517,7 @@ endmacro
%SpriteProps($63, 2, 2, $FF, $FF, $0000) ; 63 - RNG pool item (multi)
%SpriteProps($64, 2, 2, $FF, $FF, $0000) ; 64 - Progressive bow
%SpriteProps($65, 2, 2, $FF, $FF, $0000) ; 65 - Progressive bow
%SpriteProps($66, 2, 2, $00, $00, $0000) ; 66 -
%SpriteProps($66, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; 66 - Weak Glove
%SpriteProps($67, 2, 2, $00, $00, $0000) ; 67 -
%SpriteProps($68, 2, 2, $00, $00, $0000) ; 68 -
%SpriteProps($69, 2, 2, $00, $00, $0000) ; 69 -
@@ -599,8 +599,8 @@ endmacro
%SpriteProps($B5, 2, 2, $80, $80, PalettesCustom_crystal) ; B5 - Crystal 4
%SpriteProps($B6, 2, 2, $80, $80, PalettesCustom_crystal) ; B6 - Crystal 3
%SpriteProps($B7, 2, 2, $80, $80, $0000) ; B7 - Reserved
%SpriteProps($B8, 2, 2, $04, $04, $0000) ; B8 -
%SpriteProps($B9, 2, 2, $04, $04, $0000) ; B9 -
%SpriteProps($B8, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; B8 - Teleporter
%SpriteProps($B9, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; B9 - 10 IFrames
%SpriteProps($BA, 2, 2, $04, $04, $0000) ; BA -
%SpriteProps($BB, 2, 2, $04, $04, $0000) ; BB -
%SpriteProps($BC, 2, 2, $04, $04, $0000) ; BC -
@@ -764,7 +764,7 @@ endmacro
%InventoryItem($46, $0001, $0000, $0000) ; 46 - 300 rupees
%InventoryItem($47, $0001, $0000, $0000) ; 47 - 20 rupees green
%InventoryItem($48, $0085, $0000, $0000) ; 48 - Full bottle (good bee)
%InventoryItem($49, $0081, $0000, $0000) ; 49 - Tossed fighter sword
%InventoryItem($49, $0081, SwordTime, $0000) ; 49 - Tossed fighter sword
%InventoryItem($4A, $0085, FluteTime, $0000) ; 4A - Active Flute
%InventoryItem($4B, $0089, BootsTime, $0000) ; 4B - Boots
%InventoryItem($4C, $0015, $0000, CapacityUpgrades) ; 4C - Bomb capacity (50)
@@ -793,7 +793,7 @@ endmacro
%InventoryItem($63, $0001, $0000, $0000) ; 63 - RNG pool item (multi)
%InventoryItem($64, $00A5, $0000, $0000) ; 64 - Progressive bow
%InventoryItem($65, $00A5, $0000, $0000) ; 65 - Progressive bow
%InventoryItem($66, $0001, $0000, $0000) ; 66 -
%InventoryItem($66, $0089, $0000, $0000) ; 66 - Weak Glove
%InventoryItem($67, $0001, $0000, $0000) ; 67 -
%InventoryItem($68, $0001, $0000, $0000) ; 68 -
%InventoryItem($69, $0001, $0000, $0000) ; 69 -
@@ -875,8 +875,8 @@ endmacro
%InventoryItem($B5, $0080, $0000, $0000) ; B5 - Crystal 4
%InventoryItem($B6, $0080, $0000, $0000) ; B6 - Crystal 3
%InventoryItem($B7, $0000, $0000, $0000) ; B7 - Reserved
%InventoryItem($B8, $0001, $0000, $0000) ; B8 -
%InventoryItem($B9, $0001, $0000, $0000) ; B9 -
%InventoryItem($B8, $0081, $0000, $0000) ; B8 - Teleporter
%InventoryItem($B9, $0081, $0000, $0000) ; B9 - 10 IFrames
%InventoryItem($BA, $0001, $0000, $0000) ; BA -
%InventoryItem($BB, $0001, $0000, $0000) ; BB -
%InventoryItem($BC, $0001, $0000, $0000) ; BC -
@@ -1053,7 +1053,7 @@ ItemReceiptGraphicsOffsets:
dw $0 ; 63 - RNG pool item (multi)
dw $0 ; 64 - Progressive bow
dw $0 ; 65 - Progressive bow
dw $0 ; 66 -
dw $0C60 ; 66 - Weak Glove
dw $0 ; 67 -
dw $0 ; 68 -
dw $0 ; 69 -
@@ -1139,8 +1139,8 @@ ItemReceiptGraphicsOffsets:
dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4
dw BigDecompressionBuffer+$08A0 ; B6 - Crystal 3
dw $0 ; B7 - Reserved
dw $0 ; B8 -
dw $0 ; B9 -
dw $0CE0 ; B8 - Teleporter
dw $0CA0 ; B9 - 10 IFrames
dw $0 ; BA -
dw $0 ; BB -
dw $0 ; BC -
@@ -1323,7 +1323,7 @@ StandingItemGraphicsOffsets:
dw $0 ; 63 - RNG pool item (multi)
dw $0 ; 64 - Progressive bow
dw $0 ; 65 - Progressive bow
dw $0 ; 66 -
dw $0C60 ; 66 - Weak Glove
dw $0 ; 67 -
dw $0 ; 68 -
dw $0 ; 69 -
@@ -1409,8 +1409,8 @@ StandingItemGraphicsOffsets:
dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4
dw BigDecompressionBuffer+$08A0 ; B6 - Crystal 3
dw $0 ; B7 - Reserved
dw $0 ; B8 -
dw $0 ; B9 -
dw $0CE0 ; B8 - Teleporter
dw $0CA0 ; B9 - 10 IFrames
dw $0 ; BA -
dw $0 ; BB -
dw $0 ; BC -

View File

@@ -1,147 +1,149 @@
table "data/textwordcharmap.txt"
org $B28000
; You have found
; the map of
Notice_MapOf:
db $74, $00, $C2, $00, $DE, $00, $E4, $00, $FF, $00, $D7, $00, $D0, $00, $E5, $00, $D4, $00, $FF, $00, $D5, $00, $DE, $00, $E4, $00, $DD, $00, $D3
db $75, $00, $E3, $00, $D7, $00, $D4, $00, $FF, $00, $DC, $00, $D0, $00, $DF, $00, $FF, $00, $DE, $00, $D5
dw #$7F7F
db $74 : dw "You have found"
db $75 : dw "the map of"
dw $7F7F
; You have found
; the compass of
Notice_CompassOf:
db $74, $00, $C2, $00, $DE, $00, $E4, $00, $FF, $00, $D7, $00, $D0, $00, $E5, $00, $D4, $00, $FF, $00, $D5, $00, $DE, $00, $E4, $00, $DD, $00, $D3
db $75, $00, $E3, $00, $D7, $00, $D4, $00, $FF, $00, $D2, $00, $DE, $00, $DC, $00, $DF, $00, $D0, $00, $E2, $00, $E2, $00, $FF, $00, $DE, $00, $D5
dw #$7F7F
db $74 : dw "You have found"
db $75 : dw "the compass of"
dw $7F7F
; Oh look! it's
; the big key of
Notice_BigKeyOf:
db $74, $00, $B8, $00, $D7, $00, $FF, $00, $DB, $00, $DE, $00, $DE, $00, $DA, $00, $C7, $00, $FF, $00, $D8, $00, $E3, $00, $9D, $00, $E2
db $75, $00, $E3, $00, $D7, $00, $D4, $00, $FF, $00, $D1, $00, $D8, $00, $D6, $00, $FF, $00, $DA, $00, $D4, $00, $E8, $00, $FF, $00, $DE, $00, $D5
dw #$7F7F
db $74 : dw "Oh look! it's"
db $75 : dw "the big key of"
dw $7F7F
; this is a
; This is a
; small key to
Notice_SmallKeyOf:
db $74, $00, $BD, $00, $D7, $00, $D8, $00, $E2, $00, $FF, $00, $D8, $00, $E2, $00, $FF, $00, $D0
db $75, $00, $E2, $00, $DC, $00, $D0, $00, $DB, $00, $DB, $00, $FF, $00, $DA, $00, $D4, $00, $E8, $00, $FF, $00, $E3, $00, $DE
dw #$7F7F
db $74 : dw "This is a"
db $75 : dw "small key to"
dw $7F7F
; You picked up
Notice_Crystal:
db $74, $00, $C2, $00, $DE, $00, $E4, $00, $FF, $00, $DF, $00, $D8, $00, $D2, $00, $DA, $00, $D4, $00, $D3, $00, $FF, $00, $E4, $00, $DF
dw $7F7F
db $74 : dw "You picked up"
dw $7F7F
; light world
; Light World
Notice_LightWorld:
db $76, $00, $B5, $00, $D8, $00, $D6, $00, $D7, $00, $E3, $00, $FF, $00, $C0, $00, $DE, $00, $E1, $00, $DB, $00, $D3
dw #$7F7F
db $76 : dw "Light World"
dw $7F7F
; dark world
; Dark World
Notice_DarkWorld:
db $76, $00, $AD, $00, $D0, $00, $E1, $00, $DA, $00, $FF, $00, $C0, $00, $DE, $00, $E1, $00, $DB, $00, $D3
dw #$7F7F
db $76 : dw "Dark World"
dw $7F7F
; Ganons Tower
Notice_GTower:
db $76, $00, $B0, $00, $D0, $00, $DD, $00, $DE, $00, $DD, $00, $E2, $00, $FF, $00, $BD, $00, $DE, $00, $E6, $00, $D4, $00, $E1
dw #$7F7F
db $76 : dw "Ganons Tower"
dw $7F7F
; Turtle Rock
Notice_TRock:
db $76, $00, $BD, $00, $E4, $00, $E1, $00, $E3, $00, $DB, $00, $D4, $00, $FF, $00, $BB, $00, $DE, $00, $D2, $00, $DA
dw #$7F7F
db $76 : dw "Turtle Rock"
dw $7F7F
; Thieves Town
Notice_Thieves:
db $76, $00, $BD, $00, $D7, $00, $D8, $00, $D4, $00, $E5, $00, $D4, $00, $E2, $00, $FF, $00, $BD, $00, $DE, $00, $E6, $00, $DD
dw #$7F7F
db $76 : dw "Thieves Town"
dw $7F7F
; Tower of Hera
Notice_Hera:
db $76, $00, $BD, $00, $DE, $00, $E6, $00, $D4, $00, $E1, $00, $FF, $00, $DE, $00, $D5, $00, $FF, $00, $B1, $00, $D4, $00, $E1, $00, $D0
dw #$7F7F
db $76 : dw "Tower of Hera"
dw $7F7F
; Ice Palace
Notice_Ice:
db $76, $00, $B2, $00, $D2, $00, $D4, $00, $FF, $00, $B9, $00, $D0, $00, $DB, $00, $D0, $00, $D2, $00, $D4
dw #$7F7F
db $76 : dw "Ice Palace"
dw $7F7F
; Skull Woods
Notice_Skull:
db $76, $00, $BC, $00, $DA, $00, $E4, $00, $DB, $00, $DB, $00, $FF, $00, $C0, $00, $DE, $00, $DE, $00, $D3, $00, $E2
dw #$7F7F
db $76 : dw "Skull Woods"
dw $7F7F
; Misery Mire
Notice_Mire:
db $76, $00, $B6, $00, $D8, $00, $E2, $00, $D4, $00, $E1, $00, $E8, $00, $FF, $00, $B6, $00, $D8, $00, $E1, $00, $D4
dw #$7F7F
db $76 : dw "Misery Mire"
dw $7F7F
; Dark Palace
Notice_PoD:
db $76, $00, $AD, $00, $D0, $00, $E1, $00, $DA, $00, $FF, $00, $B9, $00, $D0, $00, $DB, $00, $D0, $00, $D2, $00, $D4
dw #$7F7F
db $76 : dw "Dark Palace"
dw $7F7F
; Swamp Palace
Notice_Swamp:
db $76, $00, $BC, $00, $E6, $00, $D0, $00, $DC, $00, $DF, $00, $FF, $00, $B9, $00, $D0, $00, $DB, $00, $D0, $00, $D2, $00, $D4
dw #$7F7F
db $76 : dw "Swamp Palace"
dw $7F7F
; Castle Tower
Notice_AgaTower:
db $76, $00, $AC, $00, $D0, $00, $E2, $00, $E3, $00, $DB, $00, $D4, $00, $FF, $00, $BD, $00, $DE, $00, $E6, $00, $D4, $00, $E1
dw #$7F7F
db $76 : dw "Castle Tower"
dw $7F7F
; Desert Palace
Notice_Desert:
db $76, $00, $AD, $00, $D4, $00, $E2, $00, $D4, $00, $E1, $00, $E3, $00, $FF, $00, $B9, $00, $D0, $00, $DB, $00, $D0, $00, $D2, $00, $D4
dw #$7F7F
db $76 : dw "Desert Palace"
dw $7F7F
; Eastern Palace
Notice_Eastern:
db $76, $00, $AE, $00, $D0, $00, $E2, $00, $E3, $00, $D4, $00, $E1, $00, $DD, $00, $FF, $00, $B9, $00, $D0, $00, $DB, $00, $D0, $00, $D2, $00, $D4
dw #$7F7F
db $76 : dw "Eastern Palace"
dw $7F7F
; Hyrule Castle
Notice_Castle:
db $76, $00, $B1, $00, $E8, $00, $E1, $00, $E4, $00, $DB, $00, $D4, $00, $FF, $00, $AC, $00, $D0, $00, $E2, $00, $E3, $00, $DB, $00, $D4
dw #$7F7F
db $76 : dw "Hyrule Castle"
dw $7F7F
; Hyrule Castle
Notice_Sewers:
db $76, $00, $B1, $00, $E8, $00, $E1, $00, $E4, $00, $DB, $00, $D4, $00, $FF, $00, $AC, $00, $D0, $00, $E2, $00, $E3, $00, $DB, $00, $D4
dw #$7F7F
db $76 : dw "Hyrule Castle"
dw $7F7F
; This Dungeon
Notice_Self:
db $76, $00, $E3, $00, $D7, $00, $D8, $00, $E2, $00, $FF, $00, $D3, $00, $E4, $00, $DD, $00, $D6, $00, $D4, $00, $DE, $00, $Dd
dw #$7F7F
db $76 : dw "this dungeon"
dw $7F7F
; Crystal numbers
Notice_One:
db $75, $00, $D2, $00, $E1, $00, $E8, $00, $E2, $00, $E3, $00, $D0, $00, $DB, $00, $FF, $00, $DE, $00, $DD, $00, $D4
dw #$7F7F
db $75 : dw "crystal one"
dw $7F7F
Notice_Two:
db $75, $00, $D2, $00, $E1, $00, $E8, $00, $E2, $00, $E3, $00, $D0, $00, $DB, $00, $FF, $00, $E3, $00, $E6, $00, $DE
dw #$7F7F
db $75 : dw "crystal two"
dw $7F7F
Notice_Three:
db $75, $00, $D2, $00, $E1, $00, $E8, $00, $E2, $00, $E3, $00, $D0, $00, $DB, $00, $FF, $00, $E3, $00, $D7, $00, $E1, $00, $D4, $00, $D4
dw #$7F7F
db $75 : dw "crystal three"
dw $7F7F
Notice_Four:
db $75, $00, $D2, $00, $E1, $00, $E8, $00, $E2, $00, $E3, $00, $D0, $00, $DB, $00, $FF, $00, $D5, $00, $DE, $00, $E4, $00, $E1
dw #$7F7F
db $75 : dw "crystal four"
dw $7F7F
Notice_Five:
db $75, $00, $D2, $00, $E1, $00, $E8, $00, $E2, $00, $E3, $00, $D0, $00, $DB, $00, $FF, $00, $D5, $00, $D8, $00, $E5, $00, $D4
dw #$7F7F
db $75 : dw "crystal five"
dw $7F7F
Notice_Six:
db $75, $00, $D2, $00, $E1, $00, $E8, $00, $E2, $00, $E3, $00, $D0, $00, $DB, $00, $FF, $00, $E2, $00, $D8, $00, $E7
dw #$7F7F
db $75 : dw "crystal six"
dw $7F7F
Notice_Seven:
db $75, $00, $D2, $00, $E1, $00, $E8, $00, $E2, $00, $E3, $00, $D0, $00, $DB, $00, $FF, $00, $E2, $00, $D4, $00, $E5, $00, $D4, $00, $DD
dw #$7F7F
db $75 : dw "crystal seven"
dw $7F7F

51
lift.asm Normal file
View File

@@ -0,0 +1,51 @@
pushpc
org $87D35E
db $01, $02, $01, $01, $03, $02, $03
org $8DF809
MenuEquipmentIcons:
.gloves
dw $2121, $2122, $2123, $2124 ; No glove
dw $3CDA, $3CDB, $3CEA, $3CEB ; Weak glove
dw $2130, $2131, $2140, $2141 ; Power glove
dw $28DA, $28DB, $28EA, $28EB ; Titan's mitt
.boots
dw $20F5, $20F5, $20F5, $20F5 ; No boots
dw $3429, $342A, $342B, $342C ; Pegasus boots
.flippers
dw $20F5, $20F5, $20F5, $20F5 ; No flippers
dw $2C9A, $2C9B, $2C9D, $2C9E ; Flippers
.pearl
dw $20F5, $20F5, $20F5, $20F5 ; No pearl
dw $2433, $2434, $2435, $2436 ; Moon pearl
org $8DE7C7
LDA.w #MenuEquipmentIcons_gloves
org $8DE7DD
LDA.w #MenuEquipmentIcons_boots
org $8DE7F3
LDA.w #MenuEquipmentIcons_flippers
org $8DECF9
LDA.w #MenuEquipmentIcons_pearl
org $8DFADB
dw MenuEquipmentIcons_gloves
dw MenuEquipmentIcons_boots
dw MenuEquipmentIcons_flippers
dw MenuEquipmentIcons_pearl
pullpc
LoadModifiedGloveValue:
LDA.l GloveEquipment : AND.w #$00FF
BEQ .done
DEC
.done
RTL

17
mothula.asm Normal file
View File

@@ -0,0 +1,17 @@
pushpc
org $9EBF01 ; z_speed
db 2, -2
org $9EBF03 ; y_speed and x_speed
db -32, -24, 0, 24, 32, 24, 0, -24, -32, -24
org $9EBFD3 ; beam speeds
db -24, 0, 24
db 36, 48, 36
org $9EBD6E ; spike max speed and acceleration
db 64, -64, 0, 0, 64, -64
db 2, -2, 0, 0, 2, -2
pullpc

90
msu.asm
View File

@@ -164,27 +164,27 @@ CheckMusicLoadRequest:
.continue
LDA.l TournamentSeed : BNE +++
LDA.w MSUPackRequest
CMP.w MSUPackCurrent : BEQ +++
CMP.w MSUPackCount : !BLT ++
LDA.l MSUPackRequest
CMP.l MSUPackCurrent : BEQ +++
CMP.l MSUPackCount : !BLT ++
CMP.b #$FE : !BLT +
STA.w MSUPackCurrent
STA.l MSUPackCurrent
SEP #$10
LDA.b #$00
LDX.b #$07
-
STA.w MSUFallbackTable,X
STA.l MSUFallbackTable,X
DEX : BPL -
REP #$10
BRA +++
+ : LDA.w MSUPackCurrent : STA.w MSUPackRequest
++ : STA.w MSUPackCurrent
+ : LDA.l MSUPackCurrent : STA.l MSUPackRequest
++ : STA.l MSUPackCurrent
JSL MSUInit_check_fallback
+++
LDA.w MusicControlRequest : CMP.b #$08 : BEQ ++ ; Mirror SFX is not affected by NoBGM or pack $FE
LDA.l NoBGM : BNE +
LDA.w MSUPackCurrent : CMP.b #$FE : BNE ++
LDA.l MSUPackCurrent : CMP.b #$FE : BNE ++
+ : JMP .mute
++
@@ -240,7 +240,7 @@ CheckMusicLoadRequest:
LDA.l MusicShuffleTable-1,X : DEC : PHA
AND.b #$07 : TAY
PLA : LSR #3 : TAX
LDA.w MSUFallbackTable,X : BEQ .secondary_fallback : CMP.b #$FF : BEQ .mute
LDA.l MSUFallbackTable,X : BEQ .secondary_fallback : CMP.b #$FF : BEQ .mute
- : CPY #$00 : BEQ +
LSR : DEY : BRA -
@@ -348,7 +348,7 @@ SpiralStairsPreCheck:
+
LDA.l BigKeyField : AND.w #$0004 : BEQ .done ; Check that we have the GT big key
LDA.w MSUFallbackTable+7 : AND.w #$0004 : BEQ .done ; Check that we have the extended track
LDA.l MSUFallbackTable+7 : AND.w #$0004 : BEQ .done ; Check that we have the extended track
.fade
LDX.b #$F1 : STX.w MusicControlRequest
@@ -401,10 +401,10 @@ MSUInit:
PHP
LDA.b #$00
STA.w MSULoadedTrack
STA.w MSUResumeTrack
STA.w MSUResumeTime : STA.w MSUResumeTime+1 : STA.w MSUResumeTime+2 : STA.w MSUResumeTime+3
STA.w MSUResumeControl
STA.l MSULoadedTrack
STA.l MSUResumeTrack
STA.l MSUResumeTime : STA.l MSUResumeTime+1 : STA.l MSUResumeTime+2 : STA.l MSUResumeTime+3
STA.l MSUResumeControl
LDA.l NoBGM : BNE .done
@@ -431,7 +431,7 @@ MSUInit:
.wait_pack
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_AUDIO_BUSY : BNE .wait_pack
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_TRACK_MISSING : BEQ .check_pack
TXA : STA.w MSUPackCount
TXA : STA.l MSUPackCount
BRA +
; Check the current MSU-1 pack for tracks that require SPC fallback
@@ -453,7 +453,7 @@ MSUInit:
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_TRACK_MISSING : BNE +
SEC
+
LDA.w MSUFallbackTable,X : ROL : STA.w MSUFallbackTable,X
LDA.l MSUFallbackTable,X : ROL : STA.l MSUFallbackTable,X
DEY : BPL .next_track
DEX : BPL +
@@ -474,11 +474,11 @@ MSUInit:
;--------------------------------------------------------------------------------
MSUStopPlaying:
PHA : XBA : PHA
LDA.w MSULoadedTrack
LDA.l MSULoadedTrack
JSR IsResumableTrack : BCC +
; dont save if we already saved recently
REP #$20
LDA.w MSUResumeTrack : AND #$00FF : BEQ ++
LDA.l MSUResumeTrack : AND #$00FF : BEQ ++
LDA.l NMIFrames : !SUB MSUResumeTime : PHA
LDA.l NMIFrames+2 : SBC MSUResumeTime+2 : BNE +++
PLA : CMP.l MSUResumeTimer : !BLT .too_early
@@ -487,12 +487,12 @@ PHA : XBA : PHA
PLA
++
; saving
LDA.l NMIFrames : STA.w MSUResumeTime
LDA.l NMIFrames+2 : STA.w MSUResumeTime+2
LDA.l NMIFrames : STA.l MSUResumeTime
LDA.l NMIFrames+2 : STA.l MSUResumeTime+2
SEP #$20
LDA.w MSULoadedTrack : STA.w MSUResumeTrack
LDA.b #$00 : STA.w MSULoadedTrack ; dont take this path if we're calling again
LDA.l MSULoadedTrack : STA.l MSUResumeTrack
LDA.b #$00 : STA.l MSULoadedTrack ; dont take this path if we're calling again
LDA.b #!FLAG_MSU_RESUME : STA.w MSUCTL ; save this track's position
PLA : XBA : PLA
RTS
@@ -523,23 +523,23 @@ MSUMain:
LDX.w MusicControl : BEQ +
JMP .command_ff
+
LDA.w MSUDelayedCommand : BEQ .do_fade
LDA.l MSUDelayedCommand : BEQ .do_fade
.check_busy
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_AUDIO_BUSY : BNE -
.ready
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_TRACK_MISSING : BNE -
.start
LDA.w MSUResumeControl : BIT.b #!FLAG_RESUME_CANCEL : BEQ +
EOR.b #!FLAG_RESUME_CANCEL : STA.w MSUResumeControl
REP #$20 : LDA.w MSULoadedTrack : STA.w MSUTRACK : SEP #$20
LDA.l MSUResumeControl : BIT.b #!FLAG_RESUME_CANCEL : BEQ +
EOR.b #!FLAG_RESUME_CANCEL : STA.l MSUResumeControl
REP #$20 : LDA.l MSULoadedTrack : STA.w MSUTRACK : SEP #$20
BRA -
+
LDA.b #!VAL_VOLUME_FULL
STA.w TargetVolume
LDA.w MSUResumeControl : BIT.b #!FLAG_RESUME_FADEIN : BEQ +
EOR.b #!FLAG_RESUME_FADEIN : STA.w MSUResumeControl
LDA.l MSUResumeControl : BIT.b #!FLAG_RESUME_FADEIN : BEQ +
EOR.b #!FLAG_RESUME_FADEIN : STA.l MSUResumeControl
LDA.b #$00
BRA ++
+
@@ -551,17 +551,17 @@ MSUMain:
LDA.w CurrentMSUTrack : DEC : PHA
AND.b #$07 : TAY
PLA : LSR #3 : TAX
LDA.w MSUFallbackTable,X : BEQ +++ : CMP.b #$FF : BEQ ++
LDA.l MSUFallbackTable,X : BEQ +++ : CMP.b #$FF : BEQ ++
- : CPY #$00 : BEQ +
LSR : DEY : BRA -
+
AND.b #$01 : BEQ +++
++ : LDA.w MSUDelayedCommand
++ : LDA.l MSUDelayedCommand
+++ : STA.w MSUCTL
LDA.b #$00
STA.w MSUDelayedCommand
STA.l MSUDelayedCommand
JML SPCContinue
.do_fade:
@@ -624,9 +624,9 @@ MSUMain:
+
CPX.w CurrentControlRequest : BEQ -
LDA.b #$00 : XBA
LDA.w MSUPackCurrent : BEQ +
- : CMP.w MSUPackCount : !BLT +
!SUB.w MSUPackCount : BRA -
LDA.l MSUPackCurrent : BEQ +
- : CMP.l MSUPackCount : !BLT +
!SUB.l MSUPackCount : BRA -
+
JSR MSUStopPlaying
@@ -639,11 +639,11 @@ MSUMain:
DEX : BNE -
+
STA.w MSUTRACK
STA.w MSULoadedTrack
STA.l MSULoadedTrack
SEP #$20
PLX
TXA : CMP.w MSUResumeTrack : BNE + ; dont resume if too late
TXA : CMP.l MSUResumeTrack : BNE + ; dont resume if too late
REP #$20
LDA.l NMIFrames : !SUB MSUResumeTime : PHA
LDA.l NMIFrames+2 : SBC MSUResumeTime+2 : BNE ++
@@ -656,8 +656,8 @@ MSUMain:
SEP #$20
LDA.b #!FLAG_RESUME_CANCEL
.done_resume:
STA.w MSUResumeControl
LDA.b #$00 : STA.w MSUResumeTrack
STA.l MSUResumeControl
LDA.b #$00 : STA.l MSUResumeTrack
+
CPX #07 : BNE + ; Kakariko Village
LDA.b GameMode : CMP #$07 : BNE +
@@ -667,12 +667,12 @@ MSUMain:
+
TXA
++
STA.w MSULoadedTrack
STA.l MSULoadedTrack
STX.w CurrentMSUTrack
LDA.w MSUPackCurrent : CMP #$FE : !BLT +
LDA.l MSUPackCurrent : CMP #$FE : !BLT +
LDA.b #$00 : BRA ++
+ : LDA.l MSUTrackList-1,X
++ : STA.w MSUDelayedCommand
++ : STA.l MSUDelayedCommand
LDA.l MSUExtendedFallbackList-1,X
CMP.b #17 : BEQ +
CMP.b #22 : BEQ +
@@ -722,9 +722,9 @@ PendantFanfareWait:
LDA.w MSUID+2 : CMP.w #!VAL_MSU_ID_23 : BNE .spc
LDA.w MSUID+4 : CMP.w #!VAL_MSU_ID_45 : BNE .spc
SEP #$20
LDA.w MSUPackCurrent : CMP #$FE : !BGE .spc
LDA.l MSUPackCurrent : CMP #$FE : !BGE .spc
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_TRACK_MISSING : BNE .spc
LDA.w MSUDelayedCommand : BNE .continue
LDA.l MSUDelayedCommand : BNE .continue
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_AUDIO_PLAYING : BEQ .done
.continue
jml PendantFanfareContinue
@@ -746,9 +746,9 @@ CrystalFanfareWait:
LDA.w MSUID+2 : CMP.w #!VAL_MSU_ID_23 : BNE .spc
LDA.w MSUID+4 : CMP.w #!VAL_MSU_ID_45 : BNE .spc
SEP #$20
LDA.w MSUPackCurrent : CMP.b #$FE : !BGE .spc
LDA.l MSUPackCurrent : CMP.b #$FE : !BGE .spc
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_TRACK_MISSING : BNE .spc
LDA.w MSUDelayedCommand : BNE .continue
LDA.l MSUDelayedCommand : BNE .continue
LDA.w MSUSTATUS : BIT.b #!FLAG_MSU_STATUS_AUDIO_PLAYING : BEQ .done
.continue
jml CrystalFanfareContinue

View File

@@ -65,7 +65,7 @@ NewHUD_DrawArrows:
;================================================================================
NewHUD_DrawGoal:
REP #$20
LDA.w UpdateHUDFlag : BEQ .no_goal
LDA.l UpdateHUDFlag : BEQ .no_goal
LDA.l GoalItemRequirement : BEQ .no_goal
LDA.l GoalItemIcon : STA.w HUDGoalIndicator
@@ -122,7 +122,7 @@ NewHUD_DrawKeys:
;================================================================================
NewHUD_DrawDungeonCounters:
LDA.w UpdateHUDFlag : BEQ NewHUD_DrawPrizeIcon
LDA.l UpdateHUDFlag : BEQ NewHUD_DrawPrizeIcon
LDA.l CompassMode : ORA.l MapHUDMode : BIT.b #$03 : BEQ NewHUD_DrawPrizeIcon
LDX.b IndoorsFlag : BNE +
JMP.w NewHUD_DrawMagicMeter
@@ -147,7 +147,7 @@ NewHUD_DrawPrizeIcon:
LDA.b GameMode
CMP.b #$12 : BEQ .no_prize
CMP.b #$0E : BEQ +
LDA.w UpdateHUDFlag : BEQ NewHUD_DrawItemCounter
LDA.l UpdateHUDFlag : BEQ NewHUD_DrawItemCounter
+
LDA.w DungeonID
CMP.b #$1A : BCS .no_prize
@@ -197,7 +197,7 @@ NewHUD_DrawPrizeIcon:
;================================================================================
NewHUD_DrawItemCounter:
REP #$20
LDA.w UpdateHUDFlag : BEQ NewHUD_DrawMagicMeter
LDA.l UpdateHUDFlag : BEQ NewHUD_DrawMagicMeter
LDA.l ItemCounterHUD : AND.w #$00FF : BEQ NewHUD_DrawMagicMeter
LDA.w #!SlashTile : STA.w HUDGoalIndicator+$08
LDA.l TotalItemCount : CMP.w #1000 : BCS .item_four_digits
@@ -263,7 +263,7 @@ NewHUD_DrawMagicMeter:
;================================================================================
NewHUD_DoneDrawing:
STZ.w UpdateHUDFlag
LDA.w #$0000 : STA.l UpdateHUDFlag
PLB
RTL

View File

@@ -360,6 +360,27 @@ ItemBehavior:
LDA.b #70 : STA.l ArrowsFiller ; fill arrows
RTS
.magic_item
LDA.b #$7E
STA.b $02
REP #$30
LDA.w ItemReceipts_target, X
STA.b $00
SEP #$30
LDA.b [$00]
CMP.b #$03
BCS +
INC
STA.b [$00]
+
RTS
.mirror
LDA.l MirrorEquipment : CMP.b #$02 : !BGE +
INC : STA.l MirrorEquipment ; upgrade mirror
+
RTS
.magic_2
LDA.l MagicConsumption : CMP.b #$02 : !BGE +
INC : STA.l MagicConsumption ; upgrade magic
@@ -429,7 +450,7 @@ ItemBehavior:
.single_arrow
LDA.l ArrowMode : BEQ +
LDA.l CurrentArrows : INC : STA.l CurrentArrows ; Should be sole write to this address
INC.w UpdateHUDFlag ; in retro/rupee bow mode.
LDA.b #$01 : STA.l UpdateHUDFlag ; in retro/rupee bow mode.
+
RTS
@@ -660,6 +681,28 @@ ItemBehavior:
.done
RTS
.teleporter
REP #$20 ; set 16-bit accumulator
LDA.l RewindRoomId
CMP.w #$FFFF
BEQ +
; restore
SEP #$20
LDA.b #$01
STA.l RewindTrigger
RTS
; save
+
JSL.l SaveRewind
SEP #$20
RTS
.i_frames
LDA.l IFrames
CLC : ADC.b #10
STA.l IFrames
RTS
ResolveReceipt:
PHA : PHX
PHK : PLB
@@ -765,7 +808,7 @@ ResolveLootID:
LDA.w .gloves_ids,X
JMP.w .have_item
..ids
db $1B, $1C, $1C
db $66, $1B, $1C, $1C
.progressive_bow
; For non-chest progressive bows we assign the tracking bits to SpriteMetaData,X
@@ -806,15 +849,15 @@ ResolveLootID:
JMP.w .have_item
.rng_single
JSL.l GetRNGItemSingle : STA.w ScratchBufferV+6
JSL.l GetRNGItemSingle : STA.l ScratchBufferV+6
XBA : JSR.w MarkRNGItemSingle
LDA.b #$FF : STA.l RNGLockIn ; clear lock-in
LDA.w ScratchBufferV+6 : JMP.w .get_item
LDA.l ScratchBufferV+6 : JMP.w .get_item
.rng_multi
JSL.l GetRNGItemMulti : STA.w ScratchBufferV+6
JSL.l GetRNGItemMulti : STA.l ScratchBufferV+6
LDA.b #$FF : STA.l RNGLockIn ; clear lock-in
LDA.w ScratchBufferV+6 : JMP.w .get_item
LDA.l ScratchBufferV+6 : JMP.w .get_item
;--------------------------------------------------------------------------------
DungeonItemMasks:
@@ -869,7 +912,7 @@ HandleBowTracking:
; at this point.
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ +
LDX.w CurrentSpriteSlot
LDA.w SpriteMetaData,X : BEQ +
LDA.w SpriteMetaData,X : BEQ .done
BRA .done
+
LDA.b #$00
@@ -881,6 +924,8 @@ RTS
;--------------------------------------------------------------------------------
;Return BowEquipment but also draw silver arrows if you have the upgrade even if you don't have the bow
CheckHUDSilverArrows:
JSL.l CheckMagicLevel
LDA.l ArrowMode : BNE .rupee_bow
LDA.l BowEquipment : TAX : BEQ .nobow
JSL.l DrawHUDArrows_normal
@@ -939,32 +984,32 @@ GetRNGItemSingle:
CMP.l RNGSingleTableSize : !BGE .single_reroll
+++
STA.w ScratchBufferV ; put our index value here
STA.l ScratchBufferV ; put our index value here
LDX.b #$00
TAY
.recheck
TYA
JSR.w CheckSingleItem : BEQ .single_unused ; already used
LDA.w ScratchBufferV : INC ; increment index
LDA.l ScratchBufferV : INC ; increment index
CMP.l RNGSingleTableSize : BCC +++ : LDA.b #$00 : +++ ; rollover index if needed
STA.w ScratchBufferV ; store index
STA.l ScratchBufferV ; store index
INX : TAY : TXA : CMP.l RNGSingleTableSize : BCC .recheck
LDA.b #$5A ; everything is gone, default to null item - MAKE THIS AN OPTION FOR THIS AND THE OTHER ONE
BRA .single_done
.single_unused
LDA.w ScratchBufferV
LDA.l ScratchBufferV
.single_done
TAX : LDA.l RNGSingleItemTable, X
XBA : LDA.w ScratchBufferV : STA.l RNGLockIn : XBA
XBA : LDA.l ScratchBufferV : STA.l RNGLockIn : XBA
PLY
RTL
;--------------------------------------------------------------------------------
CheckSingleItem:
LSR #3 : TAX
LDA.l RNGItem, X : STA.w ScratchBufferV+2 ; load value to temporary
LDA.l RNGItem, X : STA.l ScratchBufferV+2 ; load value to temporary
PHX
LDA.w ScratchBufferV : AND.b #$07 : TAX ; load 0-7 part into X
LDA.w ScratchBufferV+2
LDA.l ScratchBufferV : AND.b #$07 : TAX ; load 0-7 part into X
LDA.l ScratchBufferV+2
---
CPX.b #$00 : BEQ +++
LSR
@@ -976,10 +1021,10 @@ CheckSingleItem:
RTS
;--------------------------------------------------------------------------------
MarkRNGItemSingle:
LSR #3 : STA.w ScratchBufferV+1 : TAX
LSR #3 : STA.l ScratchBufferV+1 : TAX
LDA.l RNGItem, X
STA.w ScratchBufferV+2
LDA.w ScratchBufferV : AND.b #$07 : TAX ; load 0-7 part into X
STA.l ScratchBufferV+2
LDA.l ScratchBufferV : AND.b #$07 : TAX ; load 0-7 part into X
LDA.b #01
---
CPX.b #$00 : BEQ +++
@@ -989,9 +1034,9 @@ MarkRNGItemSingle:
+++
PHA
LDA.w ScratchBufferV+1 : TAX
LDA.l ScratchBufferV+1 : TAX
PLA
ORA.w ScratchBufferV+2
ORA.l ScratchBufferV+2
STA.l RNGItem, X
RTS
;--------------------------------------------------------------------------------

View File

@@ -17,7 +17,7 @@ RTL
;================================================================================
HUDRebuildIndoorHole:
PHA
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
LDA.l GenericKeys : BEQ .normal
.generic
PLA
@@ -30,7 +30,7 @@ RTL
RTL
;================================================================================
HUDRebuildIndoor:
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
LDA.l GenericKeys : BEQ .normal
.generic
LDA.b #$00 : STA.l RoomDarkness
@@ -602,6 +602,8 @@ RestoreMenu_SetSubModule:
RTL
;-------------------------------------------------------------------------------
DrawHeartPiecesMenu:
JSL DrawIFrames
LDA.l HUDHeartColors_index : AND.w #$00FF
ASL : TAX
LDA.l HUDHeartColors_masks_game_hud,X
@@ -609,7 +611,7 @@ DrawHeartPiecesMenu:
LDA.l HeartPieceQuarter : AND.w #$00FF
ASL #3 : TAX
LDY.w #$16F2
LDY.w #$16F6
LDA.l HeartPieceMenuBaseTiles,X
ORA.b Scrap0D

View File

@@ -10,7 +10,7 @@ QuickSwap:
LDA.l QuickSwapFlag : BEQ .done
LDA.w ItemCursor : BEQ .done ; Skip everything if we don't have any items
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
LDY.b #$14
PHX
XBA ; restore the stashed value
@@ -83,10 +83,13 @@ LCode:
RTS
IsItemAvailable:
LDA.l InfiniteBombs : BEQ .finite
.infinite
CPX.b #$04 : BNE .finite
LDA.b #$01 : RTL
.finite
LDA.l EquipmentWRAM-1, X
CPX.b #$14 : BNE .not_mirror
LDA.b #$01 : RTL
.not_mirror
LDA.l InfiniteBombs : BEQ .finite
.infinite
CPX.b #$04 : BNE .finite
LDA.b #$01 : RTL
.finite
LDA.l EquipmentWRAM-1, X
RTL

82
ram.asm
View File

@@ -376,6 +376,13 @@ SpriteCoordCacheY = $7E0FDA ;
;
NoMenu = $7E0FFC ; When set prevents menu, mirror, medallions
;
;===================================================================================================
;===================================================================================================
; DO NOT ADD ANY RANDOMIZER VARIABLES TO THE SPACE FROM $1100 to $1FFF
;---------------------------------------------------------------------------------------------------
; It causes isses with major glitches
;===================================================================================================
;===================================================================================================
GFXStripes = $7E1000 ; Used by stripes for arbitrary VRAM transfers. $100 bytes.
RoomStripes = $7E1100 ; Used for room drawing.
;
@@ -388,26 +395,7 @@ DelayTimer = $7E1CE9 ;
;
TextID = $7E1CF0 ; Message ID and page. Word length.
;
UpdateHUDFlag = $7E1E03 ; Flag used to mark HUD updates and avoid heavy code segments.
;
ToastBuffer = $7E1E0E ; Multiworld buffer. Word length.
;
MSUResumeTime = $7E1E6B ; Mirrored MSU block
MSUResumeControl = $7E1E6F ;
MSUFallbackTable = $7E1E70 ;
MSUDelayedCommand = $7E1E79 ;
MSUPackCount = $7E1E7A ;
MSUPackCurrent = $7E1E7B ;
MSUPackRequest = $7E1E7C ;
MSULoadedTrack = $7E1E7D ;
MSUResumeTrack = $7E1E7F ;
ClockHours = $7E1E90 ; Clock Hours
ClockMinutes = $7E1E94 ; Clock Minutes
ClockSeconds = $7E1E98 ; Clock Seconds
ClockBuffer = $7E1E9C ; Clock Temporary
ScratchBufferNV = $7E1EA0 ; Non-volatile scratch buffer. Must preserve values through return.
ScratchBufferV = $7E1EB0 ; Volatile scratch buffer. Can clobber at will.
;================================================================================
; UNMIRRORED WRAM
@@ -419,6 +407,28 @@ TileUploadBuffer = $7EA180 ; 0x300 bytes
;
ItemGetGFX = $7EBD40 ; Item receipt graphics location
;
UpdateHUDFlag = $7EBE00 ; Flag used to mark HUD updates and avoid heavy code segments.
;
ToastBuffer = $7EBE02 ; Multiworld buffer. Word length.
;
MSUResumeTime = $7EBE6B ; Mirrored MSU block
MSUResumeControl = $7EBE6F ;
MSUFallbackTable = $7EBE70 ;
MSUDelayedCommand = $7EBE79 ;
MSUPackCount = $7EBE7A ;
MSUPackCurrent = $7EBE7B ;
MSUPackRequest = $7EBE7C ;
MSULoadedTrack = $7EBE7D ;
MSUResumeTrack = $7EBE7F ;
ClockHours = $7EBE90 ; Clock Hours
ClockMinutes = $7EBE94 ; Clock Minutes
ClockSeconds = $7EBE98 ; Clock Seconds
ClockBuffer = $7EBE9C ; Clock Temporary
ScratchBufferNV = $7EBEA0 ; Non-volatile scratch buffer. Must preserve values through return.
ScratchBufferV = $7EBEB0 ; Volatile scratch buffer. Can clobber at will.
RoomFade = $7EC005 ; Flags fade to black on room transitions. Word length.
FadeTimer = $7EC007 ; Timer for transition fading and mosaics. Word length.
FadeDirection = $7EC009 ; Word length
@@ -861,23 +871,23 @@ endmacro
%assertRAM(MessageSubModule, $7E1CD8)
%assertRAM(MessageCursor, $7E1CE8)
%assertRAM(DelayTimer, $7E1CE9)
%assertRAM(TextID, $7E1CF0)
%assertRAM(ToastBuffer, $7E1E0E)
%assertRAM(MSUResumeTime, $7E1E6B)
%assertRAM(MSUResumeControl, $7E1E6F)
%assertRAM(MSUFallbackTable, $7E1E70)
%assertRAM(MSUDelayedCommand, $7E1E79)
%assertRAM(MSUPackCount, $7E1E7A)
%assertRAM(MSUPackCurrent, $7E1E7B)
%assertRAM(MSUPackRequest, $7E1E7C)
%assertRAM(MSULoadedTrack, $7E1E7D)
%assertRAM(MSUResumeTrack, $7E1E7F)
%assertRAM(ClockHours, $7E1E90)
%assertRAM(ClockMinutes, $7E1E94)
%assertRAM(ClockSeconds, $7E1E98)
%assertRAM(ClockBuffer, $7E1E9C)
%assertRAM(ScratchBufferNV, $7E1EA0)
%assertRAM(ScratchBufferV, $7E1EB0)
;%assertRAM(TextID, $7E1CF0)
;%assertRAM(ToastBuffer, $7E1E0E)
;%assertRAM(MSUResumeTime, $7E1E6B)
;%assertRAM(MSUResumeControl, $7E1E6F)
;%assertRAM(MSUFallbackTable, $7E1E70)
;%assertRAM(MSUDelayedCommand, $7E1E79)
;%assertRAM(MSUPackCount, $7E1E7A)
;%assertRAM(MSUPackCurrent, $7E1E7B)
;%assertRAM(MSUPackRequest, $7E1E7C)
;%assertRAM(MSULoadedTrack, $7E1E7D)
;%assertRAM(MSUResumeTrack, $7E1E7F)
;%assertRAM(ClockHours, $7E1E90)
;%assertRAM(ClockMinutes, $7E1E94)
;%assertRAM(ClockSeconds, $7E1E98)
;%assertRAM(ClockBuffer, $7E1E9C)
;%assertRAM(ScratchBufferNV, $7E1EA0)
;%assertRAM(ScratchBufferV, $7E1EB0)
%assertRAM(TileUploadBuffer, $7EA180)
%assertRAM(RoomFade, $7EC005)
%assertRAM(FadeTimer, $7EC007)

View File

@@ -11,18 +11,20 @@ LoadBombCount16:
.infinite
RTL
StoreBombCount:
INC.w UpdateHUDFlag
PHA : LDA.l InfiniteBombs : BEQ .finite
PHA
LDA.b #$01 : STA.l UpdateHUDFlag
LDA.l InfiniteBombs : BEQ .finite
.infinite
PLA : LDA.b #$01 : RTL
.finite
PLA : STA.l BombsEquipment
RTL
SearchForEquippedItem:
LDA.l InfiniteBombs : BEQ +
LDA.b #$01 : LDX.b #$00 : RTL
+
LDA.l BowEquipment ; thing we wrote over
LDA.b #$01 : LDX.b #$00 : RTL
; LDA.l InfiniteBombs : BEQ +
; LDA.b #$01 : LDX.b #$00 : RTL
; +
; LDA.l BowEquipment ; thing we wrote over
RTL
DecrementArrows:

281
rewind.asm Normal file
View File

@@ -0,0 +1,281 @@
pushpc
org $82D6E2
JSL CheckLoadRewind
BCC +
JMP.w $D83F
+
pullpc
CheckLoadRewind:
; what we wrote over
STZ.w $011A
STZ.w $011C
; STZ.w $010A ; removed for MSU patch anyway
LDA.l RewindTrigger
AND.w #$00FF
BEQ .no_state
JSR.w LoadRewind
SEC
RTL
.no_state
LDA.l $7EF3CC ; rest of what we wrote over
CLC
RTL
LoadRewind:
LDA.l RewindDungeonEntrance
STA.w $010E
LDA.l RewindRoomId
STA.b $A0
STA.w $048E
LDA.l RewindVerticalScroll
STA.b $E8
STA.b $E6
STA.w $0122
STA.w $0124
LDA.l RewindHorizontalScroll
STA.b $E2
STA.b $E0
STA.w $011E
STA.w $0120
LDA.l RewindYCoordinate
STA.b $20
LDA.l RewindXCoordinate
STA.b $22
LDA.l RewindCameraTriggerY
STA.w $0618
INC A
INC A
STA.w $061A
LDA.l RewindCameraTriggerX
STA.w $061C
INC A
INC A
STA.w $061E
LDA.w #$01F8
STA.b $EC
LDA.l RewindOverworldDoorTilemap
STA.w $0696
STZ.w $0698
LDA.w #$0000
STA.w $0610
LDA.w #$0110
STA.w $0612
LDA.w #$0000
STA.w $0614
LDA.w #$0100
STA.w $0616
SEP #$20
LDA.l RewindCameraScrollBoundaries
STA.w $0601
LDA.l RewindCameraScrollBoundaries+1
STA.w $0603
LDA.l RewindCameraScrollBoundaries+2
STA.w $0605
LDA.l RewindCameraScrollBoundaries+3
STA.w $0607
LDA.l RewindCameraScrollBoundaries+4
STA.w $0609
LDA.l RewindCameraScrollBoundaries+5
STA.w $060B
LDA.l RewindCameraScrollBoundaries+6
STA.w $060D
LDA.l RewindCameraScrollBoundaries+7
STA.w $060F
STZ.w $0600
STZ.w $0602
LDA.b #$10
STA.w $0604
STA.w $0606
STZ.w $0608
STZ.w $060A
STZ.w $060C
STZ.w $060E
LDA.l RewindLinkFacing
STA.b $2F
LDA.l RewindMainGFX
STA.w $0AA1
LDA.l RewindSong
STA.w $0132
LDA.l RewindFloor
STA.b $A4
LDA.l RewindDungeonId
STA.w $040C
LDA.l Rewind_6C
STA.b $6C
LDA.l Rewind_EE
STA.b $EE
LDA.l Rewind_0476
STA.w $0476
LDA.l Rewind_A6
STA.b $A6
LDA.l Rewind_A7
STA.b $A7
LDA.l Rewind_A9
STA.b $A9
LDA.l Rewind_AA
STA.b $AA
STZ.w $02E4
PHP
REP #$30
LDA.w #$0000
STA.l RewindTrigger
LDA.w #$FFFF
STA.l RewindRoomId
PHB
LDX.w #RewindEntranceCache
LDY.w #$C140
LDA.w #$27
MVN $7E, RewindEntranceCache>>16
PLB
PLP
RTS
SaveRewind:
PHP
REP #$20
LDA.w $010E
STA.l RewindDungeonEntrance
LDA.b $A0
STA.l RewindRoomId
LDA.b $E8
STA.l RewindVerticalScroll
LDA.b $E2
STA.l RewindHorizontalScroll
LDA.b $20
STA.l RewindYCoordinate
LDA.b $22
STA.l RewindXCoordinate
LDA.w $0618
STA.l RewindCameraTriggerY
LDA.w $061C
STA.l RewindCameraTriggerX
LDA.w $0696
STA.l RewindOverworldDoorTilemap
SEP #$20
LDA.w $0601
STA.l RewindCameraScrollBoundaries
LDA.w $0603
STA.l RewindCameraScrollBoundaries+1
LDA.w $0605
STA.l RewindCameraScrollBoundaries+2
LDA.w $0607
STA.l RewindCameraScrollBoundaries+3
LDA.w $0609
STA.l RewindCameraScrollBoundaries+4
LDA.w $060B
STA.l RewindCameraScrollBoundaries+5
LDA.w $060D
STA.l RewindCameraScrollBoundaries+6
LDA.w $060F
STA.l RewindCameraScrollBoundaries+7
LDA.b $2F
STA.l RewindLinkFacing
LDA.w $0AA1
STA.l RewindMainGFX
LDA.w $0132
STA.l RewindSong
LDA.b $A4
STA.l RewindFloor
LDA.w $040C
STA.l RewindDungeonId
LDA.b $6C
STA.l Rewind_6C
LDA.b $EE
STA.l Rewind_EE
LDA.w $0476
STA.l Rewind_0476
LDA.b $A6
STA.l Rewind_A6
LDA.b $A7
STA.l Rewind_A7
LDA.b $A9
STA.l Rewind_A9
LDA.b $AA
STA.l Rewind_AA
PHB
REP #$30
LDX.w #$C140
LDY.w #RewindEntranceCache
LDA.w #$27
MVN RewindEntranceCache>>16, $7E
PLB
PLP
RTL

View File

@@ -37,8 +37,8 @@ SpriteSwap_Palette_ArmorAndGloves:
SEP #$30
LDA.l SpriteSwapper : BNE .continue
REP #$30
LDA.l GloveEquipment
JSL $9BEE21 ; Read Original Palette Code
JSL.l LoadModifiedGloveValue
JSL $9BEE24 ; Read Original Palette Code
RTL
.continue

View File

@@ -321,7 +321,8 @@ DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize
; This has the same shape as the dungeon item bitfields.
MapCountDisplay: skip 2 ;
CrystalCounter: skip 2 ; Total Number of crystals collected (integer)
skip 40 ; Unused
DeadrockCounter: skip 2 ; Number of deadrocks killed
skip 38 ; Unused
ServiceSequence: ; See servicerequest.asm
ServiceSequenceRx: skip 8 ; Service sequence receive
ServiceSequenceTx: skip 8 ; Service sequence transmit
@@ -390,7 +391,34 @@ ExtendedFileNameWRAM: skip 24 ; File name, 12 word-length characters.
RoomPotData: skip 592 ; Table for expanded pot shuffle. One word per room.
SpritePotData: skip 592 ; Table for expanded pot shuffle. One word per room.
PurchaseCounts: skip 96 ; Keeps track of shop purchases
PrivateBlockPersistent: skip 513 ; Reserved for 3rd party developers
PrivateBlockPersistent: ; Reserved for 3rd party developers
IFrames: skip 1
RewindTrigger: skip 1
RewindRoomId: skip 2
RewindDungeonEntrance: skip 2
RewindVerticalScroll: skip 2
RewindHorizontalScroll: skip 2
RewindYCoordinate: skip 2
RewindXCoordinate: skip 2
RewindCameraTriggerY: skip 2
RewindCameraTriggerX: skip 2
RewindOverworldDoorTilemap: skip 2
RewindCameraScrollBoundaries: skip 8
RewindLinkFacing: skip 1
RewindMainGFX: skip 1
RewindSong: skip 1
RewindFloor: skip 1
RewindDungeonId: skip 1
Rewind_6C: skip 1
Rewind_EE: skip 1
Rewind_0476: skip 1
Rewind_A6: skip 1
Rewind_A7: skip 1
Rewind_A9: skip 1
Rewind_AA: skip 1
RewindEntranceCache: skip $28
skip 433
;================================================================================
; Direct SRAM Assignments ($700000 - $7080000)
@@ -420,7 +448,11 @@ skip 283 ;
InverseChecksumSRAM: skip 2 ;
ExtendedSaveDataSRAM: ;
ExtendedFileNameSRAM: skip 24 ; We read and write the file name directly from and to SRAM (24 bytes)
skip $1AE4 ;
skip $500
IFramesSRAM: skip 1
RewindTriggerSRAM: skip 1
RewindRoomIdSRAM: skip 2
skip $15E0 ;
RomVersionSRAM: skip 4 ; ALTTPR ROM version. Low byte is the version, high byte writes
; $01 for now (32-bits total)
RomNameSRAM: skip 21 ; ROM name from $FFC0, burned in during init (21 bytes)

View File

@@ -78,12 +78,12 @@ IncrementSmallKeys:
STA.l CurrentSmallKeys ; thing we wrote over, write small key count
PHX
LDA.l StatsLocked : BNE +
LDA.l SmallKeyCounter : INC : STA.l SmallKeyCounter
LDA.l SmallKeyCounter : INC : STA.l SmallKeyCounter
+
JSL.l UpdateKeys
PHY : LDY.b #24 : JSL.l AddInventory : PLY
JSL.l HUD_RebuildLong
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
PLX
RTL
;--------------------------------------------------------------------------------
@@ -106,7 +106,7 @@ IncrementSmallKeysNoPrimary:
++
PLP
+
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
JSL.l HUD_RebuildLong
PLX
RTL
@@ -146,25 +146,6 @@ CountChestKey:
PLX : PLA
RTS
;--------------------------------------------------------------------------------
CountBonkItem: ; called from GetBonkItem in bookofmudora.asm
LDA.b RoomIndex
CMP.b #115 : BNE +
LDA.l BonkKey_Desert
BRA ++
+
CMP.b #140 : BNE +
LDA.l BonkKey_GTower : BRA ++
+
LDA.b #$24
++
CMP.b #$24 : BNE +
PHY
TAY
JSR CountChestKey
PLY
+
RTL
;--------------------------------------------------------------------------------
IncrementAgahnim2Sword:
PHA
JSL.l IncrementBossSword
@@ -339,40 +320,30 @@ IndoorSubtileTransitionCounter:
JMP StatTransitionCounter
;--------------------------------------------------------------------------------
StatsFinalPrep:
PHA : PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers
LDA.l StatsLocked : BNE .ramPostOnly
INC : STA.l StatsLocked
JSL.l IncrementFinalSword
LDA.l HighestMail : INC : STA.l HighestMail ; add green mail to mail count
LDA.l ScreenTransitions : DEC : STA.l ScreenTransitions ; remove extra transition from exiting gtower via duck
.ramPostOnly
LDA.l SwordBossKills : LSR #4 : !ADD SwordBossKills : STA.l BossKills
LDA.l SwordBossKills+1 : LSR #4 : !ADD SwordBossKills+1 : !ADD BossKills : AND.b #$0F : STA.l BossKills
LDA.l NMIFrames : !SUB LoopFrames : STA.l LagTime
LDA.l NMIFrames+1 : SBC LoopFrames+1 : STA.l LagTime+1
LDA.l NMIFrames+2 : SBC LoopFrames+2 : STA.l LagTime+2
LDA.l NMIFrames+3 : SBC LoopFrames+3 : STA.l LagTime+3
PHA : PHX : PHP
SEP #$30
LDA.l StatsLocked : BNE .ramPostOnly
INC : STA.l StatsLocked
JSL.l IncrementFinalSword
LDA.l Aga2Duck : BEQ .ramPostOnly
LDA.l ScreenTransitions : DEC : STA.l ScreenTransitions ; remove extra transition from exiting gtower via duck
.ramPostOnly
LDA.l SwordBossKills : LSR #4 : !ADD SwordBossKills : STA.l BossKills
LDA.l SwordBossKills+1 : LSR #4 : !ADD SwordBossKills+1 : !ADD BossKills : AND.b #$0F : STA.l BossKills
LDA.l RupeesSpent : !ADD DisplayRupees : STA.l RupeesCollected
LDA.l RupeesSpent+1 : ADC DisplayRupees+1 : STA.l RupeesCollected+1
LDA.l NMIFrames : !SUB LoopFrames : STA.l LagTime
LDA.l NMIFrames+1 : SBC LoopFrames+1 : STA.l LagTime+1
LDA.l NMIFrames+2 : SBC LoopFrames+2 : STA.l LagTime+2
LDA.l NMIFrames+3 : SBC LoopFrames+3 : STA.l LagTime+3
REP #$20
LDA.l TotalItemCounter : !SUB ChestsOpened : STA.l NonChestCounter
LDA.l RupeesSpent : !ADD DisplayRupees : STA.l RupeesCollected
LDA.l RupeesSpent+1 : ADC DisplayRupees+1 : STA.l RupeesCollected+1
.done
PLP : PLX : PLA
LDA.b #$19 : STA.b GameMode ; thing we wrote over, load triforce room
REP #$20
LDA.l TotalItemCounter : !SUB ChestsOpened : STA.l NonChestCounter
.done
PLP : PLX : PLA
LDA.b #$19 : STA.b GameMode ; thing we wrote over, load triforce room
STZ.b GameSubMode
STZ.b SubSubModule
RTL
;--------------------------------------------------------------------------------
; Notes:
; s&q counter
;================================================================================

View File

@@ -13,6 +13,44 @@ db 2
db 55
db " " ; $238020
!FEATURE_PATREON_SUPPORTERS ?= 0
table "data/creditscharmapbighi.txt"
PatronCredit1Hi:
db 2
db 55
db " " ; $23803E
table "data/creditscharmapbiglo.txt"
PatronCredit1Lo:
db 2
db 55
db " " ; $23805C
table "data/creditscharmapbighi.txt"
PatronCredit2Hi:
db 2
db 55
db " " ; $23807A
table "data/creditscharmapbiglo.txt"
PatronCredit2Lo:
db 2
db 55
db " " ; $238098
table "data/creditscharmapbighi.txt"
PatronCredit3Hi:
db 2
db 55
db " " ; $2380B6
table "data/creditscharmapbiglo.txt"
PatronCredit3Lo:
db 2
db 55
db " " ; $2380D4
;===================================================================================================
CreditsLineTable:
@@ -439,6 +477,24 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("APRIL SILLIES RANDOMIZER", "green")
%blankline()
%bigcredits("KARAFRUIT")
%blankline()
%blankline()
%smallcredits("APRIL SILLIES BETA TESTERS", "yellow")
%blankline()
%bigcredits("WILLOW")
%blankline()
%blankline()
%smallcredits("SPRITE DEVELOPMENT", "green")
%blankline()
@@ -465,6 +521,8 @@ CreditsLineBlank:
%smallcredits("YOUR SPRITE BY", "yellow")
%blankline()
%addarbline(YourSpriteCreditsHi)
%addarbline(YourSpriteCreditsLo)
@@ -530,7 +588,7 @@ CreditsLineBlank:
%blankline()
%bigcredits("AND&")
%bigcredits("AND")
%blankline()
@@ -547,19 +605,6 @@ CreditsLineBlank:
%blankline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()

56
switches.asm Normal file
View File

@@ -0,0 +1,56 @@
pushpc
org $87A46E
JSL CheckBookTriggerSwitch
BCS +
skip 15
+
org $8296A8
JSL FinishPegChange
org $86B93F
BRA + : NOP #8 : +
LDA.b #$19
STA.b $11
LDA.b #$33
JSL $8DBB7C
pullpc
FinishPegChange:
LDA.b #$20
TRB.w $037A
STZ.b $B0
STZ.b $11
RTL
CheckBookTriggerSwitch:
LDA.b $10
CMP.b #$07
BNE +
LDA.l $7EC172
EOR.b #$01
STA.l $7EC172
LDA.b #$16
STA.b $11
LDA.b #$20
TSB.w $037A
LDA.b #$25
JSL $8DBB8A
SEC
BRA .done
+ CLC
.done
; what we wrote over
LDA.b $3A
AND.b #$BF
STA.b $3A
RTL

View File

@@ -64,22 +64,23 @@ LoadModifiedMagicLevel:
RTL
;================================================================================
; $7E0348 - Ice Value
LoadModifiedIceFloorValue_a11:
LDA.b RoomIndex : CMP.b #$91 : BEQ + : CMP.b #$92 : BEQ + : CMP.b #$93 : BEQ + ; mire basement currently broken - not sure why
LDA.b LinkState : CMP.b #$01 : BEQ + : CMP.b #$17 : BEQ + : CMP.b #$1C : BEQ +
LDA.b LinkSpeed : CMP.b #$02 : BEQ +
LDA.b LinkSlipping : BNE +
LDA.w TileActIce : ORA.l IceModifier : AND.b #$11 : RTL
+ : LDA.w TileActIce : AND.b #$11
RTL
LoadModifiedIceFloorValue_a01:
LoadModifiedIceFloorValue:
LDA.b RoomIndex : CMP.b #$91 : BEQ + : CMP.b #$92 : BEQ + : CMP.b #$93 : BEQ + ; mire basement currently broken - not sure why
LDA.b LinkState : CMP.b #$01 : BEQ + : CMP.b #$17 : BEQ + : CMP.b #$1C : BEQ +
LDA.b LinkSpeed : CMP.b #$02 : BEQ +
LDA.b LinkSlipping : BNE +
LDA.w TileActIce : ORA.l IceModifier : AND.b #$01 : RTL
+ : LDA.w TileActIce : AND.b #$01
RTL
LDA.b $3C : AND.b #$0F : CMP.b #$09 : BNE ++
LDA.w $0372 : BNE ++
.yes
LDA.w TileActIce : ORA.l IceModifier : ORA.b #$10 : RTS
++ : LDA.w TileActIce : ORA.l IceModifier : RTS
+ : LDA.w TileActIce
RTS
LoadModifiedIceFloorValue_a11:
JSR LoadModifiedIceFloorValue : AND.b #$11 : RTL
LoadModifiedIceFloorValue_a01:
JSR LoadModifiedIceFloorValue : AND.b #$01 : RTL
;================================================================================
CheckTabletSword:
LDA.l AllowHammerTablets : BEQ +

View File

@@ -922,7 +922,7 @@ dw $00D8 ; 216
org $B08198 ; PC 0x180198-0x1801A9
GanonsTowerOpenAddress: ; 0x180198-0x180199
dw CrystalCounter ; Target address for GT open check
dw DeadrockCounter ; Target address for GT open check
GanonsTowerOpenTarget: ; 0x18019A-0x18019B
dw $0007 ; Target amount for GT open modes to compare
GanonsTowerOpenMode: ; 0x18019C-0x18019D

View File

@@ -36,12 +36,12 @@ endmacro
;--------------------------------------------------------------------------------
CalculateTimer:
LDA.w #$0000
STA.w ClockHours ; clear digit storage
STA.w ClockHours+2
STA.w ClockMinutes
STA.w ClockMinutes+2
STA.w ClockSeconds
STA.w ClockSeconds+2
STA.l ClockHours ; clear digit storage
STA.l ClockHours+2
STA.l ClockMinutes
STA.l ClockMinutes+2
STA.l ClockSeconds
STA.l ClockSeconds+2
LDA.l TimerStyle : AND.w #$00FF : CMP.w #$0002 : BNE + ; Stopwatch Mode
%Sub32(NMIFrames,ChallengeTimer,ClockBuffer)
@@ -57,8 +57,8 @@ CalculateTimer:
LDA.l NMIFrames+2 : STA.l ChallengeTimer+2
RTS
++ CMP.w #$0001 : BNE ++ ; Negative Time
LDA.w ClockBuffer : EOR.w #$FFFF : !ADD.w #$0001 : STA.w ClockBuffer
LDA.w ClockBuffer+2 : EOR.w #$FFFF : ADC.w #$0000 : STA.w ClockBuffer+2
LDA.l ClockBuffer : EOR.w #$FFFF : !ADD.w #$0001 : STA.l ClockBuffer
LDA.l ClockBuffer+2 : EOR.w #$FFFF : ADC.w #$0000 : STA.l ClockBuffer+2
LDA.w #$0001 : STA.l ClockStatus ; Set Negative Mode
BRA .prepDigits
++ CMP.w #$0002 : BNE ++ ; OHKO
@@ -92,12 +92,12 @@ CalculateTimer:
%Sub32(ClockBuffer,.second,ClockBuffer) : BRA -
+
LDA.w ClockHours : !ADD.w #$2490 : STA.w ClockHours ; convert decimal values to tiles
LDA.w ClockHours+2 : !ADD.w #$2490 : STA.w ClockHours+2
LDA.w ClockMinutes : !ADD.w #$2490 : STA.w ClockMinutes
LDA.w ClockMinutes+2 : !ADD.w #$2490 : STA.w ClockMinutes+2
LDA.w ClockSeconds : !ADD.w #$2490 : STA.w ClockSeconds
LDA.w ClockSeconds+2 : !ADD.w #$2490 : STA.w ClockSeconds+2
LDA.l ClockHours : !ADD.w #$2490 : STA.l ClockHours ; convert decimal values to tiles
LDA.l ClockHours+2 : !ADD.w #$2490 : STA.l ClockHours+2
LDA.l ClockMinutes : !ADD.w #$2490 : STA.l ClockMinutes
LDA.l ClockMinutes+2 : !ADD.w #$2490 : STA.l ClockMinutes+2
LDA.l ClockSeconds : !ADD.w #$2490 : STA.l ClockSeconds
LDA.l ClockSeconds+2 : !ADD.w #$2490 : STA.l ClockSeconds+2
RTS
;--------------------------------------------------------------------------------
.hour
@@ -148,14 +148,14 @@ DrawChallengeTimer:
BRA ++
+ ; Show Timer
LDA.l ClockStatus : AND.w #$0001 : !ADD.w #$2804 : STA.l HUDTileMapBuffer+$94
LDA.w ClockHours+2 : STA.l HUDTileMapBuffer+$96
LDA.w ClockHours : STA.l HUDTileMapBuffer+$98
LDA.l ClockHours+2 : STA.l HUDTileMapBuffer+$96
LDA.l ClockHours : STA.l HUDTileMapBuffer+$98
LDA.w #$2806 : STA.l HUDTileMapBuffer+$9A
LDA.w ClockMinutes+2 : STA.l HUDTileMapBuffer+$9C
LDA.w ClockMinutes : STA.l HUDTileMapBuffer+$9E
LDA.l ClockMinutes+2 : STA.l HUDTileMapBuffer+$9C
LDA.l ClockMinutes : STA.l HUDTileMapBuffer+$9E
LDA.w #$2806 : STA.l HUDTileMapBuffer+$A0
LDA.w ClockSeconds+2 : STA.l HUDTileMapBuffer+$A2
LDA.w ClockSeconds : STA.l HUDTileMapBuffer+$A4
LDA.l ClockSeconds+2 : STA.l HUDTileMapBuffer+$A2
LDA.l ClockSeconds : STA.l HUDTileMapBuffer+$A4
++
LDA.b FrameCounter : AND.w #$001F : BNE + : JSR CalculateTimer : +
@@ -174,12 +174,11 @@ RTL
CheckOHKO:
SEP #$20
LDA.l OHKOFlag : CMP.l OHKOCached : BNE .change
REP #$20
CLC
REP #$21
RTS
.change
STA.l OHKOCached
INC.w UpdateHUDFlag
LDA.b #$01 : STA.l UpdateHUDFlag
REP #$20
SEC
RTS

View File

@@ -4,8 +4,9 @@
; in: X(w) - Length in Tiles
;--------------------------------------------------------------------------------
DoToast:
PHY : PHP
LDY.w ToastBuffer
PHY : PHP : PHA
LDA.l ToastBuffer : TAY
PLA
JSL.l WriteVRAMBlock
PLP : PLY
RTL

13
zoom_on_carry.asm Normal file
View File

@@ -0,0 +1,13 @@
pushpc
org $87E294
JSL.l CheckSpeed
pullpc
CheckSpeed:
LDA.w $0308 : BIT.b #$80 : BNE .zoom
LDA.b $5E : STA.b $00 ; what we wrote over
RTL
.zoom
LDA.b #$10 : STA.b $00 : RTL