Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Soft Switches on IIGS

150 views
Skip to first unread message

Paul MacMillan

unread,
Sep 24, 2020, 6:28:49 PM9/24/20
to
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

Kent Dickey

unread,
Sep 24, 2020, 10:41:29 PM9/24/20
to
In article <be27a3cf-be00-49b5...@googlegroups.com>,
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

Kelvin Sherlock

unread,
Sep 25, 2020, 12:20:22 AM9/25/20
to

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...@googlegroups.com>
-------
ProLine: kelvin@pro-kegs

Antoine Vignau

unread,
Sep 25, 2020, 6:31:43 AM9/25/20
to
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

thef...@gmail.com

unread,
Sep 25, 2020, 4:24:16 PM9/25/20
to
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; ..."

Paul MacMillan

unread,
Sep 26, 2020, 11:06:28 AM9/26/20
to
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

0 new messages