Forget PowerPoint or Google Slides or Apple Keynote. Here is a newer solution for the Commodore 64. Simply use DATA statements in BASIC to define the layout of your slides. What could be easier than that?
I originally wrote this somewhere between 1985 and 1987. I submitted the program and an article to Compute! publications but was rejected, probably not unique or attractive enough of a submission. Well, here it is for the public to see approximately 35 years later. Not sure if I wrote this originally in assembler, or just machine code. I suspect I used machine code for this one. I have done a fair job now disassembling and crafting into assembler (using ACME cross assembler) for a more modern experience.
My typical use was to either see what was on the disk, or as a game launcher. Imagine the possibility of many games packed on a 1581 disk. It even supports launching cartridge images.
I have used it with 1541/1571/1581 but not sure if it works with fully populated large drives. Seems to have trouble with some non-standard drives. I plan to review that in the future. (Update: some fixes have been applied to the original code starting with tagged version 1.1)
Keyboard and joystick(#2) controls are documented with the source README.
This example parses a string appended to the SYS command on Commodore 64
One wonderful feature of the Commodore 128 was its compatibility with the Commodore 64. It was an evolution of the Commodore 64 and still supported all the software and hardware from before. For me it was a no-brainer to buy. 80 columns, plus new features, plus CP/M. Adding a mouse, GEOS 128, REU 512K, and 3.5" floppy, and I thought it was the best place to be this side of heaven.
There were multiple ways to go into Commodore 64 mode.
PET 2001 2K to 64K supported
Vic-20 5K to 40K supported in hardware supported increments, not all available to BASIC64 RAM 3K to 64K supported not all available to BASIC
Commodore 16 and Plus/4 support 16K, 32K, or 64KCommodore 128 fixed at 128K (KERNAL does not do RAM test)
Limitations? Oh, sorry. This emulator is text only. No full screen editor. Doh! No screen pokes either (well not displayed). [Update 6/2021:] PETSCII and commodore graphics characters supported with third party font. Does support console history editor on Windows. Linux and MAC builds (you can build from my open source project) provide only simple line editing capability. Does provide accurate 6502/6510/8502 emulation, RAM banking, etc. according to the platform. So pop into the MONITOR on C128 or C16, Plus/4, or SUPERMON on other platforms to write and edit machine code. And because using console window, the text display size is not as limited, 88 columns for Vic-20 and 160 columns for C128.
|Resizable text console - 132x50 text screen on Commodore 128|
|Bil Herd, Ted/C128 hardware design project lead (left) and Dave Van Wagner, geek (right)|
The Commodore 128 is a favorite system of mine. I've owned a DCR model (cost reduced with embedded disk drive, the metal case) since around 1987. And it still works fine!
But this article is about emulation. I already wrote a C#/.NET based emulator that supports PET/Vic-20/64/16/Plus/4, and just recently have added 128 support. I thought it would be difficult with the C128 custom MMU and VDC. There was a learning curve. And I faked enough of it to boot and work (even with no Z80).
Feed the emulator some Commodore ROMs (not included, recommend grab these from Vice) and it can map ROM/RAM into the 6502 memory space and execute 6502 instructions. There are some common KERNAL entry points for character in, character out, check for stop, and load/verify/save operations. These calls are hooked to redirect console input/output to the emulated 6502. Effectively the Commodore computers are running in software.
These emulated systems don't do the fancy video games. There is a long list of things they don't do, including no PETSCII graphics either. No graphics. No sound. No timers. No color. They don't even do full screen editing. They are stuck using the console editing features. Not great, but it works -- cursor up to recall a previous command in the current screen line editor. And the Windows console editor even survives restarting the program or restarting the Commodore. Please note it is best to use Caps Lock as the Commodore expects uppercase commands most of the time.
What this does function as is a good text BASIC interpreter, and 6502 machine language environment. Some of the Commodore systems such as the C128 and Plus/4 include their own machine language monitor (MONITOR command). On the PET, Vic-20, and C64, you can load the appropriate SUPERMON for that system.
Here's how to get started.
1. Grab the sources from github
2. Grab the roms from vice, (a much larger more complete and more accurate emulator, but why would you want that much fun?). Put these in a c128 directory from which you will run the simple emulator. While you're at it, create subdirectories and copy roms for the other systems too.
c128: kernal, basiclo, basichi, chargen
c64: kernal, basic, chargen
vic20: kernal, basic, chargen
ted: kernal, basic
pet: basic1, edit1g, kernal1
3. Compile using Visual Studio or dotnet.
4. Run with the command line argument: c128
Why do this? To me this was a challenge to first emulate the 6502, and a challenge to minimally support Commodore BASIC. I thought what is the least amount of support that is needed to have a useful Commodore computer? I knew about the Kernal jump table definition by Commodore. I had seen others do it successfully. And I wanted to do it my way. It was just a mountain to climb, and since I love 6502 and Commodore computers, it is an enjoyable part of my hobby.
See what your C64 programs are up to! Debug, or help transition from BASIC to assembly language I/O programming.
c64-io_monitor is a program that allows monitoring or tracing input/output calls on the Commodore 64. It can show counts or a trace log of what calls have occurred.
The screenshots show the initial copyright screen, with usage hints, and status (includes trace log bytes available), followed by an example program, and the counts and trace log from running this program.
Basic usage includes loading io_monitor program from disk at absolute address $C000. It is recommended to lower BASIC by poking to memory address 56 (e.g. POKE 56, 128). Then NEW to both clear variables and reset BASIC program pointers. And use SYS 49152 to initialize the trace/monitor.
SYS 49152 : REM START MONITOR
The monitor copies BASIC/KERNAL ROMs to RAM, patches them to hook the I/O entry points in the Commodore 64 kernal jump table at the end of ROM within the $FF00-$FFFF range. The hooks take care of counting calls, and logging trace information in available RAM. While each call is made, the border color is incremented to show it is working.
At this point, you may make any I/O calls including keyboard input (plus RETURN), screen output, disk/tape I/O, etc. The I/O calls will be counted/logged.
When you are finished with the monitoring session, it is recommended to press STOP+RESTORE to reset back to the KERNAL ROMs, then the counts and tracing is turned off.
Counts can be displayed with SYS 49155, and the trace log can be displayed with SYS 49158.
The trace log can be sent to a file with statements like the following:
SYS 49155: REM COUNTS
SYS 49158: REM VIEW LOG
Why did I create this? I have been developing some simple (text only) 6502 Commodore emulators (one, two, three, four, five) for multiple targets (web, Windows console/terminal, Linux terminal, Mac terminal, Arduino UART, ESP32 UART, Teensy LCD, STM32F4 LCD, and more embedded targets) and am looking at supporting file I/O emulation (open, input, get, print, close, etc.) above and beyond my D64 emulation. One step along the way is understanding Commodore I/O some more from the machine language level. Seeing a trace log provides a closer in-action view of the kernal I/O routines.
The D64 disk image contains the machine code for io_monitor (also available as PRG), and some sample programs that can be used to demonstrate the functionality, including viewlog which opens and displays a sequential file (e.g. testlog saved to disk like above). The source code posted to github is open source (MIT Licensed meaning free to use/alter/distribute, giving credit where credit is due, with no warranties).
Hackaday linked to this article
Commodore systems come with a graphical character set that can be used for low resolution graphics.
|PETSCII low resolution 80x50 example|
|PETSCII block characters including inverted|
In the back of our high school math classroom was an original PET 2001. This system had a chicklet keyboard, built-in cassette drive, and 40 column white on black monochrome screen. This system has no graphics modes beyond the PETSCII capabilities.
One of the exercises in my Algebra 2 class was to graph mathematically functions. I successfully challenged myself back then to plot the graph on the PET using this block graphics method.
Using 8 PETSCII characters, and the inverse of those characters, all 16 combinations of the patterns can be achieved by setting (POKE) the correct value onto the screen (see the A array in the source). Also achieved is reading (PEEK) the current PETSCII value, converting that into pixel data, and combining existing plotted pixels with a new pixel (see the B array in the source).
|LORES PET 40COL listing|
|My handwritten PET listing from 1982|
I found my handwritten program listing that dates back to 1982. It's beautiful to see that graphics could be achieved with PETSCII with only a few lines of code. From my positive experiences with the PET, I purchased a Commodore Vic-20, and the Super Expander later in 1983 and switched to high resolution graphics at that point.
A disk image (D64) of samples for PET/Vic-20/C64 is available. Screen memory locations for PEEK/POKE are different for all the systems, and sizes are adjusted with variables for the 80 column PET, and 22 column Vic-20. The Vic-20 and C64 also have color memory, so an additional POKE is included to match the current text foreground color (PEEK(646)).
Update [5/13/2022] there are ports for both Commodore 128 40 column screen, Commodore 128 80 column screen (including SYS calls to read/write VDC 8563), and a port to the TED (C16, Plus/4) series systems showing a color gradient possible with those systems.
|Disk Listing for different Commodore Models|
|Vic-20 low resolution 44x46 plot|
|Contrast with 320x200 high resolution from C64|
|PET 80 column screen 160x50 sample|
|[Change:] 80 P=COS(I)*SIN(I)*2|
|Commodore 16, Plus/4 screen 80x50 sample (TED)|