Wednesday, August 23, 2017

Getting a BASIC listing from mame's apple2e driver

So after much much fiddling, I've figured out how to get my basic listing out of the apple2e driver in mame 0.188.


I launch mame with the following command line:


./mame64 apple2e -sl1 ssc -sl1:ssc:ssc_rs232 printer -printout myprintfile.bin


and then I ctrl+reset (ctrl+f12) to get to a command prompt, type

PR#1
PRINT "HELLO THERE"
PR#0

and then drop out of mame with ESC.


But I look at the output file and it's not right.

hexdump -C myprintfile.bin 
00000000  8d 8a dd d0 d2 c9 ce d4  a0 a2 c8 c5 cc cc cf a0  |................|
00000010  d4 c8 c5 d2 c5 a2 8d 8a  c8 c5 cc cc cf a0 d4 c8  |................|
00000020  c5 d2 c5 8d 8a 8d 8a dd  d0 d2 a3 b0 8d 8a        |..............|
0000002e
So I use unix tr to get rid of the high bit, and the text is there.

tr '\200-\377' '\000-\177' translates characters 128-255 to 0-127.

cat myprintfile.bin | tr '\200-\377' '\000-\177' | hexdump -C
00000000  0d 0a 5d 50 52 49 4e 54  20 22 48 45 4c 4c 4f 20  |..]PRINT "HELLO |
00000010  54 48 45 52 45 22 0d 0a  48 45 4c 4c 4f 20 54 48  |THERE"..HELLO TH|
00000020  45 52 45 0d 0a 0d 0a 5d  50 52 23 30 0d 0a        |ERE....]PR#0..|
0000002e
So now I can get my listing, hooray!

I suppose that I could just set the SSC card to 7 bits.




No comments:

Post a Comment