Skip to content

Instantly share code, notes, and snippets.

View freem's full-sized avatar
⛏️
work continues

AJ Kelly freem

⛏️
work continues
View GitHub Profile
for some unknown reason, fceux uses base64 encoded values for window size multiplier (and aspect ratio too but that's less important)
anyways the important thing is this:
for 1x display (default unless you changed settings)
winsizemulx base64:AAAAAAAA8D8=
winsizemuly base64:AAAAAAAA8D8=
for 2x display
winsizemulx base64:AAAAAAAAAEA=
@freem
freem / luasim_log1.txt
Created July 23, 2016 16:37
Output of my Lua 6502 simulator (2016/07/23 11:37 WIP version)
freem@freemtop ~/freemdev/lua6502sim $ lua sim.lua test.bin c000
lua6502sim, hacked together by freem
Loading contents of test.bin at 0xC000
$C000: 78 sei A:00 X:00 Y:00 P:24 SP:00
$C001: D8 cld A:00 X:00 Y:00 P:24 SP:00
$C002: A2 FF ldx #$FF A:00 X:FF Y:00 P:A4 SP:00
$C004: 9A txs A:00 X:FF Y:00 P:A4 SP:FF
$C005: 8A txa A:FF X:FF Y:00 P:A4 SP:FF
$C006: 29 64 and #$64 A:64 X:FF Y:00 P:A4 SP:FF
$C008: 48 pha A:64 X:FF Y:00 P:A4 SP:FE
@freem
freem / metatable_example.lua
Created July 22, 2016 02:26
an example of when metatables are useful
ProcessorFlags = {
Carry = false, -- 0 | (C) Carry for arithmetic and compares
Zero = false, -- 1 | (Z) Set when operation results in 0
IRQ = false, -- 2 | (I) enable/disable IRQ flag
Decimal = false, -- 3 | (D) decimal mode
Break = false, -- 4 | (B) [only available in stack version]
Unused = false, -- 5 | (-) "not used" in regular 6502 (always 1?)
Overflow = false, -- 6 | (V) Overflow for arithmetic and compares
Sign = false, -- 7 | (N) Negative value result
}
@freem
freem / example02.asm
Last active March 13, 2016 17:38
pce sprites wip
; fkit Example 02: Hello World with Sprites
;==============================================================================;
.include "pce.inc" ; hardware defines
.include "bank.inc" ; bankswitching macros
.include "ram_fkit.inc" ; fkit ram
.include "ram_user.inc" ; user ram
;==============================================================================;
.segment "VECTORS"
.addr fakeIRQ ; IRQ2
.addr IRQ1 ; IRQ1 (VDC)
@freem
freem / ca65_macros.inc
Last active March 9, 2016 11:07
possible solution for getting around the zero page problem with pceas and ca65
;;
;; macro: pcezp
;; Writes a PCE-relative zero page address (e.g. $2000-$3FFF)
;; __PCE_ZP_START__ must be defined in your linker configuration.
;;
.macro pcezp opcode,value
opcode __PCE_ZP_START__+value
.endmacro
;;
@freem
freem / vdc.inc
Created March 5, 2016 21:32
(possible) ca65 version of vdc_data macro
.macro vdc_data dl, dh
.if .paramcount = 1
lda .lobyte(dl)
sta a:video_data_l
lda .hibyte(dl)
sta a:video_data_l
.else
lda dl
sta a:video_data_l
lda dh
@freem
freem / fpr_logodata.txt
Last active March 22, 2016 02:29
Fire Pro Returns Logo Data
everything in this document is subject to change, especially since I don't know what I'm doing.
this assumes you've ripped the logo data from a FPR save file. the data for the first logo is at 0xC6010 with no edit
characters installed. your mileage may vary. I haven't been able to get past the save checksum yet (but I also haven't
really tried), so no editing yet.
0x0000-0x000F: some sort of header
0x0000: if this byte is 1, there is a logo here. otherwise, show "no data"
0x0001-0x000F: I have no idea!!!
[Jason Blackhart thinks this is garbage data; he zeroed it out and the game didn't complain, so I'm willing to agree]
@freem
freem / Makefile
Created February 29, 2016 21:57
hybrid pceas/ca65 makefile
# makefile for example pce/tg16 project
# includes targets for pceas and ca65/ld65
#==============================================================================#
# pceas setup
PCEAS = pceas
EXAMPLE_PCEAS = ./example/pceas
SOURCE_PCEAS = $(EXAMPLE_PCEAS)/dummy.s
OUTPUT_PCEAS = $(EXAMPLE_PCEAS)/dummy.pce
SYMBOLS_PCEAS = $(EXAMPLE_PCEAS)/dummy.sym
notes on the SM1 driver
=======================
[Introduction]
The main purpose of this document is to figure out how the SM1 driver accepts
parameters for some of its commands.
Examples are:
* Command $0A: Fade Out
* Command $14: Stop ADPCM-A sound?
* Command $18: Start ADPCM-A sound?
@freem
freem / ExportScoreForIRC.lua
Created January 31, 2015 01:07
SOMS2 score export, created 2010/08/09; last edit 2011/06/27
--[[
ExportScoreForIRC is something that AJ made for fun. It requires an
understanding of how StepMania views your filesystem, as well as knowledge
on how to make your IRC client play from a script file.
Since this was made for a limited purpose, it assumes you play as a single player
in non-course modes.
It spits out a string like this:
last played: $SONG by $ARTIST ($SONGGROUP) [$MODE $DIFFICULTY] $PERCENT | $W1 / $W2 / $W3 / $W4 / $W5 / $MISS | Holds: ($HELD/DROPPED) Max Combo: $MAXCOMBO