housekeeping

This commit is contained in:
scawful
2022-10-01 02:53:32 -05:00
parent 55ed3943fd
commit 30f2afad04
10 changed files with 53 additions and 64 deletions

106
Events/intro.asm Normal file
View File

@@ -0,0 +1,106 @@
;===========================================================
; Intro
; game will Switch to part 1 after your uncle left the house
;===========================================================
namespace Intro
{
Main:
{
lorom
ORG $05DF12
JSL $04ECA0
NOP
NOP
org $04ECA0
STZ $0DD0,x
STZ $02E4 ; repeat native code overwritten by hook
LDA #$02
STA $7ef3C5 ; store "part 2"
LDA #$00
STA $7ef3CC ; disable telepathic message
JSL $00FC41 ; fix monsters
RTL
} ; label Main
Items:
{
; SRM Start Modyfier
; This ASM was written by Euclid, modified by Conn; thanks to MoN for his banks research
; This is a ASM FrontEnd Code for Zelda ALTTP (US, no header) to modify the sram on startup
; the values are included to better distinguish where is what. You need to set your own values. Description at the end.
lorom
org $0cdc5a
jsr $ffb1
org $0cffb1
LDA #$0000
STA $7003C5,x
LDA #$0000
STA $7003C7,x
LDA #$0101 ; 01=sword, 02 = shield to start with
STA $700359,x ; sword/shield save
LDY #$0000
RTS
;---------------------------------------------------------
;$3C5: $00: Unset, Will put Link in his bed state at the beginning of the game. (Also can't use sword or shield)
; $01: Start in the castle on start up.
; $02: Indicates you have completed the first Hyrule Castle dungeon.
; $03: Indicates you have beaten Agahnim and are now searching for crystals.
; $04 and above: meaningless. Though, you could write code using them to expand the event system perhaps.
;$3C6: Progress Flags (bitwise)
; 00 - Set after your Uncle gives you his gear in the secret passage. Prevents him from showing up there again.
; 01 - Indicates that you've touched the dying priest in Sanctuary.
; 02 - Set after you bring Zelda to sanctuary?
; 03 - Unused? (98% certainty)
; 04 - Set after Link's Uncle leaves your house. It's used to prevent him from respawning there.
; 05 - Set after you obtain the Book of Mudora (this is a guess)
; 06 - Seems to be a persistent flag that toggles between two possible statements that a fortune teller can give you during your "reading".
; In other words, don't expect this to stay in one state if you're using fortune tellers. Has no other known purpose.
; 07 - Unused? (98% certainty)
; 10 - Start value (in house, bed)
;$3C7: Map Icons Indicator 2 (value, not bitwise)
; 00 - start value (cross at Hyrule Castle)
; 01 - cross at Sahasrala's house
; 02 - cross at ruins
; 03 - The Three Pendants
; 04 - Master Sword in Lost Woods
; 05 - Agahnim (skull icon at Hyrule Castle)
; 06 - Just crystal 1 shown (Sahasrala's idea)
; 07 - All crystals shown
; 08 - Agahnim (skull icon at Ganon's Tower)
; All values beyond 8 are invalid, it seems.
;$3C8: Starting Entrance to use. Abbreviations: LH = Link's House - SA = Sanctuary - MC = Mountain Cave - PP = Pyramid of Power in DW
; 00 - Start the game in Link's house always.
; 01 - SA.
; 03 - Secret passage under HC garden (near dying uncle).
; 05 - LH or SA or MC.
;$359: Sword you start with
; 00 - No sword
; 01 - Fighter Sword
; 02 - Master Sword
; 03 - Tempered Sword
; 04 - Golden Sword
;$35A: Shield you start with .
; 00 - No shield
; 01 - Blue Shield
; 02 - Hero's Shield
; 03 - Mirror Shield
}
} ; namespace Intro

158
Events/lostsea.asm Normal file
View File

@@ -0,0 +1,158 @@
;===========================================================
; Lost Sea Hack
;
; Area: 3A
; East Exit 3B (or 33)
; North Exit 32
; South is 42
; West is 39
; combo is N (32),W (39),S (42),N (32)
;===========================================================
namespace LostSea
{
Main:
{
lorom
org $A0F000 ; Note at this stage the accumulator contains area currently in, and X contains the area you're moving to.
LOST_WOOD_HOOK:
{
CMP #$3A ; are we in the right area?
BEQ begincode
normalfinish:
{
LDA $02A5EC,x ; not right area so return.
STZ $1CF7
RTL
} ; label normalfinish
begincode:
{
CPX #$3B
BEQ normalfinish
; from here onwards, use the ram address to determine which combo you're up to
; this code is pretty repeatable
LDA $1CF7
CMP #$00
BNE combo1
CPX #$32 ; did you get it right?
BEQ UP_CORRECT
STZ $1CF7
BRA RESOLVE_INCORRECT
} ; label begincode
combo1:
{
CMP #$01
BNE combo2
CPX #$39 ; did you get it right?
BEQ LEFT_CORRECT
STZ $1CF7
BRA RESOLVE_INCORRECT
} ; label comb1
combo2:
{
CMP #$02
BNE combo3
CPX #$42 ; did you get it right?
BEQ DOWN_CORRECT
STZ $1CF7
BRA RESOLVE_INCORRECT
} ; label comb2
combo3:
{
CPX #$32; did you get it right?
BNE RESOLVE_INCORRECT ; we want to load the down area, since we complete the combos
LDA #$1B
STA $012F ; play fanfare
BRA normalfinish
RESOLVE_INCORRECT:
CPX #$39
BEQ CASE_LEFT
CPX #$32
BEQ CASE_UP
BRA CASE_DOWN
} ; label combo3
DOWN_CORRECT:
{
INC $1CF7
CASE_DOWN:
DEC $21
DEC $21
DEC $E7
DEC $E7
DEC $E9
DEC $E9
DEC $611
DEC $611
DEC $613
DEC $613
LDA $700
SEC
SBC #$10
STA $700
BRA all
} ; label DOWN_CORRECT
UP_CORRECT:
{
INC $1CF7
CASE_UP:
INC $21
INC $21
INC $E7
INC $E7
INC $E9
INC $E9
INC $611
INC $611
INC $613
INC $613
LDA $700
CLC
ADC #$10
STA $700
BRA all
} ; label UP_CORRECT
LEFT_CORRECT:
{
INC $1CF7
CASE_LEFT:
INC $23
INC $23
INC $E1
INC $E1
INC $E3
INC $E3
INC $615
INC $615
INC $617
INC $617
INC $700
INC $700
} ; label LEFT_CORRECT
all:
{
LDA #$3A ; load the same area.
RTL
}
.end
ORG $02AA7D
JSL LOST_WOOD_HOOK
} ; label LOST_WOOD_HOOK
} ; label Main
} ; namespace LostSea