Problem to add Philips VG5000 target
Problem to add Philips VG5000 target
Hello,
I try to add the Philips VG5000 to the list of targets of z88dk but I have some problems to compile my program.
Here is the files that I modified:
in /libsrc
vg5k.lst
stdio/vg5k/fgetc_cons
stdio/vg5k/fputc_cons
stdio/vg5k/getk
stdio/puts_cons
@z80.lst
Makefile
in all: vg5k_clibs.lib
# Philips VG5000 lib - Joaopa
vg5k_clib.lib:
@echo ''
@echo '--- Building Philips VG5000 Library ---'
@echo ''
cd strings ; $(MAKE) ; cd ..
cd stdlib ; $(MAKE) generic ; cd ..
cd stdio ; $(MAKE) generic ; cd ..
cd printflike ; $(MAKE) ; cd ..
cd setjmp ; $(MAKE) ; cd ..
cd assert ; $(MAKE) ; cd ..
cd psg ; $(MAKE) ; cd ..
$(LIBLINKER) -DFORvg5k -x$(OUTPUT_DIRECTORY)/vg5k_clib @$(LISTFILE_DIRECTORY)/vg5k.lst
stdio/vg5k
fgetc_cons.asm
;
; Philips VG5000
;
; getkey() Wait for keypress
;
; Jun 2014 - Joaopa
;
;
; $Id: fgetc_cons.asm,v 1.1 2014/04/17 06:16:05 david Exp $
;
XLIB fgetc_cons
fgetc_cons:
ret
fputc_cons.asm
;
; Philips VG5000 Routines
;
; Print character to the screen
;
; Jun. 2014 -Joaopa
;
;
; $Id: fputc_cons.asm,v 1.2 2014/05/06 06:23:37 Joaopa Exp $
;
XLIB fputc_cons
;
; Entry: char to print
;
fputc_cons:
ret
getk.asm
;
; Philips VG5000
;
; getk() Read key status
;
; Jun. 2014 - joaopa
;
;
; $Id: getk.asm,v 1.1 2014/04/17 06:16:05 joaopa Exp $
;
XLIB getk
getk:
ret
in lib
config/vg5k.cfg
#
# Target configuration file for z88dk
#
# Asm file which contains the startup code (without suffix)
CRT0 DESTDIR/lib/vg5k_crt0
# Any default options you want - these are options to zcc which are fed
# through to compiler, assembler etc as necessary
OPTIONS -v -O2 -I. -DZ80 -DVG5K -D__VG5000__ -M -clib=default
CLIB default -lvg5k_clib
SUBTYPE default -Cz+vg5k
in vg5k_crt0.opt
INCLUDE "vg5k_crt0.asm
in vg5k_crt0.asm
; CRT0 for the VG5000
;
; Joaopa Jun. 2014
MODULE vg5k_crt0
;-------
; Include zcc_opt.def to find out information about us
;-------
INCLUDE "zcc_opt.def"
;-------
; Some general scope declarations
;-------
XREF _main ;main() is always external to crt0 code
;--------
; Set an origin for the application (-zorg=) default to $5000
;--------
IF !myzorg
defc myzorg = 20480
ENDIF
org myzorg
org myzorg
call _main
So, I do make clean &&build.sh.
Everything compiles fine.
So I try my program. But the compilation fails with the logout
zcc +vg5k -lndos -z80-verb -lm echecs.c -verbose
cp /home/david/z88dk/lib/config//../..//lib/vg5k_crt0.opt /tmp/tmpXXXo4R25.opt
cp /tmp/tmpXXXo4R25.opt /tmp/tmpXXXo4R25.asm
zcpp -I. -DZ80 -DVG5K -D__VG5000__ -DSCCZ80 -DSMALL_C -I/home/david/z88dk/lib/config//../..//include echecs.c /tmp/tmpXXr4brMM.i
sccz80 -verbose -asm=z80asm /tmp/tmpXXr4brMM.i
Compiling: /tmp/tmpXXr4brMM.i
Defining function: assembleur
Defining function: attribut_piece
Defining function: affiche_echiquier
Defining function: initialisation_echiquier
Defining function: analyse
Defining function: new_game
Defining function: appelle_D
Defining function: computer_move
Defining function: main
Defining function: tester_echecs
Defining function: tester_prise
Defining function: tester_roque
Defining function: D
Symbol table usage: 327
Structures defined: 4
Members defined: 36
There were 0 errors in compilation.
copt /home/david/z88dk/lib/config//../..//lib/z80rules.2 < /tmp/tmpXXr4brMM.asm > /tmp/tmpXXr4brMM.op1
copt /home/david/z88dk/lib/config//../..//lib/z80rules.1 < /tmp/tmpXXr4brMM.op1 > /tmp/tmpXXr4brMM.opt
z80asm -eopt -v -ns -Mo -I/home/david/z88dk/lib/config//../..//lib /tmp/tmpXXr4brMM.opt
Assemble all files
Assembling '/tmp/tmpXXr4brMM.opt'...
Pass1...
Reading '/tmp/tmpXXr4brMM.opt'...
Reading 'z80_crt0.hdr'...
Pass2...
Size of module 'echecs' is 8592 bytes
z80asm -a -m -Mo -L/home/david/z88dk/lib/config//../..//lib/clibs -I/home/david/z88dk/lib/config//../..//lib -oa.bin -v -ivg5k_clib -igen_math -iz80_crt0 /tmp/tmpXXXo4R25.opt /tmp/tmpXXr4brMM.o
Assemble only updated files
Create symbol table file.sym
Assemble and link/relocate to file.bin
Link library file.lib
Create address map file.map
Assembling '/tmp/tmpXXXo4R25.asm'...
Pass1...
Reading '/tmp/tmpXXXo4R25.asm'...
Reading 'vg5k_crt0.asm'...
Reading 'zcc_opt.def'...
Pass2...
Size of module 'vg5k_crt0' is 3 bytes
linking module(s)...
Pass1...
ORG address for code is 5000
Linking library module <l_gchar>
Linking library module <l_sxt>
Linking library module <l_gint>
Linking library module <l_pint>
Linking library module <l_or>
Linking library module <l_xor>
Linking library module <l_and>
Linking library module <l_eq>
Linking library module <l_ne>
Linking library module <l_gt>
Linking library module <l_ge>
Linking library module <l_lt>
Linking library module <l_ult>
Linking library module <l_asr>
Linking library module <l_neg>
Linking library module <l_lneg>
Linking library module <l_mul>
Linking library module <l_div>
Linking library module <l_div_u>
Linking library module <strlen>
Linking library module <tmpXXlARpWi>
Linking library module <l_gintsp>
Linking library module <l_gintspsp>
Linking library module <l_pint_pop>
Linking library module <getarg>
Linking library module <memset_callee>
Linking library module <abs>
Linking library module <strcpy_callee>
Linking library module <memcpy_callee>
Code size of linked modules is 9006 bytes
Pass2...
Error at file '/tmp/tmpXXlARpWi.opt' line 64: symbol not defined
1 errors occurred during assembly
Key to filenames:
/tmp/tmpXXr4brMM.o = echecs.c
Error at file '/tmp/tmpXXlARpWi.opt' line 64: symbol not defined
Erreur de segmentation (core dumped)
When I use +zx, everything is ok
zcc +zx -lndos -lm echecs.c -verbose
cp /home/david/z88dk/lib/config//../..//lib/spec_crt0.opt /tmp/tmpXXpiN68e.opt
cp /tmp/tmpXXpiN68e.opt /tmp/tmpXXpiN68e.asm
zcpp -I. -DZ80 -DSPECTRUM -D__SPECTRUM__ -DSCCZ80 -DSMALL_C -I/home/david/z88dk/lib/config//../..//include echecs.c /tmp/tmpXXsOA690.i
sccz80 -verbose -asm=z80asm /tmp/tmpXXsOA690.i
Compiling: /tmp/tmpXXsOA690.i
Defining function: assembleur
Defining function: attribut_piece
Defining function: affiche_echiquier
Defining function: initialisation_echiquier
Defining function: analyse
Defining function: new_game
Defining function: appelle_D
Defining function: computer_move
Defining function: main
Defining function: tester_echecs
Defining function: tester_prise
Defining function: tester_roque
Defining function: D
Symbol table usage: 435
Structures defined: 5
Members defined: 41
There were 0 errors in compilation.
copt /home/david/z88dk/lib/config//../..//lib/z80rules.2 < /tmp/tmpXXsOA690.asm > /tmp/tmpXXsOA690.op1
copt /home/david/z88dk/lib/config//../..//lib/z80rules.1 < /tmp/tmpXXsOA690.op1 > /tmp/tmpXXsOA690.opt
z80asm -eopt -ns -Mo -I/home/david/z88dk/lib/config//../..//lib /tmp/tmpXXsOA690.opt
z80asm -a -m -Mo -L/home/david/z88dk/lib/config//../..//lib/clibs -I/home/david/z88dk/lib/config//../..//lib -oa.bin -izx_clib -igen_math -indos -iz80_crt0 /tmp/tmpXXpiN68e.opt /tmp/tmpXXsOA690.o
Does anyone see the culprit?
I try to add the Philips VG5000 to the list of targets of z88dk but I have some problems to compile my program.
Here is the files that I modified:
in /libsrc
vg5k.lst
stdio/vg5k/fgetc_cons
stdio/vg5k/fputc_cons
stdio/vg5k/getk
stdio/puts_cons
@z80.lst
Makefile
in all: vg5k_clibs.lib
# Philips VG5000 lib - Joaopa
vg5k_clib.lib:
@echo ''
@echo '--- Building Philips VG5000 Library ---'
@echo ''
cd strings ; $(MAKE) ; cd ..
cd stdlib ; $(MAKE) generic ; cd ..
cd stdio ; $(MAKE) generic ; cd ..
cd printflike ; $(MAKE) ; cd ..
cd setjmp ; $(MAKE) ; cd ..
cd assert ; $(MAKE) ; cd ..
cd psg ; $(MAKE) ; cd ..
$(LIBLINKER) -DFORvg5k -x$(OUTPUT_DIRECTORY)/vg5k_clib @$(LISTFILE_DIRECTORY)/vg5k.lst
stdio/vg5k
fgetc_cons.asm
;
; Philips VG5000
;
; getkey() Wait for keypress
;
; Jun 2014 - Joaopa
;
;
; $Id: fgetc_cons.asm,v 1.1 2014/04/17 06:16:05 david Exp $
;
XLIB fgetc_cons
fgetc_cons:
ret
fputc_cons.asm
;
; Philips VG5000 Routines
;
; Print character to the screen
;
; Jun. 2014 -Joaopa
;
;
; $Id: fputc_cons.asm,v 1.2 2014/05/06 06:23:37 Joaopa Exp $
;
XLIB fputc_cons
;
; Entry: char to print
;
fputc_cons:
ret
getk.asm
;
; Philips VG5000
;
; getk() Read key status
;
; Jun. 2014 - joaopa
;
;
; $Id: getk.asm,v 1.1 2014/04/17 06:16:05 joaopa Exp $
;
XLIB getk
getk:
ret
in lib
config/vg5k.cfg
#
# Target configuration file for z88dk
#
# Asm file which contains the startup code (without suffix)
CRT0 DESTDIR/lib/vg5k_crt0
# Any default options you want - these are options to zcc which are fed
# through to compiler, assembler etc as necessary
OPTIONS -v -O2 -I. -DZ80 -DVG5K -D__VG5000__ -M -clib=default
CLIB default -lvg5k_clib
SUBTYPE default -Cz+vg5k
in vg5k_crt0.opt
INCLUDE "vg5k_crt0.asm
in vg5k_crt0.asm
; CRT0 for the VG5000
;
; Joaopa Jun. 2014
MODULE vg5k_crt0
;-------
; Include zcc_opt.def to find out information about us
;-------
INCLUDE "zcc_opt.def"
;-------
; Some general scope declarations
;-------
XREF _main ;main() is always external to crt0 code
;--------
; Set an origin for the application (-zorg=) default to $5000
;--------
IF !myzorg
defc myzorg = 20480
ENDIF
org myzorg
org myzorg
call _main
So, I do make clean &&build.sh.
Everything compiles fine.
So I try my program. But the compilation fails with the logout
zcc +vg5k -lndos -z80-verb -lm echecs.c -verbose
cp /home/david/z88dk/lib/config//../..//lib/vg5k_crt0.opt /tmp/tmpXXXo4R25.opt
cp /tmp/tmpXXXo4R25.opt /tmp/tmpXXXo4R25.asm
zcpp -I. -DZ80 -DVG5K -D__VG5000__ -DSCCZ80 -DSMALL_C -I/home/david/z88dk/lib/config//../..//include echecs.c /tmp/tmpXXr4brMM.i
sccz80 -verbose -asm=z80asm /tmp/tmpXXr4brMM.i
Compiling: /tmp/tmpXXr4brMM.i
Defining function: assembleur
Defining function: attribut_piece
Defining function: affiche_echiquier
Defining function: initialisation_echiquier
Defining function: analyse
Defining function: new_game
Defining function: appelle_D
Defining function: computer_move
Defining function: main
Defining function: tester_echecs
Defining function: tester_prise
Defining function: tester_roque
Defining function: D
Symbol table usage: 327
Structures defined: 4
Members defined: 36
There were 0 errors in compilation.
copt /home/david/z88dk/lib/config//../..//lib/z80rules.2 < /tmp/tmpXXr4brMM.asm > /tmp/tmpXXr4brMM.op1
copt /home/david/z88dk/lib/config//../..//lib/z80rules.1 < /tmp/tmpXXr4brMM.op1 > /tmp/tmpXXr4brMM.opt
z80asm -eopt -v -ns -Mo -I/home/david/z88dk/lib/config//../..//lib /tmp/tmpXXr4brMM.opt
Assemble all files
Assembling '/tmp/tmpXXr4brMM.opt'...
Pass1...
Reading '/tmp/tmpXXr4brMM.opt'...
Reading 'z80_crt0.hdr'...
Pass2...
Size of module 'echecs' is 8592 bytes
z80asm -a -m -Mo -L/home/david/z88dk/lib/config//../..//lib/clibs -I/home/david/z88dk/lib/config//../..//lib -oa.bin -v -ivg5k_clib -igen_math -iz80_crt0 /tmp/tmpXXXo4R25.opt /tmp/tmpXXr4brMM.o
Assemble only updated files
Create symbol table file.sym
Assemble and link/relocate to file.bin
Link library file.lib
Create address map file.map
Assembling '/tmp/tmpXXXo4R25.asm'...
Pass1...
Reading '/tmp/tmpXXXo4R25.asm'...
Reading 'vg5k_crt0.asm'...
Reading 'zcc_opt.def'...
Pass2...
Size of module 'vg5k_crt0' is 3 bytes
linking module(s)...
Pass1...
ORG address for code is 5000
Linking library module <l_gchar>
Linking library module <l_sxt>
Linking library module <l_gint>
Linking library module <l_pint>
Linking library module <l_or>
Linking library module <l_xor>
Linking library module <l_and>
Linking library module <l_eq>
Linking library module <l_ne>
Linking library module <l_gt>
Linking library module <l_ge>
Linking library module <l_lt>
Linking library module <l_ult>
Linking library module <l_asr>
Linking library module <l_neg>
Linking library module <l_lneg>
Linking library module <l_mul>
Linking library module <l_div>
Linking library module <l_div_u>
Linking library module <strlen>
Linking library module <tmpXXlARpWi>
Linking library module <l_gintsp>
Linking library module <l_gintspsp>
Linking library module <l_pint_pop>
Linking library module <getarg>
Linking library module <memset_callee>
Linking library module <abs>
Linking library module <strcpy_callee>
Linking library module <memcpy_callee>
Code size of linked modules is 9006 bytes
Pass2...
Error at file '/tmp/tmpXXlARpWi.opt' line 64: symbol not defined
1 errors occurred during assembly
Key to filenames:
/tmp/tmpXXr4brMM.o = echecs.c
Error at file '/tmp/tmpXXlARpWi.opt' line 64: symbol not defined
Erreur de segmentation (core dumped)
When I use +zx, everything is ok
zcc +zx -lndos -lm echecs.c -verbose
cp /home/david/z88dk/lib/config//../..//lib/spec_crt0.opt /tmp/tmpXXpiN68e.opt
cp /tmp/tmpXXpiN68e.opt /tmp/tmpXXpiN68e.asm
zcpp -I. -DZ80 -DSPECTRUM -D__SPECTRUM__ -DSCCZ80 -DSMALL_C -I/home/david/z88dk/lib/config//../..//include echecs.c /tmp/tmpXXsOA690.i
sccz80 -verbose -asm=z80asm /tmp/tmpXXsOA690.i
Compiling: /tmp/tmpXXsOA690.i
Defining function: assembleur
Defining function: attribut_piece
Defining function: affiche_echiquier
Defining function: initialisation_echiquier
Defining function: analyse
Defining function: new_game
Defining function: appelle_D
Defining function: computer_move
Defining function: main
Defining function: tester_echecs
Defining function: tester_prise
Defining function: tester_roque
Defining function: D
Symbol table usage: 435
Structures defined: 5
Members defined: 41
There were 0 errors in compilation.
copt /home/david/z88dk/lib/config//../..//lib/z80rules.2 < /tmp/tmpXXsOA690.asm > /tmp/tmpXXsOA690.op1
copt /home/david/z88dk/lib/config//../..//lib/z80rules.1 < /tmp/tmpXXsOA690.op1 > /tmp/tmpXXsOA690.opt
z80asm -eopt -ns -Mo -I/home/david/z88dk/lib/config//../..//lib /tmp/tmpXXsOA690.opt
z80asm -a -m -Mo -L/home/david/z88dk/lib/config//../..//lib/clibs -I/home/david/z88dk/lib/config//../..//lib -oa.bin -izx_clib -igen_math -indos -iz80_crt0 /tmp/tmpXXpiN68e.opt /tmp/tmpXXsOA690.o
Does anyone see the culprit?
What's the code around line 64 in ehecs.c?joaopa wrote:Error at file '/tmp/tmpXXlARpWi.opt' line 64: symbol not defined
1 errors occurred during assembly
Key to filenames:
/tmp/tmpXXr4brMM.o = echecs.c
Error at file '/tmp/tmpXXlARpWi.opt' line 64: symbol not defined
Erreur de segmentation (core dumped)
I put the requested new-stuff at the following address (I did not manage to obtain your email address Stephano). Hope you can do a working skeleton, for VG5000 platform.
https://docs.google.com/uc?export=downl ... UtoS3pQTlk
https://docs.google.com/uc?export=downl ... UtoS3pQTlk
In the meantime I commited a working lib prototype.
It features the 1-bit sound implementation and a bit crappy console in standard and VT-ANSI emulation mode; scroll is not implemented and the text output is based on the ROM calls but it is a good starting point for you to make it evolve as you prefer.
I couldn't get the video memory access methods work in a stable way but if you understand what's wrong the existing monochrome graphics lib may follow quite easily.
It features the 1-bit sound implementation and a bit crappy console in standard and VT-ANSI emulation mode; scroll is not implemented and the text output is based on the ROM calls but it is a good starting point for you to make it evolve as you prefer.
I couldn't get the video memory access methods work in a stable way but if you understand what's wrong the existing monochrome graphics lib may follow quite easily.
..a screenshot preview
http://www.z88dk.org/wiki/doku.php?id=e ... ps_vg-5000
http://www.z88dk.org/wiki/doku.php?id=e ... ps_vg-5000
I dowloaded the latest cvs of z88dk. I did not find the files for VG5000 inside. So when trying to compile a program, I obtain an error
zcc +vg5k -lndos -create-app othello.cpp game.cpp minimax.cpp board.cpp
Can't open config file /home/joaopa/z88dk/lib/config/vg5k.cfg
Makefile:5: recipe for target 'othello' failed
make: *** [othello] Error 1
Is it normal?
zcc +vg5k -lndos -create-app othello.cpp game.cpp minimax.cpp board.cpp
Can't open config file /home/joaopa/z88dk/lib/config/vg5k.cfg
Makefile:5: recipe for target 'othello' failed
make: *** [othello] Error 1
Is it normal?
Last edited by joaopa on Sun Sep 06, 2015 7:53 am, edited 1 time in total.
The vg5k target is in the nightly and I've just successfully compiled othello.c for it from the examples directory. I did have to fix the crt because it contained two identical ORG statements and that fix will be present in the next nightly.
Which nightly did you download (win, macos, ..)?
I'm thinking maybe you don't have the path variables set?
http://www.z88dk.org/wiki/doku.php?id=t ... stallation
Which nightly did you download (win, macos, ..)?
I'm thinking maybe you don't have the path variables set?
http://www.z88dk.org/wiki/doku.php?id=t ... stallation
Ok good. Yes the sourceforge link is very old and a lot has changed since. We're hopefully going to do a beta release soon -- we're just trying to fill in some documentation first.joaopa wrote:I see my mistake. I downloaded the latest cvs from Sourceforge. It is pretty old. The latest night-build is correct. I could compile a test programm with the VG5000 as target.
Thank you
A better answer would probably come from stef but what usually happens is the target is able to plot hi-resolution pixels but then it's also able to create graphics in another lower resolution way, for example by printing characters with block patterns or by lowering the pixel resolution in order to obtain a higher colour resolution. So the name lo-rez has meaning dependent on the target.joaopa wrote:How do you define lo-rez graphics?
On the zx target, eg, there is a normal resolution mode that is 256x192 in pixels and 32x24 in colour so that pixel and colour resolution do not match. The lo-rez implementation is 64x24 pixels (I think!) but each pixel can be any colour.
I don't know what stef did for the vg5000.