#236 Dragon Spirit - DSK version not working


From WoS:
"This game crashes during the first load before the loading screen appears. Gives you a nice reset back to 48k screen. Any ideas why? I just loaded the same disk image into Spectaculator (running on Windows XP under VMware) and it works fine.

Same story with the TNT compilation version. Works on Spectaculator, not on Fuse.

Cassette versions load fine though."


  • Fredrick Meunier

    Out of curiosity I checked if the old libdsk based code in Fuse behaved any differently but interestingly the same looking crash happens in that version.

  • Sergio Baldoví

    Sergio Baldoví - 2013-08-13

    I have given a go to Dragon Spirit. It seems that Fuse corrupts the data in a multi-sector read operation (see attached log for track 1 with sectors 1-6 ) because a fdc_event for a seek operation occurs in the middle of a read execution (ugh!). That is contrary to what upd765a datasheet states:

    "No other command (seek) could be issued for as long FDC is in process of sending step pulses to any drive".

    This mess happens in part because the program sends new seek commands while it is waiting the completion of a previous one. Here is a partial disassembly:

    0x912D CALL 90F6      ; read MSR and wait for RQM
    0x9130 LD A, 0F       ; prepare SEEK command
    0x9132 CALL 90F4      ; send command to FDC
    0x9135 XOR A          ; select drive 0
    0x9136 CALL 90F4      ; send parameter to FDC
    0x9139 LD A, (9162)   ; select track 1
    0x913C CALL 90F4      ; send parameter to FDC
    0x913F LD A, 08       ; prepare SENSE_INT command
    0x9141 CALL 90F4      ; send command to FDC
    0x9144 IN L, (C)      ; read ST0
    0x9146 CALL 90F6      ; read MSR and wait for RQM
    0x9149 IN A, (C)      ; read current track and ignore it
    0x914B LD A, L        ; prepare operation with ST0
    0x914C AND C0         ; check abnormal termination
    0x914E JR Z,90F6      ; check MSR if normal termination and exit
    0x9150 JR 912D        ; Seek track again before sending a new SENSE_INT (*)

    And Fuse fails to interpret overlapped seeks, in this case with the same drive. I have rewritten the code around seek_step():

    • Don't execute a seek command if the selected drive is busy.
    • Don't poll drives and wait FDC events started by other seek commands.

    Any thoughts are welcome.

    Last edit: Sergio Baldoví 2013-08-13
  • Fredrick Meunier

    Change works for me.

  • Sergio Baldoví

    Sergio Baldoví - 2013-08-19
    • status: open --> pending-fixed
    • Group: --> future
  • Fredrick Meunier

    • Group: future --> v1.2
  • Sergio Baldoví

    Sergio Baldoví - 2016-04-26
    • status: pending-fixed --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks