Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lgpt.pkg text eol=crlf
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# LittleGPTracker
This is a fork of m-.-n's LGPT for Symbian (S60v3) devices. Built and tested on a Nokia E63 (S60v3 FP1).

At present, everything works - except the keyboard becomes unresponsive when audio is running. To be fixed.

## Runtime dependencies
You need the Open C/C++ libraries installed; these come with the Qt installer, amongst other places. The separate SIS files are also available in the Open C/C++ plugin (see below).

## Compile dependencies
You need:

- an S60 SDK matching your phone (v3, v3 FP1, v3 FP2) - these are not backwards compatible but somewhat forwards
- a suitable version of the GCCE compiler
- the Open C/C++ plug-in
- SDL-S60v3 from here: http://repo.or.cz/w/SDL.s60v3.git

Unfortunately the Nokia site with the SDKs and tools is now gone. Most of the necessary files can be found here:
http://n8delight.blogspot.com.au/2014/05/for-developers-re-up-of-symbian.html
I also found a copy of Open C/C++ on 4shared (look for s60_open_c_cpp_plug_in_v1_7_en).
The Qt SDK 1.1.x includes compiler, SDK and plug-ins all together, which are suitable for FP2 and above. This can be found here:
ftp://ftp.informatik.hu-berlin.de/pub/Mirrors/ftp.troll.no/QT/qtsdk/

To build:
- Install the SDK, which will add it to your PATH or give you a startup link to do so (QtSDK does this).
- Install the compiler, put its bin directory on your PATH
- Install Open C/C++ over the SDK
- `cd SDL-s60v3\symbian`; `bldmake bldfiles`; `abld build gcce`
This installs the resulting files *into the SDK tree* (eek).
- cd LittleGPTracker\projects; make
Assuming the platform is set to S60, this should give you `lgpt.sis` which you can install.

### Notes
There is a "make run" target which will use `runonphone.exe` (available in the QtSDK, amongst other places). You need the App TRK installed and running on your phone.

I had to patch a few bits of the FP1 SDK to get the compiler to work!
Notably, I had to replace macros defining `va_list`, `va_start`, `va_end` etc. using `__builtin_va_{list,start,end}`.

If you use a newer SDK than your phone you might get lucky, or you might not. The FP2/QtSDK built the project nicely, but it refused to run on my phone with "Feature not supported".

There's a debugger `fdb` in the FShell project at http://fshell.sf.net which can give you stack traces; use `fdb -m e:\` to point it at `lgpt.exe.map` with all the symbols.
5 changes: 5 additions & 0 deletions projects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lgpt.mmp
lgpt.GCCE
lgpt.mif
lgpt.sis
lgpt.mbm
26 changes: 24 additions & 2 deletions projects/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
.SUFFIXES:
#---------------------------------------------------------------------------------

PLATFORM:= RASPI
PLATFORM:= S60

include $(PWD)/Makefile.$(PLATFORM)
include Makefile.$(PLATFORM)

#---------------------------------------------------------------------------------
# options for FXE
Expand Down Expand Up @@ -179,6 +179,15 @@ COMMONDIRS := ../sources/System/Console \
../sources/Externals/Soundfont \
../sources/Externals/TinyXML

S60DIRS := ../sources/Adapters/Unix/FileSystem \
../sources/System/Process \
../sources/Adapters/Dummy/Midi \
../sources/Adapters/Unix/Process \
../sources/Adapters/SDL/GUI \
../sources/Adapters/SDL/Timer \
../sources/Adapters/S60/System \
../sources/Adapters/S60

#---------------------------------------------------------------------------------
# files definition
#---------------------------------------------------------------------------------
Expand Down Expand Up @@ -299,6 +308,19 @@ GP2XFILES := GPSDLMain.o \
SDLTimer.o \
GUIFactory.o SDLEventManager.o SDLGUIWindowImp.o

S60FILES := UnixFileSystem.o \
DummyMidi.o \
S60Audio.o \
S60AudioDriver.o \
Process.o \
UnixProcess.o \
SDLTimer.o \
GUIFactory.o \
SDLEventManager.o \
SDLGUIWindowImp.o \
S60Main.o \
S60System.o

CAANOOFILES := CAANOOSDLMain.o \
UnixFileSystem.o \
CAANOOMidiService.o \
Expand Down
39 changes: 39 additions & 0 deletions projects/Makefile.S60
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
PWD = ${shell pwd}

ICONSRC = ..\sources\Resources\lgpt_icon.svg

all: lgpt.sis

run: lgpt.sis
runonphone -s lgpt.sis lgpt.exe

lgpt.sis: $(EPOCROOT)/epoc32/build/$(PWD)/lgpt/gcce/urel/lgpt.exe lgpt.pkg lgpt.mif
makesis "-d$(EPOCROOT)" lgpt.pkg

$(EPOCROOT)/epoc32/build/$(PWD)/lgpt/gcce/urel/lgpt.exe: lgpt.gcce $(SRCS) $(EPOCROOT)/epoc32/release/armv5/urel/sdl.lib
+make -f lgpt.gcce UREL

lgpt.mif: $(ICONSRC)
mifconv lgpt.mif $(ICONSRC)

lgpt.mmp: s60/mmpheader
+perl s60/makemmp.pl "$(OFILES)" "$(SOURCES)" $< > $@

lgpt.gcce: lgpt.mmp
bldmake bldfiles
makmake lgpt.mmp gcce

clean: clean-S60

clean-S60: lgpt.gcce
make -f lgpt.gcce CLEAN
del lgpt.gcce
del lgpt.mmp
del lgpt.mif
del lgpt.sis

mrproper: clean
rm -rf $(EPOCROOT)/epoc32/build$(PWD)

$(EPOCROOT)/epoc32/build/$(PWD)/gcce.make: bld.inf lgpt.mmp
bldmake bldfiles
2 changes: 2 additions & 0 deletions projects/bld.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prj_mmpfiles
lgpt.mmp
36 changes: 36 additions & 0 deletions projects/lgpt.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
&EN

; standard SIS file header
#{"LGPT"},(0xA0102034),1,0,0

;Localised Vendor name
%{"Vendor-EN"}

;Unique Vendor name
:"Vendor"

[0x101F7961], 0, 0, 0, {"S60v3"}
[0x1028315F], 0, 0, 0, {"S60v5"}

;Files to install
"\epoc32\release\gcce\urel\lgpt.exe" - "!:\sys\bin\lgpt.exe"
"\epoc32\data\z\private\10003a3f\import\apps\lgpt.rsc" - "!:\private\10003a3f\import\apps\lgpt.rsc"
"\epoc32\data\z\resource\apps\lgpt_loc.rsc" - "!:\resource\apps\lgpt_loc.rsc"
"lgpt.mif" - "!:\resource\apps\lgpt.mif"

; For getting meaningful stacktraces with fdb from FShell
"\epoc32\release\gcce\urel\lgpt.exe.map" - "e:\lgpt.exe.map"

; Demo song include
"lgpt10k\samples\tunedbell.wav" - "c:\data\lgpt\lgpt10k\samples\tunedbell.wav"
"lgpt10k\samples\triangle.wav" - "c:\data\lgpt\lgpt10k\samples\triangle.wav"
"lgpt10k\samples\square.wav" - "c:\data\lgpt\lgpt10k\samples\square.wav"
"lgpt10k\samples\Snaredrum.wav" - "c:\data\lgpt\lgpt10k\samples\Snaredrum.wav"
"lgpt10k\samples\sinus.wav" - "c:\data\lgpt\lgpt10k\samples\sinus.wav"
"lgpt10k\samples\sawtooth.wav" - "c:\data\lgpt\lgpt10k\samples\sawtooth.wav"
"lgpt10k\samples\rezobass.wav" - "c:\data\lgpt\lgpt10k\samples\rezobass.wav"
"lgpt10k\samples\Hihat.wav" - "c:\data\lgpt\lgpt10k\samples\Hihat.wav"
"lgpt10k\samples\Downramp.wav" - "c:\data\lgpt\lgpt10k\samples\Downramp.wav"
"lgpt10k\samples\Bassdrum.wav" - "c:\data\lgpt\lgpt10k\samples\Bassdrum.wav"
"lgpt10k\samples\accordion.wav" - "c:\data\lgpt\lgpt10k\samples\accordion.wav"
"lgpt10k\lgptsav.dat" - "c:\data\lgpt\lgpt10k\lgptsav.dat"
9 changes: 9 additions & 0 deletions projects/lgpt.rss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <appinfo.rh>

UID2 KUidAppRegistrationResourceFile
UID3 0xA0102034

RESOURCE APP_REGISTRATION_INFO {
app_file="lgpt";
localisable_resource_file="\\resource\\apps\\lgpt_loc";
}
31 changes: 31 additions & 0 deletions projects/s60/makemmp.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@files = split /\s+/, $ARGV[0];
@searchdirs = split /\s+/, $ARGV[1];
map { s/\.o$// } @files;

open IN, "<$ARGV[2]" || die;
for (<IN>) { print };

for $dir (@searchdirs) {
print "userinclude $dir\n";
}

%seen = ();

for $dir (@searchdirs) {
next if $dir =~ /^\s*$/;
print "sourcepath $dir\n";
for $file (@files) {
if (-e "$dir/$file.cpp") {
print "source $file.cpp\n";
$seen{$file} = 1;
}
if (-e "$dir/$file.c") {
print "source $file.c\n";
$seen{$file} = 1;
}
}
}

for (@files) {
die "Did not find source for $_.o!" unless $seen{$_};
}
54 changes: 54 additions & 0 deletions projects/s60/mmpheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
target lgpt.exe
targettype exe
uid 0x100039ce 0xa0102034
vendorid 0

epocstacksize 0xA000
epocheapsize 0x100000 0x4000000

start resource lgpt.rss
targetpath \private\10003a3f\import\apps
end
start resource lgpt_loc.rss
targetpath \resource\apps
lang SC
end

macro SYMBIAN
macro WITH_SDL
macro WITH_ZLIB
macro WITH_PERSONAL_DIR
macro CPP_MEMORY

systeminclude \epoc32\include\stdapis
systeminclude \epoc32\include\stdapis\stlport
systeminclude \epoc32\include\stdapis\stlport\stl
systeminclude \epoc32\include\stdapis\glib-2.0
systeminclude \epoc32\include
systeminclude \epoc32\include\SDL

library libc.lib
library libm.lib
library libpthread.lib
library libstdcpp.lib
staticlibrary sdl.lib
library apgrfx.lib
library apparc.lib
library avkon.lib
library bitgdi.lib
library cone.lib
library eikcore.lib
library euser.lib
library fbscli.lib
library hal.lib
library mediaclientaudiostream.lib
library mmfdevsound.lib
library ws32.lib
library centralrepository.lib
library remconcoreapi.lib
library remconinterfacebase.lib

capability ReadUserData WriteUserData

userinclude ../sources
userinclude ../sources/System/System
31 changes: 31 additions & 0 deletions sources/Adapters/S60/S60Audio.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "S60Audio.h"
#include "S60AudioDriver.h"
#include "Services/Audio/AudioOutDriver.h"
#include "System/Console/Trace.h"

S60Audio::S60Audio(AudioSettings &settings):Audio(settings),
sampleRate_(44100)
{
}

S60Audio::~S60Audio() {
}

void S60Audio::Init() {
S60AudioDriver *drv=new S60AudioDriver(settings_) ;
AudioOutDriver *out=new AudioOutDriver(*drv) ;
Insert(out) ;
sampleRate_=drv->GetSampleRate() ;
} ;

void S60Audio::Close() {
IteratorPtr<AudioOut>it(GetIterator()) ;
for (it->Begin();!it->IsDone();it->Next()) {
AudioOut &current=it->CurrentItem() ;
current.Close() ;
}
} ;

int S60Audio::GetSampleRate() {
return sampleRate_ ;
} ;
16 changes: 16 additions & 0 deletions sources/Adapters/S60/S60Audio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef _S60AUDIO_H_
#define _S60AUDIO_H_

#include "Services/Audio/Audio.h"

class S60Audio: public Audio {
public:
S60Audio(AudioSettings &settings) ;
~S60Audio() ;
virtual void Init() ;
virtual void Close() ;
virtual int GetSampleRate() ;
private:
int sampleRate_ ;
};
#endif
Loading