OSI were sneaky!!

Post Reply
bartleph
Posts: 17
Joined: Sat Oct 02, 2021 11:38 am

OSI were sneaky!!

Post by bartleph »

I'm coming along leaps and bounds with my 65C02 system. I have a Floppy IO working to Shugart 5.25 and Gotek Drives, and I am just finishing up my own 2k x 8 Memory mapped display board. So when customizing CEGMON to use ACIA ( @$8000) as input and VDU (@$D000) as output I came up with a really curved ball. I have been using Grant Searle's excellent CEGMON patches when using ACIA both for input and output with no problems but modifying it to continue getting input from the ACIA but route output to my VDU hit a snag. Output was fine, albeit the text wobbles a bit on my monitor, but input was non-existent. Looking at the CEGMON code, it jumps into BASIC ($BF22) to initialise the ACIA, and lo and behold, it thinks it's at $FC00 !! I understand why it thinks it at that address as it's a legacy thing, but why does the monitor jump into BASIC for an initialisation routine, of just 11 bytes?? After modifying the code to reflect my location all works well..
Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: OSI were sneaky!!

Post by Mark »

I believe OSI shipped the same BASIC ROMS on all BASIC in ROM systems. Its quite interesting to see how they got everything from a C2 serial system with 430board cassette to a C2P video system or a C1P all working with the same BASIC ROMs, reconfiguring for varying video starting addresses & sizes as well as UART & ACIA serial I/O, polled or ASCII keyboards.

The monitor ROM used with earliest systems (OSI400/500) seems to have expected the $FC00 ACIA initialization for BASIC-In-ROM system to be in the BASIC ROM, probably put there because there was extra space. The C1P/SYN600 ROM seems to have been developed later. The C1P used a different memory layout/requiring an additional page for disk initialization so OSI moved the ACIA to $F000 and put the ACIA initialization code in the FFxx ROM.

Later CEGMON was developed by George Chkiantz, Richard Elen & Tom Graves as a 3rd party replacement/enhancement of the OSI monitor ROMS. It integrated with the OSI/UK101 BASIC ROM and used nearly every byte available of the 2K space. It kept the well known OSI system ROM address intact for compatibility as well as for BASIC. There were different versions depending on the target system. The ACIA at FC00 was in the middle of the last 2K address space but instead of moving the ACIA it was left alone in C2/C4 systems and the page of the CEGMON ROM was remapped to another free page in the Fxxx memory space (F700/F600/F400). On the C1P the ACIA at F000 caused no conflict.

So on my version of the C1P CEGMON, no call to BF22 is present, ACIA init happens at FCA6 . On the C2P CEGMON it calls BF22 as expected. I haven't checked all the UK101 versions.

Anyway good work figuring out the problem. I don't think it was a sneaky thing, just many systems & evolution. I see the system ROM and $BF22 (C2/C4) init ACIA to enable tx/rx IRQ 8N2 ($B1), and the SYN600 (C1P) has IRQ disabled 8N2 ($11), so having IRQ connected could cause problems without IRQ handler on C2/C4. (OSI shipped without IRQ connected on those systems -- so it had no impact.)

Cheers,
-Mark
bartleph
Posts: 17
Joined: Sat Oct 02, 2021 11:38 am

Re: OSI were sneaky!!

Post by bartleph »

That explains it very well. Thank you Mark.
Post Reply