Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

bitblitter

4
Posts
4
Topics
36
Followers
5
Following
A member registered Sep 09, 2020 · View creator page →

Creator of

Recent community posts

Micro16 community · Created a new topic Changelog
(2 edits)

-------------------------------------------------------------------------------
0.2.3

micro16 virtual computer:
- fixed crash bug in micro-conio.c that was due to the MS Visual C
runtime's isspace() blowing up on umlaut characters

m16basic:
- the precompiler now takes care of auto upper casing everything. So you can
type in your source as you like. Note though that M16BASIC remains 
case insensitive: Variable_a still is the same as VARIABLE_A
- renamed PLAYSID to SIDPLAY
- SIDPLAY N, 0 now stops sid playback
- added variable reference operator '&'. Using '&varname' a reference to
a variable can be passed around. 
- LOAD now expects a variable reference
as its third parameter and will write the number of bytes loaded
or a negative error code to the referenced variable
- fixed a bug in the if-then-else-endif code generator that would
cause the vm to become corrupted

-------------------------------------------------------------------------------
0.2.2

micro16 virtual computer:
- disabled the command line direct edit functionality
because it has proven to be way too complex to try to mix&match
directly edited code (with enforced line numbers) with ED 
and particularly the m16basic pre compiler
- enabled auto running a basic program passed in from the command line
by adding -x after the file name (i.e parallax.bas -x)
- fixed several bugs related to the whole NEW/SAVE/LOAD complex sometimes
not setting flags correclty causing failed source reloads and ED
not recognizing NEW

m16basic:
- completed IF THEN ELSE ENDIF implementation supporting actual code
blocks inside the branches instead of just the ecma55 minimal 
implementation (a "jump if true" following the THEN token)
- fixed a bug related to the stack size calculation of some VM opcodes

-------------------------------------------------------------------------------
0.2.1

windows installer: 
- changed default installation directory to c:\Micro16 because
the previous default (c:\Program Files\Micro16) caused the current
directory, when in the Micro16 console, to be write protected unless 
the program was run "as administrator"

micro16 virtual computer:
- console echo now gets disabled in graphics modes: display.c::SetDisplayMode()

example programs:
- new parallax.bas example demonstrating parallax scrolling via BitBlt

-------------------------------------------------------------------------------
0.2.0

micro16 virtual computer:

m16basic:
- %import implemented 
- implemented %autonumber in the preprocessor
- implemented a pre compiler stage
- enabled loading, saving and editing (ED) of free form source text files
- added $LABEL: statements for setting jump targets for =>
- GOTO LABEL and IF THEN LABEL type statements implemented

-------------------------------------------------------------------------------
0.1.2

micro16 implementation:

- introduced PAPER and INK type functionality to set background- and
foreground color for text rendering for both, character and graphics modes
This uses the first 16 colors of the palette (which in the default state 
is the EGA palette). PAPER can be 0-7 and INK 0-15
- added "hardware scroll" type functionality to the 320x240x256 driver
- added register system for thread safe access to a set of "machine registers"
which can be used to set things like display x/y scroll and so on
- multi buffer support for ED
- pgup/pgdwn support for ED
- changed all the thread locks from semaphores to spinlocks
- m16 is now statically linked against a static library build of the latest SDL
https://glusoft.com/tutorials/sdl2/static-build-visual-studio
- new sysvar TRANSPARENT , color index treated as transparent in blits etc.
- new sysvar BGCOLOR and FGCOLOR: color indexes used in mono modes (rw)
- new sysvar USRMEM: where does user ram start (ro)
- ED now supports DEL
- implemented PMEM module for virtual memory sandbox support (PEEK, POKE)
- changed display.c display mode setup so that it uses a fixed VRAM buffer
instead of malloc
- changed display.c display init functionality: added mapping of VRAM into PMEM
- palette now also in PMEM (end of system page)
- micro-conio now handles HOME and END keys
- and so does ED
- fixed bug where loading a new source via "ed filename" would not make basic
aware that a new file was loaded

m16basic changes:

- Long identifiers (Variable names and LABELS): 48
  Maximum Identifier Length was 9
  This is due to a definition in bas55 that goes from the longest BASIC
  keyword (RANDOMIZE) and limits keyword length (and with it identifiers
  like variable and label names). This -probably- can be changed quite easily
  but I'm unsure of any unexpected side effects (hence didn't do it yet :P)
  MAX_NAME_LEN is defined in lex.c and only used in lex.c::lex_parse_id(void)
  Unless some other part of BAS55 defines another constant for this 
  (and relies on it being 9) thats all that should need a change in the lexer.
  Now, as for M16BASIC: MAX_NAME_LEN is also defined in m16bas.c 
  and used there for dimensioning the size of names in the name encoder
  m16_encode_var(const char* var_name). If the BAS55 definition is changed 
  this needs to change as well and that is really all there should be to it
  (famous last words)
- implemented a LABEL mechanism for jump targets callable by name
There is a whole new section in parse.c dealing with this
For now only GOSUB LABEL is supported but this can be extended
to GOTO and THEN. All LABELs have to start with a '$' character
- comments at the end of a line are now possible by using the # character
everything following it will be ignored (lex.c::chk_basic_chars() and yylex())
- added NOP keyword (same function as REM, auto inserted on empty spacer lines)
- added INK and PAPER keywords for setting text print colors
- added SETREG REG, VALUE for setting machine registers
- added PAUSE N which will wait for N frames, used for refresh sync and general timing
- changed PRINTAT, POINT and LINEDRAW to expect parameters to be properly separated by commas
- added ifun double PEEK(double)
- added POKE address, value 
- added BITBLT address, sx, sy, sw, sh, stride, dx, dy
- added LOAD filename, address
- added SPRITESHEET sheet_num, image_data, cel_width, cel_height, cel_count stride
void S_SetSprite(int sprite_num, int sheet_num, int cel_num, int xpos, int ypos);
void S_SetSpriteanimation(int anim_num, int sprite_num, int first_cel, int num_cels, int fps);

example programs:
- added c64colors.bas
- added mandelbrot.bas
- added blit.bas
- added scroll.bas

-------------------------------------------------------------------------------
0.1.1

m16 implementation:
all of the base functionality: 
- SDL wrapper
- IMachine machine thread driver (background display and user input updates)
- bas-editor replacing the bas55 console mode line editor
- micro-conio implementing conio style keyboard input handling and character output 
plus basic stdio replacements needed to make bas55 work nicely with m16
- display.c and the basic display drivers for implementing our retro computer style 
video modes emulation

bas55 changes:

- added ifun double INKEY
- added DIR and ED commands
- added extra entry for inbuilt EDIT command so that it can be called as E
- added CLS color
- added VMODE mode
- added POINT x y color
- added DRAWLINE x0 y0 x1 y1 color
- added PRINTAT row col

VM (runtime) changes of existing functionality

- changed sprint_unscaled(rnum, d, after, exponent) and static int sprint_num(char *rnum, double d)
to not add leading and trailing blanks to all numbers they print

# end changelog

Micro16 community · Created a new topic Known Bugs
(3 edits)

Micro16

  • Some users report being unable to switch to fullscreen mode (alt-enter)
  • Some users report being unable to close the application window through the window closer (X) button or from the task bar while entering the "quit" command on the command line (or hitting ctrl-q) works fine

M16BASIC

  • You can use the sprite system in all video modes but only mode 2 works correctly. This is due to missing functionality in the drivers. 

ED

  • When copying more than one line of text (using the MARK and ctrl-c) into the clipboard, the cursor jumps back up to the start of the copied area when it was at the end while hitting ctrl-c

Windows Installer

  • Some virus scanners report the installer as malware. This is a false positive. Sadly this is quite common with executable, self extracting installers (particularly those created with NSIS, because that system seems to be also very popular with all those wonderful people on the internet, that spend their time creating malware (sarcasm!). I am checking all my installers on VirusTotal.com and only a small group of the (more exotic) scanners produce this false positive. Latest VirusTotal check of the Micro16 Windows Installer
Micro16 community · Created a new topic Preliminary Manual
(8 edits)

I'll add information to this sticky post over time in order to make it useful as a introductory manual for Micro16. So please, keep coming back here from time to time if you'd like.

M16BASIC

The embedded BASIC system employs a  compiler that outputs byte code which is then run in a VM. The compiler is at its core based on bas55 ( Copyright © 2020 Jorge Giner Cordero) which is an implementation of the ECMA-55 minimal basic standard but has been (and continues to be) extended quite a bit.

For documentation of the underlying bas55 system and a great reference manual for programming using ECMA-55 BASIC  please refer to the following link: Bas55 Documentation Page

Changes to the ecma-55 standard BASIC:

  • Variable names are not limited to A-Z[N] (N being a numeric suffix or $ ) in M16BASIC:  all identifiers have a maximum length of 48 characters and the '_' underscore character is allowed.
  • Line end comments can be used: anything following the '#' character is ignored by the compiler. Please note though that you still have to have both, a line number and the keyword REM on any pure comment lines.
  • Subroutines can be given an identifying label using the PROC keyword. Labels have to begin with '$' and otherwise fall under the general rules for identifiers.
  • use GOSUB $PROCNAME to call a labeled subroutine.
  • Text in REM comments can be any case.

M16BASIC specific additions:

  • PEEK(address) and POKE address, value can be used to directly manipulate memory.
  • VMODE N switches the display to video mode N (please refer to "Micro16 virtual computer systems for a list of modes).
  • CLS N clears the screen to the color N.
  • PAUSE N waits for N frames to be rendered before continuing (frame rate is a fixed 60 fps). This is useful for syncing graphics operations to the screen refresh to avoid tearing.
  • PRINTAT column, row sets the output position for the next PRINT statement. Note that column and row are interpreted as y,x pixel coordinates in graphics display modes.
  • INKEY returns the scan code of the key held down by the user during the current frame (or 0 if no key is being depressed).
  • PAPER N (0-7) and INK N (0-15)  set the foreground and background  color for text output.
  • POINT X,  Y, N draws a point of color N at coordinates X and Y (graphics modes only)
  • DRAWLINE X1, Y1, X2, Y2, N draws a line from point X1, Y1 to X2, Y2 using color N (graphics modes only)
  • BITBLT ImageAddress, RectX, , RectY, RectWidth, RectHeight, ImageStride, DestinationX, DestinationY copies a a rectangle of image data, as specified by the RectN parameters,  from the image located at ImageAddress to the display at DestinationX/Y. ImageStride specifies the number of bytes to skip to get from one line of the source image to the next (allows for padded scanlines) (only supported in mode 2 right now)
  • SETREG Register, Value can be used change the value of system registers.
  • LOAD Filename, Address loads a file from the current directory of the host system to the given address in memory
  • SPRITESHEET SheetID, ImageAdress, CelWidth, CelHeight, CelCount, Stride defines a "spritesheet" for the Micro16 sprite system. The first five arguments you pass in define the sheet "slot" (0-256) to be used, the memory location of the source image, the width and height and number of sprite cels included in the image (each sheet can only contain one set of cels with a common specification of dimensions). Stride defines the source image width in the same way as described under BITBLT above.
  • SPRITE SpriteID, SheetID, CelID, Xpos, Ypos sets up  a sprite slot (0-256). The arguments specify the sprite slot, the spritesheet slot used by the sprite, the cel inside the sheet and the output X and Y coordinates of the sprite's upper left corner. Note that the coordinates can be negative or exceed the display borders in order to be able to move sprites in/out of the display seamlessly.
  • ANIMATION AnimID, SpriteID,  StartCel, CelCount, FPS adds an animator to a sprite that cycles through cels StartCel to StartCel + CelCount - 1 at the given frame rate.


System Variables and Registers

System variables are fixed memory locations inside the system page (the first 16 KB or memory). The system stores various bits of state information here and some of the system variables can be changed by user programs (using POKE). Similarly the machine registers can be used to make certain settings related to various subsystems, or "virtual chips" of the IMachine. Registers are limited in number and generally only used for states that require very fast access (registers are much faster than system variables)


Micro16 virtual computer systems

  • Byte code processor VM serves as "CPU". This runs, together with the console, in a separate thread from the IMachine (which provides all the emulated hardware) at the full speed that the host computer is capable of (no artificial virtual processor speed limits are employed).
  • 1 MB of ram of which the first 16 KB are reserved by the system and another block of 128 KB is designated as video memory.
  • The IMachine's virtual graphics chip supports three different resolutions
    • (0) 80x30 character mode with 8 PAPER (background) and 15 INK  (foreground) colors plus inverse video.
    • (1) 640x480 pixels monochrome graphics
    • (2) 320x240x256 indexed color graphics. Palette is 256x24 bits RGB.
    • (3) 640x480x16 indexed color graphics (not implemented yet).
  • The graphics system has support for fast "hardware" image data copying (bitblit) and includes a sprite system with animation support.
Micro16 community · Created a new topic First steps
(4 edits)
  • Download and run Micro16Installer.exe then double click the Micro16 icon on your desktop and you are good to go create.
  • To get  started I'd recommend to run some of the included example programs and study their source in order to get a feel for M16BASIC. Simply type in DIR (does not need to be upper case) in order to get a listing of the provided examples.
  • You can enter "RUN program_name.bas" (the file extension is optional) to load a program and execute it immediately. 
  • Programs loaded this way stay in memory after they have finished executing: you can examine them using LIST or ED (edit).
  • Hit [Ctrl-q] in order to exit ED (for help with ED simply hit [Ctrl-b] and '9'  when in the editor)
  • ED will always automatically load the current program in memory into its first buffer if you start it without arguments.
  • For an introduction to the ECMA-55 minimal BASIC standard, as implemented in Micro16's inbuilt compiler, I'd like to point you to the documentation for bas55 (M16BASIC is based on this project) by Jorge Giner Cordero here Original bas55 documentation page
  • Please refer to the sticky post "Preliminary Manual" here on this board for information relating to all the Micro16 specific changes and additions to bas55.