Possible problem with cloned SGC and Minerva 1.98

Nagging hardware related question? Post here!
martyn_hill
Aurora
Posts: 909
Joined: Sat Oct 25, 2014 9:53 am

Possible problem with cloned SGC and Minerva 1.98

Post by martyn_hill »

Hi everyone

Having purchased Tetroid's delightful SGC clone and started a thread in the 'For Sale' part of the forum, I thought to share my findings here and see if its just me or a possible incompatibility between the SGC ROM v2.49 and Minerva 1.98.

The simple test I've been running after boot-up is to attempt to load a SCR file (32k at 131072) from MDV.

Without the SGC fitted, this SCR file loads perfectly well in Minerva 1.98 from MDV1_ on this Issue-6 QL. No other mods what-so-ever (I keep this QL in its original form specifically to avoid troubleshooting my own flaky mods.)

Hermes is fitted.

I have tried a number of QDOS/Minerva ROM variants thus far, with the following results.

a) JS - LBYTES OK
b) Min 1.98 (original) - LBYTES fails and crashes the QL, after blanking (i.e. black-out) the bottom 2/3 of the display - none of the image file gets to be seen.
c) Min 1.98 (+Marcel's IO fix) - As per b)
d) Min 1.98 (+a slightly adjusted IO fix that I use on my other QLs) - As per b)

Before carrying out each test, I can successfully DIR the cartridge in each case.

By 'crash', I mean that whilst you can still hear Hermes 'click' upon each key-press, nothing else registers (not even CTRL+SHFT+ALT+TAB reset) and removing the cartridge whilst its still whirring leaves the drive spinning until the QL is hard-reset.

I've tried the test across the various Minervae 1.98+ with the IPC Interrupt both enabled and disabled (POKE!!53,192/128) - no change.

Marcel (who I trust with my QL's life!) indicated that the SGC ROM patching mechanism shouldn't get upset by the extra couple of bytes that the IO-fix adds to v1.98 and, as even an original Min 1.98 exhibits the same problem, the cause would appear to lie elsewhere.

I'll continue to try other (older) Minervae and report back, but if anyone has a different experience to share, please let me know :-)


martyn_hill
Aurora
Posts: 909
Joined: Sat Oct 25, 2014 9:53 am

Re: Possible problem with cloned SGC and Minerva 1.98

Post by martyn_hill »

...and to add that the same faulty behaviour is observed with Minerva 1.89.

Once the SGC-clone is removed, normal service is restored (and re-iterate that SGC plus JS ROM works as expected.)

Curious-er and curious-er...


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Possible problem with cloned SGC and Minerva 1.98

Post by Martin_Head »

Is it just a MDV problem. Does FLP's work OK

Can you LOAD programs OK, So that it is just LBYTES that fail. I'm wondering if it's something to do with the scatter load that LBYTES does (and maybe EXEC). As I had that problem myself once in a driver I was working on.

When the bottom 2/3 of the screen gets blanked out, Is that before the MDV starts to run, or after.

What if you OPEN the screen dump file, then run a loop in SuperBASIC to INKEY$ a byte from the file and then POKE it into the screen memory.

If you can find the addresses of the open,i/o, and close routines for the MDV driver, you could use QMON to put break points there to see if you can isolate where things go wrong.


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Possible problem with cloned SGC and Minerva 1.98

Post by NormanDunbar »

I might be wrong, but when I got my Gold Card (not Super GC) I'm almost certain that the screen address moved from the "standard" address. Is this the case on the SGC as well?

It's been a while since I had a GC (I donated it to Darren Brannagh for an elderly Gentleman's use some time back) so I could be remembering things wrongly, but I'm 98% sure. In fact, doesn't fitting a Trump Card to a BBQL move the screen address to?

Or, am I barking again? ;)


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Possible problem with cloned SGC and Minerva 1.98

Post by tofro »

NormanDunbar wrote:I might be wrong, but when I got my Gold Card (not Super GC) I'm almost certain that the screen address moved from the "standard" address. Is this the case on the SGC as well?
You're wrong, unfortunately. The screen address of a BBQL can only be in two places (where the 8301 can actually bring it to the CRT), $20000 and $28000. This does not change when you fit a GC or SGC (because these values are hard-coded into the 8301). Minerva is fine with moving the System variables away from $28000, where they normally live and makes room for the second screen when you start the QL in dual-screen mode.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Nasta
Gold Card
Posts: 443
Joined: Sun Feb 12, 2012 2:02 am
Location: Zapresic, Croatia

Re: Possible problem with cloned SGC and Minerva 1.98

Post by Nasta »

Have a look at the few posts at the bottom of page 1 and also posts on page 2 in this thread: https://www.qlforum.co.uk/viewtopic.php?f=3&t=1143


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Possible problem with cloned SGC and Minerva 1.98

Post by NormanDunbar »

tofro wrote:
NormanDunbar wrote:I might be wrong, but when I got my Gold Card (not Super GC) I'm almost certain that the screen address moved from the "standard" address. Is this the case on the SGC as well?
You're wrong, unfortunately.
That's par for the course then - thanks. :oops:

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
martyn_hill
Aurora
Posts: 909
Joined: Sat Oct 25, 2014 9:53 am

Re: Possible problem with cloned SGC and Minerva 1.98

Post by martyn_hill »

Hi Nasta, Martin, Norm and Tobi

I have yet to attach a FLP drive to the SGC clone, but as mentioned below, have tried the MDV LBYTES test both with and without the IPC interrupt being disabled - without any change in behaviour.

The SMSQ source is a bit too dense for me to figure out how the ROM patching is working - the fact that it mentions in the comments the original ROMS and Minv1.89 by name, suggests that at least these might be expected to work (and JS does work) - but of course this assumes that the SMSQ code I'm looking at matching the SGC ROM v2.49 as shipped with Tetroid's clone.

Time to play with QMON (if I can find a legitimate copy somewhere...) or else Jan's MultiMon.

I'll report back here when I find anything useful :-)


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: Possible problem with cloned SGC and Minerva 1.98

Post by mk79 »

martyn_hill wrote:I have yet to attach a FLP drive to the SGC clone, but as mentioned below, have tried the MDV LBYTES test both with and without the IPC interrupt being disabled - without any change in behaviour.
It seems that I get the crash with an original SGC, too, so the clone seems to be fine. It's possible that that the loading from MDV to screen messes up some timing somewhere as writing to the screen is slower than the other RAM region. Just a guess, though.
The SMSQ source is a bit too dense for me to figure out how the ROM patching is working
Yes, that code is quite something. In the meantime I have deciphered most of it, funnily enough most of the patches are for the Masterpiece graphics card (and thus never applied)! I'll have another look at the MDV part.
but of course this assumes that the SMSQ code I'm looking at matching the SGC ROM v2.49 as shipped with Tetroid's clone.
Yes, the source code matches v2.49, I have already ascertained that much some months ago. I actually use a ROM built from the sources on my SGC.

Cheers, Marcel


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: Possible problem with cloned SGC and Minerva 1.98

Post by mk79 »

OK, some more results:
  • Same problem with my (Tetroid) GC.
  • Crash on Minerva 1.89 and 1.98
  • Works on JS and Minerva 1.66
  • All MDV related patches are applied correctly
  • In fact these are not minor patches, the whole low level functions are exchanged. But equally for all ROMs!
  • Doesn't seem screen related after all, LBYTES to RAM also clears the screen and crashes
  • COPY works
Hmm, looking over the list I suspect the scatter load of the MDV device driver is broken on later Minervas. Further experiments now show that it always crashes when you LBYTES a file that is exactly 4096 bytes or bigger. Too late to investigate further, but the bug will be in dd_msvsc_asm I guess. Still pretty amazing that this hasn't been reported before.


Post Reply