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

Breakout source code?

425 views
Skip to first unread message

cb meeks

unread,
Apr 27, 2017, 3:02:59 PM4/27/17
to
I tried searching for this but my search skills must be way off.

Has the original Breakout game Woz did for the Apple II (in BASIC) ever been released? If so, where can I snag a copy?

Thanks!

Marco Verpelli

unread,
Apr 27, 2017, 3:26:14 PM4/27/17
to

Raymond Wiker

unread,
Apr 27, 2017, 3:31:30 PM4/27/17
to

Jeff Ramsey

unread,
Apr 27, 2017, 3:44:29 PM4/27/17
to
This is sweet! I've been looking for a short game to code with my kids, so I can show them how I used to play games when I was their age. (Dang, that is something 'old' people say!)

The fact that is written by WOZ and is one of the main reasons the A2 exists is even sweeter!

cb meeks

unread,
Apr 27, 2017, 3:53:46 PM4/27/17
to
Awesome!

Thanks everyone!

John Brooks

unread,
Apr 27, 2017, 4:44:13 PM4/27/17
to
On Thursday, April 27, 2017 at 12:53:46 PM UTC-7, cb meeks wrote:
> Awesome!
>
> Thanks everyone!

Note that it's in Integer basic, so likely won't work as-is in Applesoft.

-JB
@JBrooksBSI

James Davis

unread,
Apr 27, 2017, 9:52:34 PM4/27/17
to
As I recall, it was not hard to translate into Applesoft.

Another good coding project for Jeff and his kids.

James Davis

Raymond Wiker

unread,
Apr 28, 2017, 12:08:08 AM4/28/17
to
I think there is an Applesoft version on one of the DOS3.3(?)
disks... Actually, looks like it is the August 1980 version of DOS 3.3:

https://www.reddit.com/r/retrobattlestations/comments/1rbh1j/pong_descendant_breakout_written_in_basic_on_an/

Steve Nickolas

unread,
Apr 28, 2017, 6:15:51 AM4/28/17
to
There's a fuller one on the 1983 Sample Programs disk. This, and its
INTBASIC antecedent, were written by Bruce Tognazzini.

-uso.

Jeff Ramsey

unread,
Apr 28, 2017, 3:01:17 PM4/28/17
to
I was able to update most of it already. My 10 year old and I worked on it for about 1.5 hours last night. After she went to bed, I stayed at it for another 2 hours. TAB = HTAB, commas in an INPUT statement replaced with semicolons, etc.

I'm getting an error now in line 90, but I'll get that worked out soon as well. The best part of it was I showed it to my daughter and told her the story of Woz/Jobs and Atari Breakout, and how they all relate to the Apple II, and she told me that it was an awesome story and she sat with me for 1.5 hours and programmed it out with me!

cb meeks

unread,
Apr 28, 2017, 3:14:52 PM4/28/17
to
That's awesome. My son and I have worked on some Python in the past for his class.

Also, I'll never forget the time my stepdaughter first used an Apple IIe and she asked "where's the mouse?". LOL

Jeff Ramsey

unread,
Apr 28, 2017, 3:43:31 PM4/28/17
to
I got asked that question last night. But a more important one was "How are we gonna play this without a joystick or gamepad?" (Answer) We will build that too!

Jeff Ramsey

unread,
Apr 28, 2017, 6:57:23 PM4/28/17
to
Ok. So I am stumped on this one...

I changed all of the TAB to HTAB, I changed the , in the input lines to ; and I changed the places where # was used for 'does not equal' to <>

When I run the game, I am getting past entering my name, and choosing 'Y' for standard colors, it draws the game screen, everything is there graphics-wise except the paddle, and then I get "ILLEGAL QUANTITY ERROR IN 90"

I have checked for typo or syntax errors and I see nothing. Then it dawned on me - I don't own a joystick or paddle. Could that be why the paddle graphic is not there and I am getting this error? Or is there something else that I missed that is not compatible with AppleSoft Basic?

cybernesto

unread,
Apr 28, 2017, 7:01:18 PM4/28/17
to
Take a look into LITTLE BRICK OUT on this disk http://macgui.com/downloads/?file_id=24503&keywords=brick

Jeff Ramsey

unread,
Apr 28, 2017, 8:05:47 PM4/28/17
to
Thanks. I seen that disk image in a Reddit post also. If I downloaded it, would I be able to see the code or would I only be able to play the game?

gid...@sasktel.net

unread,
Apr 28, 2017, 8:22:06 PM4/28/17
to
A little while back I made Integer Basic work under Prodos and logged the changes that would be needed to convert programs to applesoft. I think I have covered every scenario.


To convert Integer Basic to Applesoft

INPUT comands - change comma to semi-colon
remove all DIM of a string variable (not needed)
change string variables to use MID$ - i.e. A$(1,1)(in INT) is MID$(A$,1,1)(in AS basic)
change GOTO or GOSUB with a variable to ON GOTO
change IF statements to ON GOTO where possible and convert to multiple lines. All statements that follow an IF on the same line are executed whether the statement is true or not.
change MOD function to X=Y-(INT(Y/Z)*Z)
change "#" to "<>"
change TAB to HTAB
change RND(X) to INT(RND(1)*X)
relocate ML programs and change CALL'S and POKE'S. Since INT programs go from HIMEM down, binary code is usually in low memory.

These few are not necessary but make for compact code.

change CALL -384 to INVERSE
change CALL -380 to NORMAL
change CALL -936 to HOME

James Davis

unread,
Apr 29, 2017, 1:25:29 AM4/29/17
to
On Friday, April 28, 2017 at 5:05:47 PM UTC-7, Jeff Ramsey wrote:
> Thanks. I seen that disk image in a Reddit post also. If I downloaded it, would I be able to see the code or would I only be able to play the game?

You can extract it with 7-zip.
You can extract it and look at it with CiderPress.
Once you have extracted the disk image, you can use AppleWin to load it and list it. You can do the same on a real Apple II after you transfer it to a real Apple II floppy disk.

This is it from CiderPress:

Little Brick Out:

10 GOTO 2000
20 Q = PDL (0): IF ABS (Q - OQ) < 5 * SGN (Q) THEN RETURN
21 Z = PEEK ( - 16384): IF Z = 155 THEN 11010
30 OQ = Q:Q = INT (39 - Q / 6): IF Q < 0 THEN Q = 0
40 IF Q > 34 THEN Q = 34
50 COLOR= D: VLIN Q,Q + LL AT 0: COLOR= A: IF P < Q THEN VLIN 0,Q - 1 AT 0
60 IF Q < P THEN VLIN Q + LL + 1,39 AT 0
70 P = Q: RETURN
75 PLOT X,Y / 3: COLOR= F: PLOT I,K:X = I:Y = J
80 J = Y + W: IF J < 0 OR J > 119 THEN GOSUB 230
120 I = X + V: IF I < 0 THEN 1900
130 IF I < 6 THEN OQ = 500
150 GOSUB 20: COLOR= E:K = J / 3: IF I > 39 THEN 240
160 IF SCRN( I,K) = E THEN 75
170 IF I THEN 270
180 V = 2:W = (K - P) * 2 - LL:M = 1
215 POKE 6,150 - ABS (W) * 4: POKE 7,3
218 Z = PEEK ( - 16336) - PEEK ( - 16336) + PEEK ( - 16336) - PEEK ( - 16336): CALL 768
220 GOTO 75
230 W = - W:J = Y:Z = PEEK ( - 16336) - PEEK ( - 16336) + PEEK ( - 16336) - PEEK ( - 16336) + PEEK ( - 16336) - PEEK ( - 16336) + PEEK ( - 16336): RETURN : REM SIDE BOUNCE
240 FOR I = 1 TO 6:M = PEEK ( - 16336): NEXT I:I = X:M = 0
250 V = - V
260 GOTO 75
270 IF M THEN V = ABS (V)
275 M = 1
280 VLIN INT (K / 2) * 2, INT (K / 2) * 2 + 1 AT I:S = S + I / 2 - 9: VTAB 24: HTAB 8: PRINT S;: VTAB 23: HTAB 1
295 POKE 6,180 - I * 3: POKE 7,3:Z = PEEK ( - 16336): CALL 768
300 POKE 6,140 + I * RND (1): POKE 7,2: CALL 768
310 POKE 6,50: POKE 7,3: CALL 768
330 REM ^BRICK STRUCK
340 IF S < 720 THEN 250
350 VTAB 24: PRINT : PRINT : PRINT : GOSUB 1500: GOTO 760
355 COLOR= E: REM DRAW FIELD
360 FOR I = 0 TO 39: VLIN 0,39 AT I: NEXT I
420 FOR I = 20 TO 34 STEP 2
430 COLOR= B: VLIN 0,39 AT I: COLOR= C: FOR W = INT ((I / 4 - INT (I / 4)) * 4 + .05) * SGN (I / 4) TO 39 STEP 4
440 VLIN W,W + 1 AT I: NEXT W
450 NEXT I: RETURN
760 VTAB 23: PRINT "CONGRATULATIONS, ";: IF LEN (A$) THEN PRINT A$;", ";
770 PRINT "YOU WIN!";: CALL - 868: PRINT
780 A$ = "CHAMP"
790 GOTO 1100
800 VTAB 24: PRINT : PRINT : PRINT : VTAB 22: PRINT "YOUR SCORE IS ";: IF S < 10 THEN 910
810 IF S > 50 THEN EXTP = 1
820 IF S > 100 THEN NVC = 0
830 IF S < 20 THEN 960
840 IF S < 60 THEN 1010
850 IF S < 120 THEN 1040
860 IF S < 200 THEN 1050
870 IF S < 300 THEN 1060
880 IF S < 420 THEN 1070
890 IF S < 650 THEN 1080
900 GOTO 1090
910 IF NVC THEN 930
920 PRINT "NOT TOO GOOD, BUT": PRINT "KEEP ON TRYING!":NVC = 1: GOTO 1100
930 IF NVC1 THEN 950
940 PRINT "STILL NOT GREAT,": PRINT "BUT KEEP WORKING AT IT.":NVC1 = 1: GOTO 1100
950 PRINT "ALL RIGHT.": PRINT "JUST KEEP TRYING.": GOTO 1100
960 IF NVC THEN 990
970 IF NOT EXTP THEN 910
980 PRINT "PRETTY BAD!": GOTO 1100
990 PRINT "MUCH BETTER THAN IT WAS.": PRINT "KEEP GOING!": GOTO 1100
1000 PRINT "O.K.": PRINT "TRY IT AGAIN!": GOTO 1100
1010 IF NVC THEN 1030
1020 PRINT "FAIR. ": GOTO 1100
1030 PRINT "GETTING REALLY GOOD.": GOTO 1100
1040 PRINT "NOT BAD. ": GOTO 1100
1050 PRINT "GOOD.": GOTO 1100
1060 PRINT "VERY GOOD.": GOTO 1100
1070 PRINT "VERY, VERY GOOD.": GOTO 1100
1080 PRINT "EXCELLENT.": GOTO 1100
1090 PRINT "NEARLY PERFECT.": GOTO 1100
1100 POKE 50,63: VTAB 24: PRINT "PUSH BUTTON FOR NEW GAME, ESC KEY TO EN";: POKE 2039,4: POKE 50,255: POKE - 16368,0
1110 REM "POKE 2039,4" POKES AN INVERSE "D" INTO THE LAST SCREEN POSITION, AVOIDING SCROLLING.
1120 S = S + BANUS:BANUS = 0
1130 IF S < PEEK (789) + PEEK (790) * 256 THEN 1160: REM NEW SCORE LESS THAN HIGH SCORE
1140 POKE 790,S / 256: POKE 789,S - PEEK (790) * 256: REM POKE NEW HIGH SCORE INTO PLACE
1150 VTAB 21: HTAB 15: PRINT "FORMER"
1160 Z = PEEK ( - 16384): IF PEEK ( - 16287) > 127 THEN 1190
1170 GOSUB 20: IF Z < > 155 THEN 1160
1175 REM
1180 IF Z = 155 THEN 11000
1190 OQ = 500: GOTO 2520
1300 REM PRINT POINT SCALE
1310 SCOLE = 6 - LL
1320 CALL - 936: PRINT "POINTS PER BRICK -> 1 2 3 4 5 6 7 8"
1360 VTAB 24: CALL - 958: PRINT "SCORE= 0";
1370 IF PEEK (787) = 37 THEN IF PEEK (788) = 38 THEN 1390: REM IF "VARIABLE" ALREADY INITIALIZED, SKIP
1380 POKE 787,37: POKE 788,38: POKE 789,0: POKE 790,0: REM SET FLAGS AND INIT NON-CLEARING VARIABLE
1390 HTAB 22: PRINT "HIGH SCORE= "; PEEK (789) + PEEK (790) * 256;: HTAB 1: RETURN
1500 REM BONUS
1510 VTAB 22: POKE 50,63: IF L = 1 THEN PRINT " BONUS POINTS: "
1520 IF L > 1 THEN PRINT "BONUS POINTS FOR ";L;" BALLS LEFT: "
1530 VTAB 22: FOR Q = 1 TO 1800: NEXT Q
1540 FOR Q = 0 TO L * 50 STEP 5
1550 HTAB 32: PRINT Q;
1560 POKE 6,180: POKE 7,10: CALL 768
1570 POKE 6,200 * RND (1) + 50: POKE 7,10: CALL 768
1580 POKE 6,160 - Q / 10: POKE 7,12: CALL 768
1590 NEXT Q: POKE 50,255
1600 BANUS = Q - 5: VTAB 21: HTAB 1: PRINT "TOTAL=";
1610 FOR Q = 1 TO 500: NEXT Q
1620 FOR Q = S TO S + BANUS STEP 5
1630 HTAB 8: PRINT Q;
1640 POKE 6,150 - Q / 40: POKE 7,3: CALL 768
1650 POKE 6,140: POKE 7,2: CALL 768
1660 POKE 6,50: POKE 7,3: CALL 768
1680 FOR K = 1 TO 10 * RND (1) + 20: NEXT K
1690 NEXT Q: PRINT : RETURN
1900 FOR H = 1 TO 80:OD = PEEK ( - 16336): NEXT H: GOTO 2910
2000 REM *** START OF PROGRAM ***
2010 GOSUB 7000: REM POKE SOUND ROUTINE
2020 TEXT : CALL - 936: POKE - 16298,0
2090 IF PEEK ( - 16287) > 127 THEN IF PEEK ( - 16286) > 127 THEN GOSUB 8500
2100 REM ^IF BOTH PADDLE SWITCHES READ "ON", THEN PADDLES ARE NOT PLUGGED IN.
2110 VTAB 24
2140 Q = I = LL = J = P = OQ = X = Y = K = W = E = V = D = F = N = M = Z = S: REM SET UP VARIABLE TABLE FOR MAXIMUM SPEED
2145 GOSUB 2340
2150 PRINT "***************************************";: VTAB 1: HTAB 1: PRINT "***************************************"
2160 COLOR= 10: VLIN 1,46 AT 0: VLIN 0,47 AT 39: REM "DRAW" ASTERICKS (*) ALONG EDGES
2170 VTAB 3: PRINT "* BRICK OUT IS A DYNAMIC BOARD GAME": PRINT "* IN WHICH YOU ATTEMPT TO KNOCK DOWN"
2180 PRINT "* A WALL OF BRICKS WITH A BALL": PRINT "* STRUCK BY YOUR PADDLE.": PRINT : PRINT
2190 PRINT "* YOU CONTROL THE PADDLE ON THE BOARD": PRINT "* BY TURNING THE APPLE PADDLE (0).": PRINT : PRINT
2200 PRINT "* YOU MAY "; CHR$ (34);"PUT ENGLISH"; CHR$ (34);" ON THE BALL": PRINT "* (DEFLECT THE BALL) BY HITTING IT": PRINT "* WITH THE PADDLE HELD OFF-CENTER."
2210 PRINT : PRINT
2220 POKE - 16368,0
2240 PRINT "* BEFORE WE BEGIN, PLEASE TYPE": PRINT "* YOUR FIRST NAME AND THEN PRESS": PRINT "* THE KEY MARKED "; CHR$ (34);"RETURN"; CHR$ (34);
2250 POKE PEEK (40) + PEEK (41) * 256 + PEEK (36),96: REM CURSOR
2260 P = PEEK ( - 16384): IF P = 155 THEN 11000
2270 IF PEEK ( - 16287) > 127 THEN 2335
2280 IF P < 156 AND P < > 141 THEN 2260
2290 INPUT "";A$
2300 IF LEN (A$) = 0 THEN 2335
2310 FOR I = 1 TO LEN (A$): IF ASC ( MID$ (A$,I,I)) < > 64 THEN 2330
2320 NEXT I:I = I - 1
2330 A$ = MID$ (A$,I, LEN (A$)): IF LEN (A$) THEN IF LEN (A$) > 12 THEN A$ = LEFT$ (A$,12)
2335 GOTO 2490
2340 CALL - 936: VTAB 5: PRINT "========================================";: INVERSE : PRINT " L I T T L E B R I C K O U T ";: NORMAL : PRINT "========================================"
2350 VTAB 12: PRINT " COPYRIGHT 1979 APPLE COMPUTER INC"
2410 VTAB 20
2420 PRINT : PRINT "(PRESSING THE ESC KEY WILL END THE GAME)"
2450 VTAB 23: PRINT "PRESS THE SPACE BAR TO BEGIN....";: POKE PEEK (40) + PEEK (41) * 256 + PEEK (36),96: POKE - 16368,0
2460 P = PEEK ( - 16384): IF PEEK ( - 16287) > 127 THEN 2480
2470 IF P < > 160 AND P < > 155 THEN 2460
2480 POKE - 16368,0: IF P = 155 THEN 11000
2485 HOME : VTAB 24: HTAB 1: RETURN
2490 CALL - 936
2500 GR :A = 2:B = 12:C = 9:D = 13:E = 2:F = 15: REM COLORS
2510 LL = 5:P = 15
2520 GOSUB 355
2580 OOLDP1 = PDL (1)
2860 GOSUB 1300
2870 S = 0:Y = 19:L = 6
2880 VTAB 23: POKE 50,63: PRINT " PUSH PADDLE BUTTON TO BEGIN THE GAME ";: POKE 50,255
2890 FOR K = 1 TO 20: NEXT K: REM ALLOW TIME FOR USER TO RELEASE BUTTON FROM LAST PUSH
2900 GOSUB 20
2904 P1 = PDL (1): IF ( ABS (OOLDP1 - P1) > 3 OR PEEK ( - 16286) > 127) AND NOT ERASE THEN GOSUB 4810
2905 OOLDP1 = P1: REM WRONG PADDLE
2906 IF ERASE THEN ERASE = ERASE - 1
2907 IF ERASE = 1 THEN GOSUB 4800
2909 IF PEEK ( - 16287) < 128 AND PEEK ( - 16384) < > 155 THEN 2900
2910 VTAB 23: CALL - 868
2920 COLOR= A: PLOT X,Y / 3:Y = 120 * RND (1)
2930 X = 19
2940 V = - 1:W = 5 * RND (1) - 2:L = L - 1: IF L < 1 THEN 800
2947 IF LEN (A$) THEN IF L > 1 THEN PRINT A$", ";
2950 IF L > 1 THEN PRINT "THIS IS BALL ";6 - L;" OUT OF 5."
2970 IF PEEK ( - 16384) = 155 THEN 11000
2980 IF L < > 1 THEN 3010
2990 POKE 50,63: PRINT "THIS IS THE LAST BALL";
3000 POKE 50,255: VTAB 23: PRINT
3010 FOR I = 1 TO 25 + 125 * RND (1): GOSUB 20: NEXT I:M = 1:N = 0
3020 GOTO 80
4800 VTAB 23: HTAB 1: CALL - 868: POKE 50,63: PRINT " PUSH PADDLE BUTTON TO BEGIN THE GAME ";: POKE 50,255:OQ = 500: RETURN
4810 VTAB 23: HTAB 1: CALL - 868: PRINT " <<< PLEASE USE THE OTHER PADDLE. >>> ";
4820 POKE 6,40: POKE 7,30: CALL 768
4830 ERASE = 20: RETURN
7000 REM SOUND ROUTINE
7010 POKE 768,173: POKE 769,48: POKE 770,192: POKE 771,136: POKE 772,208: POKE 773,4: POKE 774,198: POKE 775,7: POKE 776,240: POKE 777,8:
7020 POKE 778,202: POKE 779,208: POKE 780,246: POKE 781,166: POKE 782,6: POKE 783,76: POKE 784,0: POKE 785,3: POKE 786,96
7030 RETURN
8500 REM PADDLES NOT PLUGGED IN
8510 VTAB 10: PRINT "BRICK OUT REQUIRES THE USE OF THE APPLE"
8520 PRINT "PADDLE SET. PLEASE PLUG IN THE PADDLE"
8530 PRINT "SET AND THEN PRESS THE SPACE BAR."
8540 PRINT : PRINT "IF YOU DO NOT HAVE PADDLES, YOU MAY"
8550 PRINT "EXIT THE GAME BY PRESSING THE ESC KEY."
8560 P = PEEK ( - 16384): IF P < 155 THEN 8560
8570 POKE - 16368,0: IF P < > 155 THEN 8580: GOTO 11000
8580 IF PEEK ( - 16287) > 127 AND PEEK ( - 16286) > 127 THEN 8560
8590 IF P < > 160 THEN 8560
8600 CALL - 936: TEXT : RETURN : REM PADDLES ARE IN AND SPACE BAR HAS BEEN PRESSED.
11000 REM "ESC" KEY HAS BEEN PRESSED
11010 POKE - 16368,0: CALL - 936: IF PEEK (34) = 0 THEN VTAB 10
11015 PRINT "WOULD YOU LIKE TO CONTINUE"
11020 PRINT "PLAYING? ";:VTB = PEEK (37):TB = PEEK (36)
11030 PRINT : PRINT : PRINT "(TYPE YES OR NO AND PRESS RETURN)";
11040 VTAB VTB + 2: CALL - 868: VTAB VTB + 1: POKE 36,TB: CALL - 868: INPUT "";H$
11050 IF LEFT$ (H$,1) < > "Y" THEN 11060
11055 H$ = "":P = 15:OQ = 500: GOTO 2490
11060 IF LEFT$ (H$,1) < > "N" THEN 11040
11070 VTAB (VTB): CALL - 868: VTAB (VTB + 1): PRINT "WOULD SOMEONE ELSE LIKE TO PLAY? ";:VTB = PEEK (37):TB = PEEK (36)
11080 VTAB 23: CALL - 868: VTAB VTB + 1: POKE 36,TB: CALL - 868: INPUT "";H$
11090 IF LEFT$ (H$,1) = "Y" THEN 2020
11100 IF LEFT$ (H$,1) < > "N" THEN 11080
11110 GOTO 31111
31111 POKE - 16368,0: TEXT : CALL - 936: TEXT : END
55000 IF INT (39 - PDL (0) / 6) > 34 THEN P = 34

cybernesto

unread,
Apr 29, 2017, 2:23:43 AM4/29/17
to
Or you could have just clicked the big "Spyglass" icon and use a very slick function of Mac GUI that allows to examine the contents of disk images without even downloading them.
http://macgui.com/spyglass/r/fef29f438feadbf7/LITTLEBRICKOUT?f=bWt3cGljB2p7Y2hnDWF6ZA&fk=7981ee03de

James Davis

unread,
Apr 29, 2017, 3:18:23 PM4/29/17
to
Hi All,

There are four different versions of Little/Brick Out on the disk images in:

ftp://public.asimov.net/pub/apple_II/images/masters/apple_dos_all_versions.zip

Two in Integer BASIC and two in Applesoft BASIC. But, the differences are minor.

James Davis
0 new messages