Sord (CGL) M5 Target

Discussion about other targets
Post Reply
jonesypeter
New member
Posts: 9
Joined: Thu Jun 16, 2016 7:16 pm

Sord (CGL) M5 Target

Post by jonesypeter »

Hi,

I'm trying to compile for the Sord M5, and am following the instructions here:

https://github.com/z88dk/z88dk/wiki/Platform---Sord-M5

My emulator is MAME, and I'm just using a very simple C program for testing:

Code: Select all

#include <stdio.h>

int main()
{
   printf("Hello CGL M5 World !\n");
   return 0;
}
If I use the following:

Code: Select all

zcc  +m5 -create-app  program.c
Then run with:

Code: Select all

mame -window m5 -cart1 roms\m5_cart\basic-i.bin -cart2 d:\test.rom
The code runs, but the emulated machine seems to constantly reset rather than stopping. Please see the following video:

https://drive.google.com/file/d/10V5C-N ... sp=sharing

If I use the options to create a tape file:

Code: Select all

zcc  +m5 -create-app -subtype=tape test.c
and use:

Code: Select all

mame -window m5 -cart1 roms\m5_cart\basic-i.bin -cass d:\test.cas
The program loads, then the emulated system seems to reset I have tried it as ROM1 (without BASIC) and ROM2 (with BASIC). Please see the following video:

https://drive.google.com/file/d/10Vv5Vd ... sp=sharing

Any idea what I'm doing wrong?

Thanks

Peter
jonesypeter
New member
Posts: 9
Joined: Thu Jun 16, 2016 7:16 pm

Re: Sord (CGL) M5 Target

Post by jonesypeter »

Apologies, the link to the first video is incorrect. It should be:

https://drive.google.com/file/d/10fkEpQ ... sp=sharing
User avatar
dom
Well known member
Posts: 2239
Joined: Sun Jul 15, 2007 10:01 pm

Re: Sord (CGL) M5 Target

Post by dom »

I'm not going to comment on the tape side of things - I don't think I've ever got it working, so I'll defer to any advice from Stefano on that one.

The ROM side is actually working as expected - after main the ROM exits and is then restarted.

Since this is a bit limiting, I've added support for -pragma-define:CRT_ON_EXIT=XX to define the behaviour when main() returns - doc on this page: https://github.com/z88dk/z88dk/wiki/Classic--Pragmas
stefano
Well known member
Posts: 2282
Joined: Mon Jul 16, 2007 7:39 pm

Re: Sord (CGL) M5 Target

Post by stefano »

it's very long time I not using the wave mode on sord emulators, I remember it was tested on MAME and that the wave periods were incredibly short (high audio frequencies).
I need to test it again before confirming it's all right.

EDIT: I remember the Sord has different BASIC versions, could you try with BASIC-G (hope I remember the right name) ?
Fabrizio
Member
Posts: 120
Joined: Tue Jul 11, 2017 9:28 pm

Re: Sord (CGL) M5 Target

Post by Fabrizio »

Hi everyone!
I used to be able to run my homebrew games on an emulated Sord M5.
This is no longer the case now. I have opened an issue on GitHub:
https://github.com/z88dk/z88dk/issues/2643
I have tried .was, .cas and rom with Takeda's emulator and Mame, with and without BASIC-I.

I am using these options (I need CONIO support):
"
m5: $(ASSETS_PATH)/z88dk_xchase.asm
$(Z88DK_PATH)$(MYZ88DK) +m5 $(SCCZ80_OPTS) \
$(INCLUDE_OPTS) -DEXTRA_TITLE \
-lm -create-app -Cz--audio -subtype=tape \
-pragma-define:REGISTER_SP=65000 \
-D__M5__ \
-clib=ansi -pragma-define:ansicolumns=32 \
...
-clib=default -pragma-redirect:fputc_cons=fputc_cons_generic \
...
$(FULL_FILES) \
-o$(BUILD_PATH)/X$(GAME_NAME)_$@.bin
rm -rf $(BUILD_PATH)/X$(GAME_NAME)_$@.bin
"

I am posting here to see if other people have recently managed to get something working for this target.

Fabrizio
Fabrizio
Member
Posts: 120
Joined: Tue Jul 11, 2017 9:28 pm

Re: Sord (CGL) M5 Target

Post by Fabrizio »

It does work with MESS 0.191...
It seems M5 emulation is broken in more recent MAME/MESS.
Post Reply