Jump to content
IGNORED

How much code do you keep in memory?


karri

Recommended Posts

Hi programmers,

 

While writing Startdreamer I have stumbled on a fairly fundamental design issue.

 

Most levels need the same resources over and over again. Is it smarter to:

 

1) load cart loader, display control, sound engine and comlynx support in a fixed area in RAM at initial load time.

 

2) load only the cart loader in RAM and let every level deal with all the things by itself.

 

How did the old Atari-programmers deal with this in their code?

 

I thought of setting up a small block of jmp-commands at $100 to access my shared resources between levels. Like:

org $100

jmp execute_file_from_cart

jmp play_sound

jmp send_message

jmp read_message

+ some IRQ routines like VBL

 

--

Regards,

 

Karri

Link to comment
Share on other sites

My answer is going to be vague: it depends on what kind of game you're doing and how you organize your data.

 

Most puzzle-style games like Chip's Challenge probably keep the same core engine in RAM, then load individual levels as needed into a fixed level buffer in RAM.

 

Remnant ended up almost entirely fitting in RAM, except for some intro pictures when you boot up the cart. I had thought about loading individual enemies (graphics and code) only when I needed, this would have made the Remnant engine more flexible for the sequel which I've never had time to complete.

 

If you need to be able to do things like play music while loading data/code from cart ROM, then you probably need to keep extra stuff in RAM to maintain the audio, etc. If each piece of your game is more or less self-contained, then it's OK to let each piece do its own RAM loading of basic functions.

 

If you look at a game like Wolf 3D or Doom, what you see is very good separation of data and code. You can take the same compiled game binary, and run any number of WAD files which contain audio data, graphical data, etc. This is an excellent model for level-based games, whether Mario-style platformers or 3D space combat or Bomberman clones.

Link to comment
Share on other sites

Hello Karri!

 

Hi programmers,

 

While writing Startdreamer I have stumbled on a fairly fundamental design issue.

 

Most levels need the same resources over and over again. Is it smarter to:

 

1) load cart loader, display control, sound engine and comlynx support in a fixed area in RAM at initial load time.

 

2) load only the cart loader in RAM and let every level deal with all the things by itself.

 

In "MarbleMadness" i used method 1) and i intented the same for "The Dungeon".

 

Wouldn't say i did this because it is smarter, it was just possible to keep all parts of the engine in RAM for all levels. Probably because the projects didn't come to the point were using specialized code was necessary.

 

Matthias

Link to comment
Share on other sites

Hi programmers,

 

While writing Startdreamer I have stumbled on a fairly fundamental design issue.

 

Most levels need the same resources over and over again. Is it smarter to:

 

1) load cart loader, display control, sound engine and comlynx support in a fixed area in RAM at initial load time.

 

2) load only the cart loader in RAM and let every level deal with all the things by itself.

 

Hi Karri!

 

I wrote some code last weekend, which is doing exactly what you want:

Library stuff/variables/MOD and player/loader/depacker are kept in RAM, different code/data is loaded and depacked while playing MOD music.

(Bastian gave me some basic ideas during our meeting last year.)

 

Con: BLL ASM only @tm.

 

PS: eil.atari.org -> Results -> Intros -> 2. place

 

Tschau,

Sage

Link to comment
Share on other sites

I've used reloading level only. For Champ. Rally I created an editor on PC that created the level data file (included color palette, sprite map, images etc.). Then I concatentated all levels into 1 file for the .mak file.

 

The cartridge size isn't big so best to only reload what's different.

 

For the 3d project I've made everything reloadable including the action functions. Best to plan fixed memory block usage at start since often you'll run out and you won't notice until game crashes :-(.

Link to comment
Share on other sites

Hello everybody !!!

 

I've started my project (called VV2) of Lynx game... (I want to thanks Matthias for his technical help for my first steps in lynx development)

 

I just want to say that i had to choose another solution (none of yours was applicable):

 

Each world (level) sizes something like 92ko. The ram is 64ko, no more, so i must load little parts while playing... it slows a little the game, but the final result should be very intersting : a 3D combat game (M.K. IV like) with 256 colours...

 

If you want more info contact me : vince_marchand@yahoo.fr

or go there : http://www.yaronet.com/posts.php?s=21829

 

Have fun !

Link to comment
Share on other sites

The main reason most lynx games don't load pieces during gameplay is to save battery. But there are some exceptions and it depends on how often you load. I also have no idea how much battery it costs.

 

Can the lynx handle 256 colors with 3D and cartridge load at a reasonable speed? If I use horizontal hardware interrupts to change color I lose at least 2 fps. So I never found it practical for games unless you split palettes horizontal (like shadow of the beast).

Link to comment
Share on other sites

note : it's precalculated 3D

 

360° (look around in the world) with a step of 1° takes me 11sec in 256 colors...

 

to give you a better idea, my 3D engine is between MK IV and Myst (a sort of panoramic display of 3D worlds...)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...