Releases: irmen/prog8
version 11.0.1
Fixing some problems found in 11.0
Fixes
- fixed two possible compiler crashes in library import code (1 for filename CaSiNg issues on widows, 1 for transitive imports done by library modules)
- fixed a compiler crash related to array parameter types for subroutines
- pet32 target: fixed
txt.plot()
putting the cursor in the wrong position (col/row were mixed up) cbm.PLOT()
: the order of the return values when getting the cursor position has been swapped, is now colum (in Y) followed by row (in X). This is the same order as the arguments to the routine are given to set the cursor position.diskio.diskname()
could hang on a disk error, this has been fixed- some stricter type checking for multivalue assigns, to avoid possible faulty code generation due to missing type conversion
Additions/changes
- added
txt.t256c()
on the commander X16 to turn 256 color tile mode on or off - updated zsmkit library blob for a fix in the zsm_clearisr() routine
- added
coroutines
library andmultitasking
example - modified the cx16images.py Python script to work again with newer pillow library version
version 11.0
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 tostrings
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
andtxt.VERA_TEXTMATRIX_ADDR
, it's now justtxt.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 usessys.sizeof_xxx
are renamed tosys.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
andlsw
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.
Themsw
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
andmath.interpolate
to complement the existing LERP routines. Addedinterpolation
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()
andset_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
version 10.5.1
A patch release that fixes some problems and oversights in the 10.5 release. It is strongly advised to upgrade to this version if you are using 10.5 now.
Changes:
gfx_hires4
module is now namedgfx_hires
to be consistent with thegfx_lores
module- added
sprites.reset()
routine to remove sprites from the screen progstart()
was added to complementprogend()
repeat
now supports 65536 iterationsdefer
can now also be used inside if-statements (the semantics don't change though)%memtop
now specifies the first address NOT to use, to reflect the semantics of the memtop kernal call- memtop now automatically adjusts when you use
%address
beyond the default - documentation improvements
- assembly optimization regression fixed that was caused by wrong label prefixing
- fix several compiler crashes
math.mul16_last_upper()
is fixed again- internal diskio library restructuring (shouldn't be noticeable for user code)
version 10.5
This is a pretty big release with a lot of changes, some of which that are not backwards compatible with older versions.
Breaking changes:
- the compiler is now named 'prog8c' and the jar file accordingly 'prog8-10.5-all.jar'
gfx2
module is gone, it's split intogfx_lores
andgfx_hires4
optimized for a single resolution each.
thewidth
andheight
symbols were renamed toWIDTH
andHEIGHT
(constants)
and the screen_mode routine is now calledgraphics_mode
.- arrays can no longer be initialized with a single numerical value, it is now required to write out the full initialization array. Or omit it as before to get an array of all zeros. However there is a new syntax to create array literals with repeated values, see below at New Stuff
- array to array assignments is no longer supported (other than initialization of variable declaration).
Just use an explicit sys.memcopy(src, dest, sizeof(dest)) or assign array elements individually. - removed block level memory alignment via
%option align
you now have to use the new@align
tags on individual variables - asmsubs no longer get an RTS instruction inserted at the end if it is missing. Make sure you correctly return from assembly routines.
- the
math
module is no longer automatically imported in your program. If you use it you'll need to add %import math romsub
keyword renamed intoextsub
(because it's not only for ROM routines)- on the C64, the BASIC ROM at $a000-$bfff is now banked out by default. Prog8 programs have a whopping ~50 Kb of contiguous RAM at their disposal ($0801 - $cfff) without having to do memory banking by themselves.
- on the C128, the BASIC ROM at $4000-$bfff is now banked out by default. Prog8 programs can now use ~41 Kb of contiguous RAM ($1c00-$bfff) without having to do memory banking by themselves.
- program bootstrap code has been moved from the end to the beginning of the program. This shifts up the actual address of the start() routine.
New stuff:
- automatic support for calling routines in banked memory, via
@bank
tag on extsub definitions (formerly romsub). This makes Prog8 the first language on the Commander X16 at least, where you no longer have to manually switch banks when calling routines in another memory bank. This is supported on the X16, C64 and the C128. - added routines for manual memory banking on the C64
c64.banks
andc64.getbanks
including an example program - added routines for manual memory banking on the C128
c128.banks
andc128.getbanks
defer
statement for delayed execution (useful for resource cleanups for example). Inspired by the defer statement from Zig, Go, or Swift.- if-expression (prog8's alternative for a ternary operator):
result = if x>10 "yes" else "no"
It's like an if statement but it is an expression. The if and else parts are also expressions. - per-variable memory alignment via
@alignword
@alignpage
and@align64
- new directive
%align <interval>
inserts a memory alignment command for the assembler at that precise place - new directive
%memtop <address>
changes the expected max memory location the program is going to use. Can be used to "reserve" a bunch of memory at the end of the available space. alias
statement that aliases a symbol (possibly from another module) by another name locally. Can shorten/clarify code.- added
sys.memcmp
memory comparison routine (like strcmp, but doesn't stop at 0 byte) - the way block merging is done using
%option merge
has been overhauled. You can now monkeypatch existing code if you merge in subroutines with an exactly matching signature including the names of the parameters. - added a few new graphics routines in the
gfx_lores
andgfx_hires4
modules (formerlygfx2
). gfx_lores now has a draw mode selection and can draw in EOR mode, useful for non destructive drawing - added
diskio.exists
to check if a file is already present - added linear interpolation routines
math.lerp
andfloats.lerp
andfloats.lerp_fast
- replaced the old ZSOUND example by the new ZSMKIT example that plays .zsm music on the Commander X16.
- floats: added
AYINT2
as a safe wrapper aroundAYINT
(used to convert floats to integers). The new routine no longer depends on internal kernal variable locations and should always be used over AYINT. - added experimental
neo
compiler target (for the Neo6502). Still pretty bare bones but functional - variables can now be marked
@dirty
to omit initialization of their value. This saves code, but leaves their initial value undefined which is a dangerous footgun, so beware when using this that you properly assign a value to them yourself - array literals with repeated values can now be created using the similar syntax as what was already possible for string literals, type the base array and add
* <repeats>
. For example[42] * 99
creates an array of 99 times the value 42. That base array can consist of multiple values.
Other changes:
- optimizations and bug fixes, as usual.
version 10.4.2
This release fixes some bugs and improves some things, and adds some new library modules and exampoles, but no major language changes.
breaking changes
- removed the broken
verafx.mult
routine (verafx doesn't support unsigned multiplications. The muls routine is still there, that one works fine) - added
verafx.mult16
for just the 16 bit unsigned results that worked fine. - string assignments got somewhat stricter to avoid problematic cases. If your code doesn't compile anymore, you should use
string.copy
explicitly now to set a new value to a string.
other changes
- fixed assembly optimization bug that removed a RTS sometimes. This broke
floats.ceil
and some other routines. - fixed "raw" output to also properly initialize variables.
- fixed C64 floating point sign problem
- added experimental
compression
library, it provides RLE compression and decompression routines. (the RLE algorithm supported is Byterun1/Packbits, which is used in Amiga IFF ILBM images among others) - cx16: added
audio
module with subroutines to simplify calling the Audio routines in the kernal. The 'audioroutines' example has been updated to use this. - cx16: kernal bank 0 is once again activated at startup to speed up kernal calls
- cx16: added
callfar2
builtin function that allows you to set A,X,Y and Carry parameters instead of only AY. - cx16: added color fade routines to the
palette
module - cx16: added a port of the c64's "balloonflight" example. Added 'starszoom' example.
- added
sys.sizeof_byte
etc etc constants that are the memory sizes of the given datatypes - many code optimizations
- several error message improvements.
- documentation improvements.
- added 'fractal-tree' example.
Thanks to the people in the Prog8 channel on the X16 discord for their contributions.
version 10.4.1
This is a patch release that brings a bunch of optimizations and small tweaks.
(edit there's a known issue with certain asm routines such as floats.ceil()
that generate invalid code. This has been fixed in the master branch already, but was found too late to be part of this release...)
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.