January 24, 2019

"The Valley" Cartridge for C64 - Interview with Dale from Dungeon Dwellers Inc.

The Valley for the Commodore 64 - Enhanced DDI Cartridge (Prototype)
A couple of months ago, I was fortunate enough to help Dale from Dungeon Dwellers Inc. test the special upcoming Cartridge release of his enhanced version of "The Valley" for the Commodore 64. In doing so, I thought it would be neat to conduct an interview for my readers about this new release.

If you aren't familiar with Dale's work, but are into the Commodore scene, you most likely have seen his influence without even knowing it. He has helped with countless projects over the years through his expertise in PCB design and engineering. He is the creator of the Magic Cart series of PCB's (Micro Magic, Black Magic, etc) and has helped with game cartridge releases such as Sydney Hunter And The Sacred Tribe & L’Abbaye des morts. Just to name a few.

He also released the enhanced DDI Telengard for the C64 and continues to perfect his digital art across the Commodore scene.

So, without further ado... Let's take a journey into The Valley!

DnR:
First off, Dale, thank you for taking the time to chat about this. I have been really excited watching this project through the different stages and now finally, seeing it coming to fruition.


DDI:
Discovering The Valley for the Commodore 64 was an unexpected connection back to the days of the Commodore PET, where a playable version of the game was first coded. It was a game I came across while sifting through a collection of primarily small text adventures released for the Commodore 64 by The Guild Adventure Software. It was one of those games that was so poorly implemented that I almost wrote it off at first glance. However, had the Commodore 64 version not been in such rough shape, I would have never explored this gem of a game. It's my pleasure to talk more about my journey into The Valley.

DnR:
Can you tell us a bit about The Valley and some of the enhancements you've made to the code for this DDI version?


DDI:
The Valley is an early micro game first published as an incomplete BASIC adventure program back in 1982 in a British magazine called Computing Today. In The Valley, experience is gained D&D style by finding treasure and killing creatures, where ultimately it's a quest to find the Helm of Evanna, the Amulet of Alarian, and the six gems that fit the Amulet. It was not written for any particular micro of the day, but rather printed in an article with a rich backstory, along with several BASIC code modules that could be adapted to the BASIC language of any machine. Additional code modules for The Valley were published in subsequent articles as well throughout 1982. And so it was adapted to a number of systems, both micro and mini systems. Several commercial versions emerged, where Argus Press who published the Computing Today article, also published a working version of The Valley on tape for the CBM PET, the Commodore 64 and several other micros. Most of the commercial versions offered very primitive graphics using the native and often monochrome character set of a given micro. There was one version published back then by The Guild Adventure Software group for the Commodore 64 that offered a custom character set and was a fairly good attempt at a commercial quality release, but was riddled with imperfections and game play that was difficult at best. It was this version I had reworked in to a playable game, correcting and enhancing the code, using the original as a framework to build out and on top of. The game lacked an end check, and being clearly a quest natured game, it definitely deserved one. Before the game was reworked, machine code was written to combine several game files in to one loadable file that could be placed on a cartridge, which is how I started to take a closer look at the game itself. From there, I started to correct graphic elements that were off, and then went on to the game mechanics to adjust the timing for combat response, and added features that never existed in the original. Some such are enhanced color coding, 7 additional character classes, randomized event descriptions, idle encounter timer, pause, stairwell logic fixes, memory arrays to track items, expanded the number of lairs and temples by four and the height of the black tower by two, expanded loads and saves, various graphic tweaks, and many more enhancements and fixes, along with algorithm tweaks that now factor in level, class and relics found. A machine code driven ending to the game was created complete with some animation and SID sound. Much of the refinement to the game was done back in 2015 to make The Valley a very enjoyable RPG in the spirit I felt the original was intended to be.

DnR:
I'd love to hear more about the special DDI Cartridge version(s) you've been designing. Can you please tell us about it and what your plans are for release?


DDI:
Back in early 2018, I started to visualize a few high calibre cartridge designs for The Valley with etched graphics for the Amulet of Alarian and the Helm of Evanna that would include LED's for the six amulet stones, along with a LED for the Amulet and the Helm as well. Knowing I could design the hardware and write the code to control them, I drafted a new PCB based on an enhanced Magic Cart design and added the code to The Valley to control the LED's. Along with the additional code, several minor imperfections have been found and corrected. Two special cartridge versions were designed, one with PCB's as a case, and the other in transparent purple acrylic. Both are high end works of digital art, comprised of military grade components and fastened with brass and stainless hardware, both engineered to be very thin. LED's in the acrylic version illuminates the PCB substrate below the etched graphics for the Helm and Amulet and looks gorgeous in low light. The LED's for the PCB cased version rise up and through the graphics, peering just above the surface, where this version of The Valley cartridge looks brilliant in a well lit room. Everytime a relic is found, the LED for it will illuminate. There's an additional array of seven LED's on the back side of the cartridge that will slowly pulsate when all items have been found and the quest is nearly won. Returning to one of the two castles in The Valley with sufficient experience and all relics found wins the game. Both cartridge versions include a red LED illuminated reset switch, and comes in a transparent flip open tape case with beautiful artwork.The Valley cartridges are out of the prototyping phase, with a commercial release of both cartridge versions in the works for early 2019 via Shareware Plus.  All cartridges for The Valley are hand crafted by DDI and will soon be available to order from the DDI Projects page, or by contacting me via sysop at sys64738.net, for anyone interested in a copy prior to the official release.

DnR:
You have designed some really cool PCB's over the years. What are some of the challenges you've faced with this cartridge design that you haven't faced before?


DDI:
The initial challenge was to design and implement graphics for the Helm and Amulet, and size them to allow for the needed trace space to implement the additional logic and components needed to support the LED's. The level of detail in the PCB graphics pushes the limits of current PCB etching capability such as the individual bricks and text in the two castles for the PCB cased version, or the detail of the intricacies within the Amulet graphic, where efforts were made to insure the fine graphic elements would resolve though the etching process and not left fused together. I was really pleased with how the styled message that lines the circumference of the Amulet is very legible, if not requiring a magnifier for many to read. The routing and layout of the PCB is much simpler by comparison to some past projects otherwise and draws on past innovations such as reverse mounted SMT LED's from the PCB's back side, which does the PCB substrate illumination beneath the etched graphics for the acrylic cased version. I enjoy and appreciate fine hardware, with the aim of every DDI project to make a digital work of art that is as enjoyable to look at on the desk as it is to plug and play.

DnR:
Following the April 1982 issue, Computing Today continued to include articles in subsequent issues, offering modification to the game code submitted by readers. Were you aware of these modifications when you began your journey into The Valley?

DDI:
Not back in 2015, where during the creation of the cartridge for The Valley, I did become aware of the subsequent articles with suggested game variations that were published for The Valley.  The DDI revision of The Valley has similar features to some of these variations, such as Circles of Sorcery will seldom raise PSI.  Likewise, the mapping of items within temples to fixate their locations in the DDI revision is similar to the variation where temples disappear after being explored, as once items are found, they will not re-appear.

DnR:
Now that you've been in the nitty-gritty of the code, do you see any chance of DDI taking this game even further, new scenarios or a sequel so to speak?

DDI:
Unlikely, as it would require a complete re-write of the code to optimize and free up memory that would be needed for such expansions.  It's certainly possible, especially in a banked cartridge format.  In that a regard, a sequel would be more likely.  The expanded number of temples, lairs and the height of the Black tower now provides a nice game length and balance such that the needed amount of experience to win the game is achieved right around the time all the items have been retrieved from the temples, lairs and the 12 levels of the Black Tower.  The Valley was something I never intended to really make a project out of.  It's similar to finding an old antique in rough shape, and once you clean one spot, you end up cleaning it all up until it shines and works as intended, and then you polish it up further and embellish it some, but try not to change it too much to preserve what it was originally meant to be.  I simply wanted to make it an enjoyable game to play, as it had a lot of potential and work put in to it, where the history of the game as an early CRPG was a very pleasant surprise.

DnR:
While on my journey through The Valley, my barbarian decided his favorite move was to decapitate stunned foes. Do you have any favorite attack combos?

DDI:
I enjoy using the PSI Lance to reduce the lethal strength of Dragons, followed by body blows to quickly dispatch and capitalize on experience.

DnR:
This game definitely has some similarities to Telengard (in both gameplay and your enhancements) and I must say, I really appreciate how you choose to enhance these games, rather than totally modify them into something else. Have you run into any other similar antiques you feel could use a good DDI polishing?

DDI:
Nothing in the dungeon queue at this time for any olde CRPG's, but you never know what may still be lurking out there.

DnR:
So what's next on the agenda for Dungeon Dwellers Inc.? Have any new projects we can look out for?

DDI:
The MasterCart II is another current project for the Commodore 64 and is a massive 6MB monolithic menu driven cartridge that can be filled up with over 250 disk based games, offering a single scrollable menu, and an infrared remote reset option for gaming from the comfort of a reclined position.  The MasterCart II is a wonderful device to store all your favorites on one cartridge, where the menu can be customized with graphics and a background SID tune, scrollable via either joystick.  The software to compile the ROM images is easy to use and does not require any advanced programming skills.  However, assembly coders will appreciate how easy and direct the banking is to implement.  Perfect for ambitious projects, the MasterCart II is ideal for implementing a massive game that has hundreds of rooms or levels.  The MasterCart II can be used to stream large files, or simply provide fast access to a large storage space for graphics, code, and SID data.  My next project will be to take a wonderful C64 classic that has had thousands of levels written for it, and implement them all in one MasterCart II cartridge, along with the several variations to the original game engine.

DnR:
This about wraps it up for this interview. Dale, my very gracious thanks on the work you've done here. You have really enhanced a somewhat simplified old RPG type-in and made it more fun to play and even interact with in the physical world with your custom cartridge. My hat is off to you. Any closing words/links you'd like to add?

DDI:
Revising The Valley has been a wonderful and entirely unexpected excursion into one of the earliest CRPG games written for Commodore machines, where creating two very unique cartridges for The Valley has been a genuine pleasure.

RELATED LINKS:

sys64738.net - Home of DDI Projects
Shareware Plus - Keep an eye open here for upcoming release info!


I'm almost there!
Dale's Jewel Case Release - Contact him for purchasing details

February 11, 2018

Commodore 128 to 64 Power Supply Adapter



A couple of months ago I picked up a boxed C64 breadbin on Craigslist. Got it home and it wouldn't fire up. The LED was dim and it was giving me a black screen. I checked the voltage output on the power supply and it looked ok, so I started looking into possible fixes for this issue and during my tests had the power supply eventually stop giving any voltage at all. It just died. I opened the power supply to find it was one of the resin covered bricks, so basically, it's a goner. I have a few Commodore 128 supplies and learned that they output the correct voltages for a C64 as well. I considered butchering one and making a dedicated C64 supply, but hated to do that, especially if the C64 had enough wrong with it, that it'd be shelved anyway. So... I looked for some ideas online and found a person who actually made an adapter with a C128 female plug on one end and a 7 Pin DIN on the other end that would plug into the power supply and then into the C64. I liked this idea and wrote to the person, but they informed me that they no longer had any of the C128 plugs to use and would need to pull some off dead C128's.

THE IDEA:

So, my quest continued to bring this old C64 to life and I got the idea to wire some sort of connector such as a Female VGA connector to the end of the C128 power supply that could connect to two separate connectors I'd make, one being a Male VGA to 7 Pin DIN (for C64) and the other a Male VGA to 5 Pin C128 plug. This way I could connect either adapter cable to the Female VGA for whichever system I wanted to power. 

I threw the idea past Dale from Dungeon Dwellers Inc during a conversation we were having and he thought it sounded good, but suggested I didn't even need to use 3 connectors and that I could just use a Male & Female 7 Pin DIN connector. This method would allow me to plug the C128 supply directly into the C64 or plug the short Female 7 Pin DIN to 5 Pin adapter in for C128. It was perfect! As they say, two heads are better than one!

GETTING STARTED:

The idea behind this was to cut about a foot long chunk from the end of the C128 power supply, wire a Male 7 Pin DIN connector to the output end of the supply to plug directly into the C64.

Then, taking the chunk I chopped off with the C128 5 Pin plug, wiring on a Female 7 Pin DIN connector that could then be plugged back into the Male end, bringing back my option of powering my C128.

Well, this works fantastic and I'll show you how I did this...

MODDING STEPS:

1. First, I studied over the pinouts for both C64 and C128 connectors to make sure I knew exactly how I was going to wire it all up without blowing anything up.


2. I opened the C128 power supply and double checked continuity from the AC/DC lines to the corresponding pins on my pinout diagram. You only have yourself to blame if you do it incorrectly, right?


Luckily, the C128 supply isn't covered in resin!

You can use these points to double check continuity to the appropriate pins

3. Cut off the C128 plug, leaving about 6-12 inches of wire to work with and separate the wires.

Cutting about a foot from the plug and separating the wires. Make sure you peel back the grounding shield and connect it with the shielding of the new DIN plugs.

4. Peel back the grounding shield and tin each of the 4 wire tips with a bit of solder and solder on the Male 7 Pin DIN in this fashion...

C128 POWER SUPPLY TO 7 PIN DIN (C64):

9VAC (Brown) to Pin 6
9VAC (White) to Pin 7
5VDC (Red) to Pin 5
GND (Black) to Pin 2

Here I show how I had to slice along the seam of the shell to allow for the C128 cable to fit (wasn't pretty, but it worked!)

5. When soldering on the Female 7 Pin DIN, just keep in mind, it's backwards from the Male. As long as you use the pinout above, this shouldn't be a problem.

All finished!

6. After you have both plugs soldered. I'd suggest double checking all your wiring using a multimeter from back inside the power supply and from both the 7 Pin DIN and the 5 Pin C128 end. If testing from the C128 plug, it should be the same as when you started. You only have one shot at doing it correctly without possibly frying your computer! I can't be responsible for any mistakes you might make here.


7. If you did everything correctly, you now have a nifty C128 power supply capable of powering either a C64 or C128! Pretty cool, I'd say!


FINAL THOUGHTS:

After I finished making this adapter, I plugged it directly into the C64 and voila! I was greeted with a bright power LED and lovely blue screen! I must admit, I was shocked it worked without needing a PLA chip, as I had read it's a very common symptom of the Commodore 64 Black Screen.

Not sure how many people are in the same situation as I, wanting to power a C64 using a C128 power supply, but if you are and you'd like to have the option of powering both, this was a $1.59 solution that works great for me!

I'd like to give a special Thank You to Dale from DDI for refining my idea and helping this come to fruition.

Cheers!

January 31, 2018

DOSPIx86: A Raspberry Pi Zero powered DOS computer inside a keyboard


Welcome to the future. Or the past. I've never been able to figure that out, which is why last fall I became obsessed with putting a Raspberry Pi Zero inside of an old keyboard. Once I first read about how small the RPi0's were going to be, I immediately thought how cool it would be to have one inside a keyboard. Sort of an all-in-one type of computer similar to the home computers of the 80's. Being me, I have most of the home computers of that era already that interest me, but I thought it'd be cool to try emulating DOS, so that became my mission for this project. I decided to call it DOSPIx86.

TRIALS AND TRIBULATIONS:

First I began looking to see what DOS emulators were available for the Raspberry Pi's. I found two available online. One is called Rpix86 and the other is a port of the well known DOSBox. The author for Rpix86 was very helpful in answering a couple of questions I had. I was curious to know if I could boot directly into the DOS prompt upon power up and also if it would work on a Zero. He wasn't sure about performance on the Zero and said he didn't know of a way to boot directly into the DOS prompt. So... going with that, I decided to go ahead and try my luck anyway. You don't know unless you try, right?

I only found 1 or maybe 2 people who had used Pi's inside keyboards who posted online and although super cool(check this out!), that was a bit much for me price wise and also described using a full sized Pi, not a Zero model. I wanted an older gray/beige type keyboard and I also thought I should try to find one with USB to avoid added trouble during the building process.

This lead me to the Keytronic E03601U1 USB Keyboard, which strangely, as of this writing, is still available on Newegg for under $20! I couldn't find any internal photos, but studying the shape and specs, it looked as though there might be room for a Pi Zero inside.

I took a chance and ordered one on eBay for maybe around $15. When I got it, I opened it up(which btw, is super easy and only uses clips to lock the shell together) and was pleasantly surprised to see a nicely organized and spacious case for modding.


I ordered the remaining parts I thought I'd need and when I received the RPi0 began checking out how I'd make it all fit. I knew I'd need a USB Hub, so that took some time figuring that out. Initially, I thought the Hubpixed would be perfect for what I was doing, but that turned into a bunk deal.

***BUYER BEWARE!*** The creator of  Hubpixed "Vikas Shukla" (http://referencedesigner.com) offers to sell these at his site and on Amazon, but after a few weeks of never receiving mine or responding to multiple emails, I had to file a claim on PayPal(for which I was successful!). Total BS and a waste of time for $15. Screw you man! ***BUYER BEWARE!***

I instead went with the Zero4U USB Hub available through Adafruit. Has the same form factor as the RPi0, since it's designed to stack back-to-back, so it fit nicely inside this case. I also tried the CJMCU-204, which I thought could be sorta cool, but it was too big.

While I was laying everything out, trying to decide how to fit everything inside the confines of the Keytronic keyboard, I looked at my options...

For USB the Raspberry Pi Zero has 1 Micro USB port for power and 1 Micro USB OTG port for external peripherals. I wanted to keep all the wiring inside the keyboard other than the power cable and HDMI cable. But I also wanted extra USB ports for a Mouse, Gamepad, etc., so I started looking into running wire from the test pads on the underside of the RPi0 to the USB Hub.

Underside of the Raspberry Pi Zero: Voltage and USB Test Pads

My thoughts on this were... I'll run the keyboard over to the USB Hub and the power the Hub via the test pads on the underside of the RPi0. Well, the theory of this is sound, but this set me back another month in fact.

I started reading about people who were having USB input dropouts and such with these stacking hubs that use the test pads for connection. I guess the wireless signal from the Zero W's(which is the model of Pi I was using) can interfere with the pogo pins that connect the Pi's test pads to the Hub. As a workaround, they include small Ferrite rings with each Zero4U Hub that wrap around the pogo pins, which didn't help me in my case. Since I wasn't using this as a stackable hub and since I was running almost a foot of wire from the Pi to the Hub, there was a big chance of getting dropouts.

Sure enough, after I had already spaced everything out in my head where the Hub, Pi and wiring needed to be and pretty much putting it all together, my keyboard input would drop out from the Hub. I tried disabling the wireless signals in the Zero W, which seemed to work at first, then started giving me problems again. Then I ordered an older Pi0 without Wireless/Bluetooth... Same issues!!!

At this point I was pretty bummed out. I got an awesome keyboard, fit everything inside, did all my wiring and still had issues running from the soldered test pads.

I did some tests and learned that I didn't have dropouts when I ran a direct USB cable from the USB OTG port on the Pi over to the Hub(with or without wireless enabled). So my next challenge became finding a way to keep my design, but keeping the wires behind the shell of the keyboard.

Sheesh. Writing this sounds like a nightmare. I'll be surprised if this keeps anyone's interest by this point! Lol!

So... Since the placement of the USB OTG Port on the Pi was so tight inside the keyboard, I needed to find a super small Micro USB Connector. The smallest profile Male Micro USB Connector I could find was the USB3150 available from Newark.

The super low profile USB3150 Male Micro USB Connector

I had never ordered anything from Newark, but was very happy with their CSR rep Leslie's help. I ordered some other things from them, such as a Pi3 and some soldering accessories and somehow the order got lost/damaged in the mail during transit(I know, what else can go wrong with this project at this point!). But Leslie was super friendly and had my item replacements sent out immediately and I got them the following day!

Once I had the super small USB3150's, I wired it up and... wait for it... it worked! No dropouts!

So... Now that all that long-windedness is out of the way... Here are some photos of how the project looks, was put together and turned out!

THE BUILDING PROCESS:

Figuring out how to fit the Pi inside

Mounting the Zero4U USB Hub with screws

Here I am testing LED's and Resistors for brightness and activity. I used 2K for the Power and 330ohm for Activity

Prepping my LED's and Power Button for easy installation/Removal

Installed and ready to plug into the RPi0

I cut the keyboard USB cable down to about a foot to run inside and under the circuit board to the USB hub

I replaced the Ferrite ring before installation

Making sure I know which wires connect to which solder point before removing

After trimming the USB cable down to size, I ran it under the circuit board and re-soldered

Trimmed down USB cable re-soldered and running over and under to the USB hub

Marking notches for HDMI and USB Power before using my Dremel

I used a Dremel tool to cut these notches out before smoothing them down with a small hand file

Testing to see if my updated plan will work: Running a USB directly from the USB OTG port to Zero4U hub

This wasn't my first choice, but after having input dropout, using the low profile USB3150 connector saved my design!

I added some 2-pin headers for the LED's and Power Switch: This allows me to open my case if I need to

Zero4U USB hub all in place with the notch cut out and Keyboard/Pi connected

While I was at it, I shaved off a bit of plastic here to allow removal of the SD Card

Everything in place: Notice both the Pi USB and Keyboard USB wiring is under the circuit board

Almost there!

Underside of the keyboard: Notice the small silver screws? Those are mounting the Pi and Hub in place

The Power LED stays on while it's powered up and the Activity LED flickers when the SD card is accessed

All put together!

An old Sierra classic!

BUILD NOTES:

DOS emulation on the Pi's isn't perfect and you can feel that with the RPi0's. They aren't as powerful as their larger counterparts. I was only aiming to run a computer ~286 era, so for me, it works out pretty well. Rpix86 is my choice for this setup. I can run it directly from the Raspbian console and it feels on time with the games I tested. DOSBox didn't perform too well for me with the different configurations I attempted.

For Rpix86 I had to add permissions, so that games could be saved/restored and it also helped load some games I couldn't get working after the initial install. Patrick Aalto the author of Rpix86 covers some of this in his helpful FAQ here. Also, in order for the audio to output to HDMI, I needed to use an -a0 command when loading the emulator.

The LED's are really handy for this setup and I am happy I spent the time installing them. I tend to use the Raspbian desktop for transferring the DOS files. The 3 available USB ports work great for flash drive/mouse and the power switch works great too. I looked into running a custom shutdown/startup script for the power button, but it didn't feel like I really needed it. If the unit is shutdown with a Sudo Halt command, I can simply press the power switch to turn it back on.

To use the Activity LED, I had to add a couple lines of code into the config.txt file in Raspbian:

dtparam=act_led_gpio=23
enable_uart=1

PARTS:

Keytronic E03601U1 USB Keyboard 
Raspberry Pi Zero W
Zero4U USB Hub
3 x 2-Pin Header Sockets/Plugs
1 Green, 1 Blue 3MM LED's
1 Pushbutton Switch



FINAL THOUGHTS:

Well, I hope this post can help someone out there that might be interested in doing something similar with an RPi0 and keyboard. I think this is pretty cool and I'm proud of what I was able to put together with a bit of work. It goes to show that with perseverance you can overcome a lot of obstacles.

I chose to focus on running DOS, but this setup could be used for all sorts of things you can dream up. I think it'd be great for running an Atari 8-Bit Computer, Commodore 64, ZX Spectrum, etc.

One idea out there are keyboard stickers that you can stick onto keys to mimic the keys of older systems. You could use this design with some stickers and have a dedicated Commodore 64 emulator running, etc.

I've seen stickers like these available for different systems
HELPFUL LINKS:

Adafruit: My main source for Raspberry Pi parts
Rpix86 Emulator
Rpix86 - Forum
Raspberry Pi Power LED guide