In this tool-assisted education video I create an emulator for the PIC16F628A chip. In the emulator design I aimed for a data-driven design where efficient code is produced from concise and easy-to-read data at compile-time. Read more...
Downloadable files
|
S=https://bisqwit.iki.fi/jutut/kuvat/programming_examples/pic/ for s in {song_converter,emulator-source-youtube,nesplayer-{final,prototype}}.zip; do wget $S/$s && unzip -n $s ; done
export S=https://bisqwit.iki.fi/jutut/kuvat/programming_examples/pic/ echo {song_converter,emulator-source-youtube,nesplayer-{prototype,final}}.zip | xargs -n1 sh -c 'curl -O $S/$@ && 7za x -y $@' x
g++ -std=c++11 -O3 -o emulator {cpu,hexfile,memory,emu}.cc
php song_conversion/songdata.php song_conversion/2_17_MUS_Fight.txt > songdata.h
make test.hex
./emulator | sox -t u8 -r20e6 -c1 - -t s16 -r44100 -c2 - | mplayer -demuxer rawaudio -
gcc test-conly.c -o test -O2 -I. -std=c99
tcc test-conly.c -o test -O2 -I.
./test | sox -t u8 -r19531.25 -c1 - -t s16 -r44100 -c2 - | mplayer -demuxer rawaudio -
./test | mplayer -demuxer rawaudio -rawaudio rate=19531:channels=1:samplesize=1 -
./test | aplay -fu8 -r19531 -c1
./test | ffplay - -f u8 -ar 19531.25 -ac 1
./test | ffmpeg -f u8 -ar 19531 -ac 1 -i - -f mp3 - | mpg123 -