English Amiga Board


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

 
 
Thread Tools
Old 12 July 2017, 21:45   #101
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by emufan View Post
hrm, sounds reasonable, i'll have a look if this is possible

are you able to do the hack? - see below for files.
i think m68k-amigaos-objcopy.exe m68k-amigaos-objdump.exe are of good use here.

#1) I wrote a note in Novacoder's SDL thread, so maybe he will see the message.

#2) meanwhile i made a new linapple68k-testbuilds.lha.
in the zone. with aga ixemul nofpu and default build

#3) i also zoned the older SDL-AGA versions:
SDL_AGA_v1.2.14.001.zip
SDL_AGA_v1.2.3.001.zip

#4) some usefull commands - analyzing the file "libSDL_SDL_SYS_JOYSTICK.a"
Code:
$ m68k-amigaos-objdump.exe -h  libSDL_SDL_SYS_JOYSTICK.a

SDL_sysjoystick.o:     file format a.out-amiga

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000388  00000000  00000000  00000020  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, CODE
  1 .data         00000020  00000388  00000388  000003a8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000000  000003a8  000003a8  00000000  2**2
                  ALLOC
syntax of objdump is weird to say the least :/
i guess the sections are .text .data .bss , but we want to dump the whole segment "SDL_sysjoystick.o".
questions is - how
emufan, can you test the files yourself and report them?
xboxown is offline  
Old 12 July 2017, 22:50   #102
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
emufan, can you test the files yourself and report them?
the SDL-AGA version? i did already, but it just puts out an error message:
Quote:
Originally Posted by emufan View Post
Code:
New Shell process 8
8.System:00000> stack 500000
8.System:00000> applewin_AGA.68k 
Could not initialize SDL: SDL not built with timer support
so we need to have SDL-AGA which includes "timer support" (current sdl-aga on aminet)
and "SDL_SYS_JOYSTICK" (not included with current SDL-AGA aminet release).
so i was about to extract the "SDL_SYS_JOYSTICK" code section of an older link library and implant it into the latest aminet release.
but no success as of yet.

with an AppleWIN.68k_SDL-AGA build we could see, if it crashs the same way, the SDL-RTG build does.
emufan is offline  
Old 12 July 2017, 23:31   #103
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
I am terrified!!!
xboxown is offline  
Old 12 July 2017, 23:54   #104
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
I am terrified!!!
same here

but i found a way to extract the module in question from the link library:
Code:
m68k-amigaos-ar.exe x libSDL_SDL_SYS_JOYSTICK.a
...
SDL_sysjoystick.o
...
i'll try to add it to the $OBJECTS list in the Makefile

#2) boah, cool. this does really work.
Code:
$ make -j 3
==== Building applewin (release_m68k-amigaos) ====
Linking applewin
anyone wants to test the new binary first?

#3)
zoned: linapple68k-testbuilds.lha
includes SDL-AGA version - not yet tested - report back

Last edited by emufan; 13 July 2017 at 00:09.
emufan is offline  
Old 13 July 2017, 00:00   #105
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by emufan View Post
same here

but i found a way to extract the module in question from the link library:
Code:
m68k-amigaos-ar.exe x libSDL_SDL_SYS_JOYSTICK.a
...
SDL_sysjoystick.o
...
i'll try to add it to the $OBJECTS list in the Makefile
Thank you for keep on going! Thank you for not giving up! Thank you for being persistent with whatever limitation you have and knowledge and resources on the matter.

THANK YOU!
xboxown is offline  
Old 13 July 2017, 00:08   #106
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by emufan View Post
same here

but i found a way to extract the module in question from the link library:
Code:
m68k-amigaos-ar.exe x libSDL_SDL_SYS_JOYSTICK.a
...
SDL_sysjoystick.o
...
i'll try to add it to the $OBJECTS list in the Makefile

#2) boah, cool. this does really work.
Code:
$ make -j 3
==== Building applewin (release_m68k-amigaos) ====
Linking applewin
anyone wants to test the new binary first?

*brb*
I'm not sure how well this will work, as SDL-AGA is SDL-1.2.15 while the other RTG SDL is SDL-1.2.6.
Unless of course, you took the joystick part from the SDL-AGA without timer
Marlon_ is offline  
Old 13 July 2017, 00:10   #107
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
np, just test yourself first

Quote:
Originally Posted by emufan View Post
#3)
zoned: linapple68k-testbuilds.lha
includes SDL-AGA version - not yet tested - report back
Quote:
Originally Posted by Marlon_ View Post
I'm not sure how well this will work, as SDL-AGA is SDL-1.2.15 while the other RTG SDL is SDL-1.2.6.
Unless of course, you took the joystick part from the SDL-AGA without timer
i extracted the missing part from SDL_AGA_v1.2.14.001 (zoned) and just linked the resulting object file with the binary,
which is using latest SDL-AGA from aminet (timer feature).
no clue if it will work, but at least we can now build a binary

#1) and we have learned a lot

Last edited by emufan; 13 July 2017 at 00:15.
emufan is offline  
Old 13 July 2017, 01:00   #108
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by emufan View Post
np, just test yourself first




i extracted the missing part from SDL_AGA_v1.2.14.001 (zoned) and just linked the resulting object file with the binary,
which is using latest SDL-AGA from aminet (timer feature).
no clue if it will work, but at least we can now build a binary

#1) and we have learned a lot
Did you build the new binary?
xboxown is offline  
Old 13 July 2017, 01:24   #109
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
Did you build the new binary?
yes, in the zone already
Quote:
Originally Posted by emufan View Post
anyone wants to test the new binary first?

#3)
zoned: linapple68k-testbuilds.lha
includes SDL-AGA version - not yet tested - report back
maybe it will just crash, i dont know.
emufan is offline  
Old 13 July 2017, 01:51   #110
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Quote:
Originally Posted by Marlon_ View Post
I have no idea how to debug on amiga. But I'm sure there is some debug mode in winuae that we could use. I'm quite new to developing for the classic Amiga's so I'm quite lost, even though I have some knowledge regarding C/C++ for other systems.
Debugging gcc is a pain on 68k, apparently it is possible but I never figured it out. I had to result to good old system.out type console messages which was very inefficient. It once took me over a month to find a silly bug in ScummVM (literally thousands of lines of source code) which I would have fixed in minutes with a modern step-through debugger...very painful

I'm not sure how good my last SDL port is (the one on AmiNet), I remember that I was working on a better implementation which I had started from scratch but I didn't get to finish it.
NovaCoder is offline  
Old 13 July 2017, 01:58   #111
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by NovaCoder View Post
Debugging gcc is a pain on 68k, apparently it is possible but I never figured it out. I had to result to good old system.out type console messages which was very inefficient. It once took me over a month to find a silly bug in ScummVM (literally thousands of lines of source code) which I would have fixed in minutes with a modern step-through debugger...very painful

I'm not sure how good my last SDL port is (the one on AmiNet), I remember that I was working on a better implementation which I had started from scratch but I didn't get to finish it.

Please help us NovaCoder!!! Please help us get this working!!

:

US!
xboxown is offline  
Old 13 July 2017, 02:30   #112
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i did a test now on my own, and it's still about the "Timer support" - see image attached.

since the SDL-Amiga (rtg version) does not have the timer issue,
it must be something else. maybe it's the rtg sdl version,
but could be something completely different within the linapple/applewin code.

#1) i cannot find the error message in the source or in the sdl dev files.
snoopdos does not give any hint, what does produce the error message.

#2) it is the SDL-AGA lib itself, you can read the error message in the object file.
other timer related things you can find - so maybe the "timer trap" was not
disabled, when Novacoder added the timer support?!
Attached Thumbnails
Click image for larger version

Name:	Clipboard-1.png
Views:	110
Size:	5.9 KB
ID:	53720  

Last edited by emufan; 13 July 2017 at 02:45.
emufan is offline  
Old 13 July 2017, 18:15   #113
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i'm looking for things we have disabled/removed.

one thing i need to get fixed in Timer.cpp - setitimer is defined in <sys/time.h>
Code:
$ make
==== Building applewin (release_m68k-amigaos) ====
Timer.cpp
Linking applewin
obj/m68k-amigaos/Release/Timer.o(.text+0x1f0):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
obj/m68k-amigaos/Release/Timer.o(.text+0x282):obj/m68k-amigaos/Release/Timer.o: undefined reference to `setitimer'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:179: ../bin/applewin.68k] Error 1
make: *** [Makefile:17: applewin] Error 2
Timer.cpp:
Code:
	if(setitimer(ITIMER_REAL, &mytimeset, NULL) != 0) {
		fprintf(stderr, "Error creating timer (setitimer failed)\n");
		_ASSERT(0);
		return;
	}

...

	setitimer(ITIMER_REAL, &mytimeset, NULL);
if i use "int setitimer(ITIMER_REAL, &mytimeset, NULL);" in the 2nd case,
i can eliminate one "undefined reference to `setitimer'" - even while the linker issues a warning.

Makefile:
Code:
  LDFLAGS   += -s -D__AMIGA__ -fno-rtti -noixemul -fno-exceptions -fpermissive -fbbb=sapcmfbi  \
			-m68020 -msoft-float -I/opt/m68k-amigaos/include/SDL -I/opt/m68k-amigaos/include \
			-L/opt/m68k-amigaos/lib -L/opt/m68k-amigaos/m68k-amigaos/lib -fomit-frame-pointer \
			-Xlinker --allow-multiple-definition -L/opt/m68k-amigaos/lib \
			-L/opt/m68k-amigaos/m68k-amigaos/lib -L/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix \
			-L/opt/m68k-amigaos/m68k-amigaos/clib2/lib
  LIBS      += -lSDL -ljpeg -lz -ldebug -lSDL_image
  LINKCMD    = $(CXX) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)
i changed order of LIBS in the Makefile, but it makes no difference at all.
what needs to be done to fix this error?

Last edited by emufan; 13 July 2017 at 18:23.
emufan is offline  
Old 13 July 2017, 18:18   #114
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Quote:
Originally Posted by emufan View Post
what needs to be done with "setitimer" to fix this error?
is setitimer actually defined in any lib?

Last edited by alkis; 13 July 2017 at 18:18. Reason: typo
alkis is offline  
Old 13 July 2017, 18:27   #115
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by alkis View Post
is setitimer actually defined in any lib?
It's part of glibc on linux. So I wonder if this needs to be compiled with ixemul or -mcrt=clib2 (both of which is not done 100% yet)
Marlon_ is offline  
Old 13 July 2017, 18:28   #116
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Hmm, looks like libc function. try adding -lc at LIBS
alkis is offline  
Old 13 July 2017, 18:44   #117
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by Marlon_ View Post
It's part of glibc on linux. So I wonder if this needs to be compiled with ixemul or -mcrt=clib2 (both of which is not done 100% yet)
What do you mean not done 100%?
xboxown is offline  
Old 13 July 2017, 19:14   #118
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by alkis View Post
is setitimer actually defined in any lib?
i did a simple grep on all *.a within /opt/m68k-amigaos - (GCC) 6.3.1b 20170707
not a single hit - for example multiple hits for memcpy
Quote:
Originally Posted by Marlon_ View Post
It's part of glibc on linux. So I wonder if this needs to be compiled with ixemul or -mcrt=clib2 (both of which is not done 100% yet)
tested - gives much more unresolved things
Quote:
Originally Posted by alkis View Post
Hmm, looks like libc function. try adding -lc at LIBS
done , same missing setitimer
Quote:
Originally Posted by xboxown View Post
What do you mean not done 100%?
we may have a compiler which lacks some features.
so while we look into fixing the source code of the emulator,
we may have a "non working" compiler - so trying to fix the source code is all in vain,
until we can ensure the compiler has all features implemented :/

Last edited by emufan; 13 July 2017 at 19:21.
emufan is offline  
Old 13 July 2017, 19:18   #119
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by emufan View Post
i did a simple grep on all *.a within /opt/m68k-amigaos
not a single hit - for example multiple hits for memcpy

tested - gives much more unresolved things

done , same missing setitimer

we may have a compiler which lacks some features.
so while we look into fixing the source code of the emulator,
we may have a "non working" compiler - so trying to fix the source code is all in vain,
until we can ensure the compiler has all features implemented :/
OH!!!!

How do you go about doing that??!
xboxown is offline  
Old 13 July 2017, 19:20   #120
drHirudo
Amiga user
 
drHirudo's Avatar
 
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 455
Okay, I found my AppleWin porting effort on my Amiga X1000. It's running okay (see screenshots), but seems the ROM is not converted properly (endian issue I guess, so the emulator can't boot from the ROM). Problem is I don't remember how I compiled the binary at all and I am not sure if the porting script is not somewhere on my microAmigaOne, which wasn't started since years). If I find something more regarding my porting efforts, I will post here. I know not of much help, except showing that it can be done. But at least you shall try examining the AmigaOS 4 binary.

Edit: Removed attachment of LinApple for AmigaOS 4.
Attached Thumbnails
Click image for larger version

Name:	LinApple1.jpg
Views:	104
Size:	109.6 KB
ID:	53725   Click image for larger version

Name:	LinApple2.png
Views:	95
Size:	9.7 KB
ID:	53726   Click image for larger version

Name:	LinApple3.png
Views:	97
Size:	40.0 KB
ID:	53727  

Last edited by drHirudo; 25 July 2017 at 08:22.
drHirudo 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 17:36.

Top

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