Releases: irmen/prog8
version 10.4.1
This is a patch release that brings a bunch of optimizations and small tweaks.
Breaking Changes:
sprite.hide()
behavior change: no longer moves sprite off-screen but changes the priority to disabled.- (subtle) the compile time const calculations have been tweaked a bit to avoid precision loss in some cases. It could mean that your code suddenly needs an extra typecast here and there (compiler will complain)
Other changes:
- compiler option
-nostrictbool
has been removed. All code using bools now has to adhere to the stricter type checks (that have been the default for quite some time already) - subroutines do no longer have to end with a newline, so you can now write certain oneliners if you really want
graphics
module on the X16 now uses the new rom R48 routines to draw circles and ovals- added new example program
cx16/life.p8
(conway's game of life) - X16: added
cx16.mouse_present()
routine to check if a mouse is connected or not - X16: added
emudbg.cpu_cycles()
andemudbg.reset_cpu_cycles()
which allow for some detailed performance counters when running on the X16 emulator - X16: added new rom R48 extapi definition
cx16.EXTAPI_kbd_leds
to control the keyboard leds - X16: added new
gfx_lores
module that contains heavily optimized graphics routines for 320*240 256color (8bpp) screen mode. (much faster than gfx2) - X16 and C64: added
floats.time()
routine to get the value of the jiffy clock as a single float value. - all the disc graphics routines (that draw filled circles) have been optimized to no longer draw some parts multiple times.
- it's now actually possible to multi-assign multiple return status flags from asmsubs.
- the compiler now actually uses
@zp
,@requirezp
etc tags you put on subroutine parameters. Previously, those were silently ignored. - several code gen improvements
- several bugfixes.
(donation: If you'd like to buy me a hot coffee or spicy pizza, to keep this project going, you can do so at https://ko-fi.com/irmen Thanks a lot!.)
version 10.4
Breaking changes:
- moved non X16 specific variables and vector definitions from
cx16
tocbm
namespace. This makes them consistent with the other cbm targets (c64, pet32 etc). Most notably perhaps,cx16.CINV
(the IRQ vector) has been renamed tocbm.CINV
sprites.get_data_ptr()
signature changed: now properly returns the 2 values- removed various builtin functions:
sort
,reverse
,any
,all
. The last 2 now are available as regular functions in the newanyall
library module. diskio.f_readline()
now also returns I/O status as secondary return value in A- corrected
cx16.fetch()
signature
Other:
- added
kata:
string encoding (Katakana) - added
string.rfind()
function to search for a character starting from the end of the string - added new cx16 polling sample streaming example (not using AFLOW irq). Look in examples/cx16/pcmaudio/
- added "queens" example (queens on chessboard problem solver / benchmark)
- added
cx16.rom_version()
routine - fixed
atan2
routine - fixed a problem in gfx2 4 color mode
- performance of
gfx2.fill()
routine greatly improved in both 256 and 4 color modes - improved checks for negative array indexing
- fixed syslib problems for raw output
- added experimental
buffers
library module that provides some buffer data structure routines (subject to change!) - multiple code generation optimizations, also use certain 65C02 instructions more for more efficient code
- various bugfixes.
Thanks to various contributors on the X16 discord!
Version 10.3.1
This is a small update release to correct a few problems in 10.3, and a couple of easy changes. It's going to be the last release for a while because I need a summer break :) Other stuff and more complex bug fixes have to wait until after summer!
Library changes:
- cx16.mouse_pos() now returns the mouse coordinates as unsigned words
- cx16.mouse_pos() and cx16.mouse_get() now also return the scroll wheel position as extra return value in X
- cx16: added diskio.f_tell()
- added cx16.scnsiz (extapi call)
Other stuff:
- added @nozp tag for variables that should never be placed into zeropage
- miscellaneous bug fixes and documentation improvements.
- included a "profiler.py" script to process the emulator's new -memorystats dump file to see what parts of your program run the most
version 10.3
Backwards incompatible change:
It is now possible (and required) to assign all values returned from a romsub/asmsub that returns multiple values.
The void
keyword can now also be used in a new way: as a dummy assignment target for any value you are not interested in in such a multi-value assignment.
Please read the documentation in the manual for details about this new feature.
Libraries and other changes:
verafx.mult()
andmuls()
now return both words of the 32 bits result- cx16
sprites
module: thepalette_off set
parameter now takes values 0-15 (instead of 0-255) to be more consistent with docs and vera behavior - added
txt.cls()
as a shorter alternative toclear_screen()
- added
cbm.STOP2()
andcbm.GETIN2()
convenience routines (because the regular ones are now a bit more cumbersome to use because of the new multi-value assignment rules) - cx16: added
diskio.fastmode()
to select the fast serial disk mode - add
cx16.extapi()
ROM call, call numbers and shims. (new for X16 rom R47) - new
diskio.status_code()
- a few new floating point functions to the
floats
module:atan2
,secant
,csc
andcot
. - added -dumpsymbols compiler option to print a dump of all the variables and subroutine signatures
- added options -bytes2float and -float2bytes to be able to do float conversions from the command line
- added cx16 "vumeter" example.
- bugfixes.
Full Changelog: v10.2.1...v10.3
version 10.2.1
Bugs fixed:
- fixed logical expression operand evaluation order error. (and/or expressions)
- fixed problem with placing %breakpoint in some places in the code.
Library changes:
- added string.findstr() to search for a substring in another string.
- string.find() now sets A to 255 as well, beside setting Carry flag to 0 (false), if no result was found.
v10.2
breaking change: boolean types are much stricter than before.
- they're no longer 'equivalent' to bytes, you'll have to cast them explicitly if you still want to convert between bytes and booleans.
- If you are using conditionals like "if integervariable {....}" you'll have to make it into a boolean comparison expression like so "if integervariable!=0 {....}" .
- however there's a new
-nostrictbool
command line option that allow implicit conversions between bool and bytes again. This allows prog8 to compile most older code without source changes. Note that this option will likely be removed in a future version, so it's advised to actually go update your program code to be properly compatible with the new version. - a bunch of library routines have been changed to properly accept boolean arguments and return boolean values (rather than bytes 0 or 1).
- this enables more optimized code generation for many boolean expressions.
new library functions
- cx16.kbdbuf_clear() is moved to cbm.kbdbuf_clear() and is now available on all cbm targets
- sys.poweroff_system() moved to cx16, sys.set_leds_brightness() moved to cx16 and changed to set_led_brightness, you can only change the activity led brightness.
- string.strip(), string.trim() and l/r variants of them.
- txt.petscii2scr() and txt.petscii2scr_str() to convert petscii characters to screencode.
- math.randrange() and math.randrangew()
- txt.bell()
- txt.print_bool()
- sys.exit2() and sys.exit3() to allow you to set also the X or X+Y registers on program exit, rather than just A.
- monogfx.drawmode() to select the draw mode, it can now also draw in inverted/eor mode.
- diskio got more routines implemented for the 'virtual' target.
- the conv routines that convert numbers to strings now return pointer to the resulting string buffer.
- for the virtual target: txt.width() and txt.height() now return the actual terminal size if possible
other changes
- '\t' is now recognised as a tab character inside iso strings
- many bugfixes and optimizations
New Contributors
- @adiee5 made their first contribution in #123
- @mike-mcgann made their first contribution in #126
Full Changelog: v10.1...v10.2
version 10.1
Bug fix release. Please upgrade if you're using 10.0 because a handful of important fixes have been made.
Also added cx16.get_program_args() and cx16.set_program_args(), and made a couple more code generator improvements.
Full Changelog: v10.0...v10.1
donation: If you'd like to buy me a hot coffee or spicy pizza, you can do so at ko-fi.com/irmen
Version 10.0
This is a BIG release. Many things got changed, improved or fixed.
Breaking changes:
-
additional rules for symbol prefixing to avoid name clashes in the generated assembly code. Details here https://prog8.readthedocs.io/en/latest/technical.html#symbol-prefixing-in-generated-assembly-code
-
push
,pushw
,pop
andpopw
are no longer builtin functions but regular inlined subroutines insys
. -
some floating point routines have been renamed to make the names more consistent:
floats.rndf -> floats.rnd floats.parse_f -> floats.parse floats.rndseedf -> floats.rndseed floats.print_f -> floats.print floats.str_f -> floats.tostr
-
some type casting rules have been tweaked. You may have to add or remove type casts in certain places.
-
boolean logical "and" and "or" expressions are now evaluated with McCarthy / short-circuit evaluation.
This means that not every term in the expression will be evaluated if the result can already be determined!
This should normally not cause any problems because it is bad practice to write code that depends on
the order of evaluation of the terms, but sometimes we can't help ourselves.
New features:
- improved diskio error handling and file not found errors.
- you can now use Python-style negative array indexing to count from the end of the array.
- allow efficient containment check in range expression at runtime (
if x in 10 to 100
) - rol, ror, rol2, ror2, any() and reverse() are now supported on split word arrays
- optimizer now replaces variables by compile time constants if possible
- improved the const optimizer
- cx16: added all remaining romsubs for the kernal audio routines (including an example program for it)
- cx16: added the romsubs for the three X16Edit kernal entry points.
- cx16: added several Vera register aliases that are memory mapped words (such as VERA_ADDR)
- cx16: added
verafx.copy()
for fast vram to vram copy ("blitting") - cx16: added
palette.get_color()
andpalette.default_colors_16[]
- cx16: added
sprites.set_mousepointer_image()
,sprites.set_mousepointer_hand()
andsprites.get_data_ptr()
- cx16: added
cx16.cpu_is_65816()
to test for presence of the 65816 cpu vs the 6502 cpu - cx16: added celluar automatons code example
- added
string.isspace()
andstring.isprint()
andstring.contains()
. - added
call
builtin function for efficient indirect subroutine call (indirect JSR) - added
cbm.CLEARST()
- added
-varsgolden
compiler option to put variables into golden ram at $0400 - added
-slabshigh
and-slabsgolden
to do the same for memory() slabs as for variables - added
-printast1
and-printast2
command line options to dump the internal parse trees (useful for debugging purposes) - added
-check
compiler option to only quickly syntax check a program - added
%option ignore_unused
directive to suppress warnings about unused stuff, useful when writing libraries - added
floats.push()
andfloats.pop()
to push and pop floating point numbers on the cpu stack - added
math.crc16()
andmath.crc32()
to compute checksums
Other
Many, many bug fixes and other improvements have been made.
Check the commit list for all the details: v9.7...v10.0
donation: If you'd like to buy me a hot coffee or spicy pizza, you can do so at ko-fi.com/irmen
v9.7
A big release this time
incompatible changes
- removed
diskio.set_drive()
, just setdiskio.drivenumber
directly sys.set_irq()
andsys.set_rasterirq()
no longer have a useKernal parameter! The irq handler routine must return a boolean instead in the A register, that determines if the system IRQ handler should run afterwards or not.palette
module: changed in the available preset routines.
new language features
- underscores are now allowed in numbers to group digits for improved readability of large numbers
- multiple variables can be declared on one line
ubyte x,y,z
- multiple assignments can be done in one go
x=y=z=calculate()
- new module directive
%encoding
to set the text encoding for the whole file - allow all character encodings for all compilation targets
- added
continue
statement to continue with the next loop iteration - allow Unicode letters in identifiers: things like
knäckebröd
andπ
are now valid identifiers. Addedfloats.π
constant. - allow constant expression intermediate values to be 32 bits integers to avoid overflow errors:
uword large = 320*240/8/8
is now okay.
specifics for the Commander X16
- new "master" irq handler see
cx16.enable_irq_handlers()
and associated subroutines, and "Commander X16 specific IRQ handling" in the manual - palette module got more accurate color space conversion
- improved the emudbg library
- added
bmx
library to read and write "BMX" bitmap images. See "showbmx" example - added some routines to the sprites module:
move
,movex
andmovey
to move the sprite by on offset - added more registers to verafx module
other things in general
- added various subroutines to the strings module:
hash
,isdigit
,isupper
,islower
,isletter
- added
pokef()
andpeekf()
for floating point numbers - added
floats.str_f()
to convert a float number to a string (without printing it) - many optimizations and bug fixes.
Full Changelog: v9.6...v9.7
version 9.6
- added
math.diff()
andmath.diffw()
- added
gfx2.init_mode()
if you don't want to switch current screen mode but still use gfx2 library - added
gfx2.safe_circle()
andsafe_disc()
that clip the pixels to the screen. - added several routines to
textio
that can set and read the cursor position. - some textio improvements on the atari target.
- added
f_seek_w
to diskio on commander X16 (needs f_open_w_seek() to work) verafx.mult/muls
now return the upper 16 bits of the 32 bits result in r0.diskio.f_write
now uses fast MCIOUT block transfer routine on the Commander X16- added
sys.disable_caseswitch/enable_caseswitch
- added
cx16.set_chrin_keyhandler
to insert custom key handler routine into CHRIN/BASIN - added
string.append
- improved compatibility of
cx16.vpeek()
pokemon()
now actually pokes a value but also returns the previous value that was in the memory location- added
%zpallowed
to explicitly list the zeropage locations that the compiler can use (as opposed to%zpreserved
) - fixed the
fill()
flood fill routines to no longer read outside of the screen, also optimized them a bit more. - fixed parameter passing bug for certain word types
- several code gen optimizations.
- several code gen and compiler bug fixes.