Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by desertfish

  1. FIFTY functions? Wowwwww! Also. Does the library use 65C02 instructions? Or is it usable on 6502 as well?
  2. where does 6.29 mhz come from? what a weird frequency?
  3. I tried to learn a bit about the Z80 from Matt's videos on his youtube channel, but have to confess it didn't stick.
  4. Still, the 6502 has very very few tools to work with pointers and they always have to be in Zeropage. Often a lot of setup has to be done to just get a value via a pointer..... Other processors support C's pointer arithmetic /indexing/ dereferencing much more directly. I'm not sure but doesn't the Z80 for instance, have a address register that can store a pointer to work with? (and ofcourse more modern cpus such as the 68k go wild here)
  5. Probably because the 6502 lacks a lot of pointer / indirect addressing instructions. Something I struggle with in prog8 code generation as well. For instance to do indexing on a pointer you need to first copy it to zero page and only then can index it (from 0-255 if your index is bigger than that you run in even more trouble)
  6. Here's an entertaining video about Elite the procedural name generation and string tokens part starts at around 5:00 in
  7. I'm gonna snatch the essence of it for prog8 as well I think ! (can't reuse the C code, but can reuse the meaning of it! )
  8. Ian Bell (or was it Braben?) solved this for Elite by tokenizing every string in the entire game. It's a fabulous piece of engineering to cram it all in 32Kb. Not saying that you should do it too, but I find it extremely interesting and was reminded about it by your post
  9. 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.
  10. starting the emulator with -rtc option fixes the TI$ issue but I agree it should still work without.
  11. I needed this configuration file to get mtools to understand the sdcard image format: $ cat ~/.mtoolsrc mtools_skip_check=1 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.
  12. @waspentalive I'm using the mtools package on Linux to manipulate the SD card images. It allows you to show the directory and read/write files to the image, without having to mount it in any form.
  13. Hi and welcome! Basic programs usually have the .BAS suffix ! What does "limit reached" mean?
  14. 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.
  15. use IRQ_LINE https://github.com/commanderx16/x16-docs/blob/master/VERA Programmer's Reference.md#interrupts
  16. 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.
  17. 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....
  18. 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 zsound_lib: ; 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") return } cx16.rambank(1) ; ram bank to default zsm_init() zsm_setcallback(&end_of_song_cb) if zsm_start(song_bank, song_address)==0 { txt.print("music speed: ") txt.print_uw(zsm_get_music_speed()) txt.print(" hz\nplaying song! hit enter to stop.\n") while cx16.joystick_get2(0)==$ffff { sys.waitvsync() zsm_play() } zsm_stop() } 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") } }
  19. hmmm that is peculiar indeed, I notice that '?' is absent from the list above too, while some operators ARE in the token list.
  20. I think the abbreviations are not listed explicitly and just defined as "first letter of token" followed by "shifted second letter of token".
  21. Looking good!! reminds me of battlesquadron on the Amiga one of my all time favorite vertical shoot em ups
  22. 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
  23. New version uploaded that can fallback to disk based x16edit if it's not detected in rom! you have to save the special high-ram build version of x16edit that loads to $6000 to your disk named "X16EDIT-6000" for this to work.
  • Create New...

Important Information

Please review our Terms of Use