forked from tonioni/WinUAE
-
Notifications
You must be signed in to change notification settings - Fork 1
/
adide.cpp
37 lines (32 loc) · 1000 Bytes
/
adide.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* UAE - The Un*x Amiga Emulator
*
* ADIDE
*
* (c) 2009 Toni Wilen
*/
#include "sysconfig.h"
#include "sysdeps.h"
#include "options.h"
#include "gayle.h"
static struct ide_hdf *idedrive[2];
int adide_add_ide_unit (int ch, TCHAR *path, int blocksize, int readonly,
TCHAR *devname, int sectors, int surfaces, int reserved,
int bootpri, TCHAR *filesys)
{
struct ide_hdf *ide;
if (ch >= 2)
return -1;
alloc_ide_mem ();
ide = idedrive[ch];
if (!hdf_hd_open (&ide->hdhfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys))
return -1;
ide->lba48 = ide->hdhfd.size >= 128 * (uae_u64)0x40000000 ? 1 : 0;
write_log (_T("IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n"),
ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack, (int)(ide->hdhfd.size / (1024 * 1024)), ide->lba48);
ide->status = 0;
ide->data_offset = 0;
ide->data_size = 0;
//dumphdf (&ide->hdhfd.hfd);
return 1;
}