ugBASIC is an isomorphic and open source language, fully documented and designed to develop portable programs, without sacrificing efficiency. With a single source it is therefore possible to create games for numerous 8 bit platforms.
MOS 6502 Zilog Z80 Motorola 6809
Amstrad Atari ColecoVision Commodore Dragon MSX Olivetti Radio Shack Thomson SEGA ZX Spectrum
CC65 Z88DK ASM6809
ugBASIC is able to handle graphics with double buffering, to use directly PNG/JPG and other standard image formats, to manage additional RAM banks, to read multiple keyboard keys at the same time and to do inline assembly. The labor and time saving is such that it allows to create professional and high performance games in a short time.
On this video, you have the example of a real-time animation of 4 fairly large sprites on Thomson MO6. Sprites can also move in a full background setting. This new language will allow for hyper-fast game development on all 8-bit consoles and computers.
This is an example of vector graphics render with ugBASIC. The characteristics of the language are such as to allow fast execution of the same BASIC source on various home computers and consoles.
Full and complete support for console hardware features on ColecoVision, SEGA SC-3000 and SEGA SG-1000. Automatic graphic conversion from modern graphical formats included.
Each target can have a dedicated optimizer, which allows to achieve very interesting
results while leaving the BASIC code fully readable.
Here we see the peephole
optimizer for Motorola 6809 in action.
With ugBASIC is simple to write multitasking programs using parallel programming, available "out of the box". In systems with severe memory constraints such as computers based on 8 bit processors, a mechanism based on protothreads has been implemented.
You can download the official ugBASIC compiler (ugbc), which directly converts a program written in ugBASIC into the assembly equivalent for the given CPU / computer. The compiler is free, open source and licensed under the Apache 2.0 license. You can download or recompile the latest version from the GitHub repository.
An user manual is available to guide you into the language.
The book starts from "basic" concepts, like variables, operators, control statements,
subroutines, and explain how to do graphics and sound, images, sprites, and even
write multitasking programs. You will discover how to create programs while taking
advantage of the hardware limitations of retro computers.
This book is updated frequently, and it is interesting if you want to discover how to apply
modern programming techniques to retro computers, and it is
essential if you want to use ugBASIC to its fullest.
There is also an online version,
and the reference manual,
useful for those wishing to modify and/or to extend the language.
Compile your ugBASIC sources efficiently and effectively for multiple retrocomputers: ugBASIC IDE makes it easier to download and install the various software required for one or more retrocomputers, all just one "click away".
Donkey Kong su PC128 Olivetti Prodest
Paolo Cattaneo è uno sviluppatore talentuoso. Ammaliato dalle potenziali di ugBASIC, ha tirato fuori dal cilindro un port davvero interessante che mostra come "si può fare..."
ugBasic Game Programming #2. Exploring Atari 8bit Color Graphics
Atari 8bit color graphics and text mode capabilities are explored in ugBasic and we start a basic game animation loop.
La famiglia Olivetti Prodest al pranzo della domenica
Gioco in foto: Creepy Carrots by Paolo Cattaneo / March 2024 / Developed with ugBasic
Il manuale di ugBASIC / Commodore 64
Ci è giunta notizia della nuova revisione del manuale del linguaggio ugBASIC di Marco Spedaletti. Diamo un'occhiata a come si presenta la routine di tracciamento delle linee su alcuni di questi computer.
MSPRITE
command under vic2 supports the duplication of graphic definition, in order to reduce the memory requirements. The MIDI to IMF converter has been improved, with support for volume changing and specific percussion handling and automatic instrument calculation that composition software takes for granted, and improvements have also been made to multitasking interleaving capabilities, which can now also handle "busy" waits, making it even easier to write algorithms. Threads can, among other things, be suspended and resumed with the SUSPEND
and RESUME
commands.IMAGEREF
is now available, which allows you to represent an IMAGE
, an ATLAS
or an entire SEQUENCE
parametrically, that is, as a reference to one of the same graphic elements previously loaded. This tool allows you to modify the graphic resources at run time, thus allowing you to create games with great aesthetic variability. A whole set of instructions has been added, to manage (automatically) the animations and movements of graphic elements, taking advantage of the improved multitasking. In particular, the ANIMATE
command allows you to activate and drive animations while the program is running, and so does the MOVE
command, which allows you to move objects in parallel, even synchronized with the animation. This is a fairly recent feature, which will be improved and extended in future versions. The new PATH
data type, together with the TRAVEL
instruction, allows you to calculate all the intermediate points of a path between two points, thus allowing you to easily create "programmed paths", such as those associated with graphic adventure animations. These paths are also available on the MOVE
statement, to allow you to move elements on defined paths.OPTION FINAL RETURN
directive has been added, which allows you to generate a subprogram, callable, if the target allows it, from embedded BASIC or in general from the host operating system. Additional pragma DEFINE RESIDENT DETECTION
allows to optimize the usage of resident memory, when banking is active. The PRINT RAW
is now available, to print characters without escape sequence parsing. It is now possible to indicate whether an array can receive data from expansion memories, with the FOR BANK READ
and FOR BANK WRITE
options. The conditional compilation has been extended, to support compilation conditional on the presence or absence of hardware sprites (ON SPRITE AVAILABLE
/ ON SPRITE NOT AVAILABLE
). The audio and music assets are now READ ONLY
by default, as well as graphical assets on "console" type targets. The "retro compatible hacks" have been updated which ensure that previously written games can run without any issues, although there have been some small changes in the specifications. c64reu
), the Thomson MO6 (pc128op
), Thomson TO8 (to8
), and the TRS-80 Color Computer 3 (coco3
) have automatic loading into the memory banks, even if the resource is not marked as BANKED
. This allows a lot of space to be automatically recovered. The available memory for parsing has been increased of a 10x factor, and dynamic strings are more space efficient thanks to string tranpilation.PLACE
, CMOB
, MOB ON/OFF
, LOOP...EXIT IF...END LOOP
, CHECK
, ROT
, DRAW
, CSET
, CGOTO
, HIRES
, MULTI
, MOD
(as a command), COLOR
, WAVE
, PAUSE
, ENVELOPE
, DUP
, INST
, FILL
, CIRCLE
, INSERT
, DRAW TO
, JOY
(with TSB convention), %%
, $$
, CENTER AT
, ON KEY
, CHAR
, PROC
, NRM
, AT
(string swap), KEYGET
, PAINT
, DO NULL
, D.POKE
, D.PEEK
, REC
, BLOCK
. The project aims at portability rather than implementation: therefore, you will have access to all the more advanced features, while being able to recompile your Simons' BASIC projects (this is driven by OPTION DIALECT
pragma).
Moreover, this is the first version to implement the DOJO protocol. The ugBASIC language is now equipped with primitives capable of communicating with an external server, called DOJO, which is a system for creating virtual "game rooms" online.cpc
) with the PALETTE PRESERVE
pragma, and it is possible to enable keyboard / joystick management directly under interrupt, to ensure that the value readings are performed at a constant speed. In this regard, a specific keyboard driver has been implemented for each target, with a support for keyboard queue.zx
) compiler now emulates key directions using the world wide WASD standard, and random number generation has been made more compatible with other BASICs, if the parameter 0 or 1 is used (RND(0)
, RND(1)
), with "out of the box" generation of floating point numbers between 0.0 and 1.0. Disk image generation for the TRS-80 Color Computer 1/2/3 (coco
, coco3
) has also been enhanched, along with disk image generation for the C64 with REU memory expansion (c64reu
). The DATA
instruction is now able to manage binary strings.
Finally, from this version onwards, "retro compatible hacks" have been implemented which ensure that previously written games can run without any issues, although there have been some small changes in the specifications.DEFINE PROGRAM START
pragma, and to differentiate procedures if a joystick is not present. WAIT VBL
instruction.CONSOLE
, CONSOLE SAVE
, CONSOLE USE
commands has been added, to have up to four different virtual consoles; CLINE
command has been extended, to support graphical modes; ENABLE INTERRUPT
/ DISABLE INTERRUPT
, that are able to enable or disable interrupts at CPU level; COMBINE NIBBLE
, that can combine two 4 bit values in a single 8 bit value; LINE
, as alias of DRAW
, but with a more standard BASIC compatible syntax; PLAY
, to play a string as a music; DEFINE AUDIO TARGET
and DEFINE AUDIO SYNC / ASYNC
pragmas, to select the output for audio and synchronized play; the BIT
data type has been optimized; WRITING
instruction has been deprecated, and not more supported.to8
) target. It is currently in beta stage. more...FLIP IMAGE
command has been introduced, in order to reduce the memory footprints for graphical images.BANKED
keyword, if available. A way to play native PSG files has been added, as well. From this point on, the static and dynamic hardware integration and configuration will be available directly from ugBASIC by using the CONFIGURATION
instruction.EXP
and LOG
instructions. Added instructions VARBANKPTR
and VARBANK
, to allow access to banked memory. c64reu
) target. more...LOAD IMAGES
/ LOAD SEQUENCE
.WAIT VBL
, as well as the possibility of knowing whether you are operating with a LITTLE ENDIAN
or BIG ENDIAN
system. Now it is possible to redefine, at run time, the characters of the font loaded via the DEFDGR
command, as well as load an external one with the LOAD FONT
command.IMAGE
/ IMAGES
/ SEQUENCE
starting from strings, makes it possible to participate in programming competitions where it is necessary to be able to draw nice graphics without being able to load them from storage media.FORBID
and ALLOW
keywords to (RE
)SPAWN
a set of threads at the same time, assigning the handle of each of them to an element of a previously declared array, and to KILL
threads in the very same way. The SOUND
command has been extended to allow you to output a sequence of sounds with a single instruction.
The current version adds support for the TRS-80 Color Computer 3 (coco3) and
is able to generate disk images for ATARI, MSX and Commodore VIC-20.
Further optimizations have been introduced in the generated code, in particular for CPU Z80. Several commands have been added,
and there is also better compatibility with 1980s BASIC syntax. Moreover, it can
load and save data to mass storage.
Use IDE
Installation
The current version adds preliminary support for inline assembly, software for map tiling, system calls, the floating point data type, for the Commodore 128 target with the Zilog Z80 processor and for graphics blitting operations.
Further optimizations have been introduced in the generated code, in particular for the Olivetti Prodest PC128 home computers, which is now able to handle banking at the single frame level instead of the whole image, and for the COCO TRS-80 computer,
which can now make use of almost all available memory, including that under the ROM banks.
Use IDE
Installation
Happy birthday ugBASIC! Today (24/04) we celebrate two
years since the first commit, and with this milestone in
mind let's take a look at some of the results obtained by
the development team.
From a qualitative point of view, the system
supports as many as 26 heterogeneous systems,
ranging from ATARI to Olivetti Prodest, passing through MSX, TRS-80 and,
obviously, Commodore computers. A dedicated page takes into account the
actual list of supported targets.
From a quantitative point of view, ugBASIC is composed of over
156,000 lines of C code and about 43,000 lines of assembly code
(MOS 6502, Zilog Z80 and Motorola 6809), where the lexer and the
parser occupy 7,559 lines!
For published data: generated using David A. Wheeler's 'SLOCCount'
Use IDE
Download executables
Targets
The current version (1.13.1) introduces support for Radio Shack TRS-80 Color Computer.
Use IDE
Installation
The version (1.12.1) introduces support for Amstrad CPC 664 target.
Use IDE
Installation
The version 1.11.2 introduces support for audio and the Commodore 128 target.
Use IDE
Installation
Usage
Happy birthday ugBASIC! Today (25/04) we celebrate one
year since the first commit, and with this milestone in
mind let's take a look at some of the results obtained by
the development team.
From a qualitative point of view, the system
supports as many as 14 heterogeneous systems,
ranging from ATARI to Olivetti Prodest, passing through MSX and,
obviously, Commodore computers.
From a quantitative point of view, ugBASIC is composed of over
137,000 lines of C code and over 36,000 lines of assembly code
(MOS 6502, Zilog Z80 and Motorola 6809), where the lexer and the
parser occupy 6,408 lines!
Following the sizing indicated by the "COCOMO model", to redevelop
ugBASIC from scratch it would take 55 man-months or, if you like,
two and a half years of development. Alternatively, having 22 developers,
it would be done in a year.
For published data: generated using David A. Wheeler's 'SLOCCount'
Use IDE
Installation
Usage
The version 1.10.3 introduces support for SEGA SC-3000 home computer and SG-1000 console.
Use IDE
Installation
Usage
The version 1.9.1 introduces support for ColecoVision console architecture.
Use IDE
Installation
Usage
An interesting competition is held at the beginning of each year: the BASIC 10Liner Contest,
and it is possible to use ugBASIC to join in the next competition with your preferred home computer.
How to join
Use IDE
executables
The version 1.8.2 introduces support for MSX home computer architecture.
Use IDE
Installation
Usage
The version 1.7.2 introduces various improvements and bug fixes.
Use IDE
Installation
Usage
A brand new IDE has been released for ugBASIC: ugBASIC IDE
makes it easier to download and install the various software required for one or more
retrocomputers, all just one "click away". It offers syntactic highlighting,
multiple windows, file history, online help and an integration for error
diagnostics. With just one click you can see your program running directly
on one of the supported emulators.
Download executables
The current version (1.6) introduces various improvements and bug fixes.
Installation
Usage
The version 1.5 introduces support for Commodore VIC-20, film strip animations and multitasking.
Complete list of targets
How to use multitasking
Installation
Usage
The version 1.4 introduces support for Olivetti PC128 Prodest and Thomson MO5 computer.
Complete list of targets
Installation
Usage
The version 1.3.2-beta introduces various improvements and bug fixes.
Installation
Usage
The version 1.3.1-beta introduces various improvements and bug fixes.
Installation
Usage
The version 1.3-beta introduces support for Dragon 32 computer.
Complete list of targets
Installation
Usage
The version (1.2-beta) introduces various improvements and bug fixes.
Installation
Usage
The version 1.1-beta introduces support for the Atari 8-bit family of computers, such as Atari 400/800, Atari 600XL / 800XL / 1200XL and XEGS.
Complete list of targets
Installation
Usage