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

woz' original "brick out" - source code , paddles

11 views
Skip to first unread message

mad.scie...@gmail.com

unread,
Oct 22, 2007, 2:22:35 PM10/22/07
to
Can anyone point me to the original source code for Woz' Integer BASIC
"Brick Out" game for the Apple II?
(or any Apple 2 BASIC or assembly program listings, for that matter, I
would like to play around with writing some pong type games on the
apple IIe)

Is "Little Brick Out" the Woz version, or is this a later remake?

Also, is there any documentation online on how you would build your
own paddles? I have built paddles for the Atari 2600 which are pretty
easy, you just need to know the pinouts and the potentiometer values.

Thanks

aiia...@gmail.com

unread,
Oct 22, 2007, 3:17:25 PM10/22/07
to
On Oct 22, 11:22 am, mad.scientist...@gmail.com wrote:
> (or any Apple 2 BASIC or assembly program listings, for that matter, I
> would like to play around with writing some pong type games on the
> apple IIe)


here's about 5 minutes of me reinventing PONG:

you can PASTE it into AppleWin using SHIFT-INSERT

A and Z control player 1
K and M control player 2

there is no "death" or points.

the ball-istics are screwed up. I didn't spend very long figuring out
the logic.

1 REM
2 REM
3 REM DRAW FIELD
4 REM
5 REM
10 GR
20 COLOR= 7: VLIN 0,39 AT 0: VLIN 0,39 AT 39
30 HLIN 0,39 AT 0: HLIN 0,39 AT 39
100 X = 10:Y = 10:P1 = 10:P2 = 10
110 XC = 1:YC = - 1
120 PL = 8
195 REM
196 REM
197 REM DRAW PADDLE1
198 REM
199 REM
200 COLOR= 7
210 VLIN P1,P1 + PL AT 2
220 COLOR= 0: PLOT 2,P1 - 1: PLOT 2,P1 + PL + 1
295 REM
296 REM
297 REM DRAW PADDLE2
298 REM
299 REM
300 COLOR= 7
310 VLIN P2,P2 + PL AT 37
320 COLOR= 0: PLOT 37,P2 - 1: PLOT 37,P2 + PL + 1
398 REM
399 REM
400 REM DRAW BALL
401 REM
402 REM
410 COLOR= 5:
415 PLOT X,Y
416 OX = X:OY = Y
830 X = X + XC
835 IF SCRN( X,Y) > 0 THEN XC = - XC
840 Y = Y + YC
845 IF SCRN( X,Y) > 0 THEN YC = - YC
850 IF X < 1 THEN X = 1
860 IF X > 38 THEN X = 38
870 IF Y < 1 THEN Y = 1
880 IF Y > 38 THEN Y = 38
900 REM MOVE PADDLES
910 IF PEEK ( - 16384) > 127 THEN GET A$
920 IF A$ = "A" THEN P1 = P1 - 1
930 IF A$ = "Z" THEN P1 = P1 + 1
940 IF A$ = "K" THEN P2 = P2 - 1
950 IF A$ = "M" THEN P2 = P2 + 1
960 IF P1 < 2 THEN P1 = 2
970 IF P1 > 28 THEN P1 = 28
980 IF P2 < 2 THEN P2 = 2
990 IF P2 > 28 THEN P2 = 28
999 COLOR= 0: PLOT OX,OY
1000 GOTO 197

mad.scie...@gmail.com

unread,
Oct 22, 2007, 4:28:19 PM10/22/07
to
Many thanks, you rule

Can anyone post any code that would make the game work with paddles?

Are there any Apple II paddle specs online that show you how to build
a pair?

Thanks again

aiia...@gmail.com

unread,
Oct 22, 2007, 4:36:36 PM10/22/07
to
On Oct 22, 1:28 pm, mad.scientist...@gmail.com wrote:

> Can anyone post any code that would make the game work with paddles?
>

> > 900 REM MOVE PADDLES
> > 910 IF PEEK ( - 16384) > 127 THEN GET A$
> > 920 IF A$ = "A" THEN P1 = P1 - 1
> > 930 IF A$ = "Z" THEN P1 = P1 + 1
> > 940 IF A$ = "K" THEN P2 = P2 - 1
> > 950 IF A$ = "M" THEN P2 = P2 + 1


sure...

delete 910

920 if pdl(0)>200 then p1=p1+1
930 if pdl(0)<55 then p1=p1-1
940 if pdl(1)>200 then p2=p2+1
950 if pdl(1)<55 then p2=p2-1

that will give you control via paddle controllers.

There are better/faster ways to do it but the
other code would need to be changed a bit.

Rich

mad.scie...@gmail.com

unread,
Oct 22, 2007, 4:53:08 PM10/22/07
to
Thanks so much for posting that.

Incidentally, are there any good sites where you can find Apple II
BASIC program listings like this to learn from?

I have seen a lot of emulator sites and DSK images, but until I get
some floppy drives, I will be limited to typing in BASIC listings and
saving them to cassette. If there are any sites with MP3 recordings
of program cassettes, those might come in handy as well.

aiia...@gmail.com

unread,
Oct 22, 2007, 4:58:59 PM10/22/07
to
On Oct 22, 1:53 pm, mad.scientist...@gmail.com wrote:
> Thanks so much for posting that.
>
> Incidentally, are there any good sites where you can find Apple II
> BASIC program listings like this to learn from?
>
> I have seen a lot of emulator sites and DSK images, but until I get
> some floppy drives, I will be limited to typing in BASIC listings and
> saving them to cassette. If there are any sites with MP3 recordings
> of program cassettes, those might come in handy as well.

#1 GET A FLOPPY (email me if you want one. I have some for low $$)
#2 get some Nibble Magazines. You can get them on CD, or buy my whole
stack of them for cheap.

There are a few places with recordings of Cassettes, but very few.
Any recordings
are of very old Apple II programs.

Rich

mad.scie...@gmail.com

unread,
Oct 22, 2007, 5:43:39 PM10/22/07
to
Thanks for your reply. I will look around for Nibble. I had some old
COMPUTE, K Power, etc, magazines that I have from back in the day, but
I was on a C=64 so I never read the Apple articles. If I still have
these mags somewhere they should be interesting.

I do have a couple floppy drives coming, but they have not yet
arrived.
Meanwhile it's fun starting from scratch, with cassette, paper program
listings, etc. Kind of feels like "camping" - ie making do with two
sticks and a swiss army knife - in a digital sense : )

Andy McFadden

unread,
Oct 22, 2007, 9:10:31 PM10/22/07
to
mad.scie...@gmail.com wrote:
> Incidentally, are there any good sites where you can find Apple II
> BASIC program listings like this to learn from?

Somebody else suggested Nibble. Good place to start.

For something more advanced, find any of the BASIC programs written by
Beagle Bros and figure out how they work. I remember learning a lot from
those (e.g. it's the first time I saw Applesoft boolean expressions being
used as a multiplication operand).

--
Send mail to fad...@fadden.com (Andy McFadden) - http://www.fadden.com/
Fight Internet Spam - http://spam.abuse.net/spam/ & http://spamcop.net/

Mike Willegal

unread,
Oct 22, 2007, 9:38:35 PM10/22/07
to
An early "Breakout" listing is in the redbook. As for the paddles,
connect an 150K ohm potentometer between +5v and each paddle input.
Since 100K ohm potentiometers are much more common these days, you can
use one of those and in addition connect .01 uF cap between the paddle
input and ground to make up for the difference in resistance. The
paddle circuit simply measures the RC time constant that varies with the
potentiometer setting. The game port pin out is also in the red book
which can be found online in a couple of places. Search for "Apple II
reference manual".

Regards,
Mike Willegal

Joshua Bell

unread,
Oct 23, 2007, 12:14:10 AM10/23/07
to
aiia...@gmail.com wrote:
> On Oct 22, 11:22 am, mad.scientist...@gmail.com wrote:
>> (or any Apple 2 BASIC or assembly program listings, for that matter,
>> I would like to play around with writing some pong type games on the
>> apple IIe)
>
>
> here's about 5 minutes of me reinventing PONG:
>
> you can PASTE it into AppleWin using SHIFT-INSERT
>
> A and Z control player 1
> K and M control player 2
>
> there is no "death" or points.
>
> the ball-istics are screwed up. I didn't spend very long figuring out
> the logic.

Cute. :) After a quick fix to my code, this works in my Applesoft emulator:

http://www.calormen.com/Applesoft/

(Not being a 6502/Apple emulator, just Applesoft, it only supports a handful
of PEEKs. Although it supported PEEK(-16384), GET would basically clear the
keyboard strobe before blocking.)

If you have any other educational examples I'd be happy to post 'em.

aiia...@gmail.com

unread,
Oct 23, 2007, 11:40:57 AM10/23/07
to
On Oct 22, 9:14 pm, "Joshua Bell" <inexorablet...@hotmail.com> wrote:
>
> After a quick fix to my code, this works in my Applesoft emulator:
>
> http://www.calormen.com/Applesoft/


Cool!

I'll post more code to play with your emulator in the next
few days

mad.scie...@gmail.com

unread,
Oct 23, 2007, 1:35:10 PM10/23/07
to
> > After a quick fix to my code, this works in my Applesoft emulator:
> >http://www.calormen.com/Applesoft/
> Cool!
> I'll post more code to play with your emulator in the next
> few days

Thanks to you both - between the sample code and emulator I learned
how to make a game for the Apple! Here is your code with a menu and
more sensitive paddle movement (and I made the ball round :-)
There is no sound or scoring yet (how do you print text in graphics
mode?) and for keyboard mode I haven't figured out how to detect if
two keys are being pressed at once.
Thanks again...

10 REM APPLE II SIMPLE PONG V4
20 REM PASTE INTO Joshua Bell s EMULATOR AT www.calormen.com/Applesoft/
25 REM ++++++++++++++++++++++++++++++++++++++++
30 REM TITLE SCREEN + PROMPT FOR CONTROLS
35 REM ++++++++++++++++++++++++++++++++++++++++
40 TEXT : REM ENTER TEXT MODE
45 HOME : REM CLEAR TEXT SCREEN
49 PRINT "APPLE II SIMPLE PONG V4"
50 PRINT
51 PRINT "version 1 by aiiadict"
52 PRINT "tweaks by Mad Scientist Jr"
54 PRINT
55 PRINT "During game press Q to quit."
56 PRINT
58 INPUT "TYPE K FOR KEYS (A/Z, K/M) OR P FOR PADDLES OR Q TO QUIT?
";C$
60 IF C$ <> "K" AND C$ <> "P" AND C$ <> "Q" THEN GOTO 58
62 IF C$ = "Q" THEN GOTO 9000
65 REM
70 REM ++++++++++++++++++++++++++++++++++++++++
75 REM DRAW FIELD AND INITIALIZE GAME
80 REM ++++++++++++++++++++++++++++++++++++++++
85 GR: REM ENTER GRAPHIC MODE
90 COLOR= 7: VLIN 0,39 AT 0: VLIN 0,39 AT 39
95 HLIN 0,39 AT 0: HLIN 0,39 AT 39
100 bx = 10:by = 10:ox = 10:oy = 10: REM BALL START POSITION
102 dx = 1: dy = - 1: REM BALL DIRECTION
104 p1 = 10: o1 = 10: REM PLAYER 1 START POSITION
106 p2 = 10: o2 = 10: REM PLAYER 2 START POSITION
120 PL = 8: REM PADDLE LENGTH
130 REM
145 REM ++++++++++++++++++++++++++++++++++++++++
150 REM BEGIN MAIN GAME LOOP
155 REM ++++++++++++++++++++++++++++++++++++++++
196 REM ++++++++++++++++++++++++++++++++++++++++
197 REM DRAW PADDLE1
198 REM ++++++++++++++++++++++++++++++++++++++++
200 IF o1 <> p1 THEN COLOR= 0: VLIN o1,o1 + PL AT 3
210 COLOR= 7: VLIN p1,p1 + PL AT 3
296 REM ++++++++++++++++++++++++++++++++++++++++
297 REM DRAW PADDLE2
298 REM ++++++++++++++++++++++++++++++++++++++++
300 IF o2 <> p2 THEN COLOR= 0: VLIN o2,o2 + PL AT 36
310 COLOR= 7: VLIN p2,p2 + PL AT 36
399 REM ++++++++++++++++++++++++++++++++++++++++
400 REM DRAW AND MOVE BALL
401 REM ++++++++++++++++++++++++++++++++++++++++
402 IF ox <> bx OR oy <> by THEN COLOR= 0: PLOT ox,oy: PLOT ox,oy + 1
410 COLOR= 5: PLOT bx,by: PLOT bx,by + 1
416 ox = bx:oy = by
830 bx = bx + dx
835 IF SCRN( bx,by) > 0 THEN dx = - dx
840 by = by + dy
845 IF SCRN( bx,by) > 0 THEN dy = - dy
850 IF bx < 1 THEN bx = 1
860 IF bx > 38 THEN bx = 38
870 IF by < 1 THEN by = 1
880 IF by > 38 THEN by = 38
881 REM
882 REM ----------------------------------------
883 REM SAVE OLD SCREEN POSITION
884 REM ----------------------------------------
885 o1 = p1
886 o2 = p2
889 REM
900 REM ++++++++++++++++++++++++++++++++++++++++
901 REM GET PLAYER INPUT
902 REM ++++++++++++++++++++++++++++++++++++++++
903 IF PEEK ( - 16384) > 127 THEN GET K$: REM SEE IF KEY(S) PRESSED.
NEEDS FIX FOR MULTI KEY SIMULTANEOUS INPUT
904 IF C$ <> "K" THEN GOTO 921
905 REM
906 REM ----------------------------------------
907 REM KEYBOARD INPUT
908 REM NOTE: NEEDS FIX TO DETECT MULTI KEYPRESSES
909 REM ----------------------------------------
912 IF K$ = "A" THEN p1 = p1 - 1
914 IF K$ = "Z" THEN p1 = p1 + 1
916 IF K$ = "K" THEN p2 = p2 - 1
918 IF K$ = "M" THEN p2 = p2 + 1
920 GOTO 955
921 IF C$ <> "P" THEN GOTO 947
922 REM
923 REM ----------------------------------------
925 REM PADDLE INPUT
927 REM ----------------------------------------
930 REM simple (non-absolute) paddle input:
931 REM if pdl(0) > 200 then p1 = p1 + 1
932 REM if pdl(0) < 55 then p1 = p1 - 1
933 REM if pdl(1) > 200 then p2 = p2 + 1
934 REM if pdl(1) < 55 then p2 = p2 - 1
943 REM realtime (absolute position) paddle input:
944 GOSUB 3000: REM PLAYER 1
945 GOSUB 4000: REM PLAYER 2
947 REM
948 REM ----------------------------------------
949 REM SEE IF PLAYER PRESSED Q TO QUIT
950 REM ----------------------------------------
951 IF K$ = "Q" THEN GOTO 9000
954 REM
955 REM ++++++++++++++++++++++++++++++++++++++++
956 REM MAKE SURE PADDLES DONT GO OFF SCREEN
958 REM ++++++++++++++++++++++++++++++++++++++++
960 IF p1 < 2 THEN p1 = 2
970 IF p1 > 28 THEN p1 = 28
980 IF p2 < 2 THEN p2 = 2
990 IF p2 > 28 THEN p2 = 28
1000 REM
1010 REM ++++++++++++++++++++++++++++++++++++++++
1020 REM CONTINUE GAME LOOP
1030 REM ++++++++++++++++++++++++++++++++++++++++
1040 GOTO 150
3000 REM
3010 REM ++++++++++++++++++++++++++++++++++++++++
3020 REM GET SCREEN POSITION FROM PADDLE 1 INPUT
3030 REM ++++++++++++++++++++++++++++++++++++++++
3040 p1 = 26 * pdl(0)
3050 p1 = p1 / 255
3060 p1 = p1 + 2
3070 RETURN
4000 REM
4010 REM ++++++++++++++++++++++++++++++++++++++++
4020 REM GET SCREEN POSITION FROM PADDLE 2 INPUT
4030 REM ++++++++++++++++++++++++++++++++++++++++
4040 p2 = 26 * pdl(1)
4050 p2 = p2 / 255
4060 p2 = p2 + 2
4070 RETURN
9000 REM
9010 REM ++++++++++++++++++++++++++++++++++++++++
9020 REM QUIT GAME
9030 REM ++++++++++++++++++++++++++++++++++++++++
9040 TEXT : REM HOME
9045 PRINT
9050 PRINT "FINISHED APPLE II SIMPLE PONG V4."
9060 END


aiia...@gmail.com

unread,
Oct 23, 2007, 1:49:34 PM10/23/07
to
On Oct 23, 10:35 am, mad.scientist...@gmail.com wrote:
> Thanks to you both - between the sample code and emulator I learned
> how to make a game for the Apple!

neat! You can also paste this code into AppleWin emulator.
type your code into wordpad/notepad, etc.
select it,
copy it,
go to emulator basic prompt
NEW
then press SHIFT-INSERT
it will type the code into the emulated basic prompt


> There is no sound or scoring yet (how do you print text in graphics
> mode?)

sc = 983
VTAB 21:print "score= ";sc;" ";

>and for keyboard mode I haven't figured out how to detect if
> two keys are being pressed at once.

you cant.

the only way you can detect two keys:
use SHIFT and open/closed apple.

example:

input a$
if a$ = "a" then print "you pressed the a key"
if a$="A" then print "you pressed SHIFT and the A key"

but it requires you to press A... you can't detect SHIFT
by itself.

the open/closed apple keys are connected to the paddle
circuits. read in the apple II reference manual for the
correct peeks

b2utton = -16297
b1utton = -16296 (both values are DEFINITELY not correct)

10 if peek (b2utton) > 128 then print "you pressed button 2"

(or, could be "you pressed open apple")

the only way to play a 2 player game on the keyboard is to have
the players constantly tapping their keys, or use the open/closed
apple keys for one of the players.

Rich

William Garber

unread,
Oct 23, 2007, 3:05:16 PM10/23/07
to

<aiia...@gmail.com> wrote in message news:1193161774....@z24g2000prh.googlegroups.com...

: On Oct 23, 10:35 am, mad.scientist...@gmail.com wrote:
: > Thanks to you both - between the sample code and
: > emulator I learned how to make a game for the Apple!
:
: neat! You can also paste this code into AppleWin emulator.
: type your code into wordpad/notepad, etc.
: select it, copy it, go to emulator basic prompt
: NEW, then press SHIFT-INSERT

: it will type the code into the emulated basic prompt

The version of AppleWin that I use has a
PASTE FROM CLIPBOARD button in the config
section. The SHIFT-INSERT combo does not
work. Which version has this feature?

William Garber
Email Address - will...@garberstreet.com
Alt. Email - will...@comcast.net
Web address - http://www.garberstreet.com

mad.scie...@gmail.com

unread,
Oct 23, 2007, 5:22:00 PM10/23/07
to
Thanks for the info - I have a couple of other questions.

1) What kind of connector is it that plugs into the II's game port on
the motherboard, and where can you find one? Is there an equivalent
Radio Shack or Mouser part # that would work for this?

2) What is the equation to figure out the uF for a cap you would need
to get it to work with a 50K pot?

Thanks again...

> As for the paddles,
> connect an 150K ohm potentometer between +5v and each paddle input.
> Since 100K ohm potentiometers are much more common these days, you can
> use one of those and in addition connect .01 uF cap between the paddle
> input and ground to make up for the difference in resistance. The
> paddle circuit simply measures the RC time constant that varies with the
> potentiometer setting.


On Oct 22, 9:38 pm, Mike Willegal <m...@willegal.net> wrote:
> An early "Breakout" listing is in the redbook. As for the paddles,
> connect an 150K ohm potentometer between +5v and each paddle input.
> Since 100K ohm potentiometers are much more common these days, you can
> use one of those and in addition connect .01 uF cap between the paddle
> input and ground to make up for the difference in resistance. The
> paddle circuit simply measures the RC time constant that varies with the
> potentiometer setting. The game port pin out is also in the red book
> which can be found online in a couple of places. Search for "Apple II
> reference manual".
>
> Regards,
> Mike Willegal
>

aiia...@gmail.com

unread,
Oct 23, 2007, 7:37:55 PM10/23/07
to
On Oct 23, 12:05 pm, "William Garber" <willy4...@garberstreet.com>
wrote:

> The version of AppleWin that I use has a
> PASTE FROM CLIPBOARD button in the config
> section. The SHIFT-INSERT combo does not
> work. Which version has this feature?

on INPUT tab (from configuration button)

PASTE FROM CLIPBOARD button, but right after the
button it says "(Shift+Insert during emulation)"

version 1.14.0.0


aiia...@gmail.com

unread,
Oct 23, 2007, 7:44:00 PM10/23/07
to
On Oct 23, 2:22 pm, mad.scientist...@gmail.com wrote:
> Thanks for the info - I have a couple of other questions.
>
> 1) What kind of connector is it that plugs into the II's game port

?16 pin DIP? Get a 16 pin DIP socket with the proper width

> 2) What is the equation to figure out the uF for a cap you would need
> to get it to work with a 50K pot?

Just get an apple II joystick and rip out the insides. You need one
with rotary pots instead of the cheap ones that used "linear" pots..

>
> > > Also, is there any documentation online on how you would build your
> > > own paddles?

look on the archive sites. One of the atari guys scanned and posted a
book that includes an article on how to make game controllers for the
Apple II.

Rich

aiia...@gmail.com

unread,
Oct 23, 2007, 7:51:18 PM10/23/07
to
On Oct 23, 2:22 pm, mad.scientist...@gmail.com wrote:
> Thanks for the info - I have a couple of other questions.
>
> 1) What kind of connector is it that plugs into the II's game port

?16 pin DIP? Get a 16 pin DIP socket with the proper width

> 2) What is the equation to figure out the uF for a cap you would need


> to get it to work with a 50K pot?

Just get an apple II joystick and rip out the insides. You need one


with rotary pots instead of the cheap ones that used "linear" pots..

>


> > > Also, is there any documentation online on how you would build your
> > > own paddles?

look on the archive sites. One of the atari guys scanned and posted a

Mike Willegal

unread,
Oct 23, 2007, 9:05:20 PM10/23/07
to
mad.scie...@gmail.com wrote:
> Thanks for the info - I have a couple of other questions.
>
> 1) What kind of connector is it that plugs into the II's game port on
> the motherboard, and where can you find one? Is there an equivalent
> Radio Shack or Mouser part # that would work for this?

www.digikey.com:
A103-ND
Mouser has same part in catalog, but lists it as none stock.

And a good cover would be:
A111-ND or A112-ND

You will have to drill a hole in one end of the cover for the cable.

>
> 2) What is the equation to figure out the uF for a cap you would need
> to get it to work with a 50K pot?

I think that this is an simple RC time constant circuit designed with an
onboard .022uF capacitor and an external 150k ohm variable pot in mind.

To change the value. you need to solve
150k*.022uF = x * (y+.022uF)
where x the pot you want to use and y is the capacitance you need to add

so for 100k pot you get
y=(150k*.022uF)/100k-0.022uF
1.5*.022uF - .022uF =y
y = .011uF

for a 50k pot
y = (150k*.022uF)/50k-.022uF
y = .044 uF

This level of exactness isn't required in this circuit. Anything close
should work.

schmidtd

unread,
Oct 23, 2007, 9:51:45 PM10/23/07
to
On Oct 23, 7:44 pm, aiiad...@gmail.com wrote:
> look on the archive sites. One of the atari guys scanned and posted a
> book that includes an article on how to make game controllers for the
> Apple II.
http://www.atariarchives.org/ccc/chapter1.php

William Garber

unread,
Oct 24, 2007, 9:58:55 AM10/24/07
to

<aiia...@gmail.com> wrote in message
news:1193171299....@q5g2000prf.googlegroups.com...
: On Oct 23, 12:05 pm, "William Garber"

Uh-oh, time to install a newer version. I'm still
using an older one, version 1.12.6.0, which is the
one right after hard drive images were added, I believe.

mad.scie...@gmail.com

unread,
Oct 25, 2007, 6:30:56 PM10/25/07
to
Incredible - thanks so much!

I tried running that pong code on a real 128k IIe, and it is kinda
slow. Would removing the REM statements speed it up?
Would a BASIC compiler help?

I found a couple online - Einstein and Flash (though it says Integer
BASIC which I don't think comes on the IIe).
I also went to the Beagle Bros download site which had a bunch of
files but the BASIC Compiler was missing (just the manual was there,
to show you what you are missing).

What language / method would be best to develop in on the Apple 2? I
have dabbled in Pascal and C, and some 6502 assembly (on the Commodore
64).
I got the ball to beep with chr$(7) and wanted to get it to beep in
higher & lower tones, but read that to get anything other than the
system beep or a click, you have to write assembly code. Are there any
good tutorials on this and samples of sound code?

Also, typing/editing the BASIC code on the IIe is a nightmare! I
forgot the pain of not having an editor. Can BASIC be edited in an
editor on the Apple? I am used to the Commodore where a Basic program
is not stored as an ascii-type text file, and so can't be edited with
a text editor (you would have to use a conversion program to translate
the text listing into the equivalent BASIC tokens and save to a binary
file).

Finally I have to figure out how to get all these disk image files (I
am not familiar with the Apple II file extensions - dsk bin shk sdk
rsrc po nib com do bxy bsc asm acf) transferred over to the IIe. I
downloaded Cider Press and see there is quite a bit of info in there,
so I have some reading to do. Since I have a Mac LC III with an Apple
II emulator card & y cable, could I use this to transfer the DSK and
other image files to the actual Apple IIe ? Or are there any specs
online on how to build a cable to connect your PC to the Apple Disk II
(the X1541-series cables allow you to do that for Commodore disk
drives - http://sta.c64.org/xcables.html)?

Well thanks again for the help and posting the link to that awesome
game controller book...

On Oct 23, 9:51 pm, schmidtd <schmi...@my-deja.com> wrote:
> http://www.atariarchives.org/ccc/chapter1.php

BluPhoenyx

unread,
Oct 25, 2007, 11:58:01 PM10/25/07
to
To: mad.scientist.jr

mad.scientist.jr wrote:
> Incredible - thanks so much!
>
> I tried running that pong code on a real 128k IIe, and it is kinda
> slow. Would removing the REM statements speed it up?
> Would a BASIC compiler help?
>
> I found a couple online - Einstein and Flash (though it says Integer
> BASIC which I don't think comes on the IIe).
> I also went to the Beagle Bros download site which had a bunch of
> files but the BASIC Compiler was missing (just the manual was there,
> to show you what you are missing).
>
> What language / method would be best to develop in on the Apple 2? I
> have dabbled in Pascal and C, and some 6502 assembly (on the Commodore
> 64).


There are several ways to improve Applesoft speed without resorting to
assembly. Removing REM statements will help with both speed and size.
How much depends on how many REM statements exist and where they are in
the code.

Another useful trick is putting the most branched to lines at the front
of the program. Again, how much speed is gained depends on the program
and how much branching it uses.

Another minor trick is defining variables to ensure certain ones are
listed early in the variable table. However, this usually doesn't apply
to string variables. Yet again, this depends on the program.

There are several Applesoft compilers for DOS 3.3. TASC comes to mind.
The integer BASIC compilers probably won't help much but Integer BASIC
was available on any machine with the proper boot disk.

ProDOS 8 only had the Beagle Bros compiler for Applesoft. Other
compilers for BASIC exist such as ZBasic or Micol Advanced BASIC. ZBasic
has been released as free-use software and documentation is available as
well. It offers a 64k and 128k P8 versions. The DOS 3.3 version has yet
to be uploaded. I highly recommend it.

The Kyan Pascal system is available along with support tools and decent
documentation. It is a very capable Pascal system which compiles to
machine code. There is also an optimizer available.

Two C systems, Manx Aztec C and HyperC are available. Both are K&R and
are quite usable. I prefer the Manx system in general with both DOS 3.3
and ProDOS versions as well as an MSDOS based cross-compiler. On the
other hand, HyperC is considered as freely available as a shareware
product with no place to send the registration fee to. There is an
enormous amount of user supplied information and code available online.

Most of these are available at the Asimov ftp site. The best Kyan stuff
is available on the Apple2 GMail account.

> I got the ball to beep with chr$(7) and wanted to get it to beep in
> higher & lower tones, but read that to get anything other than the
> system beep or a click, you have to write assembly code. Are there any
> good tutorials on this and samples of sound code?

There are a number of short assembly language tutorials available. Some
can be found here:

ftp://garberstreet.com/Docs
http://www.textfiles.com/apple/

> Also, typing/editing the BASIC code on the IIe is a nightmare! I
> forgot the pain of not having an editor. Can BASIC be edited in an
> editor on the Apple? I am used to the Commodore where a Basic program
> is not stored as an ascii-type text file, and so can't be edited with
> a text editor (you would have to use a conversion program to translate
> the text listing into the equivalent BASIC tokens and save to a binary
> file).

Try Program Writer for a full screen editor with many bells and whistles.

You can save the BASIC program with a simple trick like this.

1 PRINT CHR$(4);"OPEN MYPROGRAM":PRINT CHR$(4);"WRITE
MYPROGRAM":LIST:PRINT CHR$(4);"CLOSE":END

Add this line and run the program. This assumes ProDOS 8 is running and
the file (MYPROGRAM in this case) doesn't exist. It is possible to
expand on this idea, place the code at an area which should never be run
normally such as 60000..61000 then from the Applesoft prompt, type

GOTO 60000
or
RUN 60000

>
> Finally I have to figure out how to get all these disk image files (I
> am not familiar with the Apple II file extensions - dsk bin shk sdk
> rsrc po nib com do bxy bsc asm acf) transferred over to the IIe. I
> downloaded Cider Press and see there is quite a bit of info in there,
> so I have some reading to do. Since I have a Mac LC III with an Apple
> II emulator card & y cable, could I use this to transfer the DSK and
> other image files to the actual Apple IIe ? Or are there any specs
> online on how to build a cable to connect your PC to the Apple Disk II
> (the X1541-series cables allow you to do that for Commodore disk
> drives - http://sta.c64.org/xcables.html)?

dsk, po, do, nib, 2mg should be disk images. They are generally byte
level copies of real disks and used in emulators. shk, sdk, bxy, acf are
archive files. shk and sdk are created by the program Shrinkit which was
the standard Apple II archive utility in it's day.

bsc files are 7 bit encoded ascii files used to send data through email,
newsgroups or other text transfer methods. can be extracted with bscit
or binscii.

CiderPress on the PC should be able to handle and convert most of these
for you.

Can't help on the MAC/IIe card though, don't have a MAC but I think
there are ways to do what you require.

See the FAQs for other info:

http://home.swbell.net/rubywand/A2FAQs1START.html

Cheers,
Mike T
--- Synchronet 3.14a-Win32 NewsLink 1.85
A2Central.com - Your total source for Apple II computing.

Paul Schlyter

unread,
Oct 26, 2007, 2:42:36 AM10/26/07
to
In article <1193351456.2...@o80g2000hse.googlegroups.com>,
<mad.scie...@gmail.com> wrote:

> What language / method would be best to develop in on the Apple 2? I
> have dabbled in Pascal and C, and some 6502 assembly (on the Commodore
> 64).

From a program development point of view, the choice is simple: switch
to Apple CP/M !!! There you'll get the largest selection of
programming languages, and the source code usually is a plain text
file which is edited in a real editor. Finally, your program will
probably be portable to other CP/M environments as well.

The most fun programming environment for the Apple 2 was IMO Turbo
Pascal for CP/M. For fun (and also to learn Pascal thoroughly) I once
rewrote the classic Apple II game "Softporn Adventure" in Turbo Pascal
on an Apple II - and with almost no effort at all that program was
ported to MS-DOS computers as well:

http://www.wurb.com/if/game/194

--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/

schmidtd

unread,
Oct 26, 2007, 8:52:47 AM10/26/07
to
On Oct 25, 6:30 pm, mad.scientist...@gmail.com wrote:
> Finally I have to figure out how to get all these disk image files (I
> am not familiar with the Apple II file extensions - dsk bin shk sdk
> rsrc po nib com do bxy bsc asm acf) transferred over to the IIe.
Here is a FAQ for all those extensions:
http://home.swbell.net/rubywand/Csa2FLUTILS.html

> I downloaded Cider Press and see there is quite a bit of info in
> there, so I have some reading to do. Since I have a Mac LC III
> with an Apple II emulator card & y cable, could I use this to
> transfer the DSK and other image files to the actual Apple IIe ?

I'm not familiar with how you would go from .DSK to something the IIe
card could use without going through a physical diskette first. A
place to start learning about the card's capabilities is here:
http://www.vintagemacworld.com/lc_card_faq.html
If you have serial capabilities on the real IIe, you can go the MacADT
or ADTPro route:
http://adtpro.sourceforge.net
The DOS ADT package ("ADT 2007_2") contains MacADT that will run on
classic Mac OS, and the ADTPro package ("ADTPro-1.0.3") will run on
OSX and other contemporary operating systems.

> Or are there any specs
> online on how to build a cable to connect your PC to the Apple Disk II

> (the X1541-series cables...)
No, not without additional hardware (i.e. the Catweasel card). The
1541 drive has a bunch of brains in it that make the PC connection
relatively easy; the Disk II is a whole different beast. :-)

Linards Ticmanis

unread,
Oct 26, 2007, 4:46:14 PM10/26/07
to
BluPhoenyx wrote:

> There are several ways to improve Applesoft speed without resorting to
> assembly. Removing REM statements will help with both speed and size.
> How much depends on how many REM statements exist and where they are in
> the code.
>
> Another useful trick is putting the most branched to lines at the front
> of the program. Again, how much speed is gained depends on the program
> and how much branching it uses.
>
> Another minor trick is defining variables to ensure certain ones are
> listed early in the variable table. However, this usually doesn't apply
> to string variables. Yet again, this depends on the program.

One more: store all numbers that are used more than once in variables.
Parsing numerical constants is quite slow in Applesoft, compared to a
variable lookup.

--
Linards Ticmanis

Linards Ticmanis

unread,
Oct 26, 2007, 4:55:13 PM10/26/07
to
mad.scie...@gmail.com wrote:

> I got the ball to beep with chr$(7) and wanted to get it to beep in
> higher & lower tones, but read that to get anything other than the
> system beep or a click, you have to write assembly code. Are there any
> good tutorials on this and samples of sound code?

If you use Integer BASIC (faster and thus better suited for such stuff),
you can use the Programmer's Aid #1 helper routines to get sounds very
easily.

Integer BASIC (including the Programmer's Aid #1) can be loaded into any
64K or higher Apple II model, by simply booting a DOS 3.3 master disk.
After that, the commands INT and FP switch between BASIC versions. Both
commands imply a NEW, so don't forget to save your program before switching.

The only book on Integer BASIC that Apple ever published is the "Apple
II BASIC programming manual", a well-written tutorial-type book. It's
available for download at

> http://www.1000bit.it/support/manuali/apple/a2bpm.pdf

The Programmer's Aid #1 has its own manual at

> http://www.1000bit.net/support/manuali/apple/3rdparts/programmers_aid1.pdf-link.pdf

which unfortunately suffers quite a bit from a bad OCR job. But it's
still usable enough.

--
Linards Ticmanis

Paul Schlyter

unread,
Oct 27, 2007, 8:12:42 AM10/27/07
to
In article <47225216$0$27120$9b4e...@newsspool1.arcor-online.net>,
Linards Ticmanis <ticm...@gmx.de> wrote:

If one switches to Apple CP/M and runs MBASIC v5 instead, several of those
problems vanishes:

MBASIC stores all numerical constants in binary format, making the
access to a constant faster than looking up variables in the variable
table. It also distinguishes between integer constants and
floating-point constants (the f.p. constants comes in two flavors:
single precision and double precision, and you can specify which one
of them any particular f.p. xconstant should be). And very small
integers (up to 10 or so) are stored in a particularly compact binary
format, making the access to these constants faster still.

When executing a GOTO or GOSUB, the MBASIC interpreter scans for the
target program line only once. When the target line has been found,
the GOTO/GOSUB instruction is modified such that it contains the
machine address of the target program line rather than its line
number. This of course makes listing the program slightly slower
since then the machine address needs to be converted back to a line
number, but that doesn't matter much. If the program is modified in
some way (i.e. if a line is added, deleted, or modified), the MBASIC
interpreter scans through the whole program, converting GOTO/GOSUB
target machine address back to program lines before modifying the
program. Finally, if the program is executed, making its GOTO/GOSUB
statements having their target lines converted to target machine
addresses, and if the program then is stored on disk in binary format
(the default format), the next time the MBASIC program is loaded from
disk, its GOTO/GOSUB statements will already have its targets as
machine addresses rather than as program lines!!!


The MBASIC which comes with Apple CP/M was MBASIC ver 5. It comes in two
flavors: MBASIC.COM which is pretty much like the generic version of
MBASIC ver 5, and GBASIC.COM which has hi-res graphics routines added.

Applesoft is really MBASIC ver 2, the 6502 version, with additions and
modifications (such as the graphics routines) added by Apple. Similar
interpreters were present in the Commodore PET, Vic-20, and 64: they
too were based om the 6502 version of MBASIC ver 2.

No MBASIC version later than ver 2 was ever available in a 6502
version.

BluPhoenyx

unread,
Oct 27, 2007, 10:50:14 PM10/27/07
to
To: pausch
But then it becomes simply a CP/M machine and not an Apple II. This may
be fine for you. I'm sure you like CP/M systems but I prefer my II stay
a II. I like the nuances of the hardware and software that give it the
personality it has.

Michael J. Mahon

unread,
Nov 12, 2007, 12:22:08 PM11/12/07
to
mad.scie...@gmail.com wrote:
> Thanks for your reply. I will look around for Nibble. I had some old
> COMPUTE, K Power, etc, magazines that I have from back in the day, but
> I was on a C=64 so I never read the Apple articles. If I still have
> these mags somewhere they should be interesting.
>
> I do have a couple floppy drives coming, but they have not yet
> arrived.
> Meanwhile it's fun starting from scratch, with cassette, paper program
> listings, etc. Kind of feels like "camping" - ie making do with two
> sticks and a swiss army knife - in a digital sense : )

I know what you mean--and it *is* fun to learn what you can
do with very little. I couldn't afford a disk drive until
I had my Apple ][+ for almost two years, and found that I
could be quite productive using cassettes.

After getting a floppy, I didn't have a printer for another
year or two, so notebooks were my primary "visible medium". ;-)

-michael

NadaPong: Network game demo for Apple II computers!
Home page: http://members.aol.com/MJMahon/

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

0 new messages