Added Zenith Data SupersPort. Based on patch from Tux.
This commit is contained in:
parent
9efd6705ae
commit
f4f9695ca9
11 changed files with 84 additions and 6 deletions
50
src/zenith.c
Normal file
50
src/zenith.c
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#include <stdlib.h>
|
||||
#include "ibm.h"
|
||||
#include "device.h"
|
||||
#include "mem.h"
|
||||
#include "zenith.h"
|
||||
|
||||
static uint8_t *zenith_scratchpad_ram;
|
||||
static mem_mapping_t zenith_scratchpad_mapping;
|
||||
|
||||
static uint8_t zenith_scratchpad_read(uint32_t addr, void *p)
|
||||
{
|
||||
return zenith_scratchpad_ram[addr & 0x3fff];
|
||||
}
|
||||
static void zenith_scratchpad_write(uint32_t addr, uint8_t val, void *p)
|
||||
{
|
||||
zenith_scratchpad_ram[addr & 0x3fff] = val;
|
||||
}
|
||||
|
||||
static void *zenith_scratchpad_init()
|
||||
{
|
||||
zenith_scratchpad_ram = malloc(0x4000);
|
||||
|
||||
mem_mapping_disable(&bios_mapping[4]);
|
||||
mem_mapping_disable(&bios_mapping[5]);
|
||||
|
||||
mem_mapping_add(&zenith_scratchpad_mapping, 0xf0000, 0x4000,
|
||||
zenith_scratchpad_read, NULL, NULL,
|
||||
zenith_scratchpad_write, NULL, NULL,
|
||||
zenith_scratchpad_ram, MEM_MAPPING_EXTERNAL, NULL);
|
||||
|
||||
return zenith_scratchpad_ram;
|
||||
}
|
||||
|
||||
static void zenith_scratchpad_close(void *p)
|
||||
{
|
||||
free(p);
|
||||
}
|
||||
|
||||
device_t zenith_scratchpad_device =
|
||||
{
|
||||
"Zenith scratchpad RAM",
|
||||
0,
|
||||
zenith_scratchpad_init,
|
||||
zenith_scratchpad_close,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
Loading…
Reference in a new issue