diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-07-04 13:00:04 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-07-04 13:00:04 +0200 |
commit | 050417b22e9bd0e9f73b6444727bd725c738157a (patch) | |
tree | c6fa92603e69a47d45b1baea31db8340e0e23c6c /plugins/ao/eng_psf | |
parent | e6013001a3e730497e4606add4aff3ac743aedc4 (diff) |
ao plugin: psf/psf2/spu seeking
Diffstat (limited to 'plugins/ao/eng_psf')
-rw-r--r-- | plugins/ao/eng_psf/eng_spu.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/plugins/ao/eng_psf/eng_spu.c b/plugins/ao/eng_psf/eng_spu.c index 2adb9470..dbda70ac 100644 --- a/plugins/ao/eng_psf/eng_spu.c +++ b/plugins/ao/eng_psf/eng_spu.c @@ -291,20 +291,28 @@ int32 spu_command(void *handle, int32 command, int32 parameter) case COMMAND_RESTART: { - s->song_ptr = &s->start_of_file[0x80200]; - - if (s->old_fmt) - { - s->num_events = s->song_ptr[4] | s->song_ptr[5]<<8 | s->song_ptr[6]<<16 | s->song_ptr[7]<<24; - } - else - { - s->end_tick = s->song_ptr[0] | s->song_ptr[1]<<8 | s->song_ptr[2]<<16 | s->song_ptr[3]<<24; - s->cur_tick = s->song_ptr[4] | s->song_ptr[5]<<8 | s->song_ptr[6]<<16 | s->song_ptr[7]<<24; - } - - s->song_ptr += 8; - s->cur_event = 0; + printf ("eng_spu restart\n"); + uint8 *buffer = s->start_of_file; + int i; + uint16 reg; + + // apply the register image + for (i = 0; i < 512; i += 2) + { + reg = buffer[0x80000+i] | buffer[0x80000+i+1]<<8; + + SPUwriteRegister(s->mips_cpu, (i/2)+0x1f801c00, reg); + } + + if (!s->old_fmt) + { + s->end_tick = buffer[0x80200] | buffer[0x80201]<<8 | buffer[0x80202]<<16 | buffer[0x80203]<<24; + s->cur_tick = buffer[0x80204] | buffer[0x80205]<<8 | buffer[0x80206]<<16 | buffer[0x80207]<<24; + s->next_tick = s->cur_tick; + } + + s->song_ptr = &buffer[0x80208]; + s->cur_event = 0; return AO_SUCCESS; } break; |