English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. C/C++ (http://eab.abime.net/forumdisplay.php?f=118)
-   -   I am close to porting AppleWin for Amiga. (http://eab.abime.net/showthread.php?t=87844)

xboxown 09 July 2017 00:36

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 :banghead 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?

RedskullDC 09 July 2017 01:49

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

xboxown 09 July 2017 01:58

Quote:

Originally Posted by RedskullDC (Post 1170164)
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!!

emufan 09 July 2017 02:13

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 :)

r.cade 09 July 2017 04:33

Is it better than Apple2000?

xboxown 09 July 2017 04:37

Quote:

Originally Posted by emufan (Post 1170170)
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 09 July 2017 04:45

Quote:

Originally Posted by r.cade (Post 1170182)
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.

alkis 09 July 2017 04:57

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.

a/b 09 July 2017 05:32

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;


xboxown 09 July 2017 06:22

Quote:

Originally Posted by a/b (Post 1170189)
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.:crazy

xboxown 09 July 2017 08:53

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?

alkis 09 July 2017 10:37

add
#include <exec/types.h>
on the file that gives you those errors

emufan 09 July 2017 16:28

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 :(

xboxown 09 July 2017 17:52

Quote:

Originally Posted by alkis (Post 1170211)
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

James 10 July 2017 12:48

Quote:

Originally Posted by xboxown (Post 1170183)
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?

xboxown 10 July 2017 17:17

Quote:

Originally Posted by James (Post 1170382)
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!

emufan 10 July 2017 18:38

Quote:

Originally Posted by xboxown (Post 1170433)
Here is the real port then:

thanks. it does work on a1200 68k emulation. :)

xboxown 10 July 2017 22:06

Quote:

Originally Posted by emufan (Post 1170438)
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 .....

emufan 10 July 2017 23:43

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 :)

xboxown 10 July 2017 23:49

Quote:

Originally Posted by emufan (Post 1170504)
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.


All times are GMT +2. The time now is 15:18.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.

Page generated in 0.05158 seconds with 11 queries