When porting some 1.1.x games app to 2.0 firmware and in order to use the open toolchain methods for event handling such as
You need to add this in main.m
- (void)mouseDown:(struct __GSEvent *)fp8;
- (void)mouseUp:(struct __GSEvent *)fp8;
- (void)mouseDragged:(struct __GSEvent *)fp8;
- (void)mouseEntered:(struct __GSEvent *)fp8;
- (void)mouseExited:(struct __GSEvent *)fp8;
- (void)mouseMoved:(struct __GSEvent *)fp8;
Otherwise, you have to rewrite the touch handling events into these methods using the firmware 2.0 UITouch and UIEvent headers as in my previous post (T4Two.app)
- (void)touchesBegan:(id)fp8 withEvent:(id)fp12;
- (void)touchesMoved:(id)fp8 withEvent:(id)fp12;
- (void)touchesEnded:(id)fp8 withEvent:(id)fp12;
I have ported a game called tris to firmware 2.0 beta using these 2 approaches, but I found out that the performance of UITouch/UIEvent handling events are slightly better in firmware 2.0 beta, so the compiled binary uses the firmware 2.0 methods.
The original project is at (with source and binary for 1.1.x)
This game supports suspend and resume and I have added a quit menu, so that it can be remove from background completely.
You can enable the firmware 1.x event handling methods (that is to disable firmware 2.0 event handling methods) by uncomment this line in the Makefile and run make again
The program will run on firmware 2.0 beta 3 and has been tested on iPhone firmware 2.0 beta 3 (pwned). The source code and makefile will build on SDK beta 3 with Open Toolchain header.
#CFLAGS += -DUSE_LEGACY_EVENT
The compiled binary tris.app folder (for firmware OS 2.0 beta 3 build 5A240d) is at
MD5 (30626-tris.zip) = 08a155605419317843084c04648be5eb
To install, just scp to the /Applications folder, or wget directly and unzip in iPhone.
If you don't have wget in iPhone, get it from here, this wget binary works in firmware 2.0 beta 3
unzip -oj 30626-tris.zip build/2.0/tris.app/* -d /Applications/tris.app
The source code, resources and Makefile are at
MD5 (30631-tris_src.zip) = 8b6434572a355d477c7da49baa2a2425