English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 05 May 2021, 17:01   #1
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Hiscore name packing...Save the CD32's NVRAM!

I came up against this before and put it on the back burner, basically I'm after the fastest (time to develop or acquire) a packer/unpacker that will crunch a hiscore table.

The table is structured simply like this:

Code:
RECORD_TABLE:	rept	MAX_LEVELS		
		dc.b	"LEO",$ff		; 0 = level number, only anything >0 is saved = 0 is default in game.
		dc.w	0                      ; record lap time
		dc.w	0                      ; record track time
		endr
There are 32 levels... so that is 32*8 = 256 bytes which needs 26 NVRAM blocks..

In CD32 terms this means that is a quarter of the NVRAM.

In terms of the data, there's only 37 combinations in the name (A-Z 0-9 <SPACE CHAR> )
In the record lap and track times, these are frame ticks... so they probably won't go above 10 bits each.

Are there any simple packers I can use to pack the table down, or am I looking at rolling my own (which will be a pain in the arse)? Or should this be the latest coding challenge to reduce it as much as possible. wink wink

Cheers,
Geezer
mcgeezer is offline  
Old 05 May 2021, 17:17   #2
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
First thing I'd try is using one of the available crunchers (such as CrunchMania) to see how much they crunch that kind of data. If crunching ratio is good enough, only thing needed is adding the decruncher code. Decrunching should be done very quick as the file isn't large.

If crunching ratio is not good, one can still think of alternative solutions.
StingRay is offline  
Old 05 May 2021, 18:00   #3
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
I wouldn't actually use a packer to pack it, as you just can't guarantee the entropy of that kind of data.

It's probably worth just trying to store the data as a bit stream in as few bits as possible
DanScott is offline  
Old 05 May 2021, 18:15   #4
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,174
as Dan said. Encode/decode the data as a bitstream with only used bits. Easy with masks & shifts (as you already know).

Then try to pack it using any available packer, and if the size is smaller, use the packed version else use the unpacked version.

(if you have only one player and the name is the same, the packing will save data )
jotd 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
CD32 NVRAM redirect BigMacDaddy New to Emulation or Amiga scene 17 17 March 2021 21:18
Extend CD32 NVRAM? Amiga1992 Hardware mods 41 16 December 2018 14:59
CD32 NVRAM management Amiga1992 support.Hardware 9 20 February 2012 13:27
CD32 nvram file...? Christian support.WinUAE 11 13 December 2006 22:25
Cd32 Nvram Phantomz request.Apps 5 16 March 2003 21:09

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 19:58.

Top

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