"Type" function in openmsx-catapult

By pitpan

Prophet (3131)

pitpan's picture

28-12-2014, 09:40

Hi!

I'm currently using openmsx-catapult 0.10.0 and openmsx 0.10.0 under Linux Mint 17 Mate (x64). It works flawlessly and even in my low-settings netbook it does not miss a single frame.

Yesterday I tried to flex my MSX-BASIC muscles a bit and I decided to type some lines. I set up a "logger" printer to a TXT file and LLISTed: everything went fine. But when I copy - pasted the code from a text editor back into the "Input text" tab of openmsx-catapult, it didn't get copied to the MSX emulator and a "NOK" error was shown at the "Status info" tab.

Any other text that I type or copy-paste works great, but NOT the ones "printed" from the MSX emulator. Any workaround? I guess some weird escape codes where present, but I couldn't fix them.

Login or register to post comments

By NYYRIKKI

Enlighted (5267)

NYYRIKKI's picture

28-12-2014, 11:24

You can find my work around to your exact problem from here, but I suggest that you just save your BASIC-program as a TXT-file. Use the "dir as disk" feature to mount the directory with TXT-file as disk and use LOAD or MERGE command inside MSX to load / combine the program to MSX memory.

By pitpan

Prophet (3131)

pitpan's picture

28-12-2014, 17:56

Thanks, Nyyrikki. I was trying to be as diskless as possible, but I see that it might be a problem. And saving to WAV a using my good'n'old WAV -> TXT coverter is a bit overkill. I'll keep experimenting Smile

By pitpan

Prophet (3131)

pitpan's picture

28-12-2014, 18:09

OK. Solved, in a way: aparently the MSX printer adds "\r" escape codes at the spaces and carriage returns, but openmsx does not want them. Therefore, stripping all the \r from the printed file allows it to be typed again from the "Input Text" tab.

In my opinion, openmsx-catapult should accept \r codes, althought they cannot be directly typed back into the emulated computer.

By NYYRIKKI

Enlighted (5267)

NYYRIKKI's picture

28-12-2014, 22:00

pitpan wrote:

Thanks, Nyyrikki. I was trying to be as diskless as possible, but I see that it might be a problem. And saving to WAV a using my good'n'old WAV -> TXT coverter is a bit overkill. I'll keep experimenting Smile

Well... there is endless number of ways to solve these issues... ie. If you type in OpenMSX console:

puts stderr [ listing]

...it will output the BASIC listing to "Status Info"-tab of Catapult.

EDIT:
-------
Ah... in the default "openMSX/share/scripts/example_tools.tcl" file has this stupid memory address added to output... To fix it, just add "#" in front of line:

append listing [format "0x%x > " $addr]

... save -> press "Stop" & "Start" on Catapult

By Manuel

Ascended (15355)

Manuel's picture

28-12-2014, 22:26

pitpan: I tried the scenario with a simple test and it worked fine.

I typed this program:

10 PRINT "Hi"
20 GOTO 10

and I printed it with LLIST to a file printer.log. Then I did a cat printer.log in my terminal and copy and pasted the text into the Catapult "Input text" tab and pressed the type button. It was typed fine...

So, perhaps you can send me the basic program text file you used and tell me which text editor you used to paste from?

Also, perhaps you can use the 'type_from_file' command in the console to type the program instead. That's another alternative to directly type text from a text file into the MSX.

By sd_snatcher

Prophet (2992)

sd_snatcher's picture

28-12-2014, 23:48

@Manuel,

The terminal is probably filtering the problematic chars. When you copy from its screen, the content will already be "clean".

By Manuel

Ascended (15355)

Manuel's picture

29-12-2014, 00:11

FYI the text file contains this:

1 0 [SPACE] P R I N T " H i " [CR] [LF] 2 0 [SPACE] G O T O [SPACE] 1 0 [CR] [LF]

So, it has normal DOS end-of-line encoding.

By sd_snatcher

Prophet (2992)

sd_snatcher's picture

29-12-2014, 00:25

Seems like a normal DOS file to me too. So how did pitpan file end up with \r before spaces?

pitpan: which emulated machine are you using?