Author Topic: Extract data from SNApshot  (Read 541 times)

0 Members and 1 Guest are viewing this topic.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.324
  • Country: fr
  • Liked: 1245
  • Likes Given: 187
Extract data from SNApshot
« 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!
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.767
  • Country: gb
    • redbox
  • Liked: 369
  • Likes Given: 273
Re: Extract data from SNApshot
« Reply #1 on: 22:09, 10 February 21 »
A SNApshot is just the binary data plus a header:

https://cpctech.cpc-live.com/docs/snapshot.html

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 1.027
  • Country: fr
    • urban exploration
  • Liked: 1396
  • Likes Given: 830
Re: Extract data from SNApshot
« Reply #2 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...
use RASM, the best assembler ever made :p

I will survive

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.324
  • Country: fr
  • Liked: 1245
  • Likes Given: 187
Re: Extract data from SNApshot
« Reply #3 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.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.767
  • Country: gb
    • redbox
  • Liked: 369
  • Likes Given: 273
Re: Extract data from SNApshot
« Reply #4 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.


Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.324
  • Country: fr
  • Liked: 1245
  • Likes Given: 187
Re: Extract data from SNApshot
« Reply #5 on: 10:21, 11 February 21 »
You could do it in Python
My thoughts exactly :). Such a great language.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 1.027
  • Country: fr
    • urban exploration
  • Liked: 1396
  • Likes Given: 830
Re: Extract data from SNApshot
« Reply #6 on: 16:40, 11 February 21 »

last version of snapshot contains crunched chunks so that's not that easy
use RASM, the best assembler ever made :p

I will survive

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.324
  • Country: fr
  • Liked: 1245
  • Likes Given: 187
Re: Extract data from SNApshot
« Reply #7 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.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.767
  • Country: gb
    • redbox
  • Liked: 369
  • Likes Given: 273
Re: Extract data from SNApshot
« Reply #8 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?

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.324
  • Country: fr
  • Liked: 1245
  • Likes Given: 187
Re: Extract data from SNApshot
« Reply #9 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.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.767
  • Country: gb
    • redbox
  • Liked: 369
  • Likes Given: 273
Re: Extract data from SNApshot
« Reply #10 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?

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.324
  • Country: fr
  • Liked: 1245
  • Likes Given: 187
Re: Extract data from SNApshot
« Reply #11 on: 19:20, 11 February 21 »
Do you have a link to this please
It's inside AT2 itself. Tools > YM Analyzer.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime