Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by desertfish

  1. Yeah! I noticed this as well (I am using Petaxian as a test bench for compiler changes).  The prg shrunk by a couple hundred bytes too.

    I do think I'm at the limits of what I can reasonably improve in the current codegen. For the future I want to write a new one based on the 'vm' intermediate code but that will be a big undertaking. I do think that may eventually be a) way better to maintain and better structured and b) generating better code.


  2. I needed this configuration file to get mtools to understand the sdcard image format:

    $ cat ~/.mtoolsrc
    drive x: file="~/cx16sdcard.img" exclusive partition=1

    you can now refer to the image file with just x: as well.

    Oh, I started with just extracting the sdcard image that is distributed in the official emulator zip file.  It is possible to create one from scratch but I forgot the exact details on how to do that.

  3. 👉  Version 8.2 has been released!   https://github.com/irmen/prog8/releases/tag/v8.2

    Documentation here https://prog8.readthedocs.io/

    - Syntax change: The pipe expression "|>" has been removed from the language.
    - Syntax change: now allows casting of negative numbers to unsigned (will result in the proper 2's complement)
    - API change:  swap() builtin function has been removed.
    - API change: boolean() builtin function has been added, to get the 'thruthy' value of a number.
    - diskio.f_read_all() now returns correct size.
    - cx16: fixed macptr() signature and it is now used in cx16diskio.f_read(),  vastly improving load times.
    - fix for regression: again gives proper name redefinition errors in same scope
    - Improved (not) mentioning of the GPL software license in the shared library files.
    - greatly improved  code gen for logical expressions and array / pointer indexing.
    - zsound examples added for cx16.
    - improved compatibility with running the compiler on windows (some file/path errors solved)
    - bugfixes.


    • Like 1
  4. Ok , some progress, and some new setbacks.

    I got the v41 wasm emulator built + running in a local browser! 

    However, there were a bunch of compiler errors that I don't understand (lack of C familiarity) and I simply commented out the offending lines, thus the result I have now will fail at certain things.

  5. To do that, someone has to step up that can successfully rebuild the emulator to WASM

    I tried it as you can read above but wasn't able with my very limited knowledge about this process, to actually get it working....

  6. I'm hijacking this topic for this one post (sorry!!!!)  but with ZeroByte's help we just got the player running in Prog8 as well!   This is amazing!!


    %import textio
    %import cx16diskio
    %zeropage basicsafe
    %zpreserved $22,$28     ; zsound lib uses this region
    main $0830 {
    ; TODO: don't like to have *main* at a set start address, but otherwise the compiler puts it at the front, overwriting another module that we wanted there
        ; this has to be the first statement to make sure it loads at the specified module address $0830
        %asmbinary "zsmplayer-0830.bin"
        ; note: jump table is offset by 2 from the load address (prg header)
        romsub $0832 = zsm_init() clobbers(A)
        romsub $0835 = zsm_play() clobbers(A, X, Y)
        romsub $0838 = zsm_playIRQ() clobbers(A, X, Y)
        romsub $083b = zsm_start(ubyte bank @A, uword song_address @XY) clobbers(A, X, Y) -> ubyte @Pc
        romsub $083e = zsm_stop()
        romsub $0841 = zsm_setspeed(uword hz @XY) clobbers(A, X, Y)
        romsub $0844 = zsm_setloop(ubyte count @A)
        romsub $0847 = zsm_forceloop(ubyte count @A)
        romsub $084a = zsm_noloop()
        romsub $084d = zsm_setcallback(uword address @XY)
        romsub $0850 = zsm_clearcallback() clobbers(A)
        romsub $0853 = zsm_get_music_speed() clobbers(A) -> uword @XY
        const ubyte song_bank = 1
        const uword song_address = $a000
        sub start() {
            txt.print("zsound demo program!\n")
            if not cx16diskio.load_raw(8, "colony.zsm", song_bank, song_address) {
                txt.print("?can't load song\n")
            cx16.rambank(1)  ; ram bank to default
            if zsm_start(song_bank, song_address)==0 {
                txt.print("music speed: ")
                txt.print(" hz\nplaying song! hit enter to stop.\n")
                while cx16.joystick_get2(0)==$ffff {
            } else {
                txt.print("?song start error\n")
            ; TODO set Vera back to sane state?
        sub end_of_song_cb() {
            txt.print("end of song!\n")
    • Like 1
  7. 👉  Version 8.1has been released!  https://github.com/irmen/prog8/releases/tag/v8.1

    Documentation here: https://prog8.readthedocs.io/

    - API change: moved all integer trig builtin functions (sin8u, cos8u etc) to regular subroutines in the math module
    - API change: moved all floating piont builtin functions to regular subroutines in the floats module
    - API change: sum() builtin function was removed altogether
    - API change: max() min() and abs() now always return uword type.
    - API change: abs() supports only integer arguments now, use floats.fabs() for floating point.
    - compiler now correctly accepts string multiplication "xxxx" * expr   where expr is not just a number literal (but still must be constant)
    - compiler now automatically converts multi compare expression (if x==1 or x==2 or x==3..) into a more efficient containment check (used to only give a warning)
    - compiler now gives a warning in many cases about shadowing symbols (re-definitions)
    - compiler now automatically inlines some more trivial non-assembly subroutines
    - added %option merge  to merge module content with existing
    - improve checks for invalid pipe expressions
    - improve error message for invalid args to min() and max()
    - fixed superfluous printing of WARN and ERROR
    - optimized cx16.setcc() and setcc2() library routines
    - finished the 'virtual' compiler target codegen and the 'emulator'
    - several other minor bugfixes and improvements


    • Like 1
  8. I guess I'm the odd one out 🙂  
    I'm using 64tass.  It's the cross assembler version of what used to be turbo assembler/ turbo macro pro on the C64 natively in the past. 
    It has a few nice features that I make use of in the code generation backend of the Prog8 compiler.  Like automatically rewriting branch statements into a jmp when the branch offset gets too large, or vice versa, and automatically eliminating unused code blocks.  It does lack a "linker" step so can't be easily integrated with code coming from elsewhere.

  • Create New...

Important Information

Please review our Terms of Use