Skip to content

Instantly share code, notes, and snippets.

@markusbkk
markusbkk / gist:52b97888e80e8437d145940a89557a51
Created February 25, 2025 12:57 — forked from tndata/gist:313688ffe2e2d24b676e2264a9943d5c
Sega MegaDrive development kit debugger
******************************************
*SEGA Megadrive comunication program *
*(c) 1991 Synchron Assembly *
*https://www.tn-data.se *
******************************************
*f1=trace, f2=skip instruction f4=go
*d xxxx set dissasm window, d pc
*m xxxx set memory window, m pc
*j xxxx set sega PC
@markusbkk
markusbkk / PrintWithoutPrintf.C
Created November 16, 2024 20:27 — forked from dhilipsiva/PrintWithoutPrintf.C
C program printing without using "printf". NO libraries. just c and memory ;)
//Created by DhilipSiva
//Free to modify and use
main()
{
char far *videoMemory = 0xB8000000;
char *helloString = "Hello World";
int stringLength = 11; //length of "Hello World" is 11
int count;
for(count = 0; count < stringLength; count++)
@markusbkk
markusbkk / README.md
Created October 21, 2024 12:52 — forked from CMCDragonkai/README.md
C: Namespaces using Macros (Namespace Macro Pattern)

Namespace Macro Pattern

Compilation of this example:

gcc -c -D NAMESPACE=First_ first.c -o First_first.o
gcc -c -D NAMESPACE=Second_ second.c -o Second_second.o
gcc -c -D NAMESPACE=Third_ third.c -o Third_third.o
gcc -c -D NAMESPACE=Fourth_ fourth.c -o Fourth_fourth.o
@markusbkk
markusbkk / requirements.txt
Created September 9, 2024 23:04 — forked from macbre/requirements.txt
Grim Fandango
$ ldd GrimFandango
linux-gate.so.1 (0xf7778000)
libLua.so => ./libLua.so (0xf7749000)
libchore.so => ./libchore.so (0xf773f000)
libSDL2-2.0.so.1 => ./libSDL2-2.0.so.1 (0xf7621000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf75e8000)
libGL.so.1 => not found
libGLU.so.1 => not found
libX11.so.6 => not found
libstdc++.so.6 => not found
@markusbkk
markusbkk / MainMenu.cs
Last active August 11, 2024 12:19
NSCUMM View Model Binding Problem
using NScumm.Core;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.UI.Xaml.Controls;
using Windows.ApplicationModel.Resources;
using Windows.UI.Core;
using System;
using Windows.UI.Popups;
using System.Threading.Tasks;
@markusbkk
markusbkk / misc_math.asm
Created July 3, 2024 12:28 — forked from mkooi/misc_math.asm
Math macros for the SNES (Ricoh 5A22) in 65C816 assembly.
;===============================================================================
; Multiplication
;===============================================================================
; Although the SNES has a hardware multiplier, multiplication by small
; constants can be implemented faster using the shift-and-add method.
;-------------------------------------------------------------------------------
;===============================================================================
; MUL3 2Val+Val
;===============================================================================
YOUR APP:
- Make sure in App Properties, “Min version” must be Fall Creators Edition (16.....)
- In Package.appxmanifest, change the Entry point to <NAMESPACE>.<MAINCLASS>, not the XAML stuff.
- In fact you should get rid of all XAML Files.
FNALIBS:
For all dependencies:
- Compile in 64-bit Release mode.
- Retarget to latest build versions if necessary, but try to keep Min Windows SDK to Fall Creators Edition.
- If any project asks you to retarget, right click the SOLUTION (not the project) and click Retarget Solution.
@markusbkk
markusbkk / helloworld.c
Created June 10, 2024 08:10 — forked from dan-rodrigues/helloworld.c
neo homebrew sample
#include <stdint.h>
#include <stdbool.h>
// Reg defines, to extract to some header
#define REG_VRAMADDR (*((volatile uint16_t *)0x3c0000))
#define REG_VRAMDATA (*((volatile uint16_t *)0x3c0002))
#define REG_VRAMINC (*((volatile uint16_t *)0x3c0004))
#define REG_LSPCMODE (*((volatile uint16_t *)0x3c0006))
@markusbkk
markusbkk / Mega_ED_PRO_USB_example.md
Created May 2, 2024 17:40 — forked from rhargreaves/Mega_ED_PRO_USB_example.md
Sending data to the Mega Drive over USB using the Mega EverDrive PRO

Mega EverDrive PRO Overview

The Mega EverDrive PRO has a USB port (much like the EverDrive X7) which allows you to send arbitary data to the Mega Drive over USB. With the X7 you could simply send data to the USB serial device and pick it up at a specific memory mapped location on the Mega Drive. With the PRO, however, you need to wrap the data in a "command" and send it over the USB serial device, so that it will be available to the Mega Drive.

The following information was obtained by reading the source contained in the MEGA-PRO repo.

Command Message Format

| Field | Bytes | Value (hex) | Description |

@markusbkk
markusbkk / union.go
Created March 14, 2024 07:10 — forked from sug0/union.go
Go 1.18 tagged union types!
// no, this is not that useful
package main
import (
"fmt"
"unsafe"
)
type Kind[T any] struct{}