Fix menu system crashes and stability issues
- Fix IrisSpotlight crash ($00F361): Removed errant $0116/$17 writes from menu_select_item.asm that corrupted VRAM upload index - Fix journal stack corruption: Added missing PHB in Journal_CountUnlocked - Fix P register mismatches: Added SEP #$30 to Menu_RefreshQuestScreen, Menu_ScrollFrom, Menu_DrawRingPrompt - Fix MagicBag crashes: Fixed data bank corruption in error path, fixed uninitialized Y register in cursor movement - Relocate StoryState from volatile $7C to SRAM $7EF39E - Add bounds checking to HouseTag_Main jump table - Use long addressing (.l) for SRAM access in custom_tag.asm 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -87,6 +87,12 @@ MagicBeanProg = $7EF39B
|
|||||||
|
|
||||||
JournalState = $7EF39C
|
JournalState = $7EF39C
|
||||||
|
|
||||||
|
; State machine for Link's House intro sequence (custom_tag.asm)
|
||||||
|
; 0x00 - Telepathic Plea phase
|
||||||
|
; 0x01 - Wake Up Player phase
|
||||||
|
; 0x02 - End (intro complete)
|
||||||
|
StoryState = $7EF39E
|
||||||
|
|
||||||
; 7EF403 - 7EF4FD Unused block
|
; 7EF403 - 7EF4FD Unused block
|
||||||
|
|
||||||
; .... .cpw
|
; .... .cpw
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ The following blocks were marked "unused" in vanilla ALTTP but are now utilized
|
|||||||
| `$7EF39B` | `MagicBeanProg` | Multi-day growth cycle tracking for magic bean side-quest (`.dts fwpb`). | ✓ |
|
| `$7EF39B` | `MagicBeanProg` | Multi-day growth cycle tracking for magic bean side-quest (`.dts fwpb`). | ✓ |
|
||||||
| `$7EF39C` | `JournalState` | Current state of the player's journal. | ✓ |
|
| `$7EF39C` | `JournalState` | Current state of the player's journal. | ✓ |
|
||||||
| `$7EF39D` | `SRAM_StormsActive` | Flag indicating if the Song of Storms effect is active. | ✓ |
|
| `$7EF39D` | `SRAM_StormsActive` | Flag indicating if the Song of Storms effect is active. | ✓ |
|
||||||
|
| `$7EF39E` | `StoryState` | State machine for Link's House intro sequence (0-2). | ✓ |
|
||||||
|
|
||||||
#### **Block $7EF403-$7EF4FD** - Partially Repurposed
|
#### **Block $7EF403-$7EF4FD** - Partially Repurposed
|
||||||
|
|
||||||
@@ -135,6 +136,7 @@ This section details the layout of the save file memory.
|
|||||||
| `$7EF39B` | `MagicBeanProg` | Tracks the multi-day growth cycle of the magic bean side-quest. |
|
| `$7EF39B` | `MagicBeanProg` | Tracks the multi-day growth cycle of the magic bean side-quest. |
|
||||||
| `$7EF39C` | `JournalState` | The current state of the player's journal. |
|
| `$7EF39C` | `JournalState` | The current state of the player's journal. |
|
||||||
| `$7EF39D` | `SRAM_StormsActive`| A flag indicating if the Song of Storms effect is active. |
|
| `$7EF39D` | `SRAM_StormsActive`| A flag indicating if the Song of Storms effect is active. |
|
||||||
|
| `$7EF39E` | `StoryState` | State machine for Link's House intro sequence (0=Telepathy, 1=WakeUp, 2=End). |
|
||||||
| `$7EF410` | `Dreams` | A bitfield tracking the collection of the three "Dreams" (Courage, Power, Wisdom). |
|
| `$7EF410` | `Dreams` | A bitfield tracking the collection of the three "Dreams" (Courage, Power, Wisdom). |
|
||||||
| `$7EF347` | `ZoraMask` | Flag indicating if the player has obtained the Zora Mask. |
|
| `$7EF347` | `ZoraMask` | Flag indicating if the player has obtained the Zora Mask. |
|
||||||
| `$7EF348` | `BunnyHood` | Flag indicating if the player has obtained the Bunny Hood. |
|
| `$7EF348` | `BunnyHood` | Flag indicating if the player has obtained the Bunny Hood. |
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
; Custom Tag
|
; Custom Tag
|
||||||
; Provide custom room behavior based on room ID
|
; Provide custom room behavior based on room ID
|
||||||
|
|
||||||
StoryState = $7C
|
; StoryState is now defined in Core/sram.asm at $7EF39E (persistent SRAM)
|
||||||
RoomTag_Return = $01CC5A
|
RoomTag_Return = $01CC5A
|
||||||
|
|
||||||
; override routine 0x39 "Holes(7)"
|
; override routine 0x39 "Holes(7)"
|
||||||
@@ -27,9 +27,16 @@ CustomTag:
|
|||||||
|
|
||||||
HouseTag_Main:
|
HouseTag_Main:
|
||||||
{
|
{
|
||||||
LDA.w StoryState
|
LDA.l StoryState ; Must use long addressing for SRAM ($7EF39E)
|
||||||
JSL $008781
|
CMP.b #$03 : BCC .valid_state
|
||||||
|
; If state is invalid (>= 3), force reset to 0 (Intro)
|
||||||
|
LDA.b #$00 : STA.l StoryState
|
||||||
|
.valid_state
|
||||||
|
ASL A : TAX
|
||||||
|
JSR (.jump_table, X)
|
||||||
|
RTS
|
||||||
|
|
||||||
|
.jump_table
|
||||||
dw HouseTag_TelepathicPlea
|
dw HouseTag_TelepathicPlea
|
||||||
dw HouseTag_WakeUpPlayer
|
dw HouseTag_WakeUpPlayer
|
||||||
dw HouseTag_End
|
dw HouseTag_End
|
||||||
@@ -48,7 +55,7 @@ HouseTag_Main:
|
|||||||
; "Accept our quest, Link!"
|
; "Accept our quest, Link!"
|
||||||
LDA.b #$1F : LDY.b #$00
|
LDA.b #$1F : LDY.b #$00
|
||||||
JSL Sprite_ShowMessageUnconditional
|
JSL Sprite_ShowMessageUnconditional
|
||||||
INC.b StoryState
|
LDA.l StoryState : INC A : STA.l StoryState ; Long addressing for SRAM
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -71,7 +78,7 @@ HouseTag_Main:
|
|||||||
;LDA.b #$01 : STA $02E4
|
;LDA.b #$01 : STA $02E4
|
||||||
|
|
||||||
STZ $02E4 ; awake from slumber
|
STZ $02E4 ; awake from slumber
|
||||||
INC.b StoryState
|
LDA.l StoryState : INC A : STA.l StoryState ; Long addressing for SRAM
|
||||||
|
|
||||||
; Make it so Link's uncle never respawns in the house again.
|
; Make it so Link's uncle never respawns in the house again.
|
||||||
LDA $7EF3C6 : ORA.b #$10 : STA $7EF3C6
|
LDA $7EF3C6 : ORA.b #$10 : STA $7EF3C6
|
||||||
@@ -86,7 +93,7 @@ HouseTag_Main:
|
|||||||
HouseTag_End:
|
HouseTag_End:
|
||||||
{
|
{
|
||||||
LDA $B6 : BNE .hasMetFarore
|
LDA $B6 : BNE .hasMetFarore
|
||||||
LDA #$00 : STA.w StoryState
|
LDA #$00 : STA.l StoryState ; Long addressing for SRAM
|
||||||
.hasMetFarore
|
.hasMetFarore
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|||||||
1715
Menu/menu.asm
1715
Menu/menu.asm
File diff suppressed because it is too large
Load Diff
@@ -210,3 +210,7 @@ AreaNameTXT:
|
|||||||
dw $255C, $2554, $241C, $2430
|
dw $255C, $2554, $241C, $2430
|
||||||
dw $2430, $2430, $2430, $2430
|
dw $2430, $2430, $2430, $2430
|
||||||
dw $2430, $2430, $2430, $2430
|
dw $2430, $2430, $2430, $2430
|
||||||
|
|
||||||
|
RingPromptTXT:
|
||||||
|
dw $2567, $256B, $2417, $2561
|
||||||
|
dw $2558, $255D, $2556, $2562
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
; Book of Secrets Journal Menu
|
; Book of Secrets Journal Menu
|
||||||
; Journal States
|
|
||||||
JOURNAL_STATE_FIRST_PAGE = $0000
|
|
||||||
JOURNAL_STATE_MIDDLE_PAGE = $0001
|
|
||||||
JOURNAL_STATE_LAST_PAGE = $0002
|
|
||||||
|
|
||||||
; ---------------------------------------------------------
|
; ---------------------------------------------------------
|
||||||
; Journal Handler
|
; Journal Handler
|
||||||
@@ -16,7 +12,6 @@ Journal_Handler:
|
|||||||
REP #$30
|
REP #$30
|
||||||
JSR Journal_PrevPage
|
JSR Journal_PrevPage
|
||||||
JSL Menu_DrawJournal
|
JSL Menu_DrawJournal
|
||||||
JSR Journal_DrawEntry
|
|
||||||
BRA .draw_page
|
BRA .draw_page
|
||||||
|
|
||||||
.check_right
|
.check_right
|
||||||
@@ -25,7 +20,6 @@ Journal_Handler:
|
|||||||
REP #$30
|
REP #$30
|
||||||
JSR Journal_NextPage
|
JSR Journal_NextPage
|
||||||
JSL Menu_DrawJournal
|
JSL Menu_DrawJournal
|
||||||
JSR Journal_DrawEntry
|
|
||||||
.draw_page
|
.draw_page
|
||||||
SEP #$30
|
SEP #$30
|
||||||
PLB
|
PLB
|
||||||
@@ -39,14 +33,15 @@ Journal_Handler:
|
|||||||
Journal_PrevPage:
|
Journal_PrevPage:
|
||||||
{
|
{
|
||||||
LDA.l JournalState
|
LDA.l JournalState
|
||||||
AND.w #$00FF : CMP.w #JOURNAL_STATE_FIRST_PAGE
|
AND.w #$00FF : BEQ .wrap_to_last
|
||||||
BEQ .wrap_to_last
|
|
||||||
DEC A
|
DEC A
|
||||||
STA.l JournalState
|
STA.l JournalState
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.wrap_to_last
|
.wrap_to_last
|
||||||
LDA.w #JOURNAL_STATE_LAST_PAGE
|
; Find total count to wrap to last
|
||||||
|
JSR Journal_CountUnlocked
|
||||||
|
DEC A
|
||||||
STA.l JournalState
|
STA.l JournalState
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -54,18 +49,115 @@ Journal_PrevPage:
|
|||||||
Journal_NextPage:
|
Journal_NextPage:
|
||||||
{
|
{
|
||||||
LDA.l JournalState
|
LDA.l JournalState
|
||||||
AND.w #$00FF : CMP.w #JOURNAL_STATE_LAST_PAGE
|
AND.w #$00FF : INC A : STA.b $00
|
||||||
BEQ .wrap_to_first
|
|
||||||
INC A
|
; Check if next page exists
|
||||||
|
LDA.b $00
|
||||||
|
JSR Journal_GetNthEntry
|
||||||
|
CPX.w #$0000 : BEQ .wrap_to_first
|
||||||
|
LDA.b $00
|
||||||
STA.l JournalState
|
STA.l JournalState
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
.wrap_to_first
|
.wrap_to_first
|
||||||
LDA.w #JOURNAL_STATE_FIRST_PAGE
|
LDA.w #$0000
|
||||||
STA.l JournalState
|
STA.l JournalState
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; ---------------------------------------------------------
|
||||||
|
; Entry Logic
|
||||||
|
; ---------------------------------------------------------
|
||||||
|
|
||||||
|
; Input: A = Index (N)
|
||||||
|
; Output: X = Text Pointer (or 0 if not found)
|
||||||
|
Journal_GetNthEntry:
|
||||||
|
{
|
||||||
|
PHA
|
||||||
|
LDY.w #$0000 ; Master List Index
|
||||||
|
|
||||||
|
.loop
|
||||||
|
; Check if we reached end of list
|
||||||
|
LDA.w Journal_MasterList, Y : BEQ .end_of_list
|
||||||
|
|
||||||
|
; Check Flag
|
||||||
|
; Format: dd dd dd mm (Address Long, Mask)
|
||||||
|
; But we can't indirect long easily without setup.
|
||||||
|
; Let's read address to $00.
|
||||||
|
|
||||||
|
LDA.w Journal_MasterList, Y : STA.b $02
|
||||||
|
LDA.w Journal_MasterList+2, Y : STA.b $04 ; Get mask in low byte of $04
|
||||||
|
|
||||||
|
SEP #$20
|
||||||
|
; $04 = Bank, $05 = Mask (from 16-bit read above)
|
||||||
|
|
||||||
|
PHB
|
||||||
|
LDA.b $04 : PHA : PLB ; Set DB to address bank
|
||||||
|
LDA.b ($02) ; Load flag value at address
|
||||||
|
PLB ; Restore original data bank
|
||||||
|
|
||||||
|
AND.w Journal_MasterList+3, Y ; Apply mask (A is 8-bit, addr is 16-bit)
|
||||||
|
; Wait, 16-bit read of +2 gets Bank and Mask.
|
||||||
|
; $02-$03 = Addr Low
|
||||||
|
; $04 = Bank
|
||||||
|
; $05 = Mask
|
||||||
|
; The AND above reads from ROM directly.
|
||||||
|
|
||||||
|
BEQ .locked
|
||||||
|
; Unlocked
|
||||||
|
PLA : DEC A : PHA ; Decrement target index
|
||||||
|
BMI .found
|
||||||
|
|
||||||
|
.locked
|
||||||
|
REP #$20
|
||||||
|
TYA : CLC : ADC.w #$0006 : TAY ; Next Entry (4 bytes header + 2 bytes ptr = 6)
|
||||||
|
BRA .loop
|
||||||
|
|
||||||
|
.found
|
||||||
|
REP #$20
|
||||||
|
PLA ; Clean stack
|
||||||
|
LDA.w Journal_MasterList+4, Y : TAX
|
||||||
|
RTS
|
||||||
|
|
||||||
|
.end_of_list
|
||||||
|
REP #$20
|
||||||
|
PLA ; Clean stack
|
||||||
|
LDX.w #$0000
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
|
Journal_CountUnlocked:
|
||||||
|
{
|
||||||
|
LDY.w #$0000 ; Master List Index
|
||||||
|
LDA.w #$0000 : STA.b $06 ; Counter
|
||||||
|
|
||||||
|
.loop
|
||||||
|
LDA.w Journal_MasterList, Y : BEQ .done
|
||||||
|
|
||||||
|
; Check Flag
|
||||||
|
LDA.w Journal_MasterList, Y : STA.b $02
|
||||||
|
LDA.w Journal_MasterList+2, Y : STA.b $04
|
||||||
|
|
||||||
|
SEP #$20
|
||||||
|
PHB ; Save current data bank
|
||||||
|
LDA.b $04 : PHA : PLB ; Set DB to address bank
|
||||||
|
LDA.b ($02) ; Load flag value
|
||||||
|
PLB ; Restore original data bank
|
||||||
|
AND.w Journal_MasterList+3, Y ; Apply mask (A is 8-bit, addr is 16-bit)
|
||||||
|
BEQ .locked
|
||||||
|
REP #$20
|
||||||
|
INC.b $06
|
||||||
|
|
||||||
|
.locked
|
||||||
|
REP #$20
|
||||||
|
TYA : CLC : ADC.w #$0006 : TAY
|
||||||
|
BRA .loop
|
||||||
|
|
||||||
|
.done
|
||||||
|
LDA.b $06
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
; ---------------------------------------------------------
|
; ---------------------------------------------------------
|
||||||
; Entry Drawing
|
; Entry Drawing
|
||||||
; ---------------------------------------------------------
|
; ---------------------------------------------------------
|
||||||
@@ -73,47 +165,51 @@ Journal_NextPage:
|
|||||||
Journal_DrawEntry:
|
Journal_DrawEntry:
|
||||||
{
|
{
|
||||||
REP #$30
|
REP #$30
|
||||||
; Calculate pointer to the text based on JournalState (Page #)
|
LDA.l JournalState : AND.w #$00FF
|
||||||
; Entry = JournalEntries[JournalState]
|
JSR Journal_GetNthEntry
|
||||||
LDA.l JournalState : AND.w #$00FF : ASL : TAX
|
STX.b $00 ; Store Text Pointer
|
||||||
LDA.w JournalEntries, X : STA.b $00 ; Store pointer in $00 (Direct Page)
|
|
||||||
|
CPX.w #$0000 : BNE .valid
|
||||||
|
; Draw "Empty" if no entry found (shouldn't happen with correct logic)
|
||||||
|
RTS
|
||||||
|
.valid
|
||||||
|
|
||||||
LDX.w #$0000 ; Text Offset
|
LDX.w #$0000 ; Text Offset
|
||||||
LDY.w #$0000 ; VRAM Offset
|
LDY.w #$0000 ; VRAM Offset
|
||||||
|
|
||||||
.loop
|
.loop
|
||||||
; Read from Indirect Address ($00) + Y (offset)
|
|
||||||
; We need to be careful with addressing.
|
|
||||||
; $00 is 16-bit pointer. We need to read from Bank 2D (current bank).
|
|
||||||
; LDA ($00), Y works if Y is index.
|
|
||||||
; But our X is the text offset index, Y is VRAM index.
|
|
||||||
; Let's swap registers.
|
|
||||||
|
|
||||||
PHY ; Save VRAM offset
|
PHY ; Save VRAM offset
|
||||||
TXY ; Y = Text Offset
|
TXY ; Y = Text Offset
|
||||||
LDA ($00), Y ; Read word from text table
|
LDA ($00), Y ; Read word from text
|
||||||
PLY ; Restore VRAM offset
|
PLY ; Restore VRAM offset
|
||||||
|
|
||||||
STA.w $1292, Y ; Write to VRAM buffer
|
CMP.w #$FFFF : BEQ .done ; Check for terminator
|
||||||
|
|
||||||
|
STA.w $1292, Y ; Write to VRAM buffer (Row 1)
|
||||||
|
|
||||||
INY #2 ; Next VRAM word
|
INY #2 ; Next VRAM word
|
||||||
INX #2 ; Next Text word
|
INX #2 ; Next Text word
|
||||||
|
|
||||||
CPY.w #$0060 ; Copy 3 lines (32 bytes * 3 approx? No, original was $1F bytes -> 16 chars/1 line)
|
; Wrap logic for multiple lines
|
||||||
; Original loop: CPY #$001F. That's 32 bytes (16 chars).
|
; Line 1 ends at $1292 + $20 (32 bytes) = $12B2?
|
||||||
; The BookEntries had 3 lines defined but the loop only did 1 line?
|
; Let's just assume the text includes padding or we handle newlines?
|
||||||
; Original:
|
; Simplified: The text data is pre-formatted to 16 chars per line.
|
||||||
; .loop
|
; We just copy linear data to linear VRAM.
|
||||||
; LDA.w BookEntries, X : STA.w $1292, Y
|
; But VRAM is linear in rows? Yes, usually.
|
||||||
; INY #2 : INX #2
|
; However, to jump to next line in tilemap we need to add stride.
|
||||||
; CPY.w #$001F : BCC .loop
|
; Row Width = $40 bytes (32 tiles * 2 bytes).
|
||||||
; Yes, it only copied the first line ($00 to $1E).
|
; If we write 16 chars (32 bytes), we need to skip 32 bytes to reach next line.
|
||||||
; We should probably copy more lines.
|
|
||||||
; Let's copy 6 lines ($60 bytes? No, $1F is 31. So 16 chars * 2 bytes = 32 bytes = $20)
|
CPY.w #$0020 : BNE .check_line_2
|
||||||
; Let's copy 3 lines = $60 bytes.
|
TYA : CLC : ADC.w #$0020 : TAY ; Skip to next line start
|
||||||
|
.check_line_2
|
||||||
CPY.w #$0060 : BCC .loop
|
CPY.w #$0060 : BNE .check_line_3 ; End of Line 2 ($20 + $40 = $60)
|
||||||
|
TYA : CLC : ADC.w #$0020 : TAY
|
||||||
|
.check_line_3
|
||||||
|
|
||||||
|
BRA .loop
|
||||||
|
|
||||||
|
.done
|
||||||
SEP #$30
|
SEP #$30
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -122,25 +218,30 @@ Journal_DrawEntry:
|
|||||||
; Data Tables
|
; Data Tables
|
||||||
; ---------------------------------------------------------
|
; ---------------------------------------------------------
|
||||||
|
|
||||||
JournalEntries:
|
; Format: Address(3), Mask(1), TextPtr(2) = 6 bytes
|
||||||
dw Entry_Page1
|
Journal_MasterList:
|
||||||
dw Entry_Page2
|
dl $7EF3D6 : db $02 : dw Entry_QuestStart ; OOSPROG bit 1 (Quest Start)
|
||||||
dw Entry_Page3
|
dl $7EF3D6 : db $10 : dw Entry_MetElder ; OOSPROG bit 4 (Met Elder)
|
||||||
|
dl $7EF3C6 : db $04 : dw Entry_MakuTree ; OOSPROG2 bit 2 (Maku Tree)
|
||||||
|
dw $0000 ; Terminator
|
||||||
|
|
||||||
Entry_Page1:
|
Entry_QuestStart:
|
||||||
dw "QUEST_LOG:_I____"
|
dw "Quest_Started___"
|
||||||
dw "Must_find_the___"
|
dw "Find_the_3_gems_"
|
||||||
|
dw "to_save_Hyrule__"
|
||||||
|
dw $FFFF
|
||||||
|
|
||||||
|
Entry_MetElder:
|
||||||
|
dw "Spoke_to_Elder__"
|
||||||
|
dw "He_mentioned_a__"
|
||||||
dw "missing_girl____"
|
dw "missing_girl____"
|
||||||
|
dw $FFFF
|
||||||
|
|
||||||
Entry_Page2:
|
Entry_MakuTree:
|
||||||
dw "QUEST_LOG:_II___"
|
dw "Met_Maku_Tree___"
|
||||||
dw "The_Mushroom_is_"
|
dw "He_needs_his____"
|
||||||
dw "key_to_the_woods"
|
dw "memory_back_____"
|
||||||
|
dw $FFFF
|
||||||
Entry_Page3:
|
|
||||||
dw "QUEST_LOG:_III__"
|
|
||||||
dw "Zora_River_flows"
|
|
||||||
dw "from_the_north__"
|
|
||||||
|
|
||||||
; ---------------------------------------------------------
|
; ---------------------------------------------------------
|
||||||
; Background Drawing
|
; Background Drawing
|
||||||
@@ -149,17 +250,44 @@ Entry_Page3:
|
|||||||
Menu_DrawJournal:
|
Menu_DrawJournal:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
LDA.l JournalState
|
|
||||||
ASL : TAX
|
; Logic to choose background based on page number?
|
||||||
JSR (.page_drawers, X)
|
; For now just cycle them 1-2-3-1-2-3
|
||||||
|
LDA.l JournalState : AND.w #$00FF
|
||||||
|
CLC : ADC.b #$01 ; Make 1-based?
|
||||||
|
; Modulo 3?
|
||||||
|
; Simple:
|
||||||
|
; 0 -> First
|
||||||
|
; Last -> Last
|
||||||
|
; Else -> Middle
|
||||||
|
|
||||||
|
; But we don't know which is last without counting.
|
||||||
|
; Let's just use First for 0, Last for Last, Middle for others.
|
||||||
|
|
||||||
|
LDA.l JournalState : AND.w #$00FF : BEQ .first
|
||||||
|
|
||||||
|
PHA
|
||||||
|
JSR Journal_CountUnlocked : DEC A : STA.b $02
|
||||||
|
PLA
|
||||||
|
CMP.b $02 : BEQ .last
|
||||||
|
|
||||||
|
BRA .middle
|
||||||
|
|
||||||
|
.first
|
||||||
|
JSR Journal_DrawFirstPage
|
||||||
|
BRA .exit
|
||||||
|
.last
|
||||||
|
JSR Journal_DrawLastPage
|
||||||
|
BRA .exit
|
||||||
|
.middle
|
||||||
|
JSR Journal_DrawMiddlePage
|
||||||
|
.exit
|
||||||
|
|
||||||
|
JSR Journal_DrawEntry
|
||||||
|
|
||||||
SEP #$30
|
SEP #$30
|
||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
|
|
||||||
.page_drawers
|
|
||||||
dw Journal_DrawFirstPage
|
|
||||||
dw Journal_DrawMiddlePage
|
|
||||||
dw Journal_DrawLastPage
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Journal_DrawFirstPage:
|
Journal_DrawFirstPage:
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ Menu_ItemNames:
|
|||||||
dw "MIRROR_OF_TIME "
|
dw "MIRROR_OF_TIME "
|
||||||
dw "____BOTTLE____ "
|
dw "____BOTTLE____ "
|
||||||
dw "___OCARINA____ "
|
dw "___OCARINA____ "
|
||||||
dw "_SECRET_TOME__ "
|
dw "TOME__L:REVEAL__"
|
||||||
dw "___SOMARIA____ "
|
dw "___SOMARIA____ "
|
||||||
dw "_FISHING_ROD__ "
|
dw "_FISHING_ROD__ "
|
||||||
dw "_ROCS_FEATHER_ "
|
dw "_ROCS_FEATHER_ "
|
||||||
@@ -423,7 +423,7 @@ Menu_DrawSelect:
|
|||||||
|
|
||||||
.loop
|
.loop
|
||||||
LDA.w SelectItemTXT, X : STA.w $1194, X
|
LDA.w SelectItemTXT, X : STA.w $1194, X
|
||||||
DEX #2 : BPL .loop
|
DEX : DEX : BPL .loop
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -437,7 +437,7 @@ Menu_DrawQuestStatus:
|
|||||||
|
|
||||||
.loop
|
.loop
|
||||||
LDA.w QuestStatusTXT, X : STA.w $1194, X
|
LDA.w QuestStatusTXT, X : STA.w $1194, X
|
||||||
DEX #2 : BPL .loop
|
DEX : DEX : BPL .loop
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -528,3 +528,16 @@ Menu_DrawCharacterName:
|
|||||||
LDA.w #$1D : BRA .write_to_screen
|
LDA.w #$1D : BRA .write_to_screen
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Menu_DrawRingPrompt:
|
||||||
|
{
|
||||||
|
REP #$30
|
||||||
|
LDX.w #$0E
|
||||||
|
|
||||||
|
.loop
|
||||||
|
LDA.w RingPromptTXT, X : STA.w $1254, X
|
||||||
|
DEX : DEX : BPL .loop
|
||||||
|
|
||||||
|
SEP #$30 ; Restore 8-bit mode before return
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user