Fix and restore optimization

This commit is contained in:
Lior Halphon 2019-05-10 22:29:30 +03:00
parent 32361589c9
commit ddc4e7484b
2 changed files with 4 additions and 3 deletions

View File

@ -70,7 +70,8 @@ static void render(GB_gameboy_t *gb, bool no_downsampling, GB_sample_t *dest)
{ {
GB_sample_t output = {0,0}; GB_sample_t output = {0,0};
for (unsigned i = GB_N_CHANNELS; i--;) { UNROLL
for (unsigned i = 0; i < GB_N_CHANNELS; i++) {
double multiplier = CH_STEP; double multiplier = CH_STEP;
if (!is_DAC_enabled(gb, i)) { if (!is_DAC_enabled(gb, i)) {
gb->apu_output.dac_discharge[i] -= ((double) DAC_DECAY_SPEED) / gb->apu_output.sample_rate; gb->apu_output.dac_discharge[i] -= ((double) DAC_DECAY_SPEED) / gb->apu_output.sample_rate;
@ -375,7 +376,7 @@ void GB_apu_run(GB_gameboy_t *gb)
} }
UNROLL UNROLL
for (unsigned i = GB_SQUARE_2 + 1; i--;) { for (unsigned i = GB_SQUARE_1; i <= GB_SQUARE_2; i++) {
if (gb->apu.is_active[i]) { if (gb->apu.is_active[i]) {
uint8_t cycles_left = cycles; uint8_t cycles_left = cycles;
while (unlikely(cycles_left > gb->apu.square_channels[i].sample_countdown)) { while (unlikely(cycles_left > gb->apu.square_channels[i].sample_countdown)) {

View File

@ -204,7 +204,7 @@ $(BIN)/SameBoy.app/Contents/MacOS/SameBoy: $(CORE_OBJECTS) $(COCOA_OBJECTS)
-@$(MKDIR) -p $(dir $@) -@$(MKDIR) -p $(dir $@)
$(CC) $^ -o $@ $(LDFLAGS) -framework OpenGL -framework AudioUnit -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework IOKit $(CC) $^ -o $@ $(LDFLAGS) -framework OpenGL -framework AudioUnit -framework AVFoundation -framework CoreVideo -framework CoreMedia -framework IOKit
ifeq ($(CONF), release) ifeq ($(CONF), release)
#strip $@ strip $@
endif endif
$(BIN)/SameBoy.app/Contents/Resources/Base.lproj/%.nib: Cocoa/%.xib $(BIN)/SameBoy.app/Contents/Resources/Base.lproj/%.nib: Cocoa/%.xib