diff --git a/GenerateVRAMTable.py b/GenerateVRAMTable.py index 2ad086e..11e0c81 100755 --- a/GenerateVRAMTable.py +++ b/GenerateVRAMTable.py @@ -6,7 +6,7 @@ import sys def main(argv): # Prologue - print ("vramRowEnds:",end="") + print ("vramRowEndsMinusOne:",end="") v = 0x20a0 rowCount = 19 @@ -16,7 +16,7 @@ def main(argv): print ("\n\t.word ", end="") rowCount=0 - print ("$%x" % v, end="") + print ("$%x" % (v-1), end="") if (rowCount<19): print (",", end="") v += 160 diff --git a/gscats.2mg b/gscats.2mg index 93a11e4..1f80779 100644 Binary files a/gscats.2mg and b/gscats.2mg differ diff --git a/tables.s b/tables.s index bcf27f4..312181c 100644 --- a/tables.s +++ b/tables.s @@ -32,14 +32,14 @@ sineTable: .byte $4F, $52, $55, $58, $5B, $5E, $61, $64 .byte $67, $6A, $6D, $70, $74, $77, $7A, $7D -vramRowEnds: - .word $20a0,$2140,$21e0,$2280,$2320,$23c0,$2460,$2500,$25a0,$2640,$26e0,$2780,$2820,$28c0,$2960,$2a00,$2aa0,$2b40,$2be0,$2c80 - .word $2d20,$2dc0,$2e60,$2f00,$2fa0,$3040,$30e0,$3180,$3220,$32c0,$3360,$3400,$34a0,$3540,$35e0,$3680,$3720,$37c0,$3860,$3900 - .word $39a0,$3a40,$3ae0,$3b80,$3c20,$3cc0,$3d60,$3e00,$3ea0,$3f40,$3fe0,$4080,$4120,$41c0,$4260,$4300,$43a0,$4440,$44e0,$4580 - .word $4620,$46c0,$4760,$4800,$48a0,$4940,$49e0,$4a80,$4b20,$4bc0,$4c60,$4d00,$4da0,$4e40,$4ee0,$4f80,$5020,$50c0,$5160,$5200 - .word $52a0,$5340,$53e0,$5480,$5520,$55c0,$5660,$5700,$57a0,$5840,$58e0,$5980,$5a20,$5ac0,$5b60,$5c00,$5ca0,$5d40,$5de0,$5e80 - .word $5f20,$5fc0,$6060,$6100,$61a0,$6240,$62e0,$6380,$6420,$64c0,$6560,$6600,$66a0,$6740,$67e0,$6880,$6920,$69c0,$6a60,$6b00 - .word $6ba0,$6c40,$6ce0,$6d80,$6e20,$6ec0,$6f60,$7000,$70a0,$7140,$71e0,$7280,$7320,$73c0,$7460,$7500,$75a0,$7640,$76e0,$7780 - .word $7820,$78c0,$7960,$7a00,$7aa0,$7b40,$7be0,$7c80,$7d20,$7dc0,$7e60,$7f00,$7fa0,$8040,$80e0,$8180,$8220,$82c0,$8360,$8400 - .word $84a0,$8540,$85e0,$8680,$8720,$87c0,$8860,$8900,$89a0,$8a40,$8ae0,$8b80,$8c20,$8cc0,$8d60,$8e00,$8ea0,$8f40,$8fe0,$9080 - .word $9120,$91c0,$9260,$9300,$93a0,$9440,$94e0,$9580,$9620,$96c0,$9760,$9800,$98a0,$9940,$99e0,$9a80,$9b20,$9bc0,$9c60,$9d00 +vramRowEndsMinusOne: + .word $209f,$213f,$21df,$227f,$231f,$23bf,$245f,$24ff,$259f,$263f,$26df,$277f,$281f,$28bf,$295f,$29ff,$2a9f,$2b3f,$2bdf,$2c7f + .word $2d1f,$2dbf,$2e5f,$2eff,$2f9f,$303f,$30df,$317f,$321f,$32bf,$335f,$33ff,$349f,$353f,$35df,$367f,$371f,$37bf,$385f,$38ff + .word $399f,$3a3f,$3adf,$3b7f,$3c1f,$3cbf,$3d5f,$3dff,$3e9f,$3f3f,$3fdf,$407f,$411f,$41bf,$425f,$42ff,$439f,$443f,$44df,$457f + .word $461f,$46bf,$475f,$47ff,$489f,$493f,$49df,$4a7f,$4b1f,$4bbf,$4c5f,$4cff,$4d9f,$4e3f,$4edf,$4f7f,$501f,$50bf,$515f,$51ff + .word $529f,$533f,$53df,$547f,$551f,$55bf,$565f,$56ff,$579f,$583f,$58df,$597f,$5a1f,$5abf,$5b5f,$5bff,$5c9f,$5d3f,$5ddf,$5e7f + .word $5f1f,$5fbf,$605f,$60ff,$619f,$623f,$62df,$637f,$641f,$64bf,$655f,$65ff,$669f,$673f,$67df,$687f,$691f,$69bf,$6a5f,$6aff + .word $6b9f,$6c3f,$6cdf,$6d7f,$6e1f,$6ebf,$6f5f,$6fff,$709f,$713f,$71df,$727f,$731f,$73bf,$745f,$74ff,$759f,$763f,$76df,$777f + .word $781f,$78bf,$795f,$79ff,$7a9f,$7b3f,$7bdf,$7c7f,$7d1f,$7dbf,$7e5f,$7eff,$7f9f,$803f,$80df,$817f,$821f,$82bf,$835f,$83ff + .word $849f,$853f,$85df,$867f,$871f,$87bf,$885f,$88ff,$899f,$8a3f,$8adf,$8b7f,$8c1f,$8cbf,$8d5f,$8dff,$8e9f,$8f3f,$8fdf,$907f + .word $911f,$91bf,$925f,$92ff,$939f,$943f,$94df,$957f,$961f,$96bf,$975f,$97ff,$989f,$993f,$99df,$9a7f,$9b1f,$9bbf,$9c5f,$9cff diff --git a/terrain.s b/terrain.s index a3aa6b1..de0fe61 100644 --- a/terrain.s +++ b/terrain.s @@ -8,6 +8,218 @@ TERRAINWIDTH = 640 ; In pixels MAXTERRAINHEIGHT = 100 ; In pixels +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; renderTerrain +; +; No stack operations permitted here! +; +renderTerrain: + lda #199*2 + sta