The Intel Flash device with inverted high bit pin now again correctly responds to reads and writes on the high BIOS mapping, fixes programming the Flash with the AMI BIOS Flash utility;

Added internal graphics card option for the Intel Advanced/EV for the on-board S3 Trio64;
Fixed configuration for internal graphics card options (using the machine's Configure button) for some machines (PCjr, Tandy 1000, Tandy 1000 HX, and now also the Intel Advanced/EV).
This commit is contained in:
OBattler
2018-02-09 05:42:40 +01:00
parent 4115cf1399
commit 4677cf600b
8 changed files with 217 additions and 135 deletions

View File

@@ -8,13 +8,13 @@
*
* Implementation of the Intel 2 Mbit 8-bit flash devices.
*
* Version: @(#)intel_flash.c 1.0.12 2017/12/28
* Version: @(#)intel_flash.c 1.0.13 2018/02/09
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca.
*/
#include <stdio.h>
#include <stdint.h>
@@ -67,13 +67,9 @@ static uint8_t flash_read(uint32_t addr, void *p)
{
flash_t *flash = (flash_t *)p;
if (flash->invert_high_pin)
{
addr ^= 0x10000;
if (addr & 0xfff00000) return flash->array[addr & 0x1ffff];
}
addr &= 0x1ffff;
switch (flash->command)
{
switch (flash->command) {
case CMD_READ_ARRAY:
default:
return flash->array[addr];
@@ -114,19 +110,13 @@ static void flash_write(uint32_t addr, uint8_t val, void *p)
int i;
if (flash->invert_high_pin)
{
addr ^= 0x10000;
if (addr & 0xfff00000) return;
}
addr &= 0x1ffff;
switch (flash->command)
{
switch (flash->command) {
case CMD_ERASE_SETUP:
if (val == CMD_ERASE_CONFIRM)
{
for (i = 0; i < 3; i++)
{
if (val == CMD_ERASE_CONFIRM) {
for (i = 0; i < 3; i++) {
if ((addr >= flash->block_start[i]) && (addr <= flash->block_end[i]))
memset(&(flash->array[flash->block_start[i]]), 0xff, flash->block_len[i]);
}
@@ -146,11 +136,10 @@ static void flash_write(uint32_t addr, uint8_t val, void *p)
default:
flash->command = val;
switch (val)
{
switch (val) {
case CMD_CLEAR_STATUS:
flash->status = 0;
break;
break;
}
}
}
@@ -159,8 +148,7 @@ static void intel_flash_add_mappings(flash_t *flash)
{
int i = 0;
for (i = 0; i <= 7; i++)
{
for (i = 0; i <= 7; i++) {
mem_mapping_add(&(flash->mapping[i]), 0xe0000 + (i << 14), 0x04000, flash_read, flash_readw, flash_readl, flash_write, mem_write_nullw, mem_write_nulll, flash->array + ((i << 14) & 0x1ffff), MEM_MAPPING_EXTERNAL, (void *)flash);
mem_mapping_add(&(flash->mapping_h[i]), 0xfffe0000 + (i << 14), 0x04000, flash_read, flash_readw, flash_readl, flash_write, mem_write_nullw, mem_write_nulll, flash->array + ((i << 14) & 0x1ffff), 0, (void *)flash);
}
@@ -171,8 +159,7 @@ static void intel_flash_add_mappings_inverted(flash_t *flash)
{
int i = 0;
for (i = 0; i <= 7; i++)
{
for (i = 0; i <= 7; i++) {
mem_mapping_add(&(flash->mapping[i]), 0xe0000 + (i << 14), 0x04000, flash_read, flash_readw, flash_readl, flash_write, mem_write_nullw, mem_write_nulll, flash->array + (((i << 14) ^ 0x10000) & 0x1ffff), MEM_MAPPING_EXTERNAL, (void *)flash);
mem_mapping_add(&(flash->mapping_h[i]), 0xfffe0000 + (i << 14), 0x04000, flash_read, flash_readw, flash_readl, flash_write, mem_write_nullw, mem_write_nulll, flash->array + (((i << 14) ^ 0x10000) & 0x1ffff), 0, (void *)flash);
}
@@ -209,8 +196,7 @@ void *intel_flash_init(uint8_t type)
flash->block_len[BLOCK_DATA2] = 0x01000;
flash->block_len[BLOCK_BOOT] = 0x02000;
if (type & FLASH_IS_BXB) /* 28F001BX-B */
{
if (type & FLASH_IS_BXB) { /* 28F001BX-B */
flash->block_start[BLOCK_MAIN] = 0x04000; /* MAIN BLOCK */
flash->block_end[BLOCK_MAIN] = 0x1ffff;
flash->block_start[BLOCK_DATA1] = 0x03000; /* DATA AREA 1 BLOCK */
@@ -219,9 +205,7 @@ void *intel_flash_init(uint8_t type)
flash->block_end[BLOCK_DATA2] = 0x04fff;
flash->block_start[BLOCK_BOOT] = 0x00000; /* BOOT BLOCK */
flash->block_end[BLOCK_BOOT] = 0x01fff;
}
else /* 28F001BX-T */
{
} else { /* 28F001BX-T */
flash->block_start[BLOCK_MAIN] = 0x00000; /* MAIN BLOCK */
flash->block_end[BLOCK_MAIN] = 0x1bfff;
flash->block_start[BLOCK_DATA1] = 0x1c000; /* DATA AREA 1 BLOCK */
@@ -232,37 +216,28 @@ void *intel_flash_init(uint8_t type)
flash->block_end[BLOCK_BOOT] = 0x1ffff;
}
for (i = 0; i < 8; i++)
{
for (i = 0; i < 8; i++) {
mem_mapping_disable(&bios_mapping[i]);
mem_mapping_disable(&bios_high_mapping[i]);
}
if (flash->invert_high_pin)
{
if (flash->invert_high_pin) {
memcpy(flash->array, rom + 65536, 65536);
memcpy(flash->array + 65536, rom, 65536);
}
else
{
memcpy(flash->array, rom, 131072);
}
if (flash->invert_high_pin)
{
intel_flash_add_mappings_inverted(flash);
}
else
{
intel_flash_add_mappings(flash);
}
flash->command = CMD_READ_ARRAY;
flash->status = 0;
f = nvr_fopen(flash_path, L"rb");
if (f)
{
if (f) {
fread(&(flash->array[flash->block_start[BLOCK_MAIN]]), flash->block_len[BLOCK_MAIN], 1, f);
fread(&(flash->array[flash->block_start[BLOCK_DATA1]]), flash->block_len[BLOCK_DATA1], 1, f);
fread(&(flash->array[flash->block_start[BLOCK_DATA2]]), flash->block_len[BLOCK_DATA2], 1, f);