Alright I tested it and it's actually faster to just use a loop and copy 1 row of data at a time, like this:
'L: which text screen to use 'X,Y,W,H: the region inside the screen to load to 'OX,OY: the offset inside MAP to load from 'MAP: map data DEF TLOAD2 L, X,Y,W,H, OX,OY, MAP[] OX=FLOOR(OX) OY=FLOOR(OY) DIM ROW%[W*2] VAR I VAR MW=DIM(MAP,1) FOR I=0 TO H-1 COPY ROW%,MAP,(OY+I)*MW+OX*2,W*2 TLOAD L,X,Y+I,W,1,ROW% NEXT ENDExample:
DIM MAP%[1000,1000,2] FOR Y=0 TO 1000-1 FOR X=0 TO 1000-1 MAP%[Y,X,0] = #TUSRCHR+RND(100) MAP%[Y,X,1] = #C_WHITE NEXT NEXT X=100*16 Y=100*16 LOOP VSYNC STICK 0 OUT SX,SY X=X+SX*4 Y=Y+SY*4 TOFS 0,0,-(X MOD 16),-(Y MOD 16) TLOAD2 0, 0,0, 20,10, X/16,Y/16, MAP% ENDLOOP