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 / SLPM_86500.md
Last active September 22, 2023 08:56
Dragon Quest VII: Sound Engine Analysis

Dragon Quest VII: Sound Engine Analysis

This is a technical analysis note of the sound engine of PS1 Dragon Quest VII.

DQVII uses a custom sound engine, developed by Heart Beat. PS1 Dragon Quest IV also uses the same sound engine.

Note: I used Japanese version of Dragon Quest VII (SLPM-86500)

@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 / 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)
@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 / List of games using GAX Audio Engine.txt
Last active September 2, 2022 06:54
List of games using GAX Audio Engine
GAX Sound Engine v1.99d (Mar 13 2001) IRIDION3D AGB-AI3E-USA 0028 - Iridion 3D (U)
GAX Sound Engine v1.99d (Mar 30 2001) TONY HAWK 2! AGB-ATHE-USA 0033 - Tony Hawk's Pro Skater 2 (U)
GAX Sound Engine v1.99d (Mar 30 2001) EWJ AGB-AEJE-USA 0037 - Earthworm Jim (U)
GAX Sound Engine v1.99d (Mar 30 2001) TONY HAWK 2! AGB-ATHD-DEU 0053 - Tony Hawk's Pro Skater 2 (G)
GAX Sound Engine v1.99d (Mar 30 2001) TONY HAWK 2! AGB-ATHF-FRA 0059 - Tony Hawk's Pro Skater 2 (F)
GAX Sound Engine v1.99d (Mar 30 2001) FORTRESS AGB-AFOE-USA 0088 - Fortress (U)
GAX Sound Engine v2.01a (Jun 6 2001) TANG TANG AGB-ATAE-USA 0094 - Tang Tang (U)
GAX Sound Engine v1.99f (Jun 13 2001) F14-TOMCAT AGB-AFTE-USA 0096 - F-14 Tomcat (U)
GAX Sound Engine v2.01b (Jun 22 2001) SPIDERMAN MM AGB-ASEE-USA 0115 - Spider-Man - Mysterio's Menace (U)
GAX Sound Engine v2.01a (Jun 6 2001) CAESARPALACE AGB-ACPE-USA 0116 - Caesar's Palace Advance - Millennium Gold Edition (U)
@loveemu
loveemu / gax_info.md
Last active April 16, 2024 03:36
Shin'en GAX Sound Engine (GBA) Specification / Research Note

Shin'en GAX Sound Engine (GBA) Specification

The research is based on GAX Engine V3. Information about V2 can be found at the end of the document.

FYI: GaXM is a tool that can analyze GAX data. You may find more information there.

FYI: You can find my IDA FLIRT signature for GAX V3 here. https://github.com/loveemu/ida-sig

FYI: Gaxtapper: Diagnostic tool / Automated GSF ripper for GAX Sound Engine.

@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 / 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.