Putting The C In C64

Older CPUs and some fairly modern microcontrollers are not made to readily support C compilers. Among those are the 1802, some 8-bit PICs, and the 6502 at the heart of the Commodore 64. That’s not to say you can’t make a C compiler for any of them, but the tricks required to handle the odd word sizes, lack of stack manipulation, or whatever other reason C isn’t a good fit tends to make compiled code bloated and possibly slower. [Dr. Mortal Wombat] took a different approach. The oscar64 compiler takes C source code and compiles it to a virtual machine code or native machine code for cases where performance might be important.

Turns out, the penalty for using native code isn’t as much as predicted, at least in some cases, The performance penalty for using the interpreter, however, can be significant in many common cases. The 6502 has a small stack that is hard to address, and indexing into a user-maintained stack is slow. The word size problem also produces lots of code as you have to break 16-bit operations into multiple 8-bit ones. The compiler aims to be C99-compliant, including floating point, recursion, multiple dimensions for arrays, and pointers to structures.

There are a few things left to hammer out. The linker doesn’t support external libraries, and the floating point code doesn’t understand NaN. On the other hand, many C++ features are available, like namespaces, reference types, templates, and more. The compiler can target several Commodore machines from the C128 to the PET. It also works with some Nintendo and Atari systems and can create various cartridge formats.

If you are writing code for any kind of 6502, it is probably worth checking out. Compiling C for the 6502 is no small feat, but then, so it is targeting PowerPoint. Don’t have a C64? Build one.

Image: [MOS6502], CC-BY-SA 3.0

Darkroom Robot Automates Away The Tedium Of Film Developing

Anyone who has ever processed real analog film in a darkroom probably remembers two things: the awkward fumbling in absolute darkness while trying to get the film loaded into the developing reel, and the tedium of getting the timing for each solution just right. This automatic film-developing machine can’t help much with the former, but it more than makes up for that by taking care of the latter.

For those who haven’t experienced the pleasures of the darkroom — and we mean that sincerely; watching images appear before your eyes is straight magic — film processing is divided into two phases: developing the exposed film from the camera, and making prints from the film. [kauzerei]’s machine automates development and centers around a modified developing tank and a set of vessels for the various solutions needed for different film processes. Pumps and solenoid valves control the flow of solutions in and out of the developing tank, while a servo mounted on the tank’s cover gently rotates the reel to keep the film exposed to fresh solutions; proper agitation is the secret sauce of film developing.

The developing machine has a lot of other nice features that really should help with getting consistent results. The developing tank sits on a strain gauge, to ensure the proper amount of each solution is added. To avoid splotches that can come from using plain tap water, rinse water is filtered using a household drinking water pitcher. The entire rig can be submerged in a heated water bath for a consistent temperature during processing. And, with four solution reservoirs, the machine is adaptable to multiple processes. [kauzerei] lists black and white and C41 color negative processes, but we’d imagine it would be easy to support a color slide process like E6 too.

This looks like a great build, and while it’s not the first darkroom bot we’ve seen — we even featured one made from Lego Technics once upon a time — this one has us itching to get back into the darkroom again.

Continue reading “Darkroom Robot Automates Away The Tedium Of Film Developing”

There Are Stradi-various Ways To Make A Violin, And This Is One

We’ve always said that if we had enough money, we’d have a large room that housed every musical instrument we’ve ever been even mildly interested in. While that dream may never come to pass, it would be far more likely to happen if many of the instruments could be 3D-printed, like this electric violin.

We really like this compact design, which mimics a headless guitar with the tuning pegs down by the bridge. [Carmensr] started with a model on Thingiverse, which uses violin strings wound around electric guitar tuners instead of wooden friction pegs. To further the guitar comparison, the three-piece neck contains a truss rod of sorts.

So how does it work, though? The magic is in the special bridge, which contains a piezo element. The bridge picks up the strings’ vibrations and sends them to a little pre-amplifier, which creates a signal that can then be used by a program like Audacity or connected directly to a speaker. Be sure to give it a listen in the video after the break.

Of course, there’s no reason not to design and print acoustic violins. It would be fun to experiment with different filaments for different sounds.

Continue reading “There Are Stradi-various Ways To Make A Violin, And This Is One”

Make Your Own Play Station (The Space Is Important)

The early history of the Sony Playstation lies in a stillborn collaboration between Nintendo and Sony to produce an SNES with a CD-ROM drive. So the story goes, Nintendo’s Philips deal angered Sony, who decided to make their own console line, and the rest is history. A very small number of prototypes were made, badged as “Play Station,” and should you find one that escaped today, you’re sitting on a fortune. [James] doesn’t have one, but he did have half a Playstation and an SNES shell, so he could make an ungodly child of the two consoles that you can see in the video below the break.

Those Playstation CD-ROM drives were notorious for melting back in the day, so it’s no surprise they’re still for sale today. Thus, he was able to bring the Sony back to life. What follows is an episode of console cutting worthy of a slasher horror movie, as instead of a bit of fine Dremmeling, he brings out an angle grinder and slices away with abandon. We don’t like the Nintendo switch carrying mains voltage, but we’re fine with the PlayStation expansion connector going away. The Nintendo eject button needs a hack to operate the Playstation door open button when pressed. It’s cool to see the board has a mod chip. We used to fit those as a sideline in a previous life. Continue reading “Make Your Own Play Station (The Space Is Important)”

Liquid Tin Could Be The Key To Cheap, Plentiful Grid Storage

Once expensive and difficult to implement, renewable energy solutions like wind and solar are now often the cheapest options available for generating electricity for the grid. However, there are still some issues around the non-continuous supply from these sources, with grid storage becoming a key technology to keep the lights on around the clock.

In the quest for cost-effective grid storage, a new player has entered the arena with a bold claim: a thermal battery technology that’s not only more than 10 times cheaper than lithium-ion batteries, but also a standout in efficiency compared to traditional thermal battery designs. Fourth Power is making waves with its “sun in a box” energy storage technology, and aims to prove its capabilities with an ambitious 1-MWh prototype.

Hot Stuff

Simple heating elements turn electricity into heat, putting it into liquid tin that then heats large graphite blocks. Credit: Fourth Power, Vimeo screenshot

The principle behind Fourth Power’s technology is deceptively simple: when there’s excess renewable energy available, use it to heat something up. The electrical energy is thus converted and stored as heat, with the idea being to convert it back to electricity when needed, such as at night time or when the wind isn’t blowing. This concept isn’t entirely new; other companies have explored doing this with everything from bricks to molten salt. Fourth Power’s approach involves heating large blocks of graphite to extremely high temperatures — as high as 2,500 °C (4,530 °F). Naturally, the hotter you go, the more energy you can store. Where the company’s concept gets interesting is how it plans to recover the heat energy and turn it back into electricity.

Continue reading “Liquid Tin Could Be The Key To Cheap, Plentiful Grid Storage”

Bringing A Chain Printer Back To Life: The Power Supply

[Usagi Electric] has his Centurion minicomputer (and a few others) running like a top.  One feature that’s missing, though, is the ability to produce a hard copy. Now, a serious machine like the Centurion demands a serious printer. The answer to that is an ODEC-manufactured printer dressed in proper Centurion blue. This is no ordinary desktop printer, though. It’s a roughly 175lb (80 Kg) beast capable of printing 100 lines per minute. Each line is 132 characters wide, printed on the tractor-feed green bar paper we all associate with old computer systems.

This sort of printer was commonly known as a chain printer, as the letters are on a chain that rides over a series of 66 hammers. Logic on this printer is 74 series logic chips – no custom silicon or LSI (Large Scale Integration) parts on this 47-year-old monster.

Continue reading “Bringing A Chain Printer Back To Life: The Power Supply”

Half Power Bank, Half Spot Welder

There was a time when every gizmo on AliExpress also had a big white LED so it could also work as a flashlight, but maybe the power bank is the new flashlight. [Aaron Christophel] has a battery spot welder that costs a not unreasonable 30 euros and can also be used as a novelty power bank. He subjects it to a test and teardown in the video below the break.

First of all, he conducts a few weld tests, and we have to say it seems capable of some reasonable results if its parameters are correctly adjusted. Then the end comes off the extruded aluminium case, and the guts of the device are slid out for a teardown.

The power comes from a pair of Li-Po pouch cells, while on the board, there’s an STM32 clone providing the timing for a set of MOSFETs that do the heavy lifting. There’s a colour display for tweaking the settings. Alongside all this, there’s also a small chip for that power bank functionality. Charging is via USB-C, though, of course, it’s not really proper USB-C but a USB-C socket that expects 5 volts. This is a disappointing trend in cheap electronics that sullys the promise of USB-C.

It seems this spot welder is capable of doing the job, which is pleasing after our previous disappointing look at battery welders.

Continue reading “Half Power Bank, Half Spot Welder”