As much memory as possible
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
As much memory as possible
Hello Atari devs!
I'm developing a game for Atari 520 ST and I need as much memory as possible.
The game uses GemDos to access files.
When the game start it is not mandatory for me to return to the desktop.
On Atari ST, The RAM seems to start at $5B4 but a part of this memory is used by TOS (end of TOS RAM at $4FA).
I've heard that some developpers copy their code in $5B4 to save memory. But how to stop TOS to use this part of memory?
Is it possible to use GemDos in this condition?
I'm developing a game for Atari 520 ST and I need as much memory as possible.
The game uses GemDos to access files.
When the game start it is not mandatory for me to return to the desktop.
On Atari ST, The RAM seems to start at $5B4 but a part of this memory is used by TOS (end of TOS RAM at $4FA).
I've heard that some developpers copy their code in $5B4 to save memory. But how to stop TOS to use this part of memory?
Is it possible to use GemDos in this condition?
-
- Hardware Guru
- Posts: 2997
- Joined: Sat Sep 10, 2005 11:11 am
- Location: Kosice, Slovakia
- Contact:
Re: As much memory as possible
I'm not an expert in this area but I'd say you have to choose one: compatibility or purging the OS. :)
There is a few open source projects which offer an OS-independent way of managing files, assets, memory etc. Amiga Demo 2 by Leonard comes into my mind: http://leonard.oxg.free.fr/download/Ami ... ersion.zip.
Loading files seems to be pretty straighforward:
It should be fairly easy to replace the demo with your game and use the underlying manager for loading files.
There is a few open source projects which offer an OS-independent way of managing files, assets, memory etc. Amiga Demo 2 by Leonard comes into my mind: http://leonard.oxg.free.fr/download/Ami ... ersion.zip.
So that gives you about 492 KB of RAM (out of 512, not bad!).The user space is from $5000 to $80000 for 512Kb machine
Loading files seems to be pretty straighforward:
Code: Select all
lea $5000.w,a0 ; user space to load the file
moveq #2,d0
jsr $1000.w ; $1000 is Kernel adress
jmp $5000.w ; jump in the file
Re: As much memory as possible
https://freemint.github.io/tos.hyp/en/t ... ctors.html
Bus errors arise when one attempts to access regions of memory to which access is not permitted. In supervisor mode this really can be only nonexistent memory areas. In user mode this can also happen in attempting to access hardware registers or regions below $800.
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2834
- Joined: Sun Jul 31, 2011 1:11 pm
Re: As much memory as possible
Some instructive reading on how not to do things: https://raw.githubusercontent.com/emuto ... atible.txt
Re: As much memory as possible
Thank you for this information. Finally, I use a packer and a compression algorithm to minimize my memory footprint while respecting the OS 

Re: As much memory as possible
Does your game actually use GEM? Can you open files with TOS? I am not sure but I think you may have a little more memory if your game boots from disk (auto folder) before GEM loads. I may be wrong about this. Well it is def true if the user has ACCs and other "on boot" apps.
4Mb is a easy max memory you will get. You can also have "fast RAM" or "TT RAM" but I have no idea how one uses that. Is it STE or F?
4Mb is a easy max memory you will get. You can also have "fast RAM" or "TT RAM" but I have no idea how one uses that. Is it STE or F?
Falcon with CT60 in rack mountable case. Two STFMs, one upgraded lots. My original STE from when I was a teen with Switchable TOS, 1.44Mb drive, 4MB RAM, Supra Hard Drive and very very yellow case. Mega STE with (currently none working) Crazy Dots 2. Atari 2600 and a Jag. And a mountain of commercial software and lots of hardware addons.
-
- Fuji Shaped Bastard
- Posts: 2367
- Joined: Sun Aug 03, 2014 5:54 pm
Re: As much memory as possible
Don't know where you got those values from, but TOS uses much more memory. In TOS 1.04 for example usable memory starts at $A84E. The _membot system variable tells you the exact address.
I would say that this doesn't save memory at all. You would then maybe be able to start at a lower address, at the cost of additional code for the filesystem routines instead of using GEMDOS. GEMDOS of tos 1.4 takes about 24k of code.
Re: As much memory as possible
I have made the choice to get rid of the os and loads at $1000. The framework is a mix of asm and c without any standard lib. There is a tool to generate a floppy image with a resource management easy to use from the application. When loading from hd the application needs more memory. It preloads the disk image into additional memory and then the framework transparently copy from memory instead of loading at each load request. I don't think the loading code implementation takes more than 24kb as the whole demo code fits in less than 100kb (code + statics) and everything runs in 1mb.
https://github.com/jhubrt/demOS
https://github.com/jhubrt/demOS