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
noise management to wyz library effects #1430
Conversation
port from original repo
Where's the original modification from? |
It was thEpOpE's improvement to 'La Churrera' MK1 engine, so effects become much more powerful. Example: new game 'Black and white' (https://greenwebsevilla.itch.io/black-and-white) uses this modification. Now it works ok, it was just they way I called it too often in my example. Check description above. |
@suborb WDYT? |
@@ -980,19 +998,26 @@ RS_CANALC: | |||
LD (IX+4),B | |||
LD (IX+5),C | |||
LD (IX+10),D | |||
poneruidomixer: ;este punto es comun a los 3 canales | |||
ld a,e ;cargamos la máscara para el mixer | |||
and (ix+7) ;lo aplicamos desde el buffer de registros del ay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsmolina we need to ensure that the top two bits of register 7 are 10b or MSX machines start to explode.
For some reason, that bit of code is in here rather than the actual MSX player.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suborb I've been talking with original author (thEpOpE), and looks like
(1) Mixer (IX+7) it's set by WYZ tracker
(2) Initially, 'E' has a common mask (%11011111)
this mask only nullifies one bit. C channel bit.
For channel B, register is rotated twice, cyclically.
So the bit that is kicked our on the right is added from the left.
For channel A, register is rotated once.
So, for channel A: register E = %11110111
in channel B: register E= %11101111
in channel A: register E = %11011111
this mask is applied in three instructions
poneruidomixer: ;este punto es comun a los 3 canales
ld a,e ;cargamos la máscara para el mixer
and (ix+7) ;lo aplicamos desde el buffer de registros del ay
ld (ix+7),a ;dejamos el resultado en el buffer de registros del ay
The problem are as you said with 2 first bits (bit 7 and bit 6). Rotations are cyclic, top bits are never altered.
These two high bits are enabling/disabling the two pins IN/OUT that AY has, so they must be always preserved, as ZX Spectrum also uses them.
Player also considers them here:
FIN_NOPLAYER:
LD A,10111000B
LD [PSG_REG+7],A
RET
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great comment, thank you
Adding noise management in effects to wyz lib.
Original code by thEpOpE
It works ok: example of it on
https://github.com/jsmolina/wyz-z88dk-integration/releases/download/0.1/a.tap
(3 = hihat, 2=snare, 1=bass drum)
Caveats: it detects if noise channel is present in effects, but you cannot mix two kind of effects. In case there is no noise channel, you must set 00, like in
https://github.com/jsmolina/wyz-z88dk-integration/blob/master/effects.asm#L29-L30