CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 112 users online: 7 members, 74 guests and 31 bots.
Members: Ashbad, colophonicd, flyingfisch, JamesV, ordelore, Spyro543.
Bots: VoilaBot (1), Magpie Crawler (3), VoilaBot (4), Googlebot (20), Ask Jeeves (1), MSN/Bing (2).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
ACagliano


Super-Expert


Joined: 08 Feb 2010
Posts: 922

Posted: 07 Feb 2012 10:28:19 am    Post subject: App Programming Help

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?
_________________
-ACagliano

Current Projects

Legend of Zelda. "Ganon's Rage"
51%
Back to top
benryves


Cemetech Expert


Joined: 12 Aug 2008
Posts: 1358
Location: London, United Kingdom

Posted: 07 Feb 2012 10:34:28 am    Post subject:

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.
Back to top
graphmastur


Power User


Joined: 27 Jul 2010
Posts: 464

Posted: 07 Feb 2012 10:35:19 am    Post subject:

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.
Back to top
ACagliano


Super-Expert


Joined: 08 Feb 2010
Posts: 922

Posted: 07 Feb 2012 10:36:31 am    Post subject:

Well, what do you have to do in order to swap pages?

Edit: and wouldn't it be call to the routine, not bcall?
_________________
-ACagliano

Current Projects

Legend of Zelda. "Ganon's Rage"
51%
Back to top
benryves


Cemetech Expert


Joined: 12 Aug 2008
Posts: 1358
Location: London, United Kingdom

Posted: 07 Feb 2012 10:37:34 am    Post subject:

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.
Back to top
ACagliano


Super-Expert


Joined: 08 Feb 2010
Posts: 922

Posted: 07 Feb 2012 10:53:01 am    Post subject:

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?
_________________
-ACagliano

Current Projects

Legend of Zelda. "Ganon's Rage"
51%
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 
Jump to:  
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

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.024139 seconds.