AxelStone
New member
Posts: 7 Joined: Thu Oct 24, 2019 7:38 pm
Post
by AxelStone » Sun Nov 03, 2019 5:07 pm
Hello everyone, I'm trying my first code using asmlib from Konamiman. I'd like to test BiosCall, so I try with the simplest function (BEEP). Here goes my code:
Code: Select all
#include <stdio.h>
#include <arch/msx/asm.h>
#define BEEP 0x00C0
Z80_registers regs;
register_usage usage;
int main()
{
usage = REGS_NONE;
BiosCall(BEEP,®s,usage);
return 0;
}
Instead of BEEP I get a weird sound sometimes and other times silence. What's wrong?
Thanks.
dom
Well known member
Posts: 2091 Joined: Sun Jul 15, 2007 10:01 pm
Post
by dom » Sun Nov 03, 2019 6:22 pm
I've just run through this with a debugger and I can't replicate this.
Everytime the program is run I end up at address 0xC0 and a beep is made. This is using the takeda emulator.
Just as a sanity check, what version of z88dk are you using?
AxelStone
New member
Posts: 7 Joined: Thu Oct 24, 2019 7:38 pm
Post
by AxelStone » Sun Nov 03, 2019 6:45 pm
Hello dom, this one according to info:
zcc - Frontend for the z88dk Cross-C Compiler - v15371-4af3b45-20191011
I compile the source with this command:
zcc +msx -subtype=msxdos2 -create-app -otest.com test.c -lmsx_clib
To get a DOS2 executable. I've tried OpenMSX, which one is the takeda emulator? Thanks.
AxelStone
New member
Posts: 7 Joined: Thu Oct 24, 2019 7:38 pm
Post
by AxelStone » Sun Nov 03, 2019 6:52 pm
Wow you are right, just tested on real MSX and it works perfect. OpenMSX is not working in the right way :-(.
Perhaps I should use the takeda emulator you say, please let me know which one is ;-). Thanks.
dom
Well known member
Posts: 2091 Joined: Sun Jul 15, 2007 10:01 pm
Post
by dom » Sun Nov 03, 2019 7:12 pm
The takeda emulator is here:
http://takeda-toshiya.my.coocan.jp - it comes without ROMs which can make setting it up a little tricky but I've got sets for most of the machines now.
I think BlueMSX is the most common development emulator, however it doesn't run properly under wine which is why I use the takeda one.