This commit is contained in:
David Haywood 2015-04-21 09:06:22 +01:00
commit a0054fed49
8 changed files with 186 additions and 18 deletions

View File

@ -2890,3 +2890,68 @@ void floppy_image_format_t::extract_sectors_from_bitstream_gcr5(const UINT8 *bit
}
}
}
void floppy_image_format_t::extract_sectors_from_bitstream_victor_gcr5(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size)
{
memset(sectors, 0, 256*sizeof(desc_xs));
// Don't bother if it's just too small
if(track_size < 100)
return;
// Start by detecting all id and data blocks
int hblk[100], dblk[100];
int hblk_count = 0, dblk_count = 0;
// Precharge the shift register to detect over-the-index stuff
UINT16 shift_reg = 0;
for(int i=0; i<16; i++)
if(sbit_r(bitstream, track_size-16+i))
shift_reg |= 0x8000 >> i;
// Scan the bitstream for sync marks and follow them to check for blocks
bool sync = false;
for(int i=0; i<track_size; i++) {
int bit = sbit_r(bitstream, i);
shift_reg = ((shift_reg << 1) | bit) & 0x3ff;
if (sync && !bit) {
UINT8 id = sbyte_gcr5_r(bitstream, i, track_size);
switch (id) {
case 0x07:
if(hblk_count < 100)
hblk[hblk_count++] = i-10;
break;
case 0x08:
if(dblk_count < 100)
dblk[dblk_count++] = i-10;
break;
}
}
sync = (shift_reg == 0x3ff);
}
// Then extract the sectors
int sectdata_pos = 0;
for(int i=0; i<hblk_count; i++) {
int pos = hblk[i];
ATTR_UNUSED UINT8 block_id = sbyte_gcr5_r(bitstream, pos, track_size);
UINT8 track = sbyte_gcr5_r(bitstream, pos, track_size);
UINT8 sector = sbyte_gcr5_r(bitstream, pos, track_size);
pos = dblk[i];
block_id = sbyte_gcr5_r(bitstream, pos, track_size);
sectors[sector].track = track & 0x7f;
sectors[sector].head = BIT(track, 7);
sectors[sector].size = 512;
sectors[sector].data = sectdata + sectdata_pos;
for(int j=0; j<sectors[sector].size; j++) {
UINT8 data = sbyte_gcr5_r(bitstream, pos, track_size);
sectdata[sectdata_pos++] = data;
}
}
}

View File

@ -522,6 +522,8 @@ protected:
void extract_sectors_from_bitstream_fm_pc(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size);
//! Commodore type sectors with GCR5 encoding
void extract_sectors_from_bitstream_gcr5(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size, int head, int tracks);
//! Victor 9000 type sectors with GCR5 encoding
void extract_sectors_from_bitstream_victor_gcr5(const UINT8 *bitstream, int track_size, desc_xs *sectors, UINT8 *sectdata, int sectdata_size);
//! @brief Get a geometry (including sectors) from an image.

View File

@ -298,16 +298,30 @@ bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *ima
return true;
}
bool victor9k_format::supports_save() const
{
return false;
}
int victor9k_format::get_rpm(int head, int track)
{
return rpm[speed_zone[head][track]];
}
int victor9k_format::get_image_offset(const format &f, int _head, int _track)
{
int offset = 0;
if (_head) {
for (int track = 0; track < f.track_count; track++) {
offset += compute_track_size(f, _head, track);
}
}
for (int track = 0; track < _track; track++) {
offset += compute_track_size(f, _head, track);
}
return offset;
}
int victor9k_format::compute_track_size(const format &f, int head, int track)
{
return sectors_per_track[head][track] * f.sector_base_size;
}
const victor9k_format::format victor9k_format::formats[] = {
{ //
floppy_image::FF_525, floppy_image::SSDD, 1224, 80, 1, 512
@ -376,4 +390,49 @@ const int victor9k_format::rpm[9] =
252, 267, 283, 300, 320, 342, 368, 401, 417
};
bool victor9k_format::save(io_generic *io, floppy_image *image)
{
const format &f = formats[0];
for(int head=0; head < f.head_count; head++) {
for(int track=0; track < f.track_count; track++) {
int sector_count = sectors_per_track[head][track];
int track_size = compute_track_size(f, head, track);
UINT8 sectdata[40*512];
desc_s sectors[40];
int offset = get_image_offset(f, head, track);
build_sector_description(f, sectdata, 0, sectors, sector_count);
extract_sectors(image, f, sectors, track, head, sector_count);
io_generic_write(io, sectdata, offset, track_size);
}
}
return true;
}
void victor9k_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count)
{
UINT8 bitstream[500000/8];
UINT8 sectdata[50000];
desc_xs sectors[256];
int track_size;
// Extract the sectors
generate_bitstream_from_track(track, head, cell_size[speed_zone[head][track]], bitstream, track_size, image);
extract_sectors_from_bitstream_victor_gcr5(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
for(int i=0; i<sector_count; i++) {
desc_s &ds = sdesc[i];
desc_xs &xs = sectors[ds.sector_id];
if(!xs.data)
memset((void *)ds.data, 0, ds.size);
else if(xs.size < ds.size) {
memcpy((void *)ds.data, xs.data, xs.size);
memset((UINT8 *)ds.data + xs.size, 0, xs.size - ds.size);
} else
memcpy((void *)ds.data, xs.data, ds.size);
}
}
const floppy_format_type FLOPPY_VICTOR_9000_FORMAT = &floppy_image_format_creator<victor9k_format>;

View File

@ -31,13 +31,10 @@ public:
virtual const char *description() const;
virtual const char *extensions() const;
int find_size(io_generic *io, UINT32 form_factor);
virtual int identify(io_generic *io, UINT32 form_factor);
void log_boot_sector(UINT8 *data);
floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count);
void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const;
virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
virtual bool supports_save() const;
virtual bool save(io_generic *io, floppy_image *image);
virtual bool supports_save() const { return true; }
static int get_rpm(int head, int track);
@ -48,6 +45,14 @@ protected:
static const int sectors_per_track[2][80];
static const int speed_zone[2][80];
static const int rpm[9];
int find_size(io_generic *io, UINT32 form_factor);
void log_boot_sector(UINT8 *data);
floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count);
void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, desc_s *sectors, int sector_count) const;
int get_image_offset(const format &f, int head, int track);
int compute_track_size(const format &f, int head, int track);
void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count);
};
extern const floppy_format_type FLOPPY_VICTOR_9000_FORMAT;

View File

@ -2922,8 +2922,8 @@ ROM_END
ROM_START( fghthistu ) /* DE-0395-1 PCB */
ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
ROM_LOAD32_WORD( "le-00.1f", 0x000000, 0x80000, CRC(a5c410eb) SHA1(e2b0cb2351782e1155ecc4029010beb7326fd874) ) /* Version 42-05, US */
ROM_LOAD32_WORD( "le-01.2f", 0x000002, 0x80000, CRC(7e148aa2) SHA1(b21e16604c4d29611f91d629deb9f041eaf41e9b) )
ROM_LOAD32_WORD( "le00-1.1f", 0x000000, 0x80000, CRC(fccacafb) SHA1(b7236a90a09dbd5870a16aa4e4eac5ab5c098418) ) /* Version 42-06, US */
ROM_LOAD32_WORD( "le01-1.2f", 0x000002, 0x80000, CRC(06a3c326) SHA1(3d8842fb69def93fc544e89fd0e56ada416157dc) )
ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_LOAD( "le02.18k", 0x00000, 0x10000, CRC(5fd2309c) SHA1(2fb7af54d5cd9bf7dd6fb4f6b82aa52b03294f1f) )
@ -2954,7 +2954,41 @@ ROM_START( fghthistu ) /* DE-0395-1 PCB */
ROM_LOAD( "ve-01a.4d", 0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
ROM_END
ROM_START( fghthistua ) /* DE-0380-2 PCB */
ROM_START( fghthistua ) /* DE-0395-1 PCB */
ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
ROM_LOAD32_WORD( "le00.1f", 0x000000, 0x80000, CRC(a5c410eb) SHA1(e2b0cb2351782e1155ecc4029010beb7326fd874) ) /* Version 42-05, US */
ROM_LOAD32_WORD( "le01.2f", 0x000002, 0x80000, CRC(7e148aa2) SHA1(b21e16604c4d29611f91d629deb9f041eaf41e9b) )
ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_LOAD( "le02.18k", 0x00000, 0x10000, CRC(5fd2309c) SHA1(2fb7af54d5cd9bf7dd6fb4f6b82aa52b03294f1f) )
ROM_REGION( 0x100000, "gfx1", 0 )
ROM_LOAD( "mbf00-8.8a", 0x000000, 0x100000, CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
ROM_REGION( 0x100000, "gfx2", 0 )
ROM_LOAD( "mbf01-8.9a", 0x000000, 0x100000, CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
ROM_REGION( 0x800000, "gfx3", 0 ) /* Sprites */
ROM_LOAD16_BYTE( "mbf02-16.16d", 0x000001, 0x200000, CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
ROM_LOAD16_BYTE( "mbf04-16.18d", 0x000000, 0x200000, CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
ROM_LOAD16_BYTE( "mbf03-16.17d", 0x400001, 0x200000, CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
ROM_LOAD16_BYTE( "mbf05-16.19d", 0x400000, 0x200000, CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
ROM_REGION(0x80000, "oki1", 0 )
ROM_LOAD( "mbf06.15k", 0x000000, 0x80000, CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
ROM_REGION(0x80000, "oki2", 0 )
ROM_LOAD( "mbf07.16k", 0x000000, 0x80000, CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
ROM_REGION(512, "proms", 0 )
ROM_LOAD( "kt-00.8j", 0, 512, CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) ) /* MB7124H type prom */
ROM_REGION( 0x0400, "plds", 0 )
ROM_LOAD( "ve-00.3d", 0x0000, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
ROM_LOAD( "ve-01a.4d", 0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
ROM_END
ROM_START( fghthistub ) /* DE-0380-2 PCB */
ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
ROM_LOAD32_WORD( "kz00-1.1f", 0x000000, 0x80000, CRC(3a3dd15c) SHA1(689b51adf73402b12191a75061b8e709468c91bc) ) /* Version 42-03, US */
ROM_LOAD32_WORD( "kz01-1.2f", 0x000002, 0x80000, CRC(86796cd6) SHA1(c397c07d7a1d03ba96ccb2fe7a0ad25b8331e945) )
@ -3749,8 +3783,9 @@ GAME( 1991, captavenua, captaven, captaven, captaven, deco32_state, captaven,
GAME( 1991, captavenj, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Japan Rev 0.2)", 0 )
GAME( 1993, fghthist, 0, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-07, DE-0380-2 PCB)", 0 )
GAME( 1993, fghthistu, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, DE-0395-1 PCB)", 0 )
GAME( 1993, fghthistua, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03, DE-0380-2 PCB)", 0 )
GAME( 1993, fghthistu, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-06, DE-0395-1 PCB)", 0 )
GAME( 1993, fghthistua, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, DE-0395-1 PCB)", 0 )
GAME( 1993, fghthistub, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03, DE-0380-2 PCB)", 0 )
GAME( 1993, fghthistj, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-07, DE-0395-1 PCB)", 0 )
GAME( 1993, fghthistja, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-05, DE-0380-2 PCB)", 0 )
GAME( 1993, fghthistjb, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-04, DE-0380-1 PCB)", 0 )

View File

@ -2175,7 +2175,7 @@ ROM_END
ROM_START( maxforce ) /* R3000 based, labeled as "Maximum Force 5-23-97 v1.05" */
ROM_REGION( 0x200000, "maincpu", 0 ) /* 2MB for IDT 79R3041 code */
ROM_LOAD32_BYTE( "maxf_105.hh", 0x00000, 0x80000, CRC(ec7f8167) SHA1(0cf057bfb1f30c2c9621d3ed25021e7ba7bdd46e) ) /* Usually found with "light grey" labels */
ROM_LOAD32_BYTE( "maxf_105.hl", 0x00001, 0x80000, CRC(3172611c) SHA1(00f14f871b737c66c20f95743740d964d0be3f24) )
ROM_LOAD32_BYTE( "maxf_105.hl", 0x00001, 0x80000, CRC(3172611c) SHA1(00f14f871b737c66c20f95743740d964d0be3f24) ) /* Also found labeled as "MAXIMUM FORCE EE FIX PROG" */
ROM_LOAD32_BYTE( "maxf_105.lh", 0x00002, 0x80000, CRC(84d49423) SHA1(88d9a6724f1118f2bbef5dfa27accc2b65c5ba1d) )
ROM_LOAD32_BYTE( "maxf_105.ll", 0x00003, 0x80000, CRC(16d0768d) SHA1(665a6d7602a7f2f5b1f332b0220b1533143d56b1) )

View File

@ -6113,8 +6113,9 @@ ragtimea // MBD (c) 1992 (Japan)
dblewing // MBE (c) 1993 Mitchell
fghthist // MBF (c) 1993 Data East Corporation (World) DE-0380-2 PCB
fghthistu // MBF (c) 1993 Data East Corporation (US) DE-0395-1 PCB
fghthistua // MBF (c) 1993 Data East Corporation (US) DE-0395-1 PCB
fghthistj // MBF (c) 1993 Data East Corporation (Japan) DE-0395-1 PCB
fghthistua // MBF (c) 1993 Data East Corporation (US) DE-0380-2 PCB
fghthistub // MBF (c) 1993 Data East Corporation (US) DE-0380-2 PCB
fghthistja // MBF (c) 1993 Data East Corporation (Japan) DE-0380-2 PCB
fghthistjb // MBF (c) 1993 Data East Corporation (Japan) DE-0380-1 PCB
hvysmsh // MBG (c) 1993 Data East Corporation (World)

View File

@ -25,7 +25,8 @@
*MP2105 TMS1370 1979, Gakken Poker, Entex Electronic Poker
*MP2139 TMS1370? 1982, Gakken Galaxy Invader 1000
*MP2788 ? 1980, Bandai Flight Time (? note: VFD-capable)
@MP3226 TMS1000 1978, Milton Bradley Simon
*MP3208 TMS1000 1977, Milton Bradley Electronic Battleship (1977, model 4750A or B)
@MP3226 TMS1000 1978, Milton Bradley Simon (model 4850)
*MP3301 TMS1000 1979, Milton Bradley Big Trak
*MP3320A TMS1000 1979, Coleco Head to Head Basketball
MP3403 TMS1100 1978, Marx Electronic Bowling -> elecbowl.c