Jump to content
IGNORED

New release of cross-platform library libcv / libcvu


PkK
 Share

Recommended Posts

Today I released a new version of my cross-platform libraries libcv and libcvu, and also a new version of png2cv.

 

The libraries and tools are designed to make it easy to target multiple Z80-based platforms in a game. They originally started out as tools for ColecoVision development, but now also support the Sega 8-Bit systems. Typically, games written for ColecoVision will just work on the Sega 8-Bit systems, except for input (Sega doesn't have the keypad), and games written for Sega SG-1000 will just work on the ColecoVision and the other Sega 8-Bit systems. Using the full power of the more advanced systems, like the Sega Master system, usually takes a bit more effort. But I have written cross-platform games that do so (when run on a Mark III or Master System they use slightly better graphics than when run on a ColecoVision or SG-1000).

 

http://www.colecovision.eu/ColecoVision/development/libcv.shtml

 

Included in the libcv / libcuv tarball are eight simple demo programs, that show how this cross-platform support works. From a single source, both a ColecoVision version and a Sega version is compiled.

 

This release is meant for use with SDCC 4.0.0 to SDCC 4.1.11. Except for two of the demos, everything should also work with the older SDCC 3.9.0. SDCC 4.1.12 and newer will be supported by a future libcv / libcvu release.

 

  • Like 5
  • Thanks 1
Link to comment
Share on other sites

Today, I released another update: libcv 0.27 / libcvu 0.20.

 

http://www.colecovision.eu/ColecoVision/development/libcv.shtml

 

The main goal of this new version is compability with newer SDCC. It is meant for use with 4.0.0 and later; unlike the previous release, it also works with SDCC 4.1.12 and later.

Some functions hand-written in asm for performance  long ago have been reverted to C code, since SDCC now generates code as good as the hand-written asm for them.

 

Edited by PkK
fixed a typo
Link to comment
Share on other sites

is it possible to get the cvlib pre built. Thanks

 

i use cygwyn and the make didn't work on it. I'm not sure what this is compiled with.

 

also dos this support megacart roms?

 

Great work on these libraries. Been using them for years.

 

 

Link to comment
Share on other sites

What error message did you get building on Cygwin?

I do most of my development on Debian GNU/Linux, not every release gets tested with Cygwin.

 

I've attached a precompiled version, built with SDCC 4.1.12.

 

Warning: On "make" (by  default, i.e. no EXTRACFLAGS set), the library is built for the SDCC version installed. Then, a library built with SDCC older than 4.1.12 will not work when linked to games compiled with SDCC 4.1.12 or later or vice versa.

 

libcv-0.27-prebuilt.tar.gz

  • Like 1
Link to comment
Share on other sites

No luck yet. i reinstalled cygwyn and sdcc 4.1.0. The path is added to my path statement.

 

 

 

gerry@PC-0459 ~/libcv/demos/stars
$ make
sdcc -mz80 -c "-I../../include/" --std-c99 main.c
../../include/cv_graphics.h:194: syntax error: token -> 'CV_ASMCALL' ; column 66
../../include/cv_graphics.h:194: warning 85: in function cv_set_write_vram_address unreferenced functio
n argument : 'address'
../../include/cv_graphics.h:196: syntax error: token -> 'CV_ASMCALL' ; column 65
../../include/cv_graphics.h:196: warning 85: in function cv_set_read_vram_address unreferenced function
 argument : 'address'
../../include/cv_graphics.h:202: syntax error: token -> 'CV_ASMCALL' ; column 70
../../include/cv_graphics.h:202: warning 85: in function cv_memtovmemcpy_slow unreferenced function arg
ument : 'src'
../../include/cv_graphics.h:202: warning 85: in function cv_memtovmemcpy_slow unreferenced function arg
ument : 'n'
../../include/cv_graphics.h:204: syntax error: token -> 'CV_ASMCALL' ; column 70
../../include/cv_graphics.h:204: warning 85: in function cv_memtovmemcpy_fast unreferenced function arg
ument : 'src'
../../include/cv_graphics.h:204: warning 85: in function cv_memtovmemcpy_fast unreferenced function arg
ument : 'n'
../../include/cv_graphics.h:206: syntax error: token -> 'CV_ASMCALL' ; column 65
../../include/cv_graphics.h:206: warning 85: in function cv_vmemtomemcpy_slow unreferenced function arg
ument : 'dest'
../../include/cv_graphics.h:206: warning 85: in function cv_vmemtomemcpy_slow unreferenced function arg
ument : 'n'
../../include/cv_graphics.h:208: syntax error: token -> 'CV_ASMCALL' ; column 65
../../include/cv_graphics.h:208: warning 85: in function cv_vmemtomemcpy_fast unreferenced function arg
ument : 'dest'
../../include/cv_graphics.h:208: warning 85: in function cv_vmemtomemcpy_fast unreferenced function arg
ument : 'n'
../../include/cv_graphics.h:210: syntax error: token -> 'CV_ASMCALL' ; column 55
../../include/cv_graphics.h:210: warning 85: in function cv_vmemset_slow unreferenced function argument
 : 'c'
../../include/cv_graphics.h:210: warning 85: in function cv_vmemset_slow unreferenced function argument
 : 'n'
../../include/cv_graphics.h:212: syntax error: token -> 'CV_ASMCALL' ; column 55
../../include/cv_graphics.h:212: warning 85: in function cv_vmemset_fast unreferenced function argument
 : 'c'
../../include/cv_graphics.h:212: warning 85: in function cv_vmemset_fast unreferenced function argument
 : 'n'
../../include/cv.h:62: syntax error: token -> 'CV_ASMCALL' ; column 75
../../include/cvu_compression.h:38: syntax error: token -> 'CVU_ASMCALL' ; column 99
sdcpp.exe: fatal error: when writing output to : Invalid argument
make: *** [Makefile:19: main.rel] Error 1
 

Link to comment
Share on other sites

2 hours ago, digress said:

No luck yet. i reinstalled cygwyn and sdcc 4.1.0. The path is added to my path statement.

I see the problem (an incompability with some SDCC versions), and will prepare another release to fix it.

In the meantime, the previous version (http://www.colecovision.eu/ColecoVision/development/libcv-0.26.tar.gz) should work with your SDCC 4.1.0.

Link to comment
Share on other sites

I now have sdcc 4.1.12 & 0.28 libcv

 

The link on your site still goes to 0.27 however I typed in http://www.colecovision.eu/ColecoVision/development/libcv-0.28.tar.gz and was able to download the newer file

 

I was able to make the libraries successfully now.

 

in sdcc 4.1.12 the objcopy.exe has been renamed to sdobjcopy.exe.  This was causing the compile to stop. I just made a duplicate in the sdcc bin directory and renamed the duplicate objcopy.exe and it then compiled fine and the resulting stars.rom & stars.sms work fine.

 

Thanks again. I'll look through the samples and see what might be new. The sms support alone is very cool!

 

gerry@PC-0459 ~/libcv/demos/stars
$ make
sdcc -mz80 -c "-I../../include/" --std-c99 main.c
sdcc -mz80 --no-std-crt0 --code-loc 0x8100 --data-loc 0x7000 ../../bin/libcvu.lib ../../bin/libcv.lib ../../bin/crt0.rel main.rel -o Stars.ihx ; objcopy --input-target=ihex --output-target=binary Stars.ihx Stars.rom
/bin/sh: objcopy: command not found
make: *** [Makefile:13: Stars.rom] Error 127
 

Link to comment
Share on other sites

I've always been using objcopy from GNU bintuils, not the variant that comes with SDCC. I guess the latter has support for some additional feature relevant to some uses of SDCC (maybe handling debug info for MCS-51?), but for the simple task of converting a .ihx to a .bin either should do.

 

  • Like 1
Link to comment
Share on other sites

On 9/29/2021 at 2:04 PM, digress said:

Ok, I was using a custom linker for sdcc provided by tursi. I forgot I replaced the original.

http://www.harmlesslion.com/cgi-bin/onesoft.cgi?3

I'll backup that version as I used it for several programs and try this new setup.

Yeah, I need to update that for the newer SDCC before I get back to my own stuff.

 

  • Like 1
Link to comment
Share on other sites

its worked great and I still use it. Really solved that megacart problem for some of us.

 

I'm just having multiple setups depending on which devkit i'm using. 

 

8 minutes ago, Tursi said:

Yeah, I need to update that for the newer SDCC before I get back to my own stuff.

 

 

 

 

  • Like 1
Link to comment
Share on other sites

There are some additional cygwyn addons that need to be installed. I found your page describing the installation which included the pkg-config that i was missing and others. 

 

for anyone else you need to also install these when setting up the cygwyn environment.

 

http://www.colecovision.eu/ColecoVision/development/tutorial0.shtml

 

still having an issue with magickwand even though I have installed it as well:

 

MagickWand

 

gerry@PC-0459 ~/libcv/png2cv
$ ./configure && make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for MagickWand... no
configure: error: Package requirements (MagickWand) were not met:

Package 'MagickWand', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables MagickWand_CFLAGS
and MagickWand_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
 

Link to comment
Share on other sites

8 hours ago, digress said:

There are some additional cygwyn addons that need to be installed. I found your page describing the installation which included the pkg-config that i was missing and others. 

 

for anyone else you need to also install these when setting up the cygwyn environment.

 

http://www.colecovision.eu/ColecoVision/development/tutorial0.shtml

 

still having an issue with magickwand even though I have installed it as well:

 

MagickWand

 

gerry@PC-0459 ~/libcv/png2cv
$ ./configure && make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for MagickWand... no
configure: error: Package requirements (MagickWand) were not met:

Package 'MagickWand', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables MagickWand_CFLAGS
and MagickWand_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
 

I'll try to look into it when I find time.

When I wrote the tutorial, MagickWand was not required (png2cv up to 0.17 used libpng instead), and I forgot to  update it for the png2cv 0.18.

 

You could try to use older png2cv 0.17, which doesn't require MagickWand. It should work just as well as current png2cv 0.18 for ColecoVision, Sega SG-1000 and SC-3000 development (but lacks some features for improved Sega Mark III and Master system support).

 

Link to comment
Share on other sites

I had every magickwand selection i could find installed. I just put this one in too. now its getting further but still complaining about a missing MagickWand.h

 

I reverted to the png2cv .17 and that has worked as you said. So I was ale to compile the cursor32 demo now.

 

getting closer though.

 

gerry@PC-0459 ~/libcv/png2cv
$ ./configure && make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for MagickWand... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of g++... gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
g++ -DPACKAGE_NAME=\"png2cv\" -DPACKAGE_TARNAME=\"png2cv\" -DPACKAGE_VERSION=\"0.18\" -DPACKAGE_STRING=\"png2cv\ 0.18\" -DPACKAGE_BUGREPORT=\"philipp@colecovision.eu\" -DPACKAGE_URL=\"\" -DPACKAGE=\"png2cv\" -DVERSION=\"0.18\" -I.  -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16    -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
main.cpp:29:10: fatal error: wand/MagickWand.h: No such file or directory
   29 | #include <wand/MagickWand.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:377: main.o] Error 1
 

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

Banking support for Z80 has improved recently in SDCC, so a current SDCC (the compiler) should do okay for the megacart. I don't know about the linker situation, though.

 

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...