Hi everyone !
I would first like to apologize for my bad English, I'll try to do my best but it's quite hard for me Smile .

So, here is my question/problem : do you know if it is possible to access the saveVram "memory zone".
I explain : during some tests, to optimize drawing, I wanted to compare some pixels with a reference (the background) I have stored before with SaveVRAM_1(); I first tried to do a simple GetPoint routine, but instead of having the VRAM address, I used the saveVram address I founded in the Simon Loathar doc, and confirmed by this topic.
The problem is that I got a System Error everytime I tried this, so, because my routine doesn't look so bad (just from my point of view Razz), I began to wonder if this sort of memory reading was possible.

Here is the routine I told you :


Code:
short getPixelFromSavedVRAM(short x, short y)
{
    short *SAVED_VRAM = (short *)0xA80A2AD5;
    return *(SAVED_VRAM + (y * LCD_WIDTH_PX) + x);
}


I didn't know what address i had to use (0xA80A2AD5 or 0x880A2AD5), I've tried both and got a Sys Error for both. I don't understand a lot the notion of cacheable address, perheaps that's why I got this problems :p.

I believe this is possible because with Insight, we can view this area of memory, but perheaps this isn't accessible for my little skills Very Happy , but that's why I post here.

So here was my problem, I thank in advance people who read this. Smile
And a bit late "Merry christmas !"

Edit : I tried to correct some sentences, it seems to me that they were not very english. Very Happy
Hi Nemhardy,

a short pointer mustn't be odd.

0xA80A2AD5 or 0x880A2AD5 can only be considered as char pointer.
SimonLothar wrote:
Hi Nemhardy,

a short pointer mustn't be odd.

0xA80A2AD5 or 0x880A2AD5 can only be considered as char pointer.
Oh, of course, I should have thought of that. Smile Thanks so much for answering, Simon. More generally, a pointer to an integer type of length N bytes must have the bottom log2(N) bits as 0. In other words, a char pointer can be aligned anywhere, a short pointer must be aligned on even addresses, an int pointer must be aligned on pointers that are multiples of 4, and so on.
Thank Simon and Kerm for this answer Smile ! I'm now understanding some things and doing some tests.

Once again thank's a lot ! Smile
Nemhardy wrote:
Thank Simon and Kerm for this answer Smile ! I'm now understanding some things and doing some tests.

Once again thank's a lot ! Smile
You're welcome, and glad to hear it. Don't hesitate to post any follow-up questions that you might run into.
  
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