English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 10 July 2017, 11:08   #1
buzzybee
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. :-)
buzzybee is offline  
Old 10 July 2017, 14:47   #2
Photon
Moderator
 
Photon's Avatar
 
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.
Photon is offline  
Old 10 July 2017, 15:38   #3
buzzybee
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.
buzzybee is offline  
Old 10 July 2017, 15:42   #4
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,754
Quote:
Originally Posted by buzzybee View Post
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
Thorham is offline  
Old 10 July 2017, 15:47   #5
buzzybee
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.
buzzybee is offline  
Old 10 July 2017, 16:20   #6
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,754
Quote:
Originally Posted by buzzybee View Post
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 View Post
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 View Post
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).
Thorham is offline  
Old 10 July 2017, 16:21   #7
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
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.
StingRay is offline  
Old 10 July 2017, 17:05   #8
buzzybee
Registered User
 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
Quote:
Originally Posted by Thorham View Post
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!
buzzybee is offline  
Old 10 July 2017, 18:47   #9
Photon
Moderator
 
Photon's Avatar
 
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
Photon is offline  
Old 19 July 2017, 14:06   #10
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by buzzybee View Post
@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.
Attached Files
File Type: s TubularWorldsPatch.s (5.7 KB, 125 views)
StingRay is offline  
Old 20 July 2017, 10:11   #11
earok
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
earok is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:54.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08686 seconds with 14 queries