Code: Select all
## In order to save quite a bit of flash space, it is possible to include only
## the waves that your patches.inc file uses, by including a custom sounds.inc
## file rather than the one included in the kernel by default. The trickery
## below is required to escape spaces in mixer path (due to custom sounds.inc).
## Be aware that if you remove waves from the wavetable, the indices of the
## waves you specify in your patches.inc file may need to be changed to match!
## To use a custom sounds.inc file, copy the one from kernel/data/sounds.inc
## into your game's data directory, and uncomment the following lines:
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
SPACE_ESC := \\$(SPACE)
MIX_PATH := $(realpath ../data/sounds.inc)
MIX_PATH_ESC := $(subst $(SPACE),$(SPACE_ESC),$(MIX_PATH))
KERNEL_OPTIONS += -DMIXER_WAVES=\"$(MIX_PATH_ESC)\"
But if your Makefile also includes:
Code: Select all
KERNEL_OPTIONS += -DINTRO_LOGO=1
I'm proposing the addition of a new define called INTRO_WAVETABLE, that can override the default wave table index used by the intro code in the kernel. For example:
Code: Select all
KERNEL_OPTIONS += -DINTRO_LOGO=1 -DINTRO_WAVETABLE=1
Code: Select all
diff --git a/kernel/defines.h b/kernel/defines.h
index 7fd052e..65fa4be 100644
--- a/kernel/defines.h
+++ b/kernel/defines.h
@@ -124,6 +124,18 @@
#endif
/*
+ * Wave table index for the "bling" sound that accompanies the Uzebox logo when the console is reset
+ * 8 = default
+ * N = Use the Nth wave table for the "bling" sound (very useful when you are using a custom sounds.inc)
+ *
+ */
+ #if INTRO_LOGO == 1
+ #ifndef INTRO_WAVETABLE
+ #define INTRO_WAVETABLE 8
+ #endif
+ #endif
+
+ /*
* Joystick type used on the board.
* Note: Will be read from EEPROM in a future release.
*
diff --git a/kernel/intro.h b/kernel/intro.h
index 23921cd..85734f2 100644
--- a/kernel/intro.h
+++ b/kernel/intro.h
@@ -25,7 +25,7 @@
//Logo "kling" sound
const char initPatch[] PROGMEM ={
- 0,PC_WAVE,8,
+ 0,PC_WAVE,INTRO_WAVETABLE,
0,PC_PITCH,85,
4,PC_PITCH,90,
0,PC_ENV_SPEED,-8,