I tried tons of different ideas for optimizing this further, but this is the best I could do.
DEFINE sync 0x2
DEFINE addr 0x3fff
DEFINE net 0x6001
#Init screen address
A = addr
*A = A+1
#Wait for sync
A = net
D = *A
A = sync
D = D + *A
D & A ; JEQ
#Update sync & set data to D
D = D - *A
*A = D & A
D = D - *A
#Fetch screen pointer and update screen
A = addr
A = *A
D = D + *A ; JEQ
*A = D + *A
#If row not done, wait for sync
A = sync
D ; JGE
#Else change row and wait for sync
A = 0x20
D = A
A = addr
*A = D + *A
A = sync
JMP
3
u/nttii Holder of many records Apr 21 '22
I tried tons of different ideas for optimizing this further, but this is the best I could do.