Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GScript widget for Mac OS X released

0 views
Skip to first unread message

limtc

unread,
Aug 22, 2008, 4:28:02 AM8/22/08
to
Hi,

I have created an early alpha of the GScript widget for Mac OS X. You
can download it here:

http://virtualgs.larwe.com/GScript.wdgt.zip

With the widget, you can use it to run Applesoft-BASIC like Javascript
code natively on your Mac. This might be useful for education purpose.
Many samples are provided.

limtc

unread,
Aug 22, 2008, 10:02:59 PM8/22/08
to
The widget is updated to reflect the latest change of GScript BASIC.
Added and updated some commands. This is for running GScript BASIC
locally on Mac OS X.

The URL has also been changed to an easier to remember
http://virtualgs.larwe.com/gsbasic.zip

You can install your own scripts into the widget package folder and
run to see the result.

limtc

unread,
Aug 26, 2008, 10:51:17 AM8/26/08
to
I updated updated the latest version (1.0.7) of the GScript BASIC
widget, now with a retro look - the UI is actually being implemented
in GScript BASIC itself (since GScript BASIC will generate HTML codes
based on print commands). You can create a script, drop into the
widget package and try it out.

You can take a look at:

Home screen
http://retromaccast.ning.com/photo/photo/show?id=1672786%3APhoto%3A28664

Commands
http://retromaccast.ning.com/photo/photo/show?id=1672786%3APhoto%3A28665

The location of download: http://virtualgs.larwe.com/gsbasic.zip

limtc

unread,
Aug 27, 2008, 9:28:52 AM8/27/08
to
I have put GScript BASIC 1.1 for download here:

http://virtualgs.larwe.com/gsbasic.zip

As long as you have Safari or Firefox 3 browser, you should be able to
run GScript BASIC standalone on the PC or Mac. To write a script, just
write in any text file and drop into the script folder and run GScript
BASIC. You can also package your script as a standalone web
application.

Please read the Readme.html for instructions.

PS: with the standalone version, the Mac OS X Dashboard widget version
is discontinued.

John B. Matthews

unread,
Aug 27, 2008, 1:25:41 PM8/27/08
to
In article
<160a9ae0-a525-40c7...@i20g2000prf.googlegroups.com>,
limtc <thye...@gmail.com> wrote:

> I have put GScript BASIC 1.1 for download here:
>
> http://virtualgs.larwe.com/gsbasic.zip
>
> As long as you have Safari or Firefox 3 browser, you should be able to
> run GScript BASIC standalone on the PC or Mac. To write a script, just
> write in any text file and drop into the script folder and run GScript
> BASIC. You can also package your script as a standalone web
> application.
>
> Please read the Readme.html for instructions.

Excellent! Here's implementations for the lores functions plot(),
hlin(), & vlin(), as well as a small demo:

// Lores test by John B. Matthews

blockWidth = 16; // screenWidth / 40
blockHeight = 10; // screenHeight / 40

hgr();
print("Lores test");
draw1();
animate(draw2);


function draw1() {
for (p = 0; p < 39; p++) {
hcolor = rnd(15) + 1;
plot(0, p);
plot(p, 0);
plot(39, p);
plot(p, 39);
plot(p, p);
plot(39 - p, p);
}
}

function draw2() {
x1 = rnd(40);
y1 = rnd(40);
x2 = rnd(40);
y2 = rnd(40);
hcolor = rnd(15) + 1;
hlin(x1, x2, y1); hlin(x1, x2, y2);
vlin(y1, y2, x1); vlin(y1, y2, x2);
}

function plot(x, y) {
rect(x * blockWidth, y * blockHeight,
blockWidth, blockHeight)
}

function hlin(x1, x2, y) {
if (x1 <= x2) rect(x1 * blockWidth, y * blockHeight,
(x2 - x1 + 1) * blockWidth, blockHeight);
else rect(x2 * blockWidth, y * blockHeight,
(x1 - x2 + 1) * blockWidth, blockHeight);
}

function vlin(y1, y2, x) {
if (y1 <= y2) rect(x * blockWidth, y1 * blockHeight,
blockWidth, (y2 - y1 + 1) * blockHeight);
else rect(x * blockWidth, y2 * blockHeight,
blockWidth, (y1 - y2 + 1) * blockHeight);
}

--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews

limtc

unread,
Aug 27, 2008, 7:21:27 PM8/27/08
to
Wow, I am amazed!

Can I include your Lore routines as part of GScript BASIC (with
credits)? We can take out the Lores demo as part of GScript demo too.

mdj

unread,
Aug 27, 2008, 8:00:33 PM8/27/08
to
On Aug 28, 9:21 am, limtc <thyech...@gmail.com> wrote:
> Wow, I am amazed!
>
> Can I include your Lore routines as part of GScript BASIC (with
> credits)? We can take out the Lores demo as part of GScript demo too.

It needs an implementation of SCRN() as well...

Are there any plans to turn this into an actual Applesoft interpreter,
like Joshua Bells ?

Matt

limtc

unread,
Aug 27, 2008, 8:28:53 PM8/27/08
to
Hi Matt,

There is already an Applesoft interpreter... I think the world does
not need two. :) That Applesoft BASIC interpreter is already the work
of an art, and I can't improve further.

I have a slightly different dream of what I wanted to do - I wish to
bring the fun of Apple II programming to the kids (thus my web site
Virtual GS - http://virtualgs.larwe.com), and I have always dream of a
super Apple IIGS with 640x400 resolutions, and Applesoft BASIC capable
of doing Super Hires. I am excited when one day Mike Westerfield comes
in to this forum and says it is possible to do another GSoft BASIC
based on Java, but since it is not done, I decided to do a version
based on JavaScript - modernized Applesoft, keep the Applesoft spirit
(the ease of HGR and HPLOT away...), put in 640x400 resolutions, let
it run on iPhone and web, extend the features in a way that Applesoft
programmer can recognized it immediately... and GIVE IT AWAY. All kids
should be able to sit down, type a few lines, and run it.

GScript BASIC is less on computing on a retro machines, but more on
the fun of retro computing on a modern environment. It is what I think
Apple IIGS BASIC should be, and I hope you all like it.

John B. Matthews

unread,
Aug 27, 2008, 11:08:25 PM8/27/08
to
In article
<76fedfc2-eb7a-472f...@k36g2000pri.googlegroups.com>,
limtc <thye...@gmail.com> wrote:

> Wow, I am amazed!
>
> Can I include your Lore routines as part of GScript BASIC (with
> credits)? We can take out the Lores demo as part of GScript demo too.

[...]

Yes, I'd be delighted if you did. I wasn't sure how to modify your
library. I'm guessing something like this:

...
var screenWidth = 640;
var screenHeight = 400;
var blockWidth = screenWidth / 40;
var blockHeight = screenHeight / 40;
...


function plot(x, y) {
rect(x * blockWidth, y * blockHeight,
blockWidth, blockHeight)
}

function hlin(x1, x2, y) {
if (x1 <= x2) rect(x1 * blockWidth, y * blockHeight,
(x2 - x1 + 1) * blockWidth, blockHeight);
else rect(x2 * blockWidth, y * blockHeight,
(x1 - x2 + 1) * blockWidth, blockHeight);
}

function vlin(y1, y2, x) {
if (y1 <= y2) rect(x * blockWidth, y1 * blockHeight,
blockWidth, (y2 - y1 + 1) * blockHeight);
else rect(x * blockWidth, y2 * blockHeight,
blockWidth, (y1 - y2 + 1) * blockHeight);
}

--

limtc

unread,
Aug 27, 2008, 11:36:49 PM8/27/08
to
Thanks! I can add in myself and modify a bit and make it part of
library.

Will released this later as 1.2 upgrade.

It is just weird with hgr() and vlin() together though! :)

btw, is Lores 16 colors = Apple IIGS 320 mode Super Hires 16 colors?
If not, where can I get the color codes for Lores?

John B. Matthews

unread,
Aug 28, 2008, 3:25:50 AM8/28/08
to
In article
<cd5bbd30-e4f0-4855...@l33g2000pri.googlegroups.com>,
limtc <thye...@gmail.com> wrote:
[...]

> It is just weird with hgr() and vlin() together though! :)

Text, too. I love it!

> [Are] lores 16 colors = Apple IIGS 320 mode Super Hires 16 colors?

Not quite. The colors are similar, but in a different order:

<http://home.woh.rr.com/jbmatthews/a2/lores.jpg>

I don't know enough about scope in JavaScript to know how to add another
palette. Would it be important?

[Here's another, slightly off-topic paean to lores graphics:]
<http://www.boreme.com/boreme/funny-2007/golden-shower-atari-p1.php>
[No, it's not pr0n!]

[...]

limtc

unread,
Aug 28, 2008, 3:29:57 AM8/28/08
to
On 8月28日, 下午3时25分, "John B. Matthews" <nos...@nospam.invalid> wrote:

> Text, too. I love it!

What's wrong with text (besides it is centralized)? :)

> > [Are] lores 16 colors = Apple IIGS 320 mode Super Hires 16 colors?
>
> Not quite. The colors are similar, but in a different order:

Thanks! I am thinking along hgr() and gr() having different colors...
so you start with gr() not hgr().

Everything is possible - I create the palette anyway. :)

limtc

unread,
Aug 28, 2008, 3:34:49 AM8/28/08
to
I am thinking whether we should use 80x48 rather than 40x40 since it
is closer to 640x400 aspect ratio. This is Double Lores (supported in
IIe, //c and IIGS...) with the text screen off (Lores is 40x48 without
text).

Do you happened to know the color names of all the 16 colors? Someone
should have written it somewhere...

limtc

unread,
Aug 28, 2008, 3:42:38 AM8/28/08
to
I spoke too fast, found it here:

http://www.uni-giessen.de/faq/archiv/apple2.asoft/msg00000.html

Valid colors are 0 (Black), 1 (Magenta), 2 (Dark Blue), 3
(Violet), 4 (Dark Green), 5 (Dark Gray), 6 (Medium Blue), 7 (Light
Blue), 8 (Brown), 9 (Orange), 10 (Light Gray), 11 (Pink), 12 (Bright
Green), 13 (Yellow), 14 (Aqua) and 15 (White).

John B. Matthews

unread,
Aug 28, 2008, 3:32:06 PM8/28/08
to
In article
<78003bca-5855-44be...@b38g2000prf.googlegroups.com>,
limtc <thye...@gmail.com> wrote:

Thanks! I remembered some of the numbers, but I didn't know about names.
I've updated my screenshot and included the code that produced it:

<http://home.woh.rr.com/jbmatthews/a2/lores.html>

Bill Garber

unread,
Aug 28, 2008, 3:43:25 PM8/28/08
to

"John B. Matthews" <nos...@nospam.invalid> wrote in message news:nospam-BD830B....@news.motzarella.org...

> In article
> <78003bca-5855-44be...@b38g2000prf.googlegroups.com>,
> limtc <thye...@gmail.com> wrote:
>
>> I spoke too fast, found it here:
>>
>> http://www.uni-giessen.de/faq/archiv/apple2.asoft/msg00000.html
>>
>> Valid colors are 0 (Black), 1 (Magenta), 2 (Dark Blue), 3
>> (Violet), 4 (Dark Green), 5 (Dark Gray), 6 (Medium Blue), 7 (Light
>> Blue), 8 (Brown), 9 (Orange), 10 (Light Gray), 11 (Pink), 12 (Bright
>> Green), 13 (Yellow), 14 (Aqua) and 15 (White).
>
> Thanks! I remembered some of the numbers, but I didn't know about names.
> I've updated my screenshot and included the code that produced it:
>
> <http://home.woh.rr.com/jbmatthews/a2/lores.html>


That's awesome, no artifacting. How is Hires?

Bill Garber from GS-Electronics
http://www.garberstreet.com

John B. Matthews

unread,
Aug 28, 2008, 4:13:01 PM8/28/08
to
In article <fO2dnZbILZ5dYivV...@comcast.com>,
"Bill Garber" <will...@comcast.net> wrote:

About what you'd expect:

<http://sites.google.com/site/trashgod/hires>

Bill Garber

unread,
Aug 28, 2008, 4:31:17 PM8/28/08
to

"John B. Matthews" <nos...@nospam.invalid> wrote in message news:nospam-F96812....@news.motzarella.org...

Pretty close to a real IIgs with RGB monitor.

limtc

unread,
Aug 28, 2008, 7:59:35 PM8/28/08
to
I have updated GScript BASIC to use gr() and color= for Lores mode.

This is your code http://virtualgs.larwe.com/gsbasic/scripts/lrdemo.js

// Lores Demo by John B. Matthews

gr()
inverse()
print(" Lores Demo ")
normal()
print("By John B. Matthews")

draw1()
animate(draw2)

function draw1() {
for (p = 0; p < 39; p++) {

color = rnd(15) + 1
plot(0, p)
plot(p, 0)
plot(39, p)
plot(p, 39)
plot(p, p)
plot(39 - p, p)
}
}

function draw2() {
x1 = rnd(40)
y1 = rnd(40)
x2 = rnd(40)
y2 = rnd(40)

color = rnd(15) + 1
hlin(x1, x2, y1)
hlin(x1, x2, y2)
vlin(y1, y2, x1)
vlin(y1, y2, x2);
}

limtc

unread,
Aug 28, 2008, 8:01:40 PM8/28/08
to
If you can update your lores codes for GScript BASIC (will definitely
need adjustment), I can try changing the palette for gr() to use the
same palette as the real Lores mode. So hgr() will use Super Hires
palette and gr() will use Lores palette.

John B. Matthews

unread,
Aug 28, 2008, 8:27:16 PM8/28/08
to
In article <hsidnWR1wYCKlirV...@comcast.com>,
"Bill Garber" <will...@comcast.net> wrote:

> "John B. Matthews" <nos...@nospam.invalid> wrote in message
> news:nospam-F96812....@news.motzarella.org...
> > In article <fO2dnZbILZ5dYivV...@comcast.com>,
> > "Bill Garber" <will...@comcast.net> wrote:

[...]


> >> > <http://home.woh.rr.com/jbmatthews/a2/lores.html>
> >>
> >> That's awesome, no artifacting. How is Hires?
> >
> > About what you'd expect:
> >
> > <http://sites.google.com/site/trashgod/hires>
>

> Pretty close to a real IIgs with RGB monitor.

I've replaced the picture with a static pattern and shots from KEGSMAC
and Sweet16. They both look good. Note Sweet16 is with original aspect
enabled.

KEGS-OSX came up empty.

limtc

unread,
Aug 28, 2008, 9:12:59 PM8/28/08
to
Hi,

I have uploaded 1.2.3 for your testing (slightly updated from the
version I sent you).

Try the Lores Colors and Lores Demo - this is now using the Lores
color palette. I try to match it with the color name (eg "magenta")
rather than actual color value, as in Lores there is probably no one
standard color value as everybody monitors might be different. The
output is close to, but not exactly, to your screenshot.

John B. Matthews

unread,
Aug 29, 2008, 6:38:26 AM8/29/08
to
In article
<746aa535-7797-4ae1...@n33g2000pri.googlegroups.com>,
limtc <thye...@gmail.com> wrote:

Good catch! I would say lores color 1 is closer to (dark) red, although
color 3 is very near violet:

<http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.apple2/2005-09/msg
00534.html>

limtc

unread,
Aug 29, 2008, 7:13:41 AM8/29/08
to
1.2.5 uploaded with your suggestion. Changed a few colors for Lores to
more closely match the original Hires screenshot - thus remove the
names so that we just know color 1 is red (not necessary magenta or
dark red... we do need a primary color red, as in green and blue).

I like Lores mode a lot, and it makes for a good teaching tool. My
original implementation for 640x400 Super Hires is for my son, but I
think a 40x40 Lores is very easy to use and learn.

John B. Matthews

unread,
Aug 29, 2008, 12:33:13 PM8/29/08
to
In article
<e8fa61b1-d1f3-469d...@t1g2000pra.googlegroups.com>,
limtc <thye...@gmail.com> wrote:

> 1.2.5 uploaded with your suggestion. Changed a few colors for Lores to
> more closely match the original Hires screenshot - thus remove the
> names so that we just know color 1 is red (not necessary magenta or
> dark red... we do need a primary color red, as in green and blue).

Thanks you for indulging me. This issue is more subtle than I thought. I
updated my lores colors page to show Linards Ticmanis' calculated colors
in addition to the KEGSMAC emulator's rendering.

<http://home.woh.rr.com/jbmatthews/a2/lores.html>

I have a clear memory of the NTSC video red being a dark shade, as
Linards suggests. I have no idea why the Applesoft manual calls it
"magenta," which I identify with a secondary color having sRGB
components (0xFF00FF). Of course, the html rendering is itself a
function of the monitor's calibration.

> I like Lores mode a lot, and it makes for a good teaching tool. My
> original implementation for 640x400 Super Hires is for my son, but I
> think a 40x40 Lores is very easy to use and learn.

Excellent!

Michael J. Mahon

unread,
Aug 30, 2008, 8:49:34 PM8/30/08
to
John B. Matthews wrote:
> In article
> <746aa535-7797-4ae1...@n33g2000pri.googlegroups.com>,
> limtc <thye...@gmail.com> wrote:
>
>> Hi,
>>
>> I have uploaded 1.2.3 for your testing (slightly updated from the
>> version I sent you).
>>
>> Try the Lores Colors and Lores Demo - this is now using the Lores
>> color palette. I try to match it with the color name (eg "magenta")
>> rather than actual color value, as in Lores there is probably no one
>> standard color value as everybody monitors might be different. The
>> output is close to, but not exactly, to your screenshot.
>
> Good catch! I would say lores color 1 is closer to (dark) red, although
> color 3 is very near violet:

Lores color 3 should be identical to HGR purple, and color 12 ($C)
should be identical to HGR green. The blue and orange should also
be the same as HGR colors.

These colors are formed by the same video signal.

-michael

AppleCrate II: An Apple II "blade server"!
Home page: http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it's seriously underused."

Michael J. Mahon

unread,
Aug 30, 2008, 8:57:26 PM8/30/08
to
John B. Matthews wrote:

> <http://home.woh.rr.com/jbmatthews/a2/lores.html>
>
> I have a clear memory of the NTSC video red being a dark shade, as
> Linards suggests. I have no idea why the Applesoft manual calls it
> "magenta," which I identify with a secondary color having sRGB
> components (0xFF00FF). Of course, the html rendering is itself a
> function of the monitor's calibration.

Color 1 has only one bit of four set, so its luminance value is
25% of white. The hi-res colors (not white and black) all have
two bits set, and so have a luminance value of 50%, so lo-res color
1 is definitely a "dark" shade. (Note that 0xFF00FF has a luminance
of 67%--very much a "light" color.

John B. Matthews

unread,
Aug 30, 2008, 9:25:38 PM8/30/08
to
In article <es6dneorgaLqcSTV...@comcast.com>,

"Michael J. Mahon" <mjm...@aol.com> wrote:

> John B. Matthews wrote:
>
> > <http://home.woh.rr.com/jbmatthews/a2/lores.html>
> >
> > I have a clear memory of the NTSC video red being a dark shade, as
> > Linards suggests. I have no idea why the Applesoft manual calls it
> > "magenta," which I identify with a secondary color having sRGB
> > components (0xFF00FF). Of course, the html rendering is itself a
> > function of the monitor's calibration.
>
> Color 1 has only one bit of four set, so its luminance value is
> 25% of white. The hi-res colors (not white and black) all have
> two bits set, and so have a luminance value of 50%, so lo-res color
> 1 is definitely a "dark" shade. (Note that 0xFF00FF has a luminance
> of 67%--very much a "light" color.

Ah, thank you, Michael. This sheds light (no pun:-) on Linards'
derivation, which matches my recollection. I remember the "yellow" being
more of a gold and the "brown" being a muddy green, but I'd swear there
were two different grays. I'm curious why his table shows the two grays,
[5] and [A], having the same sRGB 0x808080. Is that that the difference
in luminance, also?

David Wilson

unread,
Aug 30, 2008, 10:30:02 PM8/30/08
to
On Aug 31, 11:25 am, "John B. Matthews" <nos...@nospam.invalid> wrote:
> Ah, thank you, Michael. This sheds light (no pun:-) on Linards'
> derivation, which matches my recollection. I remember the "yellow" being
> more of a gold and the "brown" being a muddy green, but I'd swear there
> were two different grays. I'm curious why his table shows the two grays,
> [5] and [A], having the same sRGB 0x808080. Is that that the difference
> in luminance, also?

The two lores grays are identical in brightness on an NTSC monitor -
after all they are the same square wave but opposite polarity (and
have no 3.58MHz color component) resulting in 50% brightness.

_-_-_-_-

-_-_-_-_


Jim Sather's Understanding the Apple IIe has a color picture (Fig
8.11) showing the LORES/HIRES80 colors in a color wheel. The two grays
look identical to me.

Michael J. Mahon

unread,
Aug 31, 2008, 4:27:33 AM8/31/08
to

No, the two grays are visually identical (though they may produce
different artifacts when they border other colors). They are both
devoid of any chroma, and both have 50% luminance.

From a video signal point of view, they each are 7MHz waveforms,
but of opposite phase. Since they contain no 3.58MHz signal, they
do not produce any color.

On a hi-res monochrome display, both have two white lines and two
black lines, but one is WBWB ($A) and the other is BWBW ($5).

Michael J. Mahon

unread,
Aug 31, 2008, 4:29:09 AM8/31/08
to

Well said!

(I guess you can tell that I read the group "in order". ;-)

John B. Matthews

unread,
Aug 31, 2008, 9:13:57 AM8/31/08
to
In article <0fGdnSmyv_pqyCfV...@comcast.com>,

Thanks, David & Michael:

_-_-_-_- [5] BWBW

-_-_-_-_ [A] WBWB

It took me a minute to realize those were waveforms and not a sig:-)

0 new messages