mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
bbc: floppy formats and rom updates
- improved ssd, dsd handling - added Acorn DOS and CPM formats - added known good rom configuration for acw443 (Cambridge Workstation) - removed some BAD_DUMP flags
This commit is contained in:
parent
876c07fbf5
commit
a679a22350
@ -9,76 +9,81 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "bbc_dsk.h"
|
||||
#include "basicdsk.h"
|
||||
|
||||
LEGACY_FLOPPY_OPTIONS_START(bbc)
|
||||
LEGACY_FLOPPY_OPTION( ssd40, "bbc,img,ssd", "BBC 40t SSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
|
||||
HEADS([1])
|
||||
TRACKS([40])
|
||||
SECTORS([10])
|
||||
SECTOR_LENGTH([256])
|
||||
FIRST_SECTOR_ID([0]))
|
||||
LEGACY_FLOPPY_OPTION( ssd80, "bbc,img,ssd", "BBC 80t SSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
|
||||
HEADS([1])
|
||||
TRACKS([80])
|
||||
SECTORS([10])
|
||||
SECTOR_LENGTH([256])
|
||||
FIRST_SECTOR_ID([0]))
|
||||
LEGACY_FLOPPY_OPTION( dsd40, "dsd", "BBC 40t DSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
|
||||
HEADS([2])
|
||||
TRACKS([40])
|
||||
SECTORS([10])
|
||||
SECTOR_LENGTH([256])
|
||||
INTERLEAVE([0])
|
||||
FIRST_SECTOR_ID([0]))
|
||||
LEGACY_FLOPPY_OPTION( dsd80, "dsd", "BBC 80t DSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
|
||||
HEADS([2])
|
||||
TRACKS([80])
|
||||
SECTORS([10])
|
||||
SECTOR_LENGTH([256])
|
||||
INTERLEAVE([0])
|
||||
FIRST_SECTOR_ID([0]))
|
||||
LEGACY_FLOPPY_OPTIONS_END
|
||||
|
||||
/********************************************************************/
|
||||
|
||||
bbc_ssd_525_format::bbc_ssd_525_format() : wd177x_format(formats)
|
||||
bbc_dfs_format::bbc_dfs_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bbc_ssd_525_format::name() const
|
||||
const char *bbc_dfs_format::name() const
|
||||
{
|
||||
return "ssd";
|
||||
return "dfs";
|
||||
}
|
||||
|
||||
const char *bbc_ssd_525_format::description() const
|
||||
const char *bbc_dfs_format::description() const
|
||||
{
|
||||
return "BBC Micro 5.25\" disk image";
|
||||
return "Acorn DFS disk image";
|
||||
}
|
||||
|
||||
const char *bbc_ssd_525_format::extensions() const
|
||||
const char *bbc_dfs_format::extensions() const
|
||||
{
|
||||
return "bbc,img,ssd";
|
||||
return "bbc,img,ssd,dsd";
|
||||
}
|
||||
|
||||
int bbc_ssd_525_format::find_size(io_generic *io, UINT32 form_factor)
|
||||
int bbc_dfs_format::find_size(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
char cat[8];
|
||||
io_generic_read(io, cat, 256, 8);
|
||||
UINT64 sectors = ((cat[6] & 3) << 8) + cat[7]; // sector count from catalogue
|
||||
UINT8 cat[8];
|
||||
UINT32 sectors0, sectors2;
|
||||
|
||||
// read sector count from side 0 catalogue
|
||||
io_generic_read(io, cat, 0x100, 8);
|
||||
sectors0 = ((cat[6] & 3) << 8) + cat[7];
|
||||
|
||||
UINT64 size = io_generic_size(io);
|
||||
for(int i=0; formats[i].form_factor; i++) {
|
||||
const format &f = formats[i];
|
||||
if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
|
||||
continue;
|
||||
|
||||
if((size <= (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (sectors == f.track_count * f.sector_count))
|
||||
return i;
|
||||
if ((size <= (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (sectors0 == f.track_count * f.sector_count)) {
|
||||
if (f.head_count == 2)
|
||||
{
|
||||
// read sector count from side 2 catalogue
|
||||
if (f.sector_base_id == -1)
|
||||
io_generic_read(io, cat, 0xb00, 8); // interleaved
|
||||
else
|
||||
io_generic_read(io, cat, compute_track_size(f) * f.track_count + 0x100, 8); // sequential
|
||||
sectors2 = ((cat[6] & 3) << 8) + cat[7];
|
||||
}
|
||||
else
|
||||
{
|
||||
sectors2 = sectors0;
|
||||
}
|
||||
|
||||
if (sectors0 == sectors2)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
const bbc_ssd_525_format::format bbc_ssd_525_format::formats[] =
|
||||
int bbc_dfs_format::identify(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
int type = find_size(io, form_factor);
|
||||
|
||||
if(type != -1)
|
||||
return 90;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bbc_dfs_format::get_image_offset(const format &f, int head, int track)
|
||||
{
|
||||
if (f.sector_base_id == -1)
|
||||
return (track * f.head_count + head) * compute_track_size(f);
|
||||
else
|
||||
return (f.track_count * head + track) * compute_track_size(f);
|
||||
}
|
||||
|
||||
const bbc_dfs_format::format bbc_dfs_format::formats[] =
|
||||
{
|
||||
{ // 100k 40 track single sided single density
|
||||
floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM,
|
||||
@ -92,57 +97,15 @@ const bbc_ssd_525_format::format bbc_ssd_525_format::formats[] =
|
||||
floppy_image::FF_525, floppy_image::DSSD, floppy_image::FM,
|
||||
4000, 10, 40, 2, 256, {}, 0, {}, 40, 10, 10
|
||||
},
|
||||
{ // 200k 40 track double sided single density (interleaved)
|
||||
floppy_image::FF_525, floppy_image::DSSD, floppy_image::FM,
|
||||
4000, 10, 40, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9 }, 40, 10, 10
|
||||
},
|
||||
{ // 400k 80 track double sided single density
|
||||
floppy_image::FF_525, floppy_image::DSQD, floppy_image::FM,
|
||||
4000, 10, 80, 2, 256, {}, 0, {}, 40, 10, 10
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
bbc_dsd_525_format::bbc_dsd_525_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bbc_dsd_525_format::name() const
|
||||
{
|
||||
return "dsd";
|
||||
}
|
||||
|
||||
const char *bbc_dsd_525_format::description() const
|
||||
{
|
||||
return "BBC Micro 5.25\" disk image";
|
||||
}
|
||||
|
||||
const char *bbc_dsd_525_format::extensions() const
|
||||
{
|
||||
return "dsd";
|
||||
}
|
||||
|
||||
int bbc_dsd_525_format::find_size(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
char cat[8];
|
||||
io_generic_read(io, cat, 256, 8);
|
||||
UINT64 sectors = ((cat[6] & 3) << 8) + cat[7]; // sector count from catalogue
|
||||
UINT64 size = io_generic_size(io);
|
||||
for(int i=0; formats[i].form_factor; i++) {
|
||||
const format &f = formats[i];
|
||||
if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
|
||||
continue;
|
||||
|
||||
if((size <= (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (sectors == f.track_count * f.sector_count))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
const bbc_dsd_525_format::format bbc_dsd_525_format::formats[] =
|
||||
{
|
||||
{ // 200k 40 track double sided single density
|
||||
floppy_image::FF_525, floppy_image::DSQD, floppy_image::FM,
|
||||
4000, 10, 40, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9 }, 40, 10, 10
|
||||
},
|
||||
{ // 400k 80 track double sided single density
|
||||
{ // 400k 80 track double sided single density (interleaved)
|
||||
floppy_image::FF_525, floppy_image::DSQD, floppy_image::FM,
|
||||
4000, 10, 80, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9 }, 40, 10, 10
|
||||
},
|
||||
@ -150,63 +113,79 @@ const bbc_dsd_525_format::format bbc_dsd_525_format::formats[] =
|
||||
};
|
||||
|
||||
|
||||
bbc_adf_525_format::bbc_adf_525_format() : wd177x_format(formats)
|
||||
bbc_adfs_format::bbc_adfs_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bbc_adf_525_format::name() const
|
||||
const char *bbc_adfs_format::name() const
|
||||
{
|
||||
return "adf";
|
||||
return "adfs";
|
||||
}
|
||||
|
||||
const char *bbc_adf_525_format::description() const
|
||||
const char *bbc_adfs_format::description() const
|
||||
{
|
||||
return "BBC Micro 5.25\" ADFS disk image";
|
||||
return "Acorn ADFS disk image";
|
||||
}
|
||||
|
||||
const char *bbc_adf_525_format::extensions() const
|
||||
const char *bbc_adfs_format::extensions() const
|
||||
{
|
||||
return "adf,ads,adm,adl,img";
|
||||
return "adf,ads,adm,adl";
|
||||
}
|
||||
|
||||
const bbc_adf_525_format::format bbc_adf_525_format::formats[] =
|
||||
int bbc_adfs_format::find_size(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
{ // 160K 40 track single sided double density
|
||||
UINT8 map[3];
|
||||
UINT32 sectors;
|
||||
|
||||
// read sector count from free space map
|
||||
io_generic_read(io, map, 0xfc, 3);
|
||||
sectors = map[0] + (map[1] << 8) + (map[2] << 16);
|
||||
|
||||
UINT64 size = io_generic_size(io);
|
||||
for(int i=0; formats[i].form_factor; i++) {
|
||||
const format &f = formats[i];
|
||||
if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
|
||||
continue;
|
||||
|
||||
// valid images will have sector counts adfs-s = 0x280; adfs-m = 0x500; adfs-l = 0xa00; though many adfs-s images are incorrect
|
||||
if ((size == (UINT64)compute_track_size(f) * f.track_count * f.head_count) && (sectors == 0x280 || sectors == 0x500 || sectors == 0xa00)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int bbc_adfs_format::identify(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
int type = find_size(io, form_factor);
|
||||
|
||||
if(type != -1)
|
||||
return 100;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bbc_adfs_format::get_image_offset(const format &f, int head, int track)
|
||||
{
|
||||
if (f.sector_base_id == -1)
|
||||
return (track * f.head_count + head) * compute_track_size(f);
|
||||
else
|
||||
return (f.track_count * head + track) * compute_track_size(f);
|
||||
}
|
||||
|
||||
const bbc_adfs_format::format bbc_adfs_format::formats[] =
|
||||
{
|
||||
{ // 160K 5 1/4 inch 40 track single sided double density
|
||||
floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM,
|
||||
2000, 16, 40, 1, 256, {}, 0, {}, 60, 22, 43
|
||||
},
|
||||
{ // 320K 80 track single sided double density
|
||||
{ // 320K 5 1/4 inch 80 track single sided double density
|
||||
floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM,
|
||||
2000, 16, 80, 1, 256, {}, 0, {}, 60, 22, 43
|
||||
},
|
||||
{ // 640K 80 track double sided double density
|
||||
{ // 640K 5 1/4 inch 80 track double sided double density (interleaved)
|
||||
floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
|
||||
2000, 16, 80, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, 60, 22, 43
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
bbc_adf_35_format::bbc_adf_35_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bbc_adf_35_format::name() const
|
||||
{
|
||||
return "adf";
|
||||
}
|
||||
|
||||
const char *bbc_adf_35_format::description() const
|
||||
{
|
||||
return "BBC Micro 3.5\" ADFS disk image";
|
||||
}
|
||||
|
||||
const char *bbc_adf_35_format::extensions() const
|
||||
{
|
||||
return "adf,ads,adm,adl,img";
|
||||
}
|
||||
|
||||
const bbc_adf_35_format::format bbc_adf_35_format::formats[] = {
|
||||
{ // 160K 3 1/2 inch 40 track single sided double density
|
||||
floppy_image::FF_35, floppy_image::SSDD, floppy_image::MFM,
|
||||
2000, 16, 40, 1, 256, {}, 0, {}, 60, 22, 43
|
||||
@ -215,7 +194,7 @@ const bbc_adf_35_format::format bbc_adf_35_format::formats[] = {
|
||||
floppy_image::FF_35, floppy_image::SSQD, floppy_image::MFM,
|
||||
2000, 16, 80, 1, 256, {}, 0, {}, 60, 22, 43
|
||||
},
|
||||
{ // 640K 3 1/2 inch 80 track double sided double density
|
||||
{ // 640K 3 1/2 inch 80 track double sided double density (interleaved)
|
||||
floppy_image::FF_35, floppy_image::DSQD, floppy_image::MFM,
|
||||
2000, 16, 80, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, 60, 22, 43
|
||||
},
|
||||
@ -223,7 +202,157 @@ const bbc_adf_35_format::format bbc_adf_35_format::formats[] = {
|
||||
};
|
||||
|
||||
|
||||
const floppy_format_type FLOPPY_BBC_SSD_525_FORMAT = &floppy_image_format_creator<bbc_ssd_525_format>;
|
||||
const floppy_format_type FLOPPY_BBC_DSD_525_FORMAT = &floppy_image_format_creator<bbc_dsd_525_format>;
|
||||
const floppy_format_type FLOPPY_BBC_ADF_525_FORMAT = &floppy_image_format_creator<bbc_adf_525_format>;
|
||||
const floppy_format_type FLOPPY_BBC_ADF_35_FORMAT = &floppy_image_format_creator<bbc_adf_35_format>;
|
||||
bbc_dos_format::bbc_dos_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bbc_dos_format::name() const
|
||||
{
|
||||
return "dos";
|
||||
}
|
||||
|
||||
const char *bbc_dos_format::description() const
|
||||
{
|
||||
return "Acorn DOS disk image";
|
||||
}
|
||||
|
||||
const char *bbc_dos_format::extensions() const
|
||||
{
|
||||
return "img,adl";
|
||||
}
|
||||
|
||||
int bbc_dos_format::find_size(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
UINT8 cat[3];
|
||||
UINT32 sectors;
|
||||
|
||||
UINT64 size = io_generic_size(io);
|
||||
for(int i=0; formats[i].form_factor; i++) {
|
||||
const format &f = formats[i];
|
||||
if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
|
||||
continue;
|
||||
|
||||
if (size == (UINT64)compute_track_size(f) * f.track_count * f.head_count) {
|
||||
switch (size)
|
||||
{
|
||||
case 640 * 1024: // 640K Acorn (Bootable) DOS Format
|
||||
// read sector count from free space map - Acorn DOS = 0xaa0
|
||||
io_generic_read(io, cat, 0xfc, 3);
|
||||
sectors = cat[0] + (cat[1] << 8) + (cat[2] << 16);
|
||||
if (sectors == 0xaa0) {
|
||||
// read media type ID from FAT - Acorn DOS = 0xff
|
||||
if (f.sector_base_id == -1)
|
||||
io_generic_read(io, cat, 0x2000, 1); // interleaved
|
||||
else
|
||||
io_generic_read(io, cat, 0x1000, 1); // sequential
|
||||
if (cat[0] == 0xff) return i;
|
||||
}
|
||||
break;
|
||||
case 800 * 1024: // 800K Acorn DOS Format
|
||||
// read media type ID from FAT - Acorn DOS = 0xfd
|
||||
io_generic_read(io, cat, 0, 1);
|
||||
if (cat[0] == 0xfd) return i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int bbc_dos_format::identify(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
int type = find_size(io, form_factor);
|
||||
|
||||
if(type != -1)
|
||||
return 100;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bbc_dos_format::get_image_offset(const format &f, int head, int track)
|
||||
{
|
||||
if (f.sector_base_id == -1)
|
||||
return (track * f.head_count + head) * compute_track_size(f);
|
||||
else
|
||||
return (f.track_count * head + track) * compute_track_size(f);
|
||||
}
|
||||
|
||||
const bbc_dos_format::format bbc_dos_format::formats[] =
|
||||
{
|
||||
{ // 640K 5 1/4 inch 80 track double sided double density - gaps unverified
|
||||
floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
|
||||
2000, 16, 80, 2, 256, {}, 0, {}, 60, 22, 43
|
||||
},
|
||||
{ // 640K 5 1/4 inch 80 track double sided double density (interleaved) - gaps unverified
|
||||
floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
|
||||
2000, 16, 80, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, 60, 22, 43
|
||||
},
|
||||
{ // 800K 5 1/4 inch 80 track double sided double density - gaps unverified
|
||||
floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
|
||||
2000, 5, 80, 2, 1024, {}, 0, {}, 60, 22, 43
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
bbc_cpm_format::bbc_cpm_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bbc_cpm_format::name() const
|
||||
{
|
||||
return "cpm";
|
||||
}
|
||||
|
||||
const char *bbc_cpm_format::description() const
|
||||
{
|
||||
return "Acorn CP/M disk image";
|
||||
}
|
||||
|
||||
const char *bbc_cpm_format::extensions() const
|
||||
{
|
||||
return "img,ssd,dsd";
|
||||
}
|
||||
|
||||
int bbc_cpm_format::identify(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
UINT8 h[8];
|
||||
|
||||
io_generic_read(io, h, 0, 8);
|
||||
|
||||
int type = find_size(io, form_factor);
|
||||
|
||||
if(type != -1 && (memcmp(h, "Acorn CP", 8) == 0 || memcmp(h, "Slogger ", 8) == 0)) {
|
||||
return 100;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bbc_cpm_format::get_image_offset(const format &f, int head, int track)
|
||||
{
|
||||
if (f.sector_base_id == -1)
|
||||
return (track * f.head_count + head) * compute_track_size(f);
|
||||
else
|
||||
return (f.track_count * head + track) * compute_track_size(f);
|
||||
}
|
||||
|
||||
const bbc_cpm_format::format bbc_cpm_format::formats[] =
|
||||
{
|
||||
{ // 400K 5 1/4 inch 80 track double sided single density - gaps unverified
|
||||
floppy_image::FF_525, floppy_image::DSQD, floppy_image::FM,
|
||||
4000, 5, 80, 2, 512, {}, 0, {}, 40, 10, 10
|
||||
},
|
||||
{ // 400k 5 1/4 inch 80 track double sided single density (interleaved) - gaps unverified
|
||||
floppy_image::FF_525, floppy_image::DSQD, floppy_image::FM,
|
||||
4000, 5, 80, 2, 512, {}, -1, { 0,1,2,3,4 }, 40, 10, 10
|
||||
},
|
||||
{ // 800K 5 1/4 inch 80 track double sided double density - gaps unverified
|
||||
floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
|
||||
2000, 10, 80, 2, 512, {}, 0, {}, 60, 22, 43
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
const floppy_format_type FLOPPY_BBC_DFS_FORMAT = &floppy_image_format_creator<bbc_dfs_format>;
|
||||
const floppy_format_type FLOPPY_BBC_ADFS_FORMAT = &floppy_image_format_creator<bbc_adfs_format>;
|
||||
const floppy_format_type FLOPPY_BBC_DOS_FORMAT = &floppy_image_format_creator<bbc_dos_format>;
|
||||
const floppy_format_type FLOPPY_BBC_CPM_FORMAT = &floppy_image_format_creator<bbc_cpm_format>;
|
||||
|
@ -13,21 +13,16 @@
|
||||
#ifndef __BBC_DSK_H__
|
||||
#define __BBC_DSK_H__
|
||||
|
||||
#include "flopimg.h"
|
||||
#include "wd177x_dsk.h"
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
LEGACY_FLOPPY_OPTIONS_EXTERN(bbc);
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
class bbc_ssd_525_format : public wd177x_format
|
||||
class bbc_dfs_format : public wd177x_format
|
||||
{
|
||||
public:
|
||||
bbc_ssd_525_format();
|
||||
bbc_dfs_format();
|
||||
|
||||
virtual int find_size(io_generic *io, UINT32 form_factor);
|
||||
virtual int identify(io_generic *io, UINT32 form_factor);
|
||||
virtual int get_image_offset(const format &f, int head, int track);
|
||||
virtual const char *name() const;
|
||||
virtual const char *description() const;
|
||||
virtual const char *extensions() const;
|
||||
@ -36,12 +31,14 @@ private:
|
||||
static const format formats[];
|
||||
};
|
||||
|
||||
class bbc_dsd_525_format : public wd177x_format
|
||||
class bbc_adfs_format : public wd177x_format
|
||||
{
|
||||
public:
|
||||
bbc_dsd_525_format();
|
||||
bbc_adfs_format();
|
||||
|
||||
virtual int find_size(io_generic *io, UINT32 form_factor);
|
||||
virtual int identify(io_generic *io, UINT32 form_factor);
|
||||
virtual int get_image_offset(const format &f, int head, int track);
|
||||
virtual const char *name() const;
|
||||
virtual const char *description() const;
|
||||
virtual const char *extensions() const;
|
||||
@ -50,11 +47,14 @@ private:
|
||||
static const format formats[];
|
||||
};
|
||||
|
||||
class bbc_adf_525_format : public wd177x_format
|
||||
class bbc_dos_format : public wd177x_format
|
||||
{
|
||||
public:
|
||||
bbc_adf_525_format();
|
||||
bbc_dos_format();
|
||||
|
||||
virtual int find_size(io_generic *io, UINT32 form_factor);
|
||||
virtual int identify(io_generic *io, UINT32 form_factor);
|
||||
virtual int get_image_offset(const format &f, int head, int track);
|
||||
virtual const char *name() const;
|
||||
virtual const char *description() const;
|
||||
virtual const char *extensions() const;
|
||||
@ -63,11 +63,13 @@ private:
|
||||
static const format formats[];
|
||||
};
|
||||
|
||||
class bbc_adf_35_format : public wd177x_format
|
||||
class bbc_cpm_format : public wd177x_format
|
||||
{
|
||||
public:
|
||||
bbc_adf_35_format();
|
||||
bbc_cpm_format();
|
||||
|
||||
virtual int identify(io_generic *io, UINT32 form_factor);
|
||||
virtual int get_image_offset(const format &f, int head, int track);
|
||||
virtual const char *name() const;
|
||||
virtual const char *description() const;
|
||||
virtual const char *extensions() const;
|
||||
@ -77,9 +79,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
extern const floppy_format_type FLOPPY_BBC_SSD_525_FORMAT;
|
||||
extern const floppy_format_type FLOPPY_BBC_DSD_525_FORMAT;
|
||||
extern const floppy_format_type FLOPPY_BBC_ADF_525_FORMAT;
|
||||
extern const floppy_format_type FLOPPY_BBC_ADF_35_FORMAT;
|
||||
extern const floppy_format_type FLOPPY_BBC_DFS_FORMAT;
|
||||
extern const floppy_format_type FLOPPY_BBC_ADFS_FORMAT;
|
||||
extern const floppy_format_type FLOPPY_BBC_DOS_FORMAT;
|
||||
extern const floppy_format_type FLOPPY_BBC_CPM_FORMAT;
|
||||
|
||||
#endif // __BBC_DSK_H__
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -83,9 +83,9 @@ public:
|
||||
m_palette(*this, "palette")
|
||||
{ }
|
||||
|
||||
DECLARE_FLOPPY_FORMATS(floppy_formats_525sd);
|
||||
DECLARE_FLOPPY_FORMATS(floppy_formats_525dd);
|
||||
DECLARE_FLOPPY_FORMATS(floppy_formats_35dd);
|
||||
DECLARE_FLOPPY_FORMATS(floppy_formats_bbc);
|
||||
DECLARE_FLOPPY_FORMATS(floppy_formats_bbcm);
|
||||
DECLARE_FLOPPY_FORMATS(floppy_formats_bbcmc);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(bbc_page_selecta_w);
|
||||
DECLARE_WRITE8_MEMBER(bbc_memorya1_w);
|
||||
@ -176,11 +176,11 @@ public:
|
||||
void bbc_setup_banks(memory_bank *membank, int banks, UINT32 shift, UINT32 size);
|
||||
void bbcm_setup_banks(memory_bank *membank, int banks, UINT32 shift, UINT32 size);
|
||||
|
||||
int bbc_load_cart(device_image_interface &image, generic_slot_device *slot);
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp1_load) { return bbc_load_cart(image, m_exp1); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp2_load) { return bbc_load_cart(image, m_exp2); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp3_load) { return bbc_load_cart(image, m_exp3); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp4_load) { return bbc_load_cart(image, m_exp4); }
|
||||
int bbc_load_rom(device_image_interface &image, generic_slot_device *slot);
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp1_load) { return bbc_load_rom(image, m_exp1); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp2_load) { return bbc_load_rom(image, m_exp2); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp3_load) { return bbc_load_rom(image, m_exp3); }
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp4_load) { return bbc_load_rom(image, m_exp4); }
|
||||
|
||||
int bbcm_load_cart(device_image_interface &image, generic_slot_device *slot);
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(bbcm_exp1_load) { return bbcm_load_cart(image, m_exp1); }
|
||||
@ -228,6 +228,7 @@ public: // HACK FOR MC6845
|
||||
|
||||
void check_interrupts();
|
||||
|
||||
bool m_os01; // flag indicating whether OS 0.1 is being used
|
||||
int m_SWRAMtype; // this stores the DIP switch setting for the SWRAM type being used
|
||||
int m_Speech; // this stores the CONF setting for Speech enabled/disabled
|
||||
|
||||
@ -357,7 +358,7 @@ public: // HACK FOR MC6845
|
||||
int m_wd177x_irq_state;
|
||||
int m_wd177x_drq_state;
|
||||
int m_previous_wd177x_int_state;
|
||||
int m_177x_IntEnabled;
|
||||
int m_wd177x_int_enabled;
|
||||
|
||||
/**************************************
|
||||
Video Code
|
||||
@ -386,7 +387,6 @@ public: // HACK FOR MC6845
|
||||
int m_BBC_HSync;
|
||||
int m_BBC_VSync;
|
||||
|
||||
|
||||
int m_Teletext_Latch;
|
||||
int m_VideoULA_CR;
|
||||
int m_VideoULA_CR_counter;
|
||||
@ -398,7 +398,6 @@ public: // HACK FOR MC6845
|
||||
int m_videoULA_teletext_normal_select;
|
||||
int m_videoULA_flash_colour_select;
|
||||
|
||||
|
||||
int m_pixels_per_byte;
|
||||
int m_emulation_pixels_per_real_pixel;
|
||||
int m_emulation_pixels_per_byte;
|
||||
@ -406,24 +405,18 @@ public: // HACK FOR MC6845
|
||||
int m_emulation_cursor_size;
|
||||
int m_cursor_state;
|
||||
|
||||
int m_videoULA_pallet0[16];
|
||||
int m_videoULA_pallet1[16];
|
||||
int *m_videoULA_pallet_lookup;
|
||||
|
||||
void (*m_draw_function)(running_machine &machine);
|
||||
int m_videoULA_palette0[16];
|
||||
int m_videoULA_palette1[16];
|
||||
int *m_videoULA_palette_lookup;
|
||||
|
||||
void bbcbp_setvideoshadow(int vdusel);
|
||||
void common_init(int memorySize);
|
||||
void set_pixel_lookup();
|
||||
void set_cursor(bbc_state *state);
|
||||
void BBC_Clock_CR(bbc_state *state);
|
||||
void BBC_draw_teletext();
|
||||
void BBC_ula_drawpixel(bbc_state *state, int col, int number_of_pixels);
|
||||
void BBC_draw_hi_res();
|
||||
void BBC_Set_HSync(int offset, int data);
|
||||
void BBC_Set_VSync(int offset, int data);
|
||||
void BBC_Set_CRE(int offset, int data);
|
||||
void bbc_frameclock();
|
||||
int vdudriverset();
|
||||
int bbcm_vdudriverset();
|
||||
int bbc_keyboard(address_space &space, int data);
|
||||
|
@ -115,7 +115,7 @@ WRITE8_MEMBER(bbc_state::bbc_page_selectbp_w)
|
||||
{
|
||||
if ((offset&0x04)==0)
|
||||
{
|
||||
m_pagedRAM = (data >> 7) & 0x01;
|
||||
m_pagedRAM = BIT(data,7);
|
||||
m_rombank = data & 0x0f;
|
||||
|
||||
if (m_pagedRAM)
|
||||
@ -135,7 +135,7 @@ WRITE8_MEMBER(bbc_state::bbc_page_selectbp_w)
|
||||
else
|
||||
{
|
||||
//the video display should now use this flag to display the shadow ram memory
|
||||
m_vdusel=(data>>7)&0x01;
|
||||
m_vdusel=BIT(data,7);
|
||||
bbcbp_setvideoshadow(m_vdusel);
|
||||
//need to make the video display do a full screen refresh for the new memory area
|
||||
m_bank2->set_base(m_region_maincpu->base() + 0x3000);
|
||||
@ -291,7 +291,7 @@ b0 D 1=Display LYNNE as screen
|
||||
|
||||
ACCCON is a read/write register
|
||||
|
||||
HAZEL is the 8K of RAM used by the MOS, filing system, and other Roms at &C000-&DFFF
|
||||
HAZEL is the 8K of RAM used by the MOS, filing system, and other ROMs at &C000-&DFFF
|
||||
|
||||
ANDY is the name of the 4K of RAM used by the MOS at &8000-&8FFF
|
||||
|
||||
@ -326,14 +326,14 @@ WRITE8_MEMBER(bbc_state::bbcm_ACCCON_write)
|
||||
|
||||
tempIRR=m_ACCCON_IRR;
|
||||
|
||||
m_ACCCON_IRR=(data>>7)&1;
|
||||
m_ACCCON_TST=(data>>6)&1;
|
||||
m_ACCCON_IFJ=(data>>5)&1;
|
||||
m_ACCCON_ITU=(data>>4)&1;
|
||||
m_ACCCON_Y =(data>>3)&1;
|
||||
m_ACCCON_X =(data>>2)&1;
|
||||
m_ACCCON_E =(data>>1)&1;
|
||||
m_ACCCON_D =(data>>0)&1;
|
||||
m_ACCCON_IRR = BIT(data,7);
|
||||
m_ACCCON_TST = BIT(data,6);
|
||||
m_ACCCON_IFJ = BIT(data,5);
|
||||
m_ACCCON_ITU = BIT(data,4);
|
||||
m_ACCCON_Y = BIT(data,3);
|
||||
m_ACCCON_X = BIT(data,2);
|
||||
m_ACCCON_E = BIT(data,1);
|
||||
m_ACCCON_D = BIT(data,0);
|
||||
|
||||
if (tempIRR!=m_ACCCON_IRR)
|
||||
{
|
||||
@ -558,7 +558,7 @@ READ8_MEMBER(bbc_state::bbcm_r)
|
||||
if ((myo>=0x10) && (myo<=0x17)) return 0xfe; /* Serial System Chip */
|
||||
if ((myo>=0x18) && (myo<=0x1f)) return m_upd7002 ? m_upd7002->read(space, myo-0x18) : 0xfe; /* A to D converter */
|
||||
if ((myo>=0x20) && (myo<=0x23)) return 0xfe; /* VideoULA */
|
||||
if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd177xl_read(space, myo - 0x24); /* 177x Control Latch */
|
||||
if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd177xl_read(space, myo-0x24); /* 177x Control Latch */
|
||||
if ((myo>=0x28) && (myo<=0x2f) && (m_wd1770)) return m_wd1770->read(space, myo-0x28); /* 1770 Controller */
|
||||
if ((myo>=0x28) && (myo<=0x2f) && (m_wd1772)) return m_wd1772->read(space, myo-0x28); /* 1772 Controller */
|
||||
if ((myo>=0x28) && (myo<=0x2f)) return 0xfe; /* No Controller */
|
||||
@ -726,6 +726,9 @@ INTERRUPT_GEN_MEMBER(bbc_state::bbcb_keyscan)
|
||||
/* keyboard not enabled so increment counter */
|
||||
m_column = (m_column + 1) % 16;
|
||||
|
||||
/* OS 0.1 programs CA2 to interrupt on negative edge and expects the keyboard to still work */
|
||||
//int set = (m_os01 ? 0 : 1);
|
||||
|
||||
if (m_column < 13)
|
||||
{
|
||||
/* KBD IC4 8 input NAND gate */
|
||||
@ -779,6 +782,9 @@ int bbc_state::bbc_keyboard(address_space &space, int data)
|
||||
bit = 1;
|
||||
}
|
||||
|
||||
/* OS 0.1 programs CA2 to interrupt on negative edge and expects the keyboard to still work */
|
||||
//int set = (m_os01 ? 0 : 1);
|
||||
|
||||
if ((res | 1) != 0xff)
|
||||
{
|
||||
m_via6522_0->write_ca2(1);
|
||||
@ -872,7 +878,7 @@ WRITE8_MEMBER(bbc_state::bbcb_via_system_write_portb)
|
||||
{
|
||||
int bit, value;
|
||||
bit = data & 0x07;
|
||||
value = (data >> 3) & 0x01;
|
||||
value = BIT(data,3);
|
||||
|
||||
//logerror("SYSTEM write portb %d %d %d\n",data,bit,value);
|
||||
|
||||
@ -1048,16 +1054,16 @@ WRITE8_MEMBER(bbc_state::bbcb_via_system_write_portb)
|
||||
if (m_rtc)
|
||||
{
|
||||
//set the Address Select
|
||||
if (m_MC146818_AS != ((data>>7)&1))
|
||||
if (m_MC146818_AS != BIT(data,7))
|
||||
{
|
||||
m_MC146818_AS=(data>>7)&1;
|
||||
m_MC146818_AS = BIT(data,7);
|
||||
MC146818_set(space);
|
||||
}
|
||||
|
||||
//if CE changes
|
||||
if (m_MC146818_CE != ((data>>6)&1))
|
||||
if (m_MC146818_CE != BIT(data,6))
|
||||
{
|
||||
m_MC146818_CE=(data>>6)&1;
|
||||
m_MC146818_CE = BIT(data,6);
|
||||
MC146818_set(space);
|
||||
}
|
||||
}
|
||||
@ -1426,7 +1432,7 @@ WRITE_LINE_MEMBER(bbc_state::bbc_i8271_interrupt)
|
||||
is cleared this will not cause another nmi */
|
||||
/* I'll emulate it like this to be sure */
|
||||
|
||||
if (state!=m_previous_i8271_int_state)
|
||||
if (state != m_previous_i8271_int_state)
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
@ -1451,6 +1457,7 @@ WRITE_LINE_MEMBER(bbc_state::side_w)
|
||||
m_i8271->subdevice<floppy_connector>("1")->get_device()->ss_w(state);
|
||||
}
|
||||
|
||||
|
||||
/**************************************
|
||||
WD1770 disc control function
|
||||
***************************************/
|
||||
@ -1494,7 +1501,7 @@ void bbc_state::bbc_update_fdq_int(int state)
|
||||
int bbc_state;
|
||||
|
||||
/* if drq or irq is set, and interrupt is enabled */
|
||||
if ((m_wd177x_irq_state || m_wd177x_drq_state) && (m_177x_IntEnabled))
|
||||
if ((m_wd177x_irq_state || m_wd177x_drq_state) && (m_wd177x_int_enabled))
|
||||
{
|
||||
/* int trigger */
|
||||
bbc_state = 1;
|
||||
@ -1536,10 +1543,6 @@ WRITE8_MEMBER(bbc_state::bbc_wd1770_status_w)
|
||||
floppy_image_device *floppy = NULL;
|
||||
|
||||
m_drive_control = data;
|
||||
logerror("Drive control %d \n", data);
|
||||
|
||||
// bit 5: reset
|
||||
if (!BIT(data, 5)) m_wd1770->reset();
|
||||
|
||||
// bit 0, 1: drive select
|
||||
if (BIT(data, 0)) floppy = m_wd1770->subdevice<floppy_connector>("0")->get_device();
|
||||
@ -1553,8 +1556,11 @@ WRITE8_MEMBER(bbc_state::bbc_wd1770_status_w)
|
||||
// bit 3: density
|
||||
m_wd1770->dden_w(BIT(data, 3));
|
||||
|
||||
// bit 5: reset
|
||||
if (!BIT(data, 5)) m_wd1770->soft_reset();
|
||||
|
||||
// bit 4: interrupt enable
|
||||
m_177x_IntEnabled = !BIT(data, 4);
|
||||
m_wd177x_int_enabled = !BIT(data, 4);
|
||||
}
|
||||
|
||||
/***************************************
|
||||
@ -1571,10 +1577,6 @@ WRITE8_MEMBER(bbc_state::bbcm_wd1770l_write)
|
||||
floppy_image_device *floppy = NULL;
|
||||
|
||||
m_drive_control = data;
|
||||
//logerror("Drive control %d \n", data);
|
||||
|
||||
// bit 2: reset
|
||||
if (!BIT(data, 2)) m_wd1770->reset();
|
||||
|
||||
// bit 0, 1, 3: drive select
|
||||
if (BIT(data, 0)) floppy = m_wd1770->subdevice<floppy_connector>("0")->get_device();
|
||||
@ -1589,7 +1591,10 @@ WRITE8_MEMBER(bbc_state::bbcm_wd1770l_write)
|
||||
// bit 5: density
|
||||
m_wd1770->dden_w(BIT(data, 5));
|
||||
|
||||
m_177x_IntEnabled = 1;
|
||||
// bit 2: reset
|
||||
if (!BIT(data, 2)) m_wd1770->soft_reset();
|
||||
|
||||
m_wd177x_int_enabled = 1;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(bbc_state::bbcm_wd1772l_write)
|
||||
@ -1597,10 +1602,6 @@ WRITE8_MEMBER(bbc_state::bbcm_wd1772l_write)
|
||||
floppy_image_device *floppy = NULL;
|
||||
|
||||
m_drive_control = data;
|
||||
//logerror("Drive control %d \n", data);
|
||||
|
||||
// bit 2: reset
|
||||
if (!BIT(data, 2)) m_wd1772->reset();
|
||||
|
||||
// bit 0, 1, 3: drive select
|
||||
if (BIT(data, 0)) floppy = m_wd1772->subdevice<floppy_connector>("0")->get_device();
|
||||
@ -1615,20 +1616,23 @@ WRITE8_MEMBER(bbc_state::bbcm_wd1772l_write)
|
||||
// bit 5: density
|
||||
m_wd1772->dden_w(BIT(data, 5));
|
||||
|
||||
m_177x_IntEnabled = 1;
|
||||
// bit 2: reset
|
||||
if (!BIT(data, 2)) m_wd1772->soft_reset();
|
||||
|
||||
m_wd177x_int_enabled = 1;
|
||||
}
|
||||
|
||||
/**************************************
|
||||
BBC B Rom loading functions
|
||||
***************************************/
|
||||
|
||||
int bbc_state::bbc_load_cart(device_image_interface &image, generic_slot_device *slot)
|
||||
int bbc_state::bbc_load_rom(device_image_interface &image, generic_slot_device *slot)
|
||||
{
|
||||
UINT32 size = slot->common_get_size("rom");
|
||||
|
||||
if (size != 0x2000 && size != 0x4000)
|
||||
{
|
||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported cartridge size");
|
||||
image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unsupported ROM size");
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
|
||||
@ -1684,6 +1688,8 @@ int bbc_state::bbcm_load_cart(device_image_interface &image, generic_slot_device
|
||||
|
||||
DRIVER_INIT_MEMBER(bbc_state,bbc)
|
||||
{
|
||||
m_os01 = false;
|
||||
|
||||
m_rxd_cass = 0;
|
||||
m_nr_high_tones = 0;
|
||||
m_serproc_data = 0;
|
||||
@ -1697,6 +1703,7 @@ DRIVER_INIT_MEMBER(bbc_state,bbc)
|
||||
m_via6522_0->write_cb2(1);
|
||||
}
|
||||
|
||||
|
||||
// setup pointers for optional EPROMs
|
||||
void bbc_state::bbc_setup_banks(memory_bank *membank, int banks, UINT32 shift, UINT32 size)
|
||||
{
|
||||
|
@ -344,14 +344,14 @@ atombb // 1979 Acorn Atom
|
||||
//prophet2
|
||||
bbca // 1981 BBC Micro Model A
|
||||
bbcb // 1981 BBC Micro Model B w/8271 FDC
|
||||
bbcb_de // 1981 BBC Micro Model B (German)
|
||||
bbcb_de // 1982 BBC Micro Model B (German)
|
||||
bbcb_us // 1983 BBC Micro Model B (US)
|
||||
electron // 1983 Acorn Electron
|
||||
bbcb1770 // 1985 BBC Micro Model B w/1770 FDC
|
||||
bbcb1770 // 1984 BBC Micro Model B w/1770 FDC
|
||||
bbcbp // 1985 BBC Micro Model B+ 64K
|
||||
bbcbp128 // 1985 BBC Micro Model B+ 128K
|
||||
abc110 // 1985 ABC 110
|
||||
abc210 // 1985 ABC 210/Cambridge Workstation
|
||||
acw443 // 1985 ABC 210/Cambridge Workstation
|
||||
abc310 // 1985 ABC 310
|
||||
reutapm // 1985 Reuters APM Board
|
||||
bbcm // 1986 BBC Master 128
|
||||
|
Loading…
Reference in New Issue
Block a user