Updated Web Emulator

All aspects of programming on the Commander X16.
SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

Updated Web Emulator

Post by SlithyMatt »


If you are using cc65, the default behavior is to remap string literals to PETSCII, so the cases are effectively reversed from ASCII. If you put capital letters in source assembly, the resulting machine code will use codes that are in the graphics range for the default character set. So, unless you put in specific character mapping directives in your code, use all lowercase for filenames in assembly. You can always double-check what is generated by using -l to generate a machine code listing. Then, you need to have all actual filenames in all caps so that they can be loaded successfully by the kernal.

User avatar
AndyMt
Posts: 326
Joined: Sun Jun 21, 2020 3:02 pm
Location: Switzerland

Updated Web Emulator

Post by AndyMt »


Yes, thats how I did it. Lower case in source code, upper case on disk. This is really strange... Hm... I compose the filenames with sprintf(), maybe that's an issue?

In any case it would be nice to have a test function for the "try now" feature. Like upload a zip file for testing without showing it on the download page.

 

User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

Updated Web Emulator

Post by StephenHorn »


The lesson I learned from my own adventures in case-sensitivity was to just put the filenames in the source file in same case as the filenames will exist on disk or in the zip. The reason being that the emulator's hooks for LOAD() and SAVE() don't bother converting between PETSCII and ASCII, they just take the binary filename in memory at face value and pass it straight to the OS functions.

Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

Updated Web Emulator

Post by SlithyMatt »



3 hours ago, AndyMt said:




Yes, thats how I did it. Lower case in source code, upper case on disk. This is really strange... Hm... I compose the filenames with sprintf(), maybe that's an issue?



Ah, you are using C. I'm not sure how cc65 handles ASCII character literals in that context. You may have to use integer character values for consistency, which sucks. PETSCII is fun when you are playing around in BASIC, but it's a pain when you are cross-developing on an ASCII/Unicode platform. You may need to experiment with disassembling the compiled code and see how it handles string and character literals in different contexts.

ChrisL
Posts: 30
Joined: Tue Apr 28, 2020 12:17 am

Updated Web Emulator

Post by ChrisL »


In my code (also C) I've used lower case in source code (string literals, not composed with sprintf()), upper case on disk.  This has worked for me on Linux and (briefly) in setting up a new laptop w/Windows 10 to support X16 development.

Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

Updated Web Emulator

Post by Perifractic »



4 hours ago, AndyMt said:




In any case it would be nice to have a test function for the "try now" feature. Like upload a zip file for testing without showing it on the download page.



Given that an upload can be edited, updated, or deleted after going live if it doesn't work to your liking, I don't think we can devote coding time/money to adding a "Test Try It Now" feature, sorry. 

User avatar
AndyMt
Posts: 326
Joined: Sun Jun 21, 2020 3:02 pm
Location: Switzerland

Updated Web Emulator

Post by AndyMt »



3 hours ago, Perifractic said:




Given that an upload can be edited, updated, or deleted after going live if it doesn't work to your liking, I don't think we can devote coding time/money to adding a "Test Try It Now" feature, sorry. 



Ok, I understand ? that. But "delete" for a specific version I didn't find. If you look at the change log for Brixx, you'll see what I mean ?.

Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

Updated Web Emulator

Post by Perifractic »

Ok, I understand [emoji846] that. But "delete" for a specific version I didn't find. If you look at the change log for Brixx, you'll see what I mean [emoji6].
Ah ok that's more specific. At this stage I would just suggest leaving them there. Honestly I do not foresee many people digging down to earlier revisions. 99% of people will just download the latest one.
User avatar
AndyMt
Posts: 326
Joined: Sun Jun 21, 2020 3:02 pm
Location: Switzerland

Updated Web Emulator

Post by AndyMt »


You're probably right. I'll build the webassembly myself and run it on my raspberry. So I can do the pre-testing from there.

User avatar
AndyMt
Posts: 326
Joined: Sun Jun 21, 2020 3:02 pm
Location: Switzerland

Updated Web Emulator

Post by AndyMt »



3 hours ago, AndyMt said:




You're probably right. I'll build the webassembly myself and run it on my raspberry. So I can do the pre-testing from there.



Argh - the "emscripten" base for the webassembly doesn't build on 32 bit raspberries ?... Can someone please provide me with the actual web-emulator files:

ex16mu.data x16emu.html x16emu.js x16mu.wasm webassembly/styles.css webassembly/main.js

and maybe what's needed to mimmic the "try now" button?

Post Reply