RAMLink kernal doesn't override internal function ROM
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
Sorry, I missed the config.
3.7.1 r44603M
(GTK3 3.24.33, GLib 2.72.4, Cairo 1.16.0, Pango 1.50.6)
Linux 5.15.0-88-generic
98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023
x86_64
Which ramlink rom are you using? I did a pretty thorough test on a real RL with 2.01, but I don't remember the degree to which I tested in the internal ROM as I didn't have one.
I used 2.01 both on real HW and in VICE.
Try these test programs. The won't alter your RAMLINK contents, but they will require a reboot after. If they fail, the screen will go red, but let me know where the counter stops.
RAMLink1 (RL DOS 2.01):
C128 stops green at 3030
C128 in C64 mode stops green at 177
RAMLink2 (RL DOS 2.00):
C64 stops green at 177
Okay. I had a look at my testing code and I can verify it doesn't check the internal function ROM situation at all. I will modify it to do so, compare with my RL, and then adjust the VICE code to have the same behavior.
Last edit: Roberto Muscedere 2024-02-07
Is that code in the test bench? :)
I don't know if it is in the testbench, but it is available in "testprogs/RAMLink".
Here is an updated tester that will check the internal ROM as well. I worked on my RL. It should go up to 4166. I will start making the changes to VICE.
It goes to 227 on my C128 and then turns border red.
Which RAMLink? 1 or 2? I assume when you say "1" you mean the HW rev 1, as listed on the bottom of the unit.
Ah, no that's a misunderstanding. I just numbered them 1 and 2 myself.
RAMLink1 (in the C128) is a revision 2D
RAMLink2 (in the C64) is a revision H
Okay, test 227 checks if the internal function rom at $8000 is open-circuit, which it is on my RL. Can you enter the "monitor" and type in "m 48000" a couple of times to see if the values are inconsistent? Can you do the same with "m 88000" (which is for the external function rom)?
m 48000 is completely stable, since I have an internal function ROM. That's how I found this problem in the first place. I developed an internal function ROM and found that it didn't work with the RAMLink because that shadowed the internal function ROM on my machine (but not in VICE). m88000 is a bit random since I currently don't have an external function ROM connected.
If you intended me to test without an internal function ROM I don't understand what you are looking for. This is strictly an issue with internal function ROM in combination with RAMLink.
Okay. Your original message didn't state you were using an internal function rom, just that you noticed a problem in emulation.
Regardless, this actual made me find a problem in VICE when it comes to internal function roms; when off, it doesn't show an open-circuit, which I fixed.
My tester, rlhw128, only works if you don't have an internal function rom as it looks for open-circuit conditions as most people with a RL will have. However, just out of curiosity, your internal function rom should work as long as it is mapped to the $8000-$DFFF area.
From what I know about the RL in 128 mode, it works by "overriding" the signals from the kernal ROM (ie. forces 1's to 0's and 0's to 1's electrically). I don't know if this is a good idea in practice or if it can damage the ROMs over time. In the case of internal roms, it will override as well when the address is $E000-$FFFF. Proper RL operation may depending on the driving strength of the device you used. I don't think the RL designers considered this as they probably just modeled their solution using the operational parameters of the kernal ROM chip itself.
I've submitted the changes under r44987.
Can I close this bug?
No, the bug isn't fixed. I downloaded revision 45040 and tried the test case I provided. It still prints VICE EMULATION. So the problem remains. This is how I start VICE (with a valid RAMLink image) to reproduce it.
~/temp/vice-edge/vice/src/x128 -80 -directory ~/temp/vice-edge/vice/data -pal +confirmonexit -intfrom int_test.bin -intfunc 1 -ramlink -ramlinkbios ramlink201.bin -ramlinkmode 1 -ramlinksize 8 -ramlinkimage ramlink_scratch.rl -ramlinkimagerw
Can you try with "-cartramlink ramlink2.bin" instead of "-ramlink -ramlinkbios ramlink201.bin" instead?
That worked, so the other option to start with RAMLink needs to be removed then. You can close this ticket.