Category:Artisan BASIC
This page was last modified 15:07, 17 January 2024 by Mars2000you.

Contents

Description

Artisan BASIC is an extension created by Zoran Majcenić, a Croatian coder.

I! is targeted at MSX1 systems with 64kB of memory and a floppy controller. It extends BASIC functionality in areas of memory access, sprite control, animations, sound player and software bitmap operations.

The screens that are directly concerned by this extension are SCREEN 1, 2 and 3. On MSX2 and higher, you can also use SCREEN 4, but don't forget that this screen uses sprites type 2 that are not supported by Artisan BASIC.

The extension exists in 2 versions:

  • one using CALL instructions lwhich it's detailed below)
  • one using the DEF USR instruction to handle all provided functions - this version can be combined with the run-time compiler X-BASIC - Using of DEF USR to call the Artisan routines is explained on pages 63 to 67 of the manual

You can find it here: https://github.com/zmajcenic/ARTISAN-BASIC - A demo-game in both versions and several other examples are included on the ARTISAN.DSK disk image.

Installation

According the version, the installation can be made by

  • BLOAD"ARTISANE.BIN",R for the CALL version
  • BLOAD"ARTISAND.BIN",R for the DEFUSR version

Do not install it several times, it would lead to unexpected results. It is recommended to use CALL ARTINFO in an AUTOEXEC.BAS file to check if the extension if already present and load it only if is not the case.

The extension will be installed in page 1 from &H4000, what preserves the space for BASIC programs in pages 2 and 3.

Instructions (general info)

Artisan BASIC in its CALL version adds 36 new instructions.

Note: CALL can be replaced by the character underscore (_). A space is not required after this character. See CALL for more info.

Instructions (ordered per category)

Animation

Instruction Description
CALL ANIMSTART Starts automatic execution of an animation sequence
CALL ANIMSTEP Manually cycles through a stopped animation sequence
CALL ANIMSTOP Stops automatic execution of an animation sequence
CALL AUTOSGAMDEF Defines automatic sprite group moves and animations with boundaries
CALL AUTOSGAMSTART Starts automatic sprite group moves and animations
CALL AUTOSGAMSTOP Stop automatic sprite group moves and animations
CALL SGAM Starts manual sprite group moves and animations


Characters

Instruction Description
CALL ANIMCHAR Associates a character with an animation sequence
CALL ANIMDEF Defines a sequence of animation items
CALL ANIMITEMPTR Defines single animation state based on pattern data


Debugging

Instruction Description
CALL ARTINFO Provides infos about the extension (version, compilation flags, free memory start in page 1) (*)
CALL GENCAL Returns values in Z80 registers when executing a routine with predefined values in these registers

(*) Also available in the DEF USR version of Artisan BASIC

Graphics

Instruction Description
CALL BLIT Applies monochrome bitmap described with a mask and data to a memory buffer
CALL COLL Checks collision detection between a single object and a list of sprites or predefined rectangles
CALL TILERAM Copies monochrome bitmap to a memory buffer in a tiled fashion
CALL TILEVRM Copies monochrome bitmap to VRAM in a tiled fashion


RAM Access

Instruction Description
CALL BLIT Applies monochrome bitmap described with a mask and data to a memory buffer
CALL BOXMEMCPY Copies memory window from one location in RAM to another
CALL BOXMEMVRM Copies memory window from RAM to VRAM
CALL FILRAM Writes a value to several bytes of the memory (RAM)
CALL MEMCPY Copies memory block from one location in RAM to another
CALL MEMVRM Copies a block of the RAM to the VRAM
CALL TILERAM Copies monochrome bitmap to a memory buffer in a tiled fashion
CALL VRMMEM Copies a block of the VRAM to the RAM


Sound and Music

Instruction Description
CALL SNDPLYINI Initializes the sound player with music and effects data
CALL SNDPLYOFF Stops music and effects
CALL SNDPLYON Starts music and disables keyclick
CALL SNDSFX Plays an effect on a specified channel


Sprites

Instruction Description
CALL ANIMDEF Defines a sequence of animation items
CALL ANIMITEMPAT Defines single animation state based on sprite pattern and color
CALL ANIMITEMPTR Defines single animation state based on pattern data
CALL ANIMSPRITE Associates a sprite with an animation sequence
CALL COLL Checks collision detection between a single object and a list of sprites or predefined rectangles
CALL SPRDISABLE Disables sprite handling system
CALL SPRENABLE Enables sprite handling system
CALL SPRGRPMOV Changes location of a group of sprites


Variable Settings

Instruction Description
CALL MAXANIMDEFS Determines maximum of memory buffers for animation definitions
CALL MAXANIMITEMS Determines maximum of memory buffers for animation items
CALL MAXANIMSPRS Determines maximum of memory buffers for sprite or character animations
CALL MAXAUTOSGAMS Determines maximum of memory buffers for automatic sprite group moves and animations


VRAM Access

Instruction Description
CALL BOXMEMVRM Copies memory window from RAM to VRAM
CALL FILVRM Writes a value to several bytes of the video memory (VRAM)
CALL MEMVRM Copies a block of the RAM to the VRAM
CALL TILEVRM Copies monochrome bitmap to VRAM in a tiled fashion
CALL VRMMEM Copies a block of the VRAM to the RAM


Instructions (alphabetic order)

Instruction Generation Type
CALL ANIMCHAR MSX1 Characters
CALL ANIMDEF MSX1 Characters + Sprites
CALL ANIMITEMPAT MSX1 Sprites
CALL ANIMITEMPTR MSX1 Characters + Sprites
CALL ANIMSPRITE MSX1 Sprites
CALL ANIMSTART MSX1 Animation
CALL ANIMSTEP MSX1 Animation
CALL ANIMSTOP MSX1 Animation
CALL ARTINFO (*) MSX1 Debugging
CALL AUTOSGAMDEF MSX1 Animation
CALL AUTOSGAMSTART MSX1 Animation
CALL AUTOSGAMSTOP MSX1 Animation
CALL BLIT MSX1 Graphics + RAM Access
CALL BOXMEMCPY MSX1 RAM Access
CALL BOXMEMVRM MSX1 RAM + VRAM Access
CALL COLL MSX1 Graphics + Sprites
CALL FILRAM MSX1 RAM Access
CALL FILVRM MSX1 VRAM Access
CALL GENCAL MSX1 Debugging
CALL MAXANIMDEFS MSX1 Variable Settings
CALL MAXANIMITEMS MSX1 Variable Settings
CALL MAXANIMSPRS MSX1 Variable Settings
CALL MAXAUTOSGAMS MSX1 Variable Settings
CALL MEMCPY MSX1 RAM Access
CALL MEMVRM MSX1 RAM + VRAM Access
CALL SGAM MSX1 Animation
CALL SNDPLYINI MSX1 Sound and Music
CALL SNDPLYOFF MSX1 Sound and Music
CALL SNDPLYON MSX1 Sound and Music
CALL SNDSFX MSX1 Sound and Music
CALL SPRDISABLE MSX1 Sprites
CALL SPRENABLE MSX1 Sprites
CALL SPRGRPMOV MSX1 Sprites
CALL TILERAM MSX1 Graphics + RAM Access
CALL TILEVRM MSX1 Graphics + VRAM Access
CALL VRMMEM MSX1 RAM + VRAM Access

(*) Also available in the DEF USR version of Artisan BASIC

Data storage in RAM

The 3rd parameter of CALL ARTINFO will give you the 1st address in page 1 that is free for storing user data.

With the full current CALL version (0.9), the user data can be stored

  • in page 0 from &H0100 to &H3FFF (the &H0000 - &H00FF is reserved for system data) = 16128 bytes
  • in page 1 from &H65E8 to &H7FFF = 6680 bytes

Pages 2 and 3 can also be used but keep in mind that

  • BASIC programs are installed there, VARPTR is useful to find where BASIC variables can be stored
  • the higher part of page 3 is also reserved for system data