Skip to content

Fix sound not disabled anywhere using ``sound'' option.#3

Open
imdjh wants to merge 2 commits intorauchg:masterfrom
imdjh:master
Open

Fix sound not disabled anywhere using ``sound'' option.#3
imdjh wants to merge 2 commits intorauchg:masterfrom
imdjh:master

Conversation

@imdjh
Copy link

@imdjh imdjh commented Oct 14, 2015

When start without GB/GBC ROM provided in GBBOOTROM / GBCBOOTROM variable,
soundMasterEnabled variable is set by default.
A logic glitch would enable soundMasterEnabled variable anyway.

When start without GB/GBC ROM provided in ``GBBOOTROM'' / ``GBCBOOTROM'' variable,
``soundMasterEnabled'' variable is set by default.
A logic glitch would enable ``soundMasterEnabled'' variable anyway.
@imdjh imdjh changed the title Fix sound not disabled anywhere. Fix sound not disabled anywhere using ``sound'' option. Oct 14, 2015
@imdjh
Copy link
Author

imdjh commented Oct 14, 2015

With this patch, the actual memory taking & CPU ticking are saved.
I haven't taken a screenshot with my node-inspect testing, but I can tell it reduced (at least) 3MB in heap allocation.

Here's the node --prof with node-tick-processor output:

# Before patch with sound: false
 [JavaScript]:
   ticks  total  nonlib   name
   1891    3.0%   12.4%  LazyCompile: *min native math.js:152
   1744    2.7%   11.5%  LazyCompile: *GameBoyCore.executeIteration /home/djh/bum/letweplay-codes/weplay-emulator/node_modules/gameboy/index.js:5837
   1151    1.8%    7.6%  LazyCompile: *GameBoyCore.computeAudioChannels /home/djh/bum/letweplay-codes/weplay-emulator/node_modules/gameboy/index.js:5626
   1072    1.7%    7.0%  KeyedCallMegamorphic: args_count: 2
# After patch with sound: false
 [JavaScript]:
   ticks  total  nonlib   name
  12215    4.9%   22.2%  LazyCompile: *GameBoyCore.executeIteration /home/djh/bum/letweplay-codes/weplay-emulator/node_modules/gameboy/index.js:5837
   7313    2.9%   13.3%  KeyedCallMegamorphic: args_count: 2
   6657    2.7%   12.1%  KeyedCallMegamorphic: args_count: 1 {1}

@imdjh
Copy link
Author

imdjh commented Oct 19, 2015

Hi, rauchg:

I found this PR would causing GB emulating freeze randomly. I have no idea why it happenes, but I think the results are the results that it reduced CPU tick in audio part of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant