mirror of
https://github.com/blondie7575/GSCats.git
synced 2025-01-20 00:30:02 +00:00
Added power indicator to crosshair
Fixed years-old bug in terrain unclipper which caused it to spray garbage in bank 3. My god, what a bug.
This commit is contained in:
parent
3b7ab68342
commit
4a9958e5ac
BIN
Art/015Crosshair1.gif
Normal file
BIN
Art/015Crosshair1.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 123 B |
BIN
Art/015Crosshair1.xcf
Normal file
BIN
Art/015Crosshair1.xcf
Normal file
Binary file not shown.
Before Width: | Height: | Size: 127 B After Width: | Height: | Size: 127 B |
BIN
Art/017Crosshair3.gif
Normal file
BIN
Art/017Crosshair3.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 B |
BIN
Art/017Crosshair3.xcf
Normal file
BIN
Art/017Crosshair3.xcf
Normal file
Binary file not shown.
BIN
Art/018Crosshair4.gif
Normal file
BIN
Art/018Crosshair4.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 130 B |
BIN
Art/018Crosshair4.xcf
Normal file
BIN
Art/018Crosshair4.xcf
Normal file
Binary file not shown.
BIN
Art/019Crosshair5.gif
Normal file
BIN
Art/019Crosshair5.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 130 B |
BIN
Art/019Crosshair5.xcf
Normal file
BIN
Art/019Crosshair5.xcf
Normal file
Binary file not shown.
Binary file not shown.
18
crosshair.s
18
crosshair.s
@ -18,11 +18,11 @@ crosshairGameObject:
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; updateCrosshair
|
||||
;
|
||||
; Y = Player index to render for
|
||||
; Y = Player index to update for
|
||||
; Trashes SCRATCHL, PARAML0, PARAML1
|
||||
;
|
||||
updateCrosshair:
|
||||
SAVE_AX
|
||||
SAVE_AXY
|
||||
|
||||
PLAYERPTR_Y
|
||||
|
||||
@ -68,19 +68,28 @@ updateCrosshairCalcY:
|
||||
|
||||
updateCrosshairDone:
|
||||
|
||||
RESTORE_AX
|
||||
RESTORE_AXY
|
||||
rts
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; renderCrosshair
|
||||
;
|
||||
; Y = Player index to render for
|
||||
; Trashes Y,PARAML0,SCRATCHL
|
||||
;
|
||||
renderCrosshair:
|
||||
pha
|
||||
PLAYERPTR_Y
|
||||
|
||||
lda #crosshairGameObject
|
||||
sta PARAML0
|
||||
lda #15
|
||||
|
||||
lda playerData+PD_POWER,y ; Choose reticle size for power level
|
||||
sta SCRATCHL
|
||||
lda #14
|
||||
clc
|
||||
adc SCRATCHL
|
||||
jsr renderGameObject
|
||||
|
||||
renderCrosshairDone:
|
||||
@ -91,6 +100,7 @@ renderCrosshairDone:
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; unrenderCrosshair
|
||||
;
|
||||
; Trashes PARAML0
|
||||
;
|
||||
unrenderCrosshair:
|
||||
pha
|
||||
|
@ -103,24 +103,31 @@ gameplayLoopBeginUpdate:
|
||||
lda projectileActive ; Skip interactivity during shots, but still allow map scrolling
|
||||
bpl gameplayLoopShotTracking
|
||||
lda dirtExplosionActive
|
||||
bne gameplayLoopRender ; Skip interactivity during dirt explosions
|
||||
bne gameplayLoopRenderJump ; Skip interactivity during dirt explosions
|
||||
bra gameplayLoopScroll
|
||||
|
||||
gameplayLoopRenderJump:
|
||||
jmp gameplayLoopRender
|
||||
|
||||
gameplayLoopShotTracking:
|
||||
jsr trackActiveShot
|
||||
|
||||
; BORDER_COLOR #$1
|
||||
|
||||
gameplayLoopScroll:
|
||||
|
||||
; Scroll map if needed
|
||||
lda mapScrollRequested
|
||||
bmi gameplayLoopAngleCheck
|
||||
|
||||
jsr scrollMap
|
||||
|
||||
|
||||
gameplayLoopAngleCheck:
|
||||
lda projectileActive ; Skip interactivity during shots
|
||||
bpl gameplayLoopRender
|
||||
bpl gameplayLoopRenderJmp
|
||||
bra gameplayLoopAngle
|
||||
gameplayLoopRenderJmp:
|
||||
jmp gameplayLoopRender
|
||||
|
||||
gameplayLoopAngle:
|
||||
; Update aim angle if needed
|
||||
@ -328,6 +335,13 @@ scrollMap:
|
||||
jsr unrenderPlayers
|
||||
jsr unrenderProjectiles
|
||||
|
||||
pha
|
||||
lda projectileActive ; Crosshair is visible if projectile isn't
|
||||
beq scrollMapApplyScrolling
|
||||
jsr unrenderCrosshair
|
||||
|
||||
scrollMapApplyScrolling:
|
||||
pla
|
||||
; jsr updateProjectilePhysics ; Good idea?
|
||||
|
||||
sta mapScrollPos
|
||||
@ -345,6 +359,7 @@ scrollMap:
|
||||
jsr protectProjectiles
|
||||
jsr renderPlayers
|
||||
jsr renderProjectiles ; Prevents flicker, but ads jitter to shot tracking
|
||||
|
||||
lda #1
|
||||
sta terrainDirty
|
||||
stz projectilesDirty
|
||||
|
5
input.s
5
input.s
@ -35,7 +35,7 @@ kbdScanGameplay:
|
||||
cmp #(' ' + $80)
|
||||
beq kbdScanSpace
|
||||
cmp #(9 + $80)
|
||||
bne kbdScanDone
|
||||
bne kbdScanDebugPiggyback
|
||||
jmp kbdScanTab
|
||||
|
||||
kbdScanDone:
|
||||
@ -47,7 +47,8 @@ kbdScanDebug:
|
||||
lda KBD
|
||||
bpl kbdScanDone
|
||||
sta KBDSTROBE
|
||||
|
||||
|
||||
kbdScanDebugPiggyback:
|
||||
cmp #(27 + $80)
|
||||
beq kbdScanESC
|
||||
cmp #(127 + $80)
|
||||
|
14
macros.s
14
macros.s
@ -242,6 +242,20 @@ done:
|
||||
.endmacro
|
||||
|
||||
|
||||
.macro MEMCHK ; Check to see when a memory value has been stepped on
|
||||
.local chkdone
|
||||
pha
|
||||
lda $0311CC
|
||||
cmp #$4242
|
||||
bne chkdone
|
||||
lda #1
|
||||
sta $e1c029
|
||||
pla
|
||||
brk
|
||||
chkdone:
|
||||
pla
|
||||
.endmacro
|
||||
|
||||
;;;;;;;;;;
|
||||
; Stack Macros
|
||||
|
||||
|
11
player.s
11
player.s
@ -61,6 +61,9 @@ PD_CURRWEAPON = 166
|
||||
PD_TREATS = 168
|
||||
PD_SIZE = 256
|
||||
|
||||
MAX_POWER = 5
|
||||
MAX_ANGLE = 180
|
||||
|
||||
.macro PLAYERPTR_Y
|
||||
tya ; Pointer to player structure from index
|
||||
asl
|
||||
@ -125,7 +128,7 @@ playerDeltaAngle:
|
||||
clc
|
||||
adc playerData+PD_ANGLE,y
|
||||
bmi playerDeltaAngleClampLow
|
||||
cmp #180
|
||||
cmp #MAX_ANGLE
|
||||
bpl playerDeltaAngleClampHigh
|
||||
|
||||
playerDeltaAngleStore:
|
||||
@ -138,7 +141,7 @@ playerDeltaAngleClampLow:
|
||||
bra playerDeltaAngleStore
|
||||
|
||||
playerDeltaAngleClampHigh:
|
||||
lda #180
|
||||
lda #MAX_ANGLE
|
||||
bra playerDeltaAngleStore
|
||||
|
||||
|
||||
@ -156,7 +159,7 @@ playerDeltaPower:
|
||||
clc
|
||||
adc playerData+PD_POWER,y
|
||||
beq playerDeltaPowerClampLow
|
||||
cmp #15
|
||||
cmp #MAX_POWER
|
||||
bpl playerDeltaPowerClampHigh
|
||||
|
||||
playerDeltaPowerStore:
|
||||
@ -169,7 +172,7 @@ playerDeltaPowerClampLow:
|
||||
bra playerDeltaPowerStore
|
||||
|
||||
playerDeltaPowerClampHigh:
|
||||
lda #15
|
||||
lda #MAX_POWER
|
||||
bra playerDeltaPowerStore
|
||||
|
||||
|
||||
|
@ -2,18 +2,20 @@
|
||||
|
||||
|
||||
DrawSpriteBank :
|
||||
ASL ; A=Sprite Number ($0000-$000F)
|
||||
ASL ; A=Sprite Number ($0000-$0013)
|
||||
TAX ; Y=Target Screen Address ($2000-$9D00)
|
||||
LDA SpriteBankNum,X ; Relative Sprite Number Table
|
||||
JMP (SpriteBankBank,X) ; Bank Number Table
|
||||
|
||||
SpriteBankNum :
|
||||
.dbyt $0100,$0000,$0A00,$0500,$0600,$0900,$0E00,$0D00
|
||||
.dbyt $0800,$0700,$0C00,$0F00,$0200,$0300,$0400,$0B00
|
||||
.dbyt $0100,$0000,$0C00,$0500,$0600,$0B00,$1200,$1000
|
||||
.dbyt $0A00,$0900,$0F00,$1300,$0200,$0300,$0400,$1100
|
||||
.dbyt $0E00,$0D00,$0800,$0700
|
||||
|
||||
SpriteBankBank :
|
||||
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
|
||||
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
|
||||
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
|
||||
|
||||
SpriteBankBank00 :
|
||||
JSL $AA0000
|
||||
|
@ -206,6 +206,7 @@ clipTerrainLoop:
|
||||
; On first move-left unclip every second row is unclipped incorrectly
|
||||
unclipTerrain:
|
||||
SAVE_AXY
|
||||
|
||||
|
||||
phd
|
||||
lda #(CLIPPEDTERRAINSTACK & $f000)
|
||||
@ -220,9 +221,8 @@ unclipTerrain:
|
||||
sec ; Find stopping point for stack-relative addressing
|
||||
lda clippedTerrainStackPtr
|
||||
and #$0fff
|
||||
sbc #7 ; 4 bytes past top of stack, +3 for starting offset
|
||||
sbc #3 ; -3 for starting offset
|
||||
sta STACKPTR
|
||||
|
||||
lda #$0fff-3 ; Start at the bottom of the stack
|
||||
tax
|
||||
|
||||
@ -234,7 +234,6 @@ unclipTerrainLoop:
|
||||
|
||||
lda 0,x
|
||||
sta compiledTerrain,y
|
||||
|
||||
tya
|
||||
sec
|
||||
sbc #COMPILEDTERRAINROW+2
|
||||
@ -244,7 +243,7 @@ unclipTerrainLoop:
|
||||
dex
|
||||
dex
|
||||
dex
|
||||
cpx STACKPTR ;#$e6f-7 ;$1000 ; When x hits the top of the stack, we're done
|
||||
cpx STACKPTR ; When x hits the top of the stack, we're done
|
||||
bne unclipTerrainLoop
|
||||
|
||||
pld
|
||||
|
Loading…
x
Reference in New Issue
Block a user