mirror of
https://github.com/vivier/EMILE.git
synced 2025-04-08 04:39:14 +00:00
use bytes instead of block
This commit is contained in:
parent
6c9d87a9dc
commit
00c1bbf35a
@ -14,5 +14,5 @@
|
||||
|
||||
int map_bootblock_read(map_t* map, char* bootblock)
|
||||
{
|
||||
return map_partition_read(map, 0, BOOTBLOCK_SIZE / FLOPPY_SECTOR_SIZE, bootblock);
|
||||
return map_partition_read(map, 0, BOOTBLOCK_SIZE, bootblock);
|
||||
}
|
||||
|
@ -14,5 +14,5 @@
|
||||
|
||||
int map_bootblock_write(map_t* map, char* bootblock)
|
||||
{
|
||||
return map_partition_write(map, 0, BOOTBLOCK_SIZE / FLOPPY_SECTOR_SIZE, bootblock);
|
||||
return map_partition_write(map, 0, BOOTBLOCK_SIZE, bootblock);
|
||||
}
|
||||
|
@ -12,20 +12,17 @@
|
||||
|
||||
#include "libmap.h"
|
||||
|
||||
int map_partition_read(map_t* map, off_t block, size_t nb, char* sector)
|
||||
int map_partition_read(map_t* map, off_t offset, size_t size, char* sector)
|
||||
{
|
||||
off_t offset;
|
||||
int ret;
|
||||
|
||||
if (!map_partition_is_valid(map))
|
||||
return -1;
|
||||
|
||||
offset = read_long((u_int32_t*)&map->partition.PyPartStart + block)
|
||||
offset += read_long((u_int32_t*)&map->partition.PyPartStart)
|
||||
* FLOPPY_SECTOR_SIZE;
|
||||
|
||||
ret = map->device->read_sector(map->device,
|
||||
offset, sector,
|
||||
nb * FLOPPY_SECTOR_SIZE);
|
||||
ret = map->device->read_sector(map->device, offset, sector, size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -12,20 +12,17 @@
|
||||
|
||||
#include "libmap.h"
|
||||
|
||||
int map_partition_write(map_t* map, off_t block, size_t nb, char* sector)
|
||||
int map_partition_write(map_t* map, off_t offset, size_t size, char* sector)
|
||||
{
|
||||
off_t offset;
|
||||
int ret;
|
||||
|
||||
if (!map_partition_is_valid(map))
|
||||
return -1;
|
||||
|
||||
offset = read_long((u_int32_t*)&map->partition.PyPartStart + block)
|
||||
offset += read_long((u_int32_t*)&map->partition.PyPartStart)
|
||||
* FLOPPY_SECTOR_SIZE;
|
||||
|
||||
ret = map->device->write_sector(map->device,
|
||||
offset, sector,
|
||||
nb * FLOPPY_SECTOR_SIZE);
|
||||
ret = map->device->write_sector(map->device, offset, sector, size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user