English Amiga Board


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

 
 
Thread Tools
Old 09 July 2017, 00:36   #1
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
I am close to porting AppleWin for Amiga.

Guys this is an open SDL AppleWin not the original AppleWin that relies heavily on directX...but there is a file called curl.h preventing me from compiling it. I compiled every single other file for AppleWin and it compiles with zero error for the Amiga 68k binary except files that rely on curl.h for inheritance where curl.h itself causes an error.

I have shrunk the errors from 1000 to literally 3 errors now...just 3. But I am stuck in how to fix this. If anyone can help me please I would officially have AppleAmi now ported from AppleWin to run on rtg and vampire Amiga.

Here is the code for curl.h:

https://codetidy.com/10468/

These are the errors:

curl.h expected `}' before "NOTHING"
expected init-declarator before "COPYNAME"
expected "," or ";" before "COPYNAME"
expected constructor, destructor, or type conversion before ';' token
'CURLformoption' does not name a type
expected declaration before '}' token

That is it!! If the above is fixed...if the above is fixed then entire program compiles and we a have a power apple 2 emulator. Anyone can help me please?
xboxown is offline  
Old 09 July 2017, 01:49   #2
RedskullDC
Digital Corruption
 
RedskullDC's Avatar
 
Join Date: Jan 2007
Location: Dorrigo/Australia
Age: 60
Posts: 355
Hi,

Good work on getting it down to so few errors.

The first error on your list:
curl.h expected `}' before "NOTHING"
looks like it is causing all the rest.

What compiler are you using?

Looks like the CFINIT macro around line 1945 may not be being expanded properly:

#ifdef CURL_ISOCPP
#define CFINIT(name) CURLFORM_ ## name
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define CFINIT(name) CURLFORM_/**/name
#endif

CFINIT(NOTHING) should expand to CURLFORM_NOTHING

---

Curl itself is in a constant state of flux:
https://github.com/curl

Cheers,
Red
RedskullDC is offline  
Old 09 July 2017, 01:58   #3
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by RedskullDC View Post
Hi,

Good work on getting it down to so few errors.

The first error on your list:
curl.h expected `}' before "NOTHING"
looks like it is causing all the rest.

What compiler are you using?

Looks like the CFINIT macro around line 1945 may not be being expanded properly:

#ifdef CURL_ISOCPP
#define CFINIT(name) CURLFORM_ ## name
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define CFINIT(name) CURLFORM_/**/name
#endif

CFINIT(NOTHING) should expand to CURLFORM_NOTHING

---

Curl itself is in a constant state of flux:
https://github.com/curl

Cheers,
Red
I am using AmiDev++ the compiler is called wxDev C++. What do you mean Curl itself is in a constant state of flux? If you want I can post the source code and the project .dev here if you wish to look into it. Honestly it is an open source and I intend to release the source code, project and binary into aminet.net. If posting it here would help with programmers than me to look into it, it would be great!!
xboxown is offline  
Old 09 July 2017, 02:13   #4
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
there is an old curl release on aminet, including dev files ( curl.h ...)
maybe you can use these files - bit older, less trouble?

i think RedskullDC talks about the constant development of curl, so things may
have changed since last AppleWin version - hence the trouble you see now with latest (?) curl you are using.

#1) i did a search for curl on the AppleWIN github repository, and it cannot be found.
is this the source code you are using?

so the curl dependency is maybe provoked by the AmigaDev++ environment or the ixemul.library??
i'm not really sure, but if so, you may disable curl somehow?

#2) i have no clue about wxDev C++ , but for the crosscompiler there is a -noixemul option, for example:
m68k-amigaos-gcc.exe -m68020 -m68881 -Wall -O3 -noixemul

maybe this will keep you busy until someone post a real solution - ignore if it's of no use at all

Last edited by emufan; 09 July 2017 at 03:57.
emufan is offline  
Old 09 July 2017, 04:33   #5
r.cade
Registered User
 
r.cade's Avatar
 
Join Date: Aug 2006
Location: Augusta, Georgia, USA
Posts: 548
Is it better than Apple2000?
r.cade is offline  
Old 09 July 2017, 04:37   #6
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by emufan View Post
there is an old curl release on aminet, including dev files ( curl.h ...)
maybe you can use these files - bit older, less trouble?

i think RedskullDC talks about the constant development of curl, so things may
have changed since last AppleWin version - hence the trouble you see now with latest (?) curl you are using.

#1) i did a search for curl on the AppleWIN github repository, and it cannot be found.
is this the source code you are using?

so the curl dependency is maybe provoked by the AmigaDev++ environment or the ixemul.library??
i'm not really sure, but if so, you may disable curl somehow?

#2) i have no clue about wxDev C++ , but for the crosscompiler there is a -noixemul option, for example:
m68k-amigaos-gcc.exe -m68020 -m68881 -Wall -O3 -noixemul

maybe this will keep you busy until someone post a real solution - ignore if it's of no use at all
I used the curl you suggested which is great and I have added other headers for Amiga but more errors of different type creeped out. I am releasing the source code in dropbox in hopes someone can take over where I stopped.

I am not expert in this and expert eyes are needed for this.

I realized while I convinced arczi to port kegs and it is released in aminet and there are 50 downloads, I know he is busy to port this so I toke over. But I hit a wall end and it is beyond my knowledge and skill. So I realize if applewin the best apple ii emulator on earth get ported into Amiga the demand will be great.

Here is the link to download https://www.dropbox.com/s/nenuk82wrs...inSrc.rar?dl=0
xboxown is offline  
Old 09 July 2017, 04:45   #7
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by r.cade View Post
Is it better than Apple2000?
Dude!! AppleWin is the top of the line elite..best apple 2 emulator ever existed on planet Earth. Apple2000 doesn't even come in comparison to what this is!

If you have this ported.....you don't need any other emulator for apple ii ever again! It soooooooo perfectly accurate and compatible you literally don't need the real thing for anything.
xboxown is offline  
Old 09 July 2017, 04:57   #8
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
What does an Apple 2 emulator need the curl library for? It's for emulator to check self-updates, isn't it?

You can probably eliminate it.
alkis is offline  
Old 09 July 2017, 05:32   #9
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Try this (if the compiler doesn't support concat when macro parameters are expanded at the same time):
Code:
#ifdef CURL_ISOCPP
#define CFINIT2(x,y) x ## y
#define CFINIT(name) CFINIT2(CURLFORM_,name)
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define CFINIT2(x,y) x/**/y
#define CFINIT(name) CFINIT2(CURLFORM_,name)
#endif
or remove macros altogether:
Code:
typedef enum {
  CURLFORM_NOTHING,
  CURLFORM_COPYNAME,
...
  CURLFORM_CONTENTLEN,
  CURLFORM_LASTENTRY
} CURLformoption;
a/b is offline  
Old 09 July 2017, 06:22   #10
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by a/b View Post
Try this (if the compiler doesn't support concat when macro parameters are expanded at the same time):
Code:
#ifdef CURL_ISOCPP
#define CFINIT2(x,y) x ## y
#define CFINIT(name) CFINIT2(CURLFORM_,name)
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define CFINIT2(x,y) x/**/y
#define CFINIT(name) CFINIT2(CURLFORM_,name)
#endif
or remove macros altogether:
Code:
typedef enum {
  CURLFORM_NOTHING,
  CURLFORM_COPYNAME,
...
  CURLFORM_CONTENTLEN,
  CURLFORM_LASTENTRY
} CURLformoption;
I used the Amiga Curl which solved all these problems. But my problem now is beyond curl, it is other issues which is beyond my scope . As soon as I resolved, ten more problems comes in, and ten more and ten more and ten more.
xboxown is offline  
Old 09 July 2017, 08:53   #11
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Example of where I am stuck:

Code:
typedef ULONG *PULONG;
typedef unsigned short USHORT;
typedef USHORT *PUSHORT;
typedef unsigned char UCHAR;
typedef UCHAR *PUCHAR;
typedef char *PSZ;
#endif  /* !BASETYPES */
expected init-declarator before '*' token
expected ',' or ';' before '*' token
expected init-declarator before '*' token
expected ',' or ';' before '*' token
expected init-declarator before '*' token
expected ',' or ';' before '*' token
expected init-declarator before '*' token

What do I do here?

Then I get this error

Code:
BYTE GetPB();
	BYTE GetPA();
	void SetPB(BYTE byData);
	void SetPA(BYTE byData);
	void SetCA1( BYTE byData );
	void SetCA2( BYTE byData );
	void SetCB1( BYTE byData );
	void SetCB2( BYTE byData );
6821.h variable or field `SetCA1' declared void
6821.h expected `;' before '(' token
6821.h variable or field `SetPB' declared void
6821.h expected `;' before '(' token
6821.h variable or field `SetCA2' declared void
6821.h expected `;' before '(' token

and so on. What do I do here?

Then I have this issue

Code:
BYTE	m_byDDRB;
'BYTE' does not name a type.

What do I do there?

Then I have something like this:

Code:
void C6821::Write(BYTE byRS, BYTE byData)
'Init C6821::Write' is not a static member of 'class C6821'

What do I do here too?

Last edited by xboxown; 09 July 2017 at 08:58.
xboxown is offline  
Old 09 July 2017, 10:37   #12
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
add
#include <exec/types.h>
on the file that gives you those errors
alkis is offline  
Old 09 July 2017, 16:28   #13
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
the source code on dropbox has some option to connect to a ftp,
this explains curl.

i tried to disble some things in Common.h , but this was not successfull.

I'm using crosscompiler on cygwin: m68k-amigaos-g++.exe
so I change CXX to m68k-amigaos-g++.exe in the Makefile

changed CXXFLAG:
CXXFLAGS = -mcrt=clib2 -fomit-frame-pointer -lgcc

but this give just more errors I cannot fix
emufan is offline  
Old 09 July 2017, 17:52   #14
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by alkis View Post
add
#include <exec/types.h>
on the file that gives you those errors

Then I get this error

Code:
typedef CHAR *PCHAR;
typedef CHAR *LPCH, *PCH;

typedef CONST CHAR *LPCCH, *PCCH;
typedef CHAR *NPSTR;
typedef CHAR *LPSTR, *PSTR;
typedef CONST CHAR *LPCSTR, *PCSTR;

typedef LPWSTR LPTCH, PTCH;
typedef LPWSTR PTSTR, LPTSTR;
typedef LPCWSTR LPCTSTR;
typedef LPWSTR LP;
expected init-declarator before '*' token
expected ',' or ';' before '*' token
expected init-declarator before '*' token
expected ',' or ';' before '*' token
expected init-declarator before '*' token
expected ',' or ';' before '*' token
expected init-declarator before '*' token

in file wincompat.h
xboxown is offline  
Old 10 July 2017, 12:48   #15
James
Registered User
 
Join Date: Mar 2010
Location: Beckenham/England
Posts: 795
Quote:
Originally Posted by xboxown View Post
I convinced arczi to port kegs and it is released in aminet
No it isn't, that archive is simply kegs0.64.lha for OS4 renamed to kegs-m68k.lha. I have emailed him about this, but received no reply, and that fake archive is still on Aminet. Could you please inform him of this, and get him to upload the real m68k port?
James is offline  
Old 10 July 2017, 17:17   #16
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by James View Post
No it isn't, that archive is simply kegs0.64.lha for OS4 renamed to kegs-m68k.lha. I have emailed him about this, but received no reply, and that fake archive is still on Aminet. Could you please inform him of this, and get him to upload the real m68k port?

What?! Are you serious?? Here is the real port then: https://www.dropbox.com/s/rxdif7ken45ht38/kegs-sdl?dl=0

I am surprised this have happened!
xboxown is offline  
Old 10 July 2017, 18:38   #17
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
Here is the real port then:
thanks. it does work on a1200 68k emulation.
emufan is offline  
Old 10 July 2017, 22:06   #18
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by emufan View Post
thanks. it does work on a1200 68k emulation.
Have you managed to get a single apple ii game to work on it? Because to me it fails in all of them. Is it possible you can post this into aminet again, the one you just received for other people to use it?

I bet lots of people who faced this issue doesn't know of this conversation or know to come here or .....
xboxown is offline  
Old 10 July 2017, 23:43   #19
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
using a 128kb rom from mame emulator - i tested some game from the MacGui website.
those *.2mg images. you have to add them in the kegs_conf file, one example was: s7d1 = CRATE.2MG
so i renamed the downloaded 2mg file to CRATE.2mg and put it into the kegs folder.
the game does boot, but joystick control is somehow weird or does not work.

btw. compiling kegs itself seems not too difficult. I ended up with many unknown symbols while linking,
but compiling the source seems ok, without any big errors.
I think my CCOPTS and LDFLAGS are not correct, but someone skilled can fix this in a minute

using crosscompiler on cygwin 32bit system.
my src/vars file - file will be read by Makefile and must fit your system you want kegs compile for.
Code:
OBJECTS = $(OBJECTS1) engine_c.o
CC = m68k-amigaos-gcc.exe
CCOPTS = -m68020 -m68881 -Wall -O3 -noixemul
OPTS =
SUFFIX =
NAME = kegs
LDFLAGS = -L/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.3
# LDOPTS = -z
LD = $(CC)
# EXTRA_LIBS = -lsdl
EXTRA_SPECIALS =

AS = m68k-amigaos-as.exe
PERL = perl
in the Makefile i removed video_driver_x11.o and video_driver_win32.o from the OBJECTS1 line.

link errors (first lines only):
Code:
$ make
m68k-amigaos-gcc.exe  adb.o clock.o dis.o joystick_driver.o paddles.o scc.o scc_driver.o
iwm.o moremem.o sim65816.o smartport.o sound.o video.o video_driver.o
video_driver_sdl.o config_sdl.o configmenu.o sound_driver.o functions.o font.o ki.o rom.o
engine_c.o compile_time.o  -L/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.3
-L/opt/m68k-amigaos/m68k-amigaos/libnix/lib -lamiga -o kegs
adb.o(.text+0xdca): undefined reference to `printf'
adb.o(.text+0x20e4): undefined reference to `printf'
adb.o(.text+0x22d8): undefined reference to `printf'
adb.o(.text+0x23f2): undefined reference to `printf'
adb.o(.text+0x31ac): undefined reference to `printf'
adb.o(.text+0x846): more undefined references to `printf' follow
clock.o(.text+0x14e): undefined reference to `errno'
clock.o(.text+0x22c): undefined reference to `errno'
clock.o(.text+0x266): undefined reference to `errno'
...
would be better to compile the 68k again, so the support tools (dc2raw partls) will be 68k executables aswell.
afterwards we can put it on Aminet

Last edited by emufan; 11 July 2017 at 00:04.
emufan is offline  
Old 10 July 2017, 23:49   #20
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by emufan View Post
using a 128kb rom from mame emulator - i tested some game from the MacGui website.
those *.2mg images. you have to add them in the kegs_conf file, one example was: s7d1 = CRATE.2MG
so i renamed the downloaded 2mg file to CRATE.2mg and put it into the kegs folder.
the game does boot, but joystick control is somehow weird or does not work.

btw. compiling kegs itself seems not too difficult. I ended up with many unknown symbols while linking,
but compiling the source seems ok, without any big errors.
I think my CCOPTS and LDFLAGS are not correct, but someone skilled can fix this in a minute

using crosscompiler on cygwin32bit system.
my src/vars file:
Code:
OBJECTS = $(OBJECTS1) engine_c.o
CC = m68k-amigaos-gcc.exe
CCOPTS = -m68020 -m68881 -Wall -O3 -noixemul
OPTS =
SUFFIX =
NAME = kegs
LDFLAGS = -L/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.3
# LDOPTS = -z
LD = $(CC)
# EXTRA_LIBS = -lsdl
EXTRA_SPECIALS =

AS = m68k-amigaos-as.exe
PERL = perl
in the Makefile i removed video_driver_x11.o and video_driver_win32.o from the OBJECTS1 line.

would be better to compile the 68k again, so the support tools (dc2raw partls) will be 68k executables aswell.
afterwards we can put it on Aminet
Dude! The issue is not iigs games. The issue not a single dsk or apple ii game mode works.
xboxown 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 SDL2 to Amiga copse request.Other 3 30 November 2017 17:46
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 PhotoChrome ST/e to Amiga. pandy71 request.Other 0 09 February 2015 15:12
Porting Qt Framework to Amiga OS enviroments Pyromania Coders. General 2 24 July 2013 06:42

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 18:28.

Top

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