This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assume there is a currX and currY global state which is the current x,y position | |
// Assume that currBuffer points to a valid properly sized buffer in RAM for DMA | |
// | |
// Buffer size can be calculated as n * 4 bytes where n is max(xdelta, ydelta) | |
// where xdelta and ydelta are the extents of the line to be drawn | |
// | |
// xd and yd is the destination point | |
// | |
// The output DACs are 12 bit but for speed this outputs in steps of 4 to cut the point generation by 4 times | |
// Effective resolution is 1024 points in X and Y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; DASM assembler | |
processor 6502 | |
seg.u zpage | |
ORG $0080 | |
theta ds 2 | |
x ds 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mul1 * mul2 + A/2 -> A:mul1 (mul2 is unchanged) | |
; inner loop credit Supercat | |
MUL: | |
dec mul2 ;5 ; decrement mul2 because we will be adding with carry set for speed (an extra one) | |
ror mul1 ;5 \ | |
bcc b1 ;2/3 \ Best case 8 Worst case 10 | |
adc mul2 ;3 / | |
b1: ror ;2 \ |