Re: [cc65] Why does this work in 128 mode but not 64 mode?

From: Kajtár Zsolt <kajtarzsolt1googlemail.com>
Date: 2010-05-02 22:48:59
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I had to think about this. The problem here is that the OPEN without a
> file name essentially is a no-op: It does not perform any IEC output. It
> only updates the internal KERNAL tables. Thus, it almost cannot fail.
> For sure, a "device not present" cannot be the answer, as the system
> does not try to open a file.
> 
> So, the read afterwards falls into the trap of the bad implementation.
> 
> The only workaround I can think of: When doing an open, and there is no
> filename, issue a LISTEN/UNLISTEN sequence. If the LISTEN fails, then
> there is no device attached. Then, let the OPEN fail.

No IEC specific stuff please. Classic check is a CHKOUT/CLRCHN (which is
almost the LISTEN/UNLISTEN as above for IEC), as the CHKOUT will fail on
device not present. Other workaround as an OPEN time check (which I already
proposed):

A.) No filename
OPEN, CLOSE. Check ST for device not present. If ok, OPEN again.
B.) There's a filename
OPEN will give back device not present error, no workaround.

> Need the workaround:
> - VIC20
> - C64

Basically both are running the same KERNAL/BASIC with minor hardware related
differences. (and one or two bug fixes in the C64 version)

> Do *not* need the workaround:
> - Plus/4
> - C128

Yes, these are fixed and report correctly device not present on CHKIN. (same
with a recent IDEDOS 0.90/0.91 on a C64)

> - PET with BASIC 4.0, KERNAL 4.0
>   (but: Does not return with "DEVICE NOT PRESENT", instead status bit 1
>   (timeout on read) is set

That's IEEE-488, no wonder it's different. The OPEN/CLOSE workaround will not
work on this.

- --
						    -soci-

ps.: I'm to posting code/patches now, as it's a waste of time most likely.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvd5TsACgkQyBOVYiJltRbdvQCcDcQtBBt/6dO902Q6UzSrb+Mi
FxcAoMJaEmekCMe+b0Xseo2pPgzkU99+
=HPDW
-----END PGP SIGNATURE-----
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun May 2 22:50:47 2010

This archive was generated by hypermail 2.1.8 : 2010-05-02 22:50:51 CEST