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 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