
Apple ][+ in HTML5 - shawndumas
http://porkrind.org/a2/
======
pud

      10 X=1
      20 FOR Y=1 TO X
      30 PRINT " ";
      40 NEXT Y
      50 PRINT "HELLO"
      60 IF X=34 THEN LEFT=1
      70 IF X=0 THEN LEFT=0
      80 IF LEFT=1 THEN X=X-1
      90 IF LEFT=0 THEN X=X+1
      100 GOTO 20
      
      RUN
    

Notes: Use ^C to stop it. Type LIST to see the program you wrote. If you screw
up a line, just type the line number and hit <return> to delete that line.

~~~
kator

        10 X=1
        20 D=1
        30 FOR Y=1 TO X
        40 PRINT " ";
        50 NEXT Y
        60 PRINT "HELLO"
        70 IF X=0 OR X=34 THEN D=D*-1
        80 X=X+D
        90 GOTO 30

~~~
pud

      5 PRINT "WHAT'S YOUR FIRST NAME?"
      7 INPUT NAME$
      10 X=1
      20 D=1
      30 FOR Y=1 TO X
      40 PRINT " ";
      50 NEXT Y
      60 PRINT NAME$
      70 IF X=0 OR X=39-LEN(NAME$) THEN D=D*-1
      80 X=X+D
      90 GOTO 30
    
      RUN

------
iSnow
I do hope Apple is in a good mood about this, because apple2+.rom.js loads an
Apple ][ Applesoft ROM image, which is technically still copyrighted by Apple.

As an old geezer who earned his programming wings on an Apple ][ coding 6502
machine language and later UCSD Pascal, I am absolutely delighted about this
project. I had been toying with the same idea for some time but skipped it due
to lack of time and the fear of Apples legal stormtroopers.

Now if only I find disk images of Bandits and Dogfight...

~~~
olalonde
As far as I know, Apple does release some of their older OSes as downloadable
images from their website.

~~~
iSnow
I know, but this is only some classic MacOS disk images - no ROM files either.

I hope that after Job's demise, someone at Apple is sane enough to understand
abandonware. But I am not counting on that.

~~~
enf
In all seriousness, I don't think Apple can free the Autostart ROM image
unilaterally because Microsoft owns the copyright on Applesoft BASIC. It would
be a great joint release if you could get them both to agree on it though!

------
kinleyd
Awesome!!! Took me back many years. Kudos to David Caldwell.

~~~
kinleyd
And that's why I love HN. Thanks for the down vote.

~~~
teeja
The whole upvoting/downvoting concept seems to be aimed at recreating
communities where the majority can shout down any minorities. At the village
level. A fear tactic aimed at making you subconsciously consider whether what
you say will please the majority.

Ironic that it's called "karma", which is a complete perversion of the
original religious meaning of the concept, perverted into a means of recording
a "permanent record" of how antisocial or unsubmissive you've been to
community opprobrium. Purely regressive adaptation of technology, and a crime
against the spirit of those who created it.

~~~
podperson
It would be interesting if, say, when you upvoted something then your
perception of upvotes and downvotes from people who similarly upvoted that
thing were subtly changed and so forth. In essence, by upvoting something you
would be changing your perception of the universe.

Which, I guess, is kind of how Google works in the long run, and also would
tend to self-select people into like-minded groups. Overall, I think that our
options are somewhat limited -- we either end up in a self-selected community
or in a self-selected sub-community. E.g. I was "repelled" by digg because any
politically "liberal" comment I made would be downvoted to oblivion within
minutes. While similar things would happen on reddit if, say, one said things
critical of libertarianism, I didn't find this quite so frustrating, and
simply learned to curb my views accordingly.

Here on Hackernews (which I find to be the most reasonable community since the
glory days of slashdot) I have learned to accept that, say, being critical of
Android or having anything nice to say about PHP is likely to lead to a lot of
welts.

------
fkdjs
I fired up conan, figured out the key mappings, then my stored neurons kicked
in, found the hidden life then immediately got to the third level without
dying. God help anyone trying to figure this game out for the first time. I
want to use basic, but my keyboard mapping is fubar'ed, I figured out ctrl
maps to " but I haven't figured out which key generates "," which is needed
for a program I wanna write.

~~~
grecy
How did you fire up Conan?

~~~
fkdjs
choose the conan1 disk, click cold start, when it says flip disk, choose
conan2 disk, hit space, and you're in.

------
jonmrodriguez
here are some lists of the commands for the Apple ][

<http://www.landsnail.com/a2ref.htm>

<http://www.landsnail.com/a2ref2.htm>

<http://www.landsnail.com/a2ref3.htm>

<http://www.landsnail.com/a2ref4.htm>

~~~
kinleyd
I would like to add this link also, Linapple[1], an Apple][ emulator for
Linux, which is pretty good too. More fun on your Linux box, from the good old
days. :)

[1] <http://linapple.sourceforge.net/>

------
dkarl
Oh, wow, I can't believe how quickly BASIC comes back. I spent a lot of time
typing programs in at that prompt. I loved the hours I spent writing programs
out on notebook paper, and I absolutely _loathed_ typing them in. I always
did, though. Seeing them run gave me a little thrill. (Not that I ever wrote a
single program that I would have enjoyed using if it wasn't mine.) The best
thing in the world was when my mother typed in a program for me, which she
only did a few times when I was really, really sick.

Good times. I think I will now make a low-res snowman.

~~~
dkarl
Whoa, Chromium 18 under Ubuntu doesn't work as well as Chrome on OSX does. 18
is ancient, so I can't really complain; this is just information. I got visual
artifacts until I deselected "Use WebGL." Now everything displays fine, but I
can't type quote marks or commas. When I type ' or " I get ^. When I type , I
get <. On OSX, I know I could type double quotes and commas. For what it's
worth, I'm using Dvorak under both Linux and OSX.

------
zellyn
FYI, on my system (Chrome 23, Ubuntu Precise), the SHIFT key has no effect. I
am unable to type quotes, exclamation marks, etc. I noticed a couple of other
posters mentioned similar problems, but wanted to call it out clearly in a
separate top-level comment.

~~~
iconjack
Without SHIFT, I can't type PR#6!

------
conradfr
My father had one and somehow it's the only Apple product I have ever really
used :)

IIRC (and as the emulation does apparently) the games started themselves at
boot, so I don't think I have ever typed any command on it !

------
mhuisking
I had these Beagle Brothers posters --
<http://beagle.applearchives.com/posters.htm> Lots of great info on 'em.

------
comex
The WebGL version has some interesting results in Safari:

<http://imgur.com/KYgM1>

------
scottlu2
Nice project. Trying it out on my iPad 3. It can do 1 sec of emulated time in
~1.6 secs.

~~~
kayoone
For Reference: 2011 Macbook Air 11: 1sec emulated in 0.35s

~~~
dscrd
Hmm, there's something wrong with Macbooks' performance. My lenovo laptop
running Linux with a very modest cpu (AMD E-450 APU) gives out 1 sec / 0.17s.

Then again, perhaps the browser technology matters more than anything else:
I'm running it on latest stable chromium.

~~~
koyote
On Win7 Firefox only gives me 0.19 whereas Chrome does 0.03.

So I guess it's the browser that matters a lot here.

------
orangethirty
I sat for about an hour playing with it. Went as far as finding the original
Apple manual (on scribd) online and reading it through for the commands. Thi
sis just an amazing project. Great work.

------
ilamont
_10 PRINT "HELLO"

20 GOTO 10

RUN_

7th grade memories come flooding back ...

------
SoftwareMaven
Who says skeuomorphism is a bad thing? This is simply brilliant!

------
ggchappell
My goodness, it even switches from black & white to the messed-up color
rendering of text characters when you enter graphics mode (type "GR").

Incredible.

------
lysol
Anyone else having trouble getting Adventure Construction Set to run? (Seeing
ACS in the list brings back so many memories)

~~~
__david__
The emulation isn't perfect--I know there are still some 6502 bugs lurking
around. I did this in about a week last year and have only spent a few
sporadic days here and there improving it.

One of the things on my todo list is to use websockets or something to ship
the emulation log back to the server and compare against an independent (and
presumably better tested) 6502 emulator. From there I can detect
inconsistencies and fix the JS implementation. As I side effect I can build up
a set of (hopefully) comprehensive test vectors that anyone writing a 6502
emulator can use to validate their implementation.

~~~
to3m
The C64 6502 test suite is easy to bodge into an emulator. I used it to verify
the 6502 emulation code in mine. Very worthwhile - I found a number of bugs
because of it, particularly with BCD mode and a number of the illegal
instructions. (Obviously no guarantee the 6510 illegal instructions are the
same as the 6502's, but the few that BBC Micro games used seemed to be. I
believe the BBC Micro 6502 is the same one as in the Apple II, but 2MHz.)

An explanation of how to fit it into a non-C64 emulator:

<http://www.softwolves.com/arkiv/cbm-hackers/7/7114.html>

Mirror of the actual file:

<http://modelb.bbcmicro.com/tech.html>

------
wslh
Entering machine language monitor:

call 151

l

it unassembly a portion of memory.

~~~
wslh
I can type the minus before the 151. See
[http://stackoverflow.com/questions/143374/call-151-what-
did-...](http://stackoverflow.com/questions/143374/call-151-what-did-it-do-on-
the-apple)

------
SageRaven
That's simply awesome.

Can this thing run Aztec or Microwave, too?

------
jnazario
man i was struggling to remember various commands, hat to run, etc and thanks
for the comments, i remembered some more.

peek and poke ftw!

------
pietrofmaggi
CALL -151

and then everything comes to mind :)

~~~
SimHacker
BLOAD the INTBASIC roms, go F666G, and then you can play with the mini-
assembler!

------
OldSchool
Impressive in so many ways!

------
derleth
"The kids of today should defend themselves against the Seventies" - Pearl
Jam, itself a somewhat dated cultural icon.

It's interesting to think about the cultural impact of this if it really
catches on, at least in the hacker/geek world. This isn't just a tech demo:
It's a self-conscious reconstruction of a cultural artifact, and drags along
with it other cultural references and context. Nobody these days is going to
'grow up' with an Apple ][ because of things like this, but, previously, the
only way to experience that specific system was to either have been born in
the narrow window of time where you had one when they were still at least
vaguely mainstream, or to decide to run an emulator and likely get into
emulation as a hobby. It's the difference between knowing every Beach Boys
song because you grew up in 1960s California, knowing them because you
deliberately chose to collect that era's music, and knowing them because, like
me, your parents played them practically from your birth and so they became
the first band you really liked.

This just makes the past that much more mainstream, the software equivalent of
the deliberately dated aesthetic of a Quentin Tarantino film.

~~~
unimpressive
<http://jsmess.textfiles.com/>

Stuff like this is just the tip of the iceberg.

~~~
TazeTSchnitzel
Ooh! There's been a MAME port too, right?

