mirror of
https://github.com/ksherlock/profuse.git
synced 2025-01-10 23:29:42 +00:00
1b6a7fab18
git-svn-id: https://profuse.googlecode.com/svn/trunk@12 aa027e90-d47c-11dd-86d7-074df07e0730
39 lines
683 B
C++
39 lines
683 B
C++
/*
|
|
* DiskCopy42.cpp
|
|
* profuse
|
|
*
|
|
* Created by Kelvin Sherlock on 1/4/09.
|
|
*
|
|
*/
|
|
|
|
#include "DiskCopy42.h"
|
|
#include "common.h"
|
|
#include <string.h>
|
|
|
|
|
|
|
|
bool DiskCopy42::Load(const uint8_t *buffer)
|
|
{
|
|
unsigned i;
|
|
|
|
i = buffer[0];
|
|
if (i >= 64) return false;
|
|
|
|
memcpy(disk_name, &buffer[1], i);
|
|
disk_name[i] = 0;
|
|
|
|
|
|
data_size = load32_be(&buffer[64]);
|
|
tag_size = load32_be(&buffer[68]);
|
|
|
|
data_checksum = load32_be(&buffer[72]);
|
|
tag_checksum = load32_be(&buffer[76]);
|
|
|
|
disk_format = buffer[80];
|
|
format_byte = buffer[81];
|
|
private_word = load16_be(&buffer[82]);
|
|
|
|
if (private_word != 0x100) return false;
|
|
|
|
return true;
|
|
} |