Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Camdenmil on January 17, 2013, 09:34:34 pm

Title: 84+ Extra Ram Page
Post by: Camdenmil on January 17, 2013, 09:34:34 pm
In an Axe program, I'm using page 83h for storage. I'm using about ~14k of the page right now. What do I have to reinitialize or restore when exiting the program? Right now I get ram clears on exit but that's expected because I'm not restoring anything.
Title: Re: 84+ Extra Ram Page
Post by: DrDnar on January 17, 2013, 10:39:31 pm
You can do that in Axe? Also, page 83h? That's the same as page 82h on port 15h=55h models.

Anyway, according to WikiTI:
* RAM page 3, 977Eh–9A7Dh -- previous entries. Destroying this causes crashes.
* RAM page 3, 9A7Eh–9D7Dh -- homescreen graph buffer. Zero after destroying to prevent flicker.

If that's not enough information, try using an emulator: set up a memory watch on all addresses on page 82/83h and see what addresses the OS touches. Or, make a series of programs that overwrite blocks of memory and see which ones cause a crash.
Title: Re: 84+ Extra Ram Page
Post by: thepenguin77 on January 18, 2013, 12:32:22 am
You can do that in Axe? Also, page 83h? That's the same as page 82h on port 15h=55h models.

Anyway, according to WikiTI:
* RAM page 3, 977Eh–9A7Dh -- previous entries. Destroying this causes crashes.
* RAM page 3, 9A7Eh–9D7Dh -- homescreen graph buffer. Zero after destroying to prevent flicker.

If that's not enough information, try using an emulator: set up a memory watch on all addresses on page 82/83h and see what addresses the OS touches. Or, make a series of programs that overwrite blocks of memory and see which ones cause a crash.

You forgot about $4000-$4080. Use bcall(_fillBasePageTable) to restore that otherwise multipage apps could crash. (Asm(EF1150))

And don't forget Camdenmil that when you swap the ram page in, the high two bits of the address change depending on where you put it. Since I'm going to assume you put it in the $4000 region, the WikiTi ranges would be 577Eh-5A7Dh and 5A7Eh-5D7Dh. (I actually wrote that section and I have no idea why I used $9000 addresses.)
Title: Re: 84+ Extra Ram Page
Post by: calc84maniac on January 18, 2013, 12:34:47 am
Hold it, you can't map RAM into $4000 on all calcs (notably the Pocket versions, since we're talking 84+)
Title: Re: 84+ Extra Ram Page
Post by: Xeda112358 on January 18, 2013, 12:38:19 am
As well, make sure that if you are swapping out the page, you swap back in the old page. That is probably the main source of crashing that I can think of. For example, I am not sure if you are using hexcodes to do that, but here is how it would be done:
Code: [Select]
Asm(DB066F)→P     ;Save flashpage
<<program>>
P:Asm(7DD306      ;restore flashpage at the end of your program
Title: Re: 84+ Extra Ram Page
Post by: Camdenmil on January 19, 2013, 10:40:52 pm
I'm restoring the original page with that exact code ;D
The crashing went away when I restored the data wikiti mentions. I was about to ask about app crashing but that bcall fixed that. Mathprint, not that I use it, acts weird after I destroy all of its data in the extra page. To disable it, do I have to do anything else besides reset 5, (IY+44h)?

Hold it, you can't map RAM into $4000 on all calcs (notably the Pocket versions, since we're talking 84+)
I wouldn't put it passed TI to screw up that badly ::)
Title: Re: 84+ Extra Ram Page
Post by: thepenguin77 on January 21, 2013, 12:50:06 pm
I'm restoring the original page with that exact code ;D
The crashing went away when I restored the data wikiti mentions. I was about to ask about app crashing but that bcall fixed that. Mathprint, not that I use it, acts weird after I destroy all of its data in the extra page. To disable it, do I have to do anything else besides reset 5, (IY+44h)?

To change the state of MathPrint, use this code:
Code: [Select]
res 5, (iy + $44)      ; or set

bcall(_clrTxtShd)                ;these are only required if you actually change the state of mathprint
bcall(_saveCMDShadow)       ;these clear the homescreen so only use them if you need them

I believe you know how to change flags, but the bcalls are Asm(EF4C45EF7345).


However, I should warn you that even if you turn off MathPrint, you still need to restore the 977E buffer. This buffer is used in both MathPrint and classic.
Title: Re: 84+ Extra Ram Page
Post by: calcdude84se on January 21, 2013, 11:10:14 pm
Hold it, you can't map RAM into $4000 on all calcs (notably the Pocket versions, since we're talking 84+)
I remember the discussions when this was first discovered. Didn't BrandonW later retract his claim that this was the case because he made some mistake? Or if he didn't, I thought he at least clarified it somewhat.