English Amiga Board

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

emufan 11 July 2017 00:08

1 Attachment(s)
Quote:

Originally Posted by xboxown (Post 1170507)
Dude! The issue is not iigs games. The issue not a single dsk or apple ii game mode works.

did you tested one of the MacGUI games.
at least i hope it is a gs game.

xboxown 11 July 2017 01:55

Quote:

Originally Posted by emufan (Post 1170510)
did you tested one of the MacGUI games.
at least i hope it is a gs game.


Again..it can play 2img Apple IIgs games. What it cannot play is apple II games in .dsk, .do format that is 140 KB and it is 8-bit. That it cannot play.

emufan 11 July 2017 02:40

Quote:

Originally Posted by xboxown (Post 1170529)
Again..it can play 2img Apple IIgs games. What it cannot play is apple II games in .dsk, .do format that is 140 KB and it is 8-bit. That it cannot play.

oh,ok. i think i missed your point.
so we should skip KEGS and try to fix the AppleWin emulator. I hope someone can help.


#1) based on LinApple I did my own test, removed all the curl/ftp stuff from the source
and I can build a binary for cygwin.
with curl the emulator is able to download diskimages from some ftp servers.
so i removed all the curl stuff, since you can just insert a diskimage locally.

now using the amiga crosscompiler, i get the first errors I cannot fix:
Code:

$ make
m68k-amigaos-g++.exe -O3 -w -I/opt/m68k-amigaos/include/SDL -c -o Debug.o Debug.cpp
In file included from stdafx.h:54,
                from Debug.cpp:38:
Log.h:7: badly punctuated parameter list in `#define'
In file included from stdafx.h:63,
                from Debug.cpp:38:
SerialComms.h:3: pthread.h: No such file or directory
make: *** [<builtin>: Debug.o] Error 1

is there a replacment for pthread.h ?

Log.h - what is wrong here?
Code:

    1  #pragma once
    2
    3  #ifndef _VC71  // __VA_ARGS__ not supported on MSVC++ .NET 7.x
    4          #ifdef _DEBUG
    5                  #define LOG(format, ...) LogOutput(format, __VA_ARGS__)
    6          #else
    7                  #define LOG(...)
    8          #endif
    9  #endif
    10
    11  extern void LogOutput(LPCTSTR format, ...);

I can replace line 3 with #ifdef ... but maybe the debugger is usefull.
doing so, i'm stuck with pthread.h - is there something to replace pthread.h ?

#2) these pthread related functions seems to be used, in a simple way,
not really sure, but i guess some time(!?) critical situations, for example:
Code:

1 void CpuNmiReset()
2 {
3        _ASSERT(g_bCritSectionValid);
4        if (g_bCritSectionValid) pthread_mutex_lock(&g_CriticalSection);
5        g_bmNMI = 0;
6        g_bNmiFlank = FALSE;
7        if (g_bCritSectionValid) pthread_mutex_unlock(&g_CriticalSection);
8 }

so i'm about to remove these mutex lines, lets see what happens :)

while doing so i have another problem:
Code:

  194  typedef struct
  195  {
  196          union
  197          {
  198                  struct
  199                  {
  200                          BYTE l;
  201                          BYTE h;
  202                  };
  203                  USHORT w;
  204          };
  205  } IWORD;
  206

Structs.h:202: anonymous class type not used to declare any objects
what is wrong in line 202 ?

^^^this error did not occure when i build the binary for cygwin, this was gcc 5.4.0.
now the amiga crosscompiler is gcc 2.95.3 - this might be a bit too old now?

Marlon_ 11 July 2017 04:43

This is as far as I get:
Code:

Linking applewin
obj/m68k-amigaos/Release/SerialComms.o(.text+0x438):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `tcgetattr'
obj/m68k-amigaos/Release/SerialComms.o(.text+0x450):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `cfsetispeed'
obj/m68k-amigaos/Release/SerialComms.o(.text+0x468):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `cfsetospeed'
obj/m68k-amigaos/Release/SerialComms.o(.text+0x5d6):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `tcsetattr'
obj/m68k-amigaos/Release/Timer.o(.text+0x184):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
obj/m68k-amigaos/Release/Timer.o(.text+0x216):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
obj/m68k-amigaos/Release/Riff.o(.text+0x82):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Riff.o(.text+0x266):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Riff.o(.text+0x2e6):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Riff.o(.text+0x342):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/DiskImage.o(.text+0xa7e):obj/m68k-amigaos/Release/DiskImage.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/DiskImage.o(.text+0xd1e):obj/m68k-amigaos/Release/DiskImage.o: more undefined references to `SetFilePointer(void*, long, long, unsigned)' follow
obj/m68k-amigaos/Release/Frame.o(.text+0x68):obj/m68k-amigaos/Release/Frame.o: undefined reference to `DrawStatusArea(short)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xb48):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xc4e):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xcc4):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xd6a):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/libstdc++.a(ctype_configure_char.o)(.text+0x7a): In function `std::ctype<char>::ctype(int*, char const*, bool, unsigned long)':
/home/marlon/amigaos-cross-toolchain/.build-m68k/build/gcc-6/m68k-amigaos/libstdc++-v3/src/c++11/ctype_configure_char.cc:49: undefined reference to `vtable for std::ctype<char>'
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/libstdc++.a(ctype_configure_char.o)(.text+0x18a): In function `std::ctype<char>::ctype(char const*, bool, unsigned long)':
/home/marlon/amigaos-cross-toolchain/.build-m68k/build/gcc-6/m68k-amigaos/libstdc++-v3/src/c++11/ctype_configure_char.cc:60: undefined reference to `vtable for std::ctype<char>'
collect2: error: ld returned 1 exit status
Makefile:168: recipe for target '../bin/applewin.68k' failed
make[1]: *** [../bin/applewin.68k] Error 1
Makefile:16: recipe for target 'applewin' failed
make: *** [applewin] Error 2

EDIT:
I suggest using this repo as a starting point rather than some code from a dropbox:
https://github.com/dabonetn/linapple-pie

Which is referenced here:
http://linapple.sourceforge.net/down...017-03-12_2001

Where I suppose xboxown's source is based on (unsure if it's older or up to date)

Marlon_ 11 July 2017 04:48

Quote:

Originally Posted by emufan (Post 1170534)
now the amiga crosscompiler is gcc 2.95.3 - this might be a bit too old now?

Yes, there is an up to date cross compiler:
http://eab.abime.net/showthread.php?t=85474
https://github.com/bebbo/amigaos-cross-toolchain

Marlon_ 11 July 2017 05:00

To be honest, the code is rather messy and it seems that the LinApple programmer has made some shortcuts here and there just to get it working. So in order to do a proper port to Amiga there's more to it than just compiling.

xboxown 11 July 2017 05:05

Quote:

Originally Posted by Marlon_ (Post 1170543)
This is as far as I get:
Code:

Linking applewin
obj/m68k-amigaos/Release/SerialComms.o(.text+0x438):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `tcgetattr'
obj/m68k-amigaos/Release/SerialComms.o(.text+0x450):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `cfsetispeed'
obj/m68k-amigaos/Release/SerialComms.o(.text+0x468):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `cfsetospeed'
obj/m68k-amigaos/Release/SerialComms.o(.text+0x5d6):obj/m68k-amigaos/Release/SerialComms.o: undefined reference to `tcsetattr'
obj/m68k-amigaos/Release/Timer.o(.text+0x184):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
obj/m68k-amigaos/Release/Timer.o(.text+0x216):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
obj/m68k-amigaos/Release/Riff.o(.text+0x82):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Riff.o(.text+0x266):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Riff.o(.text+0x2e6):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Riff.o(.text+0x342):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/DiskImage.o(.text+0xa7e):obj/m68k-amigaos/Release/DiskImage.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/DiskImage.o(.text+0xd1e):obj/m68k-amigaos/Release/DiskImage.o: more undefined references to `SetFilePointer(void*, long, long, unsigned)' follow
obj/m68k-amigaos/Release/Frame.o(.text+0x68):obj/m68k-amigaos/Release/Frame.o: undefined reference to `DrawStatusArea(short)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xb48):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xc4e):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xcc4):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
obj/m68k-amigaos/Release/Harddisk.o(.text+0xd6a):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/libstdc++.a(ctype_configure_char.o)(.text+0x7a): In function `std::ctype<char>::ctype(int*, char const*, bool, unsigned long)':
/home/marlon/amigaos-cross-toolchain/.build-m68k/build/gcc-6/m68k-amigaos/libstdc++-v3/src/c++11/ctype_configure_char.cc:49: undefined reference to `vtable for std::ctype<char>'
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/libstdc++.a(ctype_configure_char.o)(.text+0x18a): In function `std::ctype<char>::ctype(char const*, bool, unsigned long)':
/home/marlon/amigaos-cross-toolchain/.build-m68k/build/gcc-6/m68k-amigaos/libstdc++-v3/src/c++11/ctype_configure_char.cc:60: undefined reference to `vtable for std::ctype<char>'
collect2: error: ld returned 1 exit status
Makefile:168: recipe for target '../bin/applewin.68k' failed
make[1]: *** [../bin/applewin.68k] Error 1
Makefile:16: recipe for target 'applewin' failed
make: *** [applewin] Error 2

EDIT:
I suggest using this repo as a starting point rather than some code from a dropbox:
https://github.com/dabonetn/linapple-pie

Which is referenced here:
http://linapple.sourceforge.net/down...017-03-12_2001

Where I suppose xboxown's source is based on (unsure if it's older or up to date)


Actually that is where I got it from :) :spin I think we should all work together as union as one to do this. So please guys assign me a task something where I can work on and I will report it as I work on it. In the end, we will literally have the best apple ii emulator ever invented by man kind in human history in Amiga 68k. With kegs on the side we will be set.

emufan 11 July 2017 05:07

i'm already using "Version from June, 2015: linapple_src-2b.tar.bz2"

once i tested the 6.x crosscompiler, but it was just ridiculus to download 2gb of useless data, each time you want to build it.
but it's maybe worth another try, hence your results :)

1st i will try the linapple-pie with my current setup.

Marlon_ 11 July 2017 05:08

It already compiles for me, it's missing linkers to libc stuff. I'll check with bebbo and see what he has to say about it.

Quote:

Originally Posted by emufan (Post 1170550)
i'm already using "Version from June, 2015: linapple_src-2b.tar.bz2"

once i tested the 6.x crosscompiler, but it was just ridiculus to download 2gb of useless data, each time you want to build it.
but it's maybe worth another try, hence your results :)

1st i will try the linapple-pie with my current setup.

2GB every time? Nonsense. It's 2GB the first time, then you just pull the changes. And it's not useless at all, since that's how big the whole GCC repository is. Plus it's rather mature now, there's mostly minor changes here and there. I update the toolchain within 16 minutes.

The "Version from June, 2015: linapple_src-2b.tar.bz2" is actually older than the repo, fyi.

emufan 11 July 2017 05:39

but it makes no diff, it starts with the same error above (Log.h). :/
so it might be a compiler issue, i think i still have a gcc 3.x somewhere, gonna test this 1st.

are there now some binary packs for the 6.x gcc crosscompiler?
centos got a build, anyone made one for cygwin 32bit, willing to share?

drHirudo 11 July 2017 09:57

I have ported AppleLin to AmigaOS 4 long time ago, but then I faced some really weird endian issues, so I left the port unfinished/unpublished. KEGS is working okay, so I just skipped AppleWin (AppleLin).

James 11 July 2017 11:53

Quote:

Originally Posted by xboxown (Post 1170433)
What?! Are you serious?? Here is the real port then: https://www.dropbox.com/s/rxdif7ken45ht38/kegs-sdl?dl=0

Thanks. :great

xboxown 11 July 2017 17:12

Quote:

Originally Posted by drHirudo (Post 1170564)
I have ported AppleLin to AmigaOS 4 long time ago, but then I faced some really weird endian issues, so I left the port unfinished/unpublished. KEGS is working okay, so I just skipped AppleWin (AppleLin).

That sentence above gives the assumption it is impossible :sad and I don't believe it is impossible :p It can be done! If endian is the issue then we tackle it head on as an army. We work together in full force and defeat the wall that is blocking us, even if it means we hit that wall using our own head :banghead

Share with us in how far you have reached in the port up and where you got stuck. This is where we need to begin in resolving the issue.

Marlon_ 11 July 2017 17:29

Quote:

Originally Posted by xboxown (Post 1170628)
That sentence above gives the assumption it is impossible :sad and I don't believe it is impossible :p It can be done! If endian is the issue then we tackle it head on as an army. We work together in full force and defeat the wall that is blocking us, even if it means we hit that wall using our own head :banghead

Share with us in how far you have reached in the port up and where you got stuck. This is where we need to begin in resolving the issue.

Well, here's my changes to get it to compile at all:
https://github.com/MBeijer/linapple-pie

You can see what I've done to make it compile. It's very hacky and I don't expect it to work. But you can use it as a base and go from there to make it work.

The only issues when it's done compiling is the actual linking.

To build the make-file (on linux) just run ./build_gmake and then type run make.

On windows/cygwin run premake4.exe gmake

xboxown 11 July 2017 17:37

Quote:

Originally Posted by Marlon_ (Post 1170629)
Well, here's my changes to get it to compile at all:
https://github.com/MBeijer/linapple-pie

You can see what I've done to make it compile. It's very hacky and I don't expect it to work. But you can use it as a base and go from there to make it work.

The only issues when it's done compiling is the actual linking.

To build the make-file (on linux) just run ./build_gmake and then type run make.

On windows/cygwin run premake4.exe gmake

Is there an archive where we can download the entire source directly as zip?

Marlon_ 11 July 2017 17:41

Quote:

Originally Posted by xboxown (Post 1170631)
Is there an archive where we can download the entire source directly as zip?

Learn to GIT. ;)

No, but seriously, click the green "Clone or download" button.

EDIT:

Now I'm down to this:
Code:

Linking applewin
obj/m68k-amigaos/Release/Timer.o(.text+0x184):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
obj/m68k-amigaos/Release/Timer.o(.text+0x216):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/libstdc++.a(ctype_configure_char.o)(.text+0x7a): In function `std::ctype<char>::ctype(int*, char const*, bool, unsigned long)':
/home/marlon/amigaos-cross-toolchain/.build-m68k/build/gcc-6/m68k-amigaos/libstdc++-v3/src/c++11/ctype_configure_char.cc:49: undefined reference to `vtable for std::ctype<char>'
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/libstdc++.a(ctype_configure_char.o)(.text+0x18a): In function `std::ctype<char>::ctype(char const*, bool, unsigned long)':
/home/marlon/amigaos-cross-toolchain/.build-m68k/build/gcc-6/m68k-amigaos/libstdc++-v3/src/c++11/ctype_configure_char.cc:60: undefined reference to `vtable for std::ctype<char>'
collect2: error: ld returned 1 exit status
Makefile:168: recipe for target '../bin/applewin.68k' failed
make[1]: *** [../bin/applewin.68k] Error 1
Makefile:16: recipe for target 'applewin' failed
make: *** [applewin] Error 2


emufan 11 July 2017 18:53

Quote:

Originally Posted by Marlon_ (Post 1170629)
To build the make-file (on linux) just run ./build_gmake and then type run make.

On windows/cygwin run premake4.exe gmake

this premake is nice. do you have to write the premake4.lua on your own or is it auto generated?

Marlon_ 11 July 2017 18:55

Quote:

Originally Posted by emufan (Post 1170650)
this premake is nice. do you have to write the premake.lua on your own. or is it auto generated?

I wrote it on my own. It's very easy to write your own config file though and there are loads of config examples on their website.

emufan 11 July 2017 19:03

Quote:

Originally Posted by Marlon_ (Post 1170651)
I wrote it on my own. It's very easy to write your own config file though and there are loads of config examples on their website.

ah, ic. this could be usefull with winemaker or make-it-so - those convert visual studio solutions into gcc makefiles.

hmm, is premake able to convert from msvc solutions to makefile on it's own?

Marlon_ 11 July 2017 19:12

No, you make a configurationfile called premake4.lua where you define what should end up in the make file. then you use premake to generate one of the following:
  • codeblocks Generate Code::Blocks project files
  • codelite Generate CodeLite project files
  • gmake Generate GNU makefiles for POSIX, MinGW, and Cygwin
  • vs2002 Generate Microsoft Visual Studio 2002 project files
  • vs2003 Generate Microsoft Visual Studio 2003 project files
  • vs2005 Generate Microsoft Visual Studio 2005 project files
  • vs2008 Generate Microsoft Visual Studio 2008 project files
  • vs2010 Generate Visual Studio 2010 project files (experimental)
  • xcode3 Generate Apple Xcode 3 project files (experimental)


All times are GMT +2. The time now is 16:45.

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

Page generated in 0.06164 seconds with 11 queries