EtchedPixels / EmulatorKit

A collection of emulators mostly of retrobrew style systems
GNU General Public License v3.0
138 stars 41 forks source link

BASIC output stops #13

Open sam-falvo opened 4 years ago

sam-falvo commented 4 years ago

I just built the the rc2014 emulator from sources. I invoke the emulator as follows:

./rc2014 -s -r ~/git/rc2014/ROMs/Factory/24886009.BIN -e 1

I then type the following line into BASIC:

10 FOR Y=0 TO 24:FOR X=0 TO 79:PRINT ".";:NEXT:PRINT:NEXT

This should dump 2000 dots to the screen. However, when I RUN the program, nothing appears on the console. I tried it with and without the -f option.

Intermittently, upon typing the ENTER key, a single line of dots will appear. Typing random characters on the keyboard has a similar effect, with the exception of when I mash multiple keys, it appears to break (as though I'd typed CTRL-C) the program instead.

If I happen to have some text in the X11 paste buffer and paste it into the console window, the whole interface just deadlocks after accepting the first character.

I was hoping to use this emulator to develop some Z80 Zed software interactively, but I will absolutely need the ability to paste code into the terminal; likewise, I will absolutely need it to dump entire screens to the console as well. It's not clear to me if I'm doing something wrong, or if there's more debugging of the emulator code that needs to happen. Is there any advice you can offer that will help resolve this issue?

Thanks for your time.

EtchedPixels commented 4 years ago

Thanks. I don't test the RC2014 BASIC emulation often. Sounds like the updates the SIO broke some element of the IRQ emulation for it (I think the standalone BASIC is the only user of the transmit interrupt)

If you run with -a and the ACIA version of the ROM does it work ?

(It is btw completely unaware of the cut and paste - it sees it just like very fast typing so I suspect that is a side effect)

sam-falvo commented 4 years ago

When I run the following command:

./rc2014 -a -r ~/git/rc2014/ROMs/Factory/24886009.BIN -e X

where X is either 0 or 1, I get a seized system. With X=2, it drops into a system monitor, and from there, I type basic and then it drops into BASIC just fine. I should point out that this only works with -a; with -A, even the monitor crashes.

In all cases, however, the emulator tells me that no UART is specified, and that it is defaulting to the ACIA option.

Since I am able to bring up BASIC in this configuration, I am able to type in the program and it does print the 2000 dots, as expected. However, when trying to paste the program listing into the console window, it seems to overrun the input buffer on the ACIA:

1 O 0T 4F = O7PIT""NX:RNNXT

At least it doesn't deadlock the emulator though. :)

EtchedPixels commented 4 years ago

The overrunning the emulator is fairly correct emulation as RC2014 uses a silly baud rate for such a slow CPU (same will occur on the SIO). If you add "-f" you'll instead run a stupidly fast CPU which may help.

I would expect it to fail with -A. The old rc2014 systems expect an ACIA partially decoded over a load of the I/O space. The -A option is a narrow decoded ACIA and requires the newer/bigger RC2014 systems with ROMWBW.

Thanks. That all helps a lot on the debug. When I have some time I will take a look at the SIO interrupt emulation.

EtchedPixels commented 4 years ago

Curiously a for loop printing stuff with a newline doesn't break. Need to also test this on a real machine I think see if it works there 8)

sam-falvo commented 4 years ago

Well, if the USPS ever delivers my Zed to me, I'll be sure to test it on live hardware after I finish building it. :)