Hacker News new | past | comments | ask | show | jobs | submit login
Apple II and Apple IIe emulators written in JavaScript and HTML5 (github.com/whscullin)
121 points by chr15m on Sept 9, 2020 | hide | past | favorite | 55 comments



For static site projects like this, I highly recommend setting up gh-pages or some other static site hosting. It's a lot of effort to expect people to clone the repo, install the dependencies, and build the project to try it out.

The no-hassle experience of running it is all the fun of building these for the web, after all!


If you do this it's worth noting that gh-pages, and Netlify's free tier, and probably others, cap egress bandwidth at 100GB/month. For a project like this one that's fine (it only downloads a few meg) but hitting HN and Reddit could easily burn through all that on a bigger project. If you care about that it's worth using something like Cloudflare as a frontside cache.


GitHub Pages only has a soft limit. As their documentation say:

> If your site exceeds these usage quotas, we may not be able to serve your site, or you may receive a polite email from GitHub Support or GitHub Premium Support suggesting strategies for reducing your site's impact on our servers, including putting a third-party content distribution network (CDN) in front of your site, making use of other GitHub features such as releases, or moving to a different hosting service that might better fit your needs.

I expect one-time hitting front page of HN or Reddit is something they won't frown on too much, whereas constantly hitting that cap on an ongoing basis is going to raise many more eyebrows.


They have a link on their GH repo to https://www.scullinsteel.com/apple2/


[SOUND WARNING]


I think when you run this using npm, it will also show your local file system. It can be a really nice sftp web front end.


I’m pretty sure GH pages has a fairly low traffic cap.


That's a nice emulator. Right now, one of the problem emulators struggle with is cycle accuracy. A (very) few demomakers (French Touch, Deater) are actually pushing the boundaries on the Apple with cycle accurate timings for various video or sound effects and the emulators start showing their limits.

However, for common usage (i.e. playing old games), emulators are perfectly fine. AppleWin seems the most advanced (lots of supported hardware, lots of small fixes to support edge cases of cycle accuracy), followed by Mame and Apple2JS. And some other I probably forget...

Also, recently a new file format was introduced for better preserving the old floppy disk and their devious copy protection (WOZ). This will improve the emulators further (and already has as far as reading disk is concerned)

Specific to the Apple2 emulation scene (I guess) is the effort of a person named "4am" to clean crack all Apple software so that they can continue working in the emulators (and old Apple's).


It alway cracked me up that some of the archived games I checked out had the same crack screens that I remember. I may have had a pirate problem in my middle school days.

Are they still trying to clean crack games that they've imaged?

The imaging of disks including their copy protection so emulation just works is pretty interesting. The data areas on disks are rather stunning.

https://ia801001.us.archive.org/8/items/Antoine_Vignau_3.5_F...

("Applesauce" creator/author twitter post gives summary of the applesauce disk reader, plus Ultima 1 was in Basic?)

https://mobile.twitter.com/diskblitz/status/1258863201447366...

The infrequent Apple time warp podcast interviewed the author:

https://appletimewarp.libsyn.com/episode-6-applesauce-with-j...


What does clean crack mean?


No scene intros, shout outs on startup, or extra payloads. Just a crack that makes the software work without some sort of '3rd word on page 2 8th paragraph from the manual' or only the original disk works because sector 22 is wonky or specific data. That plus the woz format which is a sector for sector copy (including extra wonky sectors). I think the most interesting one is the pinball construction kit which they only figured out a year or two ago. That one had many layers. MAME is also a good emu for Apple stuff if you want to try it too. The early mac stuff is a bit shaky due to a particular part not being emulated 100% yet.


WOZ isn't a sector copy, it's a raw magnetic flux copy with timing information added. It's extremely impressive stuff:

https://wiki.reactivemicro.com/Applesauce

It also makes really pretty images:

https://twitter.com/a2_4am/status/1022567636914393088


Thank you for the correction, I knew that but for some reason my brain spit out sector copy. Sorry about that. It is similar to what they are doing with LD and tapping pretty much right off the laser pickup. Woz is more of a filtered format after they toss out all of the extra junk doing a flux copy picks up. The LD guys are doing something similar. The pics are cool too because you can see how the devs were laying out the tracks and sectors to get a bit more perf out of the drives. I would have linked myself but this place I work does not let me at most of the emu sites.


The funny layouts were also driven by copy protection methods. The methods took advantage of physical properties of the disk and read circuit that the processor couldn't see but a duplication system could.

The work by 4am and others was driven by the desire to preserve these works without needing to break the physical copy protection to do it.


The real annoying ones were the read the sectors in a block starting at 0 and going up you get one set of data. But if you run it backwards or do a deliberate seek you get a different set of data. Because of the interface or drive used or the firmware on that drive like you said. Starforce also used a variant of that. The super annoying ones are the ones that played with the ECC bits too or like the PS1 having a special wobble track. The laserdisc ones I am a bit excited for. They are getting some really nice images out of them vs copying it off the board in some random place or worse out of the svideo/RCA connector. Unlike the apple stuff they are having to resort to multi image copies to get an average of 'good' because of scratches or poor SNR out of some pickups. The apple ones can filter it to a point as you know you are supposed to get 8 bit chars out of it. With LD not so much though. Seeing the diff copy protections is kind of cool too like the ones where they put a special sector out of reach for normal firmware but they would re-write it on the fly and force the drive to read it. Think there were a few of those on the c64.


Slightly off topic question—how hard is it to write an Apple II emulator compared to an NES emulator? Specifically, if I've already written an NES emulator, assuming I can reuse most of the 6502 core, what are the minimum set of support chips I need to implement?


I don't think you'll know till you do it. The apple II is older than the NES, so not as sophisticated, so easier. But the designer (WOZ) was really good at pushing the existing hardware to the limit. I would suspect you'd want to target the newer //e and //c machine (64 & 128KB ram and 80 col cards with lower case)

Graphics alone are strange especially the high res mode. (I used to program an apple //e in middle school..)

https://en.wikipedia.org/wiki/Apple_II_graphics

but the apple 2 reference manuals are online (even if the scan isn't the best).

https://archive.org/details/Apple_IIe_Technical_Reference_Ma...

and

https://archive.org/details/Apple_IIe_Reference_Manual/mode/...


PR#6

no, really, you old Apple users know what I mean. That's what you would type to get the thing to load DOS.


PR#3 got you into 80 column mode. I thought the PR# was to activate a card in a slot number.. but I'm not sure.

https://archive.org/details/iie-80-column-text-card/page/n29...

Apple2 Manuals where quite excellent back in the day. The internet archive has a bunch. Search friendly machine names the are not (Apple ii , apple//e, apple][ , apple //c.....)


In Unix terms PR# redirects the standard output to the hardware in the indicated slot and IN# redirects the standard input. From then on the BASIC commands PRINT and INPUT will access that hardware instead of the screen and keyboard respectively.

In practice the hardware can actually do anything it wants when you PR#, like booting from an attached floppy.


I was just reading the Apple IIGS Wikipedia page when I found this:

> The use of a 2.8 MHz clock was a deliberate marketing decision to limit the IIGS's performance to a level lower than that of the Macintosh, a decision that had a critical effect on the IIGS's success; the original 65C816 processor used in the IIGS was certified to run at up to 4 MHz. Additionally, as early as 1987, faster versions of the 65C816 processor were readily available, with certified speeds of between 5 and 14 MHz. Apple, however, refused to make use of the faster microprocessors (which had a negligible difference in cost, if any) and intentionally kept the machine locked down to 2.8 MHz throughout its entire production run.

It seems like Apple's consumer-unfriendly business tactics are of all times ... :(

https://en.wikipedia.org/wiki/Apple_IIGS


> which had a negligible difference in cost, if any

I don't have the contemporaneous pricing handy, but as someone who routinely perused semiconductor price sheets in the '80s, I can say this is suspect. Higher clock speeds -> lower yield -> higher price is not a new phenomenon.


Mac IIsi also had an easily over-clocked CPU (40 MHz crystal generating a 20MHz system clock could be easily swapped for a 50 MHz crystal [25 MHz system clock] with almost no downside).

I don't see this as foul play, though. They want to offer a range of price points and performance points across their product line to address the breadth of customers. That breadth of price point can easily be overall beneficial to customers. Then, engineers can go swap crystals if they want (I did it over my boss's objection, figuring I'd just buy a replacement if I botched it up.)


For the full Apple II experience, you need to load the Star TreK game from cassette tape.


What are Apple ][ and Apple //e? Pretty impossible to google search these so maybe readme could have some links or short descriptions


Two models of the Apple 2 series. Apple ][ (read Apple 2) was the first, followed by ][+ then //e (read 2e).

Apple was the first computer of Steve Jobs (you know, the guy who made the iPhone, the eBook, etc.). Note that Steve Jobs was a kind of visionary but the guy who actually built the Apple was Steve Wozniak.

The Apple was popular because it was affordable and, for its time rather powerful. That was possible because Steve Wozniak (and others) figured out how to build a computer in the cheapest (and most clever way).

As many HN readers, I learned programming when I was very young, on an Apple 2.

https://en.wikipedia.org/wiki/Apple_II


It's worth adding that the Apple II was really the first home computer, soon followed by others from Commodore and Radio Shack. There were other microcomputers, but they weren't aimed at a casual home market. The Apple II was the first personal computer that came "ready to use"... you just needed to connect a screen (which could be a regular Television of the time), plug it in, turn it on, and start programming it in Basic! There was no storage device included, but the Basic interpreter was in ROM, and gave you a prompt (kind of like a REPL) when you turned on the computer.


Commodore Pet: introduced in January 1977 at the Consumer Electronics Show in Chicago. What was shown had many differences from what eventually shipped, but Commodore started accepting orders. They only shipped 500 machines by the end of the year and it is hard to find out when the first ones actually went out.

Apple II: introduced on April 17, 1977 at the West Coast Computer Faire. It went on sale on June 5.

TRS-80: introduced on August 3, 1977 at a press conference at the Warwick Hotel in New York and was available for sale.

Radio Shack/Tandy and Commodore were big companies. They were later joined by Atari, Texas Instruments and eventually IBM.

The other players in the personal computing market back then were self financed (MITS, IMSAI, Ohio Scientific, Processor Technology, Cromenco, Northstar, Southwest Technical Products Corporation, Altos and so many others).

Apple stood apart as a venture capital backed startup. We later got Compaq and others but by that time none of the self financed companies were around anymore.

Apple is remembered as the number one in personal computing until the IBM PC came along. In terms of revenue that is true, but in terms of units shipped the much cheaper TRS-80 and the Pet dominated the late 1970s.


Thanks a lot for your thorough answer! I actually know about Apple 2 but had no idea about the two models and their naming scheme and was really curious what this was about


Yeah, they really should've considered the SEO impact of their naming before launching ;)


I know you mean well but please don't make fun of people because they don't know about something, especially when they are asking this nicely.


Parent is making a joke about Jobs and Woz not being SEO-friendly in the late 70s


Impossible? Googling Apple ][, for me, gives 3 apple.com links, and then https://en..wikipedia.org/wiki/Apple_II_series, with preview text

Apple ][ from en.wikipedia.org

Models[edit]. See also: Timeline of computing. Early II-series models were usually designated "Apple ]["; later ...

Google does a bit worse for Apple //e, but the top item in “People also ask” is “What is Apple E”, with answer “The Apple IIe (styled as Apple //e) is the third model in the Apple II series of personal computers produced by Apple Computer. The e in the name stands for enhanced, referring to the fact that several popular features were now built-in that were formerly only available as upgrades or add-ons in earlier models.”, picked from https://en.wikipedia.org/wiki/Apple_IIe


https://en.wikipedia.org/wiki/Apple_II_series

The wikipedia article uses II for ][, // etc so look at those subsections.



DuckDuckGo is weird. Top results are useless for ‘Apple ][’ https://duckduckgo.com/?q=Apple+%5D%5B but fine for ‘Apple //e’ https://duckduckgo.com/?q=Apple+%2F%2Fe (the first one is the correct Wikipedia article — “The Apple IIe (styled as Apple //e) is the third model in the Apple II series of personal computers produced by Apple Computer”).


Oof, the power of an innocent question to suddenly make me feel my age...


Probably two flavors of the Apple 2. I assume the logo for the 2e was in italics.


Close, but the logos were really styled that way, with ASCII brackets and slashes, on the cases.

https://en.wikipedia.org/wiki/Apple_II

https://en.wikipedia.org/wiki/Apple_IIe


But it's only for logo right? I don't think they should be used in text form, doubt even Apple themselves would do that.


No, they used it elsewhere. When the machines booted, they displayed "Apple ][, "Apple //c", etc. at the top.


I have an Apple II plus original reference manual here, and it uses “Apple ][“ (brackets) only on the cover. In the book text, it uses “Apple II” (Roman numeral) throughout.


Is that the red book with the handwritten notes, or the typeset one?


typeset - published 1979 by Apple


I believe these forms were used on startup (i.e. they were in the roms in text form this way).


As I recall, all print publications of the era used ][ and //

I remember typing it this way myself on the early BBS scene. Personally my system was a Radio Shack TSR-80 Model III. (That is III not 3)


People can be weird about this sort of thing, especially with Apple. I remember when the iPhone XR came out some people would insist on always writing "iPhone Xʀ", for example.


Try searching for “apple 2e“ on either Duckduckgo or Google.


Don't downvote this, it's actually fairly difficult do search at first try. Buried under all the other more modern Apple stuff.


Sometimes I genuinely forget that these aren't exactly recognized glyphs these days.


Wow , great job. Karateka! Carmen Sandiago!


Pretty neat that it supports the Koalapad. Worked well in Safari though it didn't track my system's mouse pointer perfectly.

I am amused that the POWER light works as a power button. Early Apple 2s had a plastic dome over the light which people mistook for a power switch, and most of them are broken as a result.


you can use these js emulators to play the just released v1.0 of Myst for Apple II

http://www.deater.net/weave/vmwprod/mist/


It's a node app that uses python libraries. Interesting.


I thank the project owner for not being Fabrice Bellard




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: