comparison psg.c @ 884:252dfd29831d

Selecting a second game from the menu now works
author Michael Pavone <pavone@retrodev.com>
date Fri, 13 Nov 2015 22:56:59 -0800
parents 715475788e93
children bd549b25c362
comparison
equal deleted inserted replaced
883:9f149f0e98b7 884:252dfd29831d
20 context->samples_frame = samples_frame; 20 context->samples_frame = samples_frame;
21 psg_adjust_master_clock(context, master_clock); 21 psg_adjust_master_clock(context, master_clock);
22 for (int i = 0; i < 4; i++) { 22 for (int i = 0; i < 4; i++) {
23 context->volume[i] = 0xF; 23 context->volume[i] = 0xF;
24 } 24 }
25 }
26
27 void psg_free(psg_context *context)
28 {
29 free(context->audio_buffer);
30 //TODO: Figure out how to make this 100% safe
31 //audio thread could still be using this
32 free(context->back_buffer);
33 free(context);
25 } 34 }
26 35
27 #define BUFFER_INC_RES 1000000000UL 36 #define BUFFER_INC_RES 1000000000UL
28 37
29 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock) 38 void psg_adjust_master_clock(psg_context * context, uint32_t master_clock)