PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

SPV2 with Smartphone 2003

Hi,

It looks like Toki Tori won't run on the SPV2. When you start the game, it exits directly (no screens whatsoever). Anybody else had a change to test their game on the upcoming Smartphone?

Oh, and Toki was made with GapiDraw 1.04. Maybe that's the problem? Hope not :)


Maurice
Hi Maurice,

If possible, could you write a simple C program to get the GAPI parameters? You could simply create an empty app and catch keydown in the window, call GXOpenDisplay() and then write all the parameters down to a txt file...

//Johan
Hi Johan,

I don't have one available but I will request it.
Most games work, but Toki and a few others don't and it doesn't look like a GapiDraw (1.04) problem.


Maurice
I think you're barking up the wrong tree here. The Voyager has several issues, but to answer your question:
It uses a real lineair framebuffer so the values are what you should expect: xpitch=2 ypitch=176*2
I've run other games successfully with gapidraw 1.04 on the Voyager.

Here's the crash report when run in the debugger (I don't have the source code for toki tori so I can't give details. I'll debug it with maurice tomorrow.)
Data Abort: Thread=8cf6d7e0 Proc=8c14be30 'TokiTori.exe'
AKY=04000001 PC=03fc99cc RA=014470b4 BVA=a405c800 FSR=0000000d

Stack trace indicates it got called from inside gd104.dll address 0x374470b4 and GD104.dll is loaded at 0x37440000 so it called CGapiSurface::BltFast with the destination surface the framebuffer when it died.. (Probably called when the surface is being flipped).

A bit of background: For some reason the use of gx.dll requires privileged signing. The execution remains normal until you write at the address returned by GXBeginDraw(). (The MS security team of mobile 2003 are looking into it)

I've uploaded my own certificate to the privileged store and when I sign games using this cert, they work... except toki tori. I'm guessing I've overlooked something so it's still running in unprivileged mode. Tomorrow we'll hopefully have more details what's causing this.
Great report. I'm also glad that you (most probably) found the issue.
Johan wrote:
Great report. I'm also glad that you (most probably) found the issue.

Thanks.. I've got good news btw:
-Found out exactly where the problem lies with 1.04 and toki tori, etc..
-Received word from MS they are looking at several options to fix the privilege requirement for GAPI

The problem was that the display was initialised in one thread and used for writing in the other. The init must be done in the same thread in which you write to the screen. (done for security? scheduler uses different rules to transfer pages?)
Anyway, the fix is easy in this case. If you want to use 1.04 (don't know which other versions are affected but from 2.xx the init is done in the same thread), you need to modify CGapiApplication to use only one thread or move the init code to the graphics thread.

The real lib appears to work flawlessly.
Super!!
Hi Johan,

I have to fix this quickly (phone has to return today), so maybe you can give me some pointers on how to use CGapiApplication from 2.0 in 1.0?

Unfortunatly the 2.0 has some problems with Toki, and I guess it takes longer to convert from 1.0 to 2.0 than just change the thread bit in CGapiDrawApplicition in 1.0.


Maurice
Um.. Ok.. Hmmm... There should not be that many differences.. OpenDisplay has changed.. You should remove CreateVideoSurfaces and all code related to it (such as LostSurfaces).
Hi,

I got it working in a couple of minutes. I copied the .cpp and .h from 2.01 to 1.04, included them in the project, changed the OpenDisplay call and commented out all the other problems (mostly lost-surfaces and GetHWStatus for vsync) and it worked like a charm!

Maurice