Another load of cleanups.
Also, all filename handling is now Unicode. Fixes for many items on the bugs list. New logo and main icon for the project.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Driver for the ESDI controller (WD1007-vse1) for PC/AT.
|
||||
*
|
||||
* Version: @(#)hdc_esdi_at.c 1.0.4 2018/03/27
|
||||
* Version: @(#)hdc_esdi_at.c 1.0.5 2018/03/31
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
|
||||
#define HDC_TIME (TIMER_USEC*10LL)
|
||||
#define ESDI_BIOS_FILE L"roms/hdd/esdi_at/62-000279-061.bin"
|
||||
#define ESDI_BIOS_FILE L"hdd/esdi_at/62-000279-061.bin"
|
||||
|
||||
#define STAT_ERR 0x01
|
||||
#define STAT_INDEX 0x02
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* however, are auto-configured by the system software as
|
||||
* shown above.
|
||||
*
|
||||
* Version: @(#)hdc_esdi_mca.c 1.0.3 2018/03/27
|
||||
* Version: @(#)hdc_esdi_mca.c 1.0.4 2018/03/31
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||
@@ -102,8 +102,8 @@
|
||||
#define ESDI_IOADDR_SEC 0x3518
|
||||
#define ESDI_IRQCHAN 14
|
||||
|
||||
#define BIOS_FILE_L L"roms/hdd/esdi/90x8969.bin"
|
||||
#define BIOS_FILE_H L"roms/hdd/esdi/90x8970.bin"
|
||||
#define BIOS_FILE_L L"hdd/esdi/90x8969.bin"
|
||||
#define BIOS_FILE_H L"hdd/esdi/90x8970.bin"
|
||||
|
||||
|
||||
#define ESDI_TIME (200LL*TIMER_USEC)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@
|
||||
* already on their way out, the newer IDE standard based on the
|
||||
* PC/AT controller and 16b design became the IDE we now know.
|
||||
*
|
||||
* Version: @(#)hdc_xtide.c 1.0.3 2018/03/15
|
||||
* Version: @(#)hdc_xtide.c 1.0.4 2018/03/31
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -61,10 +61,10 @@
|
||||
#include "hdc_ide.h"
|
||||
|
||||
|
||||
#define ROM_PATH_XT L"roms/hdd/xtide/ide_xt.bin"
|
||||
#define ROM_PATH_AT L"roms/hdd/xtide/ide_at.bin"
|
||||
#define ROM_PATH_PS2 L"roms/hdd/xtide/side1v12.bin"
|
||||
#define ROM_PATH_PS2AT L"roms/hdd/xtide/ide_at_1_1_5.bin"
|
||||
#define ROM_PATH_XT L"hdd/xtide/ide_xt.bin"
|
||||
#define ROM_PATH_AT L"hdd/xtide/ide_at.bin"
|
||||
#define ROM_PATH_PS2 L"hdd/xtide/side1v12.bin"
|
||||
#define ROM_PATH_PS2AT L"hdd/xtide/ide_at_1_1_5.bin"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Definitions for the hard disk image handler.
|
||||
*
|
||||
* Version: @(#)hdd.h 1.0.1 2018/02/14
|
||||
* Version: @(#)hdd.h 1.0.3 2018/03/31
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -55,6 +55,13 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
/* Define a hard disk table entry. */
|
||||
typedef struct {
|
||||
uint16_t cyls;
|
||||
uint8_t head;
|
||||
uint8_t sect;
|
||||
} hddtab_t;
|
||||
|
||||
/* Define the virtual Hard Disk. */
|
||||
typedef struct {
|
||||
int8_t is_hdi; /* image type (should rename) */
|
||||
@@ -71,11 +78,11 @@ typedef struct {
|
||||
|
||||
uint32_t base;
|
||||
|
||||
uint64_t spt,
|
||||
hpc, /* physical geometry parameters */
|
||||
tracks;
|
||||
uint8_t spt, /* physical geometry parameters */
|
||||
hpc;
|
||||
uint16_t tracks;
|
||||
|
||||
uint64_t at_spt, /* [Translation] parameters */
|
||||
uint8_t at_spt, /* [Translation] parameters */
|
||||
at_hpc;
|
||||
|
||||
FILE *f; /* current file handle to image */
|
||||
@@ -86,7 +93,7 @@ typedef struct {
|
||||
|
||||
|
||||
extern hard_disk_t hdd[HDD_NUM];
|
||||
extern uint64_t hdd_table[128][3];
|
||||
extern const hddtab_t hdd_table[128];
|
||||
|
||||
|
||||
extern int hdd_init(void);
|
||||
@@ -104,7 +111,7 @@ extern void hdd_image_zero(uint8_t id, uint32_t sector, uint32_t count);
|
||||
extern int hdd_image_zero_ex(uint8_t id, uint32_t sector, uint32_t count);
|
||||
extern uint32_t hdd_image_get_last_sector(uint8_t id);
|
||||
extern uint8_t hdd_image_get_type(uint8_t id);
|
||||
extern void hdd_image_specify(uint8_t id, uint64_t hpc, uint64_t spt);
|
||||
extern void hdd_image_specify(uint8_t id, int hpc, int spt);
|
||||
extern void hdd_image_unload(uint8_t id, int fn_preserve);
|
||||
extern void hdd_image_close(uint8_t id);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Handling of hard disk image files.
|
||||
*
|
||||
* Version: @(#)hdd_image.c 1.0.2 2018/03/27
|
||||
* Version: @(#)hdd_image.c 1.0.3 2018/03/31
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -144,10 +144,9 @@ int hdd_image_load(int id)
|
||||
uint32_t sector_size = 512;
|
||||
uint32_t zero = 0;
|
||||
uint64_t signature = 0xD778A82044445459ll;
|
||||
uint64_t full_size = 0;
|
||||
uint64_t spt = 0, hpc = 0, tracks = 0;
|
||||
int c;
|
||||
uint64_t i = 0, s = 0, t = 0;
|
||||
uint64_t s = 0, t, full_size = 0;
|
||||
int spt = 0, hpc = 0, tracks = 0;
|
||||
int c, i;
|
||||
wchar_t *fn = hdd[id].fn;
|
||||
int is_hdx[2] = { 0, 0 };
|
||||
|
||||
@@ -260,9 +259,9 @@ int hdd_image_load(int id)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
hdd[id].spt = spt;
|
||||
hdd[id].hpc = hpc;
|
||||
hdd[id].tracks = tracks;
|
||||
hdd[id].spt = (uint8_t)spt;
|
||||
hdd[id].hpc = (uint8_t)hpc;
|
||||
hdd[id].tracks = (uint16_t)tracks;
|
||||
hdd_images[id].type = 1;
|
||||
} else if (is_hdx[1]) {
|
||||
hdd_images[id].base = 0x28;
|
||||
@@ -290,9 +289,9 @@ int hdd_image_load(int id)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
hdd[id].spt = spt;
|
||||
hdd[id].hpc = hpc;
|
||||
hdd[id].tracks = tracks;
|
||||
hdd[id].spt = (uint8_t)spt;
|
||||
hdd[id].hpc = (uint8_t)hpc;
|
||||
hdd[id].tracks = (uint16_t)tracks;
|
||||
fread(&(hdd[id].at_spt), 1, 4, hdd_images[id].file);
|
||||
fread(&(hdd[id].at_hpc), 1, 4, hdd_images[id].file);
|
||||
hdd_images[id].type = 2;
|
||||
@@ -435,11 +434,11 @@ uint8_t hdd_image_get_type(uint8_t id)
|
||||
return hdd_images[id].type;
|
||||
}
|
||||
|
||||
void hdd_image_specify(uint8_t id, uint64_t hpc, uint64_t spt)
|
||||
void hdd_image_specify(uint8_t id, int hpc, int spt)
|
||||
{
|
||||
if (hdd_images[id].type == 2) {
|
||||
hdd[id].at_hpc = hpc;
|
||||
hdd[id].at_spt = spt;
|
||||
hdd[id].at_hpc = (uint8_t)hpc;
|
||||
hdd[id].at_spt = (uint8_t)spt;
|
||||
fseeko64(hdd_images[id].file, 0x20, SEEK_SET);
|
||||
fwrite(&(hdd[id].at_spt), 1, 4, hdd_images[id].file);
|
||||
fwrite(&(hdd[id].at_hpc), 1, 4, hdd_images[id].file);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Define the available hard disk types.
|
||||
*
|
||||
* Version: @(#)hdd_table.c 1.0.1 2018/02/14
|
||||
* Version: @(#)hdd_table.c 1.0.2 2018/03/29
|
||||
*
|
||||
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "hdd.h"
|
||||
|
||||
|
||||
uint64_t hdd_table[128][3] = {
|
||||
const hddtab_t hdd_table[128] = {
|
||||
{ 306, 4, 17 }, /* 0 - 7 */
|
||||
{ 615, 2, 17 },
|
||||
{ 306, 4, 26 },
|
||||
|
||||
Reference in New Issue
Block a user