65c22 connected, new data, and address-bus ribboncables!
First led on Register B blinking!
Notes: Temporary display wil be 2×16 Chars. Ram in place, but not connected (is emulated by the Arduino Mega at the moment) Rom is somewhere halfway the atlantic ocean .. still waiting on that one. Ben Eatons clock module is disconnected, i’m using the Arduino as programmable clock right now. (There wil be a little display and a rotary encoder to set clock speed.)
lda #$ff ; all bits
sta $6002 ; set direction (out) for B register
lda #$80 ; set 1 bit
sta $6000 ; set register B
lda #$00 ; reset bit
sta $6000 ; set register B
jmp $8005 ; jmp to bit set part
Almost … friday will be the day i’ll attend May Contain Hackers. Besides the awesome villages and talks.
UPDATE: 20220727 UPDATE: 20220812
You get a hackable badge, this one is more amazing as previous versions.
I can’t wait to have a go at this cool gadget. I personally could do without the pcb fancy design.
Espressif ESP32 Wrover-E with 16MB of flash storage and paired with 8MB of PSRAM, for front-end badge computing and compatibility with the badge.team ecosystem back to the 2017 SHA badge.
Lattice ICE40UP5K FPGA for hardware-accelerated graphics and user FPGA hardware designs.
Raspberry Pi RP2040 for advanced USB communication and board management.
2Ah LiPo battery to give you a full day of fun on a charge.
16-bit DAC with stereo output to headphone socket, onboard mono speaker.
ILI9341 2.2 inch TFT display with a 240 by 320 pixel resolution.
Bosch BNO055 orientation sensor.
Bosch BME680 environmental sensor.
The usual array of addressable LEDs.
SAO and Qwiic expansion connectors, FPGA PMOD expansion, plus onboard prototyping area.
Downloadable apps, micro python, Arduino ide programming. All kinds of GPIO pins, leds buttons, sound. Check out https://hatchery.badge.team/
You can play with this virtually here! https://wokwi.com/projects/335445228923126356
So much potential! Great start for a DIY project.
I won’t post about the workings, thats all well documented online. I shall post about the hacks/findings i personally did.
UPDATE: 20220727 Made a micropython program to keep your NameTag level to the ground (Better version)
UPDATE: 20220812
Someone made a 8bit logic analyser using the pmod connector !
I’ve used a basic program on C64 in the past and a Cartridge machinecode monitor in the past. I’ve really forgotten how, what i’ve used and what i’ve done with it. Not nearly as much as my friends at that time. I started with a Vic-20 and played around with machinecode on a 6502. I didn’t have a C64 for many years.
How much funit this!
I’ve recently started to build a 6502 computer again, and programming on 65xx again (Generic 6502 and C64). (2022)
Below is my setup on linux, to write assembly code, compiling and running the code in a emulator.
I have installed the Acme compiler and Vice as a emulator. Both can compile/run machinecode for multiple computer emulations. So maybe i can run my old Vic-20 machine code or the few C64 programs i’ve written.
I’ve only made the bash script, the included asm files i copied from someone on the internet. ( Credit lookup )
makeprg bash file:
#!/bin/bash
set -x
f=""
if [ "$2" == "f" ] ; then f="-fullscreen" ; fi
if [ ! -f $1.asm ] ; then
cp template.asm $1.asm
fi
vi $1.asm
acme --cpu 6510 --format cbm --outfile $1.prg $1.asm
if [ ! $? -eq 0 ] ; then exit 1 ; fi
c1541 -format foo,id d64 $1.d64 -write $1.prg
if [ ! $? -eq 0 ] ; then exit 1 ; fi
x64 $f $1.prg
template.asm
!source "basic-boot.asm"
+start_at $0900
; Set background and border to black
ldx #$00
stx bgcol
stx bocol
; Flicker border and background
.loop
inc bgcol
inc bocol
jmp .loop
basic-boot.asm
; A BASIC booter, encodes `10 SYS <address>`.
; Macroified from http://www.pouet.net/topic.php?which=6541
!source "constants.asm"
!macro start_at .address {
* = basic
!byte $0c,$08,$00,$00,$9e
!if .address >= 10000 { !byte 48 + ((.address / 10000) % 10) }
!if .address >= 1000 { !byte 48 + ((.address / 1000) % 10) }
!if .address >= 100 { !byte 48 + ((.address / 100) % 10) }
!if .address >= 10 { !byte 48 + ((.address / 10) % 10) }
!byte $30 + (.address % 10), $00, $00, $00
* = .address
}
; A cooler example is to write
;
; 10 SYS <address>: REM <backspaces>Your comment
;
; When the user types LIST, he will just see
;
; 10 Your comment
;
; but still be able to run it.
; For this, see http://codebase64.org/doku.php?id=base:acme-macro-tu
When running above bash script. it will open the file if it exists, else it will take a template file. After opening it with vi, and editing it, it starts a the compiler and creates a C64 d64 disk. This is going to be autorun/started with the VIce emulator. Appending -f to the bash script will start it in fullscreen mode. ./makeprg myawesomedemo.asm -f
Below it is running without the fullscreen option. but is shows how to start the interactive monitor in vice.
A few years ago i wrote a photo manager .. again .. ( see post about my first previous photo manager ) It is a web gui to find photos in my huge photo archive. I manually added 190k tags to 120k photos in 20+ years.
I thought wouldn’t it be nice if i can generate additional metadata using Machine Learning. A few years ago i did some testing and followed a podcast and free course about machine learning.
So today i started to implement a addition to my gui. Machine recognition tags!
It already kinda works.
Things to do :
Make it a background job, my fileserver doesn’t run Tensorflow on a GPU, so it is slooow
Embed in existing GUI and stats
Design a editor to remove wrong tags
Below a part of ML images
Command to get a thumbnail sheet with only directory names:
var system = require('system');
var page = require('webpage').create();
var url = system.args[1];
page.open(url, function () {
console.log(page.content);
phantom.exit();
});
Run phantomjs
phantomjs-2.1.1-linux-x86_64/bin/phantomjs printsource.js https://xxxxxxxx/show/xxxx > out
So now i got the rendered page, get mp3’s and titles, for this example
cat out | sed 'N;s/\n/,/' | cut -f2,7 -d\" | while read line ; do
mp3=$( echo $line | cut -f1 -d\")
title=$( echo $line | cut -f3 -d\> | tr -d '/<>[]]\!,;' | tr -d "'" | sed s/CDATA//g | sed s#title##g | sed s/:/-/g )
echo "$mp3 $title"
wget $mp3 -O "$title.mp3"
done
When running scripts which take a long time, i don’t want to wait for things to finish before i can start the next one.
For example, using my dedup script or compiling stuff. I wanna know when it is finished.
So i made some scripts
Maybe you can hear the spoken text in the background playing downstairs
I’ve put a function in .bashrc, so i can use a command like notify “Compiling is ready” A command like this i can put at the end of a command or in a script file at the end. make && make install && notify “compile ready”
What does it do when executed?
Send a mqtt message to the broker
Node-red will read this message and:
Send a message to my display on my desk – Sound and message notification. (See another post how i made this )
Send a message to a script on my Domoticz instance downstairs.
This will use a script to get a speech file from google, and play this on some small speakers in my livingroom
Send a pushover message to my phone
Display a message on my TV ( not in code below )
How?
At the end of your .bashrc
function notify() {
if [ -z "$1" ]; then
echo "Usage: $0 \"message\"";
exit 1;
fi
mosquitto_pub -h 10.1.0.17 -t notify/bashscript -m "$1"
}
This script will look for a cached audiofile with requested text, and uses that. Else it wil request a audio file from google, caches it and plays it though the speakers.
#!/bin/bash
INPUT=$*
input2=$(echo $INPUT | base64)
echo "$input2 = $INPUT" >> /home/pi/cache/files-text-relation
if [ -f /home/pi/cache/$input2.mp3 ] ; then
mpg123 -q /home/pi/cache/$input2.mp3 1>/dev/null 2>/dev/null
else
echo not cached
STRINGNUM=0
ary=($INPUT)
for key in "${!ary[@]}"
do
SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}"
LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]})
#echo "word:$key, ${ary[$key]}"
#echo "adding to: $STRINGNUM"
if [[ "$LENGTH" -lt "100" ]]; then
#echo starting new line
SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]}
else
STRINGNUM=$(($STRINGNUM+1))
SHORTTMP[$STRINGNUM]="${ary[$key]}"
SHORT[$STRINGNUM]="${ary[$key]}"
fi
done
for key in "${!SHORT[@]}"
do
echo "Playing line: $(($key+1)) of $(($STRINGNUM+1))"
NEXTURL=$(echo ${SHORT[$key]} | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g')
echo $NEXTURL
mpg123 -w $input2 -q "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$NEXTURL&tl=En-us"
ffmpeg -i $input2 -codec:a libmp3lame -qscale:a 2 /home/pi/cache/$input2.mp3
mpg123 /home/pi/cache/$input2.mp3
done
fi
Running a little program to read dipswitches and displaying them using leds.
0000 CE 8020 ; LDX #$8020
0003 6A 01 ; DEC 1,X
0005 86 04 ; LDA A A
0007 A7 02 ; STA A 2,X
0009 A7 03 ; STA A 3,X
000B A6 00 ; LDA A 0,X
000D A7 01 ; STA A 1,X
000F 20 FA ; BRA
Got a working amiga again. \o/ woot Needed to replace Paula chip, cleaning and some TLC.
Modulator
Chip donor
Scart cable i’ve got is one without the resistors, so my monitor isn’t detecting the signal. Using a A520 modulator works. At least RF, don’t know why RCA/composite video isn’t working.
Even a memory expansion and second drive (5.24 inch) are working.
One of the first disks i tested
To do:
Fix something to get disk images from and to my pc.
(My old catweasel card only fits in a ISA slot which i don’t have any more)
I was wrong .. i’ve got a IV Catweasel .. PCI it is
Fix scart
Fix my Action Replay, which i soldered into a non working state apparently .. 🙂
Get a better mouse!
Catweasel IV
Kickstart selectorAction Replay
Disks to convert:
Personal text files from ages ago
My first seka demo
My oscillator drawing program
Other assembly source files
Got another one running today also:
Olivetti M21 machine you could carry with you. 9″ screen, 640K memory, 8086 Cpu
A long time ago i took a book about doing funny stuff in dos, and wrote own additions in the sidelines of the book. Or used the empty pages.
It contains jokes using autoexec.bat and config.sys. Additions by me are most of the time things you could do with debug.com, a little program which existed on any pc at that time.
A little program which created static on a CGA or Hercules monitor. Yes, that long ago. CGA provided 16 colors in 80×25 or 40×25 text modes, but only four colors at 320×200 resolution and two colors at 640×200. Hercules was only monochrome and a max resolution of 720×348. It was on a hercules card i made my first copperbar. ( Before the effect was named copperbar ). Due to difference in timing on every machine, you had to get the copperbar timing right by using two keys i’d assigned the timing to.
MOV AL,00 # Fill AL register with 0
MOV DX,0x03D8 (cga) 03B8 (herc)# DX with address
OUT DX,AL # Set address with AL
MOV AL,[0101] # Reg AL with contents
INC AL # Increment AL
MOV [0101],AL # Address fill with AL
JMP 100 # Jump to start
The opcodes for the program :
b0 00
66 ba d8 03
ee
a0 41 00 00 00
fe c0
a2 41 00 00 00
e9 60 00 00 00
Sometimes i put these little programs in autoexec.bat, so at next restart of the pc, it would do something weird. My little BOFH jokes. Friends and computerstores where not safe.
Another example:
Two drives in a PC ? (Wie A: zegt moet ook B: zeggen) Use with care, below will f*ck up your drives. (And makes a lot of noise while doing so.)
MOV DX,0x03F2
MOV AL,71
OUT DX,AL
MOV AL,74
OUT DX,AL
JMP 100