Apple 1 "a try of Emulator" in AppleSoft Basic for the Apple II

8 posts / 0 new
Last post
Toolkitman's picture
Offline
Last seen: 10 months 5 days ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Apple 1 "a try of Emulator" in AppleSoft Basic for the Apple II

This week i was sick and i dont know what to do still in Retrochallenge 2017/10 competition having completed my Papercard G4 Cube with Raspberry pi B3 and an OS similar to Tiger, i decided to try to make an Apple 1 "emulator" in AppleSot BASIC for the APPLE II.
This is the code i have putted down, can be someone of you can give a try and make something better than me with this starting code, it runs a similar text Monitor of Apple 1.

10 FLASH
20 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
30 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
40 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
50 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
60 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
70 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
80 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
90 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
100 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
110 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
120 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
130 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
140 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
150 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
160 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
170 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
180 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
190 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
200 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
210 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
220 PRINT "@; @; @; @; @; @; @; @; @; @; @; @;":INPUT A$
230 IF A$ = "R" THEN GOTO 235
235 NORMAL
240 PRINT "@ . . . . . . . . . . . . . . . . . . ."
250 PRINT ". . . . . . . . . . . . . . . . . . . ."
260 PRINT ". . . . . . . . . . . . . . . . . . . ."
270 PRINT ". . . . . . . . . . . . . . . . . . . ."
280 PRINT ". . . . . . . . . . . . . . . . . . . ."
290 PRINT ". . . . . . . . . . . . . . . . . . . ."
300 PRINT ". . . . . . . . . . . . . . . . . . . ."
310 PRINT ". . . . . . . . . . . . . . . . . . . ."
320 PRINT ". . . . . . . . . . . . . . . . . . . ."
330 PRINT ". . . . . . . . . . . . . . . . . . . ."
340 PRINT ". . . . . . . . . . . . . . . . . . . ."
350 PRINT ". . . . . . . . . . . . . . . . . . . ."
360 PRINT ". . . . . . . . . . . . . . . . . . . ."
370 PRINT ". . . . . . . . . . . . . . . . . . . ."
380 PRINT ". . . . . . . . . . . . . . . . . . . ."
390 PRINT ". . . . . . . . . . . . . . . . . . . ."
400 PRINT ". . . . . . . . . . . . . . . . . . . ."
410 PRINT ". . . . . . . . . . . . . . . . . . . ."
420 PRINT ". . . . . . . . . . . . . . . . . . . ."
430 PRINT ". . . . . . . . . . . . . . . . . . . ."
440 PRINT ". . . . . . . . . . . . . . . . . . . ."
450 PRINT ". . . . . . . . . . . . . . . . . ." :INPUT B$
460 IF B$ ="*" THEN GOTO 470
470 PRINT "\"
480 PRINT "@":INPUT C$
490 IF C$ = "0:A9 0 AA 20 EF FF E8 8A 4C 2 0" THEN GOTO 500
492 HOME
493 SPEED = 150
500 PRINT "1234567890ABCDEFGHILMNOPQRSTYUVWZ!%&*_+"
510 GOTO 500

mmphosis's picture
Offline
Last seen: 1 month 2 days ago
Joined: Aug 18 2005 - 16:26
Posts: 442
Re: Apple 1 "a try of Emulator" in AppleSoft Basic for the ...

I would call that a simulator. The code looks like it simulates a bit of the classic feel of the Apple-1. Kudos for writing it in Applesoft.

Here is "Apple-1 for Apple II" written in assembler...

http://hoop-la.ca/apple1/

Here is "The Brain Board" hardware...

http://www.willegal.net/appleii/brainboard.htm

Toolkitman's picture
Offline
Last seen: 10 months 5 days ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Re: Apple 1 "a try of Emulator" in AppleSoft Basic for the ...

Thank you for your explanation mmphosis, here you can find the simulator running in mame for real APPLE 1 SIMULATOR CLICK HERE!

Toolkitman's picture
Offline
Last seen: 10 months 5 days ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Re: Apple 1 "a try of Emulator" in AppleSoft Basic for the ...

I have checked again the code and also with my flu i have found the bug! now it works like expected. Enjoy it here!

CLICK HERE TO TRY APPLE 1 SIMULATOR BY TOOLKITMAN!

Toolkitman's picture
Offline
Last seen: 10 months 5 days ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Re: Apple 1 "a try of Emulator" in AppleSoft Basic for the ...

Here the corrected and implemented code:

10 FLASH
20 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
30 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
40 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
50 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
60 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
70 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
80 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
90 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
100 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
110 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
120 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
130 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
140 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
150 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
160 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
170 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
180 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
190 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
200 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
210 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
220 PRINT "@; @; @; @; @; @; @; @; @; @; @; @;"
221 INPUT A$
230 IF A$ = "R" THEN GOTO 235
232 IF A$ < > "R" THEN GOTO 221
235 NORMAL
240 PRINT "@ . . . . . . . . . . . . . . . . . . ."
250 PRINT ". . . . . . . . . . . . . . . . . . . ."
260 PRINT ". . . . . . . . . . . . . . . . . . . ."
270 PRINT ". . . . . . . . . . . . . . . . . . . ."
280 PRINT ". . . . . . . . . . . . . . . . . . . ."
290 PRINT ". . . . . . . . . . . . . . . . . . . ."
300 PRINT ". . . . . . . . . . . . . . . . . . . ."
310 PRINT ". . . . . . . . . . . . . . . . . . . ."
320 PRINT ". . . . . . . . . . . . . . . . . . . ."
330 PRINT ". . . . . . . . . . . . . . . . . . . ."
340 PRINT ". . . . . . . . . . . . . . . . . . . ."
350 PRINT ". . . . . . . . . . . . . . . . . . . ."
360 PRINT ". . . . . . . . . . . . . . . . . . . ."
370 PRINT ". . . . . . . . . . . . . . . . . . . ."
380 PRINT ". . . . . . . . . . . . . . . . . . . ."
390 PRINT ". . . . . . . . . . . . . . . . . . . ."
400 PRINT ". . . . . . . . . . . . . . . . . . . ."
410 PRINT ". . . . . . . . . . . . . . . . . . . ."
420 PRINT ". . . . . . . . . . . . . . . . . . . ."
430 PRINT ". . . . . . . . . . . . . . . . . . . ."
440 PRINT ". . . . . . . . . . . . . . . . . . . ."
450 PRINT ". . . . . . . . . . . . . . . . . ."
452 INPUT B$
460 IF B$ ="*" THEN GOTO 470
462 IF B$ < > "*" THEN GOTO 452
470 PRINT "\"
480 PRINT "@"
482 INPUT C$
490 IF C$ = "0 A9 0 AA 20 EF FF E8 8A 4C 2 0" THEN GOTO 500
492 IF C$ < > "0 A9 0 AA 20 EF FF E8 8A 4C 2 0" THEN GOTO 482
493 IF C$ = "0 300R" THEN GOTO 520
494 IF C$ < > "0 300R" THEN GOTO 482
498 HOME
499 SPEED = 150
500 PRINT "1234567890ABCDEFGHILMNOPQRSTYUVWZ!%&*_+"
510 GOTO 500
520 END

Toolkitman's picture
Offline
Last seen: 10 months 5 days ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Re: Apple 1 "a try of Emulator" in AppleSoft Basic for the ...

I have added one program and one game in the Apple 1 OS, one Simple Calculator and SHALL WE PLAY A GAME? made by me.
with 0 300 R you can write your own sentences, with 0 500 R you can run a Simple Calculator, with 0 700 R you can run SHALL WE PLAY A GAME mini game.With 0 A9 0 AA 20 EF FF E8 8A 4C 2 0 you run the text monitor remember to press RETURN.

Here is the code:

10 FLASH
20 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
30 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
40 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
50 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
60 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
70 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
80 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
90 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
100 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
110 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
120 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
130 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
140 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
150 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
160 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
170 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
180 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
190 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
200 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
210 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
220 PRINT "@; @; @; @; @; @; @; @; @; @; @; @;"
221 INPUT A$
230 IF A$ = "R" THEN GOTO 235
232 IF A$ < > "R" THEN GOTO 221
235 NORMAL
240 PRINT "@ . . . . . . . . . . . . . . . . . . ."
250 PRINT ". . . . . . . . . . . . . . . . . . . ."
260 PRINT ". . . . . . . . . . . . . . . . . . . ."
270 PRINT ". . . . . . . . . . . . . . . . . . . ."
280 PRINT ". . . . . . . . . . . . . . . . . . . ."
290 PRINT ". . . . . . . . . . . . . . . . . . . ."
300 PRINT ". . . . . . . . . . . . . . . . . . . ."
310 PRINT ". . . . . . . . . . . . . . . . . . . ."
320 PRINT ". . . . . . . . . . . . . . . . . . . ."
330 PRINT ". . . . . . . . . . . . . . . . . . . ."
340 PRINT ". . . . . . . . . . . . . . . . . . . ."
350 PRINT ". . . . . . . . . . . . . . . . . . . ."
360 PRINT ". . . . . . . . . . . . . . . . . . . ."
370 PRINT ". . . . . . . . . . . . . . . . . . . ."
380 PRINT ". . . . . . . . . . . . . . . . . . . ."
390 PRINT ". . . . . . . . . . . . . . . . . . . ."
400 PRINT ". . . . . . . . . . . . . . . . . . . ."
410 PRINT ". . . . . . . . . . . . . . . . . . . ."
420 PRINT ". . . . . . . . . . . . . . . . . . . ."
430 PRINT ". . . . . . . . . . . . . . . . . . . ."
440 PRINT ". . . . . . . . . . . . . . . . . . . ."
450 PRINT ". . . . . . . . . . . . . . . . . ."
452 INPUT B$
460 IF B$ ="*" THEN GOTO 470
462 IF B$ < > "*" THEN GOTO 452
470 PRINT "\"
480 PRINT "@"
482 INPUT C$
490 IF C$ = "0 A9 0 AA 20 EF FF E8 8A 4C 2 0" THEN GOTO 1020
492 IF C$ = "0 300 R" THEN GOTO 482
494 IF C$ = "0 500 R" THEN GOTO 530
495 IF C$ = "0 700 R" THEN GOTO 910
496 IF C$ < > "0 A9 0 AA 20 EF FF E8 8A 4C 2 0" THEN GOTO 482
498 IF C$ < > "0 300 R" THEN GOTO 482
500 IF C$ < > "0 500 R" THEN GOTO 482
510 IF C$ < > "0 700 R" THEN GOTO 482
530 PRINT "APPLE II TRADITIONAL CALCULATOR BY MATTEO TREVISAN"
540 PRINT " "
550 PRINT " "
560 PRINT "NUMBER ONE": INPUT A
570 PRINT " "
580 PRINT " +"
590 PRINT " -"
600 PRINT " *"
610 PRINT " /"
620 INPUT A$
630 IF A$ = "+" THEN GOTO 670
640 IF A$ = "-" THEN GOTO 730
650 IF A$ = "*" THEN GOTO 790
660 IF A$ = "/" THEN GOTO 850
670 PRINT " +": INPUT B
680 C = A+B
690 PRINT " ="; C
700 FOR K = 1 TO 5000
710 NEXT K
720 GOTO 482
730 PRINT " -": INPUT E
740 F = A-E
750 PRINT " ="; F
760 FOR K = 1 TO 5000
770 NEXT K
780 GOTO 482
790 PRINT " *": INPUT G
800 H = A*G
810 PRINT " ="; H
820 FOR K = 1 TO 5000
830 NEXT K
840 GOTO 482
850 PRINT " /": INPUT I
860 L = A/I
870 PRINT " ="; L
880 FOR K = 1 TO 5000
890 NEXT K
900 GOTO 482
910 INPUT "SHALL WE PLAY A GAME: ";F$
920 IF F$ = "YES" THEN 950
930 PRINT "OK BYE BYE"
940 END
950 INPUT "YOUR NUMBER: ";A
960 B = INT (99 * RND (1) + 1)
970 HTAB 15: PRINT "YOUR NUMBER IS:"; A
980 HTAB 11: PRINT "COMPUTER NUMBER IS:";B
990 IF A = B THEN PRINT "YOU WIN!!!!!"
1000 IF A < > B THEN PRINT "YOU LOSE"
1010 GOTO 482
1020 HOME
1030 SPEED = 150
1040 PRINT "1234567890ABCDEFGHILMNOPQRSTYUVWZ!%&*_+"
1050 GOTO 1040

APPLE 1 FOR APPLE 2 SIMULATOR RUNNING IN MAME CLICK HERE!

Toolkitman's picture
Offline
Last seen: 10 months 5 days ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Re: Apple 1 "a try of Emulator" in AppleSoft Basic for the ...

I have correct the prompt screen to be responsive as in an Apple 1 at start.
look at the emulated software:

APPLE 1 SIMULATOR CLICK HERE

here the code:

10 FLASH
20 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
30 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
40 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
50 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
60 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
70 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
80 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
90 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
100 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
110 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
120 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
130 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
140 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
150 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
160 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
170 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
180 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
190 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
200 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
210 PRINT "@; @; @; @; @; @; @; @; @; @; @; @; @; "
220 PRINT "@; @; @; @; @; @; @; @; @; @; @; @;"
221 INPUT A$
230 IF A$ = "R" THEN GOTO 235
232 IF A$ < > "R" THEN GOTO 221
235 NORMAL
240 PRINT "@ . . . . . . . . . . . . . . . . . . ."
250 PRINT ". . . . . . . . . . . . . . . . . . . ."
260 PRINT ". . . . . . . . . . . . . . . . . . . ."
270 PRINT ". . . . . . . . . . . . . . . . . . . ."
280 PRINT ". . . . . . . . . . . . . . . . . . . ."
290 PRINT ". . . . . . . . . . . . . . . . . . . ."
300 PRINT ". . . . . . . . . . . . . . . . . . . ."
310 PRINT ". . . . . . . . . . . . . . . . . . . ."
320 PRINT ". . . . . . . . . . . . . . . . . . . ."
330 PRINT ". . . . . . . . . . . . . . . . . . . ."
340 PRINT ". . . . . . . . . . . . . . . . . . . ."
350 PRINT ". . . . . . . . . . . . . . . . . . . ."
360 PRINT ". . . . . . . . . . . . . . . . . . . ."
370 PRINT ". . . . . . . . . . . . . . . . . . . ."
380 PRINT ". . . . . . . . . . . . . . . . . . . ."
390 PRINT ". . . . . . . . . . . . . . . . . . . ."
400 PRINT ". . . . . . . . . . . . . . . . . . . ."
410 PRINT ". . . . . . . . . . . . . . . . . . . ."
420 PRINT ". . . . . . . . . . . . . . . . . . . ."
430 PRINT ". . . . . . . . . . . . . . . . . . . ."
440 PRINT ". . . . . . . . . . . . . . . . . . . ."
450 PRINT ". . . . . . . . . . . . . . . . . ."
452 INPUT B$
460 IF B$ ="*" THEN GOTO 463
462 IF B$ < > "*" THEN GOTO 452
463 HOME
470 PRINT "\"
480 PRINT "@"
482 INPUT C$
490 IF C$ = "0 A9 0 AA 20 EF FF E8 8A 4C 2 0" THEN GOTO 1020
492 IF C$ = "0 300 R" THEN GOTO 482
494 IF C$ = "0 500 R" THEN GOTO 530
495 IF C$ = "0 700 R" THEN GOTO 910
496 IF C$ < > "0 A9 0 AA 20 EF FF E8 8A 4C 2 0" THEN GOTO 482
498 IF C$ < > "0 300 R" THEN GOTO 482
500 IF C$ < > "0 500 R" THEN GOTO 482
510 IF C$ < > "0 700 R" THEN GOTO 482
530 PRINT "APPLE II TRADITIONAL CALCULATOR BY MATTEO TREVISAN"
540 PRINT " "
550 PRINT " "
560 PRINT "NUMBER ONE": INPUT A
570 PRINT " "
580 PRINT " +"
590 PRINT " -"
600 PRINT " *"
610 PRINT " /"
620 INPUT A$
630 IF A$ = "+" THEN GOTO 670
640 IF A$ = "-" THEN GOTO 730
650 IF A$ = "*" THEN GOTO 790
660 IF A$ = "/" THEN GOTO 850
670 PRINT " +": INPUT B
680 C = A+B
690 PRINT " ="; C
700 FOR K = 1 TO 5000
710 NEXT K
720 GOTO 482
730 PRINT " -": INPUT E
740 F = A-E
750 PRINT " ="; F
760 FOR K = 1 TO 5000
770 NEXT K
780 GOTO 482
790 PRINT " *": INPUT G
800 H = A*G
810 PRINT " ="; H
820 FOR K = 1 TO 5000
830 NEXT K
840 GOTO 482
850 PRINT " /": INPUT I
860 L = A/I
870 PRINT " ="; L
880 FOR K = 1 TO 5000
890 NEXT K
900 GOTO 482
910 INPUT "SHALL WE PLAY A GAME: ";F$
920 IF F$ = "YES" THEN 950
930 PRINT "OK BYE BYE"
940 END
950 INPUT "YOUR NUMBER: ";A
960 B = INT (99 * RND (1) + 1)
970 HTAB 15: PRINT "YOUR NUMBER IS:"; A
980 HTAB 11: PRINT "COMPUTER NUMBER IS:";B
990 IF A = B THEN PRINT "YOU WIN!!!!!"
1000 IF A < > B THEN PRINT "YOU LOSE"
1010 GOTO 482
1020 HOME
1030 SPEED = 150
1040 PRINT "1234567890ABCDEFGHILMNOPQRSTYUVWZ!%&*_+"
1050 GOTO 1040

Toolkitman's picture
Offline
Last seen: 10 months 5 days ago
Joined: Nov 21 2010 - 15:30
Posts: 249
Re: Apple 1 "a try of Emulator" in AppleSoft Basic for the ...

I have made a porting of rock paper scissors from Apple 1 to Apple ii and added the code to the Apple 1 simulator to show you the possibility to add more programs or games at your choose by coding, you can call it by pressing 0 900 R return in the Apple 1 simulator prompt, you can play it here:

APPLE 1 SIMULATOR CLICK HERE

Log in or register to post comments