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

noise management to wyz library effects #1430

Merged
merged 3 commits into from Apr 1, 2020

Conversation

jsmolina
Copy link
Contributor

@jsmolina jsmolina commented Mar 28, 2020

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

@jsmolina jsmolina changed the title DO NOT MERGE: noise management to wyz library effects noise management to wyz library effects Mar 28, 2020
@jsmolina jsmolina changed the title noise management to wyz library effects noise management to wyz library effects (code by thEpOpE) Mar 28, 2020
@jsmolina jsmolina changed the title noise management to wyz library effects (code by thEpOpE) noise management to wyz library effects Mar 28, 2020
@suborb
Copy link
Member

suborb commented Mar 28, 2020

Where's the original modification from?

@jsmolina
Copy link
Contributor Author

jsmolina commented Mar 29, 2020

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.

@jsmolina
Copy link
Contributor Author

@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
Copy link
Member

@suborb suborb Mar 30, 2020

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.

Copy link
Contributor Author

@jsmolina jsmolina Apr 1, 2020

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great comment, thank you

@suborb suborb merged commit 4df73db into z88dk:master Apr 1, 2020
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.

None yet

2 participants