Scripple ][

  • Follow


Well, somebody had to do it ... Apple ][ emulation in Javascript.
It's a bit of a hack, and buggy, and not really useful either.
Nevertheless, thanks to the magic of Google Web Toolkit:
http://scripple-2.appspot.com/

Notes:
- Type in the input box indicated - and hit enter a few times first
- Unfortunately I'd have to recommend IE at this stage
- Firefox and Chrome work but there is a scrolling (table) bug to
squash
- It's 48k, text-only, no disk or other hardware, just the DO-F8 ROMs
- Entering the monitor with call-151 is probably the most fun

If anyone wants the source, email me. It's a Java project in Eclipse.
I'll get around to uploading it somewhere eventually.

Cheers,
Nick.
0
Reply nick.westgate (707) 6/23/2009 4:38:38 PM

On Jun 23, 11:38=A0am, sicklittlemonkey <nick.westg...@gmail.com> wrote:
> Well, somebody had to do it ... Apple ][ emulation in Javascript.
> It's a bit of a hack, and buggy, and not really useful either.
> Nevertheless, thanks to the magic of Google Web Toolkit:http://scripple-2=
..appspot.com/

Hey, ? "Hello" was working again!  Cool!  I noticed that inverse video
doesn't yet though.

>
> Notes:
> - Type in the input box indicated - and hit enter a few times first
> - Unfortunately I'd have to recommend IE at this stage

Noooooooooooooo!!!  :-D

> - Firefox and Chrome work but there is a scrolling (table) bug to
> squash

Chrome is going to have the best JS performance of the bunch, so I've
read.

> - It's 48k, text-only, no disk or other hardware, just the DO-F8 ROMs

E000G goes back to basic alright...  No softswitches other than
keyboard though, is that right?

> - Entering the monitor with call-151 is probably the most fun
>
> If anyone wants the source, email me. It's a Java project in Eclipse.
> I'll get around to uploading it somewhere eventually.
>
> Cheers,
> Nick.

Side note, I was able to crunch the javascript with Memtronic's
cruncher down to 28kb using the "hardcore" setting.  You might only
have to break the JS into two parts if you want to go that route.

Neat stuff, Nick!  Let me know if you need any ideas of how to
implement graphics with a canvas object (or just cheat and make a
table with 280x140 pixels in it...)  Javascript is too slow to have a
full screen refresh in higher graphics modes, you might want to borrow
the JACE listener-based approach for updating graphics -- such as
having 4 divs that you flip between depending on what graphics mode is
active.  I'd be happy to mock that up in a few weeks, time
permitting.  I'm pretty okay at DHTML.

-Brendan
0
Reply brendan.robert (859) 6/23/2009 5:12:06 PM


In article 
<4a1f9e85-d506-448c-b43d-753288e3e663@s1g2000prd.googlegroups.com>,
 sicklittlemonkey <nick.westgate@gmail.com> wrote:

> Well, somebody had to do it ... Apple ][ emulation in Javascript.
> It's a bit of a hack, and buggy, and not really useful either.
> Nevertheless, thanks to the magic of Google Web Toolkit:
> http://scripple-2.appspot.com/
> 
> Notes:
> - Type in the input box indicated - and hit enter a few times first
> - Unfortunately I'd have to recommend IE at this stage
> - Firefox and Chrome work but there is a scrolling (table) bug to
> squash
> - It's 48k, text-only, no disk or other hardware, just the DO-F8 ROMs
> - Entering the monitor with call-151 is probably the most fun
> 
> If anyone wants the source, email me. It's a Java project in Eclipse.
> I'll get around to uploading it somewhere eventually.

Works in Safari 4.0.1:

] 10I=I+1:COLOR=I:VLIN0,39ATI:IFI<39GOTO10
] GR:RUN

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
Reply nospam59 (9763) 6/23/2009 5:43:46 PM

On Jun 23, 12:12=A0pm, BLuRry <brendan.rob...@gmail.com> wrote:
> On Jun 23, 11:38=A0am, sicklittlemonkey <nick.westg...@gmail.com> wrote:
>
> > Well, somebody had to do it ... Apple ][ emulation in Javascript.
> > It's a bit of a hack, and buggy, and not really useful either.
> > Nevertheless, thanks to the magic of Google Web Toolkit:http://scripple=
-2.appspot.com/
>
> Hey, ? "Hello" was working again! =A0Cool! =A0I noticed that inverse vide=
o
> doesn't yet though.
>
>
>
> > Notes:
> > - Type in the input box indicated - and hit enter a few times first
> > - Unfortunately I'd have to recommend IE at this stage
>
> Noooooooooooooo!!! =A0:-D
>
> > - Firefox and Chrome work but there is a scrolling (table) bug to
> > squash
>
> Chrome is going to have the best JS performance of the bunch, so I've
> read.
>
> > - It's 48k, text-only, no disk or other hardware, just the DO-F8 ROMs
>
> E000G goes back to basic alright... =A0No softswitches other than
> keyboard though, is that right?
>
> > - Entering the monitor with call-151 is probably the most fun
>
> > If anyone wants the source, email me. It's a Java project in Eclipse.
> > I'll get around to uploading it somewhere eventually.
>
> > Cheers,
> > Nick.
>
> Side note, I was able to crunch the javascript with Memtronic's
> cruncher down to 28kb using the "hardcore" setting. =A0You might only
> have to break the JS into two parts if you want to go that route.
>
> Neat stuff, Nick! =A0Let me know if you need any ideas of how to
> implement graphics with a canvas object (or just cheat and make a
> table with 280x140 pixels in it...) =A0Javascript is too slow to have a
> full screen refresh in higher graphics modes, you might want to borrow
> the JACE listener-based approach for updating graphics -- such as
> having 4 divs that you flip between depending on what graphics mode is
> active. =A0I'd be happy to mock that up in a few weeks, time
> permitting. =A0I'm pretty okay at DHTML.
>
> -Brendan

On another one of the javascripts, I got 63% compression -- took 16
minutes in firefox, only 6 minutes in Chrome, but Chrome needed a lot
of babysitting to keep the javascript running (freeze warnings).
Still didn't test the compressed code to see if it worked or not, but
I've had pretty good luck with Memtronic's cruncher before against
some relatively complex code.

-Brendan
0
Reply brendan.robert (859) 6/23/2009 5:46:21 PM

On Jun 24, 2:43=A0am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> Works in Safari 4.0.1:
>
> ] 10I=3DI+1:COLOR=3DI:VLIN0,39ATI:IFI<39GOTO10
> ] GR:RUN

Thanks for testing in Safari, John.

Cheers,
Nick.
0
Reply nick.westgate (707) 6/23/2009 11:43:47 PM

In article 
<674f120c-e1ef-48f2-9b75-d6a29ddceee4@v15g2000prn.googlegroups.com>,
 Nick Westgate <nick.westgate@gmail.com> wrote:

> On Jun 24, 2:43 am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> > Works in Safari 4.0.1:
> >
> > ] 10I=I+1:COLOR=I:VLIN0,39ATI:IFI<39GOTO10
> > ] GR:RUN
> 
> Thanks for testing in Safari, John.

Oh, you know me: I love lores, even when it's not present! :-)

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
Reply nospam59 (9763) 6/24/2009 12:48:10 AM

On Jun 24, 2:46=A0am, BLuRry <brendan.rob...@gmail.com> wrote:
> > Side note, I was able to crunch the javascript with Memtronic's
> > cruncher down to 28kb using the "hardcore" setting. =A0You might only
> > have to break the JS into two parts if you want to go that route.

(For anyone wondering why Brendan tried crunching the javascript,
iPhone's browser can cache files < 25k, so this app could potentially
run locally on the iPhone via "Add to home screen".)

Performance on Chrome looks near 1MHz, at least for scrolling, but the
table shrinks like it does in FF. Going back to the dynamic GWT Grid
(table) would be great for this kind of cross-browser cruft, but
playing with styles and widths at a cell level requires ids in an HTML
file for now.

Canvas would be the next step. There's actually a GWT widget for it on
Google Code.

Cheers,
Nick.
0
Reply nick.westgate (707) 6/24/2009 12:51:04 AM

On Jun 24, 9:48=A0am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> Oh, you know me: I love lores, even when it's not present! :-)

Heh, yeah sorry about that! ;-)
Graphics will require a bit of work.

Cheers,
Nick.
0
Reply nick.westgate (707) 6/24/2009 12:59:43 AM

"Nick Westgate" <nick.westgate@gmail.com> wrote in message 
news:b1f50362-89cd-4401-a146-e1f936618bb9@w9g2000pro.googlegroups.com...
> On Jun 24, 9:48 am, "John B. Matthews" <nos...@nospam.invalid> wrote:
>> Oh, you know me: I love lores, even when it's not present! :-)
>
> Heh, yeah sorry about that! ;-)
> Graphics will require a bit of work.

Feel free to borrow liberally from http://calormen.com/Applesoft/

* LoRes implemented as tables
* HiRes implemented using canvas (and excanvas for IE), with two (slower) 
alternate implementations: TABLE and sparse DIVs
* Text ("tty") implemented using a texture atlas and table (for the real 
Apple II font and exact matching of LoRes/HiRes layout - it's pixel-doubled)
* Input devices - keyboard (hidden form element), joystick, paddles

These are all written as separate JavaScript modules with minimal 
dependencies on the BASIC interpreter, so they should be fairly easy to plug 
in. They even have API documentation at the tops of the JS files (although I 
can't swear it's up-to-date, and I should have gone with the 
Class.prototype.member = ... style rather than data hiding approach I picked 
up from Crockford... but I digress)

Tested/functional (last I checked) in IE, Firefox, Chrome, Safari, Opera.

PS: Nice work!
 

0
Reply inexorabletash (26) 6/24/2009 4:31:45 AM

On Jun 24, 1:31=A0pm, "Joshua Bell" <inexorablet...@hotmail.com> wrote:
> Feel free to borrow liberally fromhttp://calormen.com/Applesoft/

Thanks a lot Josh, it's been a while since I saw your cool site.
Conversely, feel free to borrow from Scripple ][ yourself. ; - )

I need to look into the canvas stuff for sure.

Cheers,
Nick.
0
Reply nick.westgate (707) 6/24/2009 5:02:28 AM

In article <jTh0m.5772$Dx2.1713@flpi146.ffdc.sbc.com>,
 "Joshua Bell" <inexorabletash@hotmail.com> wrote:

> "Nick Westgate" <nick.westgate@gmail.com> wrote in message 
> news:b1f50362-89cd-4401-a146-e1f936618bb9@w9g2000pro.googlegroups.com...
> > On Jun 24, 9:48 am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> >> Oh, you know me: I love lores, even when it's not present! :-)
> >
> > Heh, yeah sorry about that! ;-)
> > Graphics will require a bit of work.
> 
> Feel free to borrow liberally from http://calormen.com/Applesoft/

Sweet! Rod's Color Pattern from the Red Book runs perfectly.

<http://home.roadrunner.com/~jbmatthews/apple2.html#rp>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
Reply nospam59 (9763) 6/24/2009 3:46:46 PM

On Jun 25, 12:46=A0am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> Sweet! Rod's Color Pattern from the Red Book runs perfectly.

It should run on Scripple now too. ;-)
GR mode is implemented, but not mixed screen.

Also, GR works in Firefox but not IE or Chrome.
Not sure about Safari.

And text mode is much improved: now stable in FF, Chrome, IE.
Actually Chrome is by far the fastest for text.
IE is dog slow ... which is quite fitting.

Cheers,
Nick.
0
Reply nick.westgate (707) 6/25/2009 4:04:50 PM

On Jun 25, 12:04=A0pm, Nick Westgate <nick.westg...@gmail.com> wrote:
> On Jun 25, 12:46=A0am, "John B. Matthews" <nos...@nospam.invalid> wrote:
>
> > Sweet! Rod's Color Pattern from the Red Book runs perfectly.
>
> It should run on Scripple now too. ;-)
> GR mode is implemented, but not mixed screen.
>
> Also, GR works in Firefox but not IE or Chrome.
> Not sure about Safari.
Alas, Safari output window disappears entirely with GR.  Comes back
with TEXT. :-)
0
Reply schmidtd (1096) 6/25/2009 4:46:23 PM

In article 
<8e80b1b1-cd95-4c47-9400-c526d6998c54@q14g2000vbn.googlegroups.com>,
 schmidtd <schmidtd@my-deja.com> wrote:

> On Jun 25, 12:04 pm, Nick Westgate <nick.westg...@gmail.com> wrote:
> > On Jun 25, 12:46 am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> >
> > > Sweet! Rod's Color Pattern from the Red Book runs perfectly.
> >
> > It should run on Scripple now too. ;-)
> > GR mode is implemented, but not mixed screen.
> >
> > Also, GR works in Firefox but not IE or Chrome.
> > Not sure about Safari.

> Alas, Safari output window disappears entirely with GR.
> Comes back with TEXT. :-)

I get a similar result in Safari, but it works with Firefox 3.0.11. I 
had to paste the text in one line at a time, despite trying different 
line endings. Is that expected?

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
Reply nospam59 (9763) 6/25/2009 6:23:53 PM

On Jun 25, 11:04=A0am, Nick Westgate <nick.westg...@gmail.com> wrote:
> On Jun 25, 12:46=A0am, "John B. Matthews" <nos...@nospam.invalid> wrote:
>
> > Sweet! Rod's Color Pattern from the Red Book runs perfectly.
>
> It should run on Scripple now too. ;-)
> GR mode is implemented, but not mixed screen.
>
> Also, GR works in Firefox but not IE or Chrome.
> Not sure about Safari.
>
> And text mode is much improved: now stable in FF, Chrome, IE.
> Actually Chrome is by far the fastest for text.
> IE is dog slow ... which is quite fitting.
>
> Cheers,
> Nick.

Is your daughter sleeping through the night nowadays?  This is
excellent progress in very short time.  Lo-res looks perfect!  Noticed
you implemented inverse text.

-B
0
Reply brendan.robert (859) 6/26/2009 3:15:42 AM

On Jun 26, 12:15=A0pm, BLuRry <brendan.rob...@gmail.com> wrote:
> Is your daughter sleeping through the night nowadays? =A0This is
> excellent progress in very short time. =A0Lo-res looks perfect! =A0Notice=
d
> you implemented inverse text.

GWT makes all this pretty easy ... just hacking away in Java. Yeah
inverse text is what slows down IE. Setting the syle for a cell seems
to kill it.

Though as John says, GR isn't working in Safari (or IE, Chrome) and
the single input line is a pain. Cross-browser stuff and things like
keyboard input are hard. And sound is impossible.

Cheers,
Nick.

PS: Luckily my daughter slept through from week 1. ;-)
0
Reply nick.westgate (707) 6/26/2009 6:17:10 AM

On Jun 26, 3:23=A0am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> I get a similar result in Safari, but it works with Firefox 3.0.11. I
> had to paste the text in one line at a time, despite trying different
> line endings. Is that expected?

It was, but not any more. ; - )
Also added hires.

I'm no longer testing on IE, as it sucks.
Just FF and Chrome.

Cheers,
Nick.
0
Reply nick.westgate (707) 6/28/2009 2:14:14 AM

In article 
<efc5cf80-09d6-4144-b336-645e5cfbbb7e@d32g2000yqh.googlegroups.com>,
 Nick Westgate <nick.westgate@gmail.com> wrote:

> On Jun 26, 3:23 am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> > I get a similar result in Safari, but it works with Firefox 3.0.11. I
> > had to paste the text in one line at a time, despite trying different
> > line endings. Is that expected?
> 
> It was, but not any more. ; - )
> Also added hires.
> 
> I'm no longer testing on IE, as it sucks.
> Just FF and Chrome.

Sweet!

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
Reply nospam59 (9763) 6/28/2009 3:41:07 AM

17 Replies
26 Views

(page loaded in 0.53 seconds)


Reply: