Prog8 Versions Save

high level programming language and compiler targeting 6502 machines such as the C-64 and CommanderX16

v10.3

4 weeks ago

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() and muls() now return both words of the 32 bits result
  • cx16 sprites module: the palette_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 to clear_screen()
  • added cbm.STOP2() and cbm.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 and cot.
  • 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: https://github.com/irmen/prog8/compare/v10.2.1...v10.3

v10.2.1

1 month ago

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

2 months ago

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

Full Changelog: https://github.com/irmen/prog8/compare/v10.1...v10.2

v10.1

3 months ago

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: https://github.com/irmen/prog8/compare/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

v10.0

3 months ago

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 and popw are no longer builtin functions but regular inlined subroutines in sys.

  • 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() and palette.default_colors_16[]
  • cx16: added sprites.set_mousepointer_image(), sprites.set_mousepointer_hand() and sprites.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() and string.isprint() and string.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() and floats.pop() to push and pop floating point numbers on the cpu stack
  • added math.crc16() and math.crc32() to compute checksums

Other

Many, many bug fixes and other improvements have been made. Check the commit list for all the details: https://github.com/irmen/prog8/compare/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

5 months ago

A big release this time

incompatible changes

  • removed diskio.set_drive() , just set diskio.drivenumber directly
  • sys.set_irq() and sys.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. Added floats.π 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 and movey 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() and peekf() 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: https://github.com/irmen/prog8/compare/v9.6...v9.7

v9.6

6 months ago
  • added math.diff() and math.diffw()
  • added gfx2.init_mode() if you don't want to switch current screen mode but still use gfx2 library
  • added gfx2.safe_circle() and safe_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.

v9.5.1

6 months ago

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

v9.5

7 months ago

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 and setmsb 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 in gfx2.
  • 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.

v9.4.2

8 months ago

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.