I have some questions about app programming...

1. If you have a 2 or more page app, and you are on page 1 and your data is on another page, can u still reference that data as you would in a typical program?

For instance...


Code:
Page0:

//code here
ld hl, SplashScreen
ld de, the address of the LCD buffer or wherever to write to
ldir

Page1:

SplashScreen:
//image here.


Would this work, or would u need to do something else?
That would not work as written, as both pages occupy the same memory range and you can only address one page at a time. The easiest way to make it work would be to put the code to copy the splash screen onto the same page as the splash screen itself (page 1) and to bcall it from page 0.
No, this wouldn't work, or at least, not on the way you expect it. You would essentially have a routine outside of the 0x4000 to 0x7FFF range that would swap the two pages, copy the data you want in ram, and then switch back. Then, your code from page 0 could use it.

<I notice that benryves just ninja'd me>

Better yet, I would have the routines that use the same data on the same pages. Then, you don't have to copy, just swap pages, call the routine, swap back.
Well, what do you have to do in order to swap pages?

Edit: and wouldn't it be call to the routine, not bcall?
Assuming you're using Brass, I suggest reading this tutorial.

Edit: bcall is used to call off-page routines, so you would need to bcall it. The bcall handler uses a branch table to swap in the correct page to call the routine, then swaps the original page back in when you return.
Ok, and what would I put into de as the address of the LCD RAM? I don't think I can do fastcopyb from an app, right?
  
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