tom-seddon / basic_editor

Updated version of Acornsoft's BASIC Editor for the BBC Micro
15 stars 4 forks source link

Hangs/crashes with TUBE 6502 in MODEs other than 7 #16

Closed mincebert closed 4 years ago

mincebert commented 4 years ago

I don't really know what the cause of this but it appears to be a combination of starting the editor with a TUBE and not being in MODE 7.

I have an BBC Master with an internal PiTubeDirect (running EggEater and upgraded to Fer-De-Lance) — I don't have a real TUBE co-pro and this might be the problem, but I don't get many (if any) other problems with it. If someone has a real TUBE co-pro, they could find out if it's a PiTubeDirect-specific issue, but I'm assuming not as things like ELITE work fine.

If I power on then Ctrl+Break the machine (I have the default MODE as 7) and type *BE, the editor starts up OK.

However, if I type MODE 6 (or any MODE other than 7) then type *BE, I just get "The BASIC Editor" then the machine hangs. Pressing Ctrl+Break recovers, although the TUBE co-pro is disabled. A second Ctrl+Break recovers the TUBE.

It makes no difference if I use the HiBASIC version or the BASIC version. I got this with 1.43 and still get it with 1.44.

It doesn't matter if I pick the various different 6502 processor options in PiTubeDirect (0, 1, 2 and 3 in Fer-De-Lance).

It doesn't matter if I pick a shadow screen mode or a normal screen mode (not that that makes much difference under the TUBE, I suppose).

I'm running MOS 3.50 but it does the same thing under 3.20.

I haven't even remotely tried to debug it, I admit! I'm not sure my EXMON skills are up to it!

Thanks and appreciation for your work on this editor.

tom-seddon commented 4 years ago

Thanks for the report, and sorry you're having difficulties. All versions of the BASIC editor are supposed to work just as well over the Tube as on the host computer.

I'm a bit suspicious of PiTubeDirect here - the editor runs fine in all modes on my Master with ReCo6502Mini. This configuration has had quite a lot of testing.

I think the The BASIC Editor message is printed by the OS just before it copies the ROM across the Tube. If it then doesn't get as far as clearing the screen and printing >, I'm wondering if the copy process is going wrong somehow. There's not much to go wrong between the ROM entry point and waiting for your input.

Does *BZ work?

Do other language ROMs work over the Tube? Do older versions of the editor work?

Can you build the code? I can suggest some things to try if so.

Sorry for not having a definite answer, but I'd like to get to the bottom of this!

Thanks,

--Tom

mincebert commented 4 years ago

Hi thanks for the reply — I was about to post an update after a fair bit of testing and attempted debugging this afternoon.

I tried sticking some LDA #"X" / JMP OSWRCH pairs in at various places (in the service call that parses the command and also in the language entry point). The long and short of it is that, even with that at the start of the language entry point, it doesn't print anything, so it's failing before control is sent to the BASIC Editor.

[As an aside, I couldn't see the stack pointer being reset to $FF at the language entry point - I did wonder if that might have been the cause at first, but I'm not an expert on these to know if that's definitely needed or reset elsewhere.]

I then tried EDIT (the built-in Master text editor) and it does exactly the same thing: runs fine in MODE 7 but hangs after printing "EDIT" in other modes. Actually, I just tried BASIC and that does the same thing.

Thanks for confirming with an alternative co-pro — I'll post an issue in the PiTubeDirect issues as this doesn't look like BASIC Editor and looks more like that (especially since it doesn't reappear after the first Ctrl+Break, so maybe it crashes and restarts), so sorry for wasting your time!

mincebert commented 4 years ago

Just for completeness — the issue was with my PiTube level shifter board and is resolved with a different board or changing tube_delay: https://github.com/hoglet67/PiTubeDirect/issues/70

Dave is looking at what the root cause is, but everything's working for me now, thanks.