Implemented the Chipset unlock mechanism properly for the ALi's
ALi M1217 & M1429 can be unlocked and locked back properly now.
This commit is contained in:
@@ -53,6 +53,7 @@ ali1217_log(const char *fmt, ...)
|
||||
typedef struct
|
||||
{
|
||||
uint8_t index, regs[256];
|
||||
int cfg_locked;
|
||||
} ali1217_t;
|
||||
|
||||
static void ali1217_shadow_recalc(ali1217_t *dev)
|
||||
@@ -65,7 +66,7 @@ static void ali1217_shadow_recalc(ali1217_t *dev)
|
||||
|
||||
shadowbios = !!(dev->regs[0x15] & 5);
|
||||
shadowbios_write = !!(dev->regs[0x15] & 0x0a);
|
||||
|
||||
|
||||
flushmmucache();
|
||||
}
|
||||
|
||||
@@ -80,15 +81,22 @@ ali1217_write(uint16_t addr, uint8_t val, void *priv)
|
||||
dev->index = val;
|
||||
break;
|
||||
case 0x23:
|
||||
ali1217_log("ALi M1217: dev->regs[%02x] = %02x\n", dev->index, val);
|
||||
dev->regs[dev->index] = val;
|
||||
if (dev->index != 0x13)
|
||||
ali1217_log("ALi M1217: dev->regs[%02x] = %02x\n", dev->index, val);
|
||||
|
||||
switch (dev->index)
|
||||
if(dev->index == 0x13)
|
||||
dev->cfg_locked = !(val == 0xc5);
|
||||
|
||||
if (!dev->cfg_locked)
|
||||
{
|
||||
case 0x14:
|
||||
case 0x15:
|
||||
ali1217_shadow_recalc(dev);
|
||||
break;
|
||||
dev->regs[dev->index] = val;
|
||||
switch (dev->index)
|
||||
{
|
||||
case 0x14:
|
||||
case 0x15:
|
||||
ali1217_shadow_recalc(dev);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -118,6 +126,8 @@ ali1217_init(const device_t *info)
|
||||
|
||||
device_add(&port_92_device);
|
||||
|
||||
dev->cfg_locked = 1;
|
||||
|
||||
/*
|
||||
|
||||
ALi M1217 Ports
|
||||
|
@@ -101,17 +101,16 @@ ali1429_write(uint16_t addr, uint8_t val, void *priv)
|
||||
|
||||
/* Don't log register unlock patterns */
|
||||
if(dev->index != 0x03)
|
||||
{
|
||||
ali1429_log("M1429: dev->regs[%02x] = %02x\n", dev->index, val);
|
||||
}
|
||||
|
||||
dev->regs[dev->index] = val;
|
||||
|
||||
/* Unlock/Lock Registers */
|
||||
dev->cfg_locked = !(dev->regs[0x03] && 0xc5);
|
||||
if(dev->index == 0x03)
|
||||
dev->cfg_locked = !(val == 0xc5);
|
||||
|
||||
if(dev->cfg_locked == 0)
|
||||
if(!dev->cfg_locked)
|
||||
{
|
||||
dev->regs[dev->index] = val;
|
||||
|
||||
switch(dev->index){
|
||||
/* Shadow RAM */
|
||||
case 0x13:
|
||||
|
Reference in New Issue
Block a user