• Reading the IIgs Text ROM data from inside the machine?

    From Nick Westgate@21:1/5 to All on Sun Feb 6 19:10:53 2022
    Hi guys.

    Obviously this can't be done in earlier Apple II computers.

    But someone commented on my answers here: https://retrocomputing.stackexchange.com/questions/23854/can-you-read-the-character-definitions-font-in-an-apple-ii-using-peek-in-apple/

    "Actually, on the Apple IIgs, there was a way to read the character ROM - it wasn't directly in the memory map, this was done in some backdoor way through other video-related registers. It's been far too long, I don't remember the details, or any
    explanation as to why Apple bothered implementing this."

    I've searched comp.sys.apple2 but came up empty handed.

    Does anyone have the details of how to do this?

    Cheers,
    Nick.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Schmidt@21:1/5 to Nick Westgate on Mon Feb 7 10:11:39 2022
    On 2/6/22 10:10 PM, Nick Westgate wrote:
    Hi guys.

    Obviously this can't be done in earlier Apple II computers.

    But someone commented on my answers here: https://retrocomputing.stackexchange.com/questions/23854/can-you-read-the-character-definitions-font-in-an-apple-ii-using-peek-in-apple/

    "Actually, on the Apple IIgs, there was a way to read the character ROM - it wasn't directly in the memory map, this was done in some backdoor way through other video-related registers. It's been far too long, I don't remember the details, or any
    explanation as to why Apple bothered implementing this."

    I've searched comp.sys.apple2 but came up empty handed.

    Does anyone have the details of how to do this?

    They _might_ have been thinking about the Apple ///, which you do need
    to go through some register and interrupt chicanery to load chargen data.

    - David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From awanderin@21:1/5 to David Schmidt on Mon Feb 7 17:17:37 2022
    David Schmidt <schmidtd@my-deja.com> writes:

    On 2/6/22 10:10 PM, Nick Westgate wrote:
    Hi guys.

    Obviously this can't be done in earlier Apple II computers.

    But someone commented on my answers here:
    https://retrocomputing.stackexchange.com/questions/23854/can-you-read-the-character-definitions-font-in-an-apple-ii-using-peek-in-apple/

    "Actually, on the Apple IIgs, there was a way to read the character ROM - it wasn't
    directly in the memory map, this was done in some backdoor way through other >> video-related registers. It's been far too long, I don't remember the details, or any
    explanation as to why Apple bothered implementing this."

    I've searched comp.sys.apple2 but came up empty handed.

    Does anyone have the details of how to do this?

    They _might_ have been thinking about the Apple ///, which you do need to go through some
    register and interrupt chicanery to load chargen data.

    Well, there are some vague clues:

    1. Apple IIgs Firmware Reference, page 281, last line:

    C02C:00 246 CHARROM DFB 0 ; Addr for tst mode read of character ROM

    page 290 has one line each for three more "test mode" registers:

    C06D:00 584 TESTREG DFB 0 ;Test mode bit register
    C06E:00 585 CLRTM DFB 0 ;Clear test mode
    C06F:00 586 ENTM DFB 0 ;Enable test mode


    2. The Cortland Custom ICs document: http://www.brutaldeluxe.fr/documentation/cortland/v5/Cortland%20Custom%20ICs%20-%20Wayne%20Lowry%20-%20Preliminary%20notes%20-%2019860214.pdf

    Page 46 has a _VGC Test Modes_ section, and it says:

    VGC Test Modes

    The VGC can be put into the test mode by pulling the TEXT input pin to a logic 0 level.
    When this pin is low, an internal dot-clock signal is multiplexed out onto the 3.5DISK
    output pin. This signal is used inside the chip to clock out video data; it can be
    used for signature analysis testing of the video outputs.

    When the VGC is in the test mode, writing a 1 in bit 0 of the Disk register "breaks up"
    the internal video counters and address counters and causes them to count in a
    different sequence. This is done to speed chip testing. When the counters have been
    broken, only a power-on clear can restore them to their normal operating condition.



    I might pull out my IIgs and fiddle around, but it's going to be a lot
    of shooting in the dark.

    I've looked around for diagnostic code, but haven't found anything relevant.

    There are interesting files here: https://tek4um.com/Apple Cork Cupertino Arhive/
    with some relationship to diagnostic tests, but nothing mentions the
    above I/O locations.

    The Brutal Deluxe corland documentation also seems like a likely place
    to find such information, but so far I haven't found anything else.
    Perhaps some other eyeballs on it might uncover something interesting?

    --
    Jerry awanderin at gmail dot com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nick Westgate@21:1/5 to awanderin on Mon Feb 7 17:53:16 2022
    On Tuesday, February 8, 2022 at 10:17:46 AM UTC+10, awanderin wrote:
    Well, there are some vague clues:

    1. Apple IIgs Firmware Reference, page 281, last line:

    C02C:00 246 CHARROM DFB 0 ; Addr for tst mode read of character ROM

    Wow, great finds, Jerry! I didn't even bother checking the manuals, but those are actually pretty specific clues!

    Funnily enough, another commenter pointed out exactly this use case:
    "One reason for a back door could be that it enables self-test/diagnostic software to check the function of the ROM and its data paths. If the back door hardware is cheap, that reduces manufacturing cost by simplifying QA."

    Cheers,
    Nick.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jason Harper@21:1/5 to All on Mon Feb 7 22:39:53 2022
    (I'm the commenter from stackexchange mentioned in the first post.)

    I did some digging through old disk images containing even older disk images (watch Inception for details), and found the source code where I'd actually implemented character ROM reading on the IIgs. I got the technique directly from an Apple engineer
    back in the day - it's entirely possible I'm the only programmer outside of Apple who ever used it.

    I'm pretty sure that all the registers involved are part of the Mega II chip, so it's not actually specific to the IIgs.

    Note that there's no way to supply an address to the character ROM - all you can get via CHARROM is whatever byte was most recently accessed by normal video display. So to read a specific character, the basic idea is to fill the entire text screen with
    that character, enable test mode, loop until the horizontal count register indicates you're in the middle of the visible part of a scan line, quickly read CHARROM, then read the low 3 bits of the vertical count register to see which row of the character
    bitmap you happened to grab. Repeat until you've collected all 8 rows. All of this needs to be done with interrupts disabled, and my code was careful to leave test mode enabled for the absolute minimum amount of time - apparently the machine would be
    left in some sort of bad state if it crashed or was reset with test mode active.
    - Jason Harper

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ian Brumby@21:1/5 to In reply to "Jason Harper" who on Tue Feb 8 07:09:10 2022
    In reply to "Jason Harper" who wrote the following:

    found the source code where I'd actually implemented character ROM reading
    on the IIgs. I got the technique directly from an Apple engineer back in
    the day - it's entirely possible I'm the only programmer outside of Apple
    who ever used it.

    Hi Jason,

    This is very interesting. Is it possible for you to make the source code available?

    Cheers,
    Ian.



    --
    ----------------------------------------- --- -- -
    Posted with NewsLeecher v7.0 Final
    Free Newsreader @ http://www.newsleecher.com/
    ------------------------------- ----- ---- -- -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nick Westgate@21:1/5 to Jason Harper on Mon Feb 7 23:43:28 2022
    On Tuesday, February 8, 2022 at 4:39:54 PM UTC+10, Jason Harper wrote:
    (I'm the commenter from stackexchange mentioned in the first post.)

    I did some digging through old disk images containing even older disk images (watch Inception for details), and found the source code where I'd actually implemented character ROM reading on the IIgs. I got the technique directly from an Apple engineer
    back in the day - it's entirely possible I'm the only programmer outside of Apple who ever used it.

    Thanks for digging through your meta-images!

    Apart from the obvious questions, I'd also be interested to know why you actually wanted/needed to do this. Was it for fun or a project?

    I'm pretty sure that all the registers involved are part of the Mega II chip, so it's not actually specific to the IIgs.

    Yeah, I noticed in the hardware reference that the character generator ROM is part of the Mega II, so that makes sense.

    Cheers,
    Nick.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From I am Rob@21:1/5 to All on Tue Feb 8 07:10:13 2022
    ...
    - Jason Harper

    Very nice job on SuperConvert, Jason. Did you happen to ever make the source code available for SuperConvert?

    I wrote an .lz4 compressor on the IIGS but under Prodos8, and would rather have the graphics conversions done without having to enter GSOS.

    Rob

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jason Harper@21:1/5 to Ian Brumby on Tue Feb 8 06:47:55 2022
    On Tuesday, February 8, 2022 at 1:09:13 AM UTC-6, Ian Brumby wrote:
    This is very interesting. Is it possible for you to make the source code available?

    Ian, you're probably the one person in the world who might have this source code already...

    On Tuesday, February 8, 2022 at 1:43:29 AM UTC-6, Nick Westgate wrote:
    Apart from the obvious questions, I'd also be interested to know why you actually wanted/needed to do this. Was it for fun or a project?

    It was a conversion format for SuperConvert - designed to turn a captured text screen image into a pixel-perfect graphic image, taking into account all of the relevant settings, such as system language. It was intended to work with a utility called The
    Desktop Manager, which could take such screenshots, although the file format was just a raw dump of text screen memory, so you could just as easily use BSAVE from Basic. I assume the target market was people doing documentation for text-based software -
    but I certainly no longer have any record of the conversations that led to this feature being implemented, so we may never know.
    - Jason Harper

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ian Brumby@21:1/5 to In reply to "Jason Harper" who on Tue Feb 8 23:09:37 2022
    In reply to "Jason Harper" who wrote the following:

    Ian, you're probably the one person in the world who might have this
    source code already...

    Haha! I've found it! I didn't realise it was part of the SuperConvert source code.

    I'll turn it into a standalone program to dump the character ROM and post the source + executable.

    I'm mainly interested in this from a preservation/emulation point of view. It's another softswitch that is completely undocumented and none of the current emulators will even try to emulate. Let me fix that.

    Cheers,
    Ian.



    --
    ----------------------------------------- --- -- -
    Posted with NewsLeecher v7.0 Final
    Free Newsreader @ http://www.newsleecher.com/
    ------------------------------- ----- ---- -- -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nick Westgate@21:1/5 to Ian Brumby on Tue Feb 8 15:58:32 2022
    On Wednesday, February 9, 2022 at 9:09:40 AM UTC+10, Ian Brumby wrote:
    In reply to "Jason Harper" who wrote the following:
    Ian, you're probably the one person in the world who might have this
    source code already...
    I'll turn it into a standalone program to dump the character ROM and post the source + executable.

    Awesome! Thanks guys.

    I'm mainly interested in this from a preservation/emulation point of view. It's
    another softswitch that is completely undocumented and none of the current emulators will even try to emulate. Let me fix that.

    Also awesome. I hear rumours ... ; - )
    Achievement Unlocked!

    Cheers,
    Nick.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)