Jump to content

desertfish

Members
  • Posts

    599
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by desertfish

  1. Hi thanks for trying it out. Can you post the failing program? Because it should be able to deal with undefined symbols
  2. I can't think of a reason why this is useful, do you have an example perhaps? Also a tiny suggestion for any future version: add new routines (if any) at the end of the jump table, instead of inserting them in the middle. That way existing code can keep running hopefully Mostly asking this because I now had to renumber most of the routines' addresses in my prog8 interface. That looks like this: vtui $1000 { %asmbinary "VTUI0.6.BIN", 2 ; skip the 2 dummy load address bytes ; NOTE: base address $1000 here must be the same as the block's memory address, for obvious reasons! romsub $1000 = initialize() clobbers(A, X, Y) romsub $1002 = screen_set(ubyte mode @A) clobbers(A, X, Y) romsub $1005 = set_bank(ubyte bank @Pc) clobbers(A) romsub $1008 = set_stride(ubyte stride @A) clobbers(A) romsub $100b = set_decr(ubyte incrdecr @Pc) clobbers(A) romsub $100e = clr_scr(ubyte char @A, ubyte colors @X) clobbers(Y) romsub $1011 = gotoxy(ubyte column @A, ubyte row @Y) romsub $1014 = plot_char(ubyte char @A, ubyte colors @X) romsub $1017 = scan_char() -> ubyte @A, ubyte @X romsub $101a = hline(ubyte char @A, ubyte length @Y, ubyte colors @X) clobbers(A) romsub $101d = vline(ubyte char @A, ubyte height @Y, ubyte colors @X) clobbers(A) romsub $1020 = print_str(str string @R0, ubyte colors @X, ubyte convertchars @A) clobbers(A, Y) romsub $1023 = fill_box(ubyte char @A, ubyte width @R1, ubyte height @R2, ubyte colors @X) clobbers(A, Y) romsub $1026 = pet2scr(ubyte char @A) -> ubyte @A romsub $1029 = scr2pet(ubyte char @A) -> ubyte @A romsub $102c = border(ubyte mode @A, ubyte width @R1, ubyte height @R2, ubyte colors @X) clobbers(Y) ; NOTE: mode 6 means 'custom' characters taken from r3 - r6 romsub $102f = save_rect(ubyte ramtype @A, ubyte vbank @Pc, uword address @R0, ubyte width @R1, ubyte height @R2) clobbers(A, X, Y) romsub $1032 = rest_rect(ubyte ramtype @A, ubyte vbank @Pc, uword address @R0, ubyte width @R1, ubyte height @R2) clobbers(A, X, Y) } as you can see, it uses its own language construct to interface to the routines - I can't include the vtui assembly source file and refer to the symbols defined in there. It can include the pre-assembled binary library though. And that relocation trick of VTUI is pretty awesome, I can load it at any address I want that is amazing
  3. Version 2.2

    108 downloads

    File-based assembler. Work in progress. requirements: patched v39 roms, sdcard image (no host filesystem passthrough) requires ZeroByte's patched Kernal LOAD routine to deal with the HIRAM banks correctly! Using the default unpatched V39 kernal Rom will crash the commander X16, and can corrupt your sd-card image! due to remaining kernal / emulator bugs, the file loading mechanism only works on an attached sdcard image in the emulator. Host mounted filesystem doesn't work. Source code and list of features is here https://github.com/irmen/cx16assem The instructions are fairly self-explanatory, a simple manual will come later assem-2021-12-14_01.26.48.mp4
  4. File based assembler View File File-based assembler. Work in progress. requirements: patched v39 roms, sdcard image (no host filesystem passthrough) requires ZeroByte's patched Kernal LOAD routine to deal with the HIRAM banks correctly! Using the default unpatched V39 kernal Rom will crash the commander X16, and can corrupt your sd-card image! due to remaining kernal / emulator bugs, the file loading mechanism only works on an attached sdcard image in the emulator. Host mounted filesystem doesn't work. Source code and list of features is here https://github.com/irmen/cx16assem The instructions are fairly self-explanatory, a simple manual will come later assem-2021-12-14_01.26.48.mp4 Submitter desertfish Submitted 02/26/21 Category Productivity Apps  
  5. Version 1.0 of the file based assembler shown above is released to play with You can compile it yourself or download the prg from github
  6. 0.5 is the new 0.5 Great stuff. I saw the "midnight commander" demo appliction. Is that one of the examples in the repo? I'd like to try to port your examples to prog8 to see if I missed anything in the integration.
  7. up to you but I personally prefer a separate function (you can call fill_box internally?) if the remaining bytes allow it. hmm perhaps a good idea to leave a couple dozen bytes free in any case, to allow for future changes/bugfixes?
  8. yeah I think it's convenient to not have to specify the exact dimensions every time you just need to clear the screen, and instead let the routine figure out the active screen dimensions internally via SCREEN() or so. what is convenient though is still being able to specify the character and colors just like fillbox
  9. Well, it's using a full-screen editor. You can move the cursor up a few lines and press return again to run the command on that line again. It's not as convenient perhaps but it sort of works.
  10. Version 1.0.0

    17 downloads

    After seeing others post conversions of classic basic programs, I remembered this one where the computer plays an animal guessing game with you. It tries to guess your secret animal by asking questions about it, and if it doesn't know the animal, it asks about your chosen animal so it knows about it the next round! (It's basically building a binary search tree) note: all knowledge is lost when the program exits. (maybe I'll make a future version where it can save/load the animals and questions) Source code is here: https://github.com/irmen/prog8/blob/master/examples/animals.p8
  11. Animal guessing game View File After seeing others post conversions of classic basic programs, I remembered this one where the computer plays an animal guessing game with you. It tries to guess your secret animal by asking questions about it, and if it doesn't know the animal, it asks about your chosen animal so it knows about it the next round! (It's basically building a binary search tree) note: all knowledge is lost when the program exits. (maybe I'll make a future version where it can save/load the animals and questions) Source code is here: https://github.com/irmen/prog8/blob/master/examples/animals.p8 Submitter desertfish Submitted 02/24/21 Category Games  
  12. I am stupid, this is exactly what is happening! It's an optimization I recently added to the compiler and it looks like I made a mistake there Thanks Greg for pointing it out. It works fine now after a bugfix there:
  13. Sorry to nag again but I think there's another new issue regarding the decoding of petscii strings. Ignore the stuff below, the problem's caused by a bug in Prog8's string interning that I recently added and made a mistake in. ---- If I call the print routine like this (from prog8): vtui.gotoxy(12,12) vtui.print_str(@"Hello, world! vtui from Prog8!", $f2, $80) vtui.gotoxy(12,13) vtui.print_str("Hello, world! vtui from Prog8!", $f2, $00) The first string is encoded in screencodes (because of the @-prefix) and will use the $80 parameter for print_str to not decode it. The second string is encoded in petscii and will use the $00 parameter to let print_str decode it by itself to screencodes. However something goes wrong now, have a look, it replaces/decode a lot of characters that shouldn't be touched...: If I remove the first call to print_str, and leave the rest of the codeuntouched, the result is: which is what I expected. It seems that the routine has some internal state/status that carries over inadvertently across different calls.
  14. Did something break in print_str() in the 0.5 release? My test program now crashes if I use that function. It worked fine with 0.4. I made the change to load A instead of the Carry flag.... edit: looking at the code for it, I see there's a ldy r2h before the iny in the loop that looks like it should not be there?
  15. Uploaded new version with simple sound effects (using Vera PSG)
  16. Also isn't it more fun to work with the constraints we have now! Instead of having a 16 or even 32 bit true color screenmode we could try to do something like FLI on the C64 where a bitmap image was showing MORE colors by changing the palette every X scanlines or interpolating 2 colors in interlaced frames.... This kind of trickery is for me a big part of the charm of the original 8 bit systems. Push them to the limits and beyond normal expected results by using interesting new tricks. I wonder what we can do with the Vera
  17. pascal like syntax is extremely verbose and uses long keywords, which will eat up precious memory and disk space on the x16. Just something to consider if you want to edit/process these files on the machine itself.
  18. If you look closely there are 2 issues that I'd like to fix in a future version (but I'm not in a hurry): - the circles are ovals because they always assume 1:1 pixel ratio, perhaps it is possible to draw ovals with different x/y ratios. Then again this "weird" resolution is not something we would encounter often on the commanderX16 - there are some problems in the line drawing code, certain diagonal lines are off by a pixel or so somehow. you can see this in the "scrollbar" up/down arrow buttons and in the Amiga "VV" logo. I don't know why this is happening yet.
  19. I was looking in the source code and have a question: what's the reason that in the asm source files the various functions are defined as macros and then immediately instantiated? Also another suggestion: Prog8 has compile time conversion to petscii and screencode strings. So the issue I had with the unconverted characters in print_str() could be solved by providing an additional function that simply accepts a string that's already in screencodes. It will then just pokes the values without any conversion into the vera's. What do you think? Would that fit?
  20. I was in love with my Amiga 500. Replaced after a few years with a A4000. This thing lasted me until about halfway into the 90's because I fully kitted it out with cpu accelerator, VGA graphics card, cd-rom (I played MYST on the miggy), network card . PC came after that but this was late enough in the 90's so that the first one I bought was a pentium-II 300Mhz with windows 95 so I completely skipped MSDOS I would have loved to see an Amiga with the actual "AAA" graphics they envisioned originally but which was severely cut back into "AGA", but alas, Commodore screwed up
  21. Well I was just using it because there is a set_decr() function. What is that used for otherwise? I can simply ignore it ofcourse. Eager to try out the new version tonight
  22. Pretty cool looking for a basic program! The long initialization phase, is the program creating tiles on the fly or something? Instead of loading bitmaps?
  23. Fantastic work @JimmyDansbo ; also on the documentation: even now for this early version it's already super clear and detailed. It allowed me to easily interface to the library from Prog8 and I've been playing with it for a bit! Got it to work quite smoothly (mostly): Without a doubt you'll notice a few of the letters are weird. This is because I was attempting to use vtui with upper+lowercase charset. The petscii translation routines seem overly restrictive with the characters that they accept... I was attempting to print "Hello, world! VTUI from Prog8!". Here's my list of findings so far: question: any particular reason fill_box() require the character to be in R0H ? This complicates things a little bit for me because Prog8 treats the R-registers strictly as words. Suggestion: Can't this parameter be in A, like the mode for border()? question: any particular reason fill_box(), border(), save_rect() and rest_rect() require the dimensions to be in a single R1 register rather than splitting the width and height across say R1L and R2L? (same reason for me as #1 above) suggestion: add a few more box types that look nice with the Upper+Lowercase characters charset. Currently only border mode 0 and 1 are ok in this case. Perhaps also provide a way to specify the exact box character? suggestion: let the initialize function also immediately set the 'sane' / most used default settings for vera stride and increment, without requiring screen_set() ? suggestion: the petscii-to-screencode translation and vice versa, is now quite restrictive. My "Hello, world! VTUI from Prog8!" is printed as "Vello world! VVVV from Vrog8!" as you can see in the screenshot. Can we perhaps improve this to map more characters bug: calling initialize twice makes other calls crash bug in doc: rest_rest() documentation is incorrect in the register table, 'Purpose' column seems copied from save_rect() bug: a set_decr() with C=1 (decrement) seems to misalign character+color output for instance when using print_str() afterwards in an attempt to print in reverse. This is visible in the second text line in the screenshot. I'm willing to help improve the library for things like this and add PR's on github if you want?
  24. Should be good as long as you're not storing global variables in them, I suppose, only temporary function arguments/returnvalues Thanks for considering the modification
×
×
  • Create New...

Important Information

Please review our Terms of Use