As promised, in the month of December I aim to finish three improvements/bug-fixes for the Selector. These are:
- Make the Selector work on "square pixel" Lisas
- Fix that problem of booting from a parallel port card that was mentioned last week
- Fix that problem of the Selector asking for which volume to use when the static RAM is wiped
I will not use AI for any of this, and I appreciate the patience of the community members who are all-in on AI (and making the overwhelming majority of new Lisa software and products) for holding back on doing this work themselves. Their forbearance will allow me to carry out the fixes to my own standards. I expect I will also enjoy doing the work, and why spoil a good time?
I have decided to document my process in this working log thread. I'm doing this also in some resistance to the tendency of retro forums becoming one-way product catalogs for everyone's AI-made creations. It's great to have all of these new things that massively expand what you can do with an old computer, but there is often little reason to talk about a finished project, just as you wouldn't have expected to have a nice social chat with a shareware publishing house back in the '90s. Figuring out your way through software projects and learning from each other was a good reason to talk to your neighbours in home computing for about five decades; that time may be mostly over now, but I'm going to at least subject all of you to the "pleasure" of my company before I reassess things for myself.
I expect to carry out most of my work later in the month, so don't be surprised if this thread goes quiet for a few stretches. There will be time for some sporadic improvements in the early weeks; also, I actually kicked off the work on the 30th, so I can start this working log with some initial progress. Post coming soon...
1. Fixing the lisa_io character routines for square pixels
The first problem I'm going to tackle is the square-pixel display issue: there are plenty of square pixel MacXLs out there that cannot use the Selector at all, as well as LisaFPGAs in ROM 3A mode, and emulators too of course. This improvement seems to be the most important.
The Selector's on-screen display (among other things) is powered by the lisa_io (https://codeberg.org/stepleton/lisa_io) library I wrote in the months surrounding the dawn of COVID-19. This is handy, reusable code for everyone, even though libraries are a bit unfashionable in a time when people seem to be happy to spend cash for tokens to reinvent the same wheels over and over. (Not a retro critique BTW: I see this everywhere now.)
Anyhow, one part of the library (https://codeberg.org/stepleton/lisa_io/src/branch/master/lisa_console_screen.x68) is dedicated to writing text to the screen, and this is the part that needs to be updated in order for characters in the Selector to display properly. The square pixel screen is 608 pixels/bits, hence 76 bytes, wide; the Lisa screen is 720 pixels (90 bytes) wide. When the text code writes 90-byte-wide text graphics to a 76-byte-wide display, subsequent rows of pixels skew far out of alignment and the text becomes totally unreadable.
It's not a hard problem to solve, but you have a tradeoff (https://en.wikipedia.org/wiki/Space%E2%80%93time_tradeoff) to consider: do you essentially write two versions of the code (one for each size of screen) or do you write one version of the code that branches locally based on which kind of screen it's using? The former is faster but takes up more space; the latter is slower but more compact. To me it's important that the Selector loads quickly and takes up little space, so I've opted for the second approach.
I also don't want people to have to re-write any old code that uses this library, not least myself. This means I don't want to use processor registers that I wasn't using previously: code that calls my routines may expect that code not to touch registers that it wasn't using before. Those local branches would be faster if they could check a value I'm tucking into a register somewhere, but if I can't do that then the information will need to be stored somewhere else: RAM. That will be slower still. Fortunately my code is written in such a way that it will not need to do that too frequently: twice per character, once per newline, and once every time the screen scrolls. I'm still finalising this change, but we will soon see whether this approach is tolerable.
/subscribe
The hardware manual (now back on lisa.sunder.net) does call out the magic address $FE3FFC that might be helpful here re: square pixels. At least in terms of knowing which one you're dealing with.
> so I've opted for the second approach.
Does this mean you're thinking of making a Selector-specific change and leaving the library unmodified?
Thanks for all you do!
The Selector must be one of the most useful tools yet made.
I am Happy to do testing if you wish.
I have a Lisa 2/10 here that shows the parallel card problem every time: boot ROM H, Apple dual parallel card (ROM 1.00) in slot 2, ESProFile on the lower connector. B on a Lisa Office System image ends in the crossed-out Lisa with error 49; a MacWorks image from the same card boots fine.
I also have a "Mac XL" which is a 2/10 with a 16mhz Xlerator and SCSI cards.
From my work on the driver and ESPFuji I have 7 ESProfiles, in many configurations (internal/external), various versions of the ESP32 and board revisions.
Just let me know!
$FE3FFC is indeed my method for working out whether there are square pixels fitted. It's handy that there is only one known square-pixel CPU ROM version, as that's where that identifier word lives. I just confirmed the correct value I should be looking for there in LisaEm.
I had a good session yesterday making most of the lisa_io changes, albeit without internet access. Luckily I had the LisaEm source and some of my old projects lying around to remind me of useful addresses like that one, as well as 68k assembly opcodes and syntax. I really should keep local copies of my favourite references, which for this project are liable to be:
http://wpage.unina.it/rcanonic/didattica/ce1/docs/68000.pdf
https://www.bitsavers.org/pdf/apple/lisa/Lisa_Boot_ROM_Manual_V1.3_Feb84.pdf
https://www.bitsavers.org/pdf/apple/lisa/firmware/Lisa_Boot_ROM_Asm_Listing.TEXT
and https://lisa.sunder.net/LisaHardwareManual1983.pdf of course.
To James's question I'm planning to modify the library, just in a way that shouldn't require too much work to integrate into existing programs that use it. The slightly-more capable code should require a bit of extra space, and I'm borrowing another word in RAM to store a boolean flag for whether the machine has square pixels.
(I could check against $FE3FFC each time, but I think that word lives in the ROM, and ROM access is often slower than RAM access is --- though I'm not sure this is the case on the Lisa. It seems more likely to be the case on XLerated machines. Also: comparing a word against $0341 is slower than checking whether a different word in RAM is nonzero.)
Tangent: If I really cared desperately about the library's working memory footprint: a lot of software (like the boot ROM) tends to treat the screen as being 32k in size; the ROM actually sets up the screen to start at the beginning of the final 32k of RAM. But there are some leftover bytes that the screen doesn't use: 720x364 pixels leaves 8 bytes spare, while the square-pixel mod's 608x431 (so odd!) pixel display leaves 12 extra bytes. I suppose I could keep state in there. That said, we'd have to be very careful: changing a particular one of those bits is supposed to turn the CRT beam on during the retrace, which can give you a scare! I wonder whether any of the emulators reproduce this effect; I'm guessing not. It could add a neat lightning effect to a demo, perhaps. Anyway, I'm not using any of these extra bytes.
For testing: I have irregular Lisa access at the moment but there are always the emulators, plus I have my LisaFPGA close to hand. More on that in a follow-on post: it's a funny story! But when the Selector fixes are near done, having diverse actual hardware to test with will be essential. I am not sure what kinds of challenges an XLerator will present to the assumptions my code makes, and only trying it on the real thing will tell for certain. Thanks for the offer of help!