• Soft Switches on IIGS

    From Paul MacMillan@21:1/5 to All on Thu Sep 24 15:28:48 2020
    I was playing around with Orca Pascal on the IIGS and wrote simple Peek and Poke routines (via assembly language) and I wanted to try some Lo-Res stuff. The soft switches to go to Graphics mode did not work unless I used the soft switches in the $E1 bank.

    Is this expected behaviour? I couldn't find this documented in the Apple IIGS Firmware manual.

    Thanks,
    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kent Dickey@21:1/5 to paul.s.macmillan@gmail.com on Thu Sep 24 21:41:23 2020
    In article <be27a3cf-be00-49b5-ad4c-5d2bf11f277do@googlegroups.com>,
    Paul MacMillan <paul.s.macmillan@gmail.com> wrote:
    I was playing around with Orca Pascal on the IIGS and wrote simple Peek
    and Poke routines (via assembly language) and I wanted to try some
    Lo-Res stuff. The soft switches to go to Graphics mode did not work
    unless I used the soft switches in the $E1 bank.

    Is this expected behaviour? I couldn't find this documented in the Apple
    IIGS Firmware manual.

    Thanks,
    Paul

    On a IIgs, the softswitches always exist in banks $E0 and $E1. They generally exist in banks $00 and $01 (if bit 6 of $C035 is clear, which it is under
    GSOS, and basically anything that isn't a weird demo).

    When you write native IIgs code, you'll be running out of an arbitrary bank that generally will be between $02 and $41 (if you have 4MB of memory),
    and the softswitches will not exist in those banks. So you have to be sure
    to access a bank where they do exist.

    Similarly, if you want to directly access the screen, you'll likely want to use bank $E0 for classic Apple II modes, and bank $E1 for SHR (and DHR). It's possible to use shadowing from banks $00 and $01, and this should work OK
    for text/lores since GSOS has left shadowing on for them. I don't know the steps to do so for hires under GSOS (you have to make sure GSOS doesn't try to use the memory for something else, which is very hard for bank $00). GSOS turns off shadowing of the hires pages by default.

    If you write a GUI app, you'll need to change $C029 to $41 to turn off SHR
    (and $C1 to turn SHR back on), since it overrides any old Apple II video mode.

    Kent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kelvin Sherlock@21:1/5 to Paul MacMillan on Fri Sep 25 02:30:49 2020
    Take a peek at Appendix H - Banks $E0 and $E1

    To communicate with the Mega II, the Apple IIGS either writes directly
    into bank $E0 or $E1 or enables a special soft switch, named shadowing.
    When shadowing is enabled, whenever the Apple IIGS writes into bank $00
    (or bank $01), the system automatically synchronizes with the Mega II
    and writes the same data into bank $E0 (or bank $E1).

    In <be27a3cf-be00-49b5-ad4c-5d2bf11f277do@googlegroups.com>
    Paul MacMillan <paul.s.macmillan@gmail.com> writes:

    I was playing around with Orca Pascal on the IIGS and wrote simple Peek and >Poke routines (via assembly language) and I wanted to try some Lo-Res stuff. >The soft switches to go to Graphics mode did not work unless I used the soft >switches in the $E1 bank.

    Is this expected behaviour? I couldn't find this documented in the Apple
    IIGS Firmware manual.

    Thanks,
    Paul

    -------
    ProLine: kelvin@pro-kegs

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Antoine Vignau@21:1/5 to All on Fri Sep 25 03:31:41 2020
    Paul,
    Are you using a real machine or an emulator?
    If you are using an emulator, switch to another one :-)
    If you are using a real machine, then I'd be interested in getting the generated code as, as Kelvin pointed out, both banks are OK.

    My guess is that you are using Sweet16 on a Mac...
    Antoine

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From thefadden@gmail.com@21:1/5 to paul.s.m...@gmail.com on Fri Sep 25 13:24:15 2020
    On Thursday, September 24, 2020 at 3:28:49 PM UTC-7, paul.s.m...@gmail.com wrote:
    Is this expected behaviour? I couldn't find this documented in the Apple IIGS Firmware manual.

    Wrong book. See the Hardware Reference Manual, 2nd edition, page 18 for details about shadowing, and "I/O space addresses" at the bottom of page 24.

    "The I/O space in the Apple IIgs consists of all the addresses from $C000 through $CFFF. [...] Any of these addresses can be accessed through banks $E0, $E1, $00, and $01. Access from banks $E0 and $E1 is always enabled; ..."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul MacMillan@21:1/5 to All on Sat Sep 26 08:06:27 2020
    Thanks for everyone's suggestions, this turns out to be a math error on my part -- in orca pascal, if I assign a longint variable to the constant $C050, its value is -16304, but what I need to is $0C050. That error resulted in my poking in to the wrong
    bank but the right offset.

    Paul

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