diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ao/eng_ssf/eng_ssf.c | 11 |
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; } |