Okay, so bear with me here, I probably going to make some silly mistake that I should know not to do:

So I am mapping ram page 5 to $C000-$FFFF. Here's the code I've got going now at the beginning:
But it just crashes on start. Any help is much appreciated; I'm just so used to having as much ram as I need, but now I need more. Razz


Code:
di
ld (saveSP),sp
ld sp,statVars+400
in a,($05)
ld (BackupPage),a
ld a,$05
out ($05),a
ei


And when I exit, this.


Code:
di
ld a,(BackupPage)
out ($05),a
ld sp,(saveSP)
ei


Notes:
saveSP ($8904) and BackupPage ($88FA) are stored in saveSScreen.
Around 600 bytes stored at plotsscreen
These are all accessed.
This is actually working just fine; I am silly and was trying to access an external variable while pages were swapped. Wow. Totally blanked that the VAT is also stored there. Sad
Are you trying to execute in the $C000 to $FFFF range, or just use it for data storage? Note that without using a Flash unlock exploit, you cannot execute above $BFFF.
Just as a buffer for now; just want to be able to write and read to that particular ram page. By the way, this is for the CSE. I am reading from an AppVar into this page.

EDIT: Mega Oops. Forgot that the VAT is right next to the stack... D'uh.
(FACEPALM) Sad

EDIT: Mega Oops Number 2. Bcall Arc_Unarch unlocks Flash, which looks at the value in SP, and if SP is not in the right place (See my above code) it crashes.
(FACEPALM Number 2) Sad

Okay, so if anyone reading this is wondering how to do this, here's what I did: First, only swap once you have the pointers to the variable, either in flash or RAM, then copy the data to edit. Swap back to RAM page 0 afterwords to then access the VAT. Glad I finally got this figured out! Very Happy
KermMartian wrote:
Are you trying to execute in the $C000 to $FFFF range, or just use it for data storage? Note that without using a Flash unlock exploit, you cannot execute above $BFFF.


It's not $C000 that causes it, it's RAM page 0 (which is usually swapped there) -- even-numbered pages can't execute code no matter where they're swapped in.

The even-numbered logic is because of the protected ports' initial setup -- like most things, it can be changed or disabled completely with flash unlocked.

(It's been a long time, so if that's actually not right, somebody correct me.)
If you don't need all 16 K of page 5, you might find ports 27 and 28 super-useful. (Reminder: Port 5 doesn't exist on the TI-83+!) The exist specifically for keeping the stack and system vars in memory when screwing with RAM paging.
Thanks all for your help! BrandonW, DrDnar, Iambian, tr1p1ea, and Kerm all did a really nice job explaining on IRC what the heck I was messing up on. Smile

DrDnar: Ooh, those ports look really nice! Would it just limit the size of the stack I could have there?
Not really. Just set port 27 to 8 and the first 512 bytes will stay mapped, which I think is the whole stack.
DrDnar wrote:
Not really. Just set port 27 to 8 and the first 512 bytes will stay mapped, which I think is the whole stack.


Ah, that makes sense then. Smile So that way I don't have to worry about messing around with SP. Thanks! Smile

EDIT: Just got it working! Smile Very nice.

So this means that now I can have an AppVar, archive it if it isn't archived, read the data from flash into this ram page, still maintaining my safeRAM locations, and then do whatever I want with the data while it's there. And if I need to check the VAT, I can just swap back page 0, read the VAT, swap back to page 5, and continue doing what ever was happening. Smile
Nice outcome!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement