Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File operations (OPEN/PRINT#) in current directory fails #416

Open
SerOlmy16 opened this issue Aug 19, 2022 · 3 comments
Open

File operations (OPEN/PRINT#) in current directory fails #416

SerOlmy16 opened this issue Aug 19, 2022 · 3 comments

Comments

@SerOlmy16
Copy link

This might be the drive emulation in the emulator, or it could be a ROM issue. Consider the following program:

10 OPEN 1,8,1,"TEST"
20 PRINT#1,"FOO"
30 CLOSE 1

Expected result with no SD card file mounted: The file "TEST" should be created in the current directory, containing the text "FOO".

Actual result: The emulator prints a newline and a question mark to the console, and then locks up. A file "TEST" is indeed created in the current directory, containing only the first character of the string ("F" in this case). The file remains exclusively locked until the emulator is closed.

This is 100% reproducible under 64-bit Windows. I have not tried running the emulator on other platforms.

@irmen
Copy link
Contributor

irmen commented Jan 17, 2023

99% likely caused by the current minimalistic host filesystem support in the emulator.
I'm confident your program works fine on sdcard

@mooinglemur
Copy link
Contributor

I found that this was because emulated hostfs CIOUT did not clear the carry bit in the status flag on return. Without that, I get ?I ERROR in 20 from BASIC, which is bafflingly confused.

However the real KERNAL routines always do a clc regardless of success, so we need the emulated one to do so unconditonally.

I've added this fix to my hostfs enhancement PR. #466

@mooinglemur
Copy link
Contributor

Similar weird behavior also manifested itself on INPUT# from hostfs, and the issue was basically the same for that as it was for PRINT#, just for reading instead of writing. Fix in PR#479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants