Lookup for render span VRAM rows

This commit is contained in:
blondie7575 2017-12-27 10:06:42 -07:00
parent 3e5a8ab86f
commit bbbea9b2be
4 changed files with 28 additions and 7 deletions

View File

@ -5,7 +5,6 @@ import sys
def main(argv):
# Prologue
print ("vramYOffset:",end="")
rowCount = 19
@ -19,6 +18,19 @@ def main(argv):
if (rowCount<19):
print (",", end="")
print ("\n\vramRowInvertedSpanLookup:",end="")
rowCount = 19
for jump in range(0,200):
rowCount += 1
if (rowCount==20):
print ("\n\t.word ", end="")
rowCount=0
print ("$%04x" % ((200-jump)*160+8192), end="")
if (rowCount<19):
print (",", end="")
if __name__ == "__main__":
main(sys.argv[1:])

Binary file not shown.

View File

@ -152,4 +152,16 @@ vramYOffset:
.word $6400,$64a0,$6540,$65e0,$6680,$6720,$67c0,$6860,$6900,$69a0,$6a40,$6ae0,$6b80,$6c20,$6cc0,$6d60,$6e00,$6ea0,$6f40,$6fe0
.word $7080,$7120,$71c0,$7260,$7300,$73a0,$7440,$74e0,$7580,$7620,$76c0,$7760,$7800,$78a0,$7940,$79e0,$7a80,$7b20,$7bc0,$7c60
vramRowInvertedSpanLookup:
.word $9d00,$9c60,$9bc0,$9b20,$9a80,$99e0,$9940,$98a0,$9800,$9760,$96c0,$9620,$9580,$94e0,$9440,$93a0,$9300,$9260,$91c0,$9120
.word $9080,$8fe0,$8f40,$8ea0,$8e00,$8d60,$8cc0,$8c20,$8b80,$8ae0,$8a40,$89a0,$8900,$8860,$87c0,$8720,$8680,$85e0,$8540,$84a0
.word $8400,$8360,$82c0,$8220,$8180,$80e0,$8040,$7fa0,$7f00,$7e60,$7dc0,$7d20,$7c80,$7be0,$7b40,$7aa0,$7a00,$7960,$78c0,$7820
.word $7780,$76e0,$7640,$75a0,$7500,$7460,$73c0,$7320,$7280,$71e0,$7140,$70a0,$7000,$6f60,$6ec0,$6e20,$6d80,$6ce0,$6c40,$6ba0
.word $6b00,$6a60,$69c0,$6920,$6880,$67e0,$6740,$66a0,$6600,$6560,$64c0,$6420,$6380,$62e0,$6240,$61a0,$6100,$6060,$5fc0,$5f20
.word $5e80,$5de0,$5d40,$5ca0,$5c00,$5b60,$5ac0,$5a20,$5980,$58e0,$5840,$57a0,$5700,$5660,$55c0,$5520,$5480,$53e0,$5340,$52a0
.word $5200,$5160,$50c0,$5020,$4f80,$4ee0,$4e40,$4da0,$4d00,$4c60,$4bc0,$4b20,$4a80,$49e0,$4940,$48a0,$4800,$4760,$46c0,$4620
.word $4580,$44e0,$4440,$43a0,$4300,$4260,$41c0,$4120,$4080,$3fe0,$3f40,$3ea0,$3e00,$3d60,$3cc0,$3c20,$3b80,$3ae0,$3a40,$39a0
.word $3900,$3860,$37c0,$3720,$3680,$35e0,$3540,$34a0,$3400,$3360,$32c0,$3220,$3180,$30e0,$3040,$2fa0,$2f00,$2e60,$2dc0,$2d20
.word $2c80,$2be0,$2b40,$2aa0,$2a00,$2960,$28c0,$2820,$2780,$26e0,$2640,$25a0,$2500,$2460,$23c0,$2320,$2280,$21e0,$2140,$20a0
.include "circleTable.s"

View File

@ -130,15 +130,12 @@ renderTerrainRowSpans:
sta SCRATCHL ; Track span color
; Find VRAM row
lda #200
sec
sbc PARAML1
lda PARAML1
asl
tax
lda vramYOffset,x
clc
adc #$2000
lda vramRowInvertedSpanLookup,x
tax
adc #160
sta PARAML0 ; Watch for end of VRAM row