Skip to content

Instantly share code, notes, and snippets.

@erique
erique / setup_tf4060_pi.sh
Last active October 22, 2023 18:04
Script to set up flashing tools for the CPLD and the FPGA on the TF4060
#/bin/bash
#
# 1) Write out the LITE version of the 32-bit Raspberry PI OS to an SDCARD
# Either using the 'Raspberry PI Imager':
# Use : 'Raspberry PI OS (other)' -> 'Raspberry PI OS Lite (32-bit)'
# Or download the image and write it out manually
# xzcat yyyy-mm-dd-...-armhf-lite.img.xz | ddxof=/dev/sdX bs=65536 status=progress
#
# 2) Boot the SDCARD with HDMI and USB Keyboard attached
@erique
erique / irq_perf.c
Last active October 28, 2022 22:28
Quick hack to monitor hit count, ECLK ticks and rough CPU usage for each interrupt level
// m68k-amigaos-gcc irq_perf.c -o irq_perf -noixemul -O2 -m68020 --omit-frame-pointer
#include <stdio.h>
#include <stdarg.h>
#include <proto/exec.h>
#include <proto/timer.h>
#include <exec/execbase.h>
#include <devices/timer.h>
@erique
erique / ceil_error.c
Created September 15, 2022 22:25
calling mathieeedoubbas fails
// m68k-amigaos-gcc -noixemul -m68060 -lm ceil_error.c -o ceil_error
#include <stdio.h>
#include <math.h>
int main()
{
printf("GCC %s\n", __VERSION__);
double value = 3.125;
@erique
erique / casttest.c
Created September 14, 2022 18:48
testing ___floatundidf
// m68k-amigaos-gcc -O0 -m68060 -mhard-float casttest.c -o casttest
#include <stdio.h>
int main()
{
printf("GCC %s\n", __VERSION__);
uint64_t i = 1;
double d = i;
printf("d = %f ; %s\n", d, (d == 1.0) ? "PASS" : "FAIL");
return 0;
}
@erique
erique / devmem.c
Created October 8, 2021 10:25
devmem - tool to inspect and manipulate large blocks of physical memory space
/*--------------------------------------------------------------------
* Replay Firmware
* www.fpgaarcade.com
* All rights reserved.
*
* admin@fpgaarcade.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
@erique
erique / copymem.txt
Created September 22, 2021 21:17
AmigaOS exec.library 'CopyMem()' comparison for the FPGAArcade Replay 'amiga_68060' core.
AmigaOS exec.library 'CopyMem()' comparison for the FPGAArcade Replay 'amiga_68060' core.
Using regular KS3.0:
+----------------------------------------+
| CMBench 1.2 (11.10.2020) |
| AmigaOS Exec->CopyMem() benchmark |
+----------------------------------------+
| Source: 0x012ac9b8 (aligned by 8) |
| Destination: 0x014b1880 (aligned by 8) |
@erique
erique / timer_example.c
Created September 7, 2021 23:30
Simple Amiga timer.device example (50Hz continuous trigger)
// m68k-amigaos-gcc -Wall -Wno-pointer-sign -noixemul timer_example.c -o timer_example
#include <stdio.h>
#include <exec/types.h>
#include <exec/interrupts.h>
#include <exec/io.h>
#include <dos/dos.h>
#include <inline/exec.h>
#include <inline/timer.h>
@erique
erique / split_and_flash_kick.sh
Last active June 18, 2021 09:53
split a 512kb kickstart, and flash via minipro, from bash
xxd -c 4 -g 1 kick.rom | awk '{printf $5 $4 "\n"}' | xxd -p -r > test-lo.rom && cat test-lo.rom test-lo.rom > test-lo.bin
xxd -c 4 -g 1 kick.rom | awk '{printf $3 $2 "\n"}' | xxd -p -r > test-hi.rom && cat test-hi.rom test-hi.rom > test-hi.bin
minipro -y -p "AM29F400BB@TSOP48" --write test-hi.bin
minipro -y -p "AM29F400BB@TSOP48" --write test-lo.bin
@erique
erique / build-snapshot.sh
Created July 15, 2018 11:32
bash script for building a known-good snapshot (incl. patches) of amiga-gcc (GCC6 for Amiga)
#!/bin/bash
echo "# ================================================="
echo "# cloning a stable build script"
echo "# ================================================="
git clone git@github.com:bebbo/amiga-gcc.git
cd amiga-gcc
git reset --hard af8fc421d492302afbb2feb694cbe46ed223476c

Keybase proof

I hereby claim:

  • I am erique on github.
  • I am erique (https://keybase.io/erique) on keybase.
  • I have a public key ASDnBq7uQpFQyXXrkskejbhCb3hBYwCtUIaJNorteV9v8go

To claim this, I am signing this object: