Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master games grimoire by Lubomir Blaha (8cadeee53ad3187846867db23b1a91b42bb85a72)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Lubomir Blaha <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master games grimoire by Lubomir Blaha (8cadeee53ad3187846867db23b1a91b42bb85a72)
  • Date: Sun, 10 Feb 2008 12:37:09 -0600

GIT changes to master games grimoire by Lubomir Blaha <lblaha AT sourcemage.org>:

games-emulators/zx-fuse-utils/DETAILS | 7
games-emulators/zx-fuse-utils/HISTORY | 5
games-emulators/zx-fuse-utils/fuse.gpg |binary
games-emulators/zx-fuse/CONFIGURE | 2
games-emulators/zx-fuse/DEPENDS | 1
games-emulators/zx-fuse/DETAILS | 10
games-emulators/zx-fuse/HISTORY | 6
games-emulators/zx-fuse/fuse.gpg |binary
games-libs/lib765/DETAILS | 4
games-libs/lib765/HISTORY | 3
games-libs/libspectrum/CONFIGURE | 1
games-libs/libspectrum/DETAILS | 7
games-libs/libspectrum/HISTORY | 7
games-libs/libspectrum/PRE_BUILD | 6
games-libs/libspectrum/fuse.gpg |binary
games-libs/libspectrum/libspectrum_ide.c_divip_patch | 330
+++++++++++++++++++
16 files changed, 377 insertions(+), 12 deletions(-)

New commits:
commit 8cadeee53ad3187846867db23b1a91b42bb85a72
Author: Lubomir Blaha <lblaha AT sourcemage.org>
Commit: Lubomir Blaha <lblaha AT sourcemage.org>

games-emulators/zx-fuse: fixed permissions and ownership of installed
binary

commit 522ac70a3f63fb8998facb20ed98d353ad07d966
Author: Lubomir Blaha <lblaha AT sourcemage.org>
Commit: Lubomir Blaha <lblaha AT sourcemage.org>

games-emulators/zx-fuse-utils: Updated to version 0.9.0

commit 7c5d51a857d4b83c64392d10104116e9b7daaf86
Author: Lubomir Blaha <lblaha AT sourcemage.org>
Commit: Lubomir Blaha <lblaha AT sourcemage.org>

games-emulators/zx-fuse: Updated to version 0.9.0

commit aeafe0cea88e6e97bf503c8ac9e19375de0f6c58
Author: Lubomir Blaha <lblaha AT sourcemage.org>
Commit: Lubomir Blaha <lblaha AT sourcemage.org>

games-libs/libspectrum: Updated to version 0.4.0

commit 340b81acafa2930c081362282a5b1964d728ce97
Author: Lubomir Blaha <lblaha AT sourcemage.org>
Commit: Lubomir Blaha <lblaha AT sourcemage.org>

games-libs/lib765: Updated to version 0.4.1

diff --git a/games-emulators/zx-fuse-utils/BUILD
b/games-emulators/zx-fuse-utils/BUILD
old mode 100644
new mode 100755
diff --git a/games-emulators/zx-fuse-utils/DETAILS
b/games-emulators/zx-fuse-utils/DETAILS
index 54da695..3ca00a1 100755
--- a/games-emulators/zx-fuse-utils/DETAILS
+++ b/games-emulators/zx-fuse-utils/DETAILS
@@ -1,10 +1,13 @@
SPELL=zx-fuse-utils
PKG=fuse-utils
- VERSION=0.8.0.1
+ VERSION=0.9.0
SOURCE=$PKG-$VERSION.tar.gz
+ SOURCE2=$SOURCE.sig
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$PKG-$VERSION
-
SOURCE_HASH=sha512:ee83f2e7ebc87c6589f8322218ca6bafc8b5b8f9fb2a02860d96e824d1c5bfdd5c6d5849f16d9b1e66ee0f1b4b17aad03efd7365b979e6d522caeccd96b7a15c
+ SOURCE_GPG=fuse.gpg:$SOURCE2:UPSTREAM_KEY
+ SOURCE2_IGNORE=signature
SOURCE_URL[0]=$SOURCEFORGE_URL/fuse-emulator/$SOURCE
+ SOURCE2_URL[0]=${SOURCE_URL[0]}.sig
WEB_SITE=http://fuse-emulator.sourceforge.net/fuse.php
ENTERED=20061007
LICENSE[0]=GPL
diff --git a/games-emulators/zx-fuse-utils/HISTORY
b/games-emulators/zx-fuse-utils/HISTORY
index fa1c395..d494f1f 100644
--- a/games-emulators/zx-fuse-utils/HISTORY
+++ b/games-emulators/zx-fuse-utils/HISTORY
@@ -1,3 +1,8 @@
+2008-02-09 Lubomir Blaha <lblaha AT sourcemage.org>
+ * fuse.gpg: added gpg keyring
+ * DETAILS: updated spell to 0.9.0
+ converted to upstream signature checking
+
2007-07-15 Lubomir Blaha <tritol AT trilogic.cz>
* DETAILS: updated to 0.8.0.1
* BUILD: created (default_games_build)
diff --git a/games-emulators/zx-fuse-utils/fuse.gpg
b/games-emulators/zx-fuse-utils/fuse.gpg
new file mode 100644
index 0000000..3d50004
Binary files /dev/null and b/games-emulators/zx-fuse-utils/fuse.gpg differ
diff --git a/games-emulators/zx-fuse/CONFIGURE
b/games-emulators/zx-fuse/CONFIGURE
index 4bda871..8a27ce8 100755
--- a/games-emulators/zx-fuse/CONFIGURE
+++ b/games-emulators/zx-fuse/CONFIGURE
@@ -1,4 +1,4 @@
config_query_list ZX_FUSE_VIDEO "Select video output?" \
- svgalib framebuffer sdl ggi gtk+ gtk+2 &&
+ svgalib framebuffer sdl ggi gtk+2 &&
config_query_option USEJOYSTICK "Use real joystick for Kempston?" n \
"--with-joystick" "--without-joystick"
diff --git a/games-emulators/zx-fuse/DEPENDS b/games-emulators/zx-fuse/DEPENDS
index f336c86..b11d03c 100755
--- a/games-emulators/zx-fuse/DEPENDS
+++ b/games-emulators/zx-fuse/DEPENDS
@@ -32,7 +32,6 @@ case $ZX_FUSE_VIDEO in
framebuffer) depends directfb "--with-fb" ;;
sdl) depends sdl "--with-sdl" ;;
ggi) depends libggi "--with-ggi" ;;
- gtk+) depends gtk+ "--with-gtk" ;;
gtk+2) depends gtk+2 "--with-gtk2" ;;
esac &&
depends libspectrum
diff --git a/games-emulators/zx-fuse/DETAILS b/games-emulators/zx-fuse/DETAILS
index 791766f..9b41855 100755
--- a/games-emulators/zx-fuse/DETAILS
+++ b/games-emulators/zx-fuse/DETAILS
@@ -1,14 +1,16 @@
SPELL=zx-fuse
- PKG=fuse
- VERSION=0.8.0.1
+ PKG=fuse
+ VERSION=0.9.0
SOURCE=$PKG-$VERSION.tar.gz
+ SOURCE2=$SOURCE.sig
SOURCE_URL[0]=$SOURCEFORGE_URL/fuse-emulator/$SOURCE
+ SOURCE2_URL[0]=${SOURCE_URL[0]}.sig
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$PKG-$VERSION
WEB_SITE=http://fuse-emulator.sourceforge.net/fuse.php
ENTERED=20040425
LICENSE[0]=GPL
-
SOURCE_HASH=sha512:aafb9b246842b3b4ce61f91b03eb8e818bc3060290a758ad55babdc4f2756e28dc5c39795a4ba3f554eeb2070a2da1fd97565b2a092408250ac6956505efe315
- BUILD_API=1
+ SOURCE_GPG=fuse.gpg:$SOURCE2:UPSTREAM_KEY
+ SOURCE2_IGNORE=signature
SHORT="Fuse (the Free Unix Spectrum Emulator)"
cat << EOF
Fuse (the Free Unix Spectrum Emulator) was originally,
diff --git a/games-emulators/zx-fuse/HISTORY b/games-emulators/zx-fuse/HISTORY
index c2db0c0..7a6df42 100644
--- a/games-emulators/zx-fuse/HISTORY
+++ b/games-emulators/zx-fuse/HISTORY
@@ -1,3 +1,9 @@
+2008-02-09 Lubomir Blaha <lblaha AT sourcemage.org>
+ * fuse.gpg: added gpg keyring
+ * DETAILS: updated spell to 0.9.0
+ converted to upstream signature checking
+ removed BUILD_API=1
+
2007-07-15 Lubomir Blaha <tritol AT trilogic.cz>
* DETAILS: updated to 0.8.0.1
* DETAILS: upstream GPG signing -> SHA512 (GPG no longer provided)
diff --git a/games-emulators/zx-fuse/fuse.gpg
b/games-emulators/zx-fuse/fuse.gpg
new file mode 100644
index 0000000..3d50004
Binary files /dev/null and b/games-emulators/zx-fuse/fuse.gpg differ
diff --git a/games-libs/lib765/DETAILS b/games-libs/lib765/DETAILS
index 45eaeb0..ced3796 100755
--- a/games-libs/lib765/DETAILS
+++ b/games-libs/lib765/DETAILS
@@ -1,12 +1,12 @@
SPELL=lib765
- VERSION=0.4.0
+ VERSION=0.4.1
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE_URL[0]=http://www.seasip.demon.co.uk/Unix/LibDsk/$SOURCE
WEB_SITE=http://www.seasip.demon.co.uk/Unix/LibDsk/
ENTERED=20040425
LICENSE[0]=GPL
-
SOURCE_HASH=sha512:9cf74d213f78d0c9ea4f4afee22064f47dcf18164b0e4e40fb2c9af60814bdad3aaa7150a261657793428536d29053b53392b86b55659103e284e661660c97b6
+
SOURCE_HASH=sha512:f80c878509c41a1de9d64228bb85a7c6b66bbd86bfe5a43246849d81665caf5bcd8ed043d31aa71439ed5e53af9df8b0071da5e2f169b2541bce329ef454e47d
SHORT="Lib765 is the floppy controller emulation"
cat << EOF
Lib765 is the floppy controller emulation from JOYCE,
diff --git a/games-libs/lib765/HISTORY b/games-libs/lib765/HISTORY
index af57071..39cf866 100644
--- a/games-libs/lib765/HISTORY
+++ b/games-libs/lib765/HISTORY
@@ -1,3 +1,6 @@
+2008-02-09 Lubomir Blaha <lblaha AT sourcemage.org>
+ * DETAILS: updated to 0.4.1
+
2007-07-15 Lubomir Blaha <tritol AT trilogic.cz>
* DETAILS: updated to 0.4.0

diff --git a/games-libs/libspectrum/CONFIGURE
b/games-libs/libspectrum/CONFIGURE
new file mode 100755
index 0000000..ca2403e
--- /dev/null
+++ b/games-libs/libspectrum/CONFIGURE
@@ -0,0 +1 @@
+config_query APPLY_IDEP "Apply unofficial patch to run MDOS3/FATware/DIVIP?"
n
diff --git a/games-libs/libspectrum/DETAILS b/games-libs/libspectrum/DETAILS
index 3af8981..f6cd964 100755
--- a/games-libs/libspectrum/DETAILS
+++ b/games-libs/libspectrum/DETAILS
@@ -1,11 +1,14 @@
SPELL=libspectrum
- VERSION=0.3.0.1
+ VERSION=0.4.0
SOURCE=$SPELL-$VERSION.tar.gz
+ SOURCE2=$SOURCE.sig
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE_URL[0]=$SOURCEFORGE_URL/fuse-emulator/$SOURCE
+ SOURCE2_URL[0]=${SOURCE_URL[0]}.sig
WEB_SITE=http://fuse-emulator.sourceforge.net/libspectrum.php
ENTERED=20040425
-
SOURCE_HASH=sha512:9da31be8e381d9052de6c7ca079ec9489fa5829095b29147c2d16aeaeb2f240a69d93a3317fb494d3cb67d31a00c1cebec2ca8afd5b7656a37cd7d79d96c08eb
+ SOURCE_GPG=fuse.gpg:$SOURCE2:UPSTREAM_KEY
+ SOURCE2_IGNORE=signature
LICENSE[0]=GPL
SHORT="libspectrum - file i/o for ZX Spectrum emulator"
cat << EOF
diff --git a/games-libs/libspectrum/HISTORY b/games-libs/libspectrum/HISTORY
index 4a635a3..9cf647f 100644
--- a/games-libs/libspectrum/HISTORY
+++ b/games-libs/libspectrum/HISTORY
@@ -1,3 +1,10 @@
+2008-02-09 Lubomir Blaha <lblaha AT sourcemage.org>
+ * fuse.png: added gpg keyring
+ * DETAILS: updated spell to 0.4.0
+ converted to upstream signature checking
+ * CONFIGURE, PRE_BUILD: added patch query
+ * libspectrum_ide.c_divip_patch: added, taken from
http://www.dusky.sk/zxs/
+
2007-07-15 Lubomir Blaha <tritol AT trilogic.cz>
* DETAILS: updated to 0.3.0.1

diff --git a/games-libs/libspectrum/PRE_BUILD
b/games-libs/libspectrum/PRE_BUILD
new file mode 100755
index 0000000..49445f0
--- /dev/null
+++ b/games-libs/libspectrum/PRE_BUILD
@@ -0,0 +1,6 @@
+default_pre_build &&
+cd ${SOURCE_DIRECTORY} &&
+if [ "$APPLY_IDEP" = "y" ]; then
+ patch -p0 < ${SCRIPT_DIRECTORY}/libspectrum_ide.c_divip_patch
+fi
+
diff --git a/games-libs/libspectrum/fuse.gpg b/games-libs/libspectrum/fuse.gpg
new file mode 100644
index 0000000..3d50004
Binary files /dev/null and b/games-libs/libspectrum/fuse.gpg differ
diff --git a/games-libs/libspectrum/libspectrum_ide.c_divip_patch
b/games-libs/libspectrum/libspectrum_ide.c_divip_patch
new file mode 100644
index 0000000..f4199e0
--- /dev/null
+++ b/games-libs/libspectrum/libspectrum_ide.c_divip_patch
@@ -0,0 +1,330 @@
+--- ide.c 2007-02-02 17:35:42.000000000 +0100
++++ ide_new.c 2007-07-28 15:51:15.000000000 +0200
+@@ -34,9 +34,12 @@
+
+ typedef enum libspectrum_ide_command {
+
+- LIBSPECTRUM_IDE_COMMAND_READ_SECTOR = 0x20,
+- LIBSPECTRUM_IDE_COMMAND_WRITE_SECTOR = 0x30,
+- LIBSPECTRUM_IDE_COMMAND_IDENTIFY_DRIVE = 0xec,
++ LIBSPECTRUM_IDE_COMMAND_READ_SECTOR_RETRY = 0x20,
++ LIBSPECTRUM_IDE_COMMAND_READ_SECTOR_NORETRY = 0x21,
++ LIBSPECTRUM_IDE_COMMAND_WRITE_SECTOR_RETRY = 0x30,
++ LIBSPECTRUM_IDE_COMMAND_WRITE_SECTOR_NORETRY = 0x31,
++ LIBSPECTRUM_IDE_COMMAND_IDENTIFY_DRIVE_ATA = 0xec,
++ LIBSPECTRUM_IDE_COMMAND_IDENTIFY_DRIVE_ATAPI = 0xa1,
+ LIBSPECTRUM_IDE_COMMAND_INITIALIZE_DEVICE_PARAMETERS = 0x91,
+
+ } libspectrum_ide_command;
+@@ -128,6 +131,9 @@
+ int cylinders;
+ int heads;
+ int sectors;
++
++ libspectrum_byte error;
++ libspectrum_byte status;
+
+ } libspectrum_ide_drive;
+
+@@ -143,14 +149,12 @@
+ libspectrum_ide_unit selected;
+
+ /* Register values */
+- libspectrum_byte error;
+ libspectrum_byte feature;
+ libspectrum_byte sector_count;
+ libspectrum_byte sector;
+ libspectrum_byte cylinder_low;
+ libspectrum_byte cylinder_high;
+ libspectrum_byte head;
+- libspectrum_byte status;
+ libspectrum_byte data2;
+
+ /* Channel status */
+@@ -389,10 +393,27 @@
+ chn->head = 0x00;
+
+ /* Diagnostics passed */
+- chn->error = 0x01;
++ if (chn->drive[LIBSPECTRUM_IDE_MASTER].disk)
++ chn->drive[LIBSPECTRUM_IDE_MASTER].error = 0x01;
++ else
++ chn->drive[LIBSPECTRUM_IDE_MASTER].error = 0xff;
++
++ if (chn->drive[LIBSPECTRUM_IDE_SLAVE].disk)
++ chn->drive[LIBSPECTRUM_IDE_SLAVE].error = 0x01;
++ else
++ chn->drive[LIBSPECTRUM_IDE_SLAVE].error = 0xff;
++
+
+ /* Device ready, no PACKET support */
+- chn->status = 0x72;
++ if (chn->drive[LIBSPECTRUM_IDE_MASTER].disk)
++ chn->drive[LIBSPECTRUM_IDE_MASTER].status = 0x40;
++ else
++ chn->drive[LIBSPECTRUM_IDE_MASTER].status = 0xff;
++
++ if (chn->drive[LIBSPECTRUM_IDE_SLAVE].disk)
++ chn->drive[LIBSPECTRUM_IDE_SLAVE].status = 0x40;
++ else
++ chn->drive[LIBSPECTRUM_IDE_SLAVE].status = 0xff;
+
+ /* Feature is write-only */
+ chn->feature = 0xff;
+@@ -405,8 +426,10 @@
+ chn->cylinder_low = 0xff;
+ chn->cylinder_high = 0xff;
+ chn->head = 0xff;
+- chn->error = 0xff;
+- chn->status = 0xff;
++ chn->drive[LIBSPECTRUM_IDE_MASTER].error = 0xff;
++ chn->drive[LIBSPECTRUM_IDE_SLAVE].error = 0xff;
++ chn->drive[LIBSPECTRUM_IDE_MASTER].status = 0xff;
++ chn->drive[LIBSPECTRUM_IDE_SLAVE].status = 0xff;
+ chn->feature = 0xff;
+
+ }
+@@ -524,6 +547,7 @@
+ read_data( libspectrum_ide_channel *chn )
+ {
+ libspectrum_byte data;
++ libspectrum_ide_drive *drv = &chn->drive[ chn->selected ];
+
+ /* Meaningful data is only returned in PIO input phase */
+ if( chn->phase != LIBSPECTRUM_IDE_PHASE_PIO_IN ) return 0xff;
+@@ -564,7 +588,7 @@
+ } else {
+ /* all sectors done */
+ chn->phase = LIBSPECTRUM_IDE_PHASE_READY;
+- chn->status &= ~LIBSPECTRUM_IDE_STATUS_DRQ;
++ drv->status &= ~LIBSPECTRUM_IDE_STATUS_DRQ;
+ }
+ }
+
+@@ -576,23 +600,23 @@
+ libspectrum_ide_read( libspectrum_ide_channel *chn,
+ libspectrum_ide_register reg )
+ {
+- /* Only read if the currently-selected drive exists */
+- if( chn->drive[ chn->selected ].disk ) {
++ libspectrum_ide_drive *drv = &chn->drive[ chn->selected ];
+
+ switch( reg ) {
+-
+ case LIBSPECTRUM_IDE_REGISTER_DATA: return read_data( chn );
+ case LIBSPECTRUM_IDE_REGISTER_DATA2: return chn->data2;
+- case LIBSPECTRUM_IDE_REGISTER_ERROR_FEATURE: return chn->error;
++ case LIBSPECTRUM_IDE_REGISTER_ERROR_FEATURE: return drv->error;
+ case LIBSPECTRUM_IDE_REGISTER_SECTOR_COUNT: return chn->sector_count;
+ case LIBSPECTRUM_IDE_REGISTER_SECTOR: return chn->sector;
+ case LIBSPECTRUM_IDE_REGISTER_CYLINDER_LOW: return chn->cylinder_low;
+ case LIBSPECTRUM_IDE_REGISTER_CYLINDER_HIGH: return chn->cylinder_high;
+ case LIBSPECTRUM_IDE_REGISTER_HEAD_DRIVE: return chn->head;
+- case LIBSPECTRUM_IDE_REGISTER_COMMAND_STATUS: return chn->status;
++ case LIBSPECTRUM_IDE_REGISTER_COMMAND_STATUS:
++ if (!drv->disk) return 0x00;
++ else return drv->status;
++ break;
+
+ }
+- }
+
+ return 0xff;
+ }
+@@ -602,6 +626,8 @@
+ static void
+ write_data( libspectrum_ide_channel *chn, libspectrum_byte data )
+ {
++ libspectrum_ide_drive *drv = &chn->drive[ chn->selected ];
++
+ /* Data register can only be written in PIO output phase */
+ if( chn->phase != LIBSPECTRUM_IDE_PHASE_PIO_OUT ) return;
+
+@@ -634,8 +660,8 @@
+
+ /* Write data to disk */
+ if ( write_hdf( chn ) ) {
+- chn->status |= LIBSPECTRUM_IDE_STATUS_ERR;
+- chn->error = LIBSPECTRUM_IDE_ERROR_ABRT | LIBSPECTRUM_IDE_ERROR_UNC;
++ drv->status |= LIBSPECTRUM_IDE_STATUS_ERR;
++ drv->error = LIBSPECTRUM_IDE_ERROR_ABRT | LIBSPECTRUM_IDE_ERROR_UNC;
+ }
+
+ if( chn->sector_count ) {
+@@ -644,7 +670,7 @@
+ } else {
+ /* all sectors done */
+ chn->phase = LIBSPECTRUM_IDE_PHASE_READY;
+- chn->status &= ~LIBSPECTRUM_IDE_STATUS_DRQ;
++ drv->status &= ~LIBSPECTRUM_IDE_STATUS_DRQ;
+ }
+ }
+
+@@ -685,8 +711,8 @@
+ /* Seek to the correct position */
+ if( sectornumber < 0 ||
+ sectornumber >= ( drv->cylinders * drv->heads * drv->sectors ) ) {

+- chn->status |= LIBSPECTRUM_IDE_STATUS_ERR;
+- chn->error = LIBSPECTRUM_IDE_ERROR_ABRT | LIBSPECTRUM_IDE_ERROR_IDNF;
++ drv->status |= LIBSPECTRUM_IDE_STATUS_ERR;
++ drv->error = LIBSPECTRUM_IDE_ERROR_ABRT | LIBSPECTRUM_IDE_ERROR_IDNF;
+ return LIBSPECTRUM_ERROR_UNKNOWN;
+ }
+
+@@ -694,6 +720,8 @@
+
+ /* advance registers to next sector, for multiple sector accesses */
+ chn->sector_count--;
++ if (!chn->sector_count) return LIBSPECTRUM_ERROR_NONE;
++
+ if( chn->head & LIBSPECTRUM_IDE_HEAD_LBA ) {
+
+ /* increment using LBA scheme */
+@@ -774,14 +802,14 @@
+ SET_WORD( chn->buffer, LIBSPECTRUM_IDE_IDENTITY_TOTAL_SECTORS_HI,
+ ( sector_count & 0xffff0000 ) >> 16 );
+ }
+-
++
+ /* prevent read_data from trying to read from disk after identity block
+ is completely read in */
+ chn->sector_count = 0;
+
+ /* Initiate the PIO input phase */
+ chn->phase = LIBSPECTRUM_IDE_PHASE_PIO_IN;
+- chn->status |= LIBSPECTRUM_IDE_STATUS_DRQ;
++ drv->status |= LIBSPECTRUM_IDE_STATUS_DRQ;
+ chn->datacounter = 0;
+ }
+
+@@ -789,19 +817,21 @@
+ static void
+ readsector( libspectrum_ide_channel *chn )
+ {
++ libspectrum_ide_drive *drv = &chn->drive[ chn->selected ];
++
+ if( seek( chn ) ) return;
+
+ /* Read data from disk */
+ if( read_hdf( chn ) ) {
+
+- chn->status |= LIBSPECTRUM_IDE_STATUS_ERR;
+- chn->error = LIBSPECTRUM_IDE_ERROR_ABRT | LIBSPECTRUM_IDE_ERROR_UNC;
++ drv->status |= LIBSPECTRUM_IDE_STATUS_ERR;
++ drv->error = LIBSPECTRUM_IDE_ERROR_ABRT | LIBSPECTRUM_IDE_ERROR_UNC;
+
+ } else {
+
+ /* Initiate the PIO input phase */
+ chn->phase = LIBSPECTRUM_IDE_PHASE_PIO_IN;
+- chn->status |= LIBSPECTRUM_IDE_STATUS_DRQ;
++ drv->status |= LIBSPECTRUM_IDE_STATUS_DRQ;
+ chn->datacounter = 0;
+
+ }
+@@ -811,11 +841,13 @@
+ static void
+ writesector( libspectrum_ide_channel *chn )
+ {
++ libspectrum_ide_drive *drv = &chn->drive[ chn->selected ];
++
+ if( seek( chn ) ) return;
+
+ /* Initiate the PIO output phase */
+ chn->phase = LIBSPECTRUM_IDE_PHASE_PIO_OUT;
+- chn->status |= LIBSPECTRUM_IDE_STATUS_DRQ;
++ drv->status |= LIBSPECTRUM_IDE_STATUS_DRQ;
+ chn->datacounter = 0;
+ }
+
+@@ -824,42 +856,63 @@
+ init_device_params( libspectrum_ide_channel *chn )
+ {
+ libspectrum_ide_drive *drv = &chn->drive[ chn->selected ];
++ int size;
++
++ if ( !chn->sector_count ) {
++ drv->status |= LIBSPECTRUM_IDE_STATUS_ERR;
++ drv->error = LIBSPECTRUM_IDE_ERROR_ABRT;
++ return;
++ }
++
++ size = drv->heads * drv->sectors * drv->cylinders;
++
++ if (size>16514064) size=16514064;
++
++ drv->heads = ( chn->head & LIBSPECTRUM_IDE_HEAD_HEAD ) + 1;
++ drv->sectors = chn->sector_count;
++ drv->cylinders = size / (drv->heads * drv->sectors);
++
++//maybe this should be better to move to identify device
++ if ( drv->cylinders > 65535 ) drv->cylinders = 65535;
++
++ chn->phase = LIBSPECTRUM_IDE_PHASE_READY;
++
++ drv->error = LIBSPECTRUM_IDE_ERROR_OK;
++ drv->status &= ~(LIBSPECTRUM_IDE_STATUS_ERR | LIBSPECTRUM_IDE_STATUS_BSY
| LIBSPECTRUM_IDE_STATUS_DRQ);
++ drv->status |= LIBSPECTRUM_IDE_STATUS_DRDY;
+
+- /* Return success iff the requested geometry matches the actual geometry
+- of the disk */
+- if( chn->sector_count == drv->sectors &&
+- ( chn->head & LIBSPECTRUM_IDE_HEAD_HEAD ) == drv->heads - 1 ) return;
+-
+- /* if not, return ABRT error */
+- chn->status |= LIBSPECTRUM_IDE_STATUS_ERR;
+- chn->error = LIBSPECTRUM_IDE_ERROR_ABRT;
+ }
+
+ /* Execute a command */
+ static void
+ execute_command( libspectrum_ide_channel *chn, libspectrum_byte data )
+ {
+- if( !chn->drive[ chn->selected].disk ) return;
++ libspectrum_ide_drive *drv = &chn->drive[ chn->selected ];
++
++ if( !drv->disk ) return;
+ chn->phase = LIBSPECTRUM_IDE_PHASE_READY;
+
+ /* Clear error conditions */
+- chn->error = LIBSPECTRUM_IDE_ERROR_OK;
+- chn->status &= ~(LIBSPECTRUM_IDE_STATUS_ERR | LIBSPECTRUM_IDE_STATUS_BSY);
+- chn->status |= LIBSPECTRUM_IDE_STATUS_DRDY;
++ drv->error = LIBSPECTRUM_IDE_ERROR_OK;
++ drv->status &= ~(LIBSPECTRUM_IDE_STATUS_ERR | LIBSPECTRUM_IDE_STATUS_BSY);
++ drv->status |= LIBSPECTRUM_IDE_STATUS_DRDY;
+
+ /* Perform command */
+ switch( data ) {
+
+- case LIBSPECTRUM_IDE_COMMAND_READ_SECTOR: readsector( chn ); break;
+- case LIBSPECTRUM_IDE_COMMAND_WRITE_SECTOR: writesector( chn ); break;
+- case LIBSPECTRUM_IDE_COMMAND_IDENTIFY_DRIVE: identifydevice( chn ); break;
++ case LIBSPECTRUM_IDE_COMMAND_READ_SECTOR_RETRY: readsector( chn );
break;
++ case LIBSPECTRUM_IDE_COMMAND_READ_SECTOR_NORETRY: readsector( chn );
break;
++ case LIBSPECTRUM_IDE_COMMAND_WRITE_SECTOR_RETRY: writesector( chn );
break;
++ case LIBSPECTRUM_IDE_COMMAND_WRITE_SECTOR_NORETRY: writesector( chn );
break;
++ case LIBSPECTRUM_IDE_COMMAND_IDENTIFY_DRIVE_ATA: identifydevice( chn );
break;
++ case LIBSPECTRUM_IDE_COMMAND_IDENTIFY_DRIVE_ATAPI: identifydevice( chn );
break;
+ case LIBSPECTRUM_IDE_COMMAND_INITIALIZE_DEVICE_PARAMETERS:
+ init_device_params( chn ); break;
+
+ /* Unknown/unsupported commands */
+ default:
+- chn->status |= LIBSPECTRUM_IDE_STATUS_ERR;
+- chn->error = LIBSPECTRUM_IDE_ERROR_ABRT;
++ drv->status |= LIBSPECTRUM_IDE_STATUS_ERR;
++ drv->error = LIBSPECTRUM_IDE_ERROR_ABRT;
+ }
+ }
+
+@@ -876,8 +929,7 @@
+ case LIBSPECTRUM_IDE_REGISTER_SECTOR_COUNT: chn->sector_count = data;
break;
+ case LIBSPECTRUM_IDE_REGISTER_SECTOR: chn->sector = data; break;
+ case LIBSPECTRUM_IDE_REGISTER_CYLINDER_LOW: chn->cylinder_low = data;
break;
+- case LIBSPECTRUM_IDE_REGISTER_CYLINDER_HIGH:
+- chn->cylinder_high = data; break;
++ case LIBSPECTRUM_IDE_REGISTER_CYLINDER_HIGH: chn->cylinder_high = data;
break;
+
+ case LIBSPECTRUM_IDE_REGISTER_HEAD_DRIVE:
+ chn->head = data;




Archive powered by MHonArc 2.6.24.

Top of Page