Question about PRINT behaviour.

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
User avatar
robcfg
Posts: 1676
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Question about PRINT behaviour.

Post by robcfg »

I was doing some fun stuff like reading the text screen memory and using that to render the text there in the graphics screen.

Now, when I issue a PRINT command, it will return automatically to the text display.

Is there any way to prevent that?

What I'd like is for Basic to mind its own business and write to the text memory, so I can then render that on the graphics screen without showing the text screen again.

Is that actually possible?
sixxie
Posts: 1447
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Question about PRINT behaviour.

Post by sixxie »

Not without a little extra trickery.

On the CoCo, Extended BASIC inserts a RAM hook for CHROUT that performs this "return to text mode", and you can work around it with POKE359,57 - POKEing 126 to return to normal behaviour.

But because the Dragon has a combined Extended BASIC ROM, they felt no need to use a RAM hook, so it's just part of the normal CHROUT ROM routine.

I did come up with this for Curtis a while ago, and it seemed to work:

Code: Select all

10 POKE&H3EB,&H32:POKE&H3EC,&H62:POKE&H3ED,&H7E:POKE&H3EE,&H80:POKE&H3EF,&H0C
20 POKE&H167,&H39:POKE&H168,&H03:POKE&H169,&HEB:POKE&H167,&H7E
Which sets up the same RAM hook to JMP to later in the ROM code. It almost certainly interferes with disk file io though (PRINTing to files, etc.) so buyer beware and all that.
User avatar
robcfg
Posts: 1676
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Question about PRINT behaviour.

Post by robcfg »

I'll try that, thanks!
User avatar
robcfg
Posts: 1676
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Question about PRINT behaviour.

Post by robcfg »

And it works!

Thank you very much :mrgreen:
Post Reply