add Power Noise support

This commit is contained in:
scratchminer 2024-01-21 06:44:29 -05:00
parent e19cd39e96
commit 85997e55e7
11 changed files with 55 additions and 2 deletions

View file

@ -248,6 +248,9 @@ enum DivDispatchCmds {
DIV_CMD_ESFM_MODIN, // (op, value)
DIV_CMD_ESFM_ENV_DELAY, // (op, value)
DIV_CMD_POWER_NOISE_COUNTER_LOAD, // (which, val)
DIV_CMD_POWER_NOISE_IO_WRITE, // (port, value)
DIV_CMD_MACRO_RESTART, // (which)
DIV_CMD_MAX

View file

@ -83,6 +83,7 @@
#include "platform/c140.h"
#include "platform/pcmdac.h"
#include "platform/esfm.h"
#include "platform/powernoise.h"
#include "platform/dummy.h"
#include "../ta-log.h"
#include "song.h"
@ -648,6 +649,9 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
case DIV_SYSTEM_ESFM:
dispatch=new DivPlatformESFM;
break;
case DIV_SYSTEM_POWER_NOISE:
dispatch=new DivPlatformPowerNoise;
break;
case DIV_SYSTEM_DUMMY:
dispatch=new DivPlatformDummy;
break;

View file

@ -1043,6 +1043,8 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo
featureFM=true;
featureEF=true;
break;
case DIV_INS_POWER_NOISE:
break;
case DIV_INS_MAX:
break;
case DIV_INS_NULL:

View file

@ -86,6 +86,7 @@ enum DivInstrumentType: unsigned short {
DIV_INS_C140=53,
DIV_INS_C219=54,
DIV_INS_ESFM=55,
DIV_INS_POWER_NOISE=56,
DIV_INS_MAX,
DIV_INS_NULL
};

View file

@ -247,6 +247,9 @@ const char* cmdName[]={
"ESFM_MODIN",
"ESFM_ENV_DELAY",
"POWER_NOISE_COUNTER_LOAD",
"POWER_NOISE_IO_WRITE",
"MACRO_RESTART",
};

View file

@ -132,7 +132,8 @@ enum DivSystem {
DIV_SYSTEM_TED,
DIV_SYSTEM_C140,
DIV_SYSTEM_C219,
DIV_SYSTEM_ESFM
DIV_SYSTEM_ESFM,
DIV_SYSTEM_POWER_NOISE,
};
enum DivEffectType: unsigned short {

View file

@ -1984,6 +1984,23 @@ void DivEngine::registerSystems() {
},
fmESFMPostEffectHandlerMap
);
sysDefs[DIV_SYSTEM_POWER_NOISE]=new DivSysDef(
"BS-C-04xx series (Power Noise)", NULL, 0xd2, 0, 4, false, false, 0, false, 0, 0, 0,
"a fantasy sound chip designed by jvsTSX and The Beesh-Spweesh!\nused in the Hexheld fantasy console.",
{"Noise 1", "Noise 2", "Noise 3", "Slope"},
{"N1", "N2", "N3", "SL"},
{DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_PULSE},
{DIV_INS_POWER_NOISE, DIV_INS_POWER_NOISE, DIV_INS_POWER_NOISE, DIV_INS_POWER_NOISE},
{},
{
{0x20, {DIV_CMD_POWER_NOISE_COUNTER_LOAD, "20xx: Load low byte of noise channel LFSR (00 to FF) or slope channel accumulator (00 to 7F)", constVal<0>, effectVal}},
{0x21, {DIV_CMD_POWER_NOISE_COUNTER_LOAD, "21xx: Load high byte of noise channel LFSR (00 to FF)", constVal<1>, effectVal}},
{0x22, {DIV_CMD_POWER_NOISE_IO_WRITE, "22xx: Write to I/O port A", constVal<0>, effectVal}},
{0x23, {DIV_CMD_POWER_NOISE_IO_WRITE, "23xx: Write to I/O port B", constVal<1>, effectVal}},
},
{}
);
sysDefs[DIV_SYSTEM_DUMMY]=new DivSysDef(
"Dummy System", NULL, 0xfd, 0, 8, false, true, 0, false, 0, 0, 0,