VL82C480: Fix and clean-up the DRAM banks calculation code, closes #5592.
This commit is contained in:
@@ -237,20 +237,16 @@ vl82c480_init(const device_t *info)
|
|||||||
dev->regs[0x08] = 0x38;
|
dev->regs[0x08] = 0x38;
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 4; i++) {
|
for (uint8_t i = 0; i < 4; i++) {
|
||||||
uint32_t size = 0;
|
for (uint8_t j = 2; j < 7; j++) {
|
||||||
|
|
||||||
for (uint8_t j = 2; i < 7; j++) {
|
|
||||||
if (ms >= sizes[j])
|
if (ms >= sizes[j])
|
||||||
size = sizes[j];
|
dev->banks[i] = sizes[j];
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ms -= size;
|
ms -= dev->banks[i];
|
||||||
|
|
||||||
dev->banks[i] = size;
|
if ((ms == 0) || (dev->banks[i] == 0))
|
||||||
|
|
||||||
if ((ms == 0) || (size == 0))
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user