CPCWiki forum

General Category => Programming => Topic started by: Targhan on 21:50, 10 February 21

Title: Extract data from SNApshot
Post by: Targhan on 21:50, 10 February 21
I don't want to reinvent the wheel: is there a command line tool (win+linux if possible) to extract the data from a SNApshot?
Something like:
snaExtract <input sna> <start> <length> output.bin ?

Thanks!
Title: Re: Extract data from SNApshot
Post by: redbox on 22:09, 10 February 21
A SNApshot is just the binary data plus a header:

https://cpctech.cpc-live.com/docs/snapshot.html
Title: Re: Extract data from SNApshot
Post by: roudoudou on 22:18, 10 February 21
I don't want to reinvent the wheel: is there a command line tool (win+linux if possible) to extract the data from a SNApshot?
Something like:
snaExtract <input sna> <start> <length> output.bin ?

Thanks!


Not yet but i planned an INCSNA directive...
Title: Re: Extract data from SNApshot
Post by: Targhan on 00:24, 11 February 21
A SNApshot is just the binary data plus a header:
Yes, I know that already. But it can be more subtle: there can be potential chunks after. Anyway, I just wanted to know if someone had a ready-made tool.
Title: Re: Extract data from SNApshot
Post by: redbox on 02:17, 11 February 21
Yes, I know that already. But it can be more subtle: there can be potential chunks after.

You could do it in Python to get the command line syntax you're after.

Code: [Select]
f = open('filename.sna', 'rb')
f.seek(255) # skip 255 bytes
rest = f.read() # read the rest

Python also has the bytes and bytearray manipulation built-in which would be useful.

Title: Re: Extract data from SNApshot
Post by: Targhan on 10:21, 11 February 21
You could do it in Python
My thoughts exactly :). Such a great language.
Title: Re: Extract data from SNApshot
Post by: roudoudou on 16:40, 11 February 21

last version of snapshot contains crunched chunks so that's not that easy
Title: Re: Extract data from SNApshot
Post by: Targhan on 17:52, 11 February 21
last version of snapshot contains crunched chunks so that's not that easy
But fortunately, I am generating them via Ramlaid's tool, and it does not compact the data.
Title: Re: Extract data from SNApshot
Post by: redbox on 18:13, 11 February 21
But fortunately, I am generating them via Ramlaid's tool, and it does not compact the data.

WinAPE also lets you choose if the data is compressed or uncompressed.

Targhan, is there any way of importing a YM dump into Arkos Tracker?
Title: Re: Extract data from SNApshot
Post by: Targhan on 18:55, 11 February 21
Targhan, is there any way of importing a YM dump into Arkos Tracker?

You should ask this in another thread :). No, it would be meaningless or too hard to convert to a real song. However, you can drag'n'drop it to the YM Analyzer and hack some sounds from it.
Title: Re: Extract data from SNApshot
Post by: redbox on 19:17, 11 February 21
However, you can drag'n'drop it to the YM Analyzer and hack some sounds from it.

Do you have a link to this please?
Title: Re: Extract data from SNApshot
Post by: Targhan on 19:20, 11 February 21
Do you have a link to this please
It's inside AT2 itself. Tools > YM Analyzer.