Skip to content

Instantly share code, notes, and snippets.

View loveemu's full-sized avatar

loveemu loveemu

View GitHub Profile
@loveemu
loveemu / smw-volume.lua
Last active August 29, 2015 14:08
Super Mario World (Earlier N-SPC): Volume Calculation
-- Lua 5.1: Super Mario World (Earlier N-SPC): Volume Calculation
-- Note that I do not handle a few things like tremolo
-- Also, note that it is somewhat different from modern N-SPC.
-- 1270:
local velocity_table = {
0x08, 0x12, 0x1b, 0x24, 0x2c, 0x35, 0x3e, 0x47,
0x51, 0x5a, 0x62, 0x6b, 0x7d, 0x8f, 0xa1, 0xb3
}
@loveemu
loveemu / gba_mus_riper_v22_loveemu.patch
Created January 24, 2015 09:30
Personal Patch for GBAMusRiper v2.2
diff -rdu src/gba_mus_riper.cpp src_patched/gba_mus_riper.cpp
--- src/gba_mus_riper.cpp 2014-12-22 07:03:19.000000000 +0900
+++ src_patched/gba_mus_riper.cpp 2015-01-24 18:17:27.764686700 +0900
@@ -33,6 +33,7 @@
static bool rc = false;
static bool sb = false;
static bool raw = false;
+static bool force_output_unused = false;
static uint32_t song_tbl_ptr = 0;
@loveemu
loveemu / generic-trace.lua
Created March 23, 2015 05:11
Generic Tracer Script
-- generic callback for breakpoint
function memory_breakpoint_callback(bp_address)
local timestamp = os.date("%Y-%m-%d %H:%M:%S")
local msg = string.format(timestamp .. " Breakpoint at %08X:", bp_address)
local REGS = {
"r0",
"r1",
"r2",
"r3",
@loveemu
loveemu / dkc-trace-sound.lua
Last active August 29, 2015 14:19
Donkey Kong Country - Trace Sound Transfer Script
memory.registerexec(0x8ab414, function()
local a = memory.getregister("a")
local word_16 = memory.readword(0x7e0016)
local word_18 = memory.readword(0x7e0018)
local word_1a = memory.readword(0x7e001a)
local word_1c = memory.readword(0x7e001c)
print(string.format("Load waveform: a=$%04x, $16=$%02x, $18=$%02x, $1a=$%02x, $1c=$%02x", a, word_16, word_18, word_1a, word_1c))
end)
memory.registerexec(0x8ab1cb, function()
@loveemu
loveemu / Hachiemon Music Format.md
Last active March 24, 2019 14:45
Hachiemon Music Format Analysis (GBA Natsume Driver)

Hachiemon Music Format Analysis

  • Max channels: 12
  • Similar to Standard MIDI Format 1
  • BGM/SFX have different data structure

Music address table at 0x807EC8C (xref from 0x8069DEE), 19 song items available.

Song #0 and #1 are special. They are used for setup.

@loveemu
loveemu / makegsf.sh
Created June 8, 2019 18:24
GSF creation and optimization example
# Convert the patched ROM to gsflib
#
# https://github.com/loveemu/rom2gsf
rom2gsf -o AGB-BP7J-JPN.gsflib AGB-BP7J-JPN.gba
# 256 files are too many in most cases,
# but it's handy when the appropriate count is not sure
#
# https://github.com/loveemu/minigsf
minigsf --psfby loveemu AGB-BP7J-JPN 0x80002dc 1 256
@loveemu
loveemu / MP2K.yaml
Created June 15, 2019 06:16
MP2K.yaml of VG Music Studio for GBA Castlevania Games
AAMJ_00:
Name: "Akumajou Dracula: Circle of the Moon (Japan)"
Creator: "Konami"
SongTableOffsets: 0x108A3C
SongTableSizes: 455
SampleRate: 2
ReverbType: "Normal"
Reverb: 0
Volume: 15
HasGoldenSunSynths: False
@loveemu
loveemu / List of GAX Audio Engine Games for Majority.txt
Last active September 17, 2019 23:33
List of GAX Audio Engine Games for Majority
Priority list:
Fairly OddParents: Breakin' Da Rules GBA
The Incredibles GBA
The Incredibles Rise of the Underminer GBA
LEGO Star Wars The Video Game GBA
LEGO Star Wars II: The Original Trilogy GBA
Cars GBA
Cars Mater-National Championship GBA
Ratatouille GBA
@loveemu
loveemu / List of PS1 games using AKAO format.txt
Last active May 5, 2020 09:51
List of PS1 games using AKAO format
Final Fantasy 7 (1997) [Early Version]
SaGa Frontier (1997) [Early Version]
Front Mission 2 (1997) [Early Version]
Chocobo's Mysterious Dungeon (1997) [Early Version]
Parasite Eve (1998) [Early Version]
Another Mind (1998)
Chocobo Dungeon 2 (1998)
Final Fantasy 8 (1999)
Chocobo Racing (1999)
SaGa Frontier 2 (1999)
@loveemu
loveemu / gba-custom-driver.txt
Created March 24, 2015 12:53
GBA games with custom music driver (not all games)
0009 - Konami Wai Wai Racing Advance (Konami)
0012 - Power Pro Kun Pocket 3 (Konami)
0015 - Fire Pro Wrestling A (Spike)
0020 - Yu-Gi-Oh! Dungeon Dice Monsters (Konami)
0022 - J.League Pocket (Konami)
0024 - Monster Guardians (Konami)
0028 - Iridion 3D (Majesco Sales)
0030 - Ready 2 Rumble Boxing - Round 2 (Midway)
0031 - Konami Krazy Racers (Konami)
0033 - Tony Hawk's Pro Skater 2 (Activision)