[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IIgs - read 40/80 setting at runtime?



Toinet's answer worked.

The actual code as I added it is thus (noting that by this point the system
type is already stored in a variable):

00AA27  1               ; test the 40/80 switch on an Apple IIgs (only at
startup)
00AA27  1  AD 4F AA     setgs80:  lda       systype   ; check previously
determined system type
00AA2A  1  C9 16                  cmp       #$16      ; IIgs?
00AA2C  1  F0 01                  beq       @1        ; yes, skip
00AA2E  1  60                     rts                 ; no, exit
00AA2F  1  18           @1:       clc                 ; prepare mode switch
00AA30  1                         .p816               ; here be dragons
00AA30  1  FB                     xce                 ; enter 16-bit mode
00AA31  1                         .i16                ; assemble as 16-bit
mode
00AA31  1  C2 30                  rep       #$30
00AA33  1  48                     pha
00AA34  1  F4 19 00               pea       $0019
00AA37  1  A2 03 0C               ldx       #$0C03
00AA3A  1  22 00 00 E1            jsl       $E10000   ; readbparam
00AA3E  1  68                     pla
00AA3F  1  85 EE                  sta       $EE
00AA41  1  38                     sec                 ; prepare mode switch
00AA42  1  FB                     xce                 ; exit 16-bit mode
00AA43  1                         .i8                 ; assemble as 8-bit
mode
00AA43  1  E2 30                  sep       #$30
00AA45  1                         .p02                ; no more 65816 code
past this point
00AA45  1  A5 EE                  lda       $EE       ; so was it on or off?
00AA47  1  D0 01                  bne       @2        ; on, skip
00AA49  1  60                     rts                 ; off, return
00AA4A  1  A9 03        @2:       lda       #$03      ; PR#3
00AA4C  1  4C 95 FE               jmp       $FE95     ; do it and return

-uso.