let's dev 11/14/17

added support for starting equipment
started implementing quickmenu-B (not finished)
fixed item stats problem after the most recently visited location indoors was a shop
fixed problem with big keys giving access to all keys rather than none
fixed ambigious code in recent pull request
added additional fixes to protect against credits corruption
This commit is contained in:
Karkat
2017-11-14 23:45:36 -05:00
parent d2665d0971
commit b1cd5886d2
8 changed files with 82 additions and 21 deletions

View File

@@ -26,7 +26,7 @@ org $3FFFFF ; <- 1FFFFF
db #$00 ; expand file to 2mb db #$00 ; expand file to 2mb
org $1FFFF8 ; <- FFFF8 timestamp rom org $1FFFF8 ; <- FFFF8 timestamp rom
db #$20, #$17, #$10, #$22 ; year/month/day db #$20, #$17, #$11, #$14 ; year/month/day
;================================================================================ ;================================================================================
@@ -216,10 +216,20 @@ Static_RNG: ; each line below is 512 bytes of rng
incsrc staticrng.asm incsrc staticrng.asm
warnpc $AF8401 warnpc $AF8401
;================================================================================ ;================================================================================
;bank $2F reserved for tournament use ;Bank Map
;bank $3A reserved for downstream use (Plandomizer) ;$20 Code Bank
;bank $3B reserved for downstream use (Plandomizer) ;$21 Reserved (Frame Hook & Init)
;bank $3F reserved for internal debugging ;$22 Contrib Code
;$23 Stats & Credits
;$24 Code Bank
;$30 Main Configuration Table
;$31 Graphics Bank
;$32 Text Bank
;$33 Graphics Bank
;$2F reserved for tournament use
;$3A reserved for downstream use (Plandomizer)
;$3B reserved for downstream use (Plandomizer)
;$3F reserved for internal debugging
;$7F5700 - $7F57FF reserved for downstream use ;$7F5700 - $7F57FF reserved for downstream use
;================================================================================ ;================================================================================
;org $0080DC ; <- 0xDC - Bank00.asm:179 - Kill Music ;org $0080DC ; <- 0xDC - Bank00.asm:179 - Kill Music

View File

@@ -49,10 +49,17 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!RNG_ITEM_LOCK_IN = "$7F5090" !RNG_ITEM_LOCK_IN = "$7F5090"
OnNewFile: OnNewFile:
PHX : PHP
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.l LinkStartingRupees : STA $7EF362 : STA $7EF360 LDA.l LinkStartingRupees : STA $7EF362 : STA $7EF360
LDA.l StartingTime : STA $7EF454 LDA.l StartingTime : STA $7EF454
LDA.l StartingTime+2 : STA $7EF454+2 LDA.l StartingTime+2 : STA $7EF454+2
LDX.w #$00 : - ; copy over starting equipment
LDA StartingEquipment, X : STA $7EF340, X
INX : INX
CPX.w #$004B : !BLT -
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
;LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in ;LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in
LDA.l PreopenCurtains : BEQ + LDA.l PreopenCurtains : BEQ +
@@ -60,6 +67,7 @@ OnNewFile:
LDA.b #$80 : STA $7EF093 ; open skull woods curtain LDA.b #$80 : STA $7EF093 ; open skull woods curtain
+ +
LDA StartingSword : STA $7EF359 ; set starting sword type LDA StartingSword : STA $7EF359 ; set starting sword type
PLP : PLX
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnLinkDamaged: OnLinkDamaged:

View File

@@ -658,6 +658,9 @@ NOP
org $0DE12D ; <- 6E12D - equipment.asm : 828 org $0DE12D ; <- 6E12D - equipment.asm : 828
JSL.l CloseBottleMenu JSL.l CloseBottleMenu
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $0DDF1E ; <- 6DF1E - equipment.asm : 462 - LDA $F4 : AND.b #$10 : BEQ .dontLeaveMenu
JSL.l CheckCloseItemMenu
;--------------------------------------------------------------------------------
org $0DEE70 ; <- 6EE70 - equipment.asm : 2137 org $0DEE70 ; <- 6EE70 - equipment.asm : 2137
JSL.l PrepItemScreenBigKey JSL.l PrepItemScreenBigKey
NOP NOP

View File

@@ -235,7 +235,8 @@ AddInventory:
+ +
CPY.b #$3B : BNE + : BRL .dungeonCounts : + ; Silver Arrow Bow - Skip Shop/Fairy Check for Silver Arrow Bow CPY.b #$3B : BNE + : BRL .dungeonCounts : + ; Silver Arrow Bow - Skip Shop/Fairy Check for Silver Arrow Bow
LDA $02E9 : CMP #$01 : BEQ ++ ; skip shop check for chests LDA $1B : BEQ ++ ; skip shop check if outdoors
LDA $02E9 : CMP.b #$01 : BEQ ++ ; skip shop check for chests
PHP : REP #$20 ; set 16-bit accumulator PHP : REP #$20 ; set 16-bit accumulator
LDA $048E LDA $048E
CMP.w #274 : BNE + : BRL .shop : + ; dark world death mountain shop, ornamental shield shop CMP.w #274 : BNE + : BRL .shop : + ; dark world death mountain shop, ornamental shield shop

View File

@@ -723,7 +723,25 @@ AddReceivedItemExpanded:
.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc .item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100 dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004 dw $0080, $0040, $0020, $0010, $0008, $0004, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000
db $00
dw $0000 ; Caves
} }
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
BottleListExpanded: BottleListExpanded:

View File

@@ -144,7 +144,7 @@ BringMenuDownEnhanced:
EOR.w #$FFFF : !ADD.w #$0001 ; negate menu speed EOR.w #$FFFF : !ADD.w #$0001 ; negate menu speed
!ADD.w $EA : CMP.w #$FF18 : !BGE .noOvershoot !ADD $EA : CMP.w #$FF18 : !BGE .noOvershoot
LDA.w #$FF18 ; if we went past the limit, go to the limit LDA.w #$FF18 ; if we went past the limit, go to the limit
.noOvershoot .noOvershoot
STA $EA : CMP.w #$FF18 STA $EA : CMP.w #$FF18
@@ -162,12 +162,19 @@ RaiseHudMenu:
LDA.l MenuSpeed : AND.w #$00FF LDA.l MenuSpeed : AND.w #$00FF
++ ++
!ADD.w $EA : BMI .noOvershoot !ADD $EA : BMI .noOvershoot
LDA.w #$0000 ; if we went past the limit, go to the limit LDA.w #$0000 ; if we went past the limit, go to the limit
.noOvershoot .noOvershoot
STA $EA STA $EA
RTL RTL
;================================================================================ ;================================================================================
CheckCloseItemMenu:
LDA.l MenuCollapse : BNE +
LDA $F4 : AND.b #$10 : RTL
+
LDA $F0 : AND.b #$10 : EOR.b #$10
RTL
;================================================================================
ShowDungeonItems: ShowDungeonItems:
LDA $040C : AND.w #$00FF : CMP.w #$00FF : BNE + : RTL : + ; return normal result if outdoors or in a cave LDA $040C : AND.w #$00FF : CMP.w #$00FF : BNE + : RTL : + ; return normal result if outdoors or in a cave
;LDA $F0 : AND.w #$0020 ; check for select ;LDA $F0 : AND.w #$0020 ; check for select

View File

@@ -379,6 +379,8 @@ StatsFinalPrep:
.done .done
PLP : PLX : PLA PLP : PLX : PLA
LDA.b #$19 : STA $10 ; thing we wrote over, load triforce room LDA.b #$19 : STA $10 ; thing we wrote over, load triforce room
STZ $11
STZ $B0
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Notes: ; Notes:

View File

@@ -131,7 +131,7 @@ org $30803B ; PC 0x18003B
MapMode: MapMode:
db #$00 ; #$00 = Always On (default) - #$01 = Require Map Item db #$00 ; #$00 = Always On (default) - #$01 = Require Map Item
CompassMode: CompassMode:
db #$00 ; #$00 = Off (default) - #$01 = Display Dungeon Count db #$02 ; #$00 = Off (default) - #$01 = Display Dungeon Count w/Compass - #$02 = Display Dungeon Count Always
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $30803D ; PC 0x18003D org $30803D ; PC 0x18003D
PersistentFloodgate: PersistentFloodgate:
@@ -189,6 +189,10 @@ db #$12 ; #$12 = Vwoop Up (Default) - #$20 = Menu Chime
org $0DE0E9 ; PC 0x6E0E9 (equipment.asm:780) ; Menu Up Chime org $0DE0E9 ; PC 0x6E0E9 (equipment.asm:780) ; Menu Up Chime
db #$12 ; #$12 = Vwoop Up (Default) - #$20 = Menu Chime db #$12 ; #$12 = Vwoop Up (Default) - #$20 = Menu Chime
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $308049 ; PC 0x180049
MenuCollapse:
db #$00 ; #$00 = Press Start (default) - #$10 = Release Start
;--------------------------------------------------------------------------------
org $308080 ; PC 0x180080 org $308080 ; PC 0x180080
Upgrade5BombsRefill: Upgrade5BombsRefill:
db #$00 db #$00
@@ -1317,3 +1321,11 @@ dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0AA8, $07AA, $0000, $0000, $0000, $0000, $0000 dw $0000, $0AA8, $07AA, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000 dw $0000, $0000, $0000, $0000, $0000, $0000
;=============================================================================== ;===============================================================================
org $30B000 ; PC 0x183000
StartingEquipment:
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $1818, $0000
dw $0000, $0000, $0000, $0000, $F800, $0000, $0000, $0000
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
;===============================================================================