Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
controlling what's in ROM vs WRAM / VRAM at runtime   Message List  
Reply | Forward Message #10730 of 15019 |
Re: [gbadev] controlling what's in ROM vs WRAM / VRAM at runtime

Hi,

> Sorry for the basic question folks...
>
> What's the usual way of controlling what data is code (like AGBMain for
> example), and should be loaded into memory, and what data is things like
> music and graphics for other levels, and should be kept in ROM until
> needed? Our software project has just gotten big enough that the
> difference matters. I'm using gcc and HAMlib, in case that's relevant.

Putting "const" at the start of the array decleration forces the data into
ROM (eg .const unsigned short int)

to swap data between ram and rom (eg. reading a map or gfx data into ram to
make vram copying faster) you'll need to handle that manually.

what you need to do is allocate the RAM that the data will take up (by using
malloc or making an array) then reading the contents of the ROM array into
it

eg

// x = array length

while(x--){
workram_map[x] = rom_map[x]
}



Andrew





Tue Apr 2, 2002 2:22 pm

andrew_crowe
Offline Offline
Send Email Send Email

Forward
Message #10730 of 15019 |
Expand Messages Author Sort by Date

Sorry for the basic question folks... What's the usual way of controlling what data is code (like AGBMain for example), and should be loaded into memory, and...
Jeremy Finney
jfinney@...
Send Email
Apr 2, 2002
1:47 pm

Is there any tool around that is similar to the MapAnalyzer for the GBC? Thanks for the help, Cesar. ...
Cesar Cappellozza
cappeca
Offline Send Email
Apr 2, 2002
2:08 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Apr 2, 2002
10:31 pm

Hi, ... Putting "const" at the start of the array decleration forces the data into ROM (eg .const unsigned short int) to swap data between ram and rom (eg....
Andrew Crowe
andrew_crowe
Offline Send Email
Apr 2, 2002
2:37 pm

Thanks - this is exactly the information I was looking for. A few follow-up questions: (1) If it's in ROM, I understand there are variable speeds for...
Jeremy Finney
jfinney@...
Send Email
Apr 4, 2002
8:16 am

Shortly... ... different ... data is in? You can control gamepack memory access speed modifying WAITCNT register, please check message # 10397. ... ROM? There...
gabriele_scibilia
gabriele_sci...
Offline Send Email
Apr 4, 2002
12:11 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help