summaryrefslogtreecommitdiff
path: root/plugins/ao/eng_ssf
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-07-04 13:17:45 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-07-04 13:17:45 +0200
commitad2de04a8c0ca68d57781058b3eb01a4c07ec698 (patch)
tree7a3ce3fc4044d1c9d6970f040b41cbaac22227a0 /plugins/ao/eng_ssf
parent050417b22e9bd0e9f73b6444727bd725c738157a (diff)
ao plugin: ssf seeking
Diffstat (limited to 'plugins/ao/eng_ssf')
-rw-r--r--plugins/ao/eng_ssf/eng_ssf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/ao/eng_ssf/eng_ssf.c b/plugins/ao/eng_ssf/eng_ssf.c
index 68d2c632..0d81a665 100644
--- a/plugins/ao/eng_ssf/eng_ssf.c
+++ b/plugins/ao/eng_ssf/eng_ssf.c
@@ -82,6 +82,7 @@ typedef struct {
corlett_t *c;
char psfby[256];
uint32 decaybegin, decayend, total_samples;
+ uint8 init_sat_ram[512*1024];
m68ki_cpu_core *cpu;
} ssf_synth_t;
@@ -178,7 +179,7 @@ void *ssf_start(const char *path, uint8 *buffer, uint32 length)
}
}
- #if DEBUG_LOADER && 1
+ #if DEBUG_LOADER
{
FILE *f;
@@ -198,6 +199,9 @@ void *ssf_start(const char *path, uint8 *buffer, uint32 length)
s->cpu->sat_ram[i+1] = temp;
}
+ // backup for fast restarting
+ memcpy (s->init_sat_ram, s->cpu->sat_ram, sizeof (s->init_sat_ram));
+
sat_hw_init(s->cpu);
// now figure out the time in samples for the length/fade
@@ -284,9 +288,14 @@ int32 ssf_stop(void *handle)
int32 ssf_command(void *handle, int32 command, int32 parameter)
{
+ ssf_synth_t *s = handle;
switch (command)
{
case COMMAND_RESTART:
+ sat_hw_free (s->cpu);
+ memcpy (s->cpu->sat_ram, s->init_sat_ram, sizeof (s->init_sat_ram));
+ sat_hw_init (s->cpu);
+ s->total_samples = 0;
return AO_SUCCESS;
}