PSG and 1-bit on sms and gamegear

Post Reply
Fabrizio
Member
Posts: 114
Joined: Tue Jul 11, 2017 9:28 pm

PSG and 1-bit on sms and gamegear

Post by Fabrizio »

I am a bit lost with what is meant by PSG as it means many different things depending on the sound chip of the target and on weather you are using the classic lib or the new lib.
I wonder what I can use on the sms and gg in classic lib and if I can reuse the same code I use for other PSG chips.

I see in the doc I see that 1-bit is listed as implemented "PSG (+ 1 bit)" for sms and gg in the table but not in the specific page. If I try to use 1-bit sound I hear nothing. So I guess it is either not implemented or broken.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: PSG and 1-bit on sms and gamegear

Post by dom »

I've just tried compiling examples/sound/fx.c for +sms. I ran it with emulicious and sound was emitted.

For machines with a SN76489 (see features.h and that spreadsheet I created: https://github.com/z88dk/z88dk/blob/mas ... atures.csv) Stefano implemented some code that emulates 1 bit flipping using channel 1 of the SN chip.
Fabrizio
Member
Posts: 114
Joined: Tue Jul 11, 2017 9:28 pm

Re: PSG and 1-bit on sms and gamegear

Post by Fabrizio »

@dom What do you mean by emulates 1 bit flipping? If I use the 1 bit API on the sms I hear nothing.
Should I open an issue?
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: PSG and 1-bit on sms and gamegear

Post by dom »

By emulate, I mean it sets up a tone on channel one and then adjusts the volume.

I've additionally tested examples/sound/synthdemo and it's also making sound. So it looks like the core library is working as it should, so it may well be an emulator issue or whatever code you're using to create sounds.
Fabrizio
Member
Posts: 114
Joined: Tue Jul 11, 2017 9:28 pm

Re: PSG and 1-bit on sms and gamegear

Post by Fabrizio »

How is the user supposed to use the emulated 1-bit sounds on targets with the SN76489 chip?
I am using the 1-bit sound functions bit_fx...(...).

I will try to write a simple example.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: PSG and 1-bit on sms and gamegear

Post by dom »

That’s great. They are working in examples/sound/fx.c - can you try compiling and running that example first of all so we have a known good starting point?
Fabrizio
Member
Posts: 114
Joined: Tue Jul 11, 2017 9:28 pm

Re: PSG and 1-bit on sms and gamegear

Post by Fabrizio »

@dom, yes, I am try fx.c, which is what I am trying to use.
Fabrizio
Member
Posts: 114
Joined: Tue Jul 11, 2017 9:28 pm

Re: PSG and 1-bit on sms and gamegear

Post by Fabrizio »

If I compile fx.c for the zx target I can here sounds.
I hear (and see) nothing if I compile fx.c it for the sms target.
Tested on both Emulicious and Kega Fusion.

I compile fx.c (bit_bang.c is a copy) with:
zx_bit_bang:
$(Z88DK_PATH)$(MYZ88DK) +zx -clib=default -lndos $(SOURCE_PATH)/../../test/bit_bang.c -create-app

sms_bit_bang:
$(Z88DK_PATH)$(MYZ88DK) +sms -clib=default -lndos $(SOURCE_PATH)/../../test/bit_bang.c -create-app
Fabrizio
Member
Posts: 114
Joined: Tue Jul 11, 2017 9:28 pm

Re: PSG and 1-bit on sms and gamegear

Post by Fabrizio »

@dom I am opening an issue to better track this.
Post Reply