Page 1 of 1

Using ASMLIB for MSX

Posted: Sun Nov 03, 2019 5:07 pm
by AxelStone
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,&regs,usage);
    return 0;
}
Instead of BEEP I get a weird sound sometimes and other times silence. What's wrong?

Thanks.

Posted: Sun Nov 03, 2019 6:22 pm
by dom
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?

Posted: Sun Nov 03, 2019 6:45 pm
by AxelStone
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.

Posted: Sun Nov 03, 2019 6:52 pm
by AxelStone
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.

Posted: Sun Nov 03, 2019 7:12 pm
by dom
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.