Barcode Hunter: gaming on a logistics terminal
I like doing small projects and one-off games for my kids, and I’ve recently acquired a handheld industrial PDA with a barcode scanner that suggested an idea of a barcode-scanning game. It was quite successful, as it kept my son busy for a …A physical minimalistic incremental game on micro:bit
I often chat with my son about computer games on the way to the school in the morning. One topic that comes up fairly often are the incremental games, which we both like and enjoy in various forms - I usually play browser-based ones and my …Adventures in hardware, part 11 - digital circuit design in Deeds
I like it when software is fun to use, and Deeds is fun! While playing around and doing the exercises from the the nand2Tetris course I’ve ended up discovering an awesome software for digital circuit design - Deeds , created by Giuliano …Page faults in emuriscv explained (and bugs fixed)
I’ve fixed two more bugs in the RISC-V emulator recently, both related to memory paging . The first one was caused by only supporting a one third of the possible page faults, the second one was closely related to page faults as well. Load / …Online 6502 disassembler
I’ve already visited the wonderful MOS 6502 architecture in a post titled Fantasy console on a console where I ported my 6502 emulator to the Gameboy Advance. Keeping in the spirit of implementing web applications in C, I’ve extracted and …Breaking and fixing the RISC-V Store-Conditional instructions
Trying to debug the Linux boot process on the emuriscv RISC-V emulator has led me to discover another fun bug, one that appears when you don’t read the specification as thoroughly as you should. The bug manifested itself by an endless loop …Converting Slovak text to Braille
My visually-impaired friend asked me for help in developing a conversion tool for the Slovak text into the Braille code. The idea was to convert the text into an equivalent Unicode Braille pattern . These could be further utilized, for …
5 min read -
javascript
interactive
Windows 2000 on an ARM Pinebook
I thought it would be fun to run Windows 2000 on a Pinebook - a nice little ARM-powered laptop. As there is no version targetting this architecture, we have to use an emulator. QEMU is a nice free choice to run on Linux, and it supports the …Sudoku development diaries - part 2
After developing the basic parts of a Sudoku game in text mode, I was looking for UI toolkit to make it playable with a mouse. After checking various options for a while I ended up using Dear ImGui . See also Sudoku development diaries - …Code golfing tips and tricks
This is a companion article to the 4-in-1 game for taskbar post, which has four playable games for the Windows taskbar in 3727 bytes of code describing the techniques of code size reduction. Table of contents: Shorter identifiers …RISC-V Linux syscall table
Here’s a list of Linux system calls for the RISC-V architecture. Click the syscall name for the related manpage. See also syscalls(2) . RISC-V System call table Use the fuzzy filter box for search:Filter # Call Prototype var …Fun with floating-point assembly (in RISC-V and x64)
There was a fun little exercise in an old Fortran book that involved approximating a cube root using the Newton method to a specified accuracy. I’ve implemented this in multiple high-level languages and then moved on to two different …(Mis)understanding RISC-V ecalls and syscalls
After spending some time with emuriscv and attempting to boot Linux into a shell I realized that I’m doing something really wrong regarding system calls. RISC-V offers an ecall (Environment Call) instruction to implement system calls. These …Online RISC-V disassembler
Making a nicer disassembler I’ve had a rudimentary disassembler in the emuriscv emulator, but compared to other disassemblers out there it was not very refined. Debugging and fixing the emulator required me to read a lot of disassembled …RISC-V supervisor mode
RISC-V features multiple privilege levels (machine, hypervisor, supervisor and user mode). The cores (harts) power up in machine mode, which is mandatory in all RISC-V implementations. Operating system kernel is typically loaded in …Booting RISC-V on QEMU
For reference, I wanted to check how qemu boots RISC-V Linux. Loosely following a guide , I describe how to build and boot a Linux environment targeting the 32-bit RISC-V architecture. There are three things we will need: QEMU the emulator …Revisiting RISC-V emulator in 2021
This week I’ve revisited my RISC-V emulator project emuriscv - https://github.com/jborza/emuriscv , as I’m still intrigued by the idea of booting Linux on my own CPU emulator. I’ve worked on and off on this project since 2019, it initially …Rolling your own on-screen keyboard
Rolling your own on-screen keyboard I wanted to play the Robotics;Notes visual novel on my Windows touchscreen tablet, but unfortunately the game only supports keyboard controls. While connecting a hardware keyboard is an option, it’s kind …Sudoku development diaries - part 1
I’ve been playing Sudoku on my phone for the past few weeks, learning new techniques and generally having fun. I thought it would be interesting to apply the playing skills in implementing a Sudoku game from scratch. I’ve spent several …Fixing Saitek Heavy Equipment Wheel
As a fan of simulator games I’ve also tried a couple of steering wheel setups. I’ve been playing truck , bus and farming simulator games recently and wanted a somewhat different wheel. The complete kit costs 249 € new and as usual, I tried …Fixing laptop reboot after waking up from sleep
One of the most frustrating experiences with a computer is putting it to sleep, only to find it waking up as if it had been restarted. My ThinkPad T440p has guilty of doing exactly that every so often. This is not what you typically …Notes from Programming in Lua
See the source book Programming in Lua targeted at Lua 5.0. Here are my notes in case I need to come back to it. I’ll mostly note the differences to Python as that’s what I’m used to these days. Chunks Every piece of code is a chunk …
5 min read -
lua
Writing a Forth interpreter - part 2
In the first part I started to describe a simple Forth interpreter. I eventually completed it and made it more usable - so in this part I’d like to get into the details of the interpreter mode, allowing the user to utilize the builtin …My third FPGA (for 10€)
Sipeed Tang Nano FPGA development board I like FPGA development boards and I’m excited that there are products that exist outside of the Xilinx / Intel duopoly. This branch of the Chinese semiconductor industry is still developing and I was …CHIP-8 on Nokia 3410
Mobile development like it’s 2002 I thought it’d be fun to develop something for a mobile phone. Thus I did a quick port of my previous CHIP-8 emulator from C to Java. Nokia 3410 looked like a fun target, having a screen resolution of 96x65 …4-in-1 game for the taskbar
A collection of minigames under 4 KB As a kid, I had a cheap 8 in 1 Brick Game handheld console, which had LCD display with large dots, 4 directional buttons and a speaker. Along with a couple of Tetris variations it had games like car …Wiring car instruments for fun
Car accessories as game controllers? I got inspired by the CAN BUS Gaming Simulator post on hackaday, where Leon Bataille connected a VW Polo dashboard and switches to Euro Truck Simulator 2. I’d like to do something similar, but with with …CHIP-8 in hardware - part 3 (drawing, VGA)
In the last part I ended up with a partially working CPU with most of the single-clock instructions implemented. So far, all of the testing was done in simulator only, and it’s about time to to get a visual output, so I implemented the …CHIP-8 in hardware - part 2 (CPU)
Continuing with the implementation of CHIP-8 in Verilog, I wanted to continue with the CPU module and get it to actually execute some instructions, so we’ll build an instruction decoder, CPU states and a register file. As described in the …CHIP-8 emulators inconsistent behavior
CHIP-8 arithmetic behavior and VF variable I’ve been fiddling with CHIP-8 and writing a sample program in Octo - a CHIP-8 IDE/assembler with a nicer scripting language than raw opcodes. I wanted to make a demo to try out various opcodes and …
2 min read -
chip8
CHIP-8 in hardware - part 1 (ALU)
I got into FPGAs with the intent of building a retro-computer. A couple of popular hardware implementation targets are Gameboy, NES, RISC-V and CHIP-8. Last year I’ve done my practice round with 6502 and RISC-V emulators, both in C. CHIP-8 …FPGA VGA serial display
VGA on an FPGA In the previous articles I’ve mainly interfaced with LCD displays. I thought it would be nice a produce a VGA output from my FPGA board. I’ve already had a working framebuffer-based display controller that can be written to …CHIP-8 emulator in C
CHIP-8 is one of the most popular target architectures for aspiring emulator writers. I’m planning to implement it in hardware, so I thought that writing a software emulator/interpreter would be enlightening. I was also looking for some …ModelSim and testbenches revisited
There seems to be a better way to run ModelSim than I originally described in the LCD controller post , where I was a bit lost with the tooling. (Optional) - setting up ModelSim paths If you didn’t do this when the project was created, set …Adventures in hardware, part 10 - FPGA serial display
Doom on a screen, again Recently I’ve been playing with displaying DOOM on various devices (a smart watch and a smallish IoT stick), and previously I also played with a 128x64px LCD screen connected to my FPGA board. After an afternoon of …Adventures in hardware, part 9 - FPGA calculator
A pocket calculator on FPGA One potato two potatoes Three potatoes, four! Five potatoes, six potatoes Seven potatoes, more! As a follow up to one of my first FPGA projects Adventures in hardware, part 3 - display and a calculator I wanted …Adventures in hardware, part 8 - PS2 Keyboard Typewriter
What will we do with a drunken keyboard? What will we do with a drunken keyboard? What will we do with a drunken keyboard? Early in the morning! A sea shanty from early 19th century After I implemented a display of memory-mapped display in …Adventures in hardware, part 7 - Stopwatch with a memory-mapped LCD controller
I wanted to play a bit more with the 128x64 LCD display and the FPGA board, while also exploring the memory-mapping concept of the retro computers. I thought I would like the LCD to display pixels/characters from memory, that would be …Adventures in hardware, part 6 - 128x64 display
Displaying things on a 128x64 display from an FPGA One of my FPGA boards came with a connector for a parallel-interface 12864 display, so I ordered one online, soldered 20 pins, used sample code provided by the vendor and it lit up. …My First Altera FPGA
Over a month ago I bought an Altera Cyclone IV board from a local seller, it seems to be listed on Aliexpress as well. It’s marked as A-C4E6E10, and features: Altera Cyclone IV EP4CE6E22C8 FPGA chip with 6272 logic elements, 270 Kbits of …M5Stick digital hourglass
I thought it would be cool to have a digital hourglass. The M5Stick-C with its 80x160 pixel LCD screen, battery, buttons and accelerometer has all the equipment I need. The development process A JavaScript prototype Link: …MCPU emulator (and ATTiny85 port)
MCPU is a neat minimal 8-bit CPU (CPU design by Tim Boescke in 2001, cpldcpu@opencores.org) - see its opencores project file and GitHub repo . It fits into 32 macrocells on a CPLD and can operate on 64 bytes of RAM. Being a minimal CPU it …Adventures in hardware, part 4 - LED expander
Why more LEDs? During the process of developing a 4x4 keypad reader I realized I need more LEDs for diagnostic information. As my Elbert v2 has plenty of digital input/output pins, it should only be a matter of wiring the LEDs to the IOs. …Adventures in hardware, part 3 - display and a calculator
Let’s do a calculator Let’s make a very simplistic 3-bit calculator that will: add or subtract number A and B number A is entered by DIP switches 1,2,3 number B is entered by DIP switches 4,5,6 operation (+/-) is defined by DIP switch 8 …Adventures in hardware, part 2 - even lower level
I’ve went through the first part of From Nand to Tetris course where I learnt to build a simple 16-bit computer called Hack from the digital building blocks (NAND gates). The course used its specific HDL (hardware definition language), …Detecting directional taps on M5Stick-C
As M5Stick only has three buttons, I wanted to prototype a control scheme based on accelerometer either by tilting or tapping the device from the sides. Maybe we can reliably detect “directional” taps on a device in order to move a cursor …Lower level adventures, part 1
Closer to the machine I started my way with programming with Microsoft QBASIC on DOS, I did try (and succeed) to copy code for a game from a BASIC book, and it did run, but I didn’t really “get” development back then. I didn’t really …
5 min read -
hardware
Implementing Solitaire in C
Solitaire was the first computer game I have played, ages ago, on an ancient Windows 3.1 laptop. I have never actually implemented it. When I say Solitaire, I actually mean the Klondike variant, which I think is the most commonly known …M5Stick rude watch
I bought the M5StickC ESP32 mini IoT development kit and wanted to do a fun project. Some of the kits come with a wristband, the board features a real time clock module, so it could also work as a wristwatch. I’ve seen a fun picture once …Programming Fizz-Buzz in Forth
After finished implementing my Forth interpreter I was finally ready to do some programming in Forth. Let’s do the famous Fizz-Buzz test . The assignment goes: “Write a program that prints the numbers from 1 to 100. But for multiples of …Writing a Forth interpreter - part 1
Forth the language Forth is a funny language. One of the so-called stack languages, it doesn’t really care about types, isn’t functional or object-oriented. It also has very easy syntax - identifiers (called words) are separated by …Writing a monitor console for emuriscv
As a follow up to the previous post Debugging things running in your emulator I thought it would be nice to write a monitor console for the emuriscv RISC-V emulator. With a monitor console one can interact with whatever is running inside …Updating the RISC-V Linux environment
As I planned to work some more on the emuriscv RISC-V emulator, I wanted to upgrade from Linux 4.15 and buildroot from 2018 to something more recent. Buildroot-2020-02 supports compiling the image against Linux 5.x headers, while the 5.x …Installing FreeBSD 12.1
I wanted to check out FreeBSD as I recently acquired a venerable Thinkpad T61. I have played around ages ago, but wasn’t sure how usable it is today as a Unix desktop. I initially did a test run in a virtual machine, later on the physical …Test-driven emulator development
Test-driven development is a software development process where you write a test before writing a code that satisfies that test, then refactor and continuously validate that the requirements are still fulfilled. How can we leverage this …Debugging things running in your emulator
You’ve written an emulator, how do you debug anything running inside? In this post I’ll try to describe what I did (and thought of doing), starting from the most crude methods. Using the IDE and debug the emulator binary Here you can read …Building up a RISC-V Linux with Buildroot
A friend told me about a cool new open-source instruction set architecture called RISC-V (pronounced risk-five). As I wanted to learn more about the architecture, I decided writing an RISC-V emulator (emuriscv) would make sense. One of my …Setting up Pi-hole and PiVPN in Azure for privacy on the go
I don’t like online ads too much. The easy option on a computer is to use an adblocker, but on some devices you are out of options (smart TV, or mobile games with in-game ads). I have started using Pi-hole about 2 months ago on my home …
4 min read -
privacy