Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 39 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set(LOADTRK_SOURCES
src/help.cpp
src/sound.cpp
src/console.cpp
src/colors.cpp
src/sid.cpp
src/ltlog.cpp
src/ltmidi.cpp
Expand Down Expand Up @@ -81,6 +82,37 @@ set(DATAFILE_SOURCES
set(DAT2INC_SOURCES
src/tools/dat2inc.cpp)

set(LTRELOC_SOURCES
${CMAKE_BINARY_DIR}/src/ltrkdata.cpp
src/tools/ltreloc.cpp
src/song.cpp
src/order.cpp
src/pattern.cpp
src/instr.cpp
src/table.cpp
src/play.cpp
src/display.cpp
src/file.cpp
src/reloc.cpp
src/console.cpp
src/colors.cpp
src/ltlog.cpp
src/asm/asm.tab.c
src/asm/chunkpool.c
src/asm/expr.c
src/asm/lex.yy.c
src/asm/log.c
src/asm/map.c
src/asm/buf.c
src/asm/buf_io.c
src/asm/named_buffer.c
src/asm/parse.c
src/asm/pc.c
src/asm/vec.c
src/bme/bme_win.cpp
src/bme/bme_io.cpp
src/bme/bme_end.cpp)

include_directories(${CMAKE_BINARY_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/src/bme)
Expand All @@ -94,9 +126,9 @@ add_executable(loadtrk ${LOADTRK_SOURCES})
add_executable(mod2sng ${MOD2SNG_SOURCES})
add_executable(ins2snd2 ${INS2SND2_SOURCES})
add_executable(sngspli2 ${SNGSPLI2_SOURCES})
add_executable(ltreloc ${LTRELOC_SOURCES})


target_include_directories(datafile PUBLIC SDL3::Headers)
target_compile_definitions(ltreloc PUBLIC LTRELOC)

file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/src)

Expand All @@ -116,10 +148,7 @@ add_custom_command(

add_custom_target(ltrkdata DEPENDS ${CMAKE_BINARY_DIR}/src/ltrkdata.cpp)
add_dependencies(loadtrk ltrkdata)

target_include_directories(mod2sng PUBLIC SDL3::Headers)
target_include_directories(ins2snd2 PUBLIC SDL3::Headers)
target_include_directories(sngspli2 PUBLIC SDL3::Headers)
add_dependencies(ltreloc ltrkdata)

if(MINGW)
set(LIB_MINGW mingw32)
Expand All @@ -129,8 +158,10 @@ OPTION(BUILD_STATIC "Static build" OFF)
IF(BUILD_STATIC)
set(CMAKE_EXE_LINKER_FLAGS "-static")
target_link_libraries(loadtrk SDL3::SDL3-static)
target_link_libraries(ltreloc SDL3::SDL3-static)
ELSE()
target_link_libraries(loadtrk SDL3::SDL3)
target_link_libraries(ltreloc SDL3::SDL3)
ENDIF()

find_package(Jack)
Expand Down Expand Up @@ -205,10 +236,10 @@ endif()

include(GNUInstallDirs)

INSTALL(TARGETS loadtrk RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
INSTALL(TARGETS loadtrk ltreloc mod2sng ins2snd2 sngspli2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
INSTALL(FILES loadtrk.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
INSTALL(FILES loadtrk.png DESTINATION ${CMAKE_INSTALL_DATADIR}/icons)
INSTALL(FILES doc/en/loadtrk.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
INSTALL(FILES doc/en/loadtrk.1 doc/en/ltreloc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
INSTALL(DIRECTORY examples DESTINATION ${CMAKE_INSTALL_DATADIR}/loadtrk FILES_MATCHING REGEX ".*\.(sng|ins)")

set(PACKAGE_NAME "${PROJECT_NAME}")
Expand Down
2 changes: 1 addition & 1 deletion docs/en/loadtrk.1
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Set speed multiplier (0 for 25Hz, 1 for 1x, 2 for 2x etc.)
\fB-V\fIxx\fR
Set finevibrato conversion (0 = off, 1 = on) DEFAULT=on
.TP
\fB-\fIXxx\fR
\fB-W\fIXxx\fR
Set window type (0 = window, 1 = fullscreen) DEFAULT=window
.TP
\fB-Y\fIxx\fR
Expand Down
83 changes: 83 additions & 0 deletions docs/en/ltreloc.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.TH LTReloc "Jul 22, 2026"
.SH NAME
ltreloc \- commandline relocator/packer
.SH SYNOPSIS
.B ltreloc
.RI [ songname ]
.RI [ outfile ]
.RI [ options ]
.SH DESCRIPTION
This manual page documents briefly the
.B loadtrk
command.
.PP
\fBltreloc\fP is a commandline relocator/packer based on goattracker's gt2reloc.

.TP
\fB-A\fIxx\fR
Set ADSR parameter for hardrestart in hex. DEFAULT=0F00
.TP
\fB-B\fIx\fR
Enable/disable buffered SID writes. DEFAULT=disabled
.TP
\fB-C\fIx\fR
Enable/disable zeropage ghost registers. DEFAULT=disabled
.TP
\fB-D\fIx\fR
Enable/disable sound effect support. DEFAULT=disabled
.TP
\fB-E\fIx\fR
Enable/disable volume change support. DEFAULT=disabled
.TP
\fB-F\fIxx\fR
Set custom SID clock cycles per second (0 = use PAL/NTSC default)
.TP
\fB-G\fIxx\fR
Set pitch of A-4 in Hz (0 = use default frequencytable, close to 440Hz)
.TP
\fB-H\fIx\fR
Enable/disable storing of author info. DEFAULT=disabled
.TP
\fB-I\fIx\fR
Enable/disable optimizations. DEFAULT=enabled
.TP
\fB-J\fIx\fR
Enable/disable full buffering. DEFAULT=disabled
.TP
\fB-L\fIxx\fR
SID memory location in hex. DEFAULT=D400
.TP
\fB-O\fIxx\fR
Set pulseoptimization/skipping (0 = off, 1 = on) DEFAULT=on
.TP
\fB-R\fIxx\fR
Set realtime-effect optimization/skipping (0 = off, 1 = on) DEFAULT=on
.TP
\fB-S\fIxx\fR
Set speed multiplier (0 for 25Hz, 1 for 1x, 2 for 2x etc.) DEFAULT=1
.TP
\fB-V\fIxx\fR
Set finevibrato conversion (0 = off, 1 = on) DEFAULT=on
.TP
\fB-W\fIXxx\fR
Player memory location highbyte in hex. DEFAULT=1000
.TP
\fB-Z\fIxx\fR
Zeropage memory location in hex. DEFAULT=FC
.TP
\fB-N\fR
Use NTSC timing
.TP
\fB-P\fR
Use PAL timing (DEFAULT)
.TP
\fB-?\fR
Show help
.SH SEE ALSO
.BR loadtrk (1)
.br
.SH AUTHOR
ltreloc was written by Lasse \[:O]\[:o]rni, Leandro Nini.
.PP
This manual page was written by G\[:u]rkan Seng\[:u]n <gurkan@phys.ethz.ch>,
for the Debian project (but may be used by others).
38 changes: 38 additions & 0 deletions src/colors.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* LoadTracker
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "colors.h"

Colors colors;

void initcolorscheme(bool dark)
{
colors.CBKGND = dark ? CBLACK : CDBLUE;

colors.CNORMAL = (dark ? CGREY : CLBLUE)|(colors.CBKGND<<4);
colors.CMUTE = CDGREY |(colors.CBKGND<<4);
colors.CEDIT = CLGREEN|(colors.CBKGND<<4);
colors.CPLAYING = CLRED |(colors.CBKGND<<4);
colors.CCOMMAND = CLGREY |(colors.CBKGND<<4);
colors.CTITLE = CWHITE |(colors.CBKGND<<4);

colors.CHDRBG = dark ? CDBLUE : CLBLUE;
colors.CHDRFG = CYELLOW;

colors.CHEADER = colors.CHDRFG|(colors.CHDRBG<<4);
}
60 changes: 60 additions & 0 deletions src/colors.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* LoadTracker
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifndef COLORS_H
#define COLORS_H

enum
{
CBLACK = 0x0,
CWHITE = 0x1,
CDRED = 0x2,
CCYAN = 0x3,
CPURPLE = 0x4,
CDGREEN = 0x5,
CDBLUE = 0x6,
CYELLOW = 0x7,
CLBROWN = 0x8,
CDBROWN = 0x9,
CLRED = 0xA,
CDGREY = 0xB,
CGREY = 0xC,
CLGREEN = 0xD,
CLBLUE = 0xE,
CLGREY = 0xF
};

struct Colors
{
unsigned char CBKGND;
unsigned char CNORMAL;
unsigned char CMUTE;
unsigned char CEDIT;
unsigned char CPLAYING;
unsigned char CCOMMAND;
unsigned char CTITLE;
unsigned char CHDRBG;
unsigned char CHDRFG;
unsigned char CHEADER;
};

extern Colors colors;

void initcolorscheme(bool dark);

#endif
14 changes: 0 additions & 14 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,6 @@ enum
#define VISIBLEPATTROWS 34
#define VISIBLETABLEROWS 15

struct Colors
{
unsigned char CBKGND;
unsigned char CNORMAL;
unsigned char CMUTE;
unsigned char CEDIT;
unsigned char CPLAYING;
unsigned char CCOMMAND;
unsigned char CTITLE;
unsigned char CHDRBG;
unsigned char CHDRFG;
unsigned char CHEADER;
};

struct Instr
{
unsigned char ad;
Expand Down
1 change: 1 addition & 0 deletions src/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "console.h"

#include "colors.h"
#include "configfile.h"
#include "loadtrk.h"

Expand Down
38 changes: 1 addition & 37 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "display.h"

#include "colors.h"
#include "configfile.h"
#include "console.h"
#include "instr.h"
Expand All @@ -45,26 +46,6 @@
#include <cstdio>
#include <cstring>

enum
{
CBLACK = 0x0,
CWHITE = 0x1,
CDRED = 0x2,
CCYAN = 0x3,
CPURPLE = 0x4,
CDGREEN = 0x5,
CDBLUE = 0x6,
CYELLOW = 0x7,
CLBROWN = 0x8,
CDBROWN = 0x9,
CLRED = 0xA,
CDGREY = 0xB,
CGREY = 0xC,
CLGREEN = 0xD,
CLBLUE = 0xE,
CLGREY = 0xF
};

const char *notename[] =
{"C-0", "C#0", "D-0", "D#0", "E-0", "F-0", "F#0", "G-0", "G#0", "A-0", "A#0", "B-0",
"C-1", "C#1", "D-1", "D#1", "E-1", "F-1", "F#1", "G-1", "G#1", "A-1", "A#1", "B-1",
Expand All @@ -86,23 +67,6 @@ int cursorcolortable[] = { CWHITE, CLGREY, CGREY, CLGREY };

std::string tooltip;

void initcolorscheme(bool dark)
{
colors.CBKGND = dark ? CBLACK : CDBLUE;

colors.CNORMAL = (dark ? CGREY : CLBLUE)|(colors.CBKGND<<4);
colors.CMUTE = CDGREY |(colors.CBKGND<<4);
colors.CEDIT = CLGREEN|(colors.CBKGND<<4);
colors.CPLAYING = CLRED |(colors.CBKGND<<4);
colors.CCOMMAND = CLGREY |(colors.CBKGND<<4);
colors.CTITLE = CWHITE |(colors.CBKGND<<4);

colors.CHDRBG = dark ? CDBLUE : CLBLUE;
colors.CHDRFG = CYELLOW;

colors.CHEADER = colors.CHDRFG|(colors.CHDRBG<<4);
}

void printmainscreen()
{
clearscreen();
Expand Down
1 change: 1 addition & 0 deletions src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "file.h"

#include "colors.h"
#include "console.h"
#include "display.h"
#include "loadtrk.h"
Expand Down
1 change: 1 addition & 0 deletions src/help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// online help
// =============================================================================

#include "colors.h"
#include "console.h"
#include "display.h"
#include "loadtrk.h"
Expand Down
Loading
Loading