Disable keyboard click sound with -lmsxbios

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

Disable keyboard click sound with -lmsxbios

Post by Fabrizio »

Hi everyone,

I am not able to disable the keyboard click sound on the MSX target if I use the -lmsxbios.

If I do:
POKE(0xF3DB,0);
I disable it on the msx but not if I also use -lmsxbios

So, something else is keeping the click sound active.

I am not familiar with the MSX emulators and with MSX (My project is massively cross-dev-kit and cross-platform: https://github.com/Fabrizio-Caruso/CROSS-LIB).
User avatar
dom
Well known member
Posts: 1256
Joined: Sun Jul 15, 2007 10:01 pm

Re: Disable keyboard click sound with -lmsxbios

Post by dom »

Did you add a write breakpoint to 0xf3db to see where it's being changed?

Using Mame it's "wpset 0xf3db,1,w" for example - see https://docs.mamedev.org/debugger/watchpoint.html
Fabrizio
Member
Posts: 86
Joined: Tue Jul 11, 2017 9:28 pm

Re: Disable keyboard click sound with -lmsxbios

Post by Fabrizio »

@dom, thanks I will try to use Mame and see if I can figure it out.
Timmy
Well known member
Posts: 162
Joined: Sat Mar 10, 2012 4:18 pm

Re: Disable keyboard click sound with -lmsxbios

Post by Timmy »

I think checking with a breakpoint is a great idea!

I don't use -lmsxbios myself (because I never figured out how it worked, i didn't even know that i could include that file, for example), but my msx_rom type games works with no problems when i set that byte to 0 in my own code. So something strange is going on.
User avatar
dom
Well known member
Posts: 1256
Joined: Sun Jul 15, 2007 10:01 pm

Re: Disable keyboard click sound with -lmsxbios

Post by dom »

All msxbios does really is to set VDP registers using the BIOS rather than write the VDP directly.

There's a few other routines to call some other bios functions, but it's really not an essential library.
Timmy
Well known member
Posts: 162
Joined: Sat Mar 10, 2012 4:18 pm

Re: Disable keyboard click sound with -lmsxbios

Post by Timmy »

Thanks for the info.

Can I ask 2 questions while he is still doing the breakpoints?

How do I use -lmsxbios? I haven't seen a msxbios.h inside z88dk. Is this library just somewhere hidden?
Can I just use it by "#include <msxbios.h>" and then invoke it with -msxbios and what is in there? (This would save me reinventing code.)

I can also see some really useful definitions in /z88dk/lib/target/msx/def/, like msxbios.def or msx.def. Is it possible to use these defines so that I don't have to define my own constants in my own code?
User avatar
dom
Well known member
Posts: 1256
Joined: Sun Jul 15, 2007 10:01 pm

Re: Disable keyboard click sound with -lmsxbios

Post by dom »

It's an overlay library so just add -lmsxbios to your compile line and it will replace the default implementations in the core MSX library. There's really not much there: https://github.com/z88dk/z88dk/tree/mas ... sx/msxbios but I guess more could be added.

In terms of those files in lib/target/msx/def - just INCLUDE "target/msx/def/msxbios.def" to get the constants into your assemble files/functinos.
Timmy
Well known member
Posts: 162
Joined: Sat Mar 10, 2012 4:18 pm

Re: Disable keyboard click sound with -lmsxbios

Post by Timmy »

Hi, I was wondering if you have solved the problem already, or do you need more help?
Fabrizio
Member
Posts: 86
Joined: Tue Jul 11, 2017 9:28 pm

Re: Disable keyboard click sound with -lmsxbios

Post by Fabrizio »

@Tim I have a workaround for the problem in that I do not use msxbios, which I do not really need and use.
So I have solved my use-case.

But I don't understand why the keyboard click persists.
I need to set up Mame as I only use OpenMSX and BlueMSX for the msx.
I also need to simplify my code to isolate the issue.
I need to use a breakpoint and see if I can figure it out.
As I am in the middle of a big rewrite of my code (Cross-Lib) I have not, yet, done the investigation.
Post Reply