Getting started with Gizmondo

Home / Support / Tutorials / Getting Started / Getting started with Gizmondo

Required tools and SDKs

When targeting the Gizmondo device, you need Kingcdr's KGSDK for developing homebrew. The SDK contains Embedded Visual Studio 4.0, and specific headers and libraries for Gizmondo. The SDK can be obtained at the Gizmondo forums. When building with this SDK, your Gizmondo application is only able to run on Gizmondo developer units or Gizmondo devices patched with Service Pack B to run homebrew.

After downloading the SDK, unpack it to a temporary location. Install Embedded Visual studio 4.0 including service pack 4. After that, install the SDK for EVC++ which will install the header and library files for Gizmondo. To build for this device use the EDGELIB Builder tool. A tutorial on how to set up the EDGELIB Builder tool is available.

Creating a .cpp source code file

Create a new folder: C:\projects\helloworld which will contain all project files. Also create a new folder: C:\projects\helloworld\code to contain the source code. Create a new helloworld.cpp file and edit it with a text editor. Paste the following source code sample and save the sourcefile:

helloworld.cpp (89 lines)
  1. /////////////////////////////////////////////////////////////////////
  2. // Code/helloworld.cpp
  3. // One of the EDGELIB tutorial samples for Gizmondo
  4. //
  5. // Copyright (c) 2006-2017 Elements Interactive Mobile B.V.
  6. // http://www.edgelib.com
  7. //
  8. // Show "hello world" on the screen and exit by tapping the screen or
  9. // hitting a key
  10. /////////////////////////////////////////////////////////////////////
  11.  
  12.  
  13. /////////////////////////////////////////////////////////////////////
  14. // Include and link the library                                    //
  15. /////////////////////////////////////////////////////////////////////
  16.  
  17. //Include EDGELIB
  18. #include "edgemain.h"
  19.  
  20. //Link the EDGELIB static library
  21. #pragma comment(lib, "edge.lib")
  22.  
  23. //Include internal resources
  24. #include "resource.h"
  25.  
  26. /////////////////////////////////////////////////////////////////////
  27. // Class definition                                                //
  28. /////////////////////////////////////////////////////////////////////
  29.  
  30. //The main class
  31. class ClassMain : public ClassEdge
  32. {
  33.     public:
  34.         ClassMain(void);
  35.         ~ClassMain(void);
  36.         ERESULT OnDisplayConfig(EDISPLAYCONFIG *config);
  37.         ERESULT OnNextFrame(ClassEDisplay *display, unsigned long timedelta);
  38.         void OnButtonDown(unsigned long bnr, EBUTTONLIST *blist);
  39.         void OnStylusDown(POINT pnt);
  40. };
  41.  
  42.  
  43. /////////////////////////////////////////////////////////////////////
  44. // ClassMain: public                                               //
  45. /////////////////////////////////////////////////////////////////////
  46.  
  47. //ClassMain: constructor
  48. ClassMain::ClassMain(void)
  49. {
  50. }
  51.  
  52. //ClassMain: destructor
  53. ClassMain::~ClassMain(void)
  54. {
  55. }
  56.  
  57. //Configure display
  58. ERESULT ClassMain::OnDisplayConfig(EDISPLAYCONFIG *config)
  59. {
  60.     ClassEStd::StrCpy(config->caption, "Hello World!");
  61.     config->icon = IDI_MAIN;
  62.     return(E_OK);
  63. }
  64.  
  65. //Callback: Called every frame
  66. ERESULT ClassMain::OnNextFrame(ClassEDisplay *display, unsigned long timedelta)
  67. {
  68.     display->buffer.DrawFont(0, 0, &display->fontinternal, "Hello World!");
  69.     return(E_OK);
  70. }
  71.  
  72. //Callback: Called when the user pressed a key or button
  73. void ClassMain::OnButtonDown(unsigned long bnr, EBUTTONLIST *blist)
  74. {
  75.     Quit();
  76. }
  77.  
  78. //Callback: Called when the user points the stylus down or clicks the left mouse button
  79. void ClassMain::OnStylusDown(POINT pnt)
  80. {
  81.     Quit();
  82. }
  83.  
  84.  
  85. /////////////////////////////////////////////////////////////////////
  86. // The program entry point                                         //
  87. /////////////////////////////////////////////////////////////////////
  88.  
  89. ClassEdge *EdgeMain(EDGESTARTUP *data){ return(new ClassMain); }

Set up a Gizmondo EDGELIB Builder project

Open the EDGELIB Builder and select project -> new. Choose a location to save your project. Create a new folder and save it in c:\projects\helloworld\workspace_gizmondo. Click once on "untitled" in the project tree to rename it to Hello World, the name of the project. Then add helloworld.cpp to the source files folder in the project tree. Right click on this folder and select "add files to folder". Browse to helloworld.cpp and open it to add it to the project tree. Save the project file, choose "Gizmondo" as the target platform and click build -> rebuild all. The folder c:\projects\helloworld\workspace_gizmondo\release\gizmondo contains an .exe file. This file can be copied to an SD Card with a launcher program to run homebrew through the Gizmondo menu. For more information on how to run homebrew from an SD Card, check the launcher guide.

Download tutorial project

Here is a sample that can be downloaded which contains the result of this tutorial.

Getting started tutorials

Latest forum posts