unit neo6502

Neo6502 API library for Mad-Pascal.

author: bocianu bocianu@gmail.com


Set of procedures to cover API functionality provided by:
https://www.olimex.com/Products/Retro-Computers/Neo6502/open-source-hardware
https://www.neo6502.com/

API documentation can be found here:
https://github.com/paulscottrobson/neo6502-firmware/wiki

It's work in progress, so please report any bugs you will find.

Constants:

name:value:description:
N6502MSG_ADDRESS$ff00
NEO_GFX_RAM$ffff
OPEN_MODE_RO0opens the file for read-only access;
OPEN_MODE_WO1opens the file for write-only access;
OPEN_MODE_RW2opens the file for read-write access;
OPEN_MODE_NEW3creates the file if it doesn’t already exist, truncates it if it does, and opens the file for read-write access.
FI_ATTR_DIRECTORY1mask for directory attribute
FI_ATTR_SYSTEM2mask for system attribute
FI_ATTR_ARCHIVE4mask for archive attribute
FI_ATTR_READONLY8mask for read only attribute
FI_ATTR_HIDDEN16mask for hidden attribute
MEM_650206502 ram offset
MEM_VRAM$800000Video ram offset for blitter addresing
MEM_GFX$900000Graphics ram (tiles/sprites) offset for blitter addresing
BLTACT_COPY0Blitter action: copy
BLTACT_MASK1Blitter action: copycopy, but only where src is not the transparent value.
BLTACT_SOLID2Blitter action: set target to constant solid value, but only where src is not the transparent value.
BLTFORM_BYTE0Blitter data format: bytes. Supported for both source and target.
BLTFORM_PAIRS1Blitter data format: pairs of 4-bit values (nibbles). Source only.
BLTFORM_1BPP2Blitter data format: 8 single-bit values. Source only.
BLTFORM_UPPER43Blitter data format: high nibble. Target only.
BLTFORM_LOWER44Blitter data format: low nibble. Target only.

Types:

name:type:description:
TN6502Messagerecord
  • group: byte;
  • func: byte;
  • error: byte;
  • status: byte;
  • params: array[0..7] of byte;

end;
Structure used to prepare API message
TSoundrecord
  • channel: byte;
  • freq: word;
  • len: word;
  • slide: word;
  • stype: byte;
  • vol: byte;

end;
Structure used to store note parameters

Register Variables:

name:address:type:description:
NeoMessageN6502MSG_ADDRESSTN6502Messagestructure used to communicate with neo6502 API
wordParamsN6502MSG_ADDRESS+4array[0..3] of wordhelping structure to easliy obrain or set word parametrs
dwordParamsN6502MSG_ADDRESS+4array[0..1] of cardinalhelping structure to easliy obrain or set cardinal parametrs

Interface:

name:description:
NeoSendMessage

function NeoSendMessage(group,func:byte):byte;


Sends structure stored in NeoMessage, to Neo6502 API
    parameters:
  • group (byte) - API command group
  • func (byte) - API function within the group
  • returns:
  • (byte) - Parameter0 is returned directly. All remaining returned params are avaliable via NeoMessage record
NeoWaitMessage;inline;assembler

procedure NeoWaitMessage;inline;assembler;


Waits until Message from API is returned.
    NeoSubReset

    procedure NeoSubReset;


    Resets the messaging system and its components. Should not normally be used.
      NeoGetVblanks

      function NeoGetVblanks:cardinal;


      Return the number of vblanks since power on. This isupdated at the start of the vblank period.
        returns:
      • (cardinal) - number of vblanks
      NeoWaitForVblank

      procedure NeoWaitForVblank;


      Wait for new vblank.
        NeoGetTimer

        function NeoGetTimer:cardinal;


        Get the value of the 100Hz system timer.
          returns:
        • (cardinal) - system timer
        NeoExecuteBasic

        procedure NeoExecuteBasic;


        Execute BASIC
          NeoCredits

          procedure NeoCredits;


          Prints the list of people involved, stored in Flash to save memory.
            NeoCheckSerial

            function NeoCheckSerial:byte;


            Check the serial port to see if there is a data transmission. This is done automatically in Key Read.
              returns:
            • (byte) - serial state
            NeoSetLocale

            procedure NeoSetLocale(lang:string[2]);


            Sets the specified locale code (EN.FR,GE...)
              parameters:
            • name (string[2]) - name of locale in upper-case ASCII
            NeoReset

            procedure NeoReset;


            System Reset. This is a full hardware reset. It resets the RP2040 using the Watchdog timer, and this also resets the 65C02.
              NeoMOS

              procedure NeoMOS(cmd:pointer);


              Do a MOS command (a '* command') these are specified in the Wiki as they will be steadily expanded.
                parameters:
              • cmd (pointer) - pointer to command string
              NeoWriteDebug

              procedure NeoWriteDebug(c:byte);


              Writes a single character to the debug port (the UART on the Pico, or stderr on the emulator). This allows maximum flexibility.
                parameters:
              • c (byte) - byte to be written
              NeoIsKeyPressed

              function NeoIsKeyPressed(key:byte):byte;


              Return the state of keyboard key
                parameters:
              • key (byte) - key to be checked
              • returns:
              • (byte) - state of key
              NeoSetChar

              procedure NeoSetChar(c:byte;data:pointer);


              Use bits 0..5 of data bytes to define a selected font character
                parameters:
              • c (byte) - code of char to be defined (192-255)
              • data (pointer) - pointer to 7 bytes of data
              NeoDefineHotkey

              procedure NeoDefineHotkey(keynum:byte;txt:pointer);


              Define the function key F1..F10 ($01..$0A) specified as keynum to emit the length-prefixed string stored at the memory location specified in txt. F11 and F12 cannot currently be defined.
                parameters:
              • keynum (byte) - Number of function key (1-10)
              • txt (pointer) - pointer to the length-prefixed string to be emited on the key press
              NeoShowHotkeys

              procedure NeoShowHotkeys;


              Displays the current settings of the function keys
                NeoGetScreenSize

                procedure NeoGetScreenSize(var height:byte;var width:byte);


                Returns the console size in characters.
                  parameters:
                • height (byte) - height of the screen
                • width (byte) - width of the screen
                • returns:
                • (byte) - state of key
                NeoSetTextColor

                procedure NeoSetTextColor(foreground,background:byte);


                Returns the console size in characters.
                  parameters:
                • foreground (byte) - foreground color
                • background (byte) - background color
                NeoGetCursorPos

                procedure NeoGetCursorPos(var x:byte;var y:byte);


                Returns cursor position
                  parameters:
                • x (byte) - horizontal position
                • y (byte) - vertical position
                NeoClearRegion

                procedure NeoClearRegion(x0,y0,x1,y1:byte);


                Erase all characters within the specified rectangular region.
                  parameters:
                • x0,y0 (byte) - starting point coordinates
                • x1,y1 (byte) - ending point coordinates
                NeoCursorInverse

                procedure NeoCursorInverse;


                Toggles the cursor colour between normal and inverse (swaps FG and BG colors).
                  NeoShowDir

                  procedure NeoShowDir;


                  Displays the storage directory.
                    NeoLoad

                    function NeoLoad(name:TString;dest:word):boolean;


                    Loads a named file from storage to selected address.
                    If the address is $FFFF the file is loaded into the graphic memory area used for sprites, tiles, images.
                      parameters:
                    • name (TString) - name of the file with extension
                    • dest (word) - target data address
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoSave

                    function NeoSave(name:TString;dest,len:word):boolean;


                    Saves chunk of memory from defined address to a named file on storage.
                      parameters:
                    • name (TString) - name of the file with extension
                    • dest (word) - source data address
                    • len (word) - numer of bytes to be saved
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoOpenFile

                    function NeoOpenFile(channel:byte;name:pointer;openmode:byte):boolean;


                    Opens a file into a specific channel. Modes 0 to 2 will fail if the file does not already exist. If the channel is already open, the call fails. Opening the same file more than once on different channels has undefined behaviour and is not recommended.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • name (pointer) - pointer to length prefixed string containing file name
                    • openmode (byte) - open mode. See constants above.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoCloseFile

                    function NeoCloseFile(channel:byte):boolean;


                    Closes a particular channel.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoSeekPos

                    function NeoSeekPos(channel:byte;pos:cardinal):boolean;


                    Seeks the file opened on a particular channel to a location. You can seek beyond the end of a file to extend the file. Whether the file size changes when the seek happens or when you perform the write is undefined.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • pos (cardinal) - file location
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoTellPos

                    function NeoTellPos(channel:byte):cardinal;


                    Returns the current seek location for the file opened on a particular channel.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • returns:
                    • (cardinal) - file location.
                    NeoReadFile

                    function NeoReadFile(channel:byte;addr:word;len:word):word;


                    Reads data from an opened file. Data is read from the current seek position, which is advanced after the read.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • addr (word) - points to the destination in memory, or $FFFF to write to graphics memory
                    • len (word) - amount of data to read
                    • returns:
                    • (word) - returns the amount of data actually read
                    NeoWriteFile

                    function NeoWriteFile(channel:byte;addr:word;len:word):word;


                    Writes data to an opened file. Data is written to the current seek position, which is advanced after the write.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • addr (word) - points to the source of data in memory
                    • len (word) - amount of data to write
                    • returns:
                    • (word) - returns the amount of data actually written
                    NeoGetFileSize

                    function NeoGetFileSize(channel:byte):cardinal;


                    Returns the current size of an opened file
                    This call should be used on open files and takes into account any buffered data which has not yet been written to disk. As a result it may return a different size to the NeoStatFile described below.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • returns:
                    • (cardinal) - file size
                    NeoSetFileSize

                    function NeoSetFileSize(channel:byte;size:cardinal):boolean;


                    Extends or truncates an opened file to a particular size.
                      parameters:
                    • channel (byte) - channel number (0-255)
                    • size (cardinal) - the new size of the file.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoRenameFile

                    function NeoRenameFile(fin,fout:pointer):boolean;


                    Renames a file.
                      parameters:
                    • fin (pointer) - pointer to length-prefixed string for the old name
                    • fout (pointer) - pointer to length-prefixed string for the new name
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoDeleteFile

                    function NeoDeleteFile(fin:pointer):boolean;


                    Deletes a file or directory.
                      parameters:
                    • fin (pointer) - pointer to length-prefixed filename string.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoCreateDirectory

                    function NeoCreateDirectory(fin:pointer):boolean;


                    Creates a new directory.
                      parameters:
                    • fin (pointer) - pointer to length-prefixed path string.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoChangeDirectory

                    function NeoChangeDirectory(fin:pointer):boolean;


                    Changes the current working directory.
                      parameters:
                    • fin (pointer) - pointer to length-prefixed path string.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoStatFile

                    function NeoStatFile(fin:pointer;var size:cardinal;var attr:byte):boolean;


                    Retrieves information about a file by name and returns it by referenced variables.
                    If the file is open for writing, this may not return the correct size due to buffered data not having been flushed to disk.
                    File attributes are a bitfield as follows: 0 - directory 1 - system 2 - archive 3 - read only 4 - hidden
                      parameters:
                    • fin (pointer) - pointer to length-prefixed path string.
                    • size (cardinal) - reference to size variable.
                    • attr (byte) - reference to attribute variable.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoOpenDirectory

                    function NeoOpenDirectory(fin:pointer):boolean;


                    Opens a directory for enumeration. Only one directory at a time may be opened. If a directory is already open when this call is made, it is automatically closed; however, an open directory may make it impossible to delete the directory, so closing the directory after use is good practice.
                      parameters:
                    • fin (pointer) - pointer to length-prefixed path string.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoReadDirectory

                    function NeoReadDirectory(var fname:string;var size:cardinal;var attr:byte):boolean;


                    Reads an item from the currently open directory. This call fails if there are no more items to read.
                      parameters:
                    • fname (pointer) - reference to filename string that gets updated.
                    • size (cardinal) - reference to size variable.
                    • attr (byte) - reference to attribute variable.
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoCloseDirectory

                    function NeoCloseDirectory:boolean;


                    Closes any directory opened by Open Directory.
                      returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoCopyFile

                    function NeoCopyFile(fin,fout:pointer):boolean;


                    Copies a file.
                      parameters:
                    • fin (pointer) - pointer to length-prefixed string for the old name
                    • fout (pointer) - pointer to length-prefixed string for the new name
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoSetAttr

                    function NeoSetAttr(fin:pointer;var attr:byte):boolean;


                    Sets file/directory attributes.
                    File attributes are a bitfield as follows: 0 - directory (cannot be changed) 1 - system 2 - archive 3 - read only 4 - hidden
                      parameters:
                    • fin (pointer) - pointer to length-prefixed path string.
                    • attr (byte) - file attribute
                    • returns:
                    • (boolean) - true on success. On false error code is returned in NeoMessage.error
                    NeoSearchDir

                    procedure NeoSearchDir(var searchstring:string);


                    Prints a filtered file listing of the current directory to the console. On input:
                      parameters:
                    • searchString (string) - length-prefixed searchstring
                    NeoDoMath

                    function NeoDoMath(func:byte):byte;


                    Performs API request to math coprocessing library. Not well documented yet.
                      parameters:
                    • func (byte) - number of function to be called
                    NeoSetDefaults

                    procedure NeoSetDefaults(acol,xcol,solid,size,flip:byte);


                    Sets colour for upcoming drawing operations.
                      parameters:
                    • acol (byte) - value that will be ANDED with current colour
                    • xcol (byte) - value that will be XORED with current colour
                    • solid (byte) - solid flag (0=empty, 1=solid)
                    • size (byte) - dimension (for text)
                    • flip (byte) - flip flag for tiles (0=none, 1=horizontal, 2=vertical, 3=both)
                    NeoDrawLine

                    procedure NeoDrawLine(x0,y0,x1,y1:word);


                    Draws a line.
                      parameters:
                    • x0 (word) - first x coordinate
                    • y0 (word) - first y coordinate
                    • x1 (word) - second x coordinate
                    • y1 (word) - second y coordinate
                    NeoDrawRect

                    procedure NeoDrawRect(x0,y0,x1,y1:word);


                    Draws a rectangle.
                      parameters:
                    • x0 (word) - first x coordinate
                    • y0 (word) - first y coordinate
                    • x1 (word) - second x coordinate
                    • y1 (word) - second y coordinate
                    NeoDrawEllipse

                    procedure NeoDrawEllipse(x0,y0,x1,y1:word);


                    Draws ellipse.
                      parameters:
                    • x0 (word) - first x coordinate
                    • y0 (word) - first y coordinate
                    • x1 (word) - second x coordinate
                    • y1 (word) - second y coordinate
                    NeoDrawPixel

                    procedure NeoDrawPixel(x0,y0:word);


                    Draws single pixel.
                      parameters:
                    • x0 (word) - x coordinate
                    • y0 (word) - y coordinate
                    NeoWritePixel

                    procedure NeoWritePixel(x0,y0:word;c:byte);


                    Draws single pixel.
                      parameters:
                    • x0 (word) - x coordinate
                    • y0 (word) - y coordinate
                    • c (byte) - color index
                    NeoDrawString

                    procedure NeoDrawString(x0,y0:word;var s:string);


                    Prints e string at the specified location.
                      parameters:
                    • x0 (word) - x coordinate
                    • y0 (word) - y coordinate
                    • s (string) - string to be printed
                    NeoDrawImage

                    procedure NeoDrawImage(x0,y0:word;id:byte);


                    Puts an image from the graphic memory to desired location.
                      parameters:
                    • x0 (word) - x coordinate
                    • y0 (word) - y coordinate
                    • id (byte) - image id (0-127 tiles, 128-191 sprites 16, 192-255 sprites 32);
                    NeoDrawTileMap

                    procedure NeoDrawTileMap(x0,y0,x1,y1:word);


                    Draws current tilemap on desired area.
                      parameters:
                    • x0 (word) - first x coordinate
                    • y0 (word) - first y coordinate
                    • x1 (word) - second x coordinate
                    • y1 (word) - second y coordinate
                    NeoSetPalette

                    procedure NeoSetPalette(col,r,g,b:byte);


                    Changes color in system pallette.
                      parameters:
                    • col (byte) - color number to be changed
                    • r (byte) - red component
                    • g (byte) - green component
                    • b (byte) - blue component
                    NeoGetPalette

                    procedure NeoGetPalette(col:byte;var r:byte;var g:byte;var b:byte);


                    Returns selected color rgb components from system pallette.
                      parameters:
                    • col (byte) - color number to be returned
                    • r (byte) - reference to red component
                    • g (byte) - reference to green component
                    • b (byte) - reference to blue component
                    NeoGetPixel

                    function NeoGetPixel(x,y:word):byte;


                    Reads pixel. Sets error if out of range.
                      parameters:
                    • x (word) - x coordinate
                    • y (word) - y coordinate
                    • returns:
                    • (byte) - returned pixel value
                    NeoResetPalette

                    procedure NeoResetPalette;


                    Resets system palette to default.
                      NeoSelectTileMap

                      procedure NeoSelectTileMap(mem,xoffset,yoffset:word);


                      Sets the current tilemap.
                        parameters:
                      • mem (word) - address in 6502 memory of Tilemap definition (header needed)
                      • xoffset (word) - left offset in pixels
                      • yoffset (word) - top offser in pixels
                      NeoGetSpritePixel

                      function NeoGetSpritePixel(x,y:word):byte;


                      Reads pixel from sprite layer. (0-15, 0 = transparency) Sets error if out of range.
                        parameters:
                      • x (word) - x coordinate
                      • y (word) - y coordinate
                      • returns:
                      • (byte) - returned pixel value
                      NeoSetColor

                      procedure NeoSetColor(col:byte);


                      Sets colour for upcoming drawing operations.
                        parameters:
                      • col (byte) - value that will be XORED with current colour
                      NeoSetSolidFlag

                      procedure NeoSetSolidFlag(flag:byte);


                      Sets the solid flag, which indicates either solid fill (for shapes) or solid background (for images and fonts)
                        parameters:
                      • flag (byte) - 0 empty / 1 solid
                      NeoSetDrawSize

                      procedure NeoSetDrawSize(size:byte);


                      Sets the drawing scale for images and fonts
                        parameters:
                      • size (byte) - drawing size
                      NeoSetFlip

                      procedure NeoSetFlip(flip:byte);


                      Sets the flip bits for drawing images. Bit 0 set causes a horizontal flip, bit 1 set causes a vertical flip.
                        parameters:
                      • flip (byte) - flip byte
                      NeoResetSprites

                      procedure NeoResetSprites;


                      Resets the sprite system.
                        NeoUpdateSprite

                        procedure NeoUpdateSprite(s0:byte;x,y:word;image,flip,anchor:byte);


                        Updates selected sprite. To not update a value set its byte values to $80 (or $8080 for a coordinate).
                        The coordinates cannot be set independently. Sprite 0 is the turtle sprite.
                          parameters:
                        • s0 (byte) - sprite number
                        • x (word) - x position
                        • y (word) - y position
                        • image (byte) - image (bits 0-5: sprite number, bit 6 indicated big sprite 32),
                        • flip (byte) - flip flag (0=none, 1=horizontal, 2=vertical, 3=both)
                        • anchor (byte) - sets anchor point
                          Anchor points:

                          7 | 8 | 9
                          ---+---+---
                          4 |0/5| 6
                          ---+---+---
                          1 | 2 | 3
                        NeoHideSprite

                        procedure NeoHideSprite(s0:byte);


                        Hide the sprite.
                          parameters:
                        • s0 (byte) - sprite number
                        NeoInRange

                        function NeoInRange(s0,s1,range:byte):byte;


                        Returns not zero value if the distance between the centres of the sprites is less or equal range value.
                          parameters:
                        • s0 (byte) - first sprite number
                        • s1 (byte) - second sprite number
                        • range (byte) - collision distance range
                        • returns:
                        • (byte) - not zero if collided
                        NeoGetSpriteXY

                        procedure NeoGetSpriteXY(s0:byte; var x:word;var y:word);


                        Returns coordinates of the selected sprite. Coordinates are returned in referenced variabled.
                          parameters:
                        • s0 (byte) - sprite number
                        • x (word) - variable that gets x coordinate
                        • y (word) - variable that gets y coordinate
                        • returns:
                        • (byte) - not zero if collided
                        NeoGetJoy

                        function NeoGetJoy:byte;overload;


                        Returns base controller status.
                        Bits are (from zero) Left, Right, Up, Down, A, B. Active state is 1.
                          returns:
                        • (byte) - controller state
                        NeoGetJoyCount

                        function NeoGetJoyCount:byte;


                        returns the number of game controllers plugged in to the USB This does not include the keyboard based controller, only physical controller hardware.
                          returns:
                        • (byte) - controllers number
                        NeoGetJoy

                        function NeoGetJoy(player:byte):byte;overload;


                        Returns specific controller status. Controller 0 is the keyboard controller, Controllers 1 upwards are those physical USB devices. This returns a 32 bit value in Params[0..3] which currently is compatible with function 1, but allows for expansion.
                        Bits are (from zero) Left, Right, Up, Down, A, B. Active state is 1.
                          parameters:
                        • player (byte) - player number (must be 1 for now)
                        • returns:
                        • (byte) - controller state
                        NeoMute;overload

                        procedure NeoMute;overload;


                        Resets the sound system.
                          NeoMute

                          procedure NeoMute(channel:byte);overload;


                          Resets selected sound channel.
                            parameters:
                          • channel (byte) - channel number
                          NeoBeep

                          procedure NeoBeep;


                          Plays the startup beep.
                            NeoQueueNote

                            procedure NeoQueueNote(channel:byte;freq,len,slide:word;stype:byte);


                            Queues a sound to be played.
                              parameters:
                            • channel (byte) - channel number
                            • freq (word) - tone frequency
                            • len (word) - not length (in cs)
                            • slide (word) - slide change per cs
                            • stype (byte) - sound type (beeper=0 - nothing else currently supported)
                            NeoQueueNoteX

                            procedure NeoQueueNoteX(channel:byte;freq,len,slide:word;wave:byte;vol:byte);


                            Queues a sound to be played.
                              parameters:
                            • channel (byte) - channel number
                            • freq (word) - tone frequency
                            • len (word) - not length (in cs)
                            • slide (word) - slide change per cs
                            • wave (byte) - sound wave type (0 - square, 1 - white noise)
                            • vol (byte) - sound volume
                            NeoGetChannels

                            function NeoGetChannels:byte;


                            Returns the number of available sound channels
                              returns:
                            • (byte) - number of channels
                            NeoSoundFx

                            procedure NeoSoundFx(channel,num:byte);


                            Play sound effect immediately clearing queue.
                              parameters:
                            • channel (byte) - channel number
                            • num (byte) - effect number
                            NeoGetQueueLen

                            function NeoGetQueueLen(channel:byte):byte;


                            Return the number of notes outstanding on channel before silence, including any current playing note.
                              parameters:
                            • channel (byte) - channel number
                            • returns:
                            • (byte) - number of notes
                            TurtleInit

                            procedure TurtleInit(s0:byte);


                            Initialise the turtle graphics sytem using selected sprite, don’t show it.
                              parameters:
                            • s0 (byte) - sprite number
                            TurtleRight

                            procedure TurtleRight(deg:word);


                            Turn the turtle right by selected number of degrees. Show if hidden.
                              parameters:
                            • sprite (word) - angle in degrees
                            TurtleMove

                            procedure TurtleMove(dist:word;col:byte;drawing:byte);


                            Move the turtle forward by selected number of steps.
                              parameters:
                            • dist (word) - distance in steps
                            • col (byte) - ink colour
                            • drawing (byte) - pen position flag (0=up, 1=down)
                            TurtleHide

                            procedure TurtleHide;


                            Hides the turtle.
                              TurtleHome

                              procedure TurtleHome;


                              Move the turtle to the home position (pointing up in the centre).
                                NeoSetCursorXY

                                procedure NeoSetCursorXY(x,y:word);


                                Positions the display cursor at x,y.
                                  parameters:
                                • x (word) - x coordinate
                                • y (word) - y coordinate
                                NeoShowCursor

                                procedure NeoShowCursor(show:byte);


                                Shows or hides the mouse cursor.
                                  parameters:
                                • show (byte) - 0 hide / 1 show
                                NeoReadMouse

                                procedure NeoReadMouse;


                                Returns the mouse position (screen pixel, unsigned) in neoMouseX, neoMouseY buttonstate in neoMouseButton (button 1 is 0x1, 2 0x2 etc., set when pressed), scrollwheelstate in neoMouseWheel as uint8 which changes according to scrolls.
                                  NeoIsMousePresent

                                  function NeoIsMousePresent:boolean;


                                  returns true if mouse is plugged and detected.
                                    returns:
                                  • (boolean) - true if mouse available
                                  NeoSelectCursor

                                  procedure NeoSelectCursor(shape:byte);


                                  Select a mouse cursor from predefined shapes.
                                    parameters:
                                  • shape (byte) - shape number
                                  NeoBlitterBusy

                                  function NeoBlitterBusy:boolean;


                                  used to check availability and transfer completion.
                                    returns:
                                  • (boolean) - true if the blitter/DMA system is currently transferring data,
                                  NeoBlitterCopy

                                  procedure NeoBlitterCopy(src:cardinal;dst:cardinal;len:word);


                                  Copy the block of memory. Allows transfer of data in between 6502 RAM, Video RAM and Graphics RAM.
                                  The upper 8 bits of the address are : 6502 RAM ($00xxxx) VideoRAM ($8xxxxx) Graphics RAM($90xxxx).
                                  Sets error flag if the transfer is not possible (e.g. illegal write addresses).
                                    parameters:
                                  • src (cardinal) - source data address
                                  • dst (cardinal) - target data address
                                  • len (word) - data length in bytes
                                  NeoBlitterXCopy

                                  procedure NeoBlitterXCopy(action:byte;src,dest:pointer);


                                  Copy a source rectangular area to a destination rectangular area. It's oriented toward copying graphics data, but can be used as a more general-purpose memory mover. The source and target areas may be different formats, and the copy will convert the data on the fly.
                                  The upper 8 bits of the address are : 6502 RAM ($00xxxx) VideoRAM ($8xxxxx) Graphics RAM($90xxxx).
                                    parameters:
                                  • action (byte) - blit action
                                  • src (pointer) - pointer to source rectangle data block (TBlitBlock)
                                  • dst (pointer) - pointer to target rectangle data block (TBlitBlock)

                                    For more info check neo6502 API Reference: https://www.neo6502.com/reference/api-listing/#group-12-blitter
                                  NeoBlitImage

                                  procedure NeoBlitImage(action:byte;src:pointer;x,y:word;format:byte);


                                  Blits an image from memory onto the screen. The image will be clipped, so it's safe to blit partly (or fully) offscreen-images.
                                    parameters:
                                  • action (byte) - blit action
                                  • src (pointer) - pointer to source rectangle data block (TBlitBlock)
                                  • x (word) - x pixel coordinate on screen
                                  • y (word) - y pixel coordinate on screen
                                  • format (byte) - destination format, determines how framebuffer will be written
                                    For more info check neo6502 API Reference: https://www.neo6502.com/reference/api-listing/#group-12-blitter
                                  NeoInitEditor

                                  procedure NeoInitEditor;


                                  Initialises the editor
                                    NeoReenterEditor

                                    procedure NeoReenterEditor;


                                    Re-enters the system editor. Returns the function required for call out, the editors sort of ’call backs’ - see editor specification