Skip to content

version 11.0

Latest
Compare
Choose a tag to compare
@irmen irmen released this 22 Dec 09:33

This is Prog8 version 11.0 - just in time for a nice Christmas present!
It is a new major compiler version because some fundamental things have changed and many new features have been added since version 10.

Breaking changes

  • the string module has been renamed to strings to be more consistent with others
  • removed the anyall module. It was inefficient and didn't work correctly
  • romsub keyword has been removed, extsub is now the only recognized way
  • the -addmissingrts compiler flag has been removed. No sudden RTS instructions will be inserted in your code. You have to take care that your assembly routines contain one to properly return to their caller.
  • removed txt.VERA_TEXTMATRIX_BANK and txt.VERA_TEXTMATRIX_ADDR, it's now just txt.VERA_TEXTMATRIX (a long const, see below at new language features)
  • the sort order of blocks has been changed: blocks with addresses are now sorted last
  • word arrays are now split by default. To store them in the old sequential memory layout, you can use @nosplit.
  • the -splitarrays compiler option was changed to -dontsplitarrays and the purpose was inverted accordingly.
  • cx16.set_screen_mode no longer returns anything. No need to use void anymore. You can still use the actual kernal routine if you are interested in the return status values.
  • math.crc32 now returns the crc32 value according to the ISO-HDLC standard, which is what zlib/pkzip also uses
  • sys.sizeof_xxx are renamed to sys.SIZEOF_XXX for consistency

New language features

  • you can now define const long numbers (that can hold values larger than a word). You can use them in compile time expressions. But there are no long variables yet so the result of such expressions that need to be placed in a variable still has to fit in a byte or word.
  • new msw and lsw builtin functions (similar to the existing lsb and msb) that return the most and least significant words of a value, respectively. Handy with const long values to be able to put them into word variables.
    The msw result can also be used as the ram/rom bank byte! (as long as the address put in is within 24 bits)
  • the extsub address can now be an expression, handy to define jump tables with offsets. Combine this with the @bank support for extra smooth external library routine integration.
  • normal subroutines can now also take their arguments in R0-R15 'registers' similarly as asmsubs already could. This is a footgun however! Use wisely!
  • palette.set_monochrome() has been removed
  • added a start color index parameter to several routines in the palette module so you can now modify other parts of the color palette instead of only from color 0 onwards
  • boolean variables, including boolean arrays, can now be memory mapped too.
  • goto can now jump to a calculated address using any expression instead of just a constant number or identifier
  • new operators &< and &> to get the address of the LSB and MSB sub-arrays of a split word array, respectively.

New or improved library functions

  • the zsmkit music player example has been extended with the new zsmkit V2.4 library version. This version is much easier to integrate in prog8 programs
  • added several float limits contants such as floats.EPSILON, floats.E
  • added sys.MIN_FLOAT, sys.MAX_FLOAT, and the MIN/MAX values for the integer types as well
  • added floats.interpolate and math.interpolate to complement the existing LERP routines. Added interpolation example that shows how to use this
  • added several decompression routines to the compression library: for RLE, ZX0 and TSCrunch compressed data.
  • improved buffers library and now documented
  • added sorting library to sort bytes, words, and string arrays.
  • all flood fill graphics routines (in monogfx, gfx_lores, gfx_hires) now no longer fail to fill certain areas because their out of stack memory problem is fixed (by using the much larger stack from the buffers library)
  • in diskio, the IO channels are now always reset back to their defaults (screen/keyboard) so that you don't have to do this yourself when you want to read or write stuff to the screen while a file is open.
  • the palette module has been optimized to be a lot faster and smaller
  • added palette.set_rgb_nosplit() and set_rgb_be_nosplit() to support passing of @nosplit color arrays.
    (the existing routines were modified to work on @split arrays which are now the default storage format for word arrays)
  • added sprits.pos_batch_nosplit to allow passing @nosplit x/y arrays. The existing pos_batch routine now expects @split word arrays because that is the default
  • added diskio.get_loadaddress to retrieve the load address of a PRG file (= the first 2 bytes)
  • added math.crc32_end_result to more naturally retrieve the resulting low and high words of the crc32 result.

Other changes

  • a problem with diskio was fixed that triggered a bug in the Vice C64 emulator when running on host fs where half of the data disappeared
  • value range checking has been improved
  • documentation has been overhauled, redundant syntax chapter merged with the rest
  • new compiler options -plain to remove ansi escapes from the output, and -ignorefootguns to well... ignore the footgun problems
  • new coroutines example that shows possible multitasking
  • various code generation improvements to create smaller and faster code
  • big internal compiler change to make the type system more versatile for future changes
  • bugfixes