GLBasic 64-bit

spacefractal · 53646

Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #30 on: January 02, 2015, 02:21:08 pm
Okay here we go...

In gpc_temp2.cpp (and gpc_temp.h) change the return type of compare like so
Code: [Select]
int compare(Object& a, Object& b)
In glb.h change the following (foo should be a DGPtr):
Code: [Select]
template <class T> void SORTARRAY(T& arry, DGPtr foo)
...and here the return value should be int and no cast of the return value of cmp.

Code: [Select]
template <class T> int compare_by_foo(T& a, T& b, DGPtr foo)
{
typedef DGPtr(*pcmp)(T&a, T&b);
pcmp cmp;
#pragma warning(disable:4312)
cmp = (pcmp)(DGPtr*)foo;
return cmp(a,b);
}
« Last Edit: January 02, 2015, 06:15:58 pm by headkaze »



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #31 on: January 02, 2015, 03:43:04 pm
Here its still crash with a EXE_BAD_CESSS in if (a.obid<b.obid) after those change.

here what im try (as well your version):
Code: [Select]
template <class T> int compare_by_foo(T& a, T& b, DGPtr foo)
{
typedef DGPtr(*pcmp)(T&a, T&b);
pcmp cmp;
//#pragma warning(disable:4312)
cmp = (pcmp)(DGPtr*)foo;
    int f=cmp(a,b);
    return f;
}

But im also get a warning in int f=cmp(a,b):
Implicit conversion loses integer precision: 'DGPtr' (aka 'long long') to 'int'.

PS. In your version, im might have forget to add arm64.


« Last Edit: January 02, 2015, 03:46:25 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #32 on: January 02, 2015, 04:05:34 pm
It is definitely working in 64-bit mode for me after those changes. Perhaps I'm missing a change. Hang on a sec and I'll have a look.



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #33 on: January 02, 2015, 04:21:22 pm
ok.

int compare(Object& a, Object& b) is also not working, but im uses DGInt compare(Object& a, Object& b) instead (its came with a red warning).



The Musician for the RetroBytes Portal Projects.


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #34 on: January 02, 2015, 05:21:57 pm
Try this

Code: [Select]
template <class T> int compare_by_foo(T& a, T& b, DGPtr foo)
{
typedef int(*pcmp)(T&a, T&b);
pcmp cmp;
#pragma warning(disable:4312)
cmp = (pcmp)foo;
return cmp(a,b);
}

Also don't forget you need to change the following line in gpc_temp.h

Code: [Select]
int compare(Object& a, Object& b);
Definitely works after that on my iPad Air running 64-bit.
« Last Edit: January 02, 2015, 05:28:23 pm by headkaze »



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #35 on: January 02, 2015, 06:26:47 pm
damn. Im see what its happens. There was a confuction with the naming.

DGInt is a float, while DGNat is a integer. Im used a DGInt, which have crashed it (its allways a 32bit float).

So there is also a issue in the GLBASIC manual as well, which trying that example will uses a float rather than a int. You need to add a % to the function in GLBASIC code.

This was the main reason why its diddent work, and also the new template is also confirmed works too and the game running now. Thanks for your help.

PS. How is Karma Miwa performing on your 6plus?
« Last Edit: January 02, 2015, 06:33:35 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #36 on: January 03, 2015, 01:09:28 am
I don't have a 6 plus, only an iPhone 5 and it runs fine on that.



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #37 on: January 25, 2015, 10:18:08 am
how do im define in xCode. Im have newer found that feature at all, and is totally confusion how that one work in xCode.

Im trying to do something like -DTARGET_OS_IPHONE, but im could newer get that to work.

The Musician for the RetroBytes Portal Projects.


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #38 on: January 26, 2015, 07:12:15 pm
That looks right SF.

Just be sure to put it in for each Debug, Release and Distribution settings. Also for "Other C Flags" and "Other C++ Flags". You may also need to check the "Preprocessor Macros" section; although other flags should be enough.



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #39 on: January 26, 2015, 07:21:40 pm
thanks for the screenshot.

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #40 on: February 01, 2015, 03:29:56 pm
finally after a perioid with ski vacation and being sig after that (its was a nice vacation), then im finally tested this today. Its works much better now, so im only needs one stdafx.h instead of two (one for iPhone, and one for rest of the platforms).

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #41 on: February 15, 2015, 04:32:40 pm
look like im need more help. Im cannot get Karma Miwa compiled (im have tweeked a lots of levels and added few features those days), not even in 32bit mode only. Xcode is very strange and keeps the sound engine is missing, even its should been there and include. That even im inlude glbasic source into the project. Im sadly have no one clue what it going in here....

Im got a lots of undefined symboyls for glbSoundEngine functions from dxsound.o, even im uses the source code directly (as a t est), that even im trying to clean and even restart xcode. So im got stuck again.

im pm the project, but im have NOT include the graphics for the filesize, since im asume its should works after its compile again. Also for testing im have only used 32bit mode. Not 64bit.

PS. Im might missing somewhere a framework included, but what does xcode not tell that? Im have no clue which framework the sound engine really uses.
« Last Edit: February 15, 2015, 04:37:19 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838
Reply #42 on: February 15, 2015, 09:29:56 pm
In iphonesoundengine.cpp comment out the following two lines

Code: [Select]
#if defined (APPLE_COREAUDIO)
Code: [Select]
#endif // APPLE_COREAUDIO



Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #43 on: February 15, 2015, 10:43:32 pm
im dont understand why that needed, due its should have defined that already, but xCode seens to skips that?

Howover im have still one very strange issue left.

im got a undefined symbols linker error from
"__GLBASIC__::DEBUG from gpc_temp5.o

but there is no such call from cpp code which was there, I'm but I'm commented it out, but xcode still thinks it's there in the o file.

its look like its cached, but im cant delete that cache, even im clean that and also restart xcode.

weird....
« Last Edit: February 15, 2015, 10:56:32 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #44 on: February 16, 2015, 10:13:07 pm
Im got Karma Miwa running with the update.

But have still trouble with the define options in xcode in "other flags", which seen not working quite very well.

example APPLE_COREAUDIO was defined, but fails to works as its should.

Tomorrow im seen can get stdafx.h working without having require two of them (one for iOS and one for rest of the platforms).

by now im have defined them directly in the file like this:

Code: [Select]
#define TARGET_OS_IPHONE
#define IPHONE
#define HAVE_OPENGL_ES
#define POSIX
#define APPLE_COREAUDIO
#undef WIN32

but should doing something like this:

Code: [Select]
#ifdef TARGETIOS
#define TARGET_OS_IPHONE
#define IPHONE
#define HAVE_OPENGL_ES
#define POSIX
#define APPLE_COREAUDIO
#undef WIN32
#endif

But for me xCode working can been quite confuction and strange....


Now im should create some levels for Balders. Im do later this week.
« Last Edit: February 16, 2015, 10:14:45 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #45 on: February 17, 2015, 01:31:26 pm
when compiled as a lib, then im get a new crash and seen only happens on iPad 1 (iOS5).

dyld: Symbol not found: __sincos_stret

referenced from those line in OpenGLRainbows.cpp:

sphi = sin(phi * BOG_INV_F);

EDIT: Seens Fixed. Im forget to set iOS Deployment Target to iOS5.1 when creating the glbasic iphone lib....
« Last Edit: February 17, 2015, 01:42:50 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #46 on: March 17, 2015, 07:53:56 pm
Greedy Mouse v3.5 is ready for Android (just not uploaded), include various Android Micro Consoles (fixed a anoying inapp issue for Ouya). Im do might dedicated skips iOS this time. xCode simply just want to add those damn DEFINES and skips them completly or partly and have been stuck in a while.

its the DEFINE its the remaning issue. When adding the source code, its works, but not when compiling to the lib first.

« Last Edit: March 17, 2015, 07:55:03 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline headkaze

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 7838

Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #48 on: March 19, 2015, 10:26:31 am
look like im FINALLY got it to works, even there is confuction about it. Now the game ran correctly with the compiled lib file, and have updated the public xcode project to v4. Thanks for the help.

Few issues was returned (the blowfish and a tilt issues), but seen im got those corrected to, so im now only need one source code instance in the future.

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #49 on: March 20, 2015, 05:22:43 pm
Jubii, Genius Greedy Mouse with the new glbasic lib is now submitted to Itunes Connect in 3.4.

Android version (Ouya/Mojo, Amazon AppStore and Google Play) is pretty much ready too. Im did added Amazon FireTV code, so im try adding that platform for the submittion.

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #50 on: March 30, 2015, 04:52:44 pm
im have finally brought a MOGA iOS 7 MFI controller. Its might take a week before its arive here.

Now im thinks im want to add MFI controller support for GlBasic (as least the lower game pad profile with 6 buttons, which can either send to KEYS() or mightbeen even the controller commands).

Howover when im see this document (which seen quite easy to do):
http://www.raywenderlich.com/forums/viewtopic.php?f=21&t=10339

There is no way to make sure its only do the job when iOS 7 is detected? Glbasic should works from iOS 5.1 and up (the first iPad is still cool and using that).

But in the way, for glbasic Android, im have just added a much better game controller suppport recently, if you only do games with few buttons used, then its would works "out of the box". Otherwise if do want to uses near full profile, then just make a remap assign screen, and you go. Even iCade do im finally got working now for Android and remapping it before its sends to the KEY() command.

PS. Now im in this week went back to Balders. Sorry im diddent create more levels, but im simply just like the editor in that game (dispite few issues, its still works excellet).
« Last Edit: March 30, 2015, 04:54:50 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #51 on: April 13, 2015, 01:51:41 pm
I'm got mfi game controller to work and now play nice with glbasic. It's only possible to due I'm have the glbasic source code. I'm also created a game input api so I'm can use the same controller code on Android ios and Windows.

By now CatchOut works (dual stick game, but digital dpad and buttons can also been used) as well Karma Miwa. Button pressure is supported in CatchOut.

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #52 on: April 24, 2015, 05:37:34 pm
im have fighted recently with the interface orientation issue, which im cant fix it for IOS 8. Im got a post from this one:
http://www.glbasic.com/forum/index.php?topic=9971.msg91096#msg91096

after searing on net, im trying to do this:

Code: [Select]
void iPhoneSETORIENTATION(int orig) {
        if(orig==0) {
            [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
            if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
            }
        }
        if(orig==1) {
            [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
            if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
            }
        }
        if(orig==2) {
            [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown];
            if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
            }
        }
        if(orig==3) {
            [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
            if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeRight] forKey:@"orientation"];
            }
        }
}

But when [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeRight] forKey:@"orientation"]; is called, then touch controller view is lost focus (in iphoneeagleview.m). Im have no idea how to get the focus to work again.
« Last Edit: April 24, 2015, 05:38:15 pm by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #53 on: April 26, 2015, 08:24:00 am
im are going to collect the glbasic source code tree again and send the issue. after few days im giving up. Im simply just can get it right with the orintation crap. A area Android is much much easier to work with. iOS 8 seen crap on that area.

This one fells so strange.

its works on iPad 1, iPhone 6, but of course not on iPad 3 with iOS 8.2 :-P.

Im gonna to hate iOS now and with my next phone will defensivt been Android. iOS is just no longer fun.


The Musician for the RetroBytes Portal Projects.


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #54 on: April 26, 2015, 08:44:07 am
We also have problems with rotation on winsol with ios8+

8.3 has some rotational fixes in it, not sure if that also relates to code level and fixes any of these issues.

Coding for the love of it!


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #55 on: April 26, 2015, 08:48:03 am
generally rotation on iOS8 is very buggy and sometimes the keyboard dosent show correctly or crash. So iOS8 is much more buggy than iOS7 really.

There is some devs that stopped iPad dev due iOS8 strangeless. So not good for Apple.

The Musician for the RetroBytes Portal Projects.


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #56 on: April 26, 2015, 08:57:43 am
Yes. iOS 8 has several bugs. And a lot of them are with rotation. Even with a web page sometimes you cannot tap on the links when in landscape and have to turn to portrait to do so. Not sure if 8.3 has fixed many of these problems as only just installed it the other day. Must try winsol and see if there are improvements now? Still. Even if there are it does not stop someone using 8.2 leaving bad feedback for your game when the onus lies with apple.
« Last Edit: April 26, 2015, 09:19:25 am by Flash »

Coding for the love of it!


Offline flash

  • Administrator
  • Blue Gene Super Computer
  • **********
    • Posts: 13180
Reply #57 on: April 26, 2015, 09:17:46 am
This is from the 8.3 update notes.

Code: [Select]
Orientation and rotation fixes

Addresses an issue that sometimes prevented rotating back to portrait after having rotated to landscape
Improves performance and stability issues that occurred when rotating the device between portrait and landscape
Fixes an issue where device orientation appeared upside down after pulling the iPhone 6 Plus from your pocket
Resolves an issue that sometimes prevented apps from rotating to correct orientation after switching apps in multitasking

(Sorry about syntax, just pasting with the iPhone)
« Last Edit: April 26, 2015, 09:18:51 am by Flash »

Coding for the love of it!


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #58 on: April 26, 2015, 10:22:05 am
Its should works when starting up, but wont try to do the rotations like the named issues above.

Im do finally got the orientation works and show correctly now.

But auto rotation on older 5.1 would no longer been supported, since its a bit too much different, but the game is still fully playable on iPad 1.

but when there is a system rotating, then the UIViewController in iphoneeaglview.m stops responding. This is a issue im dont know why and needs help.
« Last Edit: April 26, 2015, 11:58:00 am by spacefractal »

The Musician for the RetroBytes Portal Projects.


Offline spacefractal

  • RBP Team Member
  • Blue Gene Super Computer
  • *****
    • Posts: 4138
Reply #59 on: May 02, 2015, 12:31:46 pm
im do still need help on the response issue, and cant fint anything that help on google at all.

Soon im add UIViewController to let the window rotate, then UIView touch inputs does not fired at all.

The Musician for the RetroBytes Portal Projects.