How do I clear the VERA "error led"?
Posted: Wed May 31, 2023 2:51 pm
Ok. So I'm writing a program in ca65 assembly that implements a unix like shell environment in r43.
I know, right? A guy's gotta have his hobbies.
Anyway. A core function is that it doesn't "implement the commands" itself, instead, the commands are special programs that it loads by name into banked ram (Starting at address $A000.) and then executes. The shell provides hook vectors for the executing program to respond back with text to be displayed as a result of that command. After the command program runs, it returns back to the shell.
That works fine. I've only implemented one command, "pwd" (Print Working Directory.) that does nothing but send back a line of text.
In the shell terminal, if you press enter with a blank command line, it detects that and just drops to the next line, but if there's text, it grabs the first word, assumes it's a command, and tried to load it. If that word was 'pwd', then great! It successfully loads the program into $A000 and executes it. The text is printed, the pwd program exits and the shell is back in charge. Great!
But if you type a bad command, like "bad"... well, it can't find that! LOAD sets the carry bit which triggers the shell to say "Command not found." and go to the next line. That works fine.
That's when it gets weird! When a bad command is entered, a blinking red rectangle about 8 by 4 pixels appears in the upper right of the screen. My thought was: "Where is that coming from? What have I screwed up?"
Much debugging and pulling of hair ensued... to no avail. I could not figure out why it's doing that.
Then I have "Moment of clarity" and think, "What would Sherlock do?" Sherlock would say "Well, if you've eliminated all other possibilities, then what remains, no matter how stupid sounding... must be true!" That would be VERA emulating the red blinking LED on an actual floppy drive. Naw... that can't be right, right?
Au contraire, mon frere! It appears that is exactly what is happening. First, I set the horizontal scale to 64 to only show 40 characters per line, and it still appears in the upper right. Then I didn't run my shell at all, instead loading the 'pwd' program from BASIC with LOAD"pwd",8,1 ... Ok, that loaded fine. So I tried loading a non existent program with LOAD"bad",8,1 and viola! It responded with an error message and started blinking the SAME rectangle of red in the upper left of the screen.
Loading any legit file will clear it.
So... how do I clear that in assembly?
I know, right? A guy's gotta have his hobbies.
Anyway. A core function is that it doesn't "implement the commands" itself, instead, the commands are special programs that it loads by name into banked ram (Starting at address $A000.) and then executes. The shell provides hook vectors for the executing program to respond back with text to be displayed as a result of that command. After the command program runs, it returns back to the shell.
That works fine. I've only implemented one command, "pwd" (Print Working Directory.) that does nothing but send back a line of text.
In the shell terminal, if you press enter with a blank command line, it detects that and just drops to the next line, but if there's text, it grabs the first word, assumes it's a command, and tried to load it. If that word was 'pwd', then great! It successfully loads the program into $A000 and executes it. The text is printed, the pwd program exits and the shell is back in charge. Great!
But if you type a bad command, like "bad"... well, it can't find that! LOAD sets the carry bit which triggers the shell to say "Command not found." and go to the next line. That works fine.
That's when it gets weird! When a bad command is entered, a blinking red rectangle about 8 by 4 pixels appears in the upper right of the screen. My thought was: "Where is that coming from? What have I screwed up?"
Much debugging and pulling of hair ensued... to no avail. I could not figure out why it's doing that.
Then I have "Moment of clarity" and think, "What would Sherlock do?" Sherlock would say "Well, if you've eliminated all other possibilities, then what remains, no matter how stupid sounding... must be true!" That would be VERA emulating the red blinking LED on an actual floppy drive. Naw... that can't be right, right?
Au contraire, mon frere! It appears that is exactly what is happening. First, I set the horizontal scale to 64 to only show 40 characters per line, and it still appears in the upper right. Then I didn't run my shell at all, instead loading the 'pwd' program from BASIC with LOAD"pwd",8,1 ... Ok, that loaded fine. So I tried loading a non existent program with LOAD"bad",8,1 and viola! It responded with an error message and started blinking the SAME rectangle of red in the upper left of the screen.
Loading any legit file will clear it.
So... how do I clear that in assembly?