English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 29 August 2017, 17:09   #41
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i try to fix the P96Base this way - example taken from aminet, which uses Picasso96Api.h
Code:
...
struct Library	*P96Base;

static int openlibs (void) {
P96Base = OpenLibrary("Picasso96API.library", 0);
	if (!P96Base) return FALSE;
};

static int openlibs (void);

int main(int argc, char *argv[])
{
  int retval;
  t_sr test;

	if (!openlibs()) {
		printf("cannot open Picasso96API.library");
		return ("lib error");
	}
...
it does build the binary, does load graphics, dos .. library but not Picasso96API.library (snoopdos)
gives a HALT3 in winuae which does freeze :/

#1) hmm, -lauto should do the trick,
*hmmm*
Code:
m68k-amigaos-gcc.exe -o AmiGeneratorT.exe *.o  -m68040 -noixemul -lm -lauto -Wall \
-fomit-frame-pointer -I. -Ihdr -Icpu68k -Icmz80 -Iym2612 -Isn76496 -D__USE_INLINE__
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/../../../../m68k-amigaos/bin/ld:
cannot find -lauto
without -lauto it cannot find P96Base :/
#2) damn, there is no libauto with gcc6,
AmiDevCpp does include libauto: /AmiDevCpp/usr/local/amiga/m68k-amigaos/lib/libauto.a
but it has problems with the source code

Last edited by emufan; 29 August 2017 at 18:20.
emufan is offline  
Old 30 August 2017, 20:48   #42
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by nobody View Post
Not so interesting system but maybe this could be ported too, I don't know if it exists already.

http://dcmo5.free.fr/v11/dcmo5v11en.html
zoned: dcmo5-68k-WIP.lha
zoned: dcto9p-68k-WIP.lha - Thomson TO9+ emulator

Last edited by emufan; 30 August 2017 at 22:27.
emufan is offline  
Old 30 August 2017, 21:55   #43
nobody
Registered User
 
nobody's Avatar
 
Join Date: Dec 2013
Location: GR
Age: 47
Posts: 1,416
I tried them and sometimes they open a window and stuck or switch to full screen and crash with guru meditation (Amiga OS 3.9).
nobody is offline  
Old 30 August 2017, 22:03   #44
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by nobody View Post
I tried them and sometimes they open a window and stuck or switch to full screen and crash with guru meditation (Amiga OS 3.9).
hmm, did work here on wb/kick 3.1 030/882 winuae.

#1) one thing i dont understand, i build with -m68040 -noixemul -O2,
and i have to link in math lib (_ceil) , so i allways use -lm
is this correct, or do we need -lm881 ( which is not found ) or something?


#2) I rebuild dcto9p and dcmo5 with AmiDevCpp - just redownload from the zone
030 and 040 builds

Last edited by emufan; 30 August 2017 at 22:17.
emufan is offline  
Old 30 August 2017, 22:23   #45
nobody
Registered User
 
nobody's Avatar
 
Join Date: Dec 2013
Location: GR
Age: 47
Posts: 1,416
After i installed AHI it worked this way (030 with and without FPU)

nobody is offline  
Old 30 August 2017, 22:28   #46
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
ah, good news - thnx testing
emufan is offline  
Old 30 August 2017, 23:35   #47
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by emufan View Post
#1) one thing i dont understand, i build with -m68040 -noixemul -O2,
and i have to link in math lib (_ceil) , so i allways use -lm
is this correct, or do we need -lm881 ( which is not found ) or something?
-lm is for GCC using direct FPU instructions

-lm881, -lm040, -lm060 is for vbcc direct FPU instructions
-lmieee is for vbcc using C= math libraries
matthey is offline  
Old 30 August 2017, 23:43   #48
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by matthey View Post
-lm is for GCC using direct FPU instructions

-lm881, -lm040, -lm060 is for vbcc direct FPU instructions
-lmieee is for vbcc using C= math libraries
thanks for that info
emufan is offline  
Old 31 August 2017, 02:00   #49
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Vectrex 68k SDL RTG emulator - vecx
with sound and overlay support.
from shell/cli: vecx rom_name overlay_name

without an option it uses rom.dat, rom and overlay name are optional.

overlay image jpg or png, but somehow they are not transparent,
maybe dependend on screen depth ?!
resize window if overlay is not visible.

zoned: vecx-68k-WIP.lha

i think finaly an emulator which does run full speed.

Last edited by emufan; 31 August 2017 at 02:41.
emufan is offline  
Old 31 August 2017, 05:43   #50
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
You are right. But what is the controller for this emulator (for the vecx-68k-wip) I mean? the other emulators simply do not work.

Hey emufan while we are discussing about emulators how difficult is it to port this? https://sourceforge.net/p/bluemsx/co...k/blueMSX/Src/
xboxown is offline  
Old 31 August 2017, 09:24   #51
nobody
Registered User
 
nobody's Avatar
 
Join Date: Dec 2013
Location: GR
Age: 47
Posts: 1,416
The only way i see for Megadrive emulation to run full speed is to write from the ground and use Amiga CPU (68030+) and AGA. But people with Vampire card could probably run these ports fine.
nobody is offline  
Old 31 August 2017, 20:45   #52
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
You are right. But what is the controller for this emulator (for the vecx-68k-wip) I mean? the other emulators simply do not work.
oh, sorry: default keys: a s d f + cursor keys || ESC will quit emulator
Quote:
Hey emufan while we are discussing about emulators how difficult is it to port this? https://sourceforge.net/p/bluemsx/co...k/blueMSX/Src/
thats one nice emulator on windows machines. i'll have a look.
#1) i guess impossible, it does use OpenGL stuff.
Code:
In file included from ../../../Src/Sdl/bluemsxlite.c:59:0:
/cygdrive/d/SDL/include/SDL/SDL_opengl.h:46:60: fatal error:
GL/gl.h: No such file or directory
Quote:
Originally Posted by nobody View Post
The only way i see for Megadrive emulation to run full speed is to write from the ground and use Amiga CPU (68030+) and AGA. But people with Vampire card could probably run these ports fine.
thats beyond my abilities. it's much easier to convince some compiler to build 68k binaries from exisiting sources

Last edited by emufan; 31 August 2017 at 21:43.
emufan is offline  
Old 28 November 2017, 01:50   #53
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,932
Emufan could you go over again the libretro/retroarch stuff again? I read a little bit about it today and it's interesting they say they try to keep stuff C89 compatible.

Last edited by grelbfarlk; 28 November 2017 at 02:15.
grelbfarlk is offline  
Old 28 November 2017, 02:18   #54
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Also what did you do to get a configure file out of dgen?
configure was included in the source archive.
I run it on my win7 box, using the toolchain of AmiDevCPP ( gcc 3.4.0 )
open a dosbox (cmd) cd to 'AmiDevCPP/bin' starting bash.exe
and adding locations of the gcc to $PATH.

export PATH=/cygdrive/d/AmiDevCpp/usr/local/amiga/bin:/cygdrive/d/AmiDevCpp/bin:$PATH

next i run

./configure --host=m68k-amigaos --disable-hqx --disable-scale2x

in the dgen src directory.

Quote:
Originally Posted by grelbfarlk View Post
Emufan could you go over again the libretro/retroarch stuff again? I read a little bit about it today and it's interesting they say they try to keep stuff C89 compatible.
hmm, I'll have a look

#1)
bad start:
Code:
$ CC=m68k-amigaos-gcc.exe CFLAGS="-ISDL/include" LDFLAGS="-LSDL/lib" \
./configure --host=m68k-amigaos --disable-dynamic
Checking operating system ... Cygwin
Checking for suitable working C compiler ... m68k-amigaos-gcc.exe does not work
Error: Cannot proceed without a working C compiler.
*hmm*

#2) there are some config files in retroarch/qb, checking for different systems,
there is no "m68k-amigaos" , so we have to poke that into them

#3) with a bit of cheating in retroarch/qb/qb.comp.sh - it does a test compile, and sets a value,
cc_works=1 and cxx_works=1 - so the script continued:
Code:
 ./configure --host=m68k-amigaos
Checking operating system ... Cygwin
Checking for suitable working C compiler ... m68k-amigaos-gcc.exe works
Checking for suitable working C++ compiler ... m68k-amigaos-g++.exe works
Checking for pkg-config ... none
Warning: pkg-config not found, package checks will fail.
Checking for availability of switch -std=gnu99 in m68k-amigaos-gcc.exe ... yes
Checking for availability of switch -Wno-unused-result in m68k-amigaos-gcc.exe ... yes
Checking for availability of switch -Wno-unused-variable in m68k-amigaos-gcc.exe ... yes
Error: Cygwin is not a supported platform.
See https://bot.libretro.com/docs/compilation/windows/
#4) some editing in retroarch/qb/config.libs.sh - disable Cygwin check, the configure finishes.
starting make, 2nd source file already gives errors:
Code:
In file included from frontend/frontend.c:25:0:
./libretro-common/include/retro_timers.h: In function ‘retro_sleep’:
./libretro-common/include/retro_timers.h:103:11: error:
            variable ‘tv’ has initializer but incomplete type
    struct timespec tv = {0};
           ^~~~~~~~
this was all done with gcc6, maybe an older gcc will work better. will try later

Last edited by emufan; 28 November 2017 at 03:16.
emufan is offline  
Old 28 November 2017, 02:37   #55
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,932
Yeah sorry I didn't see configure in the git but it was in the tar.gz. Ran that, seems to like my opengl version at least.

Quote:
Originally Posted by emufan View Post
hmm, I'll have a look

configure was included in the source archive.
I run it on my win7 box, using the toolchain of AmiDevCPP ( gcc 3.4.0 )
open a dosbox (cmd) cd to 'AmiDevCPP/bin' starting bash.exe
and adding locations of the gcc to $PATH.

export PATH=/cygdrive/d/AmiDevCpp/usr/local/amiga/bin:/cygdrive/d/AmiDevCpp/bin:$PATH

next i run

./configure --host=m68k-amigaos --disable-hqx --disable-scale2x

in the dgen src directory.
grelbfarlk is offline  
Old 28 November 2017, 02:39   #56
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,932
Quote:
Originally Posted by emufan View Post
configure was included in the source archive.
I run it on my win7 box, using the toolchain of AmiDevCPP ( gcc 3.4.0 )
open a dosbox (cmd) cd to 'AmiDevCPP/bin' starting bash.exe
and adding locations of the gcc to $PATH.

export PATH=/cygdrive/d/AmiDevCpp/usr/local/amiga/bin:/cygdrive/d/AmiDevCpp/bin:$PATH

next i run

./configure --host=m68k-amigaos --disable-hqx --disable-scale2x

in the dgen src directory.


hmm, I'll have a look

#1)
bad start:
Code:
$ CC=m68k-amigaos-gcc.exe CFLAGS="-ISDL/include" LDFLAGS="-LSDL/lib" \
./configure --host=m68k-amigaos
Checking operating system ... Cygwin
Checking for suitable working C compiler ... m68k-amigaos-gcc.exe does not work
Error: Cannot proceed without a working C compiler.
*hmm*
But I mean, I ... I am at a loss. The project is not clear to me, you grab the libretro package, and what that includes the gui, some emulator cores and that all together? I barely slept last night so my low comprehension is lower than it usually is.
grelbfarlk is offline  
Old 28 November 2017, 03:26   #57
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by grelbfarlk View Post
Yeah sorry I didn't see configure in the git but it was in the tar.gz. Ran that, seems to like my opengl version at least.
ok, allright
Quote:
Originally Posted by grelbfarlk View Post
But I mean, I ... I am at a loss. The project is not clear to me, you grab the libretro package, and what that includes the gui, some emulator cores and that all together? I barely slept last night so my low comprehension is lower than it usually is.
hehe, I have no clue, maybe we should run that thing on windows, to see what we can get

Quote:
Originally Posted by emufan View Post
this was all done with gcc6, maybe an older gcc will work better. will try later
I run 'make -k' so it does continue after "errors" - and it does build alot more.
it does have problems with timespec and a non available timer function.
emufan is offline  
Old 29 November 2017, 00:05   #58
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,932
I looked at this a bit more today. The individual engines or "cores" as they call them are more or less separate packages. The main libretro package is the backend and gui. So once that part is built then adding whichever cores you'd like to add would be next.
grelbfarlk is offline  
Old 29 November 2017, 03:34   #59
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,932
Trying dgen again and I get this on pbm2df.c (first one):
../sdl/pbm2df.c: In function `main':
../sdl/pbm2df.c:53: parse error before `unsigned'
../sdl/pbm2df.c:55: `pbm_contents' undeclared (first use in this function)
../sdl/pbm2df.c:55: (Each undeclared identifier is reported only once
../sdl/pbm2df.c:55: for each function it appears in.)
grelbfarlk is offline  
Old 29 November 2017, 10:42   #60
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by grelbfarlk View Post
Trying dgen again and I get this on pbm2df.c (first one):
this is just a stand-alone, support tool.
here on my cygwin/win7 box I build win binary manualy and removed the build instruction from the sdl/Makefile:
it's been a while, but i guess this is the section, i comment out those lines
Code:
.pbm.cpp:
	./$(PBM2DF) $< $@

$(PBM2DF):				\
#	$(DIR)/pbm22df.c			\
	$(DIR)/dgenfont_16x26.pbm	\
	$(DIR)/dgenfont_8x13.pbm	\
	$(DIR)/dgenfont_7x5.pbm
#	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $(DIR)/pbm22df.c

# $(BUILT_SOURCES): $(PBM2DF)
it will convert those pbm files to cpp: dgenfont_16x26.pbm -> dgenfont_16x26.cpp

so you may just build it on ur host machine, take the 3 pbm files and make those .cpp:
pbm22df dgenfont_16x26.pbm dgenfont_16x26.cpp
next copy the cpp files in sdl folder and edit sdl/Makefile the way I did it

#1) attached the amigaos 68k binary - needs ixemul.library
if you have your toolchain on your amiga os3 machine, you may just copy pbm2df to sdl/ folder
and make the changes to sdl/Makefile

#2) sound is not working, does freeze dgen if enabled: --> dgenrc:
bool_sound = no
and I get some feedback from the emulator, maybe some AHI problem, dunno yet.

#3) dgen/system.h:
Code:
#ifndef __MINGW32__
//#define DGEN_BASEDIR ".dgen"
#define DGEN_BASEDIR "s:dgen"
#define DGEN_RC "dgenrc"
#define DGEN_AUTORC "dgenrc.auto"
#define DGEN_DIRSEP "/"
#else
#define DGEN_BASEDIR "DGen"
#define DGEN_RC "dgen.cfg"
#define DGEN_AUTORC "dgen_auto.cfg"
#define DGEN_DIRSEP "\\/"
#endif
it does read now from s:dgen/dgenrc ( default was T:.dgen/dgenrc )

#4) success with Lion King MD/Genesis rom (.md) - does work, nice

#5) it did work before, now I remember, have to use F5 - CrapTV "swab" mode, to get correct colors
not yet on aminet due to the non working sounds issue. no idea what's wrong with this :/
Attached Files
File Type: lha pbm2df-68k.lha (2.6 KB, 148 views)

Last edited by emufan; 29 November 2017 at 15:13.
emufan is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
porting an app written in C powrslave Coders. C/C++ 1 13 March 2017 04:44
Porting an Amiga game to PC CYBER_SLUNK Coders. General 4 31 January 2017 19:14
Porting Photoshop to Amiga KONEY Coders. General 25 29 December 2016 23:49
porting vlc ? turrican3 request.Apps 4 25 June 2011 21:27
Help porting Mindscape's Legend Queller request.Other 6 30 October 2010 12:07

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:17.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09899 seconds with 14 queries