diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-12-28 12:08:43 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-12-28 12:08:43 -0800 |
commit | 6b9767ff8b2343b9a16c96f26534179c33d4a0fb (patch) | |
tree | 70c91efe311904c6e2ac89952085b86ee051bb62 /ym2612.c | |
parent | afda815d163582c44c5e93cf05dd4da3e073dac4 (diff) |
Preserve WAVE logging FILE * across YM2612 device reset
Diffstat (limited to 'ym2612.c')
-rw-r--r-- | ym2612.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -135,6 +135,11 @@ void ym_reset(ym2612_context *context) memset(context->part1_regs, 0, sizeof(context->part1_regs)); memset(context->part2_regs, 0, sizeof(context->part2_regs)); memset(context->operators, 0, sizeof(context->operators)); + FILE* savedlogs[NUM_CHANNELS]; + for (int i = 0; i < NUM_CHANNELS; i++) + { + savedlogs[i] = context->channels[i].logfile; + } memset(context->channels, 0, sizeof(context->channels)); memset(context->ch3_supp, 0, sizeof(context->ch3_supp)); context->selected_reg = 0; @@ -153,6 +158,7 @@ void ym_reset(ym2612_context *context) //some games seem to expect that the LR flags start out as 1 for (int i = 0; i < NUM_CHANNELS; i++) { context->channels[i].lr = 0xC0; + context->channels[i].logfile = savedlogs[i]; } context->write_cycle = CYCLE_NEVER; for (int i = 0; i < NUM_OPERATORS; i++) { |