Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Out of memory when using uinteger array (*solved*)
#18
Turns out that chancing the divider only to a 16bit value is enough and leaving the rn variable as an 8bit value is OK.

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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)