Commit Graph

56 Commits

Author SHA1 Message Date
AJR
94eaa918fc formats/fs_fat.cpp: Various fixes
- Get the volume label from the root directory, rather than from the extended BPB (which is less reliable)
- Ignore long file name entries for now

* floptool: Add new line to error message report
2024-02-10 07:48:27 -05:00
AJR
07b3bdd04f Floppy format API refinements
- Add noexcept to format information overrides and several simple floppy_image accessors.
- Be more const-correct and use references instead of raw pointers wherever applicable. In particular, floppy_image_device::load and floppy_image_device::save now take a reference to floppy_image rather than a pointer, const-qualified in the latter case.
2023-10-08 09:02:47 -04:00
ajrhacker
d8f1b27939
Filesystem code refactoring (#11570)
- Separate fs::block_t and fs::filesystem_t to a new source file and header
- Remove inclusion of flopimg.h from fsmgr.h
2023-09-27 09:48:50 +02:00
npwoods
c831208d8c
Added support for specifying volume attributes in 'floptool flopcreate' (#9590)
An example command line:

  flopcreate vdk coco_rawdsk_os9_35 newdisk.vdk -name mycooldisk -creation_date "1999-02-28 13:23:47"

Attributes are identified on the command line prefixed with '-'; if this is not the preferred syntax this can be changed.

Implementing this also forced a change to fs::meta_value where the various as_*() calls can now be called without respect to which type the fs::meta_value is; this is necessary so that floptool code doesn't need to "own" parsing of the various types of fs::meta_value.

And with this change, fs::meta_value::to_string() is now replaced by fs::meta_value::as_string()
2022-10-16 20:04:19 +02:00
AJR
6252b49c47 corefile.h: Move filename utilities to path.h 2022-09-25 22:08:17 -04:00
Vas Crabb
14e0582083 Miscellaneous fixes:
* util/ioprocsvec.h: Fixed truncating when a write doesn't reach the end
  of stream. [F.Ulivi]
* floptool.cpp: Fixed reversed error checking logic. [F.Ulivi]
* Fixed SUBTARGET=tiny build (required Sega encrypted CPUs to be added).
2022-08-28 01:12:08 +10:00
napobear
c5903dc33b
formats: Fixed some unused local variable compiler errors. (#10251) 2022-08-25 22:23:36 +10:00
Olivier Galibert
43d01755e6 fs: new API, blk_t is probably going to change too 2022-06-28 23:08:45 +02:00
npwoods
945cb29e74
Changed fs::meta_value::to_string() to not be static and not require meta_type (#9510)
No need to pass in the meta_type when using std::visit() on the std::variant
2022-04-03 21:38:57 -04:00
Olivier Galibert
3728913a4e floppy: revisit the identify returns 2022-03-30 21:26:37 +02:00
Olivier Galibert
0e7d9c43e0 floptool: Allow creating unformatted images again 2022-03-23 14:25:11 +01:00
npwoods
897e41ff06
Fixing error message in Floptool (#9404) 2022-03-19 22:48:29 -04:00
pnp2084
97fa18881d
floptool: Fixed typo in error message. (#9365)
"Error: Aaving" should be "Error: Saving"
2022-03-04 04:49:11 +11:00
npwoods
fd73621285
Created an initial file system implementation for OS-9 under the CoCo (#9096)
* Created an initial file system implementation for OS-9 under the CoCo

* Minor fixes to directory entry handling

* Changed to use fsblk_t::r[8|16|24|32]b()
- Changed the above functions to be const
2022-01-07 18:04:07 +01:00
npwoods
6e7ff938b0
Fixing floptool usage message: (#9088)
* Fixing floptool usage message:
- Getting the name of the tool from argv[0] (stop hardcoding floptool.exe)
- Adding missing hddir/hdread/hdwrite declarations
2022-01-04 08:07:50 -05:00
npwoods
84236b7f7c
Added a 'version' verb to floptool (#9079) 2022-01-04 05:20:42 +11:00
AJR
f6f77bf639 Move filesystem library into separate namespace and use shorter uX type names there 2021-12-31 13:28:25 -05:00
AJR
1214aac092 Filesystem code cleanup
- Eliminate dependencies on emu.h, replacing most fatalerror calls and floptool's ersatz emu_fatalerror class with standard exception classes
- Use range-based std::string constructors in some methods
- Move filesystem metadata handling to a separate source file
- Eliminate src/emu as an include path for libformats (necessitates kludge in ti99_dsk.cpp)
2021-12-14 21:42:42 -05:00
Vas Crabb
e8bbea1fc6
formats, osd, util: Started refactoring file I/O stuff. (#8456)
Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic.  Also replaced core_file's build-in zlib compression with a filter.

unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename.

Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums.

Allow mounting TI-99 RPK from inside archives.
2021-08-22 09:06:15 +10:00
Vas Crabb
4b075a2c6f srcclean in preparation for release 2021-06-27 13:34:50 +10:00
Olivier Galibert
da1bd3b0ec reorganize the floptool code, add some write support 2021-05-24 14:06:06 +02:00
Vas Crabb
5fe20586ee srcclean for release 2021-05-23 17:33:52 +10:00
ksherlock
7f19153211
floptool - format/filesystem errors were printing the wrong argument (#8088) 2021-05-21 22:41:15 -04:00
Olivier Galibert
3afebb520a jasmin: Support write 2021-05-16 19:43:43 +02:00
Olivier Galibert
94db317064 prodos: Add file and resource reading 2021-05-11 21:52:25 +02:00
Olivier Galibert
ba6e0b72a7 prodos: Start of read support 2021-05-02 21:24:45 +02:00
Olivier Galibert
e72e97b174 fs: Add full jasmin read support 2021-04-30 21:43:16 +02:00
Vas Crabb
4023b48efd floptool.cpp: Be stricter about types. 2021-04-30 04:42:05 +10:00
Olivier Galibert
18d1768325 floppy: first steps on metadata, and hopefully make gcc happier on enumerate 2021-04-28 22:58:57 +02:00
Olivier Galibert
8709e06b67 floppy: start block-devicing fielsystem support 2021-04-28 16:17:56 +02:00
Vas Crabb
e298c31a69 srcclean in preparation for release 2021-03-28 14:34:50 +11:00
Olivier Galibert
b0403c0e3d Try to fix osx compile 2021-03-05 11:37:27 +01:00
Olivier Galibert
92326e47af floppy: Beginning of the support for preformatted floppy images.
What's missing:
- parameters (like the disk name when it exists)
- possibly a cleanup of ram_open and friends (but not sure of the appropriate direction in which to go)
2021-03-05 10:17:20 +01:00
Olivier Galibert
d436cbd3a6 formats: Create mame_formats_full_list which gives access to all the supported formats, make floptool use it. Castool should use it too probably, but I don't want to touch it. 2021-03-04 10:14:24 +01:00
AJR
bc0146c203 Eliminate ARRAY_LENGTH template in favor of C++17's std::size
* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h

* sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration

* gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset

* emucore.h: Remove obsolete typedef
2021-02-14 11:05:57 -05:00
arbee
1029a103aa ap_dsk35: make .2MG its own separate format handler [R. Belmont] 2021-02-05 22:55:12 -05:00
leesaudan2
3fc703e806
Added Apple 2 disk image format: .nib (read-only support) (#7725)
This format was not supported by the new floppy subsystem.
This commit provides read-only support of .nib files.
2021-01-30 19:35:58 +01:00
Olivier Galibert
bd2db8dcc6 flopimg: Change the extracted bitstreams into vector<bool>
flopimg: Change the extracted sectors into vector<vector<uint8_t>>
flopimg: Add a Mac sector extraction
apple 3.5 gcr: Generalize track creation/extraction
apple 3.5 gcr: Add a pure sector format
2021-01-22 00:02:30 +01:00
Olivier Galibert
c18d0b8a00 Update floptool to the new prototypes 2021-01-09 23:03:43 +01:00
AJR
60e518cc50 Low-level #include overhaul
- vecstream.h: Revert changes made in aa29519528. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h.
- strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified.
- osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments.
- Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
2021-01-02 15:18:15 -05:00
68bit
d5187fe74c MDOS disk format support
Motorola DOS, used on the EXORciser etc.
2020-07-03 00:16:35 +10:00
Sergey Svishchev
c155d424ac ibmxdf_dsk: IBM Extended Disk Format support (nw) 2020-03-02 20:21:04 +03:00
68bit
a87c3b6f7a wd177x_dsk: generalize to allow custom track format variations
Add a get_track_format() method that can be overridden to supply format
variations for any track and head. The code is generalised to account for such
variations. The default method returns the passed format, so this change is
neutral for existing formats.

Simplify the FLEX DSK format code. There are now simply format variation
descriptions for the second track that have the sector ID continuing in
sequence from the first track, rather than specialized code.

Extend the FLEX format to support variations in the sectors ID of the first
two sectors. The FLEX 6800 boot sectors have IDs based at zero rather than
one. Extend the FLEX format to support variations for which the first track,
on both sides, is single density on an otherwise double density disk which was
historically a common format.

Extend the OS9 disk format to support variations for which the first track, on
only the first side, is single density on an otherwise double density
disk. OS9 for the SWTPC and Gimix typically used such formats.

Extend the OS9 disk format to support variations with a base sector ID of zero
in contrast to the existing COCO OS9 format which uses a based sector ID of
one. The OS9 format identification code is extended to rely on the optional
information stored in the OS9 LSN0 header to identify COCO format disks, and
all COCO format disks appear to have this optional information in a regular
enough format.
2020-02-08 00:12:05 +11:00
Vas Crabb
a7fec751ed srcclean, manual adjustments (nw) 2020-01-26 12:39:27 +11:00
firewave
399515c7a7 use C++ library includes (nw) 2020-01-22 13:31:52 +01:00
fulivi
2ec25ca6d5 Emulation of isbc202 floppy disk controller (#6119)
* imds2: isbc202 floppy disk controller added

* imds2: attempt to fix problems with CI checks
2020-01-04 16:11:48 -05:00
68bit
10f480911d swtpc09: add a UniFLEX specific floppy format.
The UniFLEX disk format is not compatible with the Flex format. Significantly it
does not use a mix of single density for booting on some double density disks
which makes it simpler - hardware required a new boot ROM to run UniFLEX.
Further, the UniFLEX sector size is 512 bytes versus 256 for Flex, and the
UniFLEX 'SIR' info sector record is completely different to the info on Flex
disk, and the file system format is also not at all compatible.

Thus the UniFlex format can rely largely on the WD17xx format, with an
overload to handle the sector numbering on the second side continuing from the
first side (one feature in common with the Flex format). This gives a quick
'save' capability and shares code.

Support for 8" disks is included as this was the initial distribution format
and the only one found so far.
2019-08-13 13:42:13 +10:00
Christian Groessler
22f96480b1 add write support for Olivetti M20 floppy images
m20_dsk.cpp: add write support
floptool.cpp: add m20 format support
2019-08-06 00:14:51 +02:00
Sergey Svishchev
a152d1125f agat: basic emulation of agat9 (video, apple compat mode, LLE floppy)
also included: MX floppy format (nw)
2019-07-02 01:13:38 +03:00
Olivier Galibert
d43d8bcecf apple2: Add WOZ format [O. Galibert] 2018-04-24 20:41:54 +02:00