
Apple II and Apple IIe emulators written in JavaScript and HTML5 - chr15m
https://github.com/whscullin/apple2js
======
wbobeirne
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!

~~~
onion2k
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.

~~~
gsnedders
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.

------
wiz21c
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).

~~~
Narishma
What does clean crack mean?

~~~
sumtechguy
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.

~~~
joezydeco
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](https://wiki.reactivemicro.com/Applesauce)

It also makes really pretty images:

[https://twitter.com/a2_4am/status/1022567636914393088](https://twitter.com/a2_4am/status/1022567636914393088)

~~~
sumtechguy
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.

~~~
joezydeco
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.

~~~
sumtechguy
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.

------
WoodenChair
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?

~~~
acomjean
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](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...](https://archive.org/details/Apple_IIe_Technical_Reference_Manual/mode/2up)

and

[https://archive.org/details/Apple_IIe_Reference_Manual/mode/...](https://archive.org/details/Apple_IIe_Reference_Manual/mode/2up)

------
loph
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.

~~~
acomjean
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...](https://archive.org/details/iie-80-column-text-
card/page/n29/mode/2up)

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.....)

~~~
jecel
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.

------
amelius
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](https://en.wikipedia.org/wiki/Apple_IIGS)

~~~
runako
> 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.

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

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

~~~
wiz21c
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](https://en.wikipedia.org/wiki/Apple_II)

~~~
jbotz
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.

~~~
jecel
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.

------
guytv
Wow , great job. Karateka! Carmen Sandiago!

------
nsxwolf
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.

------
deater
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/](http://www.deater.net/weave/vmwprod/mist/)

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

------
tomcam
I thank the project owner for not being Fabrice Bellard

