English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 10 July 2017, 12:08   #1
buzzybee
Registered User

 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 126
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  
AdSense AdSense  
Old 10 July 2017, 15:47   #2
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,465
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, 16:38   #3
buzzybee
Registered User

 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 126
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, 16:42   #4
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 41
Posts: 2,974
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, 16:47   #5
buzzybee
Registered User

 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 126
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, 17:20   #6
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 41
Posts: 2,974
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, 17:21   #7
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 5,678
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, 18:05   #8
buzzybee
Registered User

 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 126
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, 19:47   #9
Photon
Moderator
Photon's Avatar
 
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,465
Ah, CD32 support. Good

Thread moved to System which is the best place I feel
Photon is offline  
Old 19 July 2017, 15:06   #10
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 5,678
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, 49 views)
StingRay is offline  
Old 20 July 2017, 11:11   #11
earok
Registered User

 
Join Date: Dec 2013
Location: Auckland
Posts: 1,584
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  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
68040 memory access phx Coders. Asm / Hardware 4 10 June 2017 19:32
memory access speed question Lord Riton Coders. General 40 09 April 2011 04:18
Break on Memory Access? Khyron support.WinUAE 3 21 August 2010 01:10
access emulated memory ara support.WinUAE 6 03 April 2010 14:05
[68000 ASM] Move memory to memory AmigaBoy Coders. General 7 08 December 2009 09: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 07:17.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Page generated in 0.16187 seconds with 14 queries