HI:
Mr. Stefano, Pals!
I want to use z88dk to do some programs on a Commodore 128 NTSC / WinVice 3.1.
I try to compile the example sgdemo.c from the examples\c128 folder using the two ways writed into the .c file comments
For native mode:
zcc +c128 -lndos -lmalloc sgdemo.c
And for cp/m mode:
zcc +cpm -lc128cpm -lndos -lmalloc sgdemo.c
But on the two cases raises this error:
sccz80:"sgdemo.c" L:55 Error:Illegal Argument Name:
I see the line 55 of sgdemo.c and this appears:
/* 64k vdc locations */
That I assume is not the problem but the previous line:
extern long heap(60000);
Please, can help me to compile this example!
I'm using the z88dk-win32-2.0 on Window 10 Pro
Thanks in advance for Your time!
help compile c128 example
I resolve this by Myself.
Change to using the static form of heap variable:
long heap;
Compile without using -lmalloc, because now is part of the system library itself.
Here a helpfull batch file to help pals:
zcc +c128 -subtype=disk -create-app -lm sgdemo.c -o sgdemo.bin
c1541 -format "sgdemo,sg" d64 sgdemo.d64
c1541 -attach sgdemo.d64 -write sgdemo.ldr sgdemo.ldr
c1541 -attach sgdemo.d64 -write sgdemo sgdemo
rem c1541 -attach sgdemo.d64 -write demo1.pcx demo1.pcx
rem c1541 -attach sgdemo.d64 -write demo2.pcx demo2.pcx
rem x128 -autostart "sgdemo.d64:sgdemo.ldr"
x128 "sgdemo.d64:sgdemo.ldr"
Enjoy
Change to using the static form of heap variable:
long heap;
Compile without using -lmalloc, because now is part of the system library itself.
Here a helpfull batch file to help pals:
zcc +c128 -subtype=disk -create-app -lm sgdemo.c -o sgdemo.bin
c1541 -format "sgdemo,sg" d64 sgdemo.d64
c1541 -attach sgdemo.d64 -write sgdemo.ldr sgdemo.ldr
c1541 -attach sgdemo.d64 -write sgdemo sgdemo
rem c1541 -attach sgdemo.d64 -write demo1.pcx demo1.pcx
rem c1541 -attach sgdemo.d64 -write demo2.pcx demo2.pcx
rem x128 -autostart "sgdemo.d64:sgdemo.ldr"
x128 "sgdemo.d64:sgdemo.ldr"
Enjoy
It looks like the PCX files can be obtained from here: http://www.z80.eu/gsx.html
To make it work on a c128 ntsc without vdc 64k expansion it need the line 694 to be commented and uncomment the next line, like this.
//if(savechrsets()) /* check if vdc in 16k mode */
if(1) /* check if vdc in 16k mode */
That's because the routine savechrsets doesn't work as spected.
uchar savechrsets(void)
{
if(is64kvdc())
return(1);
else
{
appChSetBufPtr = memtobufvdc(vdcCharMem,vdcCharMemSize); <== this line doesn't do its job
if (appChSetBufPtr != NULL)
return(1);
else
return(0);
}
}
As collateral damage, the character memory is not restored when return from graphic mode and show garbage on screen instead of characters, even if a call to savechrsets is maded by hand.
//if(savechrsets()) /* check if vdc in 16k mode */
if(1) /* check if vdc in 16k mode */
That's because the routine savechrsets doesn't work as spected.
uchar savechrsets(void)
{
if(is64kvdc())
return(1);
else
{
appChSetBufPtr = memtobufvdc(vdcCharMem,vdcCharMemSize); <== this line doesn't do its job
if (appChSetBufPtr != NULL)
return(1);
else
return(0);
}
}
As collateral damage, the character memory is not restored when return from graphic mode and show garbage on screen instead of characters, even if a call to savechrsets is maded by hand.
I find the files here, Thank You, but the demo doesb't load the images.dom wrote:It looks like the PCX files can be obtained from here: http://www.z80.eu/gsx.html
Maybe other problem happend.