WauloK
Wacky Amoebatron
Blue Bilby MPAGD dev
Posts: 41
|
Post by WauloK on May 24, 2020 0:16:12 GMT
Hi
Does anyone have some working code I can add to my MPAGD ZXEngine.asm file to make the CRASH sound effect since it doesn't work in MPAGD?
My game is pretty much done but I'd like to have a sound effect when the player dies and there's only BEEP which I've used a few times already.
Cheers.
|
|
WauloK
Wacky Amoebatron
Blue Bilby MPAGD dev
Posts: 41
|
Post by WauloK on May 25, 2020 6:46:07 GMT
Found some nice code online if anyone wants to use it:
noise ld e,250 ; repeat 250 times. ld hl,0 ; start pointer in ROM. noise2 push de ld b,32 ; length of step. noise0 push bc ld a,(hl) ; next "random" number. inc hl ; pointer. and 248 ; we want a black border. out (254),a ; write to speaker. ld a,e ; as e gets smaller... cpl ; ...we increase the delay. noise1 dec a ; decrement loop counter. jr nz,noise1 ; delay loop. pop bc djnz noise0 ; next step. pop de ld a,e sub 24 ; size of step. cp 30 ; end of range. ret z ret c ld e,a cpl noise3 ld b,40 ; silent period. noise4 djnz noise4 dec a jr nz,noise3 jr noise2
|
|