# PAGE

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
PAGE COPY n TO m [,when] [,dontcopyblack]
PAGE DISPLAY n [,page]
PAGE DISPLAY -1
PAGE RESIZE pageno, width, height
PAGE SCROLL pageno, x, y [,fillcolour]
PAGE STITCH frompage1, from_page_2, topage, offset
PAGE AND_PIXELS sourcepage1, sourcepage2, destinationpage
PAGE OR_PIXELS sourcepage1, sourcepage2, destinationpage
PAGE XOR_PIXELS sourcepage1, sourcepage2, destinationpage
PAGE WRITE n

Description:

PAGE COPY n TO m [,when] [,dontcopyblack]
Copy the contents of one video page to another.
'n' is the source and 'm' is the destination. 'when' can be one of letters I, B, or D. If omitted it will default to I.
I means do the copy immediately. It is the most efficient but risks causing screen artefacts
B means wait until the next frame blanking and then do the copy. It is the least efficient but is absolutely determinate in its effect and no screen artefacts will ever be seen.
D means carry on processing the next command and do the copy in the background when the next frame blanking occurs.
This is efficient but must be used with care as subsequent drawing commands may or may not be included in the copy depending on the timing of the next screen blanking
If DONTCOPYBLACK is set to 1 then only non-black pixels are copied. This is more efficient than using BLIT with bit 2 of the orientation set.

PAGE DISPLAY n [,page]
This has the ability to select which page(s) are displayed on the screen.
Normal example of use is:
PAGE DISPLAY 3. This says show on the screen the current contents of page 3. The command does not impact the current write page
In 12 bit mode you can also use: PAGE DISPAY 4,1
This sets the page to display for the top layer
The command executes in the next screen blanking period. When a program ends for any reason the normal display page 0 is restored
Note for modes 3 or 5 or 6 or 7 or 12 or 13 you can only select pages 0 or 1 for display in 8 or 16 bit colour and pages 0, 1, or 2 in 12-bit colour

PAGE DISPLAY -1
To turn the display off use PAGE DISPLAY -1. To turn it back on select a valid display page - the contents of the video pages are not changed by this command.
See OPTION SLEEP n to turn the display off for n seconds

PAGE RESIZE pageno, width, height
This command changes the width and height of a given page in memory.
‘width’ can be set between 1 and the normal width for the current display mode. ‘height’ can be set between 1 and the normal height of the display mode.
When PAGE WRITE is set to a resized page all graphics commands will respect the new values of width and height, including print output scrolling, and MM.HRES and MM.VRES will report the revised size.

PAGE SCROLL pageno, x, y [,fillcolour]
Will scroll the image on the page specified by 'pageno' by the amount defined by 'x' and 'y'. By default the area scrolled off the screen appears on the other side.
If 'fillcolour' is specified it will replace the area left behind by the scroll with the colour specified. If 'fillcolour' is set to -1 then the area left behind by the scroll is left untouched.
This is the most efficient version and is suitable if there is a black background.

PAGE STITCH frompage1, from_page_2, topage, offset
Will take the last horizontal resolution minus 'offset' columns from 'frompage1' and the first 'offset' columns from 'frompage2' and copies them to 'topage'

PAGE AND_PIXELS sourcepage1, sourcepage2, destinationpage
PAGE OR_PIXELS sourcepage1, sourcepage2, destinationpage
PAGE XOR_PIXELS sourcepage1, sourcepage2, destinationpage
These commands combine the pixels on sourcepage1 and sourcepage2 by ANDing, ORing, or XORing them. destinationpage can be the same as either of the sourcepages if required.

PAGE WRITE n
Instructs MMBasic to make all graphics commands write to page 'n'. If not used page 0 is the default. Set the page to FRAMEBUFFER to write to the framebuffer – see the FRAMEBUFFER command.

mode 13,16 '400x300
page resize 3,200,200
page resize 2,200,200
list pages
page write 2
cls
print "Hello this is a test of the first very long string to see if it wraps. "
print "Hello this is a test of the second very long string to see if it wraps. "
print "Hello this is a test of the third very long string to see if it wraps. "
print "Hello this is a test of the fourth very long string to see if it wraps. "
print "Hello this is a test of the fifth very long string to see if it wraps. "
print "Hello this is a test of the sixth very long string to see if it wraps. "
print "Hello this is a test of the seventh very long string to see if it wraps. "
print "Apparently it works. Smiley face"
box 0,0,mm.hres,mm.vres ' mm.hres and mm.vres track the current write page
page write 0
page copy 2 to 3' can do this because they are the same size
BLIT 0,0,100,50,200,200,3' pages are different sizes so have to use BLIT
do:loop

Last edited: 25 February, 2021