Skip to content

Unable to load files in FB.COM after modifying editor colors #110

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

Closed
taylor-madeak opened this issue Apr 18, 2025 · 6 comments
Closed

Unable to load files in FB.COM after modifying editor colors #110

taylor-madeak opened this issue Apr 18, 2025 · 6 comments

Comments

@taylor-madeak
Copy link

taylor-madeak commented Apr 18, 2025

Summary

I am encountering the oddest issue. What I'm trying to do is very simple, on the face of it: just modify the editor colors to white-on-black instead of the Atari default light-grey-on-blue. I was able to track that down in the source code to this section:

fastbasic/src/editor.bas

Lines 654 to 659 in 55dc52f

' Initializes editor device
PROC InitScreen
graphics 0
poke @@LMARGN, $00
poke @KEYREP, 3
ENDPROC

The change I'm making is incredibly small, simply adding two setcolor statements to the InitScreen procedure to end up with:

 PROC InitScreen 
   graphics 0 
   setcolor 1,0,14
   setcolor 2,0,0
   poke @@LMARGN, $00 
   poke @KEYREP, 3 
 ENDPROC 

It compiles without issue and, when loaded up in either an emulator or on real hardware, the colors work as expected.

But I can't load files from any device. The initial HELP.TXT file is loaded on start, but attempting to load any other file - even the same HELP.TXT file - results in 130 I/O ERROR.

For a sanity check, I did a hard reset to HEAD a clean make. The resulting ATR and FB.COM binary is able to load files without issue. It's only when I modify that editor.bas file that I encounter this problem.

I'm not sure if I'm doing something wrong here, or if this is a bug, or a problem with my toolchain. Any guidance this community can offer me would be awesome.

Reproduction Steps

  1. Check out the v4.7 tag to ensure working from the current stable source.
  2. Edit src/editor.bas and insert setcolor 1,0,14:setcolor 2,0,0 into the InitScreen procedure.
  3. Compile the code.
  4. Boot the fastbasic.atr in either an emulator or on hardware.
  5. Run FB.COM.
  6. Press CTRL+L and attempt to load D:HELP.TXT.

Dev Environment

OS: Ubuntu 24.04 derivative (Pop!_OS)

Run Environment

Emulator: Atari800 v4.2.0
Hardware: Atari 800XL w/U1MB (SpartaDOS X 4.49)

@taylor-madeak taylor-madeak changed the title Unable to load files after modifying editor Unable to load files in FB.COM after modifying editor colors Apr 18, 2025
@dmsc
Copy link
Owner

dmsc commented Apr 19, 2025

Hi!

This is strange - and I can't reproduce it :( , see my test over current GIT, I added just the lines you mentioned:

Image

Remember to always try with the full ATR, as you need DOS loaded to be able to read/write files.

@taylor-madeak
Copy link
Author

I expected that would be the case. If you were able to easily reproduce the issue, you would probably encounter it every single time you made changes to the editor.

I'll start by confirming that I am, indeed, using the full ATR in all test instances. Here is a video demonstrating the issue:

Screencast.from.04-20-2025.01.37.59.PM.webm

I suspect this boils down to toolchain differences. All I've done is install build-essential, which installed:

  • gcc v11.4.0
  • make v4.3

Can you list your versions so I can try to match them and see if that resolves this?

@Dushino
Copy link

Dushino commented Apr 21, 2025

I have not tested, but I think the problem is in dual @ in
poke @@LMARGN, $00
Should not there be only one @?

@dmsc dmsc closed this as completed in c78eee2 Apr 21, 2025
@dmsc
Copy link
Owner

dmsc commented Apr 21, 2025

Hi!

The problem is visible in your video, while changing the editor.bas file, your editor replaced the $9C and $9D characters (that are invalid UTF-8 codes) with the "missing character" UTF-8.

I changed the code to use a more compatible syntax to avoid this problem.

Have Fun!

@dmsc
Copy link
Owner

dmsc commented Apr 21, 2025

Hi!

I have not tested, but I think the problem is in dual @ in poke @@LMARGN, $00 Should not there be only one @?

Two @ means that the reference is in zero-page, producing shorter code.

Have Fun!

@taylor-madeak
Copy link
Author

I didn't even catch that. I applied your change and that solved my problem. Thank you for the help, @dmsc!

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

No branches or pull requests

3 participants