'Future.Library redefining Get and Put to use segment and offset
'
REM $INCLUDE: 'future.bi'

DECLARE SUB SVGAput (BYVAL x1%, BYVAL y1%, BYVAL offset%, BYVAL segment%)
DECLARE SUB SVGAget (BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%, BYVAL offset%, BYVAL segment%)

'$DYNAMIC
DIM Buffer%(802, 50)'50 sprites (40x40) +4 bytes for the sprite info

Set640x480 8

FOR i% = 0 TO 20
Future.BOX 20 - i%, 20 - i%, 20 + i%, 20 + i%, i%
NEXT

SVGAget 0, 0, 39, 39, VARPTR(Buffer%(0, 0)), VARSEG(Buffer%(0, 0))

FOR i% = 40 TO 0 STEP -1
Future.FILLCIRCLE 20, 20, i%, i%
NEXT

SVGAget 0, 0, 39, 39, VARPTR(Buffer%(0, 1)), VARSEG(Buffer%(0, 1))

Future.CLS 0

FOR i% = 0 TO 5000
SVGAput RND * 600, RND * 440, VARPTR(Buffer%(0, 0)), VARSEG(Buffer%(0, 0))
NEXT

SLEEP
FOR i% = 0 TO 5000
SVGAput RND * 600, RND * 440, VARPTR(Buffer%(0, 1)), VARSEG(Buffer%(0, 1))
NEXT

SLEEP
ReSetScreen

