From 103c5f3afc2af1f78dee397472979b08465de3f9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 11 Sep 2001 20:38:49 +0000 Subject: [PATCH] Added initial support for EPOC/Symbian OS (thanks Hannu!) --- README.Epoc | 87 ++++ docs.html | 2 + include/SDL_byteorder.h | 1 + include/SDL_main.h | 2 +- include/SDL_types.h | 5 + include/begin_code.h | 6 + src/main/Makefile.am | 8 +- src/main/epoc/SDL_main.cpp | 129 ++++++ src/thread/Makefile.am | 9 +- src/thread/epoc/SDL_sysmutex.cpp | 112 +++++ src/thread/epoc/SDL_syssem.cpp | 199 +++++++++ src/thread/epoc/SDL_systhread.cpp | 127 ++++++ src/thread/epoc/SDL_systhread_c.h | 30 ++ src/timer/Makefile.am | 8 +- src/timer/epoc/SDL_systimer.cpp | 111 +++++ src/video/Makefile.am | 2 +- src/video/SDL_sysvideo.h | 15 +- src/video/SDL_video.c | 10 +- src/video/epoc/SDL_epocevents.cpp | 418 ++++++++++++++++++ src/video/epoc/SDL_epocevents_c.h | 50 +++ src/video/epoc/SDL_epocvideo.cpp | 700 ++++++++++++++++++++++++++++++ src/video/epoc/SDL_epocvideo.h | 89 ++++ 22 files changed, 2103 insertions(+), 17 deletions(-) create mode 100644 README.Epoc create mode 100644 src/main/epoc/SDL_main.cpp create mode 100644 src/thread/epoc/SDL_sysmutex.cpp create mode 100644 src/thread/epoc/SDL_syssem.cpp create mode 100644 src/thread/epoc/SDL_systhread.cpp create mode 100644 src/thread/epoc/SDL_systhread_c.h create mode 100644 src/timer/epoc/SDL_systimer.cpp create mode 100644 src/video/epoc/SDL_epocevents.cpp create mode 100644 src/video/epoc/SDL_epocevents_c.h create mode 100644 src/video/epoc/SDL_epocvideo.cpp create mode 100644 src/video/epoc/SDL_epocvideo.h diff --git a/README.Epoc b/README.Epoc new file mode 100644 index 000000000..780e4c2ca --- /dev/null +++ b/README.Epoc @@ -0,0 +1,87 @@ +31.8.2001 HJV + +SDL for EPOC/Symbian OS +======================= + +This is an Epoc port of SDL (1.2.0). It is not yet complete, but good enough for starting to port all those wonderful SDL based demos, games and other programs to Epoc! I have tested a bunch of demos and test programs in Nokia 9210 Communicator, which is a fancy device with combined PDA/GSM phone features, Symbian OS (Crystal), a full keyboard and a color screen (640x200x12bit). + +Btw. Also SDLDoom works over SDL Epoc port now (CDoom)! + + +How to install to device +======================== + +Extract binary packets of the demo and test programs and copy the files to N9210. + + +How to use +========== + +Run exe's from the File manager. The Caps lock key enables or disables the virtual cursor. +The Esc key quits demo programs. +Function keys are mapped as follows: +- F1=chr+q, F2=chr+w,..., F8=chr+i, +- F9=chr+a,..., F12=chr+d. + +In Crystal, Exe programs do not appear in task list nor in Extras :-( + + +How to build +============ + +Building SDL, SDL_IMAGE and tests & demos: +- Build files are in "\sdl\epoc\" and "\sdl_image\epoc\" directories +- Building as usual: "bldmake bldfiles" "abld build wins udeb" "abld build armi urel" +- Test and demos programs are build: "abld test build wins udeb" "abld test build armi urel" + + +Building and sources +==================== +Information about the Epoc implementation: +- Made over SDL 1.2.0 +- Ported sources: SDL, SDL_image, xflame, fire, warp, newvox, graywin, testalpha, SDLDoom(CDoom) +- Test programs do not have any major changes: usually only screen size and depth is + changed for 9210, if needed +- Like in all the other platform implementations, the Epoc specific code is in "Epoc" subdirectories. All build files for Epoc are in the directory \sdl\epoc\. Adding a new OS support requires always some changes also in generic files (search for "#ifdef __SYMBIAN32__"). +- Currently, two resolutions and bit depths are supported: 320x200 and 640x200 with 8 or 12 bit color. +- I addition, two faked resolutions are supported: 640x400, 640x480. These are implemented by shrinking the screen vertically i.e. only every second scanline is drawn. This can be used for testing and for non-resource intensive programs. Thought, using faked resolutions is a waste of memory and cpu power! + +Change history +============== + +31.8.2001 Alpha 0.2: +- Now you should build ARMI binaries instead of THUMB. It runs faster. +- sdl_main.cpp: removed check for existing instance of sdlprogram +- sdl_error.h: Added debug macros under conditional compilation in Epoc +- sdl_epocevents.cpp: Added focus lost&gained event handling, added modifier handling, added a lot more key event handling (function keys and others). Function keys are mapped as follows: + F1=chr+q, F2=chr+w,..., F8=chr+i, F9=chr+a,..., F12=chr+d. +- sdl_epocvideo.h: Added EPOC_ScreenOffset variable. Added EPOC_IsWindowFocused variable (but not used for anything yet!). Added RedrawWindowL() function. +- sdl_epocvideo.cpp: Added debugging functions: Debug_AvailMem2() and Debug_AvailMem(). + Changed window to have white background. Centralize game screen if it is not full size. + Added RedrawWindowL() function. Force other windows to redraw if SDL window lost focus. This cleans up possible game graphics from screen. Redraw after getting focus again. + + +Todo +==== + +This Epoc port is (of course;-) not thoroughly tested. For testing, I have compiled and run a couple of test programs and demos in N9210. Still, e.g. thread related functions have not been tested at all. + +Known bugs and unimplemented features: +- No sound +- No console output screen. Printing to stdout do not have any effect. +- Epoc do not allow static/global variables in DLL libraries. So I could only use static linking with SDL. +- Some test programs may take so much cpu in 9210 that e.g. SMS sending and receiving is not possible at a same time. Also screen may look awkward if there appear visible notes, dialogs etc. when an sdl program is active. SDL program runs in the lowest possible priority for minimum interference in the system. Unfortunately, this is always not enough. Perhaps some Delay() commands are needed. + +P.s. I have ported also the SDL version of MirrorMagic puzzle game to Epoc. I will put the sources and binaries available as soon as I bother to clean the ported sources a bit... + + +Open Source & "bazaar" style software development +================================================= + +You can take part in this porting project. This is Open Source software and you are very welcome to try it, test it, improve the code and implement the missing pieces. If you have any fix suggestions, improvements, code excerpts etc., contact me by email. Please start the mail subject with a string "EPOC SDL:". + +Cheers, +Hannu + +Mail:hannu.j.viitala@mbnet.fi +Homepage of SDL for Epoc: www.mbnet.fi/~haviital diff --git a/docs.html b/docs.html index 7fbc6db50..6c75089e5 100644 --- a/docs.html +++ b/docs.html @@ -16,6 +16,8 @@

Major changes since SDL 1.0.0: