Contents |
Effect
Copies memory window from one location in RAM to another.
It can be used in any RAM page, also pages 0 and 1.
Syntax
CALL BOXMEMCPY(<RAM-StartAddress>,<TotalStartBytes>,<Rows>,<CopiedBytes>,<RAM-DestinationAddress>,<TotalDestinationBytes>)
Parameters
<RAM-StartAddress> can vary between &H0000 and &HFFFF.
<TotalStartBytes> is the total number of bytes per row in the source data.
<Rows> is the number of rows in the source data.
<CopiedBytes> is a number to specify how many bytes per row need to be copied, starting at the specified <RAM-StartAddress> and being copied with beginning at the specified <RAM-DestinationAddress>.
<RAM-DestinationAddress> can vary between &H0000 and &HFFFF (with some restrictions - see here). When using VARPTR, the copy will be made in page 2 or 3, starting from &H8000.
<TotalDestinationBytes> is the total number of bytes per row in the destination data.
Example
10 REM BLIT WITH PARAMETERS 20 COLOR 15,1,1:SCREEN 2,2 30 DEFINT A-Z 100 MB=0:_MEMCPY(&H4010,VARPTR(MB),2):SB=&H2000 120 I=0:X1=112:Y1=114:V1=1:V2=1:XL=0:XR=0:YU=0:YD=0:CX=0:CY=0:T=0:A$="":TM=0 230 FOR I=0 TO 7:READ T:POKE &HB000+I,T:NEXT 240 _TILERAM(&HB000,1,1,SB,32,24,0,0,32,24):_MEMCPY(SB,MB,6144) 250 _TILEVRM(&HB000,1,1,0,0,32,24) 260 _FILVRM(BASE(11),6144,&H4E,0) 270 BLOAD"MSXLOGOH.BIN",&HB008 1000 TIME=0 1010 CX=X1\8:CY=Y1\8 1020 _BLIT(X1,Y1,&HB008,&HB408,16,8,MB,32) 1030 X1=X1+V1:IF X1<1 OR X1>=128 THEN V1=-V1 1040 Y1=Y1+V2:IF Y1<1 OR Y1>=128 THEN V2=-V2 1050 XL=CX-1:IF XL<0 THEN XL=0 1060 YU=CY-1:IF YU<0 THEN YU=0 1070 XR=CX+18:IF XR>32 THEN XR=32 1080 YD=CY+10:IF YD>24 THEN YD=24 1090 T=YU*256+XL*8 1110 _BOXMEMVRM(MB+T,(XR-XL)*8,YD-YU,256,BASE(12)+T,256) 1130 _BOXMEMCPY(SB+T,(XR-XL)*8,YD-YU,256,MB+T,256) 1200 T=TIME:IF TM<T THEN TM=T 1210 A$=INKEY$:IF A$="" GOTO 1000 1220 SCREEN0:PRINT TM:END 3000 DATA &B10010010, &B01001001 3010 DATA &B00100100, &B10010010 3020 DATA &B01001001, &B00100100 3030 DATA &B10010010, &B01001001
Related to
CALL BOXMEMVRM, CALL FILRAM, CALL FILVRM, CALL MEMCPY, CALL MEMVRM, CALL TILERAM, CALL TILEVRM, CALL VRMMEM, PEEK, POKE, VARPTR
