programming


CGI Сoffee

How to Survive Without a Numpad. Alt ♫ Code ☼ Emulation ♥ on Tenkeyless (TKL) and Laptop Keyboards With Autohotkey, the "Unix Way"

I have recently obtained an extremely hard to find retro keyboard I always wanted.

It's one of those models with tactile mechanical switches, but not the deafeningly loud buckling spring ones. It both looks majestic and can actually be used on a modern PC thanks to the USB 1.0 interface.

Take a look. It's glorious!

my-retro-mechanical-keyboard

Typing on it brings back memories of the old-school terminal computers, and the time when I typed my first words on a similar mechanical, solidly built keyboard. Which might explain why I have come to love expressing my thoughts through writing so much =)

Ahem, anyway… There is just one tiny little issue with this keyboard. Coming from the early 2000's it completely lacks n-key rollover. Which makes it entirely unsuitable for gaming or any other applications where you're expected to press and/or hold several non-modifier keys simultaneously.

Think "WASD" 1st person shooter controls. That's not possible on a "retro" keyboard.

Online keyboard N-key rollover test

BTW, you can test your keyboard's rollover capabilities here.

I don't game much on my main PC, instead usually going for either one of my consoles or a fairly powerful guest-room laptop, which are all connected to a projector. So it's not really an issue. But I would like to have an option to make use of my monstrous RTX 4080 not just for rendering, video editing/encoding and running CUDA-accelerated apps, but for gaming also.

Consequently, I decided to get one of those compact wireless/wired "gaming" mechanical keyboards that are all the rage right now.

My Little Keyboards, My Little Keyboards...

After an extensive research, initial confusion and even shock, I landed on these two cuties. They both look so retro and slick, that I had to get both. Don't you judge me.

tkl-keyboard

compact-keyboard

And if you look carefully enough, you might notice that they both lack a numpad!

Whaaaat?

Hello Again, Unity. I Missed You

Some time ago I bashed Unity Game Engine (the Editor in particular) for its instability and lots of quirks and questionable changes that took place over the years following the version 4 release of the Editor.

Fast forward to this September. I'm done with my microcontroller shenanigans and have mostly finished the Design Document for the game I talked about quite a while ago (which took a lot of planning, for I am a project manager after all).

What's the next step then? — Exactly!

Prototyping!

So I've been playing with the latest "LTS" version of the Unity Editor 2021.3.7 and...

Wow!

And I mean a good wow:

  • It's rock solid and hasn't crashed once even when I was importing some of my older code and extension methods from the previous game which I wrote in 2012-2015. And 95% of the code-base ended up being non-obsolete! I guess Unity APIs didn't change that much over the years, huh? How cool is that?
  • Package Manager is amazing. Cutting some of the features of the engine from the binary/default assembly and turning those into officially supported packages with the added convenience of being able to download and update them as you please? What a deal!
  • Unity Addressable Asset system (or "Addressables"). Nuff said. This is a feature Unity devs had been dreaming of for like a decade
  • Nested prefabs. I know, I am a slowpoke, since this is not a new feature, but there is a difference: they work. Compared to my previous experience with nested prefabs in Unity when they would crash the editor like 50% of the time when I was editing them – now we're actually usable! Huzzah!
  • Integration with Visual Studio is very solid, pleasure to work with
  • I looks the same, feels the same and despite adding new features like DOTS and burst compiler, Unity team didn't change the paradigm too much, so being a knuckle-headed brute that I am I can continue using ScriptableObjects and MonoBehaviors for most of my objects and scripts. Yay!
  • C#. Yes, C#. That C#. It's not new of course, but it's C#. It's C#, you see. It's not C or C++. It's C#. I love C#, I guess that's what I'm trying to say
  • Also, Asset Store is still a thing. And can still save hundreds of hours of development for a couple hundred bucks
  • Oh, yeah, it's still free of charge for indie devs. Just sayin'

All in all, the time has come...

Unleash the monkey coder!

monkey-coder

Putting "Smart" Into Smart Devices: Enter the World of Microcontrollers With WiFi and Bluetooth. Learn to Build Your Own Smart Devices Using Off-The-Shelf Components

This post is not a comprehensive dive into the world of microcontrollers, but rather a brief introduction and a compilation of interesting facts I've collected over the months working on a couple projects that made use of contemporary microcontrollers to achieve real and practical goals.

The Harsh Reality of Reality

I'm sure you're well aware of the situation with microelectronics prices. It's been getting worse for a couple years and doesn't look like it will improve any time soon due to the on-going crisis in several areas at once: semi-conductor component shortages, logistics issues, political games, socioeconomic factors and everything in between. For an average technically-minded person this means that one must look for creative ways to achieve their goals or alter those altogether.

We do live in the real world after all, and one must adapt or perish.

pi-4-price

Remember "low-cost single-board PCs" we eagerly watched evolve and get cheaper over the years? All of those Raspberry/Orange/Rock Pi's and "Zeros", Tinker boards and Jetson Nanos? Oh they did evolve all rightInto overpriced 100+ USD boards. So now we're stuck in a reality where even the simplest single-board ARM PC in the form of a Pi Zero W is valued at 100 USD instead of expected $15-20.

pi-zero-price

So… What Do?

There are practical alternatives to single-board PCs:

  • Small x86/x64 PCs
  • Microcontrollers

The first option is blatantly obvious if you're looking for a device with a real multitasking OS and a load of compute power. And used PCs nowadays? They are cheap. For a market price of about $150 for a Raspberry Pi 4 with 4GB RAM you can get a used mini-PC with a 4-core Pentium/Celeron CPU, 4 to 8 gigs of extendable RAM and a 128GB+ SSD system drive with an option of connecting a second drive via SATA or M.2.

mini-pcs

Almost any PC will blow a Pi out of the water performance-wise. Sure, small PCs can't beat Pi boards' dimensions, power consumption and embedded IO-capabilities with over 20 I/O pins exposed for communicating with external devices. So if you're looking to set up a home web/file server, retro emulation station or use the machine as a simple desktop PC, opting for a used mini-PC today would be a no-brainer.

But what if you actually require rich I/O capabilities, small dimensions and low power-drain of a small single-board device?

Enter… Microcontrollers!

Upcoming Blog Post — Microcontrollers!

The full post is available now.

Not much to see here but a short announcement of the upcoming post about microcontrollers.

I've been dying to take a deep dive into this topic ever since I built my first PC, but was scared away by the complexly of both the programming and the hardware aspects of the whole endeavor. And now, 15+ years later, I finally built up some courage to try and program one of those and it turned out to be an incredible and very, very straightforward and rewarding experience! What helped motivate me to finally bite the bullet was the worsening availability of semiconductors and the price hike on almost all electronic components and devices that followed suit.

Microcontroller on a breadboard

What must have also contributed was another project of mine where I modded a Panasonic RX-DT75 by adding audio over Bluetooth support via a new a voltage regulator with USB-level output, to which a Bluetooth USB module was then connected to gift this machine a new lease on life as a useful appliance and not just a relic of the past collecting dust on a shelf.

Panasonic RX-DT75 Bluetooth Mod

But boy would it still make one gorgeous dust-collector regardless!

Panasonic RX-DT75

Anyway, back to work!