Reading the Nibbles & Bits newsletter and learning about the #ColecoADAM VDP (Video Display Processor) by mixing some machine language with SmartBASIC! 🤓⌨️
Reading the Nibbles & Bits newsletter and learning about the #ColecoADAM VDP (Video Display Processor) by mixing some machine language with SmartBASIC! 🤓⌨️
I was checking out some of the demo programs on DEI’s FontPower disk and I came across one that featured 60-column text. It uses the shape table to store the characters which is a really cool technique. Seeing how legible it was made me think it’d be great for a communications program so I modified the demo program and came up with this. Not sure if I’ll finish it but it sure would be nice to have.
Believe it or not I’ve never tried SmartLOGO before! I vaguely remember being at a friend’s house back in the 80s when he showed it to me and said he could make games with it. I’ve got the manual here so I’m going to have some fun going through the tutorials and see what I can do with it. 🐢 Turtle Power!
🚨New hardware alert! Got a 🖲 ColecoVision Roller Controller in great condition from my new friend James at crt-international.com. I love it! Definitely adds some arcade authenticity to games. Took me right back to playing Centipede in the arcade. Good times! 🎮🕹 #ColecoADAM
🌈 Spent time this morning in BASIC trying to produce “rainbow” text (a string with each character having a different colour all appearing on the same line). It’s not as trivial a task as it would seem to be! More experimentation is required. Excellent. 😄 #ColecoADAM
I recently got a new book called “Programming Games For The ColecoVision and ADAM in Assembler” by Tony Cruise. Yes, it is still 2020 and yes, there is a new book about ADAM programming! Of course I preordered this book as soon as I heard about it and it was released at the end of August as a digital Kindle book. You can get it on Amazon now or if you prefer a printed physical version you can preorder it here.
I’m already nine chapters into it and I’ve been enjoying it so far. The only unfortunate thing (for me) is that the workflow described in the book is Windows-centric and these days I use a Mac (when I’m not using my ADAM 🙂). This didn’t slow me down too much though as I already had a working virtualized Windows 10 installation on my Mac using VirtualBox before I started the book.
If you’re interested in creating games for ColecoVision or ADAM or maybe just interested in learning some Z-80 Assembler then I highly recommend checking out Tony’s book! There is a thread on the AtariAge forum where the author is active so you can discuss the book and ask any questions you may have.
I’m happy to announce that this weekend I was able to complete and release my SmartWriter File Viewer BASIC program.
This has been a really fun project and the end result is a utility that I will personally get a lot of use from. One of the main reasons this project was so fun was that it involved disassembling SmartBASIC’s BLOAD routine and modifying it to do what I needed. I haven’t had much experience with assembly language so this gave me a chance to dig in and learn. I used the disassembler included with the legendary Hacker’s Guide To The ADAM. The Hacker’s Guide Volume 2 was also incredibly helpful as a reference for this project. Without its section on Tape Routines I don’t think I would’ve been able to do this at all. Huge shout-out to Peter and Ben Hinkle for writing these awesome guides back in 1985/86. The other book I used as a reference was “Programming the Z80” by Rodney Zaks which I’m sure I’ll be returning to again and again.
As I mentioned in a previous post the main thing I needed to do was get the BLOAD routine to accept SmartWriter files. After reading through the assembly code I found what I was looking for here at 21083:
21083 525B 3A9641 LD A,(nn) 4196 21086 525E FE02 CP n 21088 5260 C2255F JP NZ,nn 5F25
Just before these instructions the routine loads the file header into memory location $4194. So the first line above is looking at the 3rd byte of the header (the file type) and the second line is comparing it to the value 02. If it doesn’t equal 2, the third line jumps to an error display routine (File Type Mismatch). In ADAM’s EOS, binary files have a file type of 2 whereas SmartWriter files have a file type of 1. Therefore all I had to do was modify memory location 21087 to contain the value of 1 like this:
POKE 21087, 1
Eureka! That was enough to get BLOAD to accept SmartWriter files. As a bonus, the routine would now neatly reject other binary files that would obviously be incompatible with my viewer program. Once I had this in place I started to figure out more of the routine and how it worked. There are some other modifications I had to make before I was done but this one was definitely the key. You can check out the rest of the changes and the entire code if you’d like by downloading the disk image over at the SmartBASIC Forum.
I finally have a serial port for my ADAM! A special thanks to rietveld and adamcon over at the AtariAge forum for helping me find one. I got an external unit that connects to the memory console’s side expansion port.
I’ve had a WiModem232 ready and waiting for this day. Got it all set up and working perfectly using the awesome ADAMLink V terminal software and within minutes I was connected to a BBS just like the old days.
This is incredibly cool. It just blows my mind that my computer that was made way back in 1983 is now connected to the internet via WiFi. I highly recommend the WiModem232!
I printed out a disassembly of the BLOAD routine [$5201] and spent some time studying it last night. Despite my limited assembly knowledge I’ve been able to figure out most of it including the key to making BLOAD accept SmartWriter files. 🎉 Progress! #ColecoADAM #Z80
I’m planning to write a BASIC program to view SmartWriter documents. It would come in really handy since many program disks include their documentation in this format and it’s inconvenient to reboot into the word processor just to read them. At first glance this seemed like a pretty simple program to write however the BLOAD command refuses to load SmartWriter files (although they are cataloged as type “H” binary files) for some unknown reason. The OPEN command only works with text files so that won’t work either.
One solution I’m considering is modifying the BLOAD routine in memory so it will accept SmartWriter files and load them like any other binary file. This will take me in a bit over my head as I’m not comfortable in machine code or assembly language (yet) but it does turn this into a pretty interesting project. Stay tuned!
Didn’t have such a great morning with ADAM today. First, I unsuccessfully tried to customize RamBOOT by copying FILEMANAGER onto its disk and renaming it as ADAMCALC. It wasn’t having it and simply refused to load File Manager when I hit the key for ADAM Calc. Just a blank screen. I still haven’t given up on customizing RamBOOT though. I’d love to be able to quickly jump in and out of programs of my choosing instead of its default SmartBASIC 1 and 2, ADAM Calc, and SmartWRITER options. There’s got to be a way.
After failing to customize RamBOOT I decided to change gears and try to install the ZDE programmer’s editor for CP/M. However, somewhere along the path of downloading the required files to my Mac, using WRDISK to copy them to an EOS disk image, and finally bringing them over to ADAM CP/M using the ADAM.COM tool it seems like the zde16.pma archive file got corrupted and it refused to fully extract. Sigh.
I managed to get “NEWCCP” installed and working in CP/M 2.2. I think NEWCCP may have actually been the origins of T-DOS as it is written by the same programmer. As the name suggests it is a replacement for the standard CCP that adds a few benefits like ditching the USER command in favour of the standard “A0>” style prompts and paths. It also adds paging to the TYPE command and includes frequently used commands (like COPY) as resident commands so they can be run from anywhere. You can read more about NEWCCP in Issue #36/#37 of the NIAD Newsletter.
What is really nice is that I was able to get this working on top of my ABP25-patched CP/M installation so now I’ve got a really decent CP/M environment that is somewhat comparable to T-DOS. Why not just use T-DOS? I do use it (and like it) however as I mentioned in a previous post, T-DOS’s video memory usage prevents me from running any software that makes use of ADAM’s graphics capabilities (like this cool Turbo Pascal bitmap library).
Super BASIC Plus is pretty awesome! There are a lot of SmartBASIC enhancements out there but this one is by far my favourite.
I’ve been having a bit of fun with sprites and SmartBASIC this weekend. First I loaded up SpritePOWER which is a very nice sprite editor for ADAM that was created by Digital Express Inc. Digital Express created a lot of great software for the ADAM. SpritePOWER is really nice because it gives you the option of exporting your sprites as binary (so you can BLOAD them in BASIC), Z80 code (for use in assembly), or as an ASCII file of SmartBASIC code consisting of many DATA statements. For the BASIC code option it even lets you specify the starting line number and line increment value. Pretty slick.
I wanted to create a spaceship that I would later be able to fly with the joystick, so I’d need to create it facing in at least 4 different directions (I didn’t do the diagonal variants). I first created it facing east. SpritePOWER has a handy “flip grid” feature which made it easy to create the west-facing version. Unfortunately it doesn’t have a “rotate grid” feature.
To create the north/south facing sprites what I did was take a picture of the TV screen with my iPhone and then rotate the photo. This made it much easier for me to put the pixels in the right locations. Before long I had all 4 variations of my spaceship ready to fly! I opted to save my sprites in a binary format.
Coleco SmartBASIC 1.0 doesn’t offer any syntax support for sprites so using them involves knowing what and where to POKE. Thankfully, the SpritePOWER disk included a SmartBASIC program called “SpriteDemo” which showed me how to load and use my sprites. Part of the code even demonstrates how you can move a sprite onscreen using the joystick! I pulled this section of the code into its own program and modified it so that it would use my sprites. The original code would move the same sprite in any of the 4 directions. However, I wanted my program to change the sprite depending on which direction the ship was flying so I made those modifications too. If you’d like to see the SmartBASIC code, you can download it here.
There is something pretty satisfying about flying your own custom 8-bit spacecraft around the screen. Obviously there is a lot more I could do to enhance this code and possibly even use it as the foundation for a game. I may eventually do just that!
As I mentioned in an earlier post I have been playing with some Turbo Pascal graphics extensions that directly access the VDP under CP/M. I generally prefer T-DOS over stock CP/M 2.2 because it supports a wider range of disk capacities and configurations, uses 40-column text mode, and it fully utilizes the memory expander for a larger RAM disk.
The problem I ran into is that these graphic extensions unfortunately don’t work in T-DOS. As I learned this is apparently because T-DOS uses video RAM to store its CCP (Console Command Processor). So… back to the standard Coleco version of CP/M 2.2 I go! Not a big problem however it is slightly inconvenient because it only supports a maximum disk capacity of 160K and only offers a 55K RAM disk regardless of how much memory your ADAM actually has.
I was reading through old issues of the N.I.A.D. newsletter (as one does) when I found a reference to a program called ABP12.COM (ADAM BIOS Patch) in Issue #36/#37. This patch was written by the programmer who would eventually go on to create T-DOS (Tony Morehen). The patch reportedly gave CP/M 2.2 the ability to use all of your expansion memory as a RAM disk and support disks larger than 160K. Perfect! The only trouble was finding it. I searched the ADAM Archive and scoured through every one of the NIAD disk images and came up empty. Cue Milli…
I wrote a post on the SmartBASIC forum about my search and before long Milli came through with a link to an archive that contained ABP10.COM which would suggest that it was version 1.0 of the program I was looking for. It unfortunately didn’t do everything the article suggested however it did offer a 61K RAM disk which is a very slight improvement. Fast forward a few more days and Milli replied again – this time with a link to an archive containing a copy of ABP26.COM!
ABP26.COM seemed to offer everything I was looking for! Support for 720K disks? CHECK. Compatible with the TP graphics extensions? CHECK. Larger RAM disk? ALMOST. The program seems to have a bug that freezes up CP/M when you try to access a RAM disk larger than 128K. My ADAM has 256K so this was obviously a problem. Luckily, the archive Milli directed me to also contained a copy of ABP25.COM. I gave that version a try and… presto! ADAM CP/M bliss. Now I have access to 246K of RAM disk that will persist between soft resets (awesome) and I’m able to use a 720K disk for my work which is plenty of room (compared to 160K). This makes programming using the graphics extensions so much more enjoyable!
I scored a second digital data drive for just $10! It has substantial yellowing but I installed it and it works like a champ. To me, the high-speed tape drives are an important part of ADAM’s “identity” so it’s nice to have a backup.
Been playing around with some very cool Turbo Pascal extensions that interface the VDP (Adam’s video chip) under CP/M.
New hardware alert! My 256K memory expander from MicroFox arrived on Friday and I was able to set aside some time this weekend to install it and try it out. One thing you’ll notice if you look at the pictures is that there are actually 2 cards that make up this expansion. One card is the actual expander that contains the memory chips and the other is a connected “addressor” card. The addressor card sits in slot #2 and allows Adam to address expanded memory beyond 64K.
Even with the addressor card, most ADAM software can only use the system’s base 64K RAM + 64K of expansion memory (Coleco shipped their own 64K expander back in the day). So you might ask “what’s the point of installing more than 64K?” The answer: RAM DISK!
CP/M and T-DOS (an awesome CP/M variant for ADAM) both recognize all the extra memory and use it as a super-fast RAM disk. This will be very convenient when I’m working with Turbo Pascal for example because the compile times fly since any include files can be pulled from RAM instead of disk or tape.
For EOS (Adam’s built-in OS) there are a wealth of RAM disk utilities available (like Adam’s Desktop, SmartDSK, MegaDisk, and many more) and I’m still exploring them to see which will suit my needs best. Most of these tools give the user the option of using the entire expander as a RAM disk or reserving one 64K bank of memory for expanded RAM and allocating the rest as a RAM disk. Which option you choose just depends on what you want to do with Adam at that time. The coolest thing about using a RAM disk with EOS is that the contents persist even when you reset the computer! Only a complete power-down destroys the contents. This allows me to treat the RAM disk as a sort of temporary hard disk since I can reset the computer to load other programs without disrupting my files. I can see this being very useful for jumping between SmartBASIC and a sprite editor for example. Speaking of SmartBASIC, loading code from the RAM disk is obviously incredibly fast and the expanded RAM gives me a lot of room for larger and more complex programs to be written.
I’m still wrapping my head around all the benefits of having this extra RAM but one thing I know for sure is that this 256K expander is an excellent addition to my Adam!
One of the quirky things Adam does is every time you pull the reset switch on the computer the SmartWRITER printer will do a noisy reset of its own including a linefeed which pushes the paper up one line. Trying out software using my ADE Lite drive requires me to reset the computer to load a different disk image so its something I do quite often. The noisy printer reset quickly became annoying. After looking at the ADAM Technical Reference Manual and asking around on the SmartBASIC forum I discovered that it’d be pretty easy for me to build an adapter that would prevent the computer from sending the reset signal to the printer. So a few weeks ago I ordered some wire and DB-9 ports and put it all together. Essentially it is just a straight connector with all the wires in place except the “reset” wire. Works perfectly! Okay, so it isn’t much of a hack but I was pretty happy about it. Gotta start somewhere, right?
I’m mainly a software guy. However, hardware has always fascinated me and one of the things I’ve learned since diving into the retro-computing world is that having some basic electronics skills can really come in handy. With that in mind I have registered for this course on Udemy. Hopefully it will help me level up!