| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Help me!
So I'm coding some EasyFlash stuff so most often the kernel is swapped in ($01 = #$37).
Take a look at the following chis (VICE cpu history): https://i.postimg.cc/sg9xL7xV/temp-Image-Gb-W5z-N.avif
I'm putting a CR to $ffd2 and all goes well until it hits $ed41 where the CPU fetches a JAM-instruction. How's that even possible?! The ROM can't be altered. Comparing to ROM-listings it should do a JSR $EE97 there.
There is a SEI just infront if that matters.
(Only tested in HEAD VICE and some older version like 3.6 and 3.8). Could it be an emulation bug?
((Nevermind the .arbX label, it's just my loaded labels from the assembler. In the ROM it's just BIT $94)).
It happens VERY seldom. |
|
| |
Count Zero
Registered: Jan 2003 Posts: 1943 |
Hm, what does "VERY seldom" mean? Never happened to me AFAIR.
Using $e716 for direct screen printing and $ffd2 for drive things on my EF stuff only though. Never really looking at SEI/CLI. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Hm, what does "VERY seldom" mean? Never happened to me AFAIR.
Using $e716 for direct screen printing and $ffd2 for drive things on my EF stuff only though. Never really looking at SEI/CLI.
Hard to say here. A lot of stuff is happening, but ever so often it just crashes. And according to CHIS the CPU fetches a $02-instruction from ROM where a JSR-instruction should be. The question is really how that's even remotely possible with ROM swapped in (as is the default running carts). |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
I'm just being suspicious on the ROM-coded SEI-instruction just before the "problem", if there's an emulation bug. I guess I have to test on real HW now. |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
Virtual device traps are off? I ask because this is one of the serial routines... |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
Tested on Vice 3.1 with Virtual Device trap enabled.
break ed40
bread ed47
load"$",8 with a D64 attached gave me this:
ed40 78 SEI - A:00 X:00 Y:01 SP:f1 -B IZ
ed41 02 JAM - A:00 X:00 Y:01 SP:f1 -B IZ
ee97 AD 00 DD LDA $DD00 - A:00 X:00 Y:01 SP:ef -B IZ
ee9a 29 DF AND #$DF - A:1f X:00 Y:01 SP:ef -B I
ee9c 8D 00 DD STA $DD00 - A:1f X:00 Y:01 SP:ef -B I
ee9f 60 RTS - A:1f X:00 Y:01 SP:ef -B I
ed44 20 A9 EE JSR $EEA9 - A:1f X:00 Y:01 SP:f1 -B I
eea9 02 JAM - A:1f X:00 Y:01 SP:ef -B I
eeac CD 00 DD CMP $DD00 - A:1f X:00 Y:01 SP:ef -B I
eeaf D0 F8 BNE $EEA9 - A:1f X:00 Y:01 SP:ef -B IZC
eeb1 0A ASL A - A:1f X:00 Y:01 SP:ef -B IZC
eeb2 60 RTS - A:3e X:00 Y:01 SP:ef -B I
Note the JAM in there!
Without "virtual device traps" then the CPU history looks like this, without the JAM:
ed40 78 SEI - A:00 X:00 Y:01 SP:f3 -B IZC
ed41 20 97 EE JSR $EE97 - A:00 X:00 Y:01 SP:f3 -B IZC
ee97 AD 00 DD LDA $DD00 - A:00 X:00 Y:01 SP:f1 -B IZC
ee9a 29 DF AND #$DF - A:1f X:00 Y:01 SP:f1 -B I C
ee9c 8D 00 DD STA $DD00 - A:1f X:00 Y:01 SP:f1 -B I C
ee9f 60 RTS - A:1f X:00 Y:01 SP:f1 -B I C
ed44 20 A9 EE JSR $EEA9 - A:1f X:00 Y:01 SP:f3 -B I C
eea9 AD 00 DD LDA $DD00 - A:1f X:00 Y:01 SP:f1 -B I C
eeac CD 00 DD CMP $DD00 - A:1f X:00 Y:01 SP:f1 -B I C
eeaf D0 F8 BNE $EEA9 - A:1f X:00 Y:01 SP:f1 -B IZC
eeb1 0A ASL A - A:1f X:00 Y:01 SP:f1 -B IZC
eeb2 60 RTS - A:3e X:00 Y:01 SP:f1 -B I |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
That was my suspicion also. Indeed virtual device traps are on because I wanted speed and this was a simple way to emit a debug log to a file using an emulated printer. |
| |
Martin Piper
Registered: Nov 2007 Posts: 726 |
Yeah, if I'm doing disk stuff I turn off all of those traps and enable true drive. Sometimes the traps will cause problems with turbo loaders, or protection checks. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Yeah, if I'm doing disk stuff I turn off all of those traps and enable true drive. Sometimes the traps will cause problems with turbo loaders, or protection checks.
Normally me too, but in this case I thought what the heck, it’s just ascii output to an emulated printer, what can possibly go wrong. |
| |
Fungus
Registered: Sep 2002 Posts: 695 |
Known bug with true drive emu on older vice, UPDATE. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
I’m using HEAD. Anyway, I got confused by the JAM, but I guess that’s VICE’s way to implement virtual device traps. The problem is actually further down and entierly my own fault. Some memory corruption going on causing my PC to return to oblivion. |
... 15 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 - Next |