mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
Fix IDE table indexing when same controller is configured more than once and controller has more than 1 IDE channels.
This commit is contained in:
parent
1b00bba9c6
commit
0b7ff383b8
@ -1281,8 +1281,8 @@ static bool add_ide_unit(int type, int unit, struct uaedev_config_info *uci)
|
||||
cpuboard_hd = 1;
|
||||
if (ert->add) {
|
||||
struct romconfig *rc = get_device_romconfig(&currprefs, ert->romtype, uci->controller_type_unit);
|
||||
write_log(_T("Adding IDE %s '%s' unit %d ('%s')\n"), getunittype(uci),
|
||||
ert->name, unit, uci->rootdir);
|
||||
write_log(_T("Adding IDE %s '%s' unit %d, controller %d ('%s')\n"), getunittype(uci),
|
||||
ert->name, unit, uci->controller_type_unit, uci->rootdir);
|
||||
ert->add(unit, uci, rc);
|
||||
if ((ert->romtype & ROMTYPE_MASK) == ROMTYPE_MB_IDE) {
|
||||
gayle_ide_in_use = true;
|
||||
|
||||
@ -121,8 +121,8 @@ static struct ide_board *accessx_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
static struct ide_board *ivst500at_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
static struct ide_board *trifecta_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
static struct ide_board *tandem_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
static struct ide_board* dotto_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
static struct ide_board* dev_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
static struct ide_board *dotto_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
static struct ide_board *dev_board[MAX_DUPLICATE_EXPANSION_BOARDS];
|
||||
|
||||
static struct ide_hdf *idecontroller_drive[TOTAL_IDE * 2];
|
||||
static struct ide_thread_state idecontroller_its;
|
||||
@ -211,6 +211,8 @@ static void add_ide_standard_unit(int ch, struct uaedev_config_info *ci, struct
|
||||
{
|
||||
struct ide_hdf *ide;
|
||||
struct ide_board *ideb;
|
||||
int maxch = maxunit / 2;
|
||||
int idetypenum = idetype + maxch * ci->controller_type_unit;
|
||||
if (ch >= maxunit)
|
||||
return;
|
||||
ideb = allocide(&ideboard[ci->controller_type_unit], rc, ch);
|
||||
@ -218,8 +220,8 @@ static void add_ide_standard_unit(int ch, struct uaedev_config_info *ci, struct
|
||||
return;
|
||||
ideb->keepautoconfig = true;
|
||||
ideb->type = idetype;
|
||||
ide = add_ide_unit (&idecontroller_drive[(idetype + ci->controller_type_unit) * 2], 2, ch, ci, rc);
|
||||
init_ide(ideb, idetype + ci->controller_type_unit, maxunit, byteswap, adide);
|
||||
ide = add_ide_unit (&idecontroller_drive[idetypenum * 2], maxunit, ch, ci, rc);
|
||||
init_ide(ideb, idetypenum, maxunit, byteswap, adide);
|
||||
}
|
||||
|
||||
static bool ide_interrupt_check(struct ide_board *board, bool edge_triggered)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user