preopen GT flag

also "corrected" some build errors
This commit is contained in:
sporchia
2019-08-24 08:50:25 -04:00
parent 607974caeb
commit 3fe95e2f1f
3 changed files with 54 additions and 46 deletions

View File

@@ -39,7 +39,7 @@ OnDungeonExit:
PLP : PLA PLP : PLA
STA $040C : STZ $04AC ; thing we wrote over STA $040C : STZ $04AC ; thing we wrote over
PHA : PHP PHA : PHP
JSL.l HUD_RebuildLong JSL.l HUD_RebuildLong
JSL.l FloodGateResetInner JSL.l FloodGateResetInner
@@ -55,7 +55,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnUncleItemGet: OnUncleItemGet:
JSL Link_ReceiveItem JSL Link_ReceiveItem
LDA.l EscapeAssist LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : + BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : +
BIT.b #$02 : BEQ + : STA !INFINITE_BOMBS : + BIT.b #$02 : BEQ + : STA !INFINITE_BOMBS : +
@@ -64,14 +64,14 @@ OnUncleItemGet:
LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA $7EF373 : + ; refill magic LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA $7EF373 : + ; refill magic
LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA $7EF375 : + ; refill bombs LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA $7EF375 : + ; refill bombs
LDA.l UncleRefill : BIT.b #$01 : BEQ + ; refill arrows LDA.l UncleRefill : BIT.b #$01 : BEQ + ; refill arrows
LDA.b #70 : STA $7EF376 LDA.b #70 : STA $7EF376
LDA.l ArrowMode : BEQ + LDA.l ArrowMode : BEQ +
LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 ; enable bow toggle LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 ; enable bow toggle
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA $7EF360 : !ADD.l FreeUncleItemAmount : STA $7EF360 ; rupee arrows, so also give the player some money to start LDA $7EF360 : !ADD.l FreeUncleItemAmount : STA $7EF360 ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnAga2Defeated: OnAga2Defeated:
@@ -124,7 +124,7 @@ OnNewFile:
LDA StartingEquipment, X : STA $7EF340, X LDA StartingEquipment, X : STA $7EF340, X
DEX : DEX DEX : DEX
BPL - BPL -
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 +
@@ -136,6 +136,10 @@ OnNewFile:
LDA.b #$20 : STA $7EF2DB ; pyramid hole already open LDA.b #$20 : STA $7EF2DB ; pyramid hole already open
+ +
LDA.l PreopenGanonsTower : BEQ +
LDA.b #$20 : STA $7EF2C3 ; Ganons Tower already open
+
LDA StartingSword : STA $7EF359 ; set starting sword type LDA StartingSword : STA $7EF359 ; set starting sword type
PLP : PLX PLP : PLX
RTL RTL
@@ -185,7 +189,7 @@ OnLoadDuckMap:
BNE + BNE +
INC : STA !DARK_DUCK_TEMP INC : STA !DARK_DUCK_TEMP
JSL OverworldMap_InitGfx : DEC $0200 JSL OverworldMap_InitGfx : DEC $0200
RTL RTL
+ +
LDA.b #$00 : STA !DARK_DUCK_TEMP LDA.b #$00 : STA !DARK_DUCK_TEMP

View File

@@ -376,7 +376,11 @@ org $30808B ; PC 0x18008B
PreopenPyramid: PreopenPyramid:
db $00 ; #$00 = Off (default) - #$01 = On db $00 ; #$00 = Off (default) - #$01 = On
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x18008C - 0x18008F (unused) org $30808C ; PC 0x18008C
PreopenGanonsTower:
db $00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
; 0x18008D - 0x18008F (unused)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $308090 ; PC 0x180090 - 0x180097 org $308090 ; PC 0x180090 - 0x180097
ProgressiveSwordLimit: ProgressiveSwordLimit:

View File

@@ -89,20 +89,20 @@ RTL
.gfxSlots .gfxSlots
db $06, $44, $45, $46, $2D, $20, $2E, $09 db $06, $44, $45, $46, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17 db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $28, $27, $04, $04, $0F, $16, $03, $13 db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00 db $01, $1E, $10, $00, $00, $00, $00, $00
db $00, $30, $22, $21, $24, $24, $24, $23 db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03 db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $34, $35, $31, $33, $02, $32, $36, $37 db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $43, $0C, $38, $39, $3A, $F9, $3C db $2C, $43, $0C, $38, $39, $3A, $F9, $3C
; db $2C, $06, $0C, $38, $FF, $FF, $FF, $FF ; db $2C, $06, $0C, $38, $FF, $FF, $FF, $FF
;5x ;5x
db $44 ; Safe Master Sword db $44 ; Safe Master Sword
db $3D, $3E, $3F, $40 ; Bomb & Arrow +5/+10 db $3D, $3E, $3F, $40 ; Bomb & Arrow +5/+10
@@ -112,7 +112,7 @@ RTL
db $47 ; Null Item db $47 ; Null Item
db $48, $48, $48 ; Red, Blue & Green Clocks db $48, $48, $48 ; Red, Blue & Green Clocks
db $FE, $FF ; Progressive Sword & Shield db $FE, $FF ; Progressive Sword & Shield
;6x ;6x
db $FD, $0D ; Progressive Armor & Gloves db $FD, $0D ; Progressive Armor & Gloves
db $FA, $FB ; RNG Single & Multi db $FA, $FB ; RNG Single & Multi
@@ -120,19 +120,19 @@ RTL
db $FF, $FF, $FF, $FF ; Unused db $FF, $FF, $FF, $FF ; Unused
db $49, $4A, $49 ; Goal Item Single, Multi & Alt Multi db $49, $4A, $49 ; Goal Item Single, Multi & Alt Multi
db $FF, $FF, $FF ; Unused db $FF, $FF, $FF ; Unused
;7x ;7x
db $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21 ; Free Map db $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21 ; Free Map
;8x ;8x
db $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16 ; Free Compass db $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16 ; Free Compass
;9x ;9x
db $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22 ; Free Big Key db $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22 ; Free Big Key
;Ax ;Ax
db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
@@ -228,20 +228,20 @@ RTL
.gfxPalettes .gfxPalettes
db $00, $04, $02, $08, $04, $02, $08, $02 db $00, $04, $02, $08, $04, $02, $08, $02
db $04, $02, $02, $02, $04, $04, $04, $08 db $04, $02, $02, $02, $04, $04, $04, $08
db $08, $08, $02, $02, $04, $02, $02, $02 db $08, $08, $02, $02, $04, $02, $02, $02
db $04, $02, $04, $02, $08, $08, $04, $02 db $04, $02, $04, $02, $08, $08, $04, $02
db $0A, $02, $04, $02, $04, $04, $00, $04 db $0A, $02, $04, $02, $04, $04, $00, $04
db $04, $08, $02, $02, $08, $04, $02, $08 db $04, $08, $02, $02, $08, $04, $02, $08
db $04, $04, $08, $08, $08, $04, $02, $08 db $04, $04, $08, $08, $08, $04, $02, $08
db $02, $04, $08, $02, $04, $04, $02, $02 db $02, $04, $08, $02, $04, $04, $02, $02
db $08, $08, $02, $04, $04, $08, $08, $08 db $08, $08, $02, $04, $04, $08, $08, $08
db $04, $04, $04, $02, $08, $08, $08, $08 db $04, $04, $04, $02, $08, $08, $08, $08
; db $04, $0A, $04, $02, $FF, $FF, $FF, $FF ; db $04, $0A, $04, $02, $FF, $FF, $FF, $FF
db $04 ; Safe Master Sword db $04 ; Safe Master Sword
db $08, $08, $08, $08 ; Bomb & Arrow +5/+10 db $08, $08, $08, $08 ; Bomb & Arrow +5/+10
db $04, $00, $00 ; Programmable Items 1-3 db $04, $00, $00 ; Programmable Items 1-3
@@ -319,10 +319,10 @@ IsNarrowSprite:
++ CMP.b #$63 : BNE ++ ; RNG Item (Multi) ++ CMP.b #$63 : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti JSL.l GetRNGItemMulti
++ ++
.continue .continue
;-------- ;--------
LDX.b #$00 ; set index counter to 0 LDX.b #$00 ; set index counter to 0
;---- ;----
- -
@@ -374,7 +374,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadDynamicTileOAMTable: LoadDynamicTileOAMTable:
PHA : PHP PHA : PHP
PHA PHA
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.w #$0000 : STA.l !SPRITE_OAM LDA.w #$0000 : STA.l !SPRITE_OAM
@@ -382,23 +382,23 @@ LoadDynamicTileOAMTable:
LDA.w #$0200 : STA.l !SPRITE_OAM+6 LDA.w #$0200 : STA.l !SPRITE_OAM+6
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA.b #$24 : STA.l !SPRITE_OAM+4 LDA.b #$24 : STA.l !SPRITE_OAM+4
LDA $01,s LDA $01,s
JSL.l GetSpritePalette JSL.l GetSpritePalette
STA !SPRITE_OAM+5 : STA !SPRITE_OAM+13 STA !SPRITE_OAM+5 : STA !SPRITE_OAM+13
PLA PLA
JSL.l IsNarrowSprite : BCS .narrow JSL.l IsNarrowSprite : BCS .narrow
BRA .done BRA .done
.narrow .narrow
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.w #$0000 : STA.l !SPRITE_OAM+7 LDA.w #$0000 : STA.l !SPRITE_OAM+7
STA.l !SPRITE_OAM+14 STA.l !SPRITE_OAM+14
LDA.w #$0800 : STA.l !SPRITE_OAM+9 LDA.w #$0800 : STA.l !SPRITE_OAM+9
LDA.w #$3400 : STA.l !SPRITE_OAM+11 LDA.w #$3400 : STA.l !SPRITE_OAM+11
.done .done
PLP : PLA PLP : PLA
RTS RTS
@@ -416,18 +416,18 @@ RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawDynamicTile: DrawDynamicTile:
JSL.l IsNarrowSprite : BCS .narrow JSL.l IsNarrowSprite : BCS .narrow
.full .full
LDA.b #$01 : STA $06 LDA.b #$01 : STA $06
LDA #$0C : JSL.l OAM_AllocateFromRegionC LDA #$0C : JSL.l OAM_AllocateFromRegionC
LDA #$02 : PHA LDA #$02 : PHA
BRA .draw BRA .draw
.narrow .narrow
LDA.b #$02 : STA $06 LDA.b #$02 : STA $06
LDA #$10 : JSL.l OAM_AllocateFromRegionC LDA #$10 : JSL.l OAM_AllocateFromRegionC
LDA #$03 : PHA LDA #$03 : PHA
.draw .draw
LDA.b #!SPRITE_OAM>>0 : STA $08 LDA.b #!SPRITE_OAM>>0 : STA $08
LDA.b #!SPRITE_OAM>>8 : STA $09 LDA.b #!SPRITE_OAM>>8 : STA $09
@@ -437,7 +437,7 @@ DrawDynamicTile:
JSL Sprite_DrawMultiple_quantity_preset JSL Sprite_DrawMultiple_quantity_preset
LDA.b #$00 : STA.l !SKIP_EOR LDA.b #$00 : STA.l !SKIP_EOR
PLB PLB
LDA $90 : !ADD.b #$08 : STA $90 ; leave the pointer in the right spot to draw the shadow, if desired LDA $90 : !ADD.b #$08 : STA $90 ; leave the pointer in the right spot to draw the shadow, if desired
LDA $92 : INC #2 : STA $92 LDA $92 : INC #2 : STA $92
PLA PLA
@@ -445,16 +445,16 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawDynamicTileNoShadow: DrawDynamicTileNoShadow:
JSL.l IsNarrowSprite : BCS .narrow JSL.l IsNarrowSprite : BCS .narrow
.full .full
LDA.b #$01 : STA $06 LDA.b #$01 : STA $06
LDA #$04 : JSL.l OAM_AllocateFromRegionC LDA #$04 : JSL.l OAM_AllocateFromRegionC
BRA .draw BRA .draw
.narrow .narrow
LDA.b #$02 : STA $06 LDA.b #$02 : STA $06
LDA #$08 : JSL.l OAM_AllocateFromRegionC LDA #$08 : JSL.l OAM_AllocateFromRegionC
.draw .draw
LDA.b #!SPRITE_OAM>>0 : STA $08 LDA.b #!SPRITE_OAM>>0 : STA $08
LDA.b #!SPRITE_OAM>>8 : STA $09 LDA.b #!SPRITE_OAM>>8 : STA $09
@@ -464,7 +464,7 @@ DrawDynamicTileNoShadow:
JSL Sprite_DrawMultiple_quantity_preset JSL Sprite_DrawMultiple_quantity_preset
LDA Bob : BNE + : LDA.b #$00 : STA.l !SKIP_EOR : + ; Bob fix is conditional LDA Bob : BNE + : LDA.b #$00 : STA.l !SKIP_EOR : + ; Bob fix is conditional
PLB PLB
LDA $90 : !ADD.b #$08 : STA $90 LDA $90 : !ADD.b #$08 : STA $90
LDA $92 : INC #2 : STA $92 LDA $92 : INC #2 : STA $92
RTL RTL
@@ -662,7 +662,7 @@ db #00, #01, #01, #02, #01, #02, #02, #03, #01, #02, #02, #03, #02, #03, #03, #0
; CMP.w #1 : !BLT + ; CMP.w #1 : !BLT +
; PHA : SEP #$20 : LDA $7F5007 : INC : STA $7F5007 : REP #$20 : PLA ; PHA : SEP #$20 : LDA $7F5007 : INC : STA $7F5007 : REP #$20 : PLA
; !SUB.w #1 : BRA - ; !SUB.w #1 : BRA -
; + ; +
; PLA ; PLA
;RTL ;RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -677,7 +677,7 @@ WriteVRAMStripe:
PHX PHX
LDX $1000 ; get pointer LDX $1000 ; get pointer
AND.w #$7F : STA $1002, X : INX #2 ; set destination AND.w #$7F : STA $1002, X : INX #2 ; set destination
PLA : ASL : AND.w #7FFF : ORA.w #7000 : STA $1002, X : INX #2 ; set length and enable RLE PLA : ASL : AND.w #$7FFF : ORA.w #$7000 : STA $1002, X : INX #2 ; set length and enable RLE
TYA : STA $1002, X : INX #2 ; set tile TYA : STA $1002, X : INX #2 ; set tile
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
LDA.b #$FF : STA $1002, X LDA.b #$FF : STA $1002, X
@@ -693,12 +693,12 @@ RTL
; in: X(w) - Length in Tiles ; in: X(w) - Length in Tiles
; in: Y(w) - Address of Data to Copy ; in: Y(w) - Address of Data to Copy
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
WriteVRAMStripe: WriteVRAMBlock:
PHX PHX
LDX $1000 ; get pointer LDX $1000 ; get pointer
AND.w #$7F : STA $1002, X : INX #2 ; set destination AND.w #$7F : STA $1002, X : INX #2 ; set destination
PLA : ASL : AND.w #3FFF : STA $1002, X : INX #2 ; set length PLA : ASL : AND.w #$3FFF : STA $1002, X : INX #2 ; set length
PHX PHX
TYX ; set X to source TYX ; set X to source
PHA PHA
@@ -706,7 +706,7 @@ WriteVRAMStripe:
PLA PLA
;A is already the value we need for mvn ;A is already the value we need for mvn
MVN $7F7E ; currently we transfer from our buffers in 7F to the vram buffer in 7E MVN $7F7E ; currently we transfer from our buffers in 7F to the vram buffer in 7E
!ADD 1, s ; add the length in A to the stack pointer on the top of the stack !ADD 1, s ; add the length in A to the stack pointer on the top of the stack
PLX : TAX ; pull and promptly ignore, copying the value we just got over it PLX : TAX ; pull and promptly ignore, copying the value we just got over it
@@ -731,4 +731,4 @@ RTL
;RLE feature: ;RLE feature:
;This feature makes it easy to draw the same tile repeatedly. If this bit is set, the length bits should be set to 2 times the number of copies of the tile to upload. (Without subtracting 1!) ;This feature makes it easy to draw the same tile repeatedly. If this bit is set, the length bits should be set to 2 times the number of copies of the tile to upload. (Without subtracting 1!)
;It is followed by a single tile (word). Combining this this with the D bit makes it easy to draw large horizontal or vertical runs of a tile without using much space. Geat for erasing or drawing horizontal or verical box edges. ;It is followed by a single tile (word). Combining this this with the D bit makes it easy to draw large horizontal or vertical runs of a tile without using much space. Geat for erasing or drawing horizontal or verical box edges.
;================================================================================ ;================================================================================