mirror of
https://github.com/blondie7575/GSCats.git
synced 2024-11-22 06:31:48 +00:00
Basic sine wave terrain test
This commit is contained in:
parent
b60043e4b2
commit
e7f4a0b256
BIN
gscats.2mg
BIN
gscats.2mg
Binary file not shown.
11
terrain.s
11
terrain.s
@ -33,6 +33,7 @@ renderTerrainColumn:
|
|||||||
lda terrainData,y
|
lda terrainData,y
|
||||||
and #$00ff
|
and #$00ff
|
||||||
tax
|
tax
|
||||||
|
inx ; Prevent x from going negative upon entry to loop
|
||||||
|
|
||||||
renderTerrainColumnLoop:
|
renderTerrainColumnLoop:
|
||||||
dex
|
dex
|
||||||
@ -86,9 +87,17 @@ generateTerrain:
|
|||||||
ldy #0
|
ldy #0
|
||||||
lda #terrainData
|
lda #terrainData
|
||||||
sta SCRATCHL
|
sta SCRATCHL
|
||||||
lda #MAXTERRAINHEIGHT
|
|
||||||
|
|
||||||
generateTerrainLoop:
|
generateTerrainLoop:
|
||||||
|
|
||||||
|
phy
|
||||||
|
tya ; Pull an interesting value out of the sine table
|
||||||
|
and #$00ff
|
||||||
|
tay
|
||||||
|
lda sineTable,y
|
||||||
|
and #$7f7f
|
||||||
|
ply
|
||||||
|
|
||||||
sta (SCRATCHL),y
|
sta (SCRATCHL),y
|
||||||
iny
|
iny
|
||||||
cpy #TERRAINWIDTH/4
|
cpy #TERRAINWIDTH/4
|
||||||
|
Loading…
Reference in New Issue
Block a user