Proto #2 support in GitHub ROM, Emulator & Documentation

Announcements by the development team or forum staff.
TomXP411
Posts: 1804
Joined: Tue May 19, 2020 8:49 pm

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by TomXP411 »



5 hours ago, StephenHorn said:




Correct, you only need to include rom.bin. There are various symbol files generated by building the rom as well, but even though they've usually been included in the release packages, the emulator doesn't need them and can't load them besides (well, not until or unless the feature gets added).



Yeah, while the symbol tables aren't used by the emulator, they are useful. My menu program works by printing the LOAD command to the screen and stuffing CR into the keyboard buffer. So I looked that up in the symbol table... So it's super useful to know where KERNAL and BASIC variables are located. I was actually going to include them, but forgot and didn't want to spin my Linux VM back up.

 

 

 

 

 

TomXP411
Posts: 1804
Joined: Tue May 19, 2020 8:49 pm

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by TomXP411 »



6 hours ago, mobluse said:




I believe it's only necessary with rom.bin, but you also included basic.bin, dos.bin, and geos.bin. When packaging for Linux according to the Makefile it only includes rom.bin.



BTW I succeeded in building it for Raspberry Pi OS Buster on Raspberry Pi 4B and it works with all programs I tested with so far.



x16emu_linux-armhf-2021-03-29.zip 263.59 kB · 2 downloads



Thanks for the tip. I just grabbed all the .bin files in the build directory. I figure they were only a few KB, so it didn't hurt either way. 

 

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

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by AndyMt »


I'm in the process of updating Brixx and Invaderz to the new emulator and ROM. I want them to be compatible with R38 and R39 - but how can I detect which version the PRG is running?

I know I can detect if I'm running in the emulator:

    read $9FBE/$9FBF, must read 0x31 and 0x36

This doesn't seem to be the version, just an indicator that the software is running on the emulator. Is there an official way to detect ROM/emulator version? I found different solutions, but none seemed officially supportet. Like reading $FF80 or $FFFA etc.

What's the best approach there?

mobluse
Posts: 177
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by mobluse »



1 hour ago, AndyMt said:




I'm in the process of updating Brixx and Invaderz to the new emulator and ROM. I want them to be compatible with R38 and R39 - but how can I detect which version the PRG is running?



I know I can detect if I'm running in the emulator:

    read $9FBE/$9FBF, must read 0x31 and 0x36



This doesn't seem to be the version, just an indicator that the software is running on the emulator. Is there an official way to detect ROM/emulator version? I found different solutions, but none seemed officially supportet. Like reading $FF80 or $FFFA etc.



What's the best approach there?



"The KERNAL version can be read from location $FF80 in ROM. A value of $FF indicates a custom build. All other values encode the build number. Positive numbers are release versions ($02 = release version 2), two's complement negative numbers are prerelease versions ($FE = $100 - 2 = prerelease version 2)." - https://github.com/commanderx16/x16-docs/blob/master/Commander X16 Programmer's Reference Guide.md

X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
User avatar
AndyMt
Posts: 326
Joined: Sun Jun 21, 2020 3:02 pm
Location: Switzerland

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by AndyMt »


Ok, if I see this correctly, right now in the emulator looking at $FF80 shows -38, which means ROM version equals emulator version? Using the one posted further up (upcoming R39?) gets me $FF, so it's a custom ROM, but presumably will be -39 once the emulator and ROM is released?

It occurs to me, that what I actually need is to detect the board revision - so I know which RAM banking address to use and all the other hardware memory mappings.

Michael Steil
Posts: 94
Joined: Mon May 18, 2020 7:25 pm

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by Michael Steil »



Just now, AndyMt said:




Ok, if I see this correctly, right now in the emulator looking at $FF80 shows -38, which means ROM version equals emulator version?



Using the one posted further up (upcoming R39?) gets me $FF, so it's a custom ROM, but presumably will be -39 once the emulator and ROM is released?



It occurs to me, that what I actually need is to detect the board revision - so I know which RAM banking address to use and all the other hardware memory mappings.






  • Yes, the releases have matching ROM and emulator versions. Be careful to negate the number in case it's negative, and then compare it with e.g. 38 or 39. Future versions may use positive numbers.


  • Non-official builds use $FF as the version, yes.


  • The next ROM and emulator will be -39.


  • In order to detect Proto #1 vs. Proto #2, check for abs(version) >= 39. This will work for all released emulator + ROM versions. I'm aware that this check won't work for non-official builds.


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

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by AndyMt »



3 minutes ago, Michael Steil said:




In order to detect Proto #1 vs. Proto #2, check for abs(version) >= 39. This will work for all released emulator + ROM versions. I'm aware that this check won't work for non-official builds.



Super, thanks! It's anyway just needed for a few weeks until the official release and the web-emulator are updated. So I will just assume a custom ROM is indicating the latest ROM and board revision.

And maybe the releases happen before I have updated my stuff anyway ?.

ZeroByte
Posts: 714
Joined: Wed Feb 10, 2021 2:40 pm

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by ZeroByte »


If you just want to know your bank address works, you could do something like this:

Check the value at, say $BFFF, inc(bank register), check bfff - if different, your bank register value is correct. If same, inc BFFF, dec(bank). If different then bank reg. is correct. If same then bank reg is wrong. (Then optionally fix the value at BFFF)

mobluse
Posts: 177
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by mobluse »


Is it legal to bundle the official rom.bin r39 from the Windows release (when it comes) in the snapcraft version of x16emu? because then the tests of release would work on more platforms that are not officially supported: e.g. for Linux with armhf and i386.

https://snapcraft.io/x16emu

X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
User avatar
AndyMt
Posts: 326
Joined: Sun Jun 21, 2020 3:02 pm
Location: Switzerland

Proto #2 support in GitHub ROM, Emulator & Documentation

Post by AndyMt »



1 hour ago, ZeroByte said:




If you just want to know your bank address works, you could do something like this:



Yes, I thought about this. I actually know what's supposed to be in some of the banks, so I could just do the check without modifying anything.

Post Reply