English Amiga Board


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

 
 
Thread Tools
Old 11 August 2017, 13:23   #141
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
Quote:
Originally Posted by NovaCoder View Post
I'd just use the older RTG version of the SDL to get it up and running first.
I've extracted sdl_sysjoystic.o and it does build now, will have a test now

#1) no luck, gave " sdl without timer support".

#2) tested amiga-sdl, and here i get anotehr crazy stuff, while linking:
Code:
undefined reference to `_kprintf' / undefined reference to `_fdopen'
....
$ m68k-amigaos-nm.exe ../../SDL/lib/libSDL.a | grep -i print
000001b0 t _PrintDouble
00000156 t _PrintInt
0000020e t _PrintPointer
         U _fprintf
         U _sprintf
         U _kprintf
         U _kprintf
...
absolut useless content and the enduser has to fix it? i dont get that.

#3) someone else must try to compile it, to confirm the error.
i'm not even sure if i made some mistake somewhere.

#4) readme says:
- You can get rid by debug.lib if you define an empty kprintf() in your code.
i've put a void kprint (); in Applewin.cpp main() , ,
undeclared kprint ...

need a break.

Last edited by emufan; 11 August 2017 at 14:22.
emufan is offline  
AdSense AdSense  
Old 11 August 2017, 16:34   #142
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
had to rebuild amiga-sdl, removed all the kprint & putenv crap, had to use another zlib,
removed some traces of this kprint mess from frame.cpp.
now it builds, *blub blub* but it does crash winuae.
anyone expected something else?


#1) Amiga-SDl is build with default settings, no -m68xxx option,
so i guess it's done for 68000?
well, build linapple with 040/020/000 option, grey screen visible,
next is crash dump winuae.

zoned: linapple-rtg-test.lha
zoned: linapple-rtg-aga-sdl-src.zip (*)

(*) it's based on Novacoder source code archive.
includes amiga-sdl 1.2.6 source, with removed kprint stuff
compiles with gcc6 crosscompiler (make -f makefile.cross).
libSDL.a is in resource folder for linapple.
linapple build with AmiDevCPP, projectfile for aga and rtg version ( *.dev).
curl stuff removed/disabled in src code.
look in project options -> parameters for cpu type

Last edited by emufan; 11 August 2017 at 17:25.
emufan is offline  
Old 12 August 2017, 01:54   #143
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,444
Sounds like you are getting close, don't give up!

With the archive I uploaded, make sure you check the changes I made to setTimer... you'll need to pass in the callback method (I only had time for a quick hack).

Also make sure you bump up the STACK before you try and run it.

If all that fails then you'll have to resort to putting in some printf debug statements to see how far it's getting.
NovaCoder is offline  
Old 12 August 2017, 18:51   #144
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
debuging suxx, if winuae crash dumps all the time.

without a uae gfx board i get a message: no suitable card found.
snoopdos lists USE_P96_FIX and SDL_DEBUG, but they have no good effect if set.

must be related to opening the sdl screen thing, diabled force fullscreen in common.h,
no effect.
emufan is offline  
Old 12 August 2017, 19:32   #145
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,924
It would be nice to get crash details, like log and config and crash dump file. (but make sure JIT is off)
Toni Wilen is online now  
Old 12 August 2017, 19:40   #146
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
one build is in the zone, running on default a1200 030/882 2 chip / 32 z3 with P96, and uae III card. wb/kick 3.0
using 3.5.0.0 / 3.4.0.0 release.

#1) I made some progress with adding printf on some occasions.
it wants the icon.bmp, does sdl support bmp on any platform?
Frame.cpp: apple_icon = SDL_LoadBMP("icon.bmp");

#2) very cool progress, i could track down the crash to reading in the linapple.conf file,.
so i disabled Applewin.cpp: LoadConfiguration(); function call
and we now have a black window, without any crash, *heureka* anyone ?
Code:
initialized SDL: 
Timer has been initted!
FrameCreateWindow: 
Screen size is 640x480
FrameCreateWindow2: 
SDL_MIX_MAXVOLUME=128
Freq=44100,format=36880,channels=2,silence=0
samples=4096,size=16384,bufferSize=32768
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
g_bHD_Enabled = 0
SDL_SetError: Couldn't open splash.bmp
Video: splash.bmp was not loaded
SDL_SetError: Couldn't open charset40.bmp
Video: Apple text is not unavailable: charset40.bmp was not loaded
SetColors(g_hDeviceBitmap)=1
SetColors(g_origscreen)=1
SDL_SetError: Couldn't open font.bmp
SetColors(g_hSourceBitmap)=1
In DrawFrameWindow. g_nAppMode == 0
SDL_SetError: Couldn't open font.bmp
Font file was not loaded.
Out of DrawFrameWindow!

#3) *awesome*
zoned: linapple-rtg-WIP.working.zip
build for window mode
in the shell type:
setenv SDL_DEBUG 1
linapple-RTG.exe

it does need some romfiles, have to look which: Memory.cpp
Apple2.rom - size 20480 (!?)
Apple2_Plus.rom - size 20480 (!?)
Apple2e.rom - size 32768 (!?)
Apple2e_Enhanced.rom - size 32768 (!?)


--> rom files are build in, so no need for external rom files.

#4) so we need to check what is wrong with reading linapple.conf file.
using SHIFT+F8 - write settings - gives a guru.
so something doesnt fit the amiga file handling procedure in linapple source.
Attached Thumbnails
Click image for larger version

Name:	linapple.png
Views:	43
Size:	11.0 KB
ID:	54162  

Last edited by emufan; 13 August 2017 at 19:05.
emufan is offline  
Old 12 August 2017, 21:46   #147
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,924
Quote:
Originally Posted by emufan View Post
one build is in the zone, running on default a1200 030/882 2 chip / 32 z3 with P96, and uae III card. wb/kick 3.0
using 3.5.0.0 / 3.4.0.0 release.
Without config file (and probably similar enough WB with exact library versions) it is guaranteed I am not going to duplicate any crashes -> log (with -log -logflush command line parameters) and dump file, please.
Toni Wilen is online now  
Old 12 August 2017, 21:59   #148
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
after i build the toasterless switcher after 15 years of nothing, the only answer you gave was this:
Quote:
Originally Posted by Toni Wilen View Post
Note that now that Toaster become a software hack (that does not exist in official version = anything is possible), it also become totally non-interesting and unsupported for me. Ask again when hardware documentation exist.
I wonder why do you care what i write or do now.
emufan is offline  
Old 12 August 2017, 22:01   #149
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
back to topic: did anyone found out what are the correct rom files?

#1) in resource.h there is a build in Apple2.rom.
now without config file, i hope he chooses some default, still dunno which one,
since snoopdos does not list access to any #?.rom file *hmm*

Last edited by emufan; 12 August 2017 at 22:20.
emufan is offline  
Old 12 August 2017, 22:19   #150
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 42
Posts: 19,924
Ok, if you want it, I can ignore you if you don't want any help, works fine for me. (btw, I think you should remember that you stole my thread where I asked for hardware information, software hacks don't have anything to do with hardware or how hardware works. Anyone would get annoyed by that)
Toni Wilen is online now  
Old 12 August 2017, 22:23   #151
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
Quote:
Originally Posted by Toni Wilen View Post
Ok, if you want it, I can ignore you if you don't want any help, works fine for me. (btw, I think you should remember that you stole my thread where I asked for hardware information, software hacks don't have anything to do with hardware or how hardware works. Anyone would get annoyed by that)
are u kidding me? i stole the thread ? i posted tons of usefull stuff into it,
and toaster stuff is not releated ?
it was of no use to get this thing working somehow? not any usefull thing related to addon cards ?
all the guide how to build this thing, to reproduce how this toaster thing does work,
or interacts with the amiga system, all useless , unrelated ?
are u freaking kidding me ?

#1) and about YOUR thread, all right ... initial poster was Pyromania.

Last edited by emufan; 12 August 2017 at 22:46.
emufan is offline  
Old 12 August 2017, 23:01   #152
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
the SDL_DEBUG infos gives some hint on some issue: NULL mutex.
Code:
> linapple-RTG.exe 
initialized SDL: 
Timer has been initted!
FrameCreateWindow: 
Screen size is 560x384
FrameCreateWindow2: 
SDL_MIX_MAXVOLUME=128
Freq=44100,format=36880,channels=2,silence=0
samples=4096,size=16384,bufferSize=32768
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
g_bHD_Enabled = 0
SetColors(g_hDeviceBitmap)=1
SetColors(g_origscreen)=1
SetColors(g_hSourceBitmap)=1
In DrawFrameWindow. g_nAppMode == 1
Leds are 1
Out of DrawFrameWindow!
no clue what it means. there is a fix,
but i'm not sure if we should bother.

#2) F2 "reset" does not work as intended i guess, expecting some start screen with apple info,
maybe related to the rom issue. dunno yet.

Last edited by emufan; 12 August 2017 at 23:25.
emufan is offline  
Old 13 August 2017, 03:11   #153
NovaCoder
Registered User
NovaCoder's Avatar
 
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 3,444
Quote:
Originally Posted by emufan View Post
one build is in the zone, running on default a1200 030/882 2 chip / 32 z3 with P96, and uae III card. wb/kick 3.0
using 3.5.0.0 / 3.4.0.0 release.

#1) I made some progress with adding printf on some occasions.
it wants the icon.bmp, does sdl support bmp on any platform?
Frame.cpp: apple_icon = SDL_LoadBMP("icon.bmp");

#2) very cool progress, i could track down the crash to reading in the linapple.conf file,.
so i disabled Applewin.cpp: LoadConfiguration(); function call
and we now have a black window, without any crash, *heureka* anyone ?
Code:
initialized SDL: 
Timer has been initted!
FrameCreateWindow: 
Screen size is 640x480
FrameCreateWindow2: 
SDL_MIX_MAXVOLUME=128
Freq=44100,format=36880,channels=2,silence=0
samples=4096,size=16384,bufferSize=32768
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
SDL_SetError: Passed a NULL mutex
g_bHD_Enabled = 0
SDL_SetError: Couldn't open splash.bmp
Video: splash.bmp was not loaded
SDL_SetError: Couldn't open charset40.bmp
Video: Apple text is not unavailable: charset40.bmp was not loaded
SetColors(g_hDeviceBitmap)=1
SetColors(g_origscreen)=1
SDL_SetError: Couldn't open font.bmp
SetColors(g_hSourceBitmap)=1
In DrawFrameWindow. g_nAppMode == 0
SDL_SetError: Couldn't open font.bmp
Font file was not loaded.
Out of DrawFrameWindow!

#3) *awesome*
zoned: linapple-rtg-WIP.working.zip
build for window mode
in the shell type:
setenv SDL_DEBUG 1
linapple-RTG.exe

it does need some romfiles, have to look which: Memory.cpp
Apple2.rom - size 20480 (!?)
Apple2_Plus.rom - size 20480 (!?)
Apple2e.rom - size 32768 (!?)
Apple2e_Enhanced.rom - size 32768 (!?)


#4) so we need to check what is wrong with reading linapple.conf file.
using SHIFT+F8 - write settings - gives a guru.
so something doesnt fit the amiga file handling procedure in linapple source.
I can't remember if that code I uploaded creates a mutex or not, does it have this?

https://wiki.libsdl.org/SDL_CreateMutex

Reading the configuration file problem may be an endian issue, you might need to byte swap.
NovaCoder is offline  
Old 13 August 2017, 04:44   #154
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
no CreateMutex.
Code:
$ grep -i Mutex *
CPU.cpp:// NOVA_CODER - pthread_mutex_t g_CriticalSection = PTHREAD_MUTEX_INITIALIZER;
CPU.cpp:SDL_mutex *g_CriticalSection = NULL;
CPU.cpp://      g_CriticalSection = PTHREAD_MUTEX_INITIALIZER;
CPU.cpp:        if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_UnlockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_UnlockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_UnlockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_UnlockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_LockMutex(g_CriticalSection);
CPU.cpp:        if (g_bCritSectionValid) SDL_UnlockMutex(g_CriticalSection);
SerialComms.cpp:// NOVA_CODER - pthread_mutex_t         m_CriticalSection = PTHREAD_MUTEX_INITIALIZER;
SerialComms.cpp:SDL_mutex *m_CriticalSection = NULL;
SerialComms.cpp:        SDL_LockMutex( m_CriticalSection );
SerialComms.cpp:        SDL_UnlockMutex( m_CriticalSection);
SerialComms.cpp:                SDL_LockMutex(m_CriticalSection);
SerialComms.cpp:                SDL_UnlockMutex(m_CriticalSection);
config is a textfile, but it gets fopen'ed with "a+t" flag, which is odd, but maybe ok.
so textfile can have endian issue ?
Code:
Applewin.cpp:   registry = fopen(REGISTRY, "a+t");      // open conf file (linapple.conf by default)
Registry.cpp:   registry = fopen(REGISTRY, "w+t");      // erase if been
Registry.h:#define REGISTRY     "linapple.conf"
#1) there is a CreateMutex:
Code:
SDL/include/SDL_mutex.h:extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
so when using SDL_mutex it actually calls SDL_CreateMutex?

#2) something is weird with the directory listing now, list is empty,
but i remember I had one build which lists files when pushing F3.

#3) all 4 rom files are build in, each in an array.
do we need to byteswap those ?

Last edited by emufan; 13 August 2017 at 19:06.
emufan is offline  
Old 14 August 2017, 20:00   #155
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 225
THANK YOU GUYS! THANK YOU EVERYONE! THANK YOU GUYS! THANK YOU GUYS! THANK YOU GUYS! AAAAAAAAAAAAAAAAH IT IS COMING ALONG!!!! - hits head on the hammer - It is coming along!! - hits head on the wall - I cannot believe it! - jumps up and down - aaaah!!
xboxown is offline  
Old 14 August 2017, 20:09   #156
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 29
Posts: 226
Send a message via Skype™ to Marlon_
Quote:
Originally Posted by xboxown View Post
THANK YOU GUYS! THANK YOU EVERYONE! THANK YOU GUYS! THANK YOU GUYS! THANK YOU GUYS! AAAAAAAAAAAAAAAAH IT IS COMING ALONG!!!! - hits head on the hammer - It is coming along!! - hits head on the wall - I cannot believe it! - jumps up and down - aaaah!!
Chill a bit maybe..?
Marlon_ is offline  
Old 14 August 2017, 20:56   #157
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
Quote:
Originally Posted by xboxown View Post
THANK YOU GUYS! THANK YOU EVERYONE! THANK YOU GUYS! THANK YOU GUYS! THANK YOU GUYS! AAAAAAAAAAAAAAAAH IT IS COMING ALONG!!!! - hits head on the hammer - It is coming along!! - hits head on the wall - I cannot believe it! - jumps up and down - aaaah!!
yes, thats cool indeed. some obstacles taken.
now the trouble is, to figure out, how to convert the file handling,
directory/file reading/parsing.
emufan is offline  
Old 14 August 2017, 20:59   #158
Marlon_
Amiga Programmer

Marlon_'s Avatar
 
Join Date: Mar 2016
Location: Sundsvall, Sweden
Age: 29
Posts: 226
Send a message via Skype™ to Marlon_
Quote:
Originally Posted by emufan View Post
now the trouble is, to figure out, how to convert the file handling,
directory/file reading/parsing.
Does ixemul take care of stuff like that? If not, surely there are sources from other ports that we could make use of. I need to do the same for MilkyTracker.
Marlon_ is offline  
Old 14 August 2017, 21:10   #159
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,032
Quote:
Originally Posted by Marlon_ View Post
Does ixemul take care of stuff like that? If not, surely there are sources from other ports that we could make use of. I need to do the same for MilkyTracker.
for now the binary is build using "-noixemul", but i dont see any specific x86 stuff.
some variables are defined/typedef'ed, but going back to simple char, for example,
which should get handled by the compiler in the correct way.

one thing are those current/parent folder and fullpath: "/" vs "..", already did some fixing, but no success.

also had a look on some sdl source on aminet, but couldnt find a quick fix.

#1) build without "-noixemul" - makes no diff, but i'm not sure how AmiDevCPP
handles the linking, if no such option is given.
^^ it add noixemul on it's own.

#2) use command line option "-b" - starts a benchmark.

#3) some progress with directory listing
Attached Thumbnails
Click image for larger version

Name:	linapple.png
Views:	31
Size:	12.6 KB
ID:	54197  

Last edited by emufan; 14 August 2017 at 21:57.
emufan is offline  
Old 14 August 2017, 22:22   #160
xboxown
Registered User
 
Join Date: Dec 2012
Location: Vancouver/Canada
Posts: 225
Quote:
Originally Posted by emufan View Post
for now the binary is build using "-noixemul", but i dont see any specific x86 stuff.
some variables are defined/typedef'ed, but going back to simple char, for example,
which should get handled by the compiler in the correct way.

one thing are those current/parent folder and fullpath: "/" vs "..", already did some fixing, but no success.

also had a look on some sdl source on aminet, but couldnt find a quick fix.

#1) build without "-noixemul" - makes no diff, but i'm not sure how AmiDevCPP
handles the linking, if no such option is given.
^^ it add noixemul on it's own.

#2) use command line option "-b" - starts a benchmark.

#3) some progress with directory listing

eeeeeeeeee!!!!
xboxown is offline  
AdSense AdSense  
 


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 18:46
Porting an Amiga game to PC CYBER_SLUNK Coders. General 4 31 January 2017 20:14
Porting Photoshop to Amiga KONEY Coders. General 25 30 December 2016 00:49
Porting PhotoChrome ST/e to Amiga. pandy71 request.Other 0 09 February 2015 16:12
Porting Qt Framework to Amiga OS enviroments Pyromania Coders. General 2 24 July 2013 07: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 10:36.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.29889 seconds with 15 queries