let's dev 1/17/18
added bob toggle more updates to shops (fixed sprite overload issues)
This commit is contained in:
@@ -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, #$18, #$01, #$08 ; year/month/day
|
db #$20, #$18, #$01, #$17 ; year/month/day
|
||||||
|
|
||||||
;================================================================================
|
;================================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ DrawBonkItemGFX:
|
|||||||
.skipInit
|
.skipInit
|
||||||
|
|
||||||
JSR LoadBonkItem
|
JSR LoadBonkItem
|
||||||
JSL.l DrawDynamicTile
|
JSL.l DrawDynamicTileNoShadow
|
||||||
|
|
||||||
.done
|
.done
|
||||||
PLA
|
PLA
|
||||||
|
|||||||
@@ -1042,11 +1042,11 @@ JSL.l GetMagicBatItem
|
|||||||
;================================================================================
|
;================================================================================
|
||||||
; Replacement Shopkeeper
|
; Replacement Shopkeeper
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
;org $068BEB ; <- 30BEB - Bank07.asm:1125 - (INC $0BA0, X)
|
org $068BEB ; <- 30BEB - Bank07.asm:1125 - (INC $0BA0, X)
|
||||||
;JSL.l SpritePrep_ShopKeeper : RTS
|
JSL.l SpritePrep_ShopKeeper : RTS
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
;org $1EEEE3 ; <- F6EE3 - sprite_shopkeeper.asm:7 - (LDA $0E80, X)
|
org $1EEEE3 ; <- F6EE3 - sprite_shopkeeper.asm:7 - (LDA $0E80, X)
|
||||||
;JSL.l Sprite_ShopKeeper : RTS
|
JSL.l Sprite_ShopKeeper : RTS
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
|
||||||
;================================================================================
|
;================================================================================
|
||||||
|
|||||||
@@ -24,6 +24,38 @@ RTL
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
!BIGRAM = "$7EC900";
|
!BIGRAM = "$7EC900";
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
!SPRITE_OAM = "$7EC025"
|
||||||
|
; A = Tile ID
|
||||||
|
macro UploadOAM(dest)
|
||||||
|
PHA : PHP
|
||||||
|
|
||||||
|
PHA
|
||||||
|
REP #$20 ; set 16-bit accumulator
|
||||||
|
LDA.w #$0000 : STA.l !SPRITE_OAM
|
||||||
|
STA.l !SPRITE_OAM+2
|
||||||
|
LDA.w #$0200 : STA.l !SPRITE_OAM+6
|
||||||
|
SEP #$20 ; set 8-bit accumulator
|
||||||
|
LDA.b <dest> : STA.l !SPRITE_OAM+4
|
||||||
|
|
||||||
|
LDA $01,s
|
||||||
|
|
||||||
|
JSL.l GetSpritePalette
|
||||||
|
STA !SPRITE_OAM+5 : STA !SPRITE_OAM+13
|
||||||
|
PLA
|
||||||
|
JSL.l IsNarrowSprite : BCS .narrow
|
||||||
|
|
||||||
|
BRA .done
|
||||||
|
|
||||||
|
.narrow
|
||||||
|
REP #$20 ; set 16-bit accumulator
|
||||||
|
LDA.w #$0000 : STA.l !SPRITE_OAM+7
|
||||||
|
STA.l !SPRITE_OAM+14
|
||||||
|
LDA.w #$0800 : STA.l !SPRITE_OAM+9
|
||||||
|
LDA.w #$3400 : STA.l !SPRITE_OAM+11
|
||||||
|
|
||||||
|
.done
|
||||||
|
PLP : PLA
|
||||||
|
endmacro
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
; $0A : Digit Offset
|
; $0A : Digit Offset
|
||||||
; $0C-$0D : Value to Display
|
; $0C-$0D : Value to Display
|
||||||
@@ -51,6 +83,8 @@ macro DrawDigit(value,offset)
|
|||||||
LDA $0E : !ADD.w #$0008 : STA $0E ; move offset 8px right
|
LDA $0E : !ADD.w #$0008 : STA $0E ; move offset 8px right
|
||||||
endmacro
|
endmacro
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
!COLUMN_LOW = "$7F5020"
|
||||||
|
!COLUMN_HIGH = "$7F5021"
|
||||||
DrawPrice:
|
DrawPrice:
|
||||||
PHX : PHY : PHP
|
PHX : PHY : PHP
|
||||||
LDY.b #$FF
|
LDY.b #$FF
|
||||||
@@ -75,7 +109,16 @@ DrawPrice:
|
|||||||
|
|
||||||
SEP #$20 ; set 8-bit accumulator
|
SEP #$20 ; set 8-bit accumulator
|
||||||
TXA : LSR #3 : STA $06 ; request 1-4 OAM slots
|
TXA : LSR #3 : STA $06 ; request 1-4 OAM slots
|
||||||
ASL #2 : JSL.l OAM_AllocateFromRegionB ; request 4-16 bytes
|
;ASL #2 : JSL.l OAM_AllocateFromRegionB ; request 4-16 bytes
|
||||||
|
ASL #2
|
||||||
|
PHA
|
||||||
|
LDA $22 : CMP !COLUMN_LOW : !BLT .off
|
||||||
|
CMP !COLUMN_HIGH : !BGE .off
|
||||||
|
.on
|
||||||
|
PLA : JSL.l OAM_AllocateFromRegionB : BRA + ; request 4-16 bytes
|
||||||
|
.off
|
||||||
|
PLA : JSL.l OAM_AllocateFromRegionA ; request 4-16 bytes
|
||||||
|
+
|
||||||
TXA : LSR #3
|
TXA : LSR #3
|
||||||
PLP : PLY : PLX
|
PLP : PLY : PLX
|
||||||
RTS
|
RTS
|
||||||
@@ -88,8 +131,18 @@ dw 4, 0, -4, -8
|
|||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
SpritePrep_ShopKeeper:
|
SpritePrep_ShopKeeper:
|
||||||
|
|
||||||
|
;LDA.b #$AF ; Generic small key
|
||||||
|
LDA.b #$4F ; 1/4 magic
|
||||||
|
;%UploadOAM(#$24)
|
||||||
|
JSR.w LoadDynamicTileOAMTable
|
||||||
|
JSL.l GetSpriteID ; convert loot id to sprite id
|
||||||
|
JSL.l GetAnimatedSpriteTile_variable
|
||||||
|
;%UploadOAM(#$C2)
|
||||||
|
;%UploadOAM(#$C4)
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
!COLUMN_LOW = "$7F5020"
|
||||||
|
!COLUMN_HIGH = "$7F5021"
|
||||||
Sprite_ShopKeeper:
|
Sprite_ShopKeeper:
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
JSL.l Sprite_PlayerCantPassThrough
|
JSL.l Sprite_PlayerCantPassThrough
|
||||||
@@ -114,7 +167,12 @@ Sprite_ShopKeeper:
|
|||||||
|
|
||||||
; Draw Items
|
; Draw Items
|
||||||
LDA.b #$03 : STA $06 ; request 3 OAM slots
|
LDA.b #$03 : STA $06 ; request 3 OAM slots
|
||||||
LDA #$0C : JSL.l OAM_AllocateFromRegionA ; request 12 bytes
|
LDA $20 : CMP.b #$60 : !BGE .below
|
||||||
|
.above
|
||||||
|
LDA #$0C : JSL.l OAM_AllocateFromRegionA : BRA + ; request 12 bytes
|
||||||
|
.below
|
||||||
|
LDA #$0C : JSL.l OAM_AllocateFromRegionB ; request 12 bytes
|
||||||
|
+
|
||||||
LDA.b #$03 : STA $06 ; request 3 OAM slots
|
LDA.b #$03 : STA $06 ; request 3 OAM slots
|
||||||
STZ $07
|
STZ $07
|
||||||
LDA.b #.oam_items : STA $08
|
LDA.b #.oam_items : STA $08
|
||||||
@@ -126,6 +184,15 @@ Sprite_ShopKeeper:
|
|||||||
|
|
||||||
LDA.b #$00 : STA.l !SKIP_EOR
|
LDA.b #$00 : STA.l !SKIP_EOR
|
||||||
|
|
||||||
|
; $22
|
||||||
|
; 0x48 - Left
|
||||||
|
; 0x60 - Midpoint 1
|
||||||
|
; 0x78 - Center
|
||||||
|
; 0x90 - Midpoint 2
|
||||||
|
; 0xA8 - Right
|
||||||
|
|
||||||
|
LDA.b #$00 : STA !COLUMN_LOW
|
||||||
|
LDA.b #$60 : STA !COLUMN_HIGH
|
||||||
REP #$20 ; set 16-bit accumulator
|
REP #$20 ; set 16-bit accumulator
|
||||||
LDA.w #1234 : STA $0C ; set value
|
LDA.w #1234 : STA $0C ; set value
|
||||||
LDA.w #-40 : STA $0E ; set coordinate
|
LDA.w #-40 : STA $0E ; set coordinate
|
||||||
@@ -143,6 +210,8 @@ Sprite_ShopKeeper:
|
|||||||
PLA
|
PLA
|
||||||
!ADD $92 : STA $92
|
!ADD $92 : STA $92
|
||||||
|
|
||||||
|
LDA.b #$60 : STA !COLUMN_LOW
|
||||||
|
LDA.b #$90 : STA !COLUMN_HIGH
|
||||||
REP #$20 ; set 16-bit accumulator
|
REP #$20 ; set 16-bit accumulator
|
||||||
LDA.w #5678 : STA $0C ; set value
|
LDA.w #5678 : STA $0C ; set value
|
||||||
LDA.w #8 : STA $0E ; set coordinate
|
LDA.w #8 : STA $0E ; set coordinate
|
||||||
@@ -160,6 +229,8 @@ Sprite_ShopKeeper:
|
|||||||
PLA
|
PLA
|
||||||
!ADD $92 : STA $92
|
!ADD $92 : STA $92
|
||||||
|
|
||||||
|
LDA.b #$90 : STA !COLUMN_LOW
|
||||||
|
LDA.b #$FF : STA !COLUMN_HIGH
|
||||||
REP #$20 ; set 16-bit accumulator
|
REP #$20 ; set 16-bit accumulator
|
||||||
LDA.w #9012 : STA $0C ; set value
|
LDA.w #9012 : STA $0C ; set value
|
||||||
LDA.w #56 : STA $0E ; set coordinate
|
LDA.w #56 : STA $0E ; set coordinate
|
||||||
|
|||||||
@@ -724,6 +724,10 @@ org $308172 ; PC 0x180172
|
|||||||
GenericKeys:
|
GenericKeys:
|
||||||
db #$00 ; #00 = Dungeon-Specific Keys (Default) - #$01 = Generic Keys
|
db #$00 ; #00 = Dungeon-Specific Keys (Default) - #$01 = Generic Keys
|
||||||
;================================================================================
|
;================================================================================
|
||||||
|
org $308173 ; PC 0x180173
|
||||||
|
Bob:
|
||||||
|
db #$01 ; #00 = Off - #$01 = On (Default)
|
||||||
|
;================================================================================
|
||||||
org $308190 ; PC 0x180190
|
org $308190 ; PC 0x180190
|
||||||
TimerStyle:
|
TimerStyle:
|
||||||
db #$00 ; #$00 = Off (Default) - #$01 Countdown - #$02 = Stopwatch
|
db #$00 ; #$00 = Off (Default) - #$01 Countdown - #$02 = Stopwatch
|
||||||
|
|||||||
@@ -424,6 +424,7 @@ DrawDynamicTile:
|
|||||||
LDA #$7E : PHB : PHA : PLB
|
LDA #$7E : PHB : PHA : PLB
|
||||||
LDA.b #$01 : STA.l !SKIP_EOR
|
LDA.b #$01 : STA.l !SKIP_EOR
|
||||||
JSL Sprite_DrawMultiple_quantity_preset
|
JSL Sprite_DrawMultiple_quantity_preset
|
||||||
|
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
|
||||||
@@ -431,6 +432,32 @@ DrawDynamicTile:
|
|||||||
PLA
|
PLA
|
||||||
RTL
|
RTL
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
|
DrawDynamicTileNoShadow:
|
||||||
|
JSL.l IsNarrowSprite : BCS .narrow
|
||||||
|
|
||||||
|
.full
|
||||||
|
LDA.b #$01 : STA $06
|
||||||
|
LDA #$04 : JSL.l OAM_AllocateFromRegionC
|
||||||
|
BRA .draw
|
||||||
|
|
||||||
|
.narrow
|
||||||
|
LDA.b #$02 : STA $06
|
||||||
|
LDA #$08 : JSL.l OAM_AllocateFromRegionC
|
||||||
|
|
||||||
|
.draw
|
||||||
|
LDA.b #!SPRITE_OAM>>0 : STA $08
|
||||||
|
LDA.b #!SPRITE_OAM>>8 : STA $09
|
||||||
|
STZ $07
|
||||||
|
LDA #$7E : PHB : PHA : PLB
|
||||||
|
LDA.b #$01 : STA.l !SKIP_EOR
|
||||||
|
JSL Sprite_DrawMultiple_quantity_preset
|
||||||
|
LDA Bob : BNE + : LDA.b #$00 : STA.l !SKIP_EOR : + ; Bob fix is conditional
|
||||||
|
PLB
|
||||||
|
|
||||||
|
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
|
||||||
|
RTL
|
||||||
|
;--------------------------------------------------------------------------------
|
||||||
|
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
; Sprite_IsOnscreen
|
; Sprite_IsOnscreen
|
||||||
|
|||||||
Reference in New Issue
Block a user