Since, I think I've officially made brandonw stop answering all forms of electronic devices for fear it is me, I've decided to ask bunches of dumb questions.

1. I need a very short (byte-size-wise) page swapping routine that simply backs everything up, swaps the page, and then swaps back and pops everything back into place.
2. Is there a list of all "Free ram" addresses. I'm looking for ram places that I can use while swapping the 0x4000-0x7FFF range. Things like ramCode. It doesn't matter the size. Even if it is only 1 byte. If it is used for anything like interrupts, screens, then I don't want to use it. (Never mind on this one. Anyone know how to do strikethrough?)

I know C well enough to understand enough, and learned asm at one point (Read: I might be able to write a hello world program)

Any help is appreciated. I work best with code or examples, btw. Thanks!
1. You'll have to do this in many pieces. The hardest part will be the flash erasing and writing, while the swapping it relatively trivial in and of itself, consisting only of copying a chunk to RAM, setting port 6, copying back to Flash, and resetting port 6. I'd be happy to present more complete pseudocode.

2. I can certainly collect these for you, or you can stare at the Doors CS 7 include file (cf. SafeRAM1 through SafeRAM5).
KermMartian wrote:
1. You'll have to do this in many pieces. The hardest part will be the flash erasing and writing, while the swapping it relatively trivial in and of itself, consisting only of copying a chunk to RAM, setting port 6, copying back to Flash, and resetting port 6. I'd be happy to present more complete pseudocode.

2. I can certainly collect these for you, or you can stare at the Doors CS 7 include file (cf. SafeRAM1 through SafeRAM5).

I don't really have to erase flash at all, nor write it during run-time. So that's fine. Psuedocode would be nice. I know when I'm writing the app, I do ".page 0" or whatever, but how do I know what page that is in my app? Like page 0, 1, and 2.
0 =page 65
1 =page 64
2 = page 63.
How do I know what page they are on, basically. Thanks for replying!
Wait, how are you going to swap data from one page onto another without writing Flash? I must be misunderstand what you're doing, then.
KermMartian wrote:
Wait, how are you going to swap data from one page onto another without writing Flash? I must be misunderstand what you're doing, then.

I'm not going to swap data from page to page. I'm only going to copy data in flash to ram.
graphmastur wrote:
KermMartian wrote:
Wait, how are you going to swap data from one page onto another without writing Flash? I must be misunderstand what you're doing, then.

I'm not going to swap data from page to page. I'm only going to copy data in flash to ram.
Oh. Well, then that's super-trivial.
KermMartian wrote:
graphmastur wrote:
KermMartian wrote:
Wait, how are you going to swap data from one page onto another without writing Flash? I must be misunderstand what you're doing, then.

I'm not going to swap data from page to page. I'm only going to copy data in flash to ram.
Oh. Well, then that's super-trivial.

So, Just writing to the port, and copying it back. It reads just like a normal address? Nice. Well, that parts easy. Can you give code for that? Like what is the code to back up all the registers?
Are you talking about like, finding and copying a program in flash to ram? if so, you should use my FindFlash routine to find the data and the tios routine FlashtoRam to copy it
Anakclusmos wrote:
Are you talking about like, finding and copying a program in flash to ram? if so, you should use my FindFlash routine to find the data and the tios routine FlashtoRam to copy it

I know where I want to copy it to in ram, and I know how long it will be (Well, it is listed how long it will be in the flash app). It is copying a routine from the flash app into an address in ram. My question is, how to know what pages my multipage app are on. I'll look into flash to ram, thank you.
try reading port 6, it'll tell you what page is swapped in $4000

if you need more info, look here...
http://wikiti.brandonw.net/index.php?title=83Plus:Ports:06
I'm usually busy and not at the computer when you IM me, I'm not ignoring you.

_FlashToRam is the be-all end-all "copy to RAM" routine. Disassemble it to see how to swap pages in and out of memory.

What's this talk about Flash writing and erasing? What exactly is it you're trying to do here?
BrandonW, do you happen to have a link on that?I'd be useful for my os
A link on what?
a link to a decompiled Flash2Ram routine of course
I'm sorry to say that if you don't know how to find it, you probably won't know what you're looking at.

A very old and horribly incomplete disassembly of OS 2.41 and boot code 1.02 from an 84+SE is at: http://brandonw.net/calcstuff/OS2.41_1.02dis.zip

It would take quite some time to explain, but _FlashToRam is a boot code BCALL and so it would be in the boot code disassembly, in the jump table at the start of memory, which will have the address to the actual routine.
I'll have to take a look at that sometime.hopefully its even slightly compatable with the TI83+ version.
Anakclusmos wrote:
try reading port 6, it'll tell you what page is swapped in $4000

if you need more info, look here...
http://wikiti.brandonw.net/index.php?title=83Plus:Ports:06
One particularly important thing to realize is that pages are stored backwards in ROM. In other words, if Page 0 of your app is swapped in, and Port (6) reads $68, then Page 1 is on $67, Page 2 of $66, etc. The TI-OS will always make sure your app pages are directly adjacent.
Okay, so it's been a while since I've used this thread, as poor Brandonw has been helping me. Granted it's been about usb, so that figures.

So, I've got a hook running, and I need to display some text, and exit the hook, but leave the text there. Is there any way to do that?
graphmastur wrote:
Okay, so it's been a while since I've used this thread, as poor Brandonw has been helping me. Granted it's been about usb, so that figures.

So, I've got a hook running, and I need to display some text, and exit the hook, but leave the text there. Is there any way to do that?
_Puts, or a loop with _PutC, or anything like that.
This is the code I use in Axe to copy data from page 2 of the app to the ram. This subroutine is essentially the same as ldir, but it assumes the data is on the second page of the application instead of the first.

The main part of the code that might be interesting to you is the in a,(6) \ dec a. The "in a,(6)" instruction gets the current page of the app and then the "dec a" decreases the page number since app pages are stored in reverse. It then maps this page to port 7 which it the $8000 to $CFFF section to read the byte. Then it restores all the pages back to normal in order to finally copy the byte to ram.


Code:
P2ldir:            ;I/O identical to ldir
   di
   push   af
P2ldirLoop:
   push   bc
   in   a,(7)
   ld   c,a
   in   a,(6)
   dec   a
   out   (7),a
   ld   b,(hl)
   ld   a,c
   out   (7),a
   ld   a,b
   ld   (de),a
   inc   de
   inc   hl
   pop   bc
   dec   bc
   ld   a,b
   or   c
   jr   nz,P2ldirLoop
   pop   af
   ret


EDIT: Oops, I didn't see the date of the original question. Oh well, I hope this is still useful for someone at least.
  
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 2
» 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