English Amiga Board


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

 
 
Thread Tools
Old 11 July 2017, 19:19   #41
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Quote:
Originally Posted by Marlon_ View Post
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

Eeeeeeeee! You are almost done!!!
xboxown is offline  
Old 11 July 2017, 19:21   #42
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by xboxown View Post
Eeeeeeeee! You are almost done!!!
No, I almost have it actually compile. There's most likely a long road ahead to get it fully working. There are probably loads of optimizations needed as well.
Marlon_ is offline  
Old 11 July 2017, 19:28   #43
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Quote:
Originally Posted by Marlon_ View Post
No, I almost have it actually compile. There's most likely a long road ahead to get it fully working. There are probably loads of optimizations needed as well.
Let us just get it compiled To me right now that is the focus...everything else is sweet road after that!!
xboxown is offline  
Old 11 July 2017, 19:29   #44
drHirudo
Amiga user
 
drHirudo's Avatar
 
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 456
Quote:
Originally Posted by xboxown View Post
That sentence above gives the assumption it is impossible and I don't believe it is impossible 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

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.
No, it's not impossible. As I wrote, I ported it. Porting to AmigaOS 4 is easier than porting to AmigaOS 3 though. But the emulator was not working properly, because of some endian issues and it was too much work to fix them all by hand, so I decided the just leave the porting effort, especially when KEGS is working quite okay, i.e. check this KEGS video that I made nearly 5 years ago:
[ Show youtube player ]
Additionally I used ApplePC (Apple II emulator for DOS) through DOSBox and PCTask (PCx) before:
[ Show youtube player ]
and Apple 2000e is also quite good Apple II emulator. Yet, AppleWin is still the best, especially if you want to play Prince of Persia for Apple II. On most of the other emulators Prince of Persia doesn't work properly.
I will dig through my old projects to see if I can find my AppleWin porting efforts, to share them, but as I said it was for AmigaOS 4. I don't know if it will be of much use for AmigaOS 3 porting.
drHirudo is offline  
Old 11 July 2017, 19:30   #45
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Quote:
Originally Posted by drHirudo View Post
No, it's not impossible. As I wrote, I ported it. Porting to AmigaOS 4 is easier than porting to AmigaOS 3 though. But the emulator was not working properly, because of some endian issues and it was too much work to fix them all by hand, so I decided the just leave the porting effort, especially when KEGS is working quite okay, i.e. check this KEGS video that I made nearly 5 years ago:
[ Show youtube player ]
Additionally I used ApplePC (Apple II emulator for DOS) through DOSBox and PCTask (PCx) before:
[ Show youtube player ]
and Apple 2000e is also quite good Apple II emulator. Yet, AppleWin is still the best, especially if you want to play Prince of Persia for Apple II. On most of the other emulators Prince of Persia doesn't work properly.
I will dig through my old projects to see if I can find my AppleWin porting efforts, to share them, but as I said it was for AmigaOS 4. I don't know if it will be of much use for AmigaOS 3 porting.
Any help is very much appreciated in helping get the best Apple II emulator on earth ported for Amiga 68k
xboxown is offline  
Old 11 July 2017, 21:38   #46
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by emufan View Post
#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
not only as a reminder to myself: this seems to be the way to go.
the example above should look like this:
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 }
remove all pthread related function and disable/remove #include <pthread.h>
emufan is offline  
Old 11 July 2017, 21:42   #47
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
not only as a reminder to myself: this seems to be the way to go.
the example above should look like this:
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 }
remove all pthread related function and disable/remove #include <pthread.h>
If you look at my repo, I have already done this.
Marlon_ is offline  
Old 11 July 2017, 21:44   #48
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
If you look at my repo, I have already done this.
but i didnt got a definitive answer.
so for the record, pthread.h function you can simply remove.
emufan is offline  
Old 11 July 2017, 21:50   #49
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
but i didnt got a definitive answer.
so for the record, pthread.h function you can simply remove.
There's no pthread support in classic AmigaOS 3.x, there's other ways to implement the functionality pthread is supposed to do in this case, but I don't have enough know-how to do it the proper amiga way, so for now it's just commented out.

There's also a lot of code that has been lazily ported by doing an "api"-wrapper to translate Microsoft C++ specific functions into GNU C++ functions which is confusing the toolchain.

Like SetFilePointer that's used in Harddisk.cpp and Disk*.cpp files is Microsoft specific.

The wrapper is introduced in wwrapper.cpp:
Code:
DWORD SetFilePointer(HANDLE hFile,
		LONG lDistanceToMove,
		PLONG lpDistanceToMoveHigh,
		DWORD dwMoveMethod) {
	/* ummm,fseek in Russian */
	fseek((FILE*) hFile, lDistanceToMove, dwMoveMethod);
	return ftell((FILE*) hFile);
}
However this gives me the linker error:
Code:
obj/m68k-amigaos/Release/Harddisk.o(.text+0xb48):obj/m68k-amigaos/Release/Harddisk.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
Marlon_ is offline  
Old 11 July 2017, 21:51   #50
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
which SDL version we should use for the amiga, SDL-Amiga or SDL_AGA?
emufan is offline  
Old 11 July 2017, 21:52   #51
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
The SDL-Amiga one is for RTG, SDL_AGA is AGA only. It's up to you which one you want to use, but you need to know about the limits of AGA if you go that route.
Marlon_ is offline  
Old 11 July 2017, 22:10   #52
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 676
Quote:
Originally Posted by Marlon_ View Post
The SDL-Amiga one is for RTG, SDL_AGA is AGA only. It's up to you which one you want to use, but you need to know about the limits of AGA if you go that route.
SDL RTG is the way we should go
xboxown is offline  
Old 11 July 2017, 22:10   #53
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
The SDL-Amiga one is for RTG, SDL_AGA is AGA only. It's up to you which one you want to use, but you need to know about the limits of AGA if you go that route.
ok, so both may work. i installed now:
SDL-Amiga - RTG version
SDL-Image - comes with libjpeg, libpng and libz
emufan is offline  
Old 11 July 2017, 22:32   #54
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
ok, so both may work. i installed now:
SDL-Amiga - RTG version
SDL-Image - comes with libjpeg, libpng and libz
Yup, that's what I have. I installed it all in the proper directories in the toolchain.
Marlon_ is offline  
Old 11 July 2017, 23:18   #55
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
how did you fix - for example - this one:
Code:
obj/m68k-amigaos/Release/Frame.o(.text+0x68):obj/m68k-amigaos/Release/Frame.o: undefined reference to `DrawStatusArea(short)'
?

#1) hmm, i've found something, set type to BOOL, if the function is used, in Frame.cpp:
Code:
  // DRAW THE STATUS AREA
  BOOL DrawStatusArea(DRAW_BACKGROUND | DRAW_LEDS);

vs:

  // DRAW THE STATUS AREA
  DrawStatusArea(DRAW_BACKGROUND | DRAW_LEDS);

Last edited by emufan; 11 July 2017 at 23:35.
emufan is offline  
Old 11 July 2017, 23:40   #56
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
how did you fix - for example - this one:
Code:
obj/m68k-amigaos/Release/Frame.o(.text+0x68):obj/m68k-amigaos/Release/Frame.o: undefined reference to `DrawStatusArea(short)'
?

#1) hmm, i've found something, set type to BOOL, if the function is used, in Frame.cpp:
Code:
  // DRAW THE STATUS AREA
  BOOL DrawStatusArea(DRAW_BACKGROUND | DRAW_LEDS);

vs:

  // DRAW THE STATUS AREA
  DrawStatusArea(DRAW_BACKGROUND | DRAW_LEDS);
I commented out that one. :P
Marlon_ is offline  
Old 12 July 2017, 00:16   #57
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Marlon_ View Post
I commented out that one. :P
hmm, those "undefined reference" errors are really weird.

in Timer.cpp: set type int for setitimer:
Code:
int setitimer(ITIMER_REAL, &mytimeset, NULL);
and comment out the if( setitimer ...) condition above that line
i tried a indirect declaration (int)setitimer , but this didnt work out well :/
emufan is offline  
Old 12 July 2017, 00:21   #58
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
hmm, those "undefined reference" errors are really weird.

in Timer.cpp: set type int for setitimer:
Code:
int setitimer(ITIMER_REAL, &mytimeset, NULL);
and comment out the if( setitimer ...) condition above that line
i tried a indirect declaration (int)setitimer , but this didnt work out well :/
Yeah, this is where I got stuck as well, and also this:
Code:
/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>'
Marlon_ is offline  
Old 12 July 2017, 00:29   #59
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i still dont get these errors - but how did you fix all these "SetFilePointer":
Code:
obj/m68k-amigaos/Release/Riff.o(.text+0x82):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
emufan is offline  
Old 12 July 2017, 00:32   #60
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
i still dont get these errors - but how did you fix all these "SetFilePointer":
Code:
obj/m68k-amigaos/Release/Riff.o(.text+0x82):obj/m68k-amigaos/Release/Riff.o: undefined reference to `SetFilePointer(void*, long, long, unsigned)'
The wwrapper code is supposed to take care of this, but apparently is not:
Code:
DWORD SetFilePointer(HANDLE hFile,
		LONG lDistanceToMove,
		PLONG lpDistanceToMoveHigh,
		DWORD dwMoveMethod) {
	/* ummm,fseek in Russian */
	fseek((FILE*) hFile, lDistanceToMove, dwMoveMethod);
	return ftell((FILE*) hFile);
}
But if you look at what that function is doing, you can go through all the places where SetFilePointer is used and replace it with fseek and ftell.

EDIT:
It could be that it just tries to link in the wwrapper.o file after it tries to link in Riff.o, which causes the linker not to understand that the function is internal.
One could test this theory by editing the makefile (created by premake) in the projects folder.
Marlon_ 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 23:43.

Top

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