clang-format in src/machine
This commit is contained in:
@@ -47,78 +47,74 @@
|
||||
#include <86box/io.h>
|
||||
#include <86box/vid_cga.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
mem_mapping_t scratchpad_mapping;
|
||||
uint8_t *scratchpad_ram;
|
||||
uint8_t *scratchpad_ram;
|
||||
} zenith_t;
|
||||
|
||||
|
||||
static uint8_t
|
||||
zenith_scratchpad_read(uint32_t addr, void *p)
|
||||
{
|
||||
zenith_t *dev = (zenith_t *)p;
|
||||
zenith_t *dev = (zenith_t *) p;
|
||||
return dev->scratchpad_ram[addr & 0x3fff];
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
zenith_scratchpad_write(uint32_t addr, uint8_t val, void *p)
|
||||
{
|
||||
zenith_t *dev = (zenith_t *)p;
|
||||
zenith_t *dev = (zenith_t *) p;
|
||||
dev->scratchpad_ram[addr & 0x3fff] = val;
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
zenith_scratchpad_init(const device_t *info)
|
||||
{
|
||||
zenith_t *dev;
|
||||
|
||||
dev = (zenith_t *)malloc(sizeof(zenith_t));
|
||||
dev = (zenith_t *) malloc(sizeof(zenith_t));
|
||||
memset(dev, 0x00, sizeof(zenith_t));
|
||||
|
||||
dev->scratchpad_ram = malloc(0x4000);
|
||||
|
||||
mem_mapping_add(&dev->scratchpad_mapping, 0xf0000, 0x4000,
|
||||
zenith_scratchpad_read, NULL, NULL,
|
||||
zenith_scratchpad_write, NULL, NULL,
|
||||
dev->scratchpad_ram, MEM_MAPPING_EXTERNAL, dev);
|
||||
zenith_scratchpad_read, NULL, NULL,
|
||||
zenith_scratchpad_write, NULL, NULL,
|
||||
dev->scratchpad_ram, MEM_MAPPING_EXTERNAL, dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
zenith_scratchpad_close(void *p)
|
||||
{
|
||||
zenith_t *dev = (zenith_t *)p;
|
||||
zenith_t *dev = (zenith_t *) p;
|
||||
|
||||
free(dev->scratchpad_ram);
|
||||
free(dev);
|
||||
}
|
||||
|
||||
static const device_t zenith_scratchpad_device = {
|
||||
.name = "Zenith scratchpad RAM",
|
||||
.name = "Zenith scratchpad RAM",
|
||||
.internal_name = "zenith_scratchpad",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = zenith_scratchpad_init,
|
||||
.close = zenith_scratchpad_close,
|
||||
.reset = NULL,
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = zenith_scratchpad_init,
|
||||
.close = zenith_scratchpad_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
void
|
||||
machine_zenith_init(const machine_t *model){
|
||||
machine_zenith_init(const machine_t *model)
|
||||
{
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
device_add(&zenith_scratchpad_device);
|
||||
|
||||
@@ -127,7 +123,6 @@ machine_zenith_init(const machine_t *model){
|
||||
device_add(&keyboard_xt_zenith_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -140,18 +135,18 @@ machine_xt_z184_init(const machine_t *model)
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/zdsupers/z184m v3.1d.10d",
|
||||
0x000f8000, 32768, 0);
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
lpt1_remove(); /* only one parallel port */
|
||||
lpt1_remove(); /* only one parallel port */
|
||||
lpt2_remove();
|
||||
lpt1_init(0x278);
|
||||
device_add(&ns8250_device);
|
||||
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
|
||||
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
|
||||
|
||||
device_add(&cga_device);
|
||||
|
||||
@@ -163,14 +158,14 @@ machine_xt_z151_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
ret = bios_load_linear("roms/machines/zdsz151/444-229-18.bin",
|
||||
0x000fc000, 32768, 0);
|
||||
0x000fc000, 32768, 0);
|
||||
if (ret) {
|
||||
bios_load_aux_linear("roms/machines/zdsz151/444-260-18.bin",
|
||||
0x000f8000, 16384, 0);
|
||||
0x000f8000, 16384, 0);
|
||||
}
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
@@ -187,15 +182,15 @@ machine_xt_z159_init(const machine_t *model)
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/zdsz159/z159m v2.9e.10d",
|
||||
0x000f8000, 32768, 0);
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
/* parallel port is on the memory board */
|
||||
lpt1_remove(); /* only one parallel port */
|
||||
lpt1_remove(); /* only one parallel port */
|
||||
lpt2_remove();
|
||||
lpt1_init(0x278);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user