What does a PMODE4,1 actually do?

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
tjewell
Posts: 346
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

What does a PMODE4,1 actually do?

Post by tjewell »

Hi all - still tinkering with a little utility I started 30 years ago!

Just noticed it doesn't play well with DOS (never had such luxuries when I was a kid), so I was hoping I could double check my logic. Basically, my code would like to do the equivalent of a 'PMODE4,1:SCREEN1,1', in a way that plays nicely with Basic.

So, first step, I look at $00bc, because that tells me where the first graphics page is. If it says x06, than it's at $0600, and if it's x0C, then DOS is installed and I use $0C00 as the start.

Presuming there's no DOS, I write x04 to $00B9, (to say 'PMODE 4'), 0x1e00 to $00ba:00bb to say when the page ends, and 0x600 to $00b7:00b8 to say where it starts. Finally, I write x20 to $00b9 to tell it that the screen is 32 bytes wide.

If it's DOS, I write 0x2400 to $00ba:00bb to say when the page ends, and 0xC00 to $00b7:00b8 to say where it starts. This leaves space for DOS.

Have I missed anything? Am I writing somewhere I shouldn't be? Is there a simpler way of doing this (like a ROM call?).

Thanks in advance everyone!
Post Reply