Re: [hatari-devel] asm56000.ttp problem

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 9/7/18 8:30 AM, Miro Kropáček wrote:
On Thu, 6 Sep 2018 at 23:38, Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:

What are the exact steps to reproduce the problem with this?

What is the expected output, and what is incorrect?

Thank you for taking interest in this again. :) It's easy - just download
the archive, unpack, let Hatari have its GEMDOS HD there and run
TOMSHELL.TOS.

This should start the compilation script. On real Atari (or under IDE
emulation) it succeeds, on GEMDOS HD emulation it fails.

I can reproduce both the success with IDE, and failure with GEMDOS HD.


There's a weird difference in GEMDOS calls between IDE:
------------------------------------------------
GEMDOS 0x3D Fopen("C:\EQUATES.ASM", read-only) at PC=0x5B674
GEMDOS 0x42 Fseek(0, 7, 1) at PC 0x5B43A
GEMDOS 0x42 Fseek(1, 7, 0) at PC 0x5B450
GEMDOS 0x42 Fseek(0, 7, 0) at PC 0x5B47C
GEMDOS 0x3F Fread(7, 1024, 0x6768c) at PC 0x5BBDE
GEMDOS 0x3F Fread(7, 1024, 0x6768c) at PC 0x5BBDE
GEMDOS 0x3F Fread(7, 1024, 0x6768c) at PC 0x5BBDE
GEMDOS 0x3E Fclose(7) at PC 0x5AF42
------------------------------------------------

("equates.asm" is only 1217 bytes long, why asm56000 does
the 3rd read when already 2nd read went past end of file?)


GEMDOS HD:
------------------------------------------------
GEMDOS 0x3D Fopen("C:\\EQUATES.ASM", read-only) at PC=0x5B674
GEMDOS 0x42 Fseek(0, 65, 1) at PC 0x5B43A
GEMDOS 0x42 Fseek(1, 65, 0) at PC 0x5B450
GEMDOS 0x42 Fseek(0, 65, 0) at PC 0x5B47C
GEMDOS 0x42 Fseek(0, 65, 1) at PC 0x5B43A
GEMDOS 0x42 Fseek(1, 65, 0) at PC 0x5B450
GEMDOS 0x42 Fseek(0, 65, 0) at PC 0x5B47C
GEMDOS 0x3F Fread(65, 1024, 0x6768c) at PC 0x5BBDE
GEMDOS 0x42 Fseek(0, 65, 1) at PC 0x5B43A
GEMDOS 0x42 Fseek(1, 65, 0) at PC 0x5B450
GEMDOS 0x42 Fseek(1024, 65, 0) at PC 0x5B47C
GEMDOS 0x3F Fread(65, 1024, 0x6768c) at PC 0x5BBDE
GEMDOS 0x42 Fseek(0, 65, 1) at PC 0x5B43A
GEMDOS 0x42 Fseek(1, 65, 0) at PC 0x5B450
GEMDOS 0x42 Fseek(1217, 65, 0) at PC 0x5B47C  <= not *2028*
GEMDOS 0x3F Fread(65, 1024, 0x6768c) at PC 0x5BBDE
GEMDOS 0x3E Fclose(65) at PC 0x5AF42
------------------------------------------------

Why asm56000 does all these extra Fseek()s to beginning of file?

It's not TOS specific as it happens both with EmuTOS & TOS v4.

I've verified that Fseek & Fread provide same return values
with GEMDOS HD & real TOS.

Just having GEMDOS HD enabled doesn't trigger the extra Fseek()s,
one needs to run Tomshell from it.


There's same difference when asm56000 continues parsing
the "decoder.asm" (which includes "equates.asm"), and
that appears to work fine, but then things fail...


IDE drive:
------------------------------------------------
....
GEMDOS 0x3F Fread(6, 1024, 0x655d4) at PC 0x5BBDE
GEMDOS 0x3F Fread(6, 1024, 0x655d4) at PC 0x5BBDE
GEMDOS 0x19 Dgetdrv() at PC 0x5D4C6
GEMDOS 0x47 Dgetpath(0x6508a, 0) at PC 0x5D4E6
GEMDOS 0x43 Fattrib("C:\DECODER.CLD", 0, 0x0) at PC 0x5B690
GEMDOS 0x3C Fcreate("C:\DECODER.CLD", 0x0) at PC 0x5B6F0
GEMDOS 0x42 Fseek(0, 7, 1) at PC 0x5B43A
GEMDOS 0x42 Fseek(1, 7, 0) at PC 0x5B450
GEMDOS 0x42 Fseek(0, 7, 0) at PC 0x5B47C
GEMDOS 0x19 Dgetdrv() at PC 0x5D4C6
GEMDOS 0x47 Dgetpath(0x650ae, 0) at PC 0x5D4E6
GEMDOS 0x3D Fopen("C:\DECODER.ASM", read-only) at PC=0x5B674
GEMDOS 0x42 Fseek(0, 8, 1) at PC 0x5B43A
GEMDOS 0x42 Fseek(1, 8, 0) at PC 0x5B450
GEMDOS 0x42 Fseek(0, 8, 0) at PC 0x5B47C
GEMDOS 0x48 Malloc(0x8000) at PC 0x5C214
GEMDOS 0x42 Fseek(0, 7, 1) at PC 0x5B4E4
GEMDOS 0x42 Fseek(5288, 7, 0) at PC 0x5B4E4
GEMDOS 0x42 Fseek(0, 7, 2) at PC 0x5B4E4
GEMDOS 0x40 Fwrite(7, 256, 0x650e4) at PC 0x5D846
GEMDOS 0x40 Fwrite(7, 256, 0x650e4) at PC 0x5D846
....
------------------------------------------------

Whereas with GEMDOS HD:
------------------------------------------------
....
GEMDOS 0x42 Fseek(68608, 65, 0) at PC 0x63FC8
GEMDOS 0x3F Fread(65, 1024, 0x18f44) at PC 0x6472A
GEMDOS 0x19 Dgetdrv() at PC 0x66012
GEMDOS 0x47 Dgetpath(0x6dbfa, 0) at PC 0x66032
GEMDOS 0x3D Fopen("C:\\DECODER.ASM", read-only) at PC=0x641C0
GEMDOS 0x42 Fseek(0, 66, 1) at PC 0x63F86
GEMDOS 0x42 Fseek(1, 66, 0) at PC 0x63F9C
GEMDOS 0x42 Fseek(0, 66, 0) at PC 0x63FC8
GEMDOS 0x40 Fwrite(1, 172, 0x193fc) at PC 0x66392
GEMDOS 0x3E Fclose(65) at PC 0x63A8E
GEMDOS 0x3E Fclose(66) at PC 0x63A8E
GEMDOS 0x4C Pterm(-1) at PC 0x2B394
....
------------------------------------------------

-> "decoder.asm" is opened second time in both, but
asm56000 doesn't even try to open the "decoder.cld"
file before that with GEMDOS HD?

I don't see any errors in the system calls.

The only difference I found was Dgetpath() on disk root returning
'\' for GEMDOS HD and '' for real TOS.  However, fixing that didn't
change anything.


So... Only clue is the redundant Fseek()s done by 56000 with
GEMDOS HD.  Any idea what could be triggering them and why?



Btw. There are also couple of issues with the tools in the package:
* "lod2bin" produces just zeros to decoder.dsp file. I replaced it
  with my own mintlib build of my own lod2bin.c
* "binary2c" program requires FPU, it crashes with EmuTOS if FPU
  isn't enabled


	- Eero




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/