Fixed black screens - have to only look at the lower 256K of a ROM's load address.
This commit is contained in:
@@ -68,7 +68,7 @@ uint32_t biosmask;
|
||||
int readlnum=0,writelnum=0;
|
||||
int cachesize=256;
|
||||
|
||||
uint8_t *ram,*rom;
|
||||
uint8_t *rom;
|
||||
uint8_t romext[32768];
|
||||
|
||||
uint32_t ram_mapped_addr[64];
|
||||
@@ -1327,6 +1327,7 @@ void mem_init(void)
|
||||
ram = malloc(mem_size * 1024);
|
||||
readlookup2 = malloc(1024 * 1024 * sizeof(uintptr_t));
|
||||
writelookup2 = malloc(1024 * 1024 * sizeof(uintptr_t));
|
||||
rom = NULL;
|
||||
biosmask = 0xffff;
|
||||
pages = malloc((((mem_size + 384) * 1024) >> 12) * sizeof(page_t));
|
||||
page_lookup = malloc((1 << 20) * sizeof(page_t *));
|
||||
|
||||
19
src/rom.c
19
src/rom.c
@@ -13,7 +13,7 @@
|
||||
* - c386sx16 BIOS fails checksum
|
||||
* - the loadfont() calls should be done elsewhere
|
||||
*
|
||||
* Version: @(#)rom.c 1.0.5 2017/09/28
|
||||
* Version: @(#)rom.c 1.0.6 2017/09/30
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
@@ -50,7 +50,6 @@ rom_fopen(wchar_t *fn, wchar_t *mode)
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
rom_getfile(wchar_t *fn, wchar_t *s, int size)
|
||||
{
|
||||
@@ -138,6 +137,9 @@ rom_load_linear(wchar_t *fn, uint32_t addr, int sz, int off, uint8_t *ptr)
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Make sure we only look at the base-256K offset. */
|
||||
addr &= 0x03ffff;
|
||||
|
||||
(void)fseek(f, off, SEEK_SET);
|
||||
(void)fread(ptr+addr, sz, 1, f);
|
||||
(void)fclose(f);
|
||||
@@ -163,6 +165,9 @@ rom_load_interleaved(wchar_t *fnl, wchar_t *fnh, uint32_t addr, int sz, int off,
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* Make sure we only look at the base-256K offset. */
|
||||
addr &= 0x03ffff;
|
||||
|
||||
(void)fseek(fl, off, SEEK_SET);
|
||||
(void)fseek(fh, off, SEEK_SET);
|
||||
for (c=0; c<sz; c+=2) {
|
||||
@@ -239,13 +244,13 @@ rom_load_bios(int rom_id)
|
||||
loadfont(L"roms/video/mda/mda.rom", 0);
|
||||
loadfont(L"roms/video/wyse700/wy700.rom", 3);
|
||||
|
||||
/* Default to a 64K ROM BIOS image. */
|
||||
biosmask = 0xffff;
|
||||
|
||||
/* If not done yet, allocate a 128KB buffer for the BIOS ROM. */
|
||||
if (rom == NULL)
|
||||
rom = (uint8_t *)malloc(0x20000);
|
||||
memset(rom, 0xff, 0x20000);
|
||||
rom = (uint8_t *)malloc(131072);
|
||||
memset(rom, 0xff, 131072);
|
||||
|
||||
/* Default to a 64K ROM BIOS image. */
|
||||
biosmask = 0xffff;
|
||||
|
||||
/* Zap the BIOS ROM EXTENSION area. */
|
||||
memset(romext, 0xff, 0x8000);
|
||||
|
||||
Reference in New Issue
Block a user