You are on page 1of 6

GEM S2/S3 issues - HxC Floppy Drive Emulator https://torlus.com/floppy/forum/viewtopic.php?

t=3610

HxC Floppy Drive Emulator


HxC Floppy Drive Emulator general information
and news

 FAQ  Register  Login

 Board index ‹ Third party hardware ‹ Gotek

GEM S2/S3 issues


Post Reply  21 posts 1 2 

GEM S2/S3 issues 


VBuckle

 by VBuckle » Mon Apr 29, 2019 9:28 pm Posts: 11


Joined: Mon Apr 29, 2019 9:19 pm
When reversing GEM S2/S3 Turbo ROM, I found that its floppy driver supports
another disk format.

Having implemented tools to format/write such disk format, I have found an


issue with the floppy emulator, in that writing to these images fails for some
reason, the error given is a timeout (a single FDC command must finish within
~2000ms, a seperate READ DATA/WRITE DATA command is used for each track;
therefore: reading/writing a (partial) track must complete within ~2000ms).

Later GEM devices running MIOS 3 increased this limit to ~3000ms; when
hooking various calls on S2/S3 to also provide this limit (obviously intended as a
temporary measure), writing a later track fails with sector not found error (SR1
bit 2).

This problem does not occur with a real floppy drive.

(For the record, the same problem occurs when writing large files (~1MB) to
raw .img images of disk layout GENERALMUSIC_GEM_S3_1600KB.)

I am using a Gotek emulator with HxE firmware v3.1.48.1a.

Here is the (custom) XML I am using to create a HFE image:

CODE: SELECT ALL

<?xml version="1.0" encoding="ISO-8859-1"?>


<!-- HxC Floppy Emulator Disk Layout -->
<disk_layout>
<disk_layout_name>GENERALMUSIC_GEM_S3_1760KB</disk_layout_name>
<disk_layout_description>GeneralMusic Gem S2/3 Type-4 HD Floppy Disk</disk_
<prefered_file_extension>img</prefered_file_extension>
<interface_mode>IBMPC_HD_FLOPPYMODE</interface_mode>
<file_size>1802240</file_size>
<layout>
<number_of_track>80</number_of_track>
<number_of_side>2</number_of_side>
<format>IBM_MFM</format>
<start_sector_id>1</start_sector_id>

1 di 6 06/10/2021, 10:11
GEM S2/S3 issues - HxC Floppy Drive Emulator https://torlus.com/floppy/forum/viewtopic.php?t=3610

<sector_per_track>11</sector_per_track>
The gap3 value in the xml is the value used when formatting this disk type:

CODE: SELECT ALL

case 0x400:
v1[1].buf.bytes[2] = 3; // 1024 bytes/sector
v1[1].buf.bytes[3] = 11; // 11 sectors per track
v1[1].buf.bytes[4] = 38; // gap3 length
break;

When reading/writing, the VC0 sync value used is 12:

CODE: SELECT ALL

case 0x400: // S2S3 1760KB


operation->write1_buf[5] = 3;
operation->write1_buf[6] = 11;
operation->write1_buf[7] = 12;
break;

I have also tried gap3 value 84 (used when formatting every other disk type,
including 720KB/1.44MB, for some reason); this does not work around the issue.

Reading from these images seems to work fine; the issue is with writing.

Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Tue Apr 30, 2019 12:35 am
Posts: 7686
Have you tried to directly use the img files on the gotek ? There are directly Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
supported by the emulator and this should be a way faster.
Contact: 
HxC Floppy Emulators website

Re: GEM S2/S3 issues 


VBuckle

 by VBuckle » Tue Apr 30, 2019 6:23 pm Posts: 11


Joined: Mon Apr 29, 2019 9:19 pm
As I mentioned, the same errors occur with img files.

Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Tue Apr 30, 2019 7:17 pm
Posts: 7686
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
 VBuckle wrote: ↑ Tue Apr 30, 2019 6:23 pm
Contact: 
As I mentioned, the same errors occur with img files.

Just to be sure : you mean that you have tried to save directly to an img file
present on the stick (without hfe conversion ?)
if so, have you selected the gem system family in the embedded menu ?

2 di 6 06/10/2021, 10:11
GEM S2/S3 issues - HxC Floppy Drive Emulator https://torlus.com/floppy/forum/viewtopic.php?t=3610

 VBuckle wrote: ↑ Tue Apr 30, 2019 6:23 pm


When reversing GEM S2/S3 Turbo ROM, I found that its floppy driver supports
another disk format.

This means that normal gem format is working fine ?

HxC Floppy Emulators website


Re: GEM S2/S3 issues 


VBuckle

 by VBuckle » Tue Apr 30, 2019 10:56 pm Posts: 11


Joined: Mon Apr 29, 2019 9:19 pm
Yes.
I have had better results when using hfe, but the problem is still there.
I can load my new 1.76mb files but writing them errors.
This problem does not happen with a real floppy drive.
The error is only with the gotek, I have not tried the hxc sdcard drive as I don't
own one.

Re: GEM S2/S3 issues 


VBuckle

 by VBuckle » Tue Apr 30, 2019 10:58 pm Posts: 11


Joined: Mon Apr 29, 2019 9:19 pm
I can't use a 1.76mb img because the hxc firmware does not support the new
format, hence the xml code in the 1st post.

Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Tue Apr 30, 2019 11:56 pm
Posts: 7686
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
 VBuckle wrote: ↑ Tue Apr 30, 2019 10:58 pm
Contact: 
I can't use a 1.76mb img because the hxc firmware does not support the new
format, hence the xml code in the 1st post.

ok ! Let me add this format to the firmware, i will post the new one here.

HxC Floppy Emulators website


Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Wed May 01, 2019 12:06 am
Posts: 7686
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
 Jeff wrote: ↑ Tue Apr 30, 2019 11:56 pm
Contact: 
 VBuckle wrote: ↑ Tue Apr 30, 2019 10:58 pm
I can't use a 1.76mb img because the hxc firmware does not support the
new format, hence the xml code in the 1st post.

ok ! Let me add this format to the firmware, i will post the new one here.

attached.

3 di 6 06/10/2021, 10:11
GEM S2/S3 issues - HxC Floppy Drive Emulator https://torlus.com/floppy/forum/viewtopic.php?t=3610

change the file extensions to ".gem" or set the system family preference into
the embedded menu to be sure to use the General Music format.

ATTACHMENTS
gem_test.zip
(80.15 KiB) Downloaded 167 times

HxC Floppy Emulators website


Re: GEM S2/S3 issues 


VBuckle

 by VBuckle » Wed May 01, 2019 6:45 pm Posts: 11


Joined: Mon Apr 29, 2019 9:19 pm
I tried the new firmware but there is nothing displayed on the LED screen so I
flashed back to version 3.1.48.1a
I assume the test version does not have support for the LED screen and rotary
knob that I have modified the Gotek with.

Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Wed May 01, 2019 7:37 pm
Posts: 7686
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
 VBuckle wrote: ↑ Wed May 01, 2019 6:45 pm
Contact: 
I tried the new firmware but there is nothing displayed on the LED screen so
I flashed back to version 3.1.48.1a
I assume the test version does not have support for the LED screen and
rotary knob that I have modified the Gotek with.

No, the test version is a normal version. So you should have something on the
LED screen.
Please retry.

HxC Floppy Emulators website


Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Wed May 01, 2019 8:09 pm
Posts: 7686
fyi there is now an "official" release : Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact: 
https://hxc2001.com/download/floppy_dri ... rmware.zip
(WIP folder)

HxC Floppy Emulators website


Re: GEM S2/S3 issues 


VBuckle

 by VBuckle » Wed May 01, 2019 9:22 pm Posts: 11


Joined: Mon Apr 29, 2019 9:19 pm
I tried writing the entirety of 1.76MB .gem image, 10 attempts, 5 with the
patches in place for the larger timeout and 5 after removing those.

Out of the first 5 attempts (with larger timeout): 2 succeeded, and 3 failed. All
the failures were sector not found errors; one was on track 29, one on track 9,
and one on track 52.

4 di 6 06/10/2021, 10:11
GEM S2/S3 issues - HxC Floppy Drive Emulator https://torlus.com/floppy/forum/viewtopic.php?t=3610

Out of the second 5 attempts (with original timeout): 4 succeeded, and 1


failed. The failure was, again, a sector not found error, on track 29.

What could be causing the inconsistent sector not found errors?


Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Wed May 01, 2019 9:34 pm
Posts: 7686
with the new firmware ? On a img/gem file ? Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact: 
if "yes" and "yes", try another usb stick (another model)

The error is not a timeout anymore ?

And what about the sector interleaving ? Are you sure that it is set to 1 ?

HxC Floppy Emulators website


Re: GEM S2/S3 issues 


VBuckle

 by VBuckle » Wed May 01, 2019 10:06 pm Posts: 11


Joined: Mon Apr 29, 2019 9:19 pm
Tried a new sandisk key and it worked fine, 5 out of 5 attempts.

Can you add the 1.76Mb format to the PC software.

Thanks for your help...


Vince

Re: GEM S2/S3 issues 


Jeff
Site Admin
 by Jeff » Wed May 01, 2019 10:12 pm
Posts: 7686
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
 VBuckle wrote: ↑ Wed May 01, 2019 10:06 pm
Contact: 
Tried a new sandisk key and it worked fine, 5 out of 5 attempts.

Can you add the 1.76Mb format to the PC software.

Thanks for your help...


Vince

ok fine.
what is the non working usb stick model/brand?

HxC Floppy Emulators website


Post Reply    21 posts 1 2 

 Return to “Gotek” Jump to 

 Board index  Delete cookies All times are UTC+02:00

5 di 6 06/10/2021, 10:11
GEM S2/S3 issues - HxC Floppy Drive Emulator https://torlus.com/floppy/forum/viewtopic.php?t=3610

Powered by phpBB® Forum Software © phpBB Limited


Privacy | Terms

6 di 6 06/10/2021, 10:11

You might also like