Splitting Assets from Code: Difference between revisions

Corrected a factual mistake regarding global variable initialization.
m (Clarified the use of buffer)
(Corrected a factual mistake regarding global variable initialization.)
 
Line 96:
The idea is, before you start rendering the level, you load any textures you need into your global cache (which can be any size you want, not just 4096 bytes). Then, when the data isn't needed anymore, you mark that part of the buffer as "empty" and you can overwrite it with new data.
 
You're probably wondering: "Hold on, this global buffer variable is part of the code... Won't it be subject to the exact same 1MB restriction we had before?". The answer is yesno, howeverbecause thisinitialized methodglobal ensuresvariables thatare onlynot theloaded datafrom youROM need(as they're dynamically "created" when your code loads). The downside to this method is loadedthat atyou amight timenot inalways thehave 1MBfull codecontrol segmentover (aswhere opposedthe todata everythingis beinginitialized there)to in memory. The alternative would be:
 
== Having a buffer somewhere in RAM ==