Prog8 language and compiler topic

All aspects of programming on the Commander X16.
User avatar
ahenry3068
Posts: 1212
Joined: Tue Apr 04, 2023 9:57 pm

Re: Prog8 language and compiler topic

Post by ahenry3068 »

mortarm wrote: Sat Dec 28, 2024 3:41 am
ahenry3068 wrote: Fri Dec 27, 2024 11:19 pm Something you Shoot yourself in the Foot with. Shooting yourself in the foot is a figure of speech for making a kind of stupid mistake.
Somehow, I expected an answer of a higher caliber. :)
Image

Image
User avatar
desertfish
Posts: 1126
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Prog8 version 11.0.1 has been released

Post by desertfish »

Hehe the footgun .


Anyway, version 11.0.1 has been released https://github.com/irmen/prog8/releases/tag/v11.0.1

This is a bug fix release to repair a few important problems that were 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 and multitasking example
modified the cx16images.py Python script to work again with newer pillow library version
mortarm
Posts: 330
Joined: Tue May 16, 2023 6:21 pm

Re: Prog8 version 11.0.1 has been released

Post by mortarm »

desertfish wrote: Sun Dec 29, 2024 7:33 pm ...pillow library version
Now /that's/ SOFTware. :D
User avatar
desertfish
Posts: 1126
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Prog8 language and compiler topic

Post by desertfish »

Heheh
(extra clarification: pillow has nothing to do with Prog8 or the X16 itself, it is an image library for Python programs)
mgkaiser
Posts: 61
Joined: Sat Dec 02, 2023 6:49 pm

Re: Prog8 language and compiler topic

Post by mgkaiser »

Is there a way to build a Prog8 program targeted at a specific address with no startup code? My idea is that you could build libraries, keep then under 8k, and target them at $a000. Then you could make "header" files with "extsub" lines pointing at the library. Given extsub now deals with banks, you could have multiple 8k libraries loaded and still leave main RAM available for the main program. You could even build the Prog8 included libraries in this manner. I think the only limitation is you could not call one routine in banked ram from another routine in banked ram.
User avatar
desertfish
Posts: 1126
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Prog8 language and compiler topic

Post by desertfish »

yes you can, but it's a bit messy and there are some caveats (prog8 requires variable initialization). You may also need to disable the use of the zeropage, because otherwise it may clobber variables in your main program

if you use this in your main module

%launcher none %option no_sysinit %zeropage dontuse %address $a000

you will get something close to what you asked.

I want to improve on this in a future prog8 version.
User avatar
desertfish
Posts: 1126
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Prog8 version 11.1 has been released

Post by desertfish »

Prog8 version 11.1 has been released: https://github.com/irmen/prog8/releases/tag/v11.1

documentation here https://prog8.readthedocs.io/en/latest/index.html

breaking changes
- `txt.get_cursor()` now returns column+row as 2 values
- `abs()` returntype is now unsigned
- `-sourcelines` command line option is changed into `-nosourcelines` because the default is now to include those source lines in the generated assembly.

libraries
- added fileselector example (cx16 and c64)
- `monogfx` can fill with stippling again
- added `cx16.get_charset()`
- added `sprites.getxy()`
- `diskio`: added several routines to only list files or directories

other new stuff
- normal (non-asmsub) subroutines can now also return multiple values
- support multi-value variable initialization: ubyte a,b,c = multi()
- added configurable compilation targets
- atari and neo targets are no longer built-in but available as such configurable targets in the examples
- added `%output library` to make it easier to produce loadable libraries (this is the improvement I talked about in the previous post)
- added `%jmptable` directive to build a JMP-table meant for libraries
- added `c64os` character encodings
- code generation improvements and bugfixes
User avatar
desertfish
Posts: 1126
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Important Prog8 version 11.2 has been released

Post by desertfish »

Prog8 version 11.2 has been released: https://github.com/irmen/prog8/releases/tag/v11.2
Documentation: https://prog8.readthedocs.io/en/latest/


Important bug fix release with some new features.
Bugs fixed:


C64: graphics.plot() now works again , it was broken since version 10.5
X16: introduced a workaround for SMC issue that could make sys.reset_system() and sys.poweroff_system() not work properly on hardware boards
X16: cx16.VERA_FX_POLY_FILL_H constant value typo fixed
clear error messages instead of compiler crashes for several source code errors
symbol prefixing bug fixed for certain use of %option no_symbol_prefixing
you can once again call a label as a subroutine (but this is now also a footgun warning)
fix code generation error when assigning address of split word array without explicit adressof syntax
better error if module name clash occurs caused by case-insensitive names
fix codegen for @(ptr-offset)=value that was writing bogus values to memory

New stuff:

some range checks can now be evaluated at compile time
introduced %option romable as a start to help generate code that can be put into ROM. There's still a long way to go. But this option now starts generating warnings of code that is generated that will not be able to be put into ROM, so it can help to identify problem points.
Added strings.ncompare to compare strings up to n characters
improved some syntax highlights
more forgiving handling of constants of different types
various optimizations in generated code
internal compiler refactoring to reduce project dependencies and improve API surface for future code generators or tools
more often print the offending source code position that triggers an internal compiler crash
added a sprites/coroutines/defer benchmark module to the benchmarking program
Post Reply