While attending Bornhack 2024 in Danmark, I came up with the below fun ideas.
Using Python and OpenCV, I made some funny webcam hacks.
Note: My laptop webcam is very bad, a better webcam should give you a more stable result.
First, a virtual workspace flipper. Just using my head movement to flip through my virtual desktops. (Turning left and right)
Next, an image viewer. Using your head movement up, down, left and right to control the image. Note : this is not the same movement as above. This won’t use rotation of your head!
Although there are bad hackers (black hat), the term hacker is being used to describe people who are using technology alternative or even hack food and drinks. Create something new or improve. Mostly using computers, but think of it in a broad way. Programming, 3D designing or printing. Learning new things.
We (me and my girlfriend) went with Bigred (and his girlfriend) and Tyrone. Both good old friends.
With Bigred I made a mini C64 Badge in the last few months. With Tyrone I started coding 6502 Machine Language again. (Planning to release a demo at X2025)
Old badges I boughtExplaining my compile pipeline to TyroneSoldering bus manipulatorCampsite
Stuff I did there:
Programming demo parts (Sprite multiplexing, Music Sync)
Made some demo graphics
Programmed some shaders
Circuit Python hacking on the Badges, no new one this year 🙁
Soldering my Bus Manipulator
Python to generate SIN tables (acme output) !byte $CA,$FE,$BA,$BE
Coding 101 with Tyrone (Acme pipeline, Git and MircoPython on his MCH badge)
Drank too much
Slept too short
Removing gallons of rain water from Tyrone’s tent.
Mini shader in GLSL language
After a week of hacking, we went for a short holiday in Denmark.
Visiting Viking Museums, Old cosy towns, WWII bunkers, the Beach and more. Driving back to the Netherlands, we visited the only surviving VII-C U-boat in the world. (Same as I 3D printed for the Uboot game)
The lone surviving example, U-995, is on display at the Laboe Naval Memorial located in Laboe, Schleswig-Holstein, Germany
I’ve connected the rotary encoder directly to the zero. Although many websites state that you need pull-up resistors, there is no need. Just use the internal pull-up resistors in the Pi.
Example code
GPIO.setmode(GPIO.BCM) # Use BCM mode
GPIO.setup(self.24, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(self.25, GPIO.IN, pull_up_down=GPIO.PUD_UP)
NOTE: Between 24 and 25 is a GND connection
Besides USB HID below XT, C64 and Amiga connectors will be emulated
Testing the first keyboard. It is the 8085-SDK hex matrix keyboard.
It is running on a Raspberry Pi Zero 2, without X server. So the images are displayed using the framebuffer. Also the touch data is read using evdev and the raw devices.
Todo:
HID part
Add a rotary button for the selection of the different Keyboard Layouts
Improvement keyboard matrix calculation to find out which key is being pressed.
Code to control AT/PS2 computers directly using GPIO pins
Add a controller to use Raw controlling of matrix pins ( 6502 C64 hardware for example )
import select
from math import floor
import sys
slot = 0
keysname=[["F","E","D","C","vect-int","reset"],
["B","A","9","8","GO","Single-Step"],
["7","6","5","4","Exam-reg","Subst-mem"],
["3","2","1","0","Exec","Next"],
]
keysnames=[["F","E","D","C","vect-int","reset"],
["B","A","L","H","GO","Single-Step"],
["PCL","PCH","SPL","SPH","Exam-reg","Subst-mem"],
["3","2","1","0",".",","],
]
for path in evdev.list_devices():
device = evdev.InputDevice(path)
if evdev.ecodes.EV_ABS in device.capabilities():
break
else:
sys.stderr.write('Failed to find the touchscreen.\n')
sys.exit(1)
while True:
r, w, x = select.select([device.fd], [], [])
id_ = -1
x = y = 0
for event in device.read():
if event.code == event.value == 0:
if id_ != -1:
yy = floor(( x - 600 ) / 700)
xx = floor(( y - 1377 ) / 226)
if yy < 4 and yy >=0 and xx < 6 and xx >= 00:
if slot == 1:
print(keysnames[yy][xx])
else:
print(keysname[yy][xx])
elif event.code == ABS_MT_TRACKING_ID:
id_ = event.value
elif event.code == ABS_MT_SLOT:
slot = event.value
elif event.code == ABS_MT_POSITION_X:
x = event.value
elif event.code == ABS_MT_POSITION_Y:
y = event.value
I came up with a simple matrix calculation
Pressing the 4 corner keys gave me x and y. I took averages for min and max reading. I don’t need pixel-perfect reading, and I noticed values between 960 and 3080 vertically. We want 960 – 3080 into 4 blocks, but the middle should start @ 960.
So 3080/3 = about 700 700 / 2 = 350 block 1 starts 350 sooner than 960 is ~ 600 Upper key y coords = 600-> + 700 Next is 1300 -> + 700 converting to whole numbers using floor gives me: floor(( y – 600 ) / 700) NOTE: My x and y are rotated
Example using coordinates 1600, 1600 floor(( 1600 – 600 ) / 700) = floor(1,4…) = 1st row (from row 0,1,2,3)
I’ve been busy programming Python and NodeRed for a client. But these are the things I’ve done in the last days.
C64 Assembly: Breaking borders, using sprites and multicolor font intro.
It does not look impressive, but I’ve learned a lot. Found a new way (for me) to open borders and change border colours on predefined raster lines. Sources will be posted.
KiCad tutorial, posted on YT also because I could not find many resources about the subject online. Maybe it’s helpful
Video editing using Kdenlive.
Edit: Even faster, use Netlabels, no need to join pins. Press L (uppercase) select pin 1, name 1. Press and hold insert until all pins named. Copy paste socket 5 times and goto your PCB tab.
This movie is about creating a backplane for a 6502 SBC I’m building. It is real-time and below 4 minutes.
Multi Keyboard
My small multitouch screen came in. This is for my previously mentioned multi-computer case.
It is going to show multiple keyboard layouts for different systems. (See previous posts about this)
Waveshare display, Raspberry Zero as HID device, using USB and pin emulated keyboards. (c64 matrix, AT (DIN) keyboard, ps2 keyboard)
Some example screens
Vic-20
Photo-realistic
Petscii C64
Another C64
I’m also going to make a layout like the keyboards on my 8085
GameA masm setupExample asm program to see gfx capabilities
68000 Progress
My address decoder seems to work (using an ATF22v10C) See previous posts.
Also new Rom and Ram chips. These are 8 bits, but the 68000’s data bus we need two (Odd and Even Addresses)
C64 Hacks
I made a proof of concept for a Rom switcher. 8 Different Roms can be selected using the dip switches. (Dipswitches are being replaces bij something smarter in the future, like an Arduino Nano (like Adrian Black’s solution)