Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined duplicate channels in sound engine #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jroweboy
Copy link
Contributor

@jroweboy jroweboy commented Apr 5, 2024

If two channels are unused, then they very likely have the exact same data. This change will detect when a channel's data is already in the file, and point the header pointer to the previous channel data to reduce size for no extra cost

Example:

Consider the following header

music_data_oddity:
	.byte 7
	.word @instruments
	.word @instruments_exp
	.word @samples-4
	.word @song0ch0,@song0ch1,@song0ch2 ; 00 : EPSM Detected

@song0ch0:
  .byte $ff, $ff
@song0ch1:
  .byte $ff, $ff
@song0ch2:
  .byte $ff, $ff

With this patch, the export code will detect that the data is exactly the same between the channels and merge them like so

music_data_oddity:
	.byte 7
	.word @instruments
	.word @instruments_exp
	.word @samples-4
	.word @song0ch0,@song0ch1,@song0ch2 ; 00 : EPSM Detected

@song0ch2:
@song0ch1:
@song0ch0:
  .byte $ff, $ff

The header remains the same, and the data is still there for one channel, but all the "unused" channels will be merged into one.

If two channels are unused, then they very likely have the exact same data. This change
will detect when a channel's data is already in the file, and point the header pointer
to the previous channel data to reduce size for no extra cost
@BleuBleu
Copy link
Owner

BleuBleu commented Apr 5, 2024

This one well put on hold until 4.3.0. Too risky.

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.

2 participants