Files
AyeZeeBB 86aa8d38fb Music: local files, online radio, equaliser, queue, and a Music page in the menu
Sources
- Local Files: add a folder of music from the setup page (MP3, M4A, AAC, Ogg,
  FLAC, WAV; up to 200 songs a folder, 12 folders). Names and covers come from
  the files' tags. Each folder is a tile in its own row.
- Online Radio: find stations by name (radio-browser.info) or add a stream's
  address (MP3, AAC, .pls, .m3u; no HLS). Each station is a tile in its own
  row; the track name follows what the station sends. Up to 24.
- Both are decoded by the library built into the DLL (SpotifyHelper), which
  now plays files and HTTP streams as well as a program's output, reads tags
  and embedded pictures, and accepts MPEG-2 ADTS from AAC stations.

Sound
- Five-band equaliser (60 Hz, 250 Hz, 1 kHz, 4 kHz, 12 kHz) and loudness
  levelling, applied to every source on its way into the game.
- Loudness, the speakers option, the equaliser and levelling are now kept in
  music-settings.json between sessions.

Setup page
- Remade in the mod's own colours and type, with numbered steps per source.
- Queue pinned to the right: now playing, the playlist's songs with covers,
  find, and press to jump. Spotify's own queue shows once signed in.
- Cards for Local files and Online radio; equaliser and levelling under Sound.

In game
- MUSIC page in the menu: player and queue, sound settings, source status and
  a button for the setup page.
- "Loading song..." notice in the corner for songs that take a moment, with a
  switch to hide it. Presses made while a song is loading no longer restart it.
- The Spotify row is hidden when Spotify is not in use.
- Console: "spotify ..." is now "music ..." (music, music setup, music gain,
  music through, music spotify client|login|logout).

Logs
- The music sources' working lines (traces, per-song and per-bind lines,
  librespot's own) are debug only; stack captures are skipped unless debug
  logging is on. Grind exits: the per-pop line is debug only too.
- A "Pace:" line when the game takes the sound faster or slower than real
  time, to find why music sounds fast after tabbing back in.

Chat filter
- A run of digits is a number, not a word spelled with look-alikes: a race
  time such as 2:55.0 is no longer masked.
2026-10-12 16:03:35 -05:00

29 lines
3.0 KiB
C++

#pragma once
#include "Engine/Game/Build/fingerprint.h"
// The game's Lua is stock Lua 5.2 with every standard library open. These are the functions in
// it that reach outside Lua (Extension/Scripting/lua_native_block.h). Found from the libraries'
// registration tables in .rodata (package at 0x6445c30, os at 0x6445f90, io at 0x6446150).
namespace dingosdk::game::build::v20260929::lua_natives {
// int ll_loadfunc(lua_State*, const char* path, const char* symbol): the one place Lua loads a
// DLL (LoadLibraryExA). package.loadlib calls it, and so does require through both C searchers
// (by way of loadfunc at 0x334cfa0). 0 on success; 1 with a message pushed when the DLL does
// not load.
inline constexpr Fingerprint load_library{0x334d4d0, {0x48,0x89,0x5c,0x24,0x10,0x48,0x89,0x6c,0x24,0x18,0x56,0x57,0x41,0x54,0x41,0x56,0x41,0x57,0x48,0x83,0xec,0x30,0x48,0x8b,0x59,0x10,0x4c,0x8d,0x25,0xdb,0x91,0x0f}};
// const char* lua_pushfstring(lua_State*, const char* format, ...).
inline constexpr Fingerprint push_format{0x33663f0, {0x48,0x89,0x54,0x24,0x10,0x4c,0x89,0x44,0x24,0x18,0x4c,0x89,0x4c,0x24,0x20,0x53,0x48,0x83,0xec,0x20,0x48,0x8b,0x41,0x18,0x48,0x8b,0xd9,0x48,0x83,0x78,0x18,0x00}};
// void f_parser(lua_State*, SParser*): compiles a chunk, or undumps one that starts with the
// bytecode signature. It checks the chunk's kind against SParser::mode.
inline constexpr Fingerprint parse_chunk{0x3347400, {0x40,0x53,0x55,0x56,0x57,0x48,0x83,0xec,0x38,0x4c,0x8b,0x02,0x48,0x8b,0xda,0x48,0x8b,0xf1,0x45,0x8b,0x08,0x41,0x8d,0x41,0xff,0x41,0x89,0x00,0x48,0x8b,0x3a,0x45}};
// const char* SParser::mode ("b", "t", "bt" or null for both); name follows at 0x50.
inline constexpr std::uintptr_t parser_mode_offset = 0x48;
// lua_CFunctions of the os and io libraries.
inline constexpr Fingerprint os_execute{0x33379b0, {0x48,0x89,0x5c,0x24,0x08,0x57,0x48,0x83,0xec,0x20,0x48,0x8b,0x41,0x20,0x48,0x8b,0xd9,0x48,0x8b,0x10,0x48,0x83,0xc2,0x10,0x48,0x3b,0x51,0x10,0x73,0x7c,0x48,0x8d}};
inline constexpr Fingerprint os_remove{0x3337a90, {0x48,0x89,0x5c,0x24,0x08,0x48,0x89,0x74,0x24,0x10,0x57,0x48,0x83,0xec,0x20,0x48,0x8b,0x41,0x20,0x48,0x8d,0x1d,0x56,0xdf,0x10,0x03,0x48,0x8b,0xf9,0x48,0x8b,0x10}};
inline constexpr Fingerprint os_rename{0x3337ba0, {0x48,0x89,0x5c,0x24,0x08,0x48,0x89,0x74,0x24,0x10,0x57,0x48,0x83,0xec,0x20,0x48,0x8b,0x41,0x20,0x48,0x8d,0x3d,0x46,0xde,0x10,0x03,0x48,0x8b,0xf7,0x48,0x8b,0xd9}};
inline constexpr Fingerprint io_popen{0x333bc00, {0x40,0x53,0x55,0x56,0x57,0x48,0x83,0xec,0x28,0x48,0x8b,0x41,0x20,0x48,0x8d,0x1d,0xec,0x9d,0x10,0x03,0x48,0x8b,0xf3,0x48,0x8b,0xf9,0x48,0x8b,0x10,0x48,0x83,0xc2}};
inline constexpr Fingerprint io_open{0x333b9f0, {0x40,0x53,0x55,0x56,0x57,0x48,0x83,0xec,0x28,0x48,0x8b,0x41,0x20,0x48,0x8d,0x1d,0xfc,0x9f,0x10,0x03,0x48,0x8b,0xf3,0x48,0x8b,0xf9,0x48,0x8b,0x10,0x48,0x83,0xc2}};
inline constexpr Fingerprint io_output{0x333be90, {0x4c,0x8d,0x05,0xa1,0x15,0xe6,0x02,0x48,0x8d,0x15,0x4a,0xb8,0x10,0x03,0xe9,0xcd,0xd8,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc}};
}