CALL YMMM
This page was last modified 10:50, 18 May 2020 by Mars2000you. Based on work by Gdx.

Contents

Effect

This instruction allows to execute easily the command YMMM (Y Move to Memory from Memory) of VDP in Basic. It make a fast copy of an area to another area in VRAM using same X coordinate for destination. The advantage over the basic instruction standard is that the coordinates are not clipped. Any VRAM area is usable regardless of the pages.

Note: This instruction is not available in SCREEN 0 to 4. It is available in SCREEN 9 but requires advanced knowledge of this mode to use.

Syntax

CALL YMMM (<X0>,<Y0>)-STEP(<X1>,<Y1>) TO (<X2>,<Y2>)

Parameters

<X0> and <Y0> are coordinates of first corner of source area (X0=0~255/511, Y0=0~511/1023).

<X1> and <Y1> are coordinates of the opposite corner of source area ((X0=0~255/511, Y0=0~511/1023).

STEP parameter changes X1 and Y1 coordinates to relative coordinates (and therefore allows the use of negative values) when specified.

<X2> and <Y2> are coordinates of the upper-left corner of destination area (X0=0~255/511, Y0=0~511/1023). Whatever the specified coordinate of X2, it takes same coordinate as X0.

Example

10 CLEAR300,&HA800:BLOAD"diskinst.bin",R:_SYSON
20 COLOR,0,0: SCREEN5: VDP(9)=VDP(9) OR 2 ' Disable sprites
30 FOR X=0 TO 255 STEP4: Y=RND(1)*211: PSET(X,Y),11: NEXT
40 FOR X=0 TO 255 STEP6: Y=RND(1)*211: PSET(X,Y),14: NEXT
50 FOR X=1 TO 254 STEP8: Y=RND(1)*211: PSET(X,Y),15: NEXT
60 CALL YMMM (0,59)-(255,99) TO (0,212) ' Copy some stars to hidden area
70 VDP(24)=(VDP(24)-1) AND 255
80 IF NOT STRIG(0) THEN 70
90 VDP(24)=0

Related to

CALL CELLO, CALL HMMM, CALL HMMV, CALL LMMM, CALL LMMV, CALL VCOPY

Compatibility

DM-System2 BASIC