English Amiga Board


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

 
 
Thread Tools
Old 14 July 2017, 01:49   #121
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Quote:
Originally Posted by drHirudo View Post
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.
Do you have the source code for AppleLin for AmigaOS 4.x? That helps way more than the binary version.
xboxown is offline  
Old 14 July 2017, 02:47   #122
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
OH!!!!

How do you go about doing that??!
not sure. for now we have to wait for an update of the crosscompiler,
or someone who can tell us what we are doing wrong.

i found a simple source code, which uses setitimer function.
i can build the binary on cygwin with g++ v5.4 - while building the same with
m68k-amigaos-g++ v6.3.1 - i get a big list of different errors.

so i think something is wrong with the crosscompiler.

@drHirudo: do you remember which compiler you were using?

Last edited by emufan; 14 July 2017 at 02:57.
emufan is offline  
Old 14 July 2017, 03:03   #123
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
It's not the cross-compiler's fault. It's some library. Probably ixemul does not implement the scheme.
alkis is offline  
Old 14 July 2017, 03:03   #124
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
How are you setting those timers?

I don't think you should be calling 'SetTimer()' you should be using SDL Timers if you are using SDL.


https://wiki.libsdl.org/SDL_AddTimer


Also about the missing SDL Joystick functionality...I'd advise that you to simply stub out the SDL Joystick calls in 'Joystick.cpp' and use my latest SDL_AGA.lib from AmiNet, after you get it up and running you can then worry about implementing the joystick handling.

Last edited by NovaCoder; 14 July 2017 at 03:18.
NovaCoder is offline  
Old 14 July 2017, 03:55   #125
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by alkis View Post
It's not the cross-compiler's fault. It's some library. Probably ixemul does not implement the scheme.
but we get the error messages while building the binary with option "-noixemul" - so something in the crosscompiler package does not work as intended.

and i cannot find anything with "setitimer" in the link libs. i'm no expert but from the looks, something is missing.

Quote:
Originally Posted by NovaCoder View Post
How are you setting those timers?

I don't think you should be calling 'SetTimer()' you should be using SDL Timers if you are using SDL.


https://wiki.libsdl.org/SDL_AddTimer


Also about the missing SDL Joystick functionality...I'd advise that you to simply stub out the SDL Joystick calls in 'Joystick.cpp' and use my latest SDL_AGA.lib from AmiNet, after you get it up and running you can then worry about implementing the joystick handling.
hmm, i dont set anything, i just take what is given in the emulator sources

the trouble is, i can build the SDL-AGA version, but only if i remove and "fix"
the setitimer calls.
so this might explain the sdl-aga error message about missing timer support
emufan is offline  
Old 14 July 2017, 05:18   #126
drHirudo
Amiga user
 
drHirudo's Avatar
 
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 455
Quote:
Originally Posted by emufan View Post
not sure. for now we have to wait for an update of the crosscompiler,
or someone who can tell us what we are doing wrong.

i found a simple source code, which uses setitimer function.
i can build the binary on cygwin with g++ v5.4 - while building the same with
m68k-amigaos-g++ v6.3.1 - i get a big list of different errors.

so i think something is wrong with the crosscompiler.

@drHirudo: do you remember which compiler you were using?
I used GCC from the AmigaOS 4 SDK back then. The sourcecode I have is unmodified. For my porting purposes I usually use modified .h files with custom #ifdef, #ifndef and #DEFINE directives in order to keep the original sourcecode unmodified.
drHirudo is offline  
Old 14 July 2017, 06:30   #127
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by drHirudo View Post
I used GCC from the AmigaOS 4 SDK back then. The sourcecode I have is unmodified. For my porting purposes I usually use modified .h files with custom #ifdef, #ifndef and #DEFINE directives in order to keep the original sourcecode unmodified.
i had a look at the os4 sdk on the hyperion website.
just did a simple grep on those link libs and found no "setitimer".
so if you managed to compile it with the same restrictions,
your custom definitions could help alot
emufan is offline  
Old 15 July 2017, 04:36   #128
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
What?! That's it?
xboxown is offline  
Old 24 July 2017, 22:48   #129
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Is it officially dead? Do we cancel the entire project?
xboxown is offline  
Old 24 July 2017, 22:53   #130
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by xboxown View Post
Is it officially dead? Do we cancel the entire project?
waiting for drHirudo and his source code,
I hope he will find and share it
emufan is offline  
Old 25 July 2017, 00:05   #131
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
drHirudo what gives man??! - claps hands very fast - chop chop man! We are waiting for you!
xboxown is offline  
Old 25 July 2017, 01:05   #132
Marlon_
AmigaDev.com
 
Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Stockholm, Sweden
Age: 35
Posts: 625
Quote:
Originally Posted by xboxown View Post
drHirudo what gives man??! - claps hands very fast - chop chop man! We are waiting for you!
Ever heard of vacation?
Marlon_ is offline  
Old 25 July 2017, 01:50   #133
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Vaca.... what? Will I hope he have a happy and restful vacation
xboxown is offline  
Old 25 July 2017, 07:42   #134
drHirudo
Amiga user
 
drHirudo's Avatar
 
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 455
Quote:
Originally Posted by xboxown View Post
drHirudo what gives man??! - claps hands very fast - chop chop man! We are waiting for you!
Sorry, for the delay. My Amiga X1000 is in the other room and I didn't have the time to move it and turn it on to look for the sources. I hope Hyperion/Amiga will be okay with me distributing modified .h files from the SDK. Well, just saying because unexpected things can pop up from anywhere. Two years ago my PayPal account was terminated because they accused me of selling emulators! (just because I hosted them on my website!) and killed all my motivation for coding at all. The account balance was 0 and they allowed me to open a new account (probably realizing their mistake, but didn't want to acknowledge it).

Quote:
Vaca.... what? Will I hope he have a happy and restful vacation
Quite the opposite actually. The last few weeks I lost sleep and I am fighting constantly with YouTube and their bugs they introduce that broke hundreds of my videos. I write to them pointing out where the bugs are and why they happened and how they can fix them, but they just reply to me some paste text and didn't look at all what I am pointing to them, asking me to re-upload terrabytes of videos, because it will be easier for them that way. So, if they don't do anything (most probably), I have to fix hundreds of videos manually for weeks, without any warranty it will work or wont broke again in the future. They promised me 4 months ago everything will be okay and it will not break, but it happened, so I lost belief in YouTube technical support.
drHirudo is offline  
Old 25 July 2017, 19:44   #135
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
Advice to all that?

-hands you a cup of cold fresh water with couple of fresh ices-
xboxown is offline  
Old 04 August 2017, 18:55   #136
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 675
I am just saying that it is ok about applewin being cancelled or not ported. I am deciding to get the real apple ii machine instead.
xboxown is offline  
Old 04 August 2017, 19:11   #137
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
dont be disappointed. there is still some hope, if we can get the scr code of the os4 version.
maybe this will help to make a os3 port.
emufan is offline  
Old 11 August 2017, 03:08   #138
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
Hiya,

I had a quick look at the source linapple_src-2b.tar.bz2, I think this is a better version to use than the updated RetroPie source. If you could get it working then you can always update it with some of the newer stuff.

The main stuff I changed was:

Replace thread handling to use SDL:

Code:
// for CRITICAL_SECTION handling
// NOVA_CODER - #include <pthread.h>

// NOVA_CODER - pthread_mutex_t g_CriticalSection = PTHREAD_MUTEX_INITIALIZER;
SDL_mutex *g_CriticalSection = NULL;


void CpuIrqReset()
{
	_ASSERT(g_bCritSectionValid);
	if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
	g_bmIRQ = 0;
	if (g_bCritSectionValid) SDL_UnlockMutex(g_CriticalSection);
}
Replace Timer handling to use SDL:

Code:
/* NOVA_CODER
#ifndef _WIN32
//for Timers try to use POSIX compliant timers
#include <signal.h>
#include <sys/time.h>
#endif*/

bool SysClk_InitTimer()
{// first initialization of the timer
/*	memset(&sa_SysClk, 0, sizeof(sa_SysClk));	// clear sigaction struct
	sa_SysClk.sa_handler = &SysClk_TickTimer;
	sigaction(SIGALRM, &sa_SysClk, NULL);	// set SIGALRM handler*/
	//if(signal(SIGALRM, SysClk_TickTimer) == SIG_ERR)
	//	return false;

    // NOVA_CODER
    SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);

	printf("Timer has been initted!\n");
 	return true;
}
This now compiles but has a lot of conversion warnings, probably not that well written I'd guess...I'm also not sure about the use of CURL (I'd probably replace it). I'll attach the workspace that I used for those updates.

Hope that helps.

Last edited by NovaCoder; 18 February 2019 at 10:11.
NovaCoder is offline  
Old 11 August 2017, 12:00   #139
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
thanks alot Nova

while building with SDL_AGA, i get these linker errors:
Code:
../SDL/lib/SDL_AGA_040.a(SDL_joystick.o)(.text+0x10):SDL_joystick.o: undefined reference to `_SDL_SYS_JoystickInit'
../SDL/lib/SDL_AGA_040.a(SDL_joystick.o)(.text+0xcc):SDL_joystick.o: undefined reference to `_SDL_SYS_JoystickName'
../SDL/lib/SDL_AGA_040.a(SDL_joystick.o)(.text+0x3fc):SDL_joystick.o: undefined reference to `_SDL_SYS_JoystickClose'
../SDL/lib/SDL_AGA_040.a(SDL_joystick.o)(.text+0x546):SDL_joystick.o: undefined reference to `_SDL_SYS_JoystickOpen'
../SDL/lib/SDL_AGA_040.a(SDL_joystick.o)(.text+0x71e):SDL_joystick.o: undefined reference to `_SDL_SYS_JoystickQuit'
../SDL/lib/SDL_AGA_040.a(SDL_joystick.o)(.text+0xa0e):SDL_joystick.o: undefined reference to `_SDL_SYS_JoystickUpdate'
collect2: ld returned 1 exit status
in sdl_joystick.h i tried to define it, without success:

Code:
m68k-amigaos-nm.exe SDL_AGA_040.a
...
000007de T _SDL_PrivateJoystickHat
         U _SDL_SYS_JoystickClose
         U _SDL_SYS_JoystickInit
         U _SDL_SYS_JoystickName
         U _SDL_SYS_JoystickOpen
         U _SDL_SYS_JoystickQuit
         U _SDL_SYS_JoystickUpdate
...
older version and rtg got the "T" next to the "U" entry for SDL_SYS_... but it is missing in latest aminet version.
Code:
extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
extern DECLSPEC void SDLCALL SDL_SYS_JoystickUpdate(void);
this doesnt happen with your earlier version of sdl-aga nor the rtg version.
any idea?

Last edited by emufan; 11 August 2017 at 12:07.
emufan is offline  
Old 11 August 2017, 12:08   #140
NovaCoder
Registered User
 
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
I'd just use the older RTG version of the SDL to get it up and running first.
NovaCoder 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 09:38.

Top

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