English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. System (https://eab.abime.net/forumdisplay.php?f=113)
-   -   How to access nonvolatile memory in asm? (https://eab.abime.net/showthread.php?t=87856)

buzzybee 10 July 2017 11:08

How to access nonvolatile memory in asm?
 
Hi guys!

I´d love to implement highscore save code in my forthcoming game RESHOOT R. Wonder if anyone wants to share code on how to use the Nonvolatile library in asm. :-)

Photon 10 July 2017 14:47

If you specify where you want the highscores to be saved, I can determine if this stays in Hardware or is moved to System. :)

If the game is started from AmigaDOS/Workbench, saving a file with dos.library should be the way to go.

If the game runs from floppy, you can reserve a sector or two and write it with hardware routines or trackdisk.device.

buzzybee 10 July 2017 15:38

RESHOOT R is supposed to run on a CD32, A1200 or A4000 with Kick >3.0. It´s booting from CD-ROM, but can also be run from the Workbench, just like RESHOOT.

I prefer to use the nonvolatile-library, as its said to automatically choose the CD32s builtin 1 KB memory if available; and on A1200/4000 a path to whatever the user has defined to be his nonvolatile memory, be it harddrive or floppy disk. Therefore I wouldn´t need any sophisticated trackdisk trickery.

Thorham 10 July 2017 15:42

Quote:

Originally Posted by buzzybee (Post 1170375)
Wonder if anyone wants to share code on how to use the Nonvolatile library in asm. :-)

I assume you've looked at the documentation?

http://amigadev.elowar.com/read/ADCD.../node04DA.html

buzzybee 10 July 2017 15:47

Yes, but still a tested example of working code would be nice :-) I´m always having a hard time when I´m supposed to work with Amigas OS-routines. Documentation doesn´t look complete to me, too. Have no idea about the precise format of the parameters, for example, and don´t want to spend too much time on experimentation. Got plenty of other things to fix in order to make the demo ready for the gamescom show end of August inc Cologne.

Thorham 10 July 2017 16:20

Quote:

Originally Posted by buzzybee (Post 1170413)
I´m always having a hard time when I´m supposed to work with Amigas OS-routines.

That's something you may want to look into in the future. I did exactly that years ago, and haven't regretted it.

Quote:

Originally Posted by buzzybee (Post 1170413)
Documentation doesn´t look complete to me

The AOS autodocs can seem way too concise, and they can require you to look at include files, but it should be all there (even if they are a pain sometimes).

Quote:

Originally Posted by buzzybee (Post 1170413)
don´t want to spend too much time on experimentation. Got plenty of other things to fix in order to make the demo ready for the gamescom show end of August inc Cologne.

Good point. If nothing comes of this thread (which I somehow doubt), then you could just leave saving out of the demo version. For a shoot'm up this is one of the least important things (or so it seems).

StingRay 10 July 2017 16:21

Some years ago I coded a CD32 patch for Tubular Worlds which also included saving scores to NVRAM. I'll see if I can find the source somewhere. :)

buzzybee 10 July 2017 17:05

Quote:

Originally Posted by Thorham (Post 1170418)
Good point. If nothing comes of this thread (which I somehow doubt), then you could just leave saving out of the demo version. For a shoot'm up this is one of the least important things (or so it seems).

That´s a plan. Still I´d prefer to show people the save-feature instead of just talking about it :-)

@StingRay: Sounds great, can´t wait!

Photon 10 July 2017 18:47

Ah, CD32 support. Good :)

Thread moved to System which is the best place I feel :)

StingRay 19 July 2017 14:06

1 Attachment(s)
Quote:

Originally Posted by buzzybee (Post 1170429)
@StingRay: Sounds great, can´t wait!

Well, I couldn't find my original source anymore so I ended up disassembling my very own patch. :) Source is attached, interesting for you are the Load/SaveHighscores routines which should be pretty self-explanatory. In case of questions don't hesitate to ask.

earok 20 July 2017 10:11

May be too late, but for what it's worth Gloom saves to CD32 NVRAM

https://github.com/earok/GloomAmiga/blob/master/gloom.s


All times are GMT +2. The time now is 10:58.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.08399 seconds with 11 queries