Basic sine wave terrain test

This commit is contained in:
blondie7575 2017-07-30 12:16:19 -07:00
parent b60043e4b2
commit e7f4a0b256
2 changed files with 10 additions and 1 deletions

Binary file not shown.

View File

@ -33,6 +33,7 @@ renderTerrainColumn:
lda terrainData,y
and #$00ff
tax
inx ; Prevent x from going negative upon entry to loop
renderTerrainColumnLoop:
dex
@ -86,9 +87,17 @@ generateTerrain:
ldy #0
lda #terrainData
sta SCRATCHL
lda #MAXTERRAINHEIGHT
generateTerrainLoop:
phy
tya ; Pull an interesting value out of the sine table
and #$00ff
tay
lda sineTable,y
and #$7f7f
ply
sta (SCRATCHL),y
iny
cpy #TERRAINWIDTH/4