Jump to content
Sign in to follow this  
flashjazzcat

Reset Protection of $BC20 - $BFFF - possible?

Recommended Posts

I would find it useful to have program code in the $BC20-$BFFF region (under BASIC, which is disabled) and protect it from being overwritten by the default display handler on Reset. Unfortunately the OS seems determined to open the editor at this address regardless of MEMTOP or RAMTOP settings, which are evidently recalculated on Reset based on whether there's a cartridge present. Is there any way to "fool" the OS into opening E: at a lower address, or am I on a hiding to nothing here?

Share this post


Link to post
Share on other sites

Set the flag to enable Basic.

 

But then you get $9C20 - $9FFF overwritten.

 

Then use CASINI or DOSINI to switch Basic out again.

 

No other real alternative, either way you get near 1K wiped out.

 

Actually, just or two alternatives - PBI handler could probably get in and change RAMTOP. Or, a cartridge could stop it.

Diagnostic mode cart gets control right away, but you have no OS variables or functions initialised.

Normal mode cart you get the JSR thru $BFFE before "E:" is opened, if you don't return you have a mostly initialised system but no pesky screen.

Alternatively you could return after changing RAMTOP to a lower value.

Edited by Rybags

Share this post


Link to post
Share on other sites

Hmmm... setting BASIC flag would probably be OK (this is non-cart software), since $8000-$9FFF is buffer space anyway. Problem is, I wanted to make the buffer space dual-purpose: display RAM for the Antic 80 column handler (in which case it's no problem if it gets overwritten after Reset), or text buffer space when the display buffer is in VBXE's RAM. Clearly text buffer space should not be overwritten at any time (note $8000-$9FFF is chosen for its proximity to $4000-$7FFF, since it's essentially an optional "extension" of the text buffer space which is fixed in the banked area).

 

The only other way of doing it is to find some buffers which don't need to retain their data and aren't dependant on the screen driver in use and cram them all into $BC20-$BFFF. Trouble is, such buffers currently reside in pages 4, 5 and 6. I suppose it's safe to fill pages 4 and 5 (we know page 6 is safe) with code providing the FP and cassette handler aren't used (which they aren't). We could put the code at the top of memory into this area, and move the buffers up to the top under the OS screen RAM.

 

Anyway - thanks for the suggestions!

Edited by flashjazzcat

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...