[comp.sys.apple] Hyper-C now fixed on an Apple IIgs.

beversdo@silver.bacs.indiana.edu (Tom Beversdorf ) (06/01/89)

I discovered the problem on the Hyper-C which wouldn't run on a IIgs
computer because it intended to execute a "BRK" instruction.  The BRK
on an Apple //e stays in the language card while an Apple IIgs switched
into ROM memory.

The Solution:

    Go to the monitor on an Apple IIgs computer, type:

        *E1/0010:5C D4 D0 00
        *6^p
Then that should work.

Another Solution:

    Go to the sector editor:

    On Track 0, Sector 3:
    Starting Byte B8:
    Change them to 20 D0 F5 EA EA EA EA EA EA.

    On Track 3, Sector E:
    Byte C0 through the near end of the sector:

    AD 81 C0 38 20 1F FE AD  83 C0 AD 83 C0 60 00 00
    A2 0D BD C0 F5 9D 00 03  CA 10 F7 20 00 03 90 0B
    A9 D4 8D FE FF A9 D0 8D  FF FF 60 A2 03 BD F8 F5
    9F 10 00 E1 CA 10 F6 60  5C D4 D0 00 .. .. .. ..

That should also work (if you don't have to bother with monitor command
everytime you start up with Hyper-C on an Apple IIgs.

----

Technical Information of how to fix Hyper-C on an Apple IIgs:

At first, after the Hyper-C has been booted up and the system is loaded,
it checks for the machine-ID for IIgs, but we had a problem.  First, the
code had to be moved into the main RAM memory such as $0300 to switch the
ROM w/ Language Card and checks for an ID and return to the Language Card
routine.  If that is a IIgs specific, then it writes into bank E1 address
0010, the IIgs interrupt vector, to jump to cold start.  If not, then it
writes the Language Card FFFE and FFFF to D0D4.

Assembly Listing for Hyper-C modification:

GS_CHECK    LDA $C081        ;Enables the ROM memory
            SEC              ;Suppose that is non-IIgs specific
            JSR $FE1F        ;Machine ID - Check for IIgs.
            LDA $C083        ;Enables the Language Card
            LDA $C083        ;Enables write to Language Card
            RTS
ENDCHK      EQU *            ;End of Checking Code.

START       LDX #ENDCHK-GS_CHECK
LOOP1       LDA GS_CHECK,X   ;Move the code out of the Language Card so
            STA $300,x       ;we can swap the ROM w/ Language Card.
            DEX
            BPL LOOP1
            JSR $300         ;Do a Machine ID code.
            BCC IIGS         ;if Carry bit is clear, then IIgs,
            LDA #$D4         ;else //e, //c.
            STA $FFFE
            LDA #$D0
            STA $FFFF
            RTS
IIGS        LDX #$03
LOOP2       LDA JMLCODE,X
            STA $E10010,X
            DEX
            BPL LOOP2
            RTS
JMLCODE     JMP $00D0D4

Mine works on the modification of Hyper-C.

dlyons@Apple.COM (David Lyons) (06/02/89)

In article <21462@iuvax.cs.indiana.edu> beversdo@silver.bacs.indiana.edu (Tom Beversdorf    ) writes:
>I discovered the problem on the Hyper-C which wouldn't run on a IIgs
>computer because it intended to execute a "BRK" instruction.  The BRK
>on an Apple //e stays in the language card while an Apple IIgs switched
>into ROM memory.
>
>The Solution:
>
>    Go to the monitor on an Apple IIgs computer, type:
>
>        *E1/0010:5C D4 D0 00
> [...and a machien code patch that also involved changing the E1/10 vector...]

            AA    CCC  K  K  !
           A  A  C     K K   !
           AAAA  C     KK    !
           A  A  C     K K
           A  A   CCC  K  K  !

If there are *any* other interrupts (other than the BRK that Hyper-C executes
intentionally) occuring in your GS after making this patch, your system will
go south and you'll have to reboot.

$E10010 is the vector that all sorts of interrupts go through on the GS.  This
includes serial port interrupts, scanline interrupts, sound interrupts,
vertical blanking interrupts (for heartbeat tasks), mouse interrupts, quarter
second interrupts, ADB interrupts, desk manager interrupts (hitting Apple-Ctrl-
ESC), and others.

With the above patch, any of these interrupts will cause a jump to $00D054,
which contains Hyper-C code *if* you're lucky enough to have the right language
card bank switches in at the time the interrupt occurs.

Probably *no* interrupts occur typically when you're using Hyper-C.  Maybe it
even disables them--I don't know; I've never used it.  If you manage to do a
soft enough reboot from Hyper-C, your system will probably freeze mysteriously.

There's got to be a nicer way to fix Hyper-C.  (Like putting the entry point
to its BRK handler in main memory instead of the language card.)

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   AppleLink--Personal Edition: Dave Lyons   |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.