# HG changeset patch # User Michael Pavone # Date 1546027723 28800 # Node ID 4637ab86be8c8c1d3517dcaf5c93c8575533e58a # Parent 858d5214037516df14145523c59ea285a92be39a Preserve WAVE logging FILE * across YM2612 device reset diff -r 858d52140375 -r 4637ab86be8c ym2612.c --- a/ym2612.c Thu Dec 27 10:40:24 2018 -0800 +++ b/ym2612.c Fri Dec 28 12:08:43 2018 -0800 @@ -135,6 +135,11 @@ 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 @@ //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++) {