I have an idea to stream a binary file directly to apple2 memory over serial. My setup is appleIIe clone not enhanced (Pravetz 8C) with 128kb ram. I've made a custom serail card which uses esp8266 with Bo Zimmerman firmware to stream data over http.
I've made a cc65 C program which can hook to http server and stream a file to the apple2. Currently the program takes 23 blocks on Prodos disk, which I believe is about 10k.
After loading the program it connects to local http server, and as a test I'm streaming Moon Patrol binary which is 32kb with stripped first two bytes (which indicate the loading address). There's an option in AppleCommander so I used it to export the bin for the purpose of streaming it.
Now the problem I don't know how to solve is, how to use the auxilary memory in Prodos and directly put the bytes which are being streamed in there. My program loads at address $0803 and takes 10kb. Moon Patrol binary is 32kb, so that's 42kb of memory needed for both programs in the memory. I can't overwrite my "loader" program with Moon patrol bin, as it will break the streaming process. So I guess my only option is to find a way how to put the streaming bytes into the aux 64kb.
Any ideas or hints how to do this?
Sounds a bit like you're reimplementing ADTPro, so you can stream to disk from Ethernet. But sounds like a fun project anyway... :)
If I understand correctly, the question is about how to use the AUX RAM. This is easily enabled through soft-switches. You can switch read and write access to aux vs main memory separately. So you can keep executing your program in main RAM (= reading from main RAM), while writing to AUX RAM.
Here's a good explanation of the soft-switches in SpeedyG's AppleBox:
https://www.applefritter.com/appleii-box/P002_AUXMEMIIe.htm
When you use ProDOS, you need to make sure to keep clear of the RAM areas used by ProDOS itself. Here is a good memory map:
https://prodos8.com/docs/techref/writing-a-prodos-system-program/
So, as I understand the ProDOS memory map, you can use the AUX RAM area from $800-$BF00 for your own purposes.
Thank you for the suggestions!
I've read briefly today about what you suggest and will likley try it if I fail with my current approach. As far as I understand there are two approaches for using the upper 64kb. The first is the one you describe (with the soft switches) and the second one is take advantage of ProDos' RAM disk. I decided to try the second one as it seemed less hassle initially.
When booted, ProDos creates a RAM disk with the size of the AUX 64kb Ram. I decided to try and stream the bytes direclty to a file in the Ram disk. It's quite easy actually with cc65 fopen()/fwrite()/fclose(), just setting the name to '/ram/streamed_file.bin' in fopen(). After streaming, I can see the file is saved in the ram disk and the block->kb conversion is roughly as the expected original size. The starting address show, however is $0000.
The problem seems to be a missing header, which ProDos expects to see at the begning of every file. The header indicates also the loading address and some other other magic bytes. The file which I stream is dumped from Dos 3.3 image and doesn't have a prodos header. So I need to figure out how to calculate this header and append it at the begining of the data file which I dump from Dos 3.3. I tried to load the file at a certain address, e.g. "bload /ram/m.bin, a$2000", then in Monitor : $2000g, but it doesn't work. Tried with address $800 and it fails again.
Screenshot 2024-10-24 at 22.24.35.png
Screenshot 2024-10-24 at 22.11.26.png
I don't know anything about what you're doing but it sounds kind of similar to this: https://asciiexpress.net/gameserver/
Just my two ccents worth
magnus
But Pravetz 8C and 8A have no cassette port input (it was cut to leave softswitches for some Cyrillic charset/kbd control), I guess that's why OP is fighting to get something similar. Anyway, I would have added the cassette port input circuitry instead.
I don't want to to it with cassette port/routines. I have some progress with understanding where the problem might be. It's within ProDos and its aux types and load addreess. I've been experimenting with raw binary file and AppleSingle file types so I just need to stream the file and save it with the correct format and settings.
Well, I made some progress. The problem was a bug in my code. There was +1 byte offset in the streamed file. I've successflly streamed over wifi Moon Patrol, saved it on the active disk and run it.
It also works with the Ram drive. Now the only thing left is to make the file auto start after download.
Here's a rather sped up video of the streaming process