Download Green Delicious User Guide
Transcript
GREEN DELICIOUS APPLE-1 EMULATOR Apple-1 on display at the Smithsonian by Ed Uthman / CC Green Delicious is an Apple-1 emulator that runs on Commodore 64. It emulates the 40x24 monochrome display, 7x8 character cells (280x192 pixels), pixelperfect Signetics 2513 character generator, instant 50/60 Hz hardware scrolling and an ASCII keyboard. It mimics somewhat sufficiently the PIA interface chip functions and it's almost as fast as the original. Apple-1 was introduced the year I was born. This emulator was programmed 37 years later on a Mac. Quick Start Run the emulator and type ‘F000R’. This executes the program at $F000, which displays a little help text I included there for you. Apple-1 is a simple 6502-based computer with keyboard input and slooow text output (yes, approximately one character per frame) and uppercase characters only. There is no backspace and it’s not possible to move the cursor back or up. And no sound, which is great! ‘F800R’ starts C’mon monitor, a machine code monitor I originally wrote for VIC 20 in 2001. With just a few modifications it worked fine on Apple-1 too. BASIC programs are started by typing ‘E2B3R’ and then ‘RUN’. Emulator Keys F1 Clear the screen and return cursor to top-left corner—on Apple-1 this is a hardware key and you can’t do the same in software. Printing 24 carriage returns effectively clears the screen, but the cursor remains at the bottom row F3 Cycle the display text color through a carefully crafted palette of historically relevant greens, grays, yellow and amber F5 Switch cursor type between the colorful apple sprite and the standard ‘@’—It does look a bit like an apple as well, doesn’t it? F7 Apple-1 reset: Jumps to ‘Woz Monitor’ at $FF00 and prompts a ‘\’. Hold down F7 for a second to freeze the Apple-1 and enter disk options menu Woz Monitor Apple-1 ROM is a tiny 256-byte program, ‘Woz Monitor’, that allows inspecting memory, writing in hex values and executing programs, and not much else. Though minimal, it’s much less user-hostile than the physical LED-and-switch user interfaces of the time. View memory: 0300 (Just type the address) Hex dump: 0300.03FF Write bytes to memory: 0300:10 12 1A 13 1B … Run program: 0300R C’mon Monitor Type ‘F800R’ in Woz Monitor to launch C’mon. Assemble: A 0300 LDA #$10 (Enter a blank line to stop) Write bytes to memory: W 0300 10 20 30 … Disassemble: D 0300 D (continue) Execute program: G 0300 Hex dump: H 0300 H Text dump: T 0300 T View 6510 registers: R Memory Map & Useful ROM Calls $0000-$0FFF $1000-$3FFF $4000-$903F $C000-$C1FF $D010-$D013 $E000-$EFFF $F000-$F3FF $F800-$FEFF $FF00-$FFFF 4K Low RAM Extended 12K RAM (Non-standard) Green Delicious Tape interface (Not implemented, at least not yet) PIA chip registers 4K High RAM (Integer BASIC is loaded here) Help text C’mon monitor Apple-1 ROM (‘Woz Monitor’) JSR $FFEF JSR $FFDC Output an ASCII character Output a byte in hex Compatibility All Integer BASIC programs should work fine. Most machine code programs should run fine too, although there’s a few points to note. Low RAM at $0002-$0FFF, High RAM at $E000-$EFFF and also Extended RAM at $1000-$3FFF are available. Zeropage locations $00 and $01 cannot be used, because 6510 reserves them for memory configuration and I/O. If your Apple-1 program uses these two locations you have to patch it manually. Tough luck! PIA chip reads and writes must be patched too, but this is done automatically when loading a new program: LDA $D010 -> JSR $8010 (Keyboard input: Reading this also clears bit 7 of $D011) STA $D012 -> JSR $9012 (ASCII output: Writing to the register sets bit 7 of $D012) Also: LDX LDY STX STY $D010 $D010 $D012 $D012 -> -> -> -> JSR JSR JSR JSR $8020 $8030 $9022 $9032 Read keyboard example (returns ASCII value of key + 128): .1 LDA $D011 ; Bit 7 is set when there's a new keypress BPL .1 LDA $D010 ; This becomes JSR $8010 ASCII output example (same as Apple-1 ROM at $FFEF): .1 BIT $D012 ; Bit 7 is cleared when the video terminal is ready to take a new character BMI .1 STA $D012 ; This becomes JSR $9012 Actually, $D012 writes don’t need to be patched if the high bit is always set. But some programs—like the Integer BASIC—occasionally write to $D012 with bit 7 cleared. Memory location $8C00 holds the number of patches done. Patched addresses are stored at $8C02-$8CFF. Type ‘8C00’ or ‘8C00.8CFF’ in Woz Monitor to view this information. If you have typed in a program in the emulator and need to apply the automatic patches there, just type ‘8006R’. This handles the memory areas $0000-$3FFF and $E000-$EFFF. When writing new Apple-1 programs, do not call the patched routines directly. Let Green Delicious do the job for you, and you will have a binary that is compatible with the real thing. If required, you can also skip the automatic PIA patching after loading a file. To do this press Shift+Return in the disk menu (instead of Return). Disk Contents APPLE-1 EMULATOR APPLE-1 NO BASIC APPLE-1 WOZ ONLY Full version with Integer BASIC, help text and C’mon No Integer BASIC preloaded, but C’mon is there Only Apple-1 ROM: 256 bytes ‘Woz Monitor’ at $FF00 CMON.300 CMON.900 CMON.E000 CMON.E900 Relocated versions of C’mon BASIC.E000 Integer BASIC, which you can also load separately MASTERMIND.300 LUNAR LANDER.300 BLACKJACK.E2B3 HAMURABI.E2B3 STARTREK.E2B3 A couple of games that were sold by Apple on tape in 1977 Binary File Format Two first bytes of standard Commodore binary files define the loading address. Green Delicious follows this with two exceptions: Apple-1 Low RAM files ($0000-$0FFF) are relocated to $C000-$CFFF. 16K Extended RAM programs that span $0000-$3FFF also have the load address of $C000, but the Green Delicious loader skips to $1000 when reaching $D000. The first 4K is moved to the right place when the emulator is resumed. Examples: LUNAR LANDER.300 and CMON.300 actually have load address of $C300. Start the programs by typing ‘300R’. BASIC.E000 loads to $E000. ‘E000R’ is BASIC cold start. HAMURABI.E2B3 and other BASIC programs load to $0000-$0FFF. ‘E2B3R’ is BASIC warm start. Low RAM and High RAM programs can be also loaded to C64 memory before starting the emulator: LOAD"CMON.300",8,1 NEW LOAD"APPLE-1 EMULATOR",8,1 RUN Loading and Saving Files Press and hold F7 for a second to freeze Apple-1 and reach the disk options menu: Low RAM is $0000-$0FFF (4K), Extended RAM is $0000-$3FFF (16K) and High RAM is $E000-$EFFF (4K). Apple-1 Information http://en.wikipedia.org/wiki/Apple_I http://www.applefritter.com/apple1 http://www.brielcomputers.com/wordpress/?cat=17 http://commons.wikimedia.org/wiki/File:Apple_I_Computer.jpg Credits Apple-1 ROM (‘Woz Monitor’) and Apple Integer BASIC by Steve Wozniak in 1976 Apple-1 photo by Ed Uthman and licensed under Creative Commons Green Delicious Emulator and C’mon monitor by Aleksi Eeben in 2001 & 2013 [email protected] 0300: 0310: 0320: 0330: 0340: 0350: 0360: 0370: 0380: 0390: 03A0: 03B0: 03C0: 03D0: 03E0: 03F0: 0400: 0410: 0420: 0430: 0440: 0450: 0460: 0470: 0480: 0490: 04A0: 04B0: 04C0: 04D0: 04E0: 04F0: 0500: 0510: 0520: 0530: 0540: 0550: 0560: 0570: 0580: 0590: 05A0: 05B0: 05C0: 05D0: 05E0: 05F0: 0600: 0610: 0620: 0630: 0640: 0650: 0660: 0670: 0680: 0690: 06A0: 06B0: 06C0: 06D0: 06E0: 06F0: 0700: 0710: 0720: 0730: 0740: 0750: 0760: 0770: 0780: 0790: 07A0: 07B0: 07C0: 07D0: 07E0: 07F0: 0800: 0810: 0820: 0830: D8 03 0E 29 A9 F6 D9 A8 06 18 00 02 84 30 BD 68 F8 D0 20 D0 72 20 B0 81 4C 21 2A 05 B1 0A 07 F9 2C A4 20 F8 F8 A2 85 06 E1 83 6C 20 F8 A9 91 FE 02 DC 00 EF 2C 85 06 06 F8 20 59 69 0A 18 C4 E6 B1 EA 2E F1 8C 06 15 36 48 5A 60 6C 84 90 03 03 00 02 04 02 20 20 03 7F 0D 60 98 06 20 60 02 02 F7 F0 03 85 F0 E3 09 FA A0 15 51 C5 4A 20 2A FB FD C8 85 F0 09 F9 15 18 85 20 FA 68 18 02 FD 41 69 00 FD 85 18 FF B1 FF A9 FE B0 B0 38 EF 77 65 06 D8 CC F6 A2 09 3E 38 AA 06 18 36 48 5A 60 6F 84 90 04 04 00 03 05 0B 8B 52 20 C9 99 84 06 85 08 20 D9 D9 A0 0D 02 F8 11 F0 C0 C0 02 06 38 F9 04 EF 2A 18 85 C0 F9 2A F0 B9 06 69 F8 20 20 A8 60 8C 00 06 30 85 E6 F8 60 4C FD C8 20 20 13 03 60 FF 5B 75 16 58 C6 EE A6 05 6A F8 A8 06 1B 36 48 5A 63 72 84 93 05 05 01 04 00 04 05 03 4D 5F 00 F5 F0 FC 06 52 75 77 0B DD C9 A0 C9 AA 00 09 91 4C E5 B0 A9 FF 29 60 F8 97 A0 20 25 44 C6 02 4C 1F 05 C8 20 82 A0 88 20 FC FC 20 38 41 C9 CA 4C 5B 2A 05 98 E8 46 6D 0E B8 D6 FE B6 15 66 78 BA 06 1E 39 48 5A 63 75 84 93 06 09 02 05 00 06 A9 20 03 D0 02 A4 05 6C 20 03 08 08 A2 03 30 00 04 A2 F0 F0 FD 81 FD 1A 81 38 F0 20 88 D0 03 41 30 09 FA 90 06 06 06 C0 46 02 03 D0 EF 20 D0 46 60 06 A0 D0 EF 06 2A FB 18 D0 CB 7D 1E C9 CE E8 AE 0D 76 85 8A 06 21 39 48 5A 63 78 84 93 07 09 03 00 04 01 03 5E AD 06 C9 F6 88 FB 22 99 D0 F0 00 02 B0 B9 D0 00 2A 20 20 03 85 A9 C5 60 85 46 B1 F6 BD 06 05 F0 D0 02 05 C6 A0 08 06 BA 20 F4 FF FA EE 06 20 18 B0 EB FF B0 2A 18 60 F5 83 79 90 C5 DE C8 BE 1D 6E 95 9A 06 24 39 48 5A 63 78 84 96 08 09 04 00 0A 02 85 03 11 C6 0D E6 10 00 03 00 10 09 98 D0 F5 47 06 B9 85 A5 96 20 F9 FF F9 BD FB 06 FD A9 75 B9 A5 06 94 E6 20 FA 00 D0 B0 8E 86 AD CA 05 18 B0 3E 65 08 98 20 03 2A 60 BE 18 B4 61 B0 D5 CA 4C A0 19 7E 8D 98 06 27 3C 48 5A 63 78 84 96 01 02 05 01 04 03 FE A9 D0 F6 F0 F6 F8 20 A0 02 AD C8 48 11 90 07 A5 B0 F7 F7 04 96 A5 C5 90 03 BD A9 85 00 08 38 F8 A8 18 F8 46 D0 98 EF 5F 81 06 80 D0 B0 60 01 06 FD C9 4C FA 85 29 A0 5C 60 A3 71 F0 CD 88 6C A4 01 4D 9D 03 09 2A 3C 4B 5A 66 78 84 96 02 04 06 02 01 04 A0 01 10 10 04 B9 38 46 00 C8 01 C8 B9 C9 00 C5 F8 06 A2 C9 B0 04 FA FA 06 02 03 10 F7 AA 20 09 20 20 60 18 06 F4 48 A2 20 02 A0 02 F4 0D 20 18 A5 85 80 15 05 FD F0 0F 09 0D 05 29 24 DD 49 20 B4 11 60 99 03 09 2D 3C 4B 5D 69 78 87 99 03 09 07 03 02 05 00 69 FB EB E6 00 60 06 20 C9 02 C8 50 0D 68 F7 C9 81 00 02 69 B0 E5 D0 A9 E8 02 85 88 F0 EF A8 DC 86 85 65 A9 18 B1 08 A0 68 04 85 18 20 46 60 FE FD B0 06 B0 18 85 D9 A0 41 03 25 2C D9 45 A9 AC 48 E9 81 03 09 30 3F 4B 5D 69 7B 8A 9C 04 09 08 04 03 00 84 00 AD 30 F6 02 B9 B0 52 0D D9 C0 09 F0 A8 D0 09 FD A9 F0 A0 58 FE 14 00 20 E8 FA B1 06 FF 20 FF 06 F8 FD 08 60 FD 20 05 8D B9 F8 60 5B 06 20 20 90 0F A9 0F 60 FB B6 00 48 05 35 30 C1 55 A5 BC 08 E5 91 03 09 33 3F 4B 5D 69 7B 8D 9F 05 09 01 05 04 02 FD A8 10 E6 D0 A4 A0 43 03 D0 76 AB A8 14 88 11 F0 B9 24 09 01 85 85 A6 C5 77 20 20 FD BE E8 86 A5 A4 A5 85 85 20 20 1F 08 80 80 A2 20 06 B0 52 DC 02 C9 2E 20 20 20 09 BD 54 05 2D D0 D1 4D B5 4A 68 F5 86 03 09 36 3F 4E 5D 69 7B 90 A2 06 00 02 06 05 03 F0 20 D0 A4 D8 F5 06 20 C9 F5 08 D0 B9 C8 10 B9 07 DE E8 20 91 FA FA F9 FA 06 77 05 D9 47 88 06 F7 F9 F7 F7 FA 46 DC 06 8D 02 02 08 46 B0 0C 03 FF E6 20 D0 5B 52 52 F0 00 57 05 3D 10 E0 5D AD 46 28 ED 96 03 0C 36 3F 51 5D 69 7B 90 A5 07 09 04 07 06 04 0E 86 20 F6 A9 60 85 FA 0D A0 D0 E1 68 E8 D6 DE C8 07 DD 96 FD 20 10 CA F0 B0 06 06 B0 07 D0 A4 20 B9 10 A5 20 06 FF C6 84 D8 20 A9 06 09 85 C9 A5 FE 90 F1 06 03 03 05 09 47 05 39 00 E4 59 BD 56 2A FD 8E 03 0F 36 42 54 60 69 7B 90 A8 08 09 01 08 07 05 20 06 EF 10 00 A0 FB 05 D0 00 08 38 09 D0 30 07 C0 A8 02 04 A5 96 14 CA EC 14 B0 A0 06 B9 F6 F9 DC 20 02 FE 05 A9 20 FA 02 18 DC 00 B0 A4 F7 20 FD 60 0B A9 B0 20 20 88 F0 44 04 21 50 EC 41 B9 4E 26 F9 84 03 12 36 45 54 60 69 7E 90 01 00 00 02 02 08 00 22 4C FF 02 85 07 B9 90 05 AD AD 60 C9 EC CE C5 97 B9 02 B0 F7 04 A9 8A A9 2A 03 02 F0 DE A4 B9 FF 09 C6 65 06 04 41 D0 8E 60 FF 26 17 FC A5 D0 20 A0 20 0D 0A 77 77 10 06 52 05 31 70 C0 51 A1 5E 36 E1 94 06 15 36 48 57 60 69 81 90 02 02 00 04 03 01 01 0840: 0850: 0860: 0870: 0880: 0890: 08A0: 08B0: 08C0: 08D0: 08E0: 08F0: 0900: 0910: 0920: 0930: 0940: 0950: 0960: 0970: 0980: 0990: 09A0: 09B0: 09C0: 09D0: 09E0: 09F0: 300R 02 00 00 00 4C 42 4C 58 49 44 41 52 45 58 01 01 06 00 CA 24 30 30 30 24 41 2C 20 00 03 02 00 00 42 4E 43 43 4E 41 50 4F 44 54 02 01 05 01 CB 30 0D 2C 30 30 42 58 59 0D 04 03 02 00 43 45 43 50 43 4C 48 52 53 41 02 01 06 07 CD 30 20 59 29 30 43 00 52 43 05 04 03 00 43 42 4C 59 49 44 41 52 45 59 02 80 05 0C D0 0D 24 0D 2C 2C 44 2C 20 27 06 05 04 00 42 50 44 44 4E 58 50 54 49 54 03 80 00 13 D8 20 30 20 59 59 45 58 53 4D 07 00 05 3F 43 4C 43 45 58 4C 48 49 53 53 03 00 00 1A D3 24 30 28 0D 0D 46 29 50 4F 08 00 06 3F 53 42 4C 43 49 44 50 52 54 58 03 01 00 23 D7 30 30 24 20 30 3F 00 20 4E 00 01 07 3F 42 52 49 44 4E 59 50 54 41 54 02 80 07 2C D5 30 30 30 28 31 0D 29 4E 20 00 02 08 41 45 4B 43 45 59 4C 4C 53 53 58 02 00 00 35 0D 2C 2C 30 24 32 2E 2C 56 41 00 03 02 44 51 42 4C 58 4A 53 41 53 54 41 02 04 07 13 20 58 58 2C 30 33 00 59 2D 50 00 04 0B 43 42 56 56 44 4D 52 50 42 58 54 03 05 08 3E 23 0D 0D 58 30 34 23 00 42 50 00 05 04 41 49 43 43 45 50 4E 4C 43 53 58 02 05 09 47 24 20 20 29 30 35 24 41 44 4C 02 06 02 4E 54 42 4D 59 4A 4F 50 53 54 53 80 05 0A F1 30 24 24 0D 30 36 00 43 49 45 03 07 03 44 42 56 50 45 53 50 52 45 59 54 80 05 00 C7 30 30 30 20 29 37 28 20 5A 0D 04 08 04 41 4D 53 43 4F 52 4F 4F 43 54 59 80 05 0B C6 0D 30 30 28 0D 38 24 58 43 2E 05 00 00 53 49 43 50 52 4C 52 4C 53 41 41 80 06 08 DB 20 30 30 24 20 39 00 52 0D 00