Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: shmibs on October 12, 2011, 08:27:20 pm
-
is there any fast way to draw a specified 96*64 window directly from a larger buffer (say 104*72)?
what i mean is just using an x and y offset to determine which position to start and drawing from
-
Changing the Y offset should be easy, but Changing the X offset is more difficult. The calculator stores pixels in Byte-Sized pieces (no pun intended), so you can only have an X offset as a multiple of 8 without having to do nasty rotation and shifting.
\\For this example, let's say that X is the X offset, Y is the Y offset, and B is the buffer.
B+(Y*13)+(X/8)->C \\104/8=13 There are 13 bytes in a buffer of 104
L6->D
For(A,1,64)
Copy(C,D,12)
C+13->C \\Again, the X length of the buffer is 13 bytes.
D+12->D \\PlotSScreen is 12 bytes wide.
End
This code is probably very buggy. This is just for the general idea. You want to copy 12 bytes from the buffer, loop to the next line, and repeat for 64 lines.
Unfortunately, this method limits itself to 8 pixel increments. Similarly, the buffer X width can only be divisible by 8. These problems can be overcome by doing bit rotation and shifting, but that would be more time consuming and probably require inline ASM.
-
I assume this is for line clipping? I have to think there must be a better way to do this x.x Not to mention Axe's default line drawing routine won't work on a buffer that is wider than 12 bytes.
-
ok, i can cross of that option then, i guess. i was just trying to think of any possible alternative solutions to a problem i've been running into, and i figured i'd ask if anything had changed, since i'm a little behind on the new axe syntax.
thanks =)
-
I think the best bet to create an Axe clipped line would be to manually cull the points to the domain of the screen, although that can be a little math heavy D:
-
If you think that math is hard, try writing it in pure assembly O_O. Hopefully I will eventually finish that clipped line routine...
-
ouch. asm == hard