Commit Graph

133 Commits

Author SHA1 Message Date
smf-
86523aabea either I misunderstand the spec or the code but judge dredd doesn't like this change (nw) 2013-06-12 19:07:06 +00:00
smf-
6f67159d96 moved block_count to the device, renamed some ide commands to make them closer to the spec & also use the block count for triggering the first irq on read/write multiple (nw) 2013-06-12 18:16:53 +00:00
smf-
4701b261cb moved password fields off the ide controller (nw) 2013-06-12 17:47:10 +00:00
smf-
900595dd05 moved more state from idectrl.h (nw) 2013-06-12 17:28:00 +00:00
smf-
4b1d6da30d moved the buffer from the ide controller to the device (nw) 2013-06-11 21:58:07 +00:00
smf-
598d207e53 If there is no drive selected then there is nothing to read from, although I'm not sure what value you'd expect to receive. (nw) 2013-06-11 18:59:57 +00:00
Miodrag Milanovic
16f5234d43 Cleanups and version bump 2013-06-11 07:16:42 +00:00
smf-
18a537031e converted to device_timer() (nw) 2013-06-10 17:34:27 +00:00
smf-
407e3b8882 Decoupled the IDE bus master emulation from the hard drive emulation [smf] 2013-06-10 08:42:39 +00:00
smf-
02f48983ca Started to separate the bus master dma from the drive emulation (nw) 2013-06-09 18:58:02 +00:00
smf-
b0a5f6fa03 created a new device for the bus master ide controller, but the implementation is still in the ide controller. (nw) 2013-06-09 15:44:43 +00:00
smf-
9eafc98ed9 First pass at tidying up ide interface. It no longer tries to force everything to act as a PC. A copy of the VIA VT83C461 datasheet would be useful to remove some of the hacks added to make the games using it work again. [smf] 2013-06-08 15:42:11 +00:00
smf-
eb943bed5a moved handlers into the ide_controller_device (nw) 2013-06-06 16:26:48 +00:00
smf-
a06026456b moved where cur_drive is updated & changed pcmcia trampoline definition to 16 bit. (nw) 2013-06-05 20:29:15 +00:00
smf-
636876c2d7 Merge the mame and mess ide hd device (nw) 2013-06-05 14:25:17 +00:00
smf-
2b9a645218 Started to split ide hd from ide controller [smf] 2013-06-05 09:09:34 +00:00
smf-
631605ff43 changed i/o to 8/16 bit & removed the flash trampolines in the driver.(nw) 2013-05-16 09:23:46 +00:00
Miodrag Milanovic
051011971f Expanded device_t constructor with parameters for short name and source file location [Miodrag Milanovic] 2013-03-26 15:18:37 +00:00
Scott Stone
8a069502f1 Chihiro.c [Samuele Zannoli]
* Implentation of nvidia register combiners.
 * Fix for ide_controller_device class for most uninitialized variables.
2013-03-04 23:02:36 +00:00
R. Belmont
c95286710d idectrl: words 57/58 of IDENTIFY DEVICE are total sectors, not sectors per track [R. Belmont]
As commented, this is the case for ATA-1, -2, -3, -4, and -5.  The CFFA2 Apple 
II IDE card firmware relies on this value being as documented in the standards 
to properly detect the drive size, and none of the usual sensitive Atari/Midway
games are broken by the change.

(This field is unused in ATA-6 and later).
2013-02-20 05:30:51 +00:00
Scott Stone
ec43bbcb96 idectrl.c: [Peter Ferrie]
- Fix regression in Fishin' Frenzy without breaking Area 51 Site 4.
2013-02-06 21:22:34 +00:00
smf-
1940866c70 output of new srcclean changes that are relatively small [smf] 2013-01-11 19:43:14 +00:00
Miodrag Milanovic
0e19f641d3 Cleanups and version bump 2013-01-11 07:32:46 +00:00
Scott Stone
87731393f5 idectrl.c - fix phantom slave drive detection problem. [Peter Ferrie] 2013-01-09 11:50:44 +00:00
Scott Stone
dac3c173c6 Revert of a portion of r20073:
idectrl.c  [Peter Ferrie]
- correct status flags for multi-sector reads
- implement more correct controller reset values
- fix phantom slave drive detection problem

Causes problems noted with many MAME games such as Area 51: Site 4, Primal Rage 2, All Viper.c games among others that are either not starting or constantly RE-starting looking for proper IDE communications.
2013-01-05 22:43:37 +00:00
Scott Stone
99345a6c27 8042kbdc.c [Peter Ferrie]
- add support for keyboard enable command
- add support for keyboard reset command

idectrl.c  [Peter Ferrie]
- correct status flags for multi-sector reads
- implement more correct controller reset values
- fix phantom slave drive detection problem

calchase.c  [Peter Ferrie]
- corrected memory map to 64kb blocks
- corrected access to PAM register
- removed execution hack

queen.c  [Peter Ferrie]
- split BIOS region into 64kb blocks
- implement missing PAM registers
- remove unused PAM regions

savquest.c  [Peter Ferrie]
- split BIOS region into 16kb blocks
- implement missing PAM registers
- correct slave_ack configuration member declaration
2013-01-05 08:53:11 +00:00
smf-
029ef2cd18 cleaned up the ide controller enough to change the irq to a DEVCB2 [smf] 2012-10-26 01:12:21 +00:00
Aaron Giles
621ac620ae Since nobody checks for NULLs anyway, make
device_memory_interface::space() assert against NULL and
return a reference, and pushed references throughout all 
address space usage in the system. Added a has_space() 
method to check for those rare case when it is ambiguous.
[Aaron Giles]

Also reinstated the generic space and added fatal error
handlers if anyone tries to actually read/write from it.
2012-09-19 19:48:09 +00:00
Aaron Giles
e33b41ee01 Stop allocating arrays of UINT8s for the tokens, when
we can allocate objects of the real type.
2012-09-18 05:28:33 +00:00
Aaron Giles
ab97dc30ef First pass at modernizing struct definitions. 2012-09-15 21:47:30 +00:00
Phil Bennett
fe13f1a310 idetrl.c - Support IDE command 0x31 (IDE_COMMAND_WRITE_MULTIPLE_NORETRY) [Phil Bennett] 2012-09-15 12:25:18 +00:00
Miodrag Milanovic
071eb8de4b Cleanup and some inheritance fixes (no whatsnew) 2012-09-03 15:00:20 +00:00
Miodrag Milanovic
b711b1a007 conversion of legacy devices into modern wip (no whatsnew) 2012-09-03 13:56:17 +00:00
Miodrag Milanovic
aa9bbe5371 Removed legacy inline_config support and updated devices using it (no whatsnew) 2012-08-30 14:27:14 +00:00
Miodrag Milanovic
f59f48e859 More proper solution for not connected IDE devices (no whatsnew) 2012-08-20 14:41:34 +00:00
Miodrag Milanovic
032b0f355e Fix for MT bug #04844, no need to clear status if drive not connected (no whatsnew) 2012-07-15 14:42:44 +00:00
Miodrag Milanovic
932910a75e fixed some "comparison is always true/false" warnings reported by clang by Firewave
in timer.c I have commented not removed lines that are always false
2012-05-20 11:43:57 +00:00
Curt Coder
10d8064c72 Added the clock counter chain and other common functions into device_rtc_interface, removing duplicated code in RTC implementations. Rewrote the Dallas DS1302 to support additional features needed by IDE64 in MESS. [Curt Coder] 2012-04-27 21:23:39 +00:00
Miodrag Milanovic
86d811c58a Sync with MESS (no whatsnew) 2012-04-27 13:08:09 +00:00
Miodrag Milanovic
bef76826c9 fixed several Visual Studio compiler warnings and 64-bit libflac compilation by Firewave, and idectrl change from Carl (no whatsnew) 2012-02-29 09:13:22 +00:00
Angelo Salese
cf4b58b6f6 Clean-ups and version bump 2012-02-19 15:23:23 +00:00
Aaron Giles
f0823886a6 Major CHD/chdman update. The CHD version number has been increased
from 4 to 5. This means any diff CHDs will no longer work. If you
absolutely need to keep the data for any existing ones you have,
find both the diff CHD and the original CHD for the game in question 
and upgrade using these commands:

  rename diff\game.dif diff\game-old.dif
  chdman copy -i diff\game-old.dif -ip roms\game.chd -o diff\game.dif -op roms\game.chd -c none

Specifics regarding this change:

Defined a new CHD version 5. New features/behaviors of this version:
  - support for up to 4 codecs; each block can use 1 of the 4
  - new LZMA codec, which tends to do better than zlib overall
  - new FLAC codec, primarily used for CDs (but can be applied anywhere)
  - upgraded AVHuff codec now uses FLAC for encoding audio
  - new Huffman codec, used to catch more nearly-uncompressable blocks
  - compressed CHDs now use a compressed map for significant savings
  - CHDs now are aware of a "unit" size; each hunk holds 1 or more units
     (in general units map to sectors for hard disks/CDs)
  - diff'ing against a parent now diffs at the unit level, greatly
     improving compression

Rewrote and modernized chd.c. CHD versions prior to 3 are unsupported,
and version 3/4 CHDs are only supported for reading. Creating a new
CHD now leaves the file open.  Added methods to read and write at the 
unit and byte level, removing the need to handle this manually. Added
metadata access methods that pass astrings and dynamic_buffers to
simplify the interfaces. A companion class chd_compressor now
implements full multithreaded compression, analyzing and compressing
multiple hunks independently in parallel. Split the codec 
implementations out into a separate file chdcodec.*

Updated harddisk.c and cdrom.c to rely on the caching/byte-level read/
write capabilities of the chd_file class. cdrom.c (and chdman) now also 
pad CDs to 4-frame boundaries instead of hunk boundaries, ensuring that
the same SHA1 hashes are produced regardless of the hunk size.

Rewrote chdman.exe entirely, switching from positional parameters to
proper options. Use "chdman help" to get a list of commands, and
"chdman help <command>" to get help for any particular command. Many 
redundant commands were removed now that additional flexibility is
available. Some basic mappings:

  Old: chdman -createblankhd <out.chd> <cyls> <heads> <secs>
  New: chdman createhd -o <out.chd> -chs <cyls>,<heads>,<secs>

  Old: chdman -createuncomphd <in.raw> <out.chd> ....
  New: chdman createhd -i <in.raw> -o <out.chd> -c none ....

  Old: chdman -verifyfix <in.chd>
  New: chdman verify -i <in.chd> -f

  Old: chdman -merge <parent.chd> <diff.chd> <out.chd>
  New: chdman copy -i <diff.chd> -ip <parent.chd> -o <out.chd>

  Old: chdman -diff <parent.chd> <compare.chd> <diff.chd>
  New: chdman copy -i <compare.chd> -o <diff.chd> -op <parent.chd>

  Old: chdman -update <in.chd> <out.chd>
  New: chdman copy -i <in.chd> -o <out.chd>

Added new core file coretmpl.h to hold core template classes. For now
just one class, dynamic_array<> is defined, which acts like an array
of a given object but which can be appended to and/or resized. Also
defines dynamic_buffer as dynamic_array<UINT8> for holding an 
arbitrary buffer of bytes. Expect to see these used a lot.

Added new core helper hashing.c/.h which defines classes for each of
the common hashing methods and creator classes to wrap the 
computation of these hashes. A future work item is to reimplement
the core emulator hashing code using these.

Split bit buffer helpers out into C++ classes and into their own
public header in bitstream.h.

Updated huffman.c/.h to C++, and changed the interface to make it
more flexible to use in nonstandard ways. Also added huffman compression
of the static tree for slightly better compression rates.

Created flac.c/.h as simplified C++ wrappers around the FLAC interface.
A future work item is to convert the samples sound device to a modern
device and leverage this for reading FLAC files.

Renamed avcomp.* to avhuff.*, updated to C++, and added support for
FLAC as the audio encoding mechanism. The old huffman audio is still
supported for decode only.

Added a variant of core_fload that loads to a dynamic_buffer.

Tweaked winwork.c a bit to not limit the maximum number of processors
unless the work queue was created with the WORK_QUEUE_FLAG_HIGH_FREQ
option. Further adjustments here are likely going to be necessary.

Fixed bug in aviio.c which caused errors when reading some AVI files.
2012-02-16 09:47:18 +00:00
Miodrag Milanovic
7f01dff571 Small cleanup (no whatsnew) 2012-02-09 10:59:11 +00:00
Miodrag Milanovic
ba0b21c8fb IDE controller now support two slots, currently used devices are made as slot devices [Miodrag Milanovic]
out of log: note that rom regions for disks are now changed in order to support multiple connected drives in cases needed.
2012-02-09 10:27:12 +00:00
Miodrag Milanovic
510d4caf5e Clean it a bit (no whatsnew) 2012-01-26 15:19:53 +00:00
Miodrag Milanovic
b5450315d5 fixed idectrl regression (no whatsnew) 2012-01-26 15:17:35 +00:00
Angelo Salese
7b631e4c5b Clean-ups and version bump 2012-01-15 21:40:54 +00:00
Miodrag Milanovic
29e524c885 Added support for 2 drives on IDE controller [Miodrag Milanovic] 2012-01-12 15:49:24 +00:00
Miodrag Milanovic
17503e2d39 Preps for doing idectrl change to work with more devices (no whatsnew) 2012-01-11 15:57:05 +00:00
Miodrag Milanovic
fc5cae0fff Added delayed interrupts in idectrl to enable booting on some older bioses [Carl] 2012-01-06 07:07:49 +00:00