10 July 2017, 11:08 | #1 |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
|
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. :-) |
10 July 2017, 14:47 | #2 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
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. |
10 July 2017, 15:38 | #3 |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
|
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. |
10 July 2017, 15:42 | #4 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,754
|
Quote:
http://amigadev.elowar.com/read/ADCD.../node04DA.html |
|
10 July 2017, 15:47 | #5 |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
|
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.
|
10 July 2017, 16:20 | #6 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,754
|
Quote:
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). 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). |
|
10 July 2017, 16:21 | #7 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
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.
|
10 July 2017, 17:05 | #8 | |
Registered User
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
|
Quote:
@StingRay: Sounds great, can´t wait! |
|
10 July 2017, 18:47 | #9 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Ah, CD32 support. Good
Thread moved to System which is the best place I feel |
19 July 2017, 14:06 | #10 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
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.
|
20 July 2017, 10:11 | #11 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,542
|
May be too late, but for what it's worth Gloom saves to CD32 NVRAM
https://github.com/earok/GloomAmiga/blob/master/gloom.s |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
memory access speed question | Lord Riton | Coders. General | 42 | 27 February 2019 14:26 |
68040 memory access | phx | Coders. Asm / Hardware | 4 | 10 June 2017 18:32 |
Break on Memory Access? | Khyron | support.WinUAE | 3 | 21 August 2010 00:10 |
access emulated memory | ara | support.WinUAE | 6 | 03 April 2010 13:05 |
[68000 ASM] Move memory to memory | AmigaBoy | Coders. General | 7 | 08 December 2009 08:16 |
|
|