Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serhii Bykov: Programming for 1980's computers ...

Serhii Bykov: Programming for 1980's computers in 2020

MacPaw Tech Talks

November 26, 2020

Transcript

97 slides
  1. Website and TV show comparison Apple //e application wanna-be (Mr.

    Robot S4E11) Web-version of application (http://whoismrrobot.com/exit/) 9
  2. Apple //e boot and TV show comparison Apple //e application

    wanna-be (Mr. Robot S4E11) Apple //e boot sequence video from user `Neon Onion` (https://www.youtube.com/watch?v=R7FAveqrhjs) 10
  3. Emulators • microM8 • Apple ][js • Virtual ][ •

    Octalyzer • Sweet16 • KEGS • JACE • OpenEmulator 14
  4. Emulators • microM8 • Apple ][js • Virtual ][ •

    Octalyzer • Sweet16 • KEGS • JACE • OpenEmulator 15
  5. microM8 • Free • Cross-platform • Custom shell over emulation

    w/ internet bridge (useful for development) • Multiple devices for emulation (Apple ][, Apple ][+, Apple //e) • A lot of demo apps 16
  6. Actual list of programming languages • Applesoft Basic, Apple Integer

    Basic, MD Basic • Apple Fortran • Apple Pascal, UCSD Pascal, Orca (ByteWorks) Pascal, Kyan Pascal • Aztec C, Orca/C • ASM • Terrapin Logo, Apple Logo 25
  7. Built-in programming languages • Applesoft Basic, Apple Integer Basic, MD

    Basic • Apple Fortran • Apple Pascal, UCSD Pascal, Orca (ByteWorks) Pascal, Kyan Pascal • Aztec C, Orca/C • ASM • Terrapin Logo, Apple Logo 26
  8. 34

  9. Working with conditions 41 10 INPUT A$ 20 IF A$

    = "TRUE" THEN GOTO 30 21 IF A$ >< "TRUE" THEN GOTO 40 30 PRINT "A IS `TRUE`" : GOTO 50 40 PRINT "A IS NOT `TRUE`" 50 PRINT "FINISH"
  10. Sleep function 44 1010 POKE 768,169: POKE 770,76 1020 POKE

    771,168: POKE 772,252 1025 LET A = 256 1040 IF A < 1 OR A > 256 THEN 30 1050 POKE 769,(A < 256) * A 1060 LET C = (26 + 27 * A + 5 * A ^ 2) / 2 1095 CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: 1096 CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: CALL 768: 1100 RETURN
  11. Sample Code 340 HOME:HGR:D$=CHR$(4):PRINT D$;"BLOAD img6.HGR” 350 VTAB 21:PRINT "In

    the water you see a boat. What do you do?":INPUT "> “;A$ 360 IF A$ = "Get on the boat" THEN GOTO 390 370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here" 375 GOSUB 1000 380 GOTO 340 45
  12. Sample Code - Splitted 340 HOME:HGR:D$=CHR$(4):PRINT D$;"BLOAD img6.HGR” 350 VTAB

    21:PRINT "In the water you see a boat. What do you do?":INPUT "> “;A$ 360 IF A$ = "Get on the boat" THEN GOTO 390 370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here" 375 GOSUB 1000 380 GOTO 340 46
  13. Loading Image 340 HOME:HGR:D$=CHR$(4):PRINT D$;"BLOAD img6.HGR" • HOME - clears

    the text screen • HGR - clears the HGR page • Image loading magic 47
  14. Printing message and asking for input 350 VTAB 21:PRINT "In

    the water you see a boat. What do you do?":INPUT "> ";A$ • VTAB 21 - put text on 21 row • PRINT - text • INPUT - write input to variable $A 48
  15. Handling input • Condition on variable `A` • If condition

    is true • Perform GOTO (to next question) 49 360 IF A$ = "Get on the boat" THEN GOTO 390 370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here" 375 GOSUB 1000 380 GOTO 340
  16. Handling input 360 IF A$ = "Get on the boat"

    THEN GOTO 390 370 PRINT "" : PRINT "> ";A$;"" : PRINT "You can't do that here" 375 GOSUB 1000 380 GOTO 340 • Condition on variable `A` • If condition is false • Perform print operations • GOSUB - go subroutine on row 1000 (sleep function) • GOTO - go to row 340 (ask question again) 50
  17. AppleCommander - Used Commands 54 ➜ ~ applecommander --help AppleCommander

    command line options [1.6.0]: -p <imagename> <filename> <type> [[$|0x]<addr>] put stdin -n <imagename> <volname> change volume name (ProDOS or Pascal). -pro140 <imagename> <volname> create a 140K ProDOS image. -bas <imagename> <filename> import an AppleSoft basic file from text back to its tokenized format.
  18. Build script cp ${empty_disk_path} ${result_disk_path} applecommander -n ${result_disk_path} "eXit" src=("STARTUP"

    "SPLASH" "EXIT") for i in "${src[@]}" do cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i} done images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8") for i in "${images[@]}" do ${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr rm ${images_path}/${i}_280x192_hgr.png applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR; rm -rf ${images_path}/${i}.hgr done 55
  19. Build script cp ${empty_disk_path} ${result_disk_path} applecommander -n ${result_disk_path} "eXit" src=("STARTUP"

    "SPLASH" "EXIT") for i in "${src[@]}" do cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i} done images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8") for i in "${images[@]}" do ${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr rm ${images_path}/${i}_280x192_hgr.png applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR; rm -rf ${images_path}/${i}.hgr done 56
  20. Build script cp ${empty_disk_path} ${result_disk_path} applecommander -n ${result_disk_path} "eXit" src=("STARTUP"

    "SPLASH" "EXIT") for i in "${src[@]}" do cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i} done images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8") for i in "${images[@]}" do ${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr rm ${images_path}/${i}_280x192_hgr.png applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR; rm -rf ${images_path}/${i}.hgr done 57
  21. Build script cp ${empty_disk_path} ${result_disk_path} applecommander -n ${result_disk_path} "eXit" src=("STARTUP"

    "SPLASH" "EXIT") for i in "${src[@]}" do cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i} done images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8") for i in "${images[@]}" do ${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr rm ${images_path}/${i}_280x192_hgr.png applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR; rm -rf ${images_path}/${i}.hgr done 58
  22. Build script cp ${empty_disk_path} ${result_disk_path} applecommander -n ${result_disk_path} "eXit" src=("STARTUP"

    "SPLASH" "EXIT") for i in "${src[@]}" do cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i} done images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8") for i in "${images[@]}" do ${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr rm ${images_path}/${i}_280x192_hgr.png applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR; rm -rf ${images_path}/${i}.hgr done 59
  23. Build script cp ${empty_disk_path} ${result_disk_path} applecommander -n ${result_disk_path} "eXit" src=("STARTUP"

    "SPLASH" "EXIT") for i in "${src[@]}" do cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i} done images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8") for i in "${images[@]}" do ${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr rm ${images_path}/${i}_280x192_hgr.png applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR; rm -rf ${images_path}/${i}.hgr done 60
  24. Build script cp ${empty_disk_path} ${result_disk_path} applecommander -n ${result_disk_path} "eXit" src=("STARTUP"

    "SPLASH" "EXIT") for i in "${src[@]}" do cat ${src_path}/${i}.bas | applecommander -bas ${result_disk_path} ${i} done images=("img0" "img1" "img2" "img3" "img4" "img5" "img6" "img7" "img8") for i in "${images[@]}" do ${bin_path}/tohgr ${images_path}/${i}_280x192.png &>/dev/null mv ${images_path}/${i}_280x192.hgr ${images_path}/${i}.hgr rm ${images_path}/${i}_280x192_hgr.png applecommander -p ${result_disk_path} ${i}.HGR BIN 0x2000 < ${images_path}/${i}.HGR; rm -rf ${images_path}/${i}.hgr done 61
  25. Apple //e • Pros • Exact machine as used in

    TV series • Working machine in our museum • Cons • No internal floppy drive (cannot run program without floppy drive) 64
  26. Apple III • Pros • Working machine available in museum

    (oldest device in our museum - 1980) • Floppy drive • Cons • Not same machine as used in Mr. Robot 66
  27. Apple III - Expectations • New hardware - 2x performance

    • New OS • Backward compatibility 80
  28. Randy Wigginton, Apple Computer #6 employee “The Apple III was

    kind of like a baby conceived during a group orgy, and [later] everybody had this bad headache and there's this bastard child, and everyone says, ‘It's not mine.’” 82

More Decks by MacPaw Tech Talks

Other Decks in Programming