- accept an optional rom image in the 0xe0000 area and load them into BIOS memory
This commit is contained in:
parent
d232d245f4
commit
9d3cbbdb76
@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// $Id: misc_mem.cc,v 1.62 2005-10-12 17:11:44 vruppert Exp $
|
// $Id: misc_mem.cc,v 1.63 2005-10-25 08:33:55 vruppert Exp $
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||||
@ -95,7 +95,7 @@ void BX_MEM_C::init_memory(int memsize)
|
|||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.62 2005-10-12 17:11:44 vruppert Exp $"));
|
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.63 2005-10-25 08:33:55 vruppert Exp $"));
|
||||||
// you can pass 0 if memory has been allocated already through
|
// you can pass 0 if memory has been allocated already through
|
||||||
// the constructor, or the desired size of memory if it hasn't
|
// the constructor, or the desired size of memory if it hasn't
|
||||||
// BX_INFO(("%.2fMB", (float)(BX_MEM_THIS megabytes) ));
|
// BX_INFO(("%.2fMB", (float)(BX_MEM_THIS megabytes) ));
|
||||||
@ -210,14 +210,18 @@ void BX_MEM_C::load_ROM(const char *path, Bit32u romaddress, Bit8u type)
|
|||||||
BX_PANIC(("ROM: ROM image must start at a 2k boundary"));
|
BX_PANIC(("ROM: ROM image must start at a 2k boundary"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((romaddress < 0xc0000) || (romaddress > 0xdffff)) {
|
if ((romaddress < 0xc0000) || (romaddress > 0xe0000)) {
|
||||||
close(fd);
|
close(fd);
|
||||||
BX_PANIC(("ROM: ROM address space out of range"));
|
BX_PANIC(("ROM: ROM address space out of range"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
start_idx = ((romaddress - 0xc0000) >> 11);
|
start_idx = ((romaddress - 0xc0000) >> 11);
|
||||||
end_idx = start_idx + (size >> 11) + (((size % 2048) > 0) ? 1 : 0);
|
end_idx = start_idx + (size >> 11) + (((size % 2048) > 0) ? 1 : 0);
|
||||||
offset = (romaddress & EXROM_MASK) + BIOSROMSZ;
|
if (romaddress < 0xe0000) {
|
||||||
|
offset = (romaddress & EXROM_MASK) + BIOSROMSZ;
|
||||||
|
} else {
|
||||||
|
offset = romaddress & BIOS_MASK;
|
||||||
|
}
|
||||||
for (i = start_idx; i < end_idx; i++) {
|
for (i = start_idx; i < end_idx; i++) {
|
||||||
if (BX_MEM_THIS rom_present[i]) {
|
if (BX_MEM_THIS rom_present[i]) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user