datajerk / c2t

Retro Code (Apple II, Cosmac VIP) to Tape/Text
BSD 3-Clause "New" or "Revised" License
64 stars 11 forks source link

Micro-Professor MPF-II Apple-II clone? #14

Closed vitasam closed 3 years ago

vitasam commented 3 years ago

Hello, what do you think is possible (in theory) to do the same for this Apple-II clone? https://en.wikipedia.org/wiki/Microprofessor_II

I was not able to find any information about cassette data format of MPF-II, but comparing WAV files from Apple-II and MPF-II, it becomes clear that they are different.

Do you think it would be possible to reverse engineer an audio file from MPF-II if, for example, save a block of memory from Monitor with known bytes to a file?

datajerk commented 3 years ago

I'm sure it's possible, just takes time and physical access to HW.

vitasam commented 3 years ago

I have the HW, but have little knowledge about MPF-II modulation scheme. Do you have an idea where to start from?

datajerk commented 3 years ago

connect it to audacity (FOSS, but perhaps get an older version now since there's spyware in the latest version, you'll have to google for tips on getting a non-spyware version), write some data, look at the waveform

vitasam commented 3 years ago

Yep, I did it, it looks like there is 1 kHz of pilot signal, followed by probably frequency modulated signal (I see 2 periods of waves). image

datajerk commented 3 years ago

Looks like zeros and ones to me.

vitasam commented 3 years ago

Hi, I just found from the manual, that MPF-II supports saving data to cassette in Apple-II format: image

However, I'm not sure how compatible that format with an actual Apple-II format. Could you kindly take a look in to attached zip file, where 8 bytes ( 0400: 89 91 00 00 00 00 00 00 ) have been stored to audio files (8-bit uncompressed PCM) from the real MPF-II computer? I was trying to generate the same mon's bytes to Apple-II .wav file with c2t, but MPF-II was not able to load that file.

MPF-II_two_formats_audio.zip

vitasam commented 3 years ago

Wow, it works! Mon-to-Apple-II_to_MPF-II

  1. I've converted Hello World monitor dump in to Apple-II .wav with your utility:
    0400: A2 00 BD 11 04 C9 FF D0
    0408: 01 60 20 ED FD E8 4C 02
    0410: 04 C8 C5 CC CC CF A0 D7
    0418: CF D2 CC C4 8D FF FF 00

c2t-96h.exe -2 hellow.mon,400 hello.wav

  1. Then I converted .wav file in to 1-bit .BAW file to use it with ZX-Taper (a digital "tape recorder" on AVR).
  2. Loaded .BAW file to MPF-II and run it:
 CALL -159
 400.41FRA
 400G
datajerk commented 3 years ago

excellent news

vitasam commented 3 years ago

Thanks! By the way, do you know, is there a way to decode BASIC .wav file in to a text listing?

datajerk commented 3 years ago

First you need to find a tool that will convert a basic binary dump to text listing. I do not know of any. Then you'll need to create a tool to read a wav and do the zero crossing detection so that you can extract the binary data for the 2nd tool; that should not be too hard, look at minimodem source as an example.

vitasam commented 3 years ago

Yep, I guess such converter (BASIC binary to text) is a main problem. So, basically it should be a complete BASIC interpreter on a PC, able to load and list the program text.

About .WAV file - I'm using 1-bit .BAW format with ZXTapeRecorder2 device, it works very reliably with MPF-II (after HW modification of MIC port). My guess is that 1-bit format should be relatively easy to convert into binary dump.