Added the Magitronic B215

Intended for just testing the XT FDC issues
This commit is contained in:
Panagiotis
2021-01-31 13:49:14 +02:00
committed by GitHub
parent 1290fdb065
commit 41c3dbc451
5 changed files with 103 additions and 2 deletions

View File

@@ -13,5 +13,5 @@
# Copyright 2020,2021 David Hrdlička.
#
add_library(fdd OBJECT fdd.c fdc.c fdc_pii15xb.c fdi2raw.c fdd_common.c
add_library(fdd OBJECT fdd.c fdc.c fdc_magitronic.c fdc_pii15xb.c fdi2raw.c fdd_common.c
fdd_86f.c fdd_fdi.c fdd_imd.c fdd_img.c fdd_json.c fdd_mfm.c fdd_td0.c)

View File

@@ -109,6 +109,7 @@ typedef const struct {
/* All emulated machines have at least one integrated FDC controller */
static fdc_cards_t fdc_cards[] = {
{ "internal", NULL },
{ "b215", &fdc_b215_device },
{ "dtk_pii151b", &fdc_pii151b_device },
{ "dtk_pii158b", &fdc_pii158b_device },
{ "", NULL },

View File

@@ -0,0 +1,99 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of the Magitronic B215 XT-FDC Controller.
*
* Authors: Tiseno100
*
* Copyright 2021 Tiseno100
*
*/
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/timer.h>
#include <86box/io.h>
#include <86box/device.h>
#include <86box/mem.h>
#include <86box/rom.h>
#include <86box/fdd.h>
#include <86box/fdc.h>
#include <86box/fdc_ext.h>
#define ROM_B215 L"roms/floppy/magitronic/Magitronic B215 - BIOS ROM.bin"
#define ROM_ADDR (uint32_t)(device_get_config_hex20("bios_addr") & 0x000fffff)
typedef struct
{
fdc_t *fdc_controller;
rom_t rom;
} b215_t;
static void
b215_close(void *priv)
{
b215_t *dev = (b215_t *)priv;
free(dev);
}
static void *
b215_init(const device_t *info)
{
b215_t *dev = (b215_t *)malloc(sizeof(b215_t));
memset(dev, 0, sizeof(b215_t));
rom_init(&dev->rom, ROM_B215, ROM_ADDR, 0x2000, 0x1fff, 0, MEM_MAPPING_EXTERNAL);
device_add(&fdc_at_device);
return dev;
}
static int b215_available(void)
{
return rom_present(ROM_B215);
}
static const device_config_t b215_config[] = {
{
"bios_addr", "BIOS Address:", CONFIG_HEX20, "", 0xca000, "", { 0 },
{
{
"CA00H", 0xca000
},
{
"CC00H", 0xcc000
},
{
""
}
}
},
{
"", "", -1
}
};
const device_t fdc_b215_device = {
"Magitronic B215",
DEVICE_ISA,
0,
b215_init,
b215_close,
NULL,
{b215_available},
NULL,
NULL,
b215_config};

View File

@@ -27,6 +27,7 @@ extern int fdc_type;
/* Controller types. */
#define FDC_INTERNAL 0
extern const device_t fdc_b215_device;
extern const device_t fdc_pii151b_device;
extern const device_t fdc_pii158b_device;

View File

@@ -658,7 +658,7 @@ SIOOBJ := sio_acc3221.o \
sio_um8669f.o \
sio_vt82c686.o
FDDOBJ := fdd.o fdc.o fdc_pii15xb.o \
FDDOBJ := fdd.o fdc.o fdc_magitronic.o fdc_pii15xb.o \
fdi2raw.o \
fdd_common.o fdd_86f.o \
fdd_fdi.o fdd_imd.o fdd_img.o fdd_json.o \