Releases: irmen/prog8
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.
version 9.5.1
Correcting some code generation errors and some additional tweaks:
- optimized word array reads with an index variable, fixed wrong result when that index variable was zero
- fix signed byte to word sign extension in assignment
- fix signed byte to word casting issue uw = 8888 + (bb as ubyte)
- implemented taking address of array var with variable index
- added
-breakinstr
compiler option to emit STP or BRK for a %breakpoint - monogfx and gfx2: optimized flood fill
- some more expression code generation tweaks and optimizations
version 9.5
many "Commander X16" enhancements in this release.
gfx2
has its screen modes renumbered! See the module's source code for the new list- '\n' (newline) in source code now maps to petscii 13 (return) just like '\r' (carriage return) did. It used to map to $8d (shift-return)
- added
setlsb
andsetmsb
builtin functions to only set 1 byte of a word - added
math.mul16_last_upper
routine to access the upper 16 bits of the 32 bits result of a word-multiplication - cx16: added
verafx
library module to access Vera FX functionality - cx16: added
emudbg
library module to access emulator debugging support - cx16: added
monogfx
library module, this now contains the removed monochrome support that was ingfx2
. - cx16: gfx2.clear_screen now takes a fill color argument.
- cx16: added %option verafxmuls to automatically use hardware word multiplication routine
- cx16: added chunkedfile example.
- cx16: the adpcm decoding example can now also decode stereo wavs.
diskio
library module: more robust channel handling- it's now possible to take the address of an array variable's element, like
&array[2]
- fix alignment of arrays
- miscellaneous bugfixes and improvements.
version 9.4.2
Bug fixes.
- fix invalid addressing mode on generated assembly for bytevalue +/- bytearray[i].
- cx16: fix for i/o channel reset in diskio.f_seek().
- c64: added a couple of routines that calculate the correct memory locations for video ram and sprite pointers etc. based on current VIC-II memory setup. Adapted several sprite examples to use this rather than hard poking a fixed memory location.
version 9.4.1
Mainly a release with some important bugfixes. It is advised to upgrade.
- the
unroll
statement now correctly accepts (contant) expressions rather than just a fixed integer - bug fixes in a bunch of code generation cases
- fixed floating point invalid results on C64 (cx16 was okay)
- added "sprites" library module for the cx16, and 2 examples that use it
- added cx16 "plasma" example
- added math.log2() and math.log2w() functions
- several code optimizations
version 9.4
- new 'pet32' compilation target (Commodore PET 4032, experimental)
- added float.parse_f() routine to parse a string into a floating point number
- added '-warnshadow' compiler option to get assembler warnings about potential symbol shadowing problems
- faster code for x*x expressions (squaring)
- faster code for sqrt(x) expression (integer square root)
- slightly faster code for integer byte multiplication
- faster code for integer word multiplications (~ 2x faster)
- produce a compiler error when attempting to pass a byte value to a routine that expects a str
- fixed bug in variable bitwise shifting, when the number of shifts is zero
- fixed several invalid 6502 code issues (65c02 was ok)