Skip to content

Instantly share code, notes, and snippets.

View JettMonstersGoBoom's full-sized avatar
💭
I may be slow to respond.

Jett JettMonstersGoBoom

💭
I may be slow to respond.
View GitHub Profile
@JettMonstersGoBoom
JettMonstersGoBoom / menu_system.mfk
Created December 27, 2020 23:27
millfork menu system
// ----------------------------------------------------------
// Menu Code
// ----------------------------------------------------------
const byte DEBOUNCE = %10000000 // or type with this to only change value when input is toggled vs held
const byte CLAMP = %01000000 // stop at min max
const byte WRAP = %00100000 // wrap at min max
// types
enum ItemType { NONE, BYTE ,WORD ,LWORD ,BOOL, MENU }
@JettMonstersGoBoom
JettMonstersGoBoom / makefile
Created January 6, 2021 15:38
opengl context from a makefile ( win32 with TCC )
#if 0
.PHONY: run
run:
tcc -run makefile
ifeq (0, 1)
#endif
#include <GL/gl.h>
#include "stdio.h"
// 16 color mode notes
// this sample shows using 16 color mode, with multiple palettes
// the colour ram is divided into 16 sets of colors $00-$0f set 0 $10-$1f set 1 etc.
.cpu _45gs02
// boot header
* = $2001
.var addrStr = toIntString(Entry)
// https://github.com/emmanuel-marty/apultra
// ported to Kick asm
// can depack from other banks now
// can't cross over 64kb
.segment ZP
apl_bitbuf: .byte 0
apl_offset: .dword 0
apl_winptr: .dword 0
@JettMonstersGoBoom
JettMonstersGoBoom / fsm.c
Last active April 12, 2021 16:35
Simple Finite State machine in C
//
// simple finite state machine in C
//
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
// for this example lets have N objects/entities
// Kernal CLS Routine
.label INIT_SCREEN = $e544
// Variables
.label player_x = $d000
.label player_y = $d001
.label player_c = $d027
# load NESST session data and create binary data
# makes it easier to process and only need to hit save. not save each part or name each part
# python nesstNSStoBin.py session.nss data\output
# will create
# data\output.chr
# data\output.map
# data\output.pal
# data\output.msb
@JettMonstersGoBoom
JettMonstersGoBoom / example.c
Last active October 19, 2021 21:21
C64 screen mode for DOSLIKE
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "dos.h"
#define VIC_IMPL
#include "vic.h"
unsigned char raster_colours[] = {
0x6, 0x6, 0x6, 0xe, 0x6, 0xe,
@JettMonstersGoBoom
JettMonstersGoBoom / reutesting.mfk
Created January 13, 2022 18:17
REU millfork experiments
import c64_joy
volatile byte REU_STATUS @$DF00
const byte REU_IRQ = $80 //Bit 7: INTERRUPT PENDING (1 = interrupt waiting to be served)
const byte REU_EOB = $40 //Bit 6: END OF BLOCK (1 = transfer complete)
const byte REU_FAULT = $20 //Bit 5: FAULT (1 = block verify error)
const byte REU_VERSION = %1111
volatile byte REU_COMMAND @$DF01
@JettMonstersGoBoom
JettMonstersGoBoom / pcengine.asm
Last active September 12, 2022 21:00
PCEngine Kickassembler simple sample.
// java -jar c:\Devtools\KickAssembler\KickAss65CE02-5.24e.jar base_pce.asm
.cpu _huc6280
.function _arg0(arg) {
.if ((arg.getType()==-6) || (arg.getType()==1) || (arg.getType()==17))
.return CmdArgument(arg.getType(),<arg.getValue())
.return CmdArgument(arg.getType(),arg.getValue())
}