07-20-2011, 02:26 AM
Turns out that chancing the divider only to a 16bit value is enough and leaving the rn variable as an 8bit value is OK.
But why would you need a 16bit resolution in a divider that covers an 8bit range or ubyte to ubyte? Unless of course the range is 256*176 = 45056 and 45056 / 4 = 11264 and 11264 / 3 = 3755.
Or the resolution needed for the random sequences and that relates to the number of pixels on the screen for each triangle.
Code:
__LABEL__DrawTriangles:
call _randint
ld de, 21846
call __DIVU16
inc hl
ld a, l
ld (_rn), a
But why would you need a 16bit resolution in a divider that covers an 8bit range or ubyte to ubyte? Unless of course the range is 256*176 = 45056 and 45056 / 4 = 11264 and 11264 / 3 = 3755.
Or the resolution needed for the random sequences and that relates to the number of pixels on the screen for each triangle.