Bridged chat on:
Please support the defense of Ukraine.
Credit card, bank transfer
Bitcoin, Ethereum, Polkadot, USDT
via Unclutter App for Mac
Active forum topics
No Social Media.
All Content Locally Hosted.
Two Terabytes and Growing.
Built on Free Software.
We have complied with zero government requests for information.
I can't figure out an easy way to I get the assembly code into Merlin-Pro 2.43. I tried using CyderPress to add the text file and then use "Read text file", but the encoding seems to be different and it doesn't work. My idea is to write the assembly code in VS Code with the Merlin 6502 extension, which does syntax highlighting and IntelliSense and then somehow get it into Merlin.
With Merlin-8 v2.58 it's supper easy, since it has a multiline editor and I can just copy the source from VS Code and <Shift><Insert> it in AppleWin.
Btw, I was able to compile and run the second version in Merlin-8 after simply converting it to upper case in VS Code:
When I run it, it still goes to monitor and then I have to type 3000G. Is this happening because of Merlin-8?
I also tried it on the real hardware and it found the card and switched the video. There is a small bug causing keystrokes not to be sent until the joystick is moved, but I think I can fix it.
The CVT file is on the Merlin disk image I sent you. So you should just have to follow step 2 above.
The reason you still need to type 3000G in your Merlin 2.58 version is that you are still using the original file I sent you. The one I most recently posted has the "jmp start" instruction at the beginning (line 34) which will make it BRUNable. It also has a few other fixes...
Yep, in all the excitement I was assembling and running the wrong file! The second version works almost perfectly on the real hardware too! Thanks for all your help, I think this is a great place for me to start.
I was looking for a very simple edit and run procedure and I think VS Code + Merlin-8 is good enough for now. Larger changes can be done by shift-inserting the entire source into AppleWin running Merlin-8 from a 32 MB ProDOS volume of an SD card. Then all I have to do is move the SD card from my laptop to the Dan ][ Controller and I can run it on the real Apple II with an ESP32 SoftCard. The microSD card extenders ended up being super useful for that. Smaller changes can be done simply within Merlin-8 on the real Apple II, since it's multiline editor is not so bad.
Here is the entire dev setup with the JTAG and UART connected. Normally the lid is closed and there is a color CRT monitor on top:
Glad you were able to get it "mostly" working. There are lots of tricks to make this code more efficient, but you can look to improve it after everything does what it's supposed to. There are also many ways to set up a development workflow using either a cross assembler or tools to send files from the host computer to the target Apple or emulator. Personally, I like to edit files on a Mac and then use Applescript to transfer the files to a disk image which Merlin can process in the Virtual II emulator.
In any case, I look forward to see how this turns out. Can't wait to get my hands on one of your boards when it's ready. In the meantime, let me know if you have any more questions or need any further help.
Well, at this point it's already working 100% like the Basic program, except probably faster by a double digit factor.
Some of the issues were actually being caused by running way faster than before. I found that at least 4 NOP operations are needed when sending 2 consecutive bytes, otherwise the ESP32 ends up missing one. I added a much larger delay to be on the safe side. Going to assembly by itself is such a huge optimization, that I don't think I need to worry about it.
I finally finished with the assembly program with full Apple Mouse II support. Now the mouse is working perfectly in the Macintosh emulator, but I left the joystick as well. I am also planning to enable it in Doom, Wolfenstein 3D and have it emulate a joystick in the Sega and Nintendo emulators.
The assembly program got more complicated than I expected, since the Apple Mouse II only works in clamped mode. This is perfect for fixed resolution with linear cursor motion. For example the resolution of the Macintosh Classic is 512x342, so when the mouse is clamped between 0,0 and 512,342 the mouse firmware itself makes sure it never goes off screen. However I needed it to be able to go infinitely far in any direction, so I ended up implementing a roll-over in the assembly program. Basically it starts in the middle of the bounding box and as soon as it hits one of the bounds it jumps right back to the middle. This allows it to go forever in any direction, without me having to worry that it will hit the bounding box and stop. This behavior allows me to use it as a joystick and also it can have a non-linear motion of the cursor, like in modern computers.
Here is the completed assembly program: ESP32.zip
Also for anyone getting into assembly for the Apple II, I would highly recommend the Merlin 6502 extension for VS Code. It has the most useful IntelliSence for every instruction, it’s completely aware of all Apple II special routine addresses and it has the ability to generate perfectly spaced code that looks pretty when pasted in Merlin. Even though I use Eclipse for development, it was easy to set up Eclipse to launch VS Code when double-clicking an .asm file.
Once again big thanks to jeffmazur for providing the foundation.
- In addition to the Macintosh emulator, I also added Apple Mouse II support to Doom, Wolfenstein 3D, Nintendo and Sega
- Implemented true KeyDown/KeyUp events instead of just KeyPress for when the ESP32 SoftCard is hosted in an Apple IIe.
The latter allows for much more natural keyboard control for all the games when a key is held down, as it no longer relies on the Apple II’s hardware keyboard repeat. I would like to thank S.Elliot for his detailed blogpost on the AY-5-3600-PRO/KR9600-PRO bug. All Apple IIe machines with an original keyboard encoder have it and I would have wasted days if I ran into it blind, as I am using the same approach to detect KeyDown/KeyUp as Apple IIe’s implementation of Prince of Persia.
Speaking of which, the ESP32 SoftCard allows 3 additional 8-bit versions of Prince of Persia to be played (Nintendo, Sega and Macintosh), so I really wanted to get this one right.