6502: Added Apple II support - #89
Conversation
90fadee to
c7c9787
Compare
|
This looks absolutely fantastic! I'm going to give it a once-over and try to test it as best I can, but I'm mostly just going to assume this works, since I don't know much about the Apple II environment. |
|
A couple minor things: The licenses for things like the trackloader should be added to license.txt in the root of the repo. That's where fake6502 and jquery are, for example. I love how the Makefile suggests install commands if tools aren't found on the PATH. We should start doing that for the rest of the Makefiles! I also appreciate your extensive comments. I wish Linus had done the same! Building via Makefile produces this: Is it anything to worry about? Or is that just info? CLAUDE.md is inaccurate in a few respects. |
|
A few more serious issues:
Also, another minor thing: Dialog's Z-machine runtime includes fallbacks for a number of non-ZSCII Unicode characters: NBSPs (00A0, 202F) display as a space, en-dash (2013) displays as I see in the comments you've thought about using MouseText for a pretty progress bar. That would be a great enhancement, but I don't really see how MouseText would be useful for that—a long arrow, I guess? It's so limited compared to the box-drawing character sets I'm used to… |
|
Good feedback, I'll make a story to reproduce these issues and fix. The Apple 2 version uses ROM routines for printing but I think it can do everything as long as we have a rectangular window. I left styling out (b/c we only have inverse and flash) and just assumed inverse is used for status areas if that's reasonable. I think I considered MouseText before I looked at the full character set (the little running guy is cool but maybe not appropriate!) Maybe there's still something useful there, or maybe it can be used for of a few of the Unicode characters. If we relax the no-self-modification rule we can patch at init time and it won't take much extra RAM. |
|
I'll send over the file I'm using to test this as soon as I'm back at my
laptop. One of my IFComp entries runs on the C64, so it seemed like a good
test case for the Apple II.
…On Mon, Aug 24, 2026, 2:09 PM Steven Hugg ***@***.***> wrote:
*sehugg* left a comment (Dialog-IF/aamachine#89)
<#89 (comment)>
Good feedback, I'll make a story to reproduce these issues and fix. The
Apple 2 version uses ROM routines for printing but I think it can do
everything as long as we have a rectangular window. I left styling out (b/c
we only have inverse and flash) and just assumed inverse is used for status
areas if that's reasonable.
I think I considered MouseText before I looked at the full character set
(the little running guy is cool but maybe not appropriate!) Maybe there's
still something useful there, or maybe it can be used for of a few of the
Unicode characters. If we relax the no-self-modification rule we can patch
at init time and it won't take much extra RAM.
—
Reply to this email directly, view it on GitHub
<#89?email_source=notifications&email_token=ABRD4KHZPVVA2D3SPIUJ3R35LSHF5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBQGAYDEOBSG442M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5400028279>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRD4KE7CMVEC6RMVV6R3KD5LSHF5AVCNFSNUABFKJSXA33TNF2G64TZHM4TANZUGQZDEOJXHNEXG43VMU5TKMRTGQ3DCNZVGQ2KC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ABRD4KCNBDKFKHJHIU47Q5L5LSHF5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBQGAYDEOBSG442M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/ABRD4KCSMAETQVUSOFEHDWD5LSHF5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBQGAYDEOBSG442M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you commented.Message ID:
***@***.***>
|
|
Good luck on your entry! BTW is that drawn with (inline status bar)? If so I think neither interpreter supports that feature right now. |
|
Thanks! This one's not an inline status bar, just a normal Unfortunately due to IFComp rules I can't actually post a link to the .aastory file here; send an email to dsdraco7@gmail.com and I'll send it over. |
|
I'll also add all the other codepoints that the C64 version supports with a glyph, there's about 23 of them. Makes sense to have parity between the two ports. I can commit a test story for codepoints if that's useful. There's also a thing with non-breaking spaces I have to chase down, I think on the 6502 they were getting dropped. |
- Supports Apple II+ and later models - 64 or 128 kB - 40 or 80 columns - Aambundle builds 140 kB and 800 kB ProDOS-format disk images - No actual ProDOS system image is needed - Save/restore is supported with only one slot at the moment - Run "make -C test apple2" for unit tests Aambundle: Stories without a title in their metadata are named after the base name of the story file.
…which the c64 has a glyph
|
Wow, that's a lot of commits! You mention in a few places that there may also be problems with the C64 version—where are those in particular? |
|
So the new "codepoints" test runs through a bunch of transliteration and word wrap edge cases, and a few problems are specific to Apple II but a few are in C-64 and even aambox. Things like counting dual-character translits, not adding spurious new lines, not flushing the buffer properly, handling non-breaking spaces properly. The C-64 also has a lot of missing glyphs and translits. And I'm not sure about a lot of stuff like status bar heights (they always seem to be 1) There was a problem with all frontends where the NBSP opcode was being ignored, so I changed it to a breaking space. The "proper" fix might impact savefiles so a little more complex. But that's the only non-Apple II fix in this new batch. The C-64 can be brought up to par but I thought that would overcomplicate this PR. I made a lot of little commits here so it'll be easier to trace back the changes later. I didn't want the Apple II port to get too far ahead. I also added an izapple2 test on Github which doesn't block anything, just informative. |
|
Hmm, I think something is wrong. I cloned your repository into an entirely new directory, switched to the It also says "Aa-machine 1.0.2" when I load the disk, so I suspect I have an old version somehow. How do I get the latest version to test? |
|
Ah, had to |
|
Weird ... maybe you have another copy of aambundle in your path? I guess the first thing would be to check timestamps on everything. |
|
Yeah, I'm honestly not sure what was going wrong. I was calling aambundle with an absolute path, and But this all looks good now! If you're ready to merge, I'll merge it. |
|
Another thing: The Apple II has a hardcoded transliteration table (codepoint -> 0, 1 or 2 chars) which is to compensate for not being able to define its own fonts. Here's the current table, which includes (I think) the C-64 extended glyphs: Is there an offical list of supported codepoints besides the Z-machine list? I guess dedicated story authors could hack it to add their own custom glyphs/translit table. |
|
The most official list is fontdef.txt, which is used to build the C64 interpreter (with its custom font). But that list is deliberately easy to add to, so it may change in the future. |
|
Okay, makes sense. Yeah, I'm ready to merge. Good luck with your game and I hope you consider an Apple II release :) |
|
Oh, I absolutely will! |

Here's the Apple II port:
It needs the ACME assembler to build and the izapple2 emulator to run (optional) tests, but the makefiles will prompt for those if not found.
There are a couple of updates to engine.s but those should not affect anything in the C64 port. Part of the engine is split into the $d000+ language card area so there's no elegant way to do that.
I started this port against full ProDOS, but it was low on memory, so moved to the ProRWTS2 sector loader. You can still define PRODOS=1 and PRORWTS=0 to enable the full ProDOS port but it should be considered unsupported (but might be handy to compare against if bugs come up.)
Have tested on a few emulators (izapple2, Virtual ][, 8bitworkshop) but my real Apple ][+ is in storage :(
(Also a minor fix in aambundle: Stories without a title in their metadata are given the base name of the story file.)