From 8def9fa09808813e22625bb7e9924dd73db01b57 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 25 Sep 2016 11:54:31 +0300 Subject: [PATCH] Dataflyer options, v1.5 and v1.7 boot roms. --- expansion.cpp | 15 ++++++++++++-- idecontrollers.cpp | 50 +++++++++++++++++++++++++++++++--------------- include/scsi.h | 5 +++-- rommgr.cpp | 6 +++++- scsi.cpp | 4 ++-- 5 files changed, 57 insertions(+), 23 deletions(-) diff --git a/expansion.cpp b/expansion.cpp index b4a1d508..d4db4e11 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -4100,7 +4100,16 @@ static const struct expansionboardsettings a4091_settings[] = { NULL } }; - +static const struct expansionboardsettings dataflyersplus_settings[] = { + { + _T("Configuration\0") _T("SCSI+IDE\0") _T("SCSI\0") _T("IDE\0"), + _T("config\0") _T("scsiide") _T("scsi\0") _T("ide\0"), + true + }, + { + NULL + } +}; const struct expansionromtype expansionroms[] = { { @@ -4223,7 +4232,9 @@ const struct expansionromtype expansionroms[] = { _T("dataflyerplus"), _T("DataFlyer Plus"), _T("Expansion Systems"), dataflyerplus_init, NULL, dataflyerplus_add_idescsi_unit, ROMTYPE_DATAFLYER, 0, 0, BOARD_AUTOCONFIG_Z2, false, NULL, 0, - true, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_IDE + true, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_IDE, + 0, 0, 0, false, NULL, + false, 0, dataflyersplus_settings }, { _T("gvp1"), _T("GVP Series I"), _T("Great Valley Products"), diff --git a/idecontrollers.cpp b/idecontrollers.cpp index 4a7b4d1e..7448998b 100644 --- a/idecontrollers.cpp +++ b/idecontrollers.cpp @@ -705,12 +705,18 @@ static uae_u32 ide_read_byte(struct ide_board *board, uaecptr addr) v = board->rom[addr & board->rom_mask]; if (board->configured) { if (addr == 0x10) { - v = ide_irq_check(board->ide[0], false) ? 0x08 : 0x00; + if (board->subtype & 2) { + v = ide_irq_check(board->ide[0], false) ? 0x08 : 0x00; + } } else if (addr < 0x80) { - v = rochard_scsi_get(oaddr); + if (board->subtype & 1) { + v = idescsi_scsi_get(oaddr); + } else { + v = 0xff; + } } } - if (addr & 0x8000) { + if ((addr & 0x8000) && (board->subtype & 2)) { int regnum = get_dataflyerplus_reg(addr, board); if (regnum >= 0) v = get_ide_reg(board, regnum); @@ -725,7 +731,7 @@ static uae_u32 ide_read_byte(struct ide_board *board, uaecptr addr) v = get_ide_reg_multi(board, regnum, portnum, 1); } else if ((addr & 0x7c00) == 0x7000) { if (board->subtype) - v = rochard_scsi_get(oaddr); + v = idescsi_scsi_get(oaddr); else v = 0; } else { @@ -762,7 +768,7 @@ static uae_u32 ide_read_word(struct ide_board *board, uaecptr addr) } else if (board->type == DATAFLYERPLUS_IDE) { - if (!(addr & 0x8000)) { + if (!(addr & 0x8000) && (board->subtype & 2)) { if (board->rom) { v = board->rom[(addr + 0) & board->rom_mask]; v <<= 8; @@ -907,9 +913,13 @@ static uae_u32 ide_read_word(struct ide_board *board, uaecptr addr) } else if (board->type == DATAFLYERPLUS_IDE) { if (board->configured) { - int reg = get_dataflyerplus_reg(addr, board); - if (reg >= 0) - v = get_ide_reg_multi(board, reg, 0, 1); + if (board->subtype & 2) { + int reg = get_dataflyerplus_reg(addr, board); + if (reg >= 0) + v = get_ide_reg_multi(board, reg, 0, 1); + } else { + v = 0xff; + } } } else if (board->type == ROCHARD_IDE) { @@ -1069,11 +1079,15 @@ static void ide_write_byte(struct ide_board *board, uaecptr addr, uae_u8 v) if (board->configured) { if (addr & 0x8000) { - int regnum = get_dataflyerplus_reg(addr, board); - if (regnum >= 0) - put_ide_reg(board, regnum, v); + if (board->subtype & 2) { + int regnum = get_dataflyerplus_reg(addr, board); + if (regnum >= 0) + put_ide_reg(board, regnum, v); + } } else if (addr < 0x80) { - rochard_scsi_put(oaddr, v); + if (board->subtype & 1) { + idescsi_scsi_put(oaddr, v); + } } } @@ -1087,7 +1101,7 @@ static void ide_write_byte(struct ide_board *board, uaecptr addr, uae_u8 v) put_ide_reg_multi(board, regnum, v, portnum, 1); } else if ((addr & 0x7c00) == 0x7000) { if (board->subtype) - rochard_scsi_put(oaddr, v); + idescsi_scsi_put(oaddr, v); } } } @@ -1214,9 +1228,11 @@ static void ide_write_word(struct ide_board *board, uaecptr addr, uae_u16 v) } else if (board->type == DATAFLYERPLUS_IDE) { if (board->configured) { - int reg = get_dataflyerplus_reg(addr, board); - if (reg >= 0) - put_ide_reg_multi(board, reg, v, 0, 1); + if (board->subtype & 2) { + int reg = get_dataflyerplus_reg(addr, board); + if (reg >= 0) + put_ide_reg_multi(board, reg, v, 0, 1); + } } } else if (board->type == ROCHARD_IDE) { @@ -1874,6 +1890,8 @@ bool dataflyerplus_init(struct autoconfig_info *aci) ide->rom_size = rom_size; ide->mask = 65536 - 1; ide->keepautoconfig = false; + ide->subtype = ((aci->rc->device_settings & 3) <= 1) ? 1 : 0; // scsi + ide->subtype |= ((aci->rc->device_settings & 3) != 1) ? 2 : 0; // ide ide->rom_mask = ide->rom_size - 1; memcpy(ide->acmemory, ide->rom, sizeof ide->acmemory); diff --git a/include/scsi.h b/include/scsi.h index 554db5e1..37052973 100644 --- a/include/scsi.h +++ b/include/scsi.h @@ -206,8 +206,6 @@ void adscsi_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfi void rochard_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc); bool rochard_scsi_init(struct romconfig *rc, uaecptr baseaddress); -uae_u8 rochard_scsi_get(uaecptr addr); -void rochard_scsi_put(uaecptr addr, uae_u8 v); bool cltda1000scsi_init(struct autoconfig_info *aci); void cltda1000scsi_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc); @@ -260,6 +258,9 @@ void scram5380_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romco bool ossi_init(struct autoconfig_info*); void ossi_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfig *rc); +uae_u8 idescsi_scsi_get(uaecptr addr); +void idescsi_scsi_put(uaecptr addr, uae_u8 v); + void x86_xt_hd_bput(int, uae_u8); uae_u8 x86_xt_hd_bget(int); bool x86_xt_hd_init(struct autoconfig_info *aci); diff --git a/rommgr.cpp b/rommgr.cpp index c4504f78..b9ecd3f3 100644 --- a/rommgr.cpp +++ b/rommgr.cpp @@ -95,7 +95,7 @@ struct romdata *getromdatabypath (const TCHAR *path) return NULL; } -#define NEXT_ROM_ID 170 +#define NEXT_ROM_ID 172 #define ALTROM(id,grp,num,size,flags,crc32,a,b,c,d,e) \ { _T("X"), 0, 0, 0, 0, 0, size, id, 0, 0, flags, (grp << 16) | num, 0, NULL, crc32, a, b, c, d, e }, @@ -463,6 +463,10 @@ static struct romdata roms[] = { 0x1f672e4b, 0xb20d50b8, 0x31ec9823, 0xfa732fc6, 0x522ecc6a, 0xae36ec33, NULL, NULL }, { _T("IVS GramdSlam/Trumpcard Pro v4.9"), 4, 9, 4, 9, _T("IVSPRO\0"), 16384, 161, 0, 0, ROMTYPE_IVSTPRO, 0, 0, NULL, 0x4a15f224, 0x29500b47, 0x289e84ac, 0x575e3c7d, 0x82199b45, 0x605d8fc9, NULL, NULL }, + { _T("Expansion Systems Dataflyer+ v1.5"), 1, 5, 1, 5, _T("DATAFLYERPLUS\0"), 32768, 170, 0, 0, ROMTYPE_DATAFLYER, 0, 0, NULL, + 0x00888f19, 0x54b73354, 0xb3592691, 0x59a80909, 0x0bdb67df, 0x8ac22aa9, NULL, NULL }, + { _T("Expansion Systems Dataflyer+ v1.7"), 1, 7, 1, 7, _T("DATAFLYERPLUS\0"), 32768, 171, 0, 0, ROMTYPE_DATAFLYER, 0, 0, NULL, + 0xb0814aca, 0xb817672c, 0x1beb86c6, 0x840aa4bd, 0xf4640835, 0x1ed103f4, NULL, NULL }, { _T("Expansion Systems Dataflyer+ v2.1"), 2, 1, 2, 1, _T("DATAFLYERPLUS\0"), 32768, 169, 0, 0, ROMTYPE_DATAFLYER, 0, 0, NULL, 0xc49daa65, 0x20275716, 0xdc7eb00e, 0x5dc53680, 0xb5c8a90a, 0x7c00e390, NULL, NULL }, diff --git a/scsi.cpp b/scsi.cpp index b9b2a62a..8c089400 100644 --- a/scsi.cpp +++ b/scsi.cpp @@ -3604,12 +3604,12 @@ void rochard_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconf generic_soft_scsi_add(ch, ci, rc, NCR5380_ROCHARD, 65536, -1, ROMTYPE_ROCHARD); } -uae_u8 rochard_scsi_get(uaecptr addr) +uae_u8 idescsi_scsi_get(uaecptr addr) { return soft_generic_bget(addr); } -void rochard_scsi_put(uaecptr addr, uae_u8 v) +void idescsi_scsi_put(uaecptr addr, uae_u8 v) { soft_generic_bput(addr, v); } -- 2.47.3