The ESP32 SoftCard for the Apple II

352 posts / 0 new
Last post
PTB
Offline
Last seen: 8 hours 18 min ago
Joined: Aug 14 2020 - 07:01
Posts: 116
Epic !!!!  I have some old

Epic !!!!  I have some old disks from when i was a junior that would be cool to revisit and run. I think the program was Framework III

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Wow!  That really looks good

Wow!  That really looks good actually!  Even 4.77 PC or PC/XT level performance is enough to run a ton of early MS-DOS software.

 

tulack's picture
Offline
Last seen: 2 months 1 day ago
Joined: Oct 20 2023 - 14:21
Posts: 59
Congratulations on the development

I received your card a couple of days ago. Congratulations for the work done. I haven't been able to get it up and running yet, I haven't had the time.

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
You won't be disappointed! 

You won't be disappointed!  It's awesome!

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Project Update: x86 Emulator

Project Update: x86 Emulator

 

Well, after some heavy optimization the fastest I could get the Faux86 based emulator is about 25% faster than an XT running at 4.7 MHz and less than a third of the speed of an AT running at 8 MHz:

 

 

I also got the ESP32-SBC-FabGL from Olimex up and running and I can already tell that the FabGL library's emulator is much faster, even though it's rendering VGA. Without any optimization, it seems to be as fast as an XT machine running at 8 MHz and half the speed of an AT running at 8 MHz, which I think is perfect:

 

 

So, I'm starting work on porting FabGL's PC emulator. 

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Faux86 is good enough to run

Faux86 is good enough to run a lot of stuff but the FabGL is pretty impressive.  More than good enough to run a ton of MS-DOS stuff from the 1980s and early 1990s.

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
How is progress coming on

How is progress coming on that?  Any guess as to when you may be releasing?  I think this could be super popular.

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Project Update

It's progressing, but there is still a lot of work left. At this point I am further with FabGL's PC emulator than I was with Faux86. I just got Hercules' 720x348 working and with that Windows 3.0 for Hercules:

 

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Wow!  Looking good! 

Wow!  Looking good!

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
softwarejanitor wrote:Wow! 
softwarejanitor wrote:

Wow!  Looking good!

 

Thanks! Getting the various things to work using FabGL's PC emulator is taking a while, because the library was designed to produce VGA and work with a real PS/2 keyboard and mouse. On top of that the PC supports so many different graphics modes that all need to be handled differently over composite video.

 

However it has been a nostalgia trip like no other! It brings me back to the time my parents had an Amstrad PPC640 with an 8MHz V30 CPU with CGA at home and my father had an 286 AT with a Hercules graphics card at his work. (Actually my father kept the Amstrad and a couple of years ago he gave it to me. I have been working on modernizing it: click!)

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Project Update: PC Emulator

I finally got the BOIS Mode 13h working, a.k.a. MCGA 320x200x256 colors, a.k.a. 256-color VGA. This took a while, because the FabGL PC emulator only supports CGA and Hercules. It doesn’t support EGA or VGA. However the PC emulator on which FabGL’s emulator is based does support MCGA in the BIOS, so I was able to add it without too much hassle.

 

The next step is to add EGA 320x200x16 colors, which is the most important graphics mode for most games written for the 8088/8086 machines.

 

In the meantime here is DeluxePaint II Enhanced (v3.0) running in the newly added 256-color mode on my Sony Trinitron CRT. This is in PAL mode. NTSC is a bit more "artifacty" around the toolbar.

 

PTB
Offline
Last seen: 8 hours 18 min ago
Joined: Aug 14 2020 - 07:01
Posts: 116
Incredible what you are doing

Incredible what you are doing here. Thanks so much for adding all these cool systems and features. Cheers

Dave

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Wow that is impressive

Wow that is impressive progress!

 

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Project Update: PC Emulator

So far the following text and graphics modes are implemented and working at speeds comparable to a V30 8086 processor running at 8 MHz:

 

  • CGA Text 640x200: 80 columns by 25 rows, 8x8 font, 16 colors converted to grayscale
  • MDA Text 720x350: 80 columns by 25 rows, 9x14 font, 2 colors (black and white, extra bright or underlined characters are not supported)
  • CGA Graphics: 640x200, 2 colors (black and white)
  • CGA Graphics: 320x200, 4 colors from a palette of 16
  • Hercules Graphics: 720x348, 2 colors (black and white)
  • MCGA Graphics: 320x200, 256 colors from a palette of around 262 thousand colors

 

This brings us to the EGA 320x200, 16 colors from a palette of 64. I’ve been struggling with it for a week now and at this point I understand it enough to be able to explain in one sentence why it cannot be supported on the ESP32 without a huge effort: it is because the EGA card is a freaking rudimentary GPU!

 

In all the modes that are already supported, the picture that needs on be displayed on the screen is generated somewhere in memory by the program that is running on the x86 processor. However EGA (and VGA) do not work like that. Instead the running program tells the card what to draw using a bunch of registers. It could be drawing a single pixel, but also an entire plane or shifting the entire picture vertically or horizontally. This is pretty much GPU territory and the amount of processing required per pixel is too much for the ESP32. It is possible, but it would require pretty much implementing an EGA card emulator that would need to run on the other core, so that games in this mode can run at a regular speed.

 

However there is still hope for the 320x200 16 colors mode. It’s TGA and many games support it. It seems to be 1:1 memory to screen, so it should be easy to implement and fast when running. So, EGA is definitely out, but I am going to give TGA a try.

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
TGA is enough to support a

TGA is enough to support a ton of software that was written for the PCJr, Tandy 1000SX and a lot of XT level clones of that era.  It will still be quite an accomplishment.

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
The TGA is a success! The

The TGA is a success! The format is very close to 4-color CGA, so it was very easy to add.

 

Here is Commander Keen 4 in 16 colors, which originally was never released for TGA, but fans recompiled it later:

 

Offline
Last seen: 5 days 21 hours ago
Joined: Jun 29 2018 - 16:55
Posts: 583
CVT wrote:The TGA is a
CVT wrote:

The TGA is a success! The format is very close to 4-color CGA, so it was very easy to add.

 

Here is Commander Keen 4 in 16 colors, which originally was never released for TGA, but fans recompiled it later:

 

[[{"fid":"38254","view_mode":"default","fields":{"format":"default","alignment":""

I was already excited but Keen is amazing, such a big part of my childhood PC gaming! 

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Looks good!  This is going to

Looks good!  This is going to really make the ESP32 Softcard highly sought after I think.  Is that PAL or NTSC output?

 

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
The one above is PAL.

The one above is PAL. Whenever I post pictures, I usually put the PAL version, because it looks slightly better due to less color artifacting.

 

But just to be fair, here is the NTSC version:

 

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
I really can't tell much

I really can't tell much difference between those two, they both look good.

 

macnoyd's picture
Offline
Last seen: 9 hours 29 min ago
Joined: Oct 15 2012 - 08:59
Posts: 839
The NTSC image looks less clear to me

The NTSC image looks less clear to me in comparrison, particularly in the lower right corner where it says "Press F1 for Help"

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Time to compare apples to apples!

Time to compare apples to apples!

 

Some time ago I made a CGA to SCART adapter for my Amstrad PPC 640 and posted a video on YouTube how it runs a couple of games on my Sony Trinitron TV: Commander Keen 4 and Cycles. Now that the PC emulator is almost ready, I can compare its speed to a real NEC V30 8086 CPU running at 8 MHz. Today I made two videos of the game Cycles running on the ESP32 SoftCard: one in 4 colors CGA and one in 16 color TGA in order to see how it compares to the real thing.

 

First here is the original video running on the Amstrad PPC 640: https://youtu.be/tDclvLTWv1g?si=1uH19Qt23O3kGdkL&t=269

Here it is on the ESP32 SoftCard in 4-color CGA mode: https://youtu.be/JglyKdTnf2M?si=u2HuWa4oKiByiMgo

And here it on the ESP32 SoftCard in 16-color TGA: https://youtu.be/XKu9gk0mFEk?si=WDGLVTPVW1DDJMrN

 

Because the Amstrad PPC 640 is running at 60 Hz, I decided to use NTSC for both new videos. I think it's obvious that the PC emulator on the ESP32 SoftCard in CGA mode is slightly slower than the CGA on the Amstrad PPC 640. The TGA is much slower, but that is to be expected. From what I remember this game is also much slower on EGA.

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Even the "slow" ones seem to

Even the "slow" ones seem to be fast enough to be playable. I'm favorably impressed.

 

Offline
Last seen: 9 hours 40 min ago
Joined: Jun 12 2022 - 23:35
Posts: 109
In case someone else needs a

In case someone else needs a CGA to SCART converter, I made a board for CGA/SCART/VGA conversion.

https://github.com/profdc9/CGA2Scart

Dan

 

Offline
Last seen: 1 week 4 days ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
profdc9 wrote:In case someone
profdc9 wrote:

In case someone else needs a CGA to SCART converter, I made a board for CGA/SCART/VGA conversion.

https://github.com/profdc9/CGA2Scart

Dan

 

That's pretty cool.  Unfortunately SCART was never a thing in the US.  It's too bad because it would have been better than some of what we did have back i nthe day.

 

 

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
profdc9 wrote:In case someone
profdc9 wrote:

In case someone else needs a CGA to SCART converter, I made a board for CGA/SCART/VGA conversion.

https://github.com/profdc9/CGA2Scart

Dan

 

Mine is just the simplest one transistor version that you can find on the Net, bit I managed to fit it inside the SCART connector itself: click!

Later I added an extension that provides a composite monochrome output from the green line: click!

Offline
Last seen: 9 hours 40 min ago
Joined: Jun 12 2022 - 23:35
Posts: 109
Yeah, I tried that.  It didn

Yeah, I tried that.  It didn't work for me because:

1.  The CGA didn't provide 5 V.

2.  The video device required the vertical blanking interval to be inverted so that HSYNC and VSYNC needed to be XORed with each other.

3.  Also, some devices are picky about having a minimum interval for the HSYNC and VSYNC signal.

Given this, I made mine able to be jumpered to different configurations to try different variations of the sync signal (CSYNC vs HSYNC, inverted vs. not inverted, XOR, etc.)

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Project Update: PC Emulator

I spent some time optimizing and I was able to increase the speed by around 20% by better balancing the load between the two cores. So at this point I can confidently say that when it comes to CPU speed and rendering time, it is on par with my Amstrad PPC 640, which has a NEC V30 8086 processor running at 8 MHz. I will probably have to reshoot the Cycles videos, because they now showcase it to be slower than it is.

 

Here is the final score from MIPS:

 

CheckIt's CPU benchmark seems to agree:

 

The video benchmark on average has the same advatage over the IBM PC-XT:

 

On the other hand the Hard Drive benchmark is off the scale and this is noticeable when loading programs:

 

I feel like any further optimization at this point is like trying to squeeze water from a rock, but I will make sure these numbers stay as they are for the final release, which is coming very soon.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
Excited to try it all out

I just got mine in the mail today, fresh from Bulgaria.

 

I haven't had a chance yet to install and try it out but that's on my agenda for this evening and I'm looking forward to giving it a spin. And I'm looking forward to trying the PC emulator features when those become available.

 

I just wanted to say thanks to CVT for his work on all this.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
MPBApple wrote:I just got
MPBApple wrote:

I just got mine in the mail today, fresh from Bulgaria.

 

I haven't had a chance yet to install and try it out but that's on my agenda for this evening and I'm looking forward to giving it a spin. And I'm looking forward to trying the PC emulator features when those become available.

 

I just wanted to say thanks to CVT for his work on all this.

 

Well, I installed it and it's been a little hit and miss for me. At first I'd do the "BRUN ESP32NTSC" and it's detecting the card in slot 1 okay, detects the mouse interface in slot 4, and then it wouldn't show anything else. I thought maybe I did something wrong so I checked and double-checked the speaker and video inputs and outputs and everything was fine, so I booted up again and this time when running it, it actually showed the Softcard prompt that time. Whew.

I was able to launch DOOM and play a little although I don't really know the controls too well. Playing with the joystick is difficult, and moving with the mouse equally so, but maybe that's just me.

I then rebooted, tried again and ran the MAC emulator which came up okay... the mouse cursor had a drift though so clicking on things was a little hard. I clicked to open the "Games" folder and it seemed to hang or something... mouse cursor went away and I couldn't do anything else.

At that point, power cycling and trying to run it again, I was back to the original problem where it detects the card in slot 1 okay but then I never get the "Please plug the monitor through the card" message and it just sits there. Hmm...

It has firmware 2.01 on it... other details about my system:

Apple IIe with 80-column card, serial card (slot 2), disk II interface in slot 5, another disk interface in slot 6.

I'm using a FloppyEmu to boot the DOS 3.3 disk.

I do have the ROMxe BIOS installed if that makes any difference.

Any thoughts on anything I could try to help make it reliably start? I was encouraged that it started working after the first few failures and thought maybe it was initializing something from the memory card, but then when the issues came back, I'm not sure what to do next... wipe the memory card and restore from how it came originally, in case something on there is damaged? Try a different mem card?

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
I let it sit a bit, had

I let it sit a bit, had dinner, went back and turned the Apple IIe on and it loaded up the ESP32 interface just fine this time. Played some NES Choplifter, calibrated the joystick and mouse, etc.

 

It did hang up at one point. When I calibrated the joystick, I hit Ctrl-Q when I was done and then typed MOUSE to check that out as well. It showed the screen but then it was hung up... moving the mouse didn't do anything. I hit Ctrl-Q and it actually went back to the prompt, so I typed MOUSE again and that time it worked. I don't know what that was all about, but then I ran NES and did some Choplifter action and everything seemed fine... video, audio, joystick controls, etc.

 

One thing I wasn't clear about from reading this thread was that Ctrl-Q seems to be the "get me back to the prompt" shortcut, but when I saw that in some of the other screens like the joystick calibration, I realized that seems to be common. I don't know if that works across all of the different emulators? If so that might be worth adding to the basic instructions? Just a suggestion since I was stumbling around a bit there at first. :)

 

I was reading up on the ROMxe trying to figure out how to "romify" the launching program. I thought that'd be a nice option so I could do that straight from the ROMxe boot routine, but that's more of a "nice to have". I'm somewhat new to all of the "new" retro Apple II stuff although back in my teen years in the 80's I was all about the Apple ecosystem and knew my way around really well. So all of that knowledge is a little dusty still, but I might see if the Romify instructions make any sense and give that a shot.

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Sorry that you are having

Sorry that you are having issues with it!

 

Let’s start with a bit of background. There are two types of crashes that can happen with the card. The first one is when the ESP32 encounters an error or hangs. When that happens, it is set up to immediatly restart, causing the video to switch back to the Apple II. If the ESP32 doesn’t crash, but simply hangs, it will restart in 2 seconds, because of watchdog timers on both cores and again you end up with the Apple II Basic prompt.

 

The seconds crash is when the Interface program running on the Apple II processor crashes and exists to Basic or simply hangs. When this happens, the ESP32 simply stops receiving input, but it keeps running whatever it was running before. However you can no longer interact with it, because no keystrokes or joystick/mouse events are sent. If for example it is running Wolfenstein 3D in demo mode, it will continue doing that forever. You can simulate this by simply hitting <Ctrl><Reset> while in the ESP32 command prompt. You will see that you can no longer type, because you have actually rebooted the Apple II and are now in the Basic prompt. However if you blindly type “BRUN ESP32NTSC” you end up relaunching the Interface program and you will be able to type once again.

 

I highly suspect the second is happening, however I don’t know if the Interface program is hanging or exiting to Basic. However when this happens, if you manually unplug your monitor from the ESP32 SoftCard and plug it to the back of the Apple II, you can tell if you are back in Basic or the Interface program is hung. Now the Interface program can hang for a variety of reasons most of them having to go with some issue with the Apple II. I have a flaky Apple II+ myself and this happens on it very often when it has been sitting for a while.

 

However, since you mention that the cursor was drifting, I want to eliminate another possibility, which is the ghost mouse motion. If you have a mouse card, but the mouse is not plugged in, it causes the cursor to move in some direction with ever increasing speed, which interferes with the comunication of the ESP32 SotCard and the Apple II. So, can you please try to get back to the ESP32 SoftCard’s command prompt and run the MOUSE command? You should see stationary crosshairs. Also if you run the JOYSTICK command, you should see the joystick cursor centered within the box. If it is not, please use the wheels to center it.

 

Other than that, the first step to try a minimalistic configuration by removing all the other expansion cards, except for the FloppyEMU and moving the ESP32 SoftCard to a different slot. Also are you able to try it without the ROMX BIOS?

 

Btw, when in the Mac emulator, Button 2 of the joystick (or the solid Apple key) toggles between the joystick emulating a mouse and operating the arrow keys. So the cursor disappearing might be just that.

 

PS: I wrote most of this prior to seeing your latest post.

PS: jeffmazur was one of the early adopters, and he has the ESP32 Interface program in ROMX already. Perhaps he can send it to you.

PS: <Ctrl><Q> is used to exit all the game console emulators + the joystick and mouse calibrators. To exit the Mac emulator you actually have to do Restart (not Shut Down) from the Special menu.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
Thanks for the reply. Since

Thanks for the reply. Since it started working again after that initial attempt, I'll continue to check it over the next few days to see if the problem comes back up.

 

If so, I'll simplify by removing anything that it doesn't need. I have the original ROM chips, so I could swap those out for the ROMxe but they're not the "enhanced" ROMs. That probably won't matter for this card though since it's only using the Apple to launch the ESP32 interface and intercept keyboard, mouse and joystick. So it probably doesn't need anything from the enhanced ROMs or a 65C02 ?

 

I also have another Apple IIe that I'm in the process of repairing (a few broken/missing keys that are currently being shipped to replace those). It's also unenhanced but it might be a good way to test it out and see if it's a computer specific issue or not.

 

Both of my Apple II's are eBay purchases that worked, but needed some cleaning, and the power supply on one of them definitely had to be recapped (the one I'm using now looks like it already had a recap done). But both passed all their memory tests thankfully so I'm pretty sure the RAM is okay on them.

 

It's good to know that jeffmazur was also using a ROMx on his system and I guess it was working okay? That was my concern, that maybe that was somehow causing an issue, and in my case I also swapped out the Video ROM from them as well (since it was an un-enhanced system, I at least would have had to get the enhanced video ROM, and figured I may as well get the ROMxe video ROM as long as I was swapping chips).

 

I'll also keep in mind the things you mentioned about the types of crashes and recovery. Hopefully if this keeps happening I'll have more feedback to help narrow down where the problem is. :)

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Thanks for the input! I think

Thanks for the input! I think since you have a second Apple II coming up online, we should be able to identify the issue by simply trying a few configuration combinations.

 

Yes, Jeff was one of the first people to receive this card, since he helped me tremendously with translating the Interface program from Basic to Assembly. It does't need anyting from the enhanced ROM, but he mentioned in a previous post that he got it working with ROMX: https://www.applefritter.com/comment/103419#comment-103419

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
So far, so good

Well, I don't know what the issues were that I was having at first. I didn't change anything except I did reverse the speaker wires since at first I thought maybe that had something to do with it.

 

With the ROMXe installed, I think that changes how it beeps when starting up and I wasn't 100% sure I was hearing the normal Apple II beep as well as the one that the Esp32 is supposed to add. I'm still not sure. :)

 

Anyway, everything has been working fine for the past couple days. I started it up again this morning to try it out and I was testing a TG16 game of Super Mario Bros which was going fine right up until my rebuilt joystick broke a button (plastic around the button broke off... :) I'm trying to superglue it back together right now)

 

I'll keep testing it out. By the way, I was enjoying the sample list of Internet radio stations... I was listening to the 70's station and was amused to hear German commercials between songs. And the inclusion of an Adrian's Digital Basement clip in the videos was fun (his channel is how I heard about this project, and honestly it's also what got me back into some vintage computers like the ones I used in high school).

 

I was still having issues with the Mac emulation where the cursor was drifting, but you're right, it's because of a drift in the joystick. If I pushed the joystick button a couple times (toggling keyboard?) or just moved the cursor with the joystick, the drift would stop, but then if I tried the mouse again the drift would pick up. I think the joystick was calibrated okay using the JOYSTICK option. I had it centered and from that screen, it wasn't drifting around. I guess as long as I have the joystick open to fix that button, I'll get some deoxit into the potentiometers just to see if that helps. I did that when I first got it since it was in rough shape and it has been performing well right up until the button broke, but it may have got a little "scratchy" again since my initial cleaning.

 

Thanks again for the troubleshooting tips.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
jeffmazur wrote:I'm also
jeffmazur wrote:

I'm also having fun with the new board. Seems like there is a great potential to expand its features as well.

 

I did create a ROM image of the setup program and added it to my ROMX so I can instantly start up the board on power up.

 

Is there any chance you could share your ROMX image? I was going to try creating one myself but if you had something going, that would be a timesaver since I haven't tried to romify anything with it... wasn't exactly sure from the instructions how to do it. I figured out where the binary loads and does the initial jump but then I tabled any further work on it 'til later. It's pretty small (1270 bytes I think?) so I thought about just doing a DOS 3.3 version with a 12K template, but I couldn't find the 12K template anywhere. All I found was the 32K one in the ROMX zip file... maybe the 12K is in the one for the II/II+.

 

I'm probably just thinking it's more complicated than it sounds. :)

Offline
Last seen: 9 hours 15 min ago
Joined: Jun 18 2010 - 13:54
Posts: 744
 MPBApple wrote:Is there any

 

MPBApple wrote:
Is there any chance you could share your ROMX image?

I did make an image for the ROMXe to auto startup the ESP32 Softcard:

 

Package iconESP32.NTSC_.dsk_.zip

 

Making this work on a ROMX for the Apple II/II+ is a little more complicated. But we have a new board coming out soon that would make this possible.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
Thanks for that, I'll

Thanks for that, I'll definitely give it a try.

 

I was trying out a few more interesting features of the card today, like the FTPSERVER and the internet radio stations.

 

Some feedback for CVT, and maybe this was something I was doing wrong, but the FTP server was connecting okay with anonymous, but when I tried to set it up for a user pass (like "FTPSERVER user password") I was getting connection errors. I used WinSCP as well as trying Windows Explorer to map with the user/pass, and dusted off the Putty FTP (psftp.exe) but I'd just errors. I'll have to look at the server responses more... i could see the banner info while connecting but I think it was giving a 503.

 

Anyway... Anonymous did work. Another issue I had was that I was trying to copy back over the 2 Mac disk images because I must have done something with it when fiddling with the joystick creeping... Anyway, disk 2 copied back over okay, just 1440KB, but disk 1 would get partway through (sometimes 20%, sometimes 30%, I think as much as 40%) but then error out. WinSCP was guessing it was a "disk full" error but the sdcard still has lots of room. I was just trying to avoid opening up the case and swapping the card into my reader, but I can do that in this case.

 

Updating other files like the audiostreams.txt is fine... great in fact. I was testing various streaming stations, and the ability to quickly copy the updated file back over was great. If I had to pop that card out/in for little updates like that, it'd be a pain, so that FTP server is awesome.

 

As far as the LISTEN feature, it works for some stations, but other stations I was testing had a lot of dropouts. I don't know if it's because some stations were streaming 192Kbps ? Is that too much for it, or should it be able to handle that okay?

 

I also wasn't quite sure if I should be including the http:// or https:// handler in front of the URL, but it seems to figure it out if I leave those out of the URL so that's what I've been doing.

 

Most of my testing was just getting the correct URL to use... using VLC to test out the stream URL ahead of time is helpful.

 

Here's one station that was giving me some dropout issues:

Vintage Broadcast, s9.myradiostream.com/8724/;?type=mp3&nocache=1705031670?0.06009898341105413

 

A curious thing about that URL... it's actually listed as /:8724/ so that colon is part of the URL path, but I could see that when LISTEN opened it, it was parsing that as the *port* to connect to, not as part of the URI path so it was failing. I could get around that by URL encoding the colon to %3A which worked, but eventually I discovered that that station will stream fine without the colon at all. I wonder if they originally actually did have it on that port but changed it, and that # is just included in the path for legacy reasons. Whatever... I figured it out.

 

So... the FTP user/pass, which maybe I'm just doing something wrong? And how it had issues uploading large files to it...  I assume that's all part of an ESP32 library, the ftp server components, so hopefully that's something with some fixes to explore.

 

The audio streaming and dropouts... when streaming with VLC on my laptop it's fine so I knew the stream itself was okay, but the LISTEN feature was dropping out. It seems like the buffer size should be okay to handle network delays, but maybe it needs more buffer? I'm just guessing. I think my wifi connection is good. I realize that there's VERY little antenna strength on this, but my hotspot is just out in the hallway from my office and I think it was showing about -52 dbm which seems okay. And it was only some streams having issues so I was guessing it had to do with the streaming bitrate.

 

If needed I can stick to streams with lower bitrates like 128k or below... After all, I'm not going for super hi fi on this and the tinny built in speaker. I thought it'd be fun to listen to retro radio on my retro PC, and I can probably find something with a more suitable "lo fi" 32Kb stream. :)

 

I am pleased as punch that the initial problems I had with getting the card to go into the CLI haven't returned. I'm still not sure what that was all about but it's been going great the past few days which is great. 2 thumbs up from me.

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Thanks for the feedback!

Thanks for the feedback!

 

I was able to reproduce and fix the audio stream URL parsing problem. I also noticed that HTTPS is not working because of a missing certificate. I fixed that as well, but there is no advantage in streaming over HTTPS when HTTP is available. In AudioStreams.txt when you don't prefix the URL with http:// or https:// it simply defaults to HTTP.

 

For me the URL  http://s9.myradiostream.com/8724/;?type=mp3  streams perfectly without breaking or buffering. However according to https://www.iplocation.net/ip-lookup the server is based in France and I am much closer to it geographically.

 

I reproduced all the FTP server bugs as well and I am looking into them.

 

I will post a firmware update with all these fixes prior to releasing version 3.0 of the firmware, which will contain the PC emulator.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
Thanks for checking on those

Thanks for checking on those things. I was trying some other streaming URLs today (more of the retro/vintage radio) and some were okay, some still had the buffering/slowness issues.

 

Let me work on a list of the ones that are okay or have issues and that way you'll have a few different ones to compare (I think I also lost track of which ones were okay or not by this point, LOL)

 

I kept retrying the FTP copy of that large Mac disk image and at some point it finally uploaded okay... took a dozen tries but it got there. :)

 

Anyway, I know I've said it before but I'll say it again, I really appreciate the work you've done on this. It's such a cool project... I thought it was fun enough just putting together a retro PC but then adding this to it just expands the types of retro activity I can use it for.

 

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Thanks! A list of problematic

Thanks! A list of problematic audio stream URLs will be very helpful.

 

Don’t waste your time with the FTP server at this point though. It has multiple problems, some of which I already fixed, while others are still eluding me, like the random disconnects during the transfer of large files. Also its transfer buffer was only 1K, causing the speed to cap at 1 Mbps when using Windows explorer. This means when it worked, it took almost 12 minutes to transfer an 80 MB file. I increased it to 8K and managed to double the speed, but it doesn’t look like I can do any better than that. So even if I manage to fix all the issues, it will still be a bit slow for the 80 MB Macintosh HD image or the 2 PC hard drive images I’m putting together, which are also 80 MB each.

 

So for anyone who wants to transfer files really fast without opening the case, I recommend getting one of these: click!

I also use them for for my dev setup:

 

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
Great progress

That's great progress on figuring out the FTP.

 

I thought about getting some kind of micro-SD extension cable. I didn't know if they existed or not (apparently they do)... I wondered if there would be too much signal loss but if it works, that's definitel a good idea for anyone who makes frequent changes. It might be useful for other things too. I see you have one in your Dan ][, and something like that would also be handy for some servers I use that have an internal card slot for the OS (vmware or something). I was working on such a server a while back, testing some small bootable Linux systems, and it was kind of a pain to keep popping the cover off to access the card.

 

For people in the US who might not have the patience for AliExpress shipping, I saw Amazon has similar items for just a bit more. But if you didn't mind the wait, I've always had good luck so far with my Ali orders.

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
MPBApple wrote:...I see you
MPBApple wrote:

...

I see you have one in your Dan ][...

...

 

The Dan ][ Controller actually requires a small modification in order to be able to use these extenders, which I have described some time ago here, but it didn't make it into any of the later releases: https://www.applefritter.com/comment/101104#comment-101104

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
AudioStreams - test results

Here are the test results from my audio streams file. In one case, the "LiSTNR 80s New Wave" station, it works in VLC but when I examine the "m3u8" file it seems to be talking about an MP4a codec so maybe that won't work. No big deal.

For the ones that suffer the "slow stream" and "dropouts", the bitrate is typically higher (over 128Kbps) but even one at 128K was stuttering. Nothing reported on it about the dropouts, but it was definitely cutting out here and there. One thing they all had in common though, maybe just a coincidence, is that the dropouts all come from 48K sample rates. If they have 44.1K sample rates then it seemed to be fine.

 

The notes in green mean it worked fine for me, yellow means it had the dropouts, and then that blue one which is probably just an unsupported code?

 

It's worth mentioning that I just pulled a variety of internet stations that seemed interesting and I may or may not keep any or all of them (but the vintage ones are pretty fun, with old radio dramas from the 50s like "Dimension X" episodes of classic sci fi stories). So if they simply can't be supported because of the sample rate or bit rate, that's fine too.

 

EDIT:  The color highlights I added in the post are NOT appearing when I actually post it. Boo... hopefully it's still understandable with the notes I added about which ones are okay or not. If I didn't say anything about the slow stream/dropouts, that means it played just fine.

 

Christmas Vinyl HD, icecast.walmradio.com:8000/christmas = slow stream, dropouts possible = channels 2, samplerate 48K, bits per sample 16, bitrate 256K

Classic Vinyl HD, icecast.walmradio.com:8000/classic = slow stream, dropouts possible = channels 2, samplerate 48K, bits per sample 16, bitrate 256K

Contemporary Christian, icecast.walmradio.com:8000/walmn = slow stream, dropouts possible = channels 2, samplerate 48K, bits per sample 16, bitrate 320K

LiSTNR 80s New Wave, wz7liw.scahw.com.au/live/780snewwave_128.stream/playlist.m3u8 = not working (works in VLC though) - may be mp4a codec?

Indiana Dunes Old Time Radio, ais-edge106-live365-dal02.cdnstream.com/a78203 = channels 2, samplerate 44.1K, bits per sample 16, bitrate 128K

New Wave 80s Radio, digitalaudiobroadcasting.net:8004/stream = channels 2, samplerate 44.1K, bits per sample 16, bitrate 128K

Old Time Radio, icecast.walmradio.com:8000/otr = channels 1, samplerate 48K, bits per sample 16, bitrate 64K

Traditional Christian and Classical, icecast.walmradio.com:8000/walm2 = slow stream, dropouts possible = channels 2, samplerate 48K, bits per sample 16, bitrate 256K

Vintage Broadcast, s9.myradiostream.com/8724/?type=mp3 = slow stream, dropouts possible = channels 2, samplerate 44.1K, bits per sample 16, bitrate 192K

Vintage Obscura, radio.vintageobscura.net/stream = no errors shown but it's still stuttery compared to normal on VLC = channels 2, samplerate 48K, bits per sample 16, bitrate 128K

WZQR Gold Big Band, ais-edge102-live365-dal02.cdnstream.com/a21353 = channels 2, samplerate 48K, bits per sample 16, bitrate 128K

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
I tried all of them, here is

I tried all of them, here is what I am getting:

 

All the ones that start with icecast.walmradio.com: some dropouts, but rare

    Server location: Netherlands

 

LiSTNR 80s New Wave or anything that ends on .m3u8: playlists are not supported at this point

 

Indiana Dunes Old Time Radio: this one is protected through a website authentication. Will not work.

 

New Wave 80s Radio – plays perfect for me

    Server location: USA

 

Vintage Broadcast – plays perfect for me

    Server location: France

 

Vintage Obscura – plays perfect for me

    Server location: USA

 

WZQR Gold Big Band – plays perfect for me

    Server location: USA

 

So at this point I don’t see anything obvious that I can fix. However I noticed that I am getting more dropouts when I connect to my seconds hotspot, which is in another room and has a weaker signal. So can you please try putting your router right next to the Apple II to see it this makes a difference? Also I am seeing almost no dropouts this Sunday morning around 9 AM, compared to last night (Saturday).

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Firmware Update

Firmware Update:

 

Here is a minor version firmware update, which fixes the issues found by MPBApple: Package iconESP32 SoftCard FW v.2.02.zip

I never published v2.01 here, which is why I am including it in the version history.

 

Version History: (Continued)

 

v2.01

    - Command prompt: Updated the help screen to include the TG16/PCE command.

    - TurboGrafx-16: fixed a bug causing some games to go into an unsupported graphics mode on PAL when relaunched.

 

v2.02

    - FTP server: fixed a bug causing random disconnects during the transfer of large files.

    - FTP server: fixed a bug that prevented non-anonymous users from being able to connect.

    - FTP server: increased the transfer speed from around 1 Mbps to around 2 Mbps.

    - Audio player: fixed a bug causing HTTPS URLs not to connect. Now they properly default to HTTP.

    - Audio player: fixed a parsing bug that was causing some URLs with a colon after a slash to fail.

    - Audio player: fixed a bug causing long stream names or long URLs to break the LISTEN command table. 

 

To update, simply place the BIN file found inside the ZIP archive in the /Firmware directory of the SD card and then run the UPDATE command.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
The new firmware seems to

The new firmware seems to have fixed that FTP issue like you mentioned. Thanks. The copy of that large Mac disk worked fine. It's not going to win any speed records (I think WinSCP was showing 130-140 Kbps) but it got the job done. And the good news is that I was able to copy over the new firmware file without any problems, so it was small enough to copy okay so I could do the flash.

 

For the audio streaming, I pulled an old access point out of my stash, placed it directly next to the Apple and gave it a test SSID, and connected to that. In the screenshot I'm attaching, you can see it "MPTest" with a signal strength of -35 dBm compared to -59 dBm for my regular "MPMesh" ssid I was using before. So it's a lot stronger by a lot, but I still get those audio dropouts on the same stations when streaming. I'll attach a photo of that screen too in case the errors or other metadata show anything useful.

 

Those stations all stream okay on my Windows machine with VLC so I know they were working okay in general. Well, I'm not too worried about it, I'm sure I can find other similar stations that stream at a lower bitrate. I wonder if there are any other ESP32 Softcard users, maybe in the US like me, that could try some of them out just to compare.

 

Oh, I wondered if there was any attachment points for an external antenna on the ESP32 itself. I haven't opened the Apple case again to see if the ESP32 has the external antenna connection with the option to move a resistor to different pads for internal or external antenna. I've seen some videos on soldering an SMA connector directly to it by scratching off some of the solder mask that covers the internal antenna area, but I think my wifi connection is okay, but I was just curious if there was a cleaner way of doing that, just in case. I've mostly tinkered with things like Raspberry Pi and this is my first ESP32 device so I'm very new to the architecture.

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
MPBApple wrote:The new
MPBApple wrote:

The new firmware seems to have fixed that FTP issue like you mentioned. Thanks. The copy of that large Mac disk worked fine. It's not going to win any speed records (I think WinSCP was showing 130-140 Kbps) but it got the job done.

...

 

Hmm, only 130-140 KB/s? There is something strange here. The signal strength of the hotspot I am using is only -52 dBm, yet I am getting almost twice the transfer speed. I was using File Explorer until now, but I decided to install WinSCP, so that we are comparing apples to apples. Also I used the same 80 MB Mac hard drive image file. I did a download and an upload, here are the results for the download form the ESP32 SoftCard to my Windows 10 laptop:

 

 

And for the upload from my laptop to the ESP32 SoftCard:

 

 

Converting to megabits per second this is: 255 KB/s x 8 bits/byte = 2.04 Mbps, which is exactly what I was seeing in Task Manager when I used the Windows 10 File Explorer as an FTP client.

 

I am not sure why you get this difference, but I suggest trying with the Apple II lid open before considering an external antenna. Perhaps the two floppy drives on top are really shielding pretty much all the non-metal walls. Also it’s not really fair to compare an audio stream quality to a modern PC running VLC. It has so much more CPU power and bandwidth and it can easily smooth a very choppy audio stream by simply burst-buffering.

 

That being said, I think there might be a problem with the 48000 sampling rate. I hear this frequent popping, which suggests that it might not be switching the sampling rate properly. I will investigate this further.

Offline
Last seen: 1 week 6 days ago
Joined: Jan 6 2024 - 17:57
Posts: 35
Thanks for double-checking. I

Thanks for double-checking. I just tried the FTP copy again using that Mac disk 1 and it's much better. I might not have remembered it right, or maybe I saw it when it was first starting up and hadn't made a good average time yet. I checked the copy rate after 15 seconds to get a good rate an it's 231 KB/s (so it would take a little under 6 minutes to copy that file).

 

By the way, I was checking out some random games just for fun yesterday and saw in the NES selection there's an Angry Birds 3. I tried it just to see what that would look like but all I got was a blank screen. I'm sure it's some modern port of the game which made me curious to see it but it wasn't working for me. I wouldn't be surprised if it's something in that ROM file itself though.

 

Other games I tried like Arkanoid work great, although with Arkanoid, it seems like maybe I was seeing something similar where the mouse and joystick are both basically usable by the emulator and it was resulting in some weird issues. I could use the mouse or joystick, but it was a little sluggish and sometimes the "paddle" would want to stick all the way left or right (whichever direction I had been going). If I unplug the joystick and just use mouse control its fine, and it might be the same if I just unplugged the mouse and used joystick.

 

Anyway, I wondered if there might be some option to disable mouse or joystick in the emulators, so it was only using the inputs from one or the other (some games like Arkanoid are better with mouse, I think, and some just work better with a joystick, etc).

 

I managed to fix my joystick button... it's an old Kraft Premium II joystick and the plastic around the button just broke entirely. I tried superglue but it doesn't hold, so I ended up ordering a pack of 12mm round buttons in various colors... (I used red to replace the primary red button that broke). Had to use my step bit to drill the hole a little larger (from square to round), soldered the new one in and it works great. Better than the original, I think. Plus, it usese a backing nut to hold it in, instead of some plastic clips that might break again, so I think it'll be more durable. I was tempted to go ahead and replace the other button while I was at it but I'll save that for another day.

 

All of that has nothing to do with the Esp32 Softcard, LOL... but I figure someone googling about that joystick and replacing a button might appreciate the extra info. I couldn't find a direct replacement anywhere, at least not where I was sure it would fit without some hole size modifications anyway, so I just went with the good old Amazon option. $10 USD for a pack of 10 buttons with pre-wired leads... 2 each in 5 different colors. 12mm hole size (on my step bit the 5/8" marking was perfect) since the original square/rectangular hole was about 12mm x 11mm.  I also used the opportunity to get a little Deoxit into the pots for the controls, although they were pretty stable already, and made a slight tweak of the rotation so I could center them a little better in the joystick test screen.

CVT
CVT's picture
Offline
Last seen: 6 hours 37 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1012
Yes, Angry Birds was a NES

Yes, Angry Birds was a NES game I found on a homebrew site. It doesn’t work but I keep a few games that don’t work just to make sure they don’t cause crashes.

 

Regarding the joystick – I do believe your joystick might be too sensitive or maybe it doesn’t stay centered. Third party joysticks can have different sensitivity profiles and unfortunately at this point there is no way to adjust the sensitivity. If it’s off center and it’s plugged-in, it will interfere with game play and cause the cursor to drift in the Mac emulator. I am thinking of adding the ability to adjust its sensitivity to the joystick calibration screen, by allowing the user to increase the size of box in the center. I think it would be better than disabling, since disabling doesn’t really solve the problem.

 

In the mean time if you want to disable it, you need to unplug it and power cycle the Apple II, so that when you type SYSTEM in the ESP32 SoftCard's command prompt, you see “Joystick: not present”. Simply unplugging it will not disable it and it will make matters worse, since its coordinates will go to the maximum and it will start pulling really hard towards the bottom right.

 

The mouse on the other hand should not move when plugged-in to the card, so there is no need to disable it. If you don’t touch it, the cursor should stay where it is and it will not interfere with anything.

Pages

Log in or register to post comments