87
PoGa - 4DGL Portable Game Console Reference Manual Document Date: 18 th November 2011 Document Revision: 3.0 © 2011 4D Systems www.4dsystems.com.au Page 1 of 87

PoGa - 4DGL Portable Game Console Reference Manual

Embed Size (px)

Citation preview

Page 1: PoGa - 4DGL Portable Game Console Reference Manual

PoGa - 4DGL Portable Game Console Reference Manual

Document Date: 18th November 2011 Document Revision: 3.0

© 2011 4D Systems www.4dsystems.com.au Page 1 of 87

Page 2: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Table of Contents1. What is PoGa?..........................................................................................................................32. System requirements (all the resources/downloads you need).................................................4

2.1 Hardware....................................................................................................................................42.2 Software ....................................................................................................................................42.3 Documents.................................................................................................................................4

3. Creating your first PoGa Program.............................................................................................53.1 Your first PoGa Program.............................................................................................................53.2 Writing your first PoGa game.....................................................................................................83.3 Writing your second PoGa game.............................................................................................103.4 Adding Graphics to your program............................................................................................123.5 Let’s add graphics to the TextTiler...........................................................................................15

4. Add Images/Animations/Videos in your game........................................................................204.1 Building GCI DEMO .................................................................................................................204.2 Building the Tiler Demo...........................................................................................................28

5. PoGa Explorer........................................................................................................................395.1 PoGa Screenshot......................................................................................................................395.2 Formatting the SD card to PoGa Format .................................................................................405.3 Adding Folders.........................................................................................................................425.4 Copying programs to the DISK.................................................................................................435.5 Deleting programs from the DISK............................................................................................43

6. Including your game into the PoGa File System.......................................................................446.1 Setting PoGa Disk.....................................................................................................................446.2 Testing the files on the PoGa Disk............................................................................................51

7. PoGa Sprite Editor..................................................................................................................527.1 Making your First Sprite...........................................................................................................537.2 Making few more Sprites.........................................................................................................63

8. Creating and controlling sprites..............................................................................................73Appendix A: PoGa File System Overview...................................................................................................76Appendix B: PoGa Schematic.....................................................................................................................80Appendix C: Software/Driver Installation Guide........................................................................................81Appendix D: Microsoft’s ‘User Account Control’ (UAC)..............................................................................85Proprietary Information.............................................................................................................87Disclaimer of Warranties & Limitation of Liability.......................................................................87

© 2011 4D Systems www.4dsystems.com.au Page 2 of 87

Page 3: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

1. What is PoGa?Playing a computer game is one thing, but have you ever wondered how these games are produced?

• Do you want to learn how to make your own computer games?

• Is it really a 'dark art' practised by gurus working in secret for large companies?

• Do you want the satisfaction of showing your friends cool games that you have created?

4D Systems would like to introduce the PoGa, a Portable Game Development console and 4DGL (4D Graphics Language), a cost effective way for you to be able to learn all about game development and programming.

PoGa incorporates a 128 x 128 pixel full colour TFT display, 'standard' game console push button layout for controlling the game flow, a small loudspeaker for sound effects, and a micro SD card for storing images and game data. It is driven by the tiny yet powerful GOLDELOX-PoGa custom graphics processor from 4D Labs. Graphics, text, image, animation and countless more features are built right inside the chip. For portability the PoGa can be powered for many hours on standard 3xAAA batteries.

The 4D Graphics language provides enough power and flexibility to make some really cool games and learn the 'art of programming' with a leisurely learning curve.

The 4D Workshop incorporates a text editor, graphics tools, and program down-loader in a neat and easy to use package.

You can have your first demo game running within minutes and then start to understand how to modify and improve existing games or use 'building blocks' of code to create your very own games!

The aim of the PoGa is to provide a highly educational game development platform, at the same time providing lots of fun designing and playing arcade quality games!

Note: The GOLDELOX-PoGa is a close variant of the GOLDELOX-GFX2 chip.

© 2011 4D Systems www.4dsystems.com.au Page 3 of 87

Page 4: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

2. System requirements (all the resources/downloads you need)

2.1 Hardware• PoGa

• 4D Programming Cable OR (uUSB-MB5 + USB extension Cable)

• Windows PC

• micro-SD memory card (2gb or above ... optional)

2.2 Software• PoGa PmmC

• 4D Workshop

◦ PmmCloader

◦ Graphics Composer

◦ Sprite Editor

◦ PoGa Explorer

• uUSB-MB5 Driver

• 4D Programming Cable Driver

2.3 Documents• PoGa-QuickStart-Guide.pdf

• PoGa-Kit-Construction-and-Assembly-Guide-revXX.pdf

• PoGa-4DGL-Portable-Game-Console-Reference-Manual-revXX.pdf

• GOLDELOX-PoGa-4DGL-Internal-Functions-revXX.pdf

• 4DGL-Programmers-Reference-Manual-revXX.pdf

Note: Refer to Appendix C for Installation Guide.

Note: mico-SD card is also referred as uSD card.

Note: You will need a separate USB A-to-miniB cable to use with the uUSB-MB5 module.

Note: The minimum size memory card you will need for the PoGa-Disk is 2Gb. To format the card and to add your games and applications you will need to use the PoGa-Explorer software tool that's included in the 4D Workshop3 IDE.

© 2011 4D Systems www.4dsystems.com.au Page 4 of 87

Page 5: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

3. Creating your first PoGa ProgramAll of the example program files used in this section can be found at ‘All Users\Shared Documents\4D Labs\PoGa Intro\’ folder (XP) or ‘Users\Public\Documents\4D Labs\PoGa Intro\’ folder (Vista and Windows 7).

3.1 Your first PoGa ProgramFire up WorkShop

Click Start, Programs, 4D Workshop 3 IDE, Workshop

Start a new Program

© 2011 4D Systems www.4dsystems.com.au Page 5 of 87

'New' Icon in the Tool bar

Page 6: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Click ‘New’ Icon or “New” in the File menu; Select ‘4DGL program’, if necessary. This will create a program with an empty shell, the 1st line is the platform type and will be filled in for you, if necessary, change this to PoGa-Goldelox by using the ‘Platform’ Combobox in the middle immediately above the editor.

Add some housekeeping code

For this first example we simply need a main function and end function.

func main()

endfunc

Add the code

func main()print("Hello world\n") ;repeat

foreverendfunc

Notice that print uses ‘standard’ C escape characters, it doesn’t really do anything here it’s just to show that it can be used.

The ‘repeat’ and ‘forever’ is just to keep the program running in an endless loop, rather than exit back to the PmmC or menu program.

Run it

If you haven’t connected your PoGa to the computer, do it now.

Select the com port using the combobox to the left of the traffic light.

© 2011 4D Systems www.4dsystems.com.au Page 6 of 87

Choose the Platform

Choose the Com Port

Page 7: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now Press F9 which will compile your program, download it to your PoGa and start running it. You could also have clicked on “Comp’nLoad” which is the same thing.

Save the program with the file name 'helloworld.4dg'

Snazzy it up

Move the cursor and insert a new line before the ‘print’ statement, type “txt_” and press Ctrl-Space, this will bring up a list of all the functions starting with “txt_”, select “txt_Height” either by positioning the cursor and pressing Enter, or by clicking with the mouse.

Keep typing until your code looks like the following.

func main() txt_Height(2); txt_Bold(ON); txt_Italic(ON); txt_MoveCursor(3, 3); txt_FGcolour(WHITE); print("Hello world\n") ; repeat foreverendfunc

Since you have used WHITE as a color you need to tell the compiler where to locate the definition of WHITE, so insert the following line after the platform statement.

#inherit "4DGL_16bitColours.fnc"

If you want to have a look inside ‘4DGL_16bitColours.fnc’, just right click the filename and select ‘Open File at Cursor’. Now press F9 again and see what is displayed this time.

You may Save As with a different name, like 'helloworld2.4dg'

© 2011 4D Systems www.4dsystems.com.au Page 7 of 87

Click Comp'nLoad button

Page 8: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

3.2 Writing your first PoGa gameStart a new Program

Click on the ‘New’ Icon again, the file type should be ‘4DGL program’, since that’s what you created last time, then click OK. The platform should be PoGa-Goldelox, since that’s what we selected last time.

We are going to write a simple target shooting game, so lets start by including the color definitions and adding some constants.

#inherit "4DGL_16bitColours.fnc"

#constant LineLen 5 // length of each crosshair line#constant BoomPause 100 // pause between each expanding circle for the kaboom function#constant TgtSize 4 // distance from centre-point to start of crosshair lines#constant Indent 20 // Indent must be >= Linelen + TgtSize so cursor stays within display area

And some global variables.

var xtgt, ytgt ; // position of the red circle (target)var xcross, ycross ; // crosshair positionvar xcrosso, ycrosso ; // old crosshair position

We’ll need some effects to be displayed when the target is hit.

// a sequence to show that we 'hit' the targetfunc kaboom() var i ; for (i := 1;i < Indent;i++) gfx_CircleFilled(xtgt, ytgt,i, RAND()); beep(i*210,BoomPause/2) ; // beep as we go pause(BoomPause) ; nextendfunc

A routine to move the crosshairs around the screen.

func writescreen() // erase old crosshairs gfx_Line(xcrosso-TgtSize-LineLen,ycrosso,xcrosso-TgtSize,ycrosso,BLACK) ; gfx_Line(xcrosso+TgtSize,ycrosso,xcrosso+TgtSize+LineLen,ycrosso,BLACK) ; gfx_Line(xcrosso,ycrosso-TgtSize-LineLen,xcrosso,ycrosso-TgtSize,BLACK) ; gfx_Line(xcrosso,ycrosso+TgtSize,xcrosso,ycrosso+TgtSize+LineLen,BLACK) ; gfx_CircleFilled(xtgt, ytgt,TgtSize-1, RED); // incase crosshairs were covering it // Write new crosshairs gfx_Line(xcross-TgtSize-LineLen,ycross,xcross-TgtSize,ycross,WHITE) ; gfx_Line(xcross+TgtSize,ycross,xcross+TgtSize+LineLen,ycross,WHITE) ; gfx_Line(xcross,ycross-TgtSize-LineLen,xcross,ycross-TgtSize,WHITE) ; gfx_Line(xcross,ycross+TgtSize,xcross,ycross+TgtSize+LineLen,WHITE) ;endfunc

Note that we erase the old crosshairs by redrawing them in BLACK before drawing the new crosshairs in white.

© 2011 4D Systems www.4dsystems.com.au Page 8 of 87

Page 9: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

And now the main function, compile and download, saving it as 'Target.4dg'.

func main()

var i, newgame;

SEED(peekB(SYSTEM_TIMER_LO)) ; newgame := 1 ; while(1) if (newgame == 1) // if this is a new game xcross := 63 ; // set crosshairs to screen centre ycross := 63 ; xcrosso := 63 ; ycrosso := 63 ; xtgt := (ABS(RAND()) % (128 - 2*Indent)) + Indent ; // make rand pos for the tgt ytgt := (ABS(RAND()) % (128 - 2*Indent)) + Indent ; gfx_Cls(); // clear the screen newgame := 0 ; // new game now set, clear newgame flag endif

writescreen() ; // update display with crosshair and target xcrosso := xcross ; // save current crosshair, needed so we can erase old position ycrosso := ycross ; while((i := joystick()) == 0) ; // read the joystick value pause(50) ; // pause a little bit, so we get autorepeat if ((i == UP) && (ycross != Indent)) // move crosshair if within bounds ycross := ycross -1 ; else if ((i == DOWN) && (ycross != 128-Indent-1)) ycross := ycross +1 ; else if ((i == RIGHT) && (xcross != 128-Indent-1)) xcross := xcross +1; else if ((i == LEFT) && (xcross != Indent)) xcross := xcross -1; else if (i == BTNB) // else see if it was the fire button beep(20,200) ; if ((xcross == xtgt) && (ycross == ytgt)) // if cross is same as the target kaboom() ; // do the kaboom sequence newgame := 1 ; // set flag so we start a new game endif endif wend // loop forever

endfunc

A snapshot of the 'Target.4dg'.

© 2011 4D Systems www.4dsystems.com.au Page 9 of 87

Page 10: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

3.3 Writing your second PoGa gameStart a new Program

Click on the ‘New’ Icon again, the file type should be ‘4DGL program’, since that’s what you created last time, then click OK. The platform should be PoGa-Goldelox, since that’s what we selected last time.

We are going to write a computer version of the classic ’15 puzzle’, so lets start by including the color definitions and adding some constants.

#inherit "4DGL_16bitColours.fnc"

#constant TileSX 32 // pixel width of each Slider#constant TileSY 32 // pixel height of each Slider#constant TileNX 4 // Number of Tiles in X direction#constant TileNY 4 // Number of Tiles in Y direction

And some initialised global variables.

var chars[16] := ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P'] ;var posn[16] := [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ;

See the program snapshot below.

© 2011 4D Systems www.4dsystems.com.au Page 10 of 87

Page 11: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

And now the main function.

func main() var i, j, xp, yp, xn, yn, newgame;

SEED(peekB(SYSTEM_TIMER_LO)) ; newgame := 1 ; while(1) if (newgame == 1) for(i := 0; i < 16; i++) // randomise sliders SWAP(&posn[i],&posn[ABS(RAND() % 16)]) ; next for(i := 0; i < TileNY; i++) // draw screen for(j := 0; j < TileNX; j++) if (posn[i*TileNY+j] == 15) gfx_RectangleFilled(j*TileSX,i*TileSY,(j+1)*TileSX-1,(i+1)*TileSY-1,BLACK); yp := i ; xp := j ; else pokeB(TEXT_XMAG,3) ; pokeB(TEXT_YMAG,3) ; gfx_MoveTo(j*TileSX, i*TileSY) ; print([CHR] chars[posn[i*TileNY+j]]); endif next next newgame := 0 ; endif yn := yp ; xn := xp ; while((i := joystick()) == 0) ; // read the joystick value pause(200) ; if ((i == UP) && (yp != 0)) // move slider if within bounds yn := yp -1 ; else if ((i == DOWN) && (yp != TileNY-1)) yn := yp +1 ; else if ((i == RIGHT) && (xp != TileNX-1)) xn := xp +1; else if ((i == LEFT) && (xp != 0)) xn := xp -1; endif if ((yn != yp) || (xn != xp)) // if sucessful move, reorder board gfx_RectangleFilled(xn*TileSX,yn*TileSY,(xn+1)*TileSX-1,(yn+1)*TileSY-1,BLACK) ; gfx_MoveTo(xp*TileSX, yp*TileSY) ; pokeB(TEXT_XMAG,3) ; pokeB(TEXT_YMAG,3) ; print([CHR] chars[posn[yn*TileNY+xn]]); SWAP(&posn[yn*TileNY+xn],&posn[yp*TileNY+xp]) ; yp := yn ; xp := xn ; endif

j := 0 ; // check for everything in correct order for(i := 0; i < 16; i++) if (i != posn[i]) j := 1 ; next if (j == 0) // yep, game over gfx_MoveTo(xp*TileSX, yp*TileSY) ; pokeB(TEXT_XMAG,3) ; pokeB(TEXT_YMAG,3) ; print([CHR] chars[15]); beep(20,1000) ; pause(1000) ; // wait for beep to end newgame := 1 ; endif wend

endfunc

Now compile and download this, saving it as TextTiler.

© 2011 4D Systems www.4dsystems.com.au Page 11 of 87

Page 12: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

3.4 Adding Graphics to your programStart Graphics Composer

Select Tools, Graphics Composer from the Workshop menu. Graphics Composer will start and begin a new graphics project.

Note: If you get a ‘User Account Control’ message when starting Graphics composer, please refer to Appendix D.

Add a graphic

Click Add on the bottom left.

Navigate to C:\Documents and Settings\All Users\Documents\4D Labs\PoGa Intro\Target-Vid\Images and add Explode-02-june.gif.

© 2011 4D Systems www.4dsystems.com.au Page 12 of 87

Page 13: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Build the graphics output

Insert an ‘empty’ uSD card into your computer, Click on the chip icon. Save the GCS as EXPLODE.

Select ‘4DGL – uSD Raw – GCI at Specified offset’ as the build type.

Select the drive you inserted the uSD card into and a sector offset of 0.

Click OK, this will convert the Explode-02-june.gif file into a video and save it to the uSD card.

© 2011 4D Systems www.4dsystems.com.au Page 13 of 87

Click the Chip icon

Page 14: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Change TARGET to include a Movie when the target is hit.

Open Target.4DG in workshop (if it isn’t still open).

Add the following code at the start of the main procedure (immediately after the vars) .

repeat pause(200); gfx_Cls(); if(media_Init()) break; // initialise and test the uSD card putstr("No Disk"); forever

Change the KaBoom function as follows.

func kaboom() beep(200,2000) ; gfx_Set(CLIPPING,ON) ; media_SetSector(0,0); media_Video(xtgt-39,ytgt-60) ;endfunc

Remove the uSD card from your computer and insert it into your PoGa.

Save this as TARGET-VID and compile and download.

Note: For an in depth treatment of Graphics composer See section 4.2.

© 2011 4D Systems www.4dsystems.com.au Page 14 of 87

Page 15: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

3.5 Let’s add graphics to the TextTilerClick on the ‘New’ Icon in Graphics composer.

Add a graphic

Click Add on the bottom left. Navigate to C:\Documents and Settings\All Users\Documents\4D Labs\PoGa Intro\15Puzzle-GFX\Images and add PoGaDog.bmp.

© 2011 4D Systems www.4dsystems.com.au Page 15 of 87

Page 16: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Modify it

Check ‘Tiled’ under ‘Image Attributes’ and change the tile width and height to 32

Build the graphics output

Insert an ‘empty’ uSD card into your computer , Click on the chip icon. Save the GCS as POGADOGTILED.

Select ‘4DGL – uSD Raw – GCI at Specified offset’ as the build type.

Select the drive you inserted the uSD card into and a sector offset of 0.

Click OK, this will convert the PoGaDog.bmp file into a video of the bitmap cut up into 32x32 tiles and save it to the uSD card.

© 2011 4D Systems www.4dsystems.com.au Page 16 of 87

Check the 'Tiled'check box

Page 17: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Modify the TextTiler program

Open TextTiler.4DG in workshop (if it isn’t still open).

Add the following code at the start of the main procedure (immediately after the vars) .

if(media_Init() == 0) // initialise and test the uSD card print("No uSD CARD\n"); while(1); endif for(i := 0; i < TileNY; i++) for(j := 0; j < TileNX; j++) media_VideoFrame(j*TileSX, i*TileSY, i*TileNY+j); next next pause(2000) ;

This shows the puzzle as it will look when complete, just in case it looks too messed up to understand when it is randomised.

Replace the Initial tile writing at line 46 (if using the sample code, or approximately line 37 if cutting and pasting from this doc).

pokeB(TEXT_XMAG,3) ; pokeB(TEXT_YMAG,3) ; gfx_MoveTo(j*TileSX, i*TileSY) ; print([CHR] chars[posn[i*TileNY+j]]);

With

media_VideoFrame(j*TileSX, i*TileSY, posn[i*TileNY+j]);

© 2011 4D Systems www.4dsystems.com.au Page 17 of 87

Page 18: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Replace the updated tile writing at line 67 (if using the sample code, or approximately line 58 if cutting and pasting from this doc). Maybe shorten here.

gfx_MoveTo(xp*TileSX, yp*TileSY) ; pokeB(TEXT_XMAG,3) ; pokeB(TEXT_YMAG,3) ; print([CHR] chars[posn[yn*TileNY+xn]]);

With,

media_VideoFrame(xp*TileSX, yp*TileSY, posn[yn*TileNY+xn]);

Replace the final tile writing at line 78 (if using the sample code, or approximately line 68 if cutting and pasting from this doc). Maybe shorten here.

gfx_MoveTo(xp*TileSX, yp*TileSY) ; pokeB(TEXT_XMAG,3) ; pokeB(TEXT_YMAG,3) ; print([CHR] chars[15]);

With,

media_VideoFrame(j*TileSX, i*TileSY, posn[i*TileNY+j]);

© 2011 4D Systems www.4dsystems.com.au Page 18 of 87

Page 19: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Remove the uSD card from your computer and insert it into your PoGa.

Save this as GFXTiler and compile and download.

Note: You can cut and paste the programs from the test boxes in this chapter or find them in the ‘All Users\Shared Documents\4D Labs\PoGa Intro\’ folder (XP) or ‘Users\Public\Documents\4D Labs\PoGa Intro\’ folder (Vista and Windows 7).

© 2011 4D Systems www.4dsystems.com.au Page 19 of 87

Page 20: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

4. Add Images/Animations/Videos in your gameUp to 256 images/movies/animations can be stored within each PoGa file space and referenced with a special index list. For each PoGa file, storage of up to 3960 sectors (2,027,520 bytes) is available and can be accessed using the SelectGCIimage function. The position of each image entry is also saved, allowing you to build an entire screen of objects using the Graphics Composer as a WYSIWYG format. The information here is a description of how this can be achieved by taking you through the steps that were taken to create the GCI file for the GCI_Demo.

4.1 Building GCI DEMO Note: The GCI_Demo.4DG example demonstrates the use of the media_SelectGCIimage function.

From the Workshop toolbar, select the Graphics composer tool.

When the graphics Composer opens, select New from the File menu. Now, navigate to the project folder and add the required bitmaps and animations to the project by holding the left shift key down while clicking on each of the file names so we select them all.

© 2011 4D Systems www.4dsystems.com.au Page 20 of 87

Page 21: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Once the required files are high-lighted, click the 'Open' button.

The images have now all been dumped into the top left corner. Note that our 'Screen Size' is still left at 240x320, and also that the '10gear.gif' will obviously be too big to fit the 128x128 screen. First we will resize the 10gear.gif image.

© 2011 4D Systems www.4dsystems.com.au Page 21 of 87

Files should now be high-lighted

Now click 'Open' to load these files

Page 22: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

In the 'Entries' list, click on '10-gear.gif and resize it.

Now adjust the width and height settings.

© 2011 4D Systems www.4dsystems.com.au Page 22 of 87

Notice that the image is brought to the front, and high-lighted with the red dashed line

Single click on 10-gear.gif to select it

TIP You can also resize the image by dragging the red rectangle

Page 23: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now change the screen size to 128 x 128.

Now drag the images to the required positions. Click once on the object to select it (object is selected when you see the red rectangle around it) then press and hold down the mouse button to drag the object to the required position. You can also select objects by clicking on the required entry in the 'Items' list box which will high-light the object, then drag it.

© 2011 4D Systems www.4dsystems.com.au Page 23 of 87

Page 24: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Notice that each object that is selected/high-lighted shows its width, height, X position and Y position. These values can be manually adjusted by typing into the relevant text boxes or micro-positioned by clicking the adjustment arrows at the right hand side of each entry box.

Once you are happy with the layout, we can now save the GC project info.

It is best to save project files in a common place, the GC FILES folder within the Workshops Resources folder.

Now click the 'Chip' icon on the toolbar so we can build the output file.

© 2011 4D Systems www.4dsystems.com.au Page 24 of 87

Click on the chip button to open the Build Output

window

'From the File menu, select 'Save As

Page 25: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Click the second radio button and navigate to the project folder.

© 2011 4D Systems www.4dsystems.com.au Page 25 of 87

First, navigate to the Workshop folder,

where we will keep all our GC

housekeeping files

Then name the file 'GCI_Demo1'

Finally, click 'Save'

Page 26: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now browse for the 4DGL project folder

Click 'Ok' to save the file, then close the Graphics Composer.

© 2011 4D Systems www.4dsystems.com.au Page 26 of 87

Click 'Ok' to save files

Destination folder now shown

Page 27: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

We have just created 2 files, GCI_Demo.DAT and GCI_Demo.GCI . The DAT file contains vital information about the GCI file. If you wish to have a quick look at the DAT file, navigate to the projects folder in the Workshop folder, right click on GCI_Demo.DAT and select notepad.

Contents of GCI_Demo.DAT

"7segOrange_18x36.gif" 0000 0000 55 91

"10-gear.gif" 001C 0000 17 40

"exclaim.bmp" 017C 0000 14 11

"info.bmp" 017E 0000 50 11

"warn.bmp" 0180 0000 86 12

Each line contains 5 entries relating to the GCI file:-

• The name of the entry

• Low word of sector offset of the image (HEX format)

• High word of sector offset of the image (HEX format)

• X position of the image (decimal format)

• Y position if the image (decimal format)

Note: The GCI_Demo1.dat and GCI_Demo1.gci files will be used for the GCI_Demo1.4DG program which will demonstrate the displaying of the 3 icons, and the gears and number will be animated. Loading and running this program will be covered later in section 6.1.

© 2011 4D Systems www.4dsystems.com.au Page 27 of 87

Page 28: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

4.2 Building the Tiler DemoThe GFXTiler.4DG game currently uses the bitmap file PoGaDog.bmp. It can be found in the ...\4Dlabs\PoGa Intro\GFXTiler\Images folder.

You may wish to change this image, so here is a description of how this can be achieved by taking you through the steps that were taken to create the tile map.

From the Workshop toolbar, select the Graphics composer tool.

When the graphics Composer opens, select New from the File menu. Now add the required bitmap file to the project.

Now add the required bitmap file to the project.

© 2011 4D Systems www.4dsystems.com.au Page 28 of 87

Page 29: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

© 2011 4D Systems www.4dsystems.com.au Page 29 of 87

Navigate to the project folder and select the

required image

Click the 'Add' button to add a

new image

Then Open the file

Page 30: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now change some of the setting as follows.

Screen should now look like this,

© 2011 4D Systems www.4dsystems.com.au Page 30 of 87

Set the Tile Width and Tile Heigh to 32

Click on 'Tiled' checkbox to

select 'tiled' mode

Change screen size to 128 x 128

Entries list shows the file we have added Image is now 128 x 128 and

has been cut into 16 tiles

Page 31: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

For this simple demo we are all done, now we save the project.

It is best to save project files in a common place, the GC FILES folder within the Workshops Resources folder.

© 2011 4D Systems www.4dsystems.com.au Page 31 of 87

First, navigate to the Workshop folder, where we will keep all our

GC housekeeping files

Then name the file 'GFXtiler'

Finally, save the GCS file as 'GFXtiler'

Page 32: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now click the 'Chip' icon on the toolbar so we can build the output file.

There are several options available, but first up, we will just make the GFXtiler.GCI and GFXtiler.DAT files in FAT format and save them in our project folder as we will be requiring them later for another demo, so click the second radio button and navigate to the project folder.

After we do this, we will then use the 'raw' mode, and load the GCI file directly to a uSD card and test the project.

© 2011 4D Systems www.4dsystems.com.au Page 32 of 87

Click on the chip button to open the Build Output

window

Select the elipses button so we can navigate to the

destination folder

Select the second option so we can navigate to our 4DGL project folder and

save the files

Page 33: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now browse for the 4DGL project folder.

Then click 'Ok' to save the GCI and DAT files in the 4DGL project folder.

© 2011 4D Systems www.4dsystems.com.au Page 33 of 87

Then click 'Ok' to select the folder

Destination folder now shown

Click 'Ok' to save files

Navigate to the GFXtiler folder where our 4DGL source code is stored

Page 34: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

GFXtiler.GCI and GFXtiler.DAT have now been successfully saved to the project folder.

We will use these later for the PoGaExplorer demonstration where we will be using a menu program to select files stored on a PoGa disk, but for now, we will download the GCI file as raw binary to a uSD card at sector 0 so we can test out the GFXTiler.4DG program.

Place a uSD card in a SD card slot on the PC. Click on the 'Chip' button again.

Select the required format, and the correct drive letter.

© 2011 4D Systems www.4dsystems.com.au Page 34 of 87

Select uSD 'RAW' mode

Select the correct drive letter

Set the Sector Offset to zero

Then click the 'Ok' button

Page 35: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

If the uSD card contains a valid file format, you will get a warning that you are about to destroy it's formatting – remember, we are just saving 'raw' data to the card for this test which will over-write any previous file system!

You may briefly see a progress bar while the uSD card is being written.

We are now finished with the Graphics composer, so you may now close it.

© 2011 4D Systems www.4dsystems.com.au Page 35 of 87

Answer 'Yes' if you agree to over-write the uSD card

Page 36: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Lets test our work so far, it's time to open the Workshop.

Navigate the the GFXTiler.4DG program and open it.

© 2011 4D Systems www.4dsystems.com.au Page 36 of 87

Select 'File Open'

Page 37: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Insert the uSD card we just programmed into the PoGa, connect the USB cable, and turn on the PoGa. Click on the com port drop down, and select the port that PoGa is connected to.

Now click on the RED traffic light to establish the connection with the PoGa. It should turn BLUE. Move the mouse cursor away for a moment then hover back over the BLUE traffic light. You should see the platform information, and the capacity of the uSD card you are using. If all is ok, we are ready to program the PoGa.

© 2011 4D Systems www.4dsystems.com.au Page 37 of 87

Page 38: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Click the 'Comp'n'Load” button (Compile and Load).

The information panel should now show the compiler information info, and the 'download successful' message.

Also, the PoGa should be running the program!

© 2011 4D Systems www.4dsystems.com.au Page 38 of 87

Page 39: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

5. PoGa ExplorerOpen the PoGa Explorer from the Workshop 3 menu.

Note: If you get a ‘User Account Control’ message when starting Graphics composer, please refer to Appendix D.

5.1 PoGa Screenshot

PoGa Explorer is broken up into 4 distinct areas.

Top Left

• PoGa Drives.

Top Right

• PoGa File contents and description within current category (a category is a PoGa Folder).

Bottom Left

• PC's folder navigation.

• Note - not the same as explorer, you need to click on folder to see if it has sub folders.

Bottom Right

• PoGa Files Panel - files applicable to PoGa Explorer may be dragged from this panel, from here you can drag various items into the PoGa file.

© 2011 4D Systems www.4dsystems.com.au Page 39 of 87

Page 40: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

PoGa Explorer makes extensive use of drag and drop tecniques - a brief explanation of things that can be dragged.

• Drag and drop to PoGa files panel to copy .4xe files.

• Drag and drop onto file in PoGa files panel to insert graphics into PoGa file.

• Drag and drop to PoGa files panel to restore .PoGa Image files.

• Drag and drop to PoGa drives panel to insert graphics into Common Storage Area (CSA).

• Drag and drop to PoGa drives panel to create / replace PoGa drive with contents of .PoGa Image file.

5.2 Formatting the SD card to PoGa Format Plug in the uSD card in to your PC. Select the required drive by right clicking on the drive name.

© 2011 4D Systems www.4dsystems.com.au Page 40 of 87

Page 41: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Click on 'format' to format the drive, erasing any previous formats or data.

If the drive already has eg a FAT format, you will get the following warning message.

Click OK to continue and the formatting will start.

© 2011 4D Systems www.4dsystems.com.au Page 41 of 87

Page 42: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

When the formatting is complete, note the the drive icon changes to the PoGa Icon indicating success.

5.3 Adding FoldersYou can make folders in the PoGa formatted Disk..

Right click on the PoGa Disk extension and click “New PoGa category”. Write the folder name and press OK.

© 2011 4D Systems www.4dsystems.com.au Page 42 of 87

Page 43: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

5.4 Copying programs to the DISKBrowse for the 4XE files. Drag it from the bottom right window and drop it in to the top right space.

5.5 Deleting programs from the DISKRight click on the file and click Delete.

© 2011 4D Systems www.4dsystems.com.au Page 43 of 87

Page 44: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

6. Including your game into the PoGa File System

6.1 Setting PoGa DiskFormat the uSD card using PoGa explorer to PoGa File format, when completed, the drive icon will change to the PoGa Icon indicating success.

Note: PoGa Disk structure details are in Appendix A.

Now right click on the PoGa drive to activate the file menu, then right (or left) click on “New Poga Entry” to create a PoGa folder.

Now enter the Category name for the folder as “Demo's”.

© 2011 4D Systems www.4dsystems.com.au Page 44 of 87

Page 45: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

We can now start importing some files to the “Demo's “ folder. First. Navigate to the 4D Labs project folder using the directory tree in the left pane.

Open the GCI_Demo1 folder by double clicking on it, then click and hold down the left mouse button over the GCI_Demo1.4XE file, and drag it to the top pane, finally releasing the mouse button.

© 2011 4D Systems www.4dsystems.com.au Page 45 of 87

Page 46: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now we need to add the graphics file associated with the GCI_Demo1.4XE file, so double click on the Images folder to open it, and drag the GCI_Demo1.GCI file (the same way as you dragged the GCI_Demo1.4XE file) and drop it on top of the GCI_Demo1.4XE file.

A progress bar will be shown while the graphics data is loading to the card.

© 2011 4D Systems www.4dsystems.com.au Page 46 of 87

Page 47: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now that the graphics data is loaded, lets have a quick look at what has happened.

Right click on the GCI_Demo1 project, and select 'Properties'

Notice that our executable program, and the graphics data, is visible in the properties window – they are now together in the PoGa file entry.

Don't worry about the other blank fields at the moment, they will be explained later.

© 2011 4D Systems www.4dsystems.com.au Page 47 of 87

Page 48: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now click Ok to close the properties window.

Now go through the other project folders, dragging each file into the pane above so they are loaded into the demo folder. Ensure the you also drag the GCI file for the GFXTiler, PoGaSlot, and Target-Vid programs. Eventually, the 'Demo's' folder pane should look like this. Now just to check, right click on GFXTiler, PoGaSlot, and Target-Vid and check the properties to make sure that the associated GCI files are indeed present.

So that's it, the PoGa uSD card is now loaded. It contains 1 folder named “Demo's”, which contains 11 demo programs. Before we exit, we will now make a backup of the PoGa drive. In the bottom left hand pane, navigate back up to the PoGa Intro folder, then drag the PoGa drive down onto the bottom right pane (the

© 2011 4D Systems www.4dsystems.com.au Page 48 of 87

Page 49: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

PoGa Intro folder).

When the mouse button is released, you will be asked for a filename, name the backup, then click the 'Save' button.

© 2011 4D Systems www.4dsystems.com.au Page 49 of 87

Click and hold while dragging...

Drag down to here below the

other folders, then release mouse

button

Page 50: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

The entire drive is now compressed and backed up. In the future, if you wish to restore a drive, or email it to a friend etc., simply format another card, and drag the backup from wherever it is stored onto the drive letter in the top left pane – its that easy!

We have now finished with the PoGa Explorer so close it.

© 2011 4D Systems www.4dsystems.com.au Page 50 of 87

Page 51: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

6.2 Testing the files on the PoGa DiskIts now time to test the files on the PoGa hardware.

Before we can make anything happen, we must download the menu program to the PoGa. Remove the uSD card from the PC, and place it in the PoGa so we are ready. Open the 4D Workshop, and open the file named menu2.4DG.

Click on the com port drop down, and select the port that PoGa is connected to. Ensure that a connection has been established, the traffic light should be BLUE.

Then click on the “Comp'n'Download” button. The menu program should now be running.

Now navigate with the PoGa up and down buttons to select the GCI_Tiler demo. And press the fire button. You should see the program running. Press 'FIRE' again to exit the program and return to the main menu.

Now you can go through and check the other programs. Note that some of the simpler demo programs don't have any exit method, and it is necessary to power cycle (with the on/off switch) to return to the main menu.

© 2011 4D Systems www.4dsystems.com.au Page 51 of 87

Page 52: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

7. PoGa Sprite Editor'Sprite' was a term that sprung up in the mid 1970's for a method of rendering a number of lines on a video screen with an image (scan line rendering).

PoGa is equipped with a sprite generator that is capable of rendering blocks of up to 16 pixels wide and 16 pixels high (sprite tiles) in up to 4 simultaneous colours. The sprite generator is also capable of 'transparency' where one of the 4 colours can be nominated as a transparent colour, ie. The nominated colour will not be written to the screen leaving the underlying pixel that was already present on the screen undisturbed. This allows sprites to overlay each other without completely writing over the top of an underlying image. Sprites can also be rotated and mirrored with ease.

A sprite can also have multiple palettes associated with it, allowing for what is known as 'colour cycling' to achieve interesting visual effects by cycling (shifting) the color palette.

Also, the txt_Width() and txt_Height() shared functions may be used to magnify the sprite.

Although sprite bitmaps can be generated by manually entering data into the program, a tool is provided (PoGa Sprite Editor) that allows you to easily 'draw' sprites and create the required data statements in a file that may be included in your main program file as a resource. This file can then be loaded up into the Sprite Editor at any time to make simple modifications or additions.

There are 3 parts to a sprite set which are automatically named by the Sprite Editor,

“sprites” (the bitmaps ) Each sprite bitmap consists of a matrix of bit pairs, each pair of bits selects one of 4 colours from a palette.

“colors” (the colour lookup table or CLUT used by the palettes) A list of all the colours required by the sprite palettes.

“palette” (the palettes used to hold the 4 colour sets for the sprites) Each palette holds 4 colours (selected from the CLUT) to be used by a sprite. Any palette can be used with any sprite.

Example of a typical sprite bitmap.

© 2011 4D Systems www.4dsystems.com.au Page 52 of 87

Each pixel is represented by 2 bits in the sprite

bitmap

If BLACK is nominated as the 'transparent' colour, the BLACK pixels will not be

displayed

Page 53: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Note that the sprite is always represented within a 16x16 pixel block. The sprite can be smaller than 16x16 by nominating one of the colours to be a 'transparent' colour which will stop that colour being written to the screen. In the case of the cherry example, if the 'black' background is nominated as the 'transparent' colour it will not be drawn, so only the red, green and white pixels will be written to the screen allowing it to overlay other images. Another thing to note, the cherry is centred, allowing rotation or mirroring without the image shifting from its central position.

We will now jump right in the deep end and create the cherry sprite using the Sprite Editor, and write a simple program in 4DGL to display it. The explanation of how it all works will unfold as you go.

7.1 Making your First SpriteFirst, from the Workshop tool bar, open the Sprite Editor.

Start a new file.

© 2011 4D Systems www.4dsystems.com.au Page 53 of 87

Page 54: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

First thing we need to do is create a palette entry for our cherry so we have the correct colours to draw with so insert a palette into the “Palettes” list by clicking the “Insert” button under the palette list.

Now name the palette entry and select the required colours. Note that the default colours are already almost what we need, we only have to change BLUE to WHITE for this entry.

© 2011 4D Systems www.4dsystems.com.au Page 54 of 87

Click “Insert” to create a new palette entry

New palette entry now in list

2] select the last entry, we need to change its colour

1] change the palette entry name 3] select WHITE for the last palette colour

(note that the entry name has now changed)

Page 55: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now we need to make a bitmap entry so we can start drawing.

Notice that the Sprite Editor gives you 2 copies of the palette colours, one for the left mouse button, and one for the right mouse button. This allows you to select the 2 dominant colours for the palette to facilitate fast drawing with both mouse buttons.

Start drawing the image, note that RED is selected for the left button, and GREEN is selected for the right button to make it easier to draw. If yo make a mistake and put a pixel in the wrong place, just select BLACK for the left button colour, click on it to make it BLACK, then switch back to the required colour. Note also that our GREEN is not all that bright, we'll fix that up a bit later.

© 2011 4D Systems www.4dsystems.com.au Page 55 of 87

Click “Insert” to create a new sprite entry

Page 56: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Continue to draw the rest of the pixels to complete the sprite. The green is a bit dull, so we will change it to LIME. Click in the GREEN radio button, scroll down in the “Standard colors” list, and select LIME.

That looks a lot better. Now name the sprite entry, call it Cherry, same as the palette name which is quite ok.

© 2011 4D Systems www.4dsystems.com.au Page 56 of 87

Type the new name here for the sprite -

Cherry

Page 57: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now we will save the sprite, from the file menu, select “Save As”.

Navigate to the 4D Workshop folder where we will be saving the file, and name it “demo.inc”.

You can now close the PoGa Sprite Editor.

Navigate to the 4D Workshop folder where the Demo.inc file has been stored, and open it with your favourite text editor. Note that the PoGa Sprite Editor has created all the components we need and formatted them into data statements. It has also created some handy constants that we can use to refer to the various parts by name.

Note that the 3 parts of the sprite set have been automatically pre-pended with the name of the file “demo.inc”.

demo_sprites the bitmap pixel pairs for the sprites

demo_colours the colour lookup table (CLUT) for the sprite(s)

demo_palette the list of palettes for the sprites

© 2011 4D Systems www.4dsystems.com.au Page 57 of 87

Page 58: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

© 2011 4D Systems www.4dsystems.com.au Page 58 of 87

#DATA word demo_sprites//1) Cherry 0x0000,0x0000, // line 1 0x0000,0x0000, // line 2 0x0000,0x0A00, // line 3 22 0x0000,0x0AA0, // line 4 2222 0x0000,0x008A, // line 5 22 2 0x8000,0x0080, // line 6 2 2 0x2540,0x0020, // line 7 1112 2 0x5950,0x0008, // line 8 111211 2 0x1550,0x0059, // line 9 11111 1211 0x45D0,0x0159, // line 10 1311 112111 0x4750,0x0155, // line 11 1131 111111 0x4540,0x0157, // line 12 111 131111 0x4000,0x015D, // line 13 113111 0x0000,0x0055, // line 14 1111 0x0000,0x0000, // line 15 0x0000,0x0000 // line 16 #END#CONST S_Cherry#END#DATA word demo_colors BLACK, RED, LIME, WHITE#END#DATA byte demo_palette 0,1,2,3 // BLACK, RED, LIME, WHITE (Cherry)#END#CONST P_Cherry#END

32 words defining the sprite image pixel pairs for the Cherry image

A constant we can use to refer the Cherry sprite

A list of all the colours used in this sprite file

A list of all the palettes used in this sprite file

A constant we can use to refer the Cherry palette

Page 59: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

We will now create a simple 4DGL program to display the cherry sprite.

Open the 4D Workshop, start a new file.

Select the new file to be a 4DGL program file.

Type the following code into the editor.

#inherit "4DGL_16bitColours.fnc" // we need the colour list for the sprites CLUT

#inherit "Demo.inc" // inherit the demo sprite bitmaps

func main()

// first, set the pointers for the sprite generator

gfx_SpriteSet(demo_sprites, demo_colors, demo_palette);

// display the cherry sprite at 50,50

gfx_BlitSprite(S_Cherry, P_Cherry, 56, 10, NORTH);

repeat forever // stop

endfunc

© 2011 4D Systems www.4dsystems.com.au Page 59 of 87

Page 60: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now navigate to the folder where we put the sprite file, and save it as “Sprite_Demo0.4dg”.

Connect the PoGa to the PC and establish a connection with the com port selection box.

© 2011 4D Systems www.4dsystems.com.au Page 60 of 87

Page 61: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Then click the “Comp'n'Load” button, and if all is well you should see the following in the Workshop information panel, and you should see the sprite displayed on the PoGa.

Now alter the program to the following by adding the lines marked in red, this will demonstrate the transparent effect.

Make the changes then click the “Comp'n'load” button.

© 2011 4D Systems www.4dsystems.com.au Page 61 of 87

#platform "PoGa-GOLDELOX"

#inherit "4DGL_16bitColours.fnc" // we need to colour list for the sprites CLUT#inherit "Demo.inc" // inherit the demo sprite bitmaps

func main() gfx_RectangleFilled(0,0,127,40,DARKGRAY); // set a background colour gfx_SpriteSet(demo_sprites, demo_colors, demo_palette); // pointers for the sprite generator

gfx_BlitSprite(S_Cherry, P_Cherry, 56, 10, NORTH); // display the cherry sprite at 56,50 gfx_TransparentColour(BLACK); gfx_Transparency(ON); gfx_BlitSprite(S_Cherry, P_Cherry, 86, 10, NORTH); // display at 86,50, transparently

repeat foreverendfunc

Page 62: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

And finally, alter the program again to demonstrate rotation and magnification.

Please refer to the sprite_Demo2 doc for further information on controlling multiple sprites.

A lot of information can also be gleaned from the invaders.4DG program and associated sprite file.

© 2011 4D Systems www.4dsystems.com.au Page 62 of 87

#platform "PoGa-GOLDELOX"

#inherit "4DGL_16bitColours.fnc" // we need to colour list for the sprites CLUT#inherit "Demo.inc" // inherit the demo sprite bitmaps

func main() gfx_RectangleFilled(0,0,127,40,DARKGRAY); // set a background colour gfx_SpriteSet(demo_sprites, demo_colors, demo_palette); // pointers for the sprite generator

gfx_BlitSprite(S_Cherry, P_Cherry, 56, 10, NORTH); // display the cherry sprite at 56,50 gfx_TransparentColour(BLACK); gfx_Transparency(ON); gfx_BlitSprite(S_Cherry, P_Cherry, 86, 10, NORTH); // display at 86,50, transparently

var n, x, y:=42; for(n:=0; n<8; n++) gfx_BlitSprite(S_Cherry, P_Cherry, x, y, n); // display using all 8 orientations x+=16; next var xm:=1, ym:=1; x:=0; y:=62; for(n:=0; n<3; n++) txt_Width(xm); txt_Height(ym); // set sprite magnification gfx_BlitSprite(S_Cherry, P_Cherry, x, y, NORTH); // display in 3 sizes xm++; ym++; x+=16*xm; next repeat foreverendfunc

Page 63: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

7.2 Making few more SpritesNow that you have been shown how to make a single sprite, and display it on the screen in various ways. We will now add a few more sprites to the original work, and show how to animate them. First we will make a copy of the work we last did. The easiest way to do this is to open the Sprite Editor, open the last file we made (“demo.inc”) , then save a copy with a different name, then close it.

First, from the Workshop tool bar, open the Sprite Editor, Load up the last demo we did - “demo.inc”.

Now save the first demo with a different name. Name it “AnimationDemo”.

© 2011 4D Systems www.4dsystems.com.au Page 63 of 87

Page 64: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now close the Sprite Editor, we have finished with it for the moment.

We are going to take a bit of a shortcut, and show how to cut and paste some other sprites from another project into the AnimationDemo.inc file.

Open the Workshop, open the file ...\4DLabs\PoGa Intro\Sprite_Demo0\demoAnimation.inc.

(the file we just saved). We are going to cheat a little here, and copy and paste a few sprite entries from another file into our new demoAnimation.inc then feed it back to the Sprite Editor (so we don't have to bother entering all the pixel information manually).

© 2011 4D Systems www.4dsystems.com.au Page 64 of 87

Page 65: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now also open the file ...\4DLabs\PoGa Intro\ Sprite_Demo2\Demo2.inc .

Now from the Demo2.inc file, copy lines 190 to 223 to the clipboard .Drag mouse with left button down over the area we wish to copy, releasing left button at end of copy region, then right click and select 'copy'.

© 2011 4D Systems www.4dsystems.com.au Page 65 of 87

Page 66: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now go to the demoAnimation.inc file by clicking its tab.

Here is our current file, showing the position we are going to paste to. Left click at this point.

Now right click and select 'Paste' to paste the code.

© 2011 4D Systems www.4dsystems.com.au Page 66 of 87

We are going to paste HERE

Page 67: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Make sure that the #END statement ended up on a line by itself. (should be on line 54).

Now, save the file.

Now its time to open the Sprite Editor again, and make some final modifications.

© 2011 4D Systems www.4dsystems.com.au Page 67 of 87

Page 68: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

From the Workshop 3 toolbar, open the Sprite Editor.

Open the file ...\4DLabs\PoGa Intro\ Sprite_Demo2\Demo2.inc again.

Now we have the extra 2 sprites that we copied.

Note that we only have the single palette which was intended for the cherry. Let's make the ghost look a bit different, then we will make some code to animate him.

© 2011 4D Systems www.4dsystems.com.au Page 68 of 87

Page 69: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Click the palette insert button to create a new (default) palette, name the palette, then move the cherry palette back up (or the Ghost palette down) so things are in a logical order. Also, change the palette colours, you can have any colours you want, but keep the background BLACK.

The window should now be looking a bit like this.

© 2011 4D Systems www.4dsystems.com.au Page 69 of 87

Click insert to create a new palette

Name the palette Ghost1

Move new palette down

Change the colours

Page 70: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Note that you can select either palette, and any of the images to view them. Note also the reason for 2 ghosts shown slightly differently is so we can make him look like he is walking when we do the animation code. When you are happy, save the file – and close the Sprite Editor.

Now we are going to write some code to animate our ghost. Go back to the Workshop and open the old example 'Sprite_Demo0.4dg' . We are going to use this as a bit of a template as its easier than starting from scratch, so save it as 'Sprite_Ghost'. The Workshop should now look a bit like this.

Change the prefix names for the gfx_SpriteSet arguments from demo_xxx to demoanimation_xxx.

Its a good time to mention that the sprite bitmap file is best having a short descriptive name - demoanimation was not a particularly good name in hindsight!

© 2011 4D Systems www.4dsystems.com.au Page 70 of 87

First thing to do, change the name here to 'demoAnimation.inc'

Change the demo_ prefix's to demoanimation_

Page 71: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Now also add these 2 lines after line15 so we can at least just display them and take a look.

Now hit the 'Comp'n'Load' button and test the code, you should see the 4 ghosts.

Now, as a final touch, we will make a ghost 'walk'. Add the following code, then download it.

The method used for the demo is not a particularly efficient way of doing this, but its done this way so it's easy to understand what's going on.

Note: Please refer to the other Sprite demo's and games for further ideas on sprite manipulation.

Note: The code for this demo is also saved as SpriteGhostDemo.4DG.

© 2011 4D Systems www.4dsystems.com.au Page 71 of 87

Page 72: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Final editable version of SpriteGhostDemo.4DG source code.

#platform "PoGa-GOLDELOX"

#inherit "4DGL_16bitColours.fnc" // we need to colour list for the sprites CLUT#inherit "demoAnimation.inc" // inherit the demo sprite bitmaps

func main() gfx_RectangleFilled(0,0,127,40,DARKGRAY); // set a background colour

gfx_SpriteSet(demoanimation_sprites, demoanimation_colors, demoanimation_palette); // first, set the pointers for the sprite generator

gfx_BlitSprite(S_Cherry, P_Cherry, 56, 10, NORTH); // display the cherry sprite at 56,50 gfx_TransparentColour(BLACK); gfx_Transparency(ON);

gfx_BlitSprite(S_Cherry, P_Cherry, 86, 10, NORTH); // display the cherry sprite at 86,50, transparently

gfx_BlitSprite(S_11_ghost_rightleft_1, P_Ghost1, 10, 100, NORTH); // display the ghost, looking right gfx_BlitSprite(S_12_ghost_rightleft_2, P_Ghost1, 30, 100, NORTH); // display the ghost, looking right gfx_BlitSprite(S_11_ghost_rightleft_1, P_Ghost1, 50, 100, NORTH_MIRRORED);// display the ghost, looking left gfx_BlitSprite(S_12_ghost_rightleft_2, P_Ghost1, 70, 100, NORTH_MIRRORED);// display the ghost, looking left

var x, y; gfx_Transparency(OFF); // transparency off so the black surround of the spright blanks its trail x := 10; y := 70;

repeat // walk right repeat gfx_BlitSprite(S_11_ghost_rightleft_1, P_Ghost1, x, y, NORTH); // display the ghost, looking right pause(40); gfx_BlitSprite(S_12_ghost_rightleft_2, P_Ghost1, x, y, NORTH); // display the ghost, looking right pause(40); x++; until(x>=100); // walk left repeat gfx_BlitSprite(S_11_ghost_rightleft_1, P_Ghost1, x, y, NORTH_MIRRORED); // display the ghost, looking left pause(40); gfx_BlitSprite(S_12_ghost_rightleft_2, P_Ghost1, x, y, NORTH_MIRRORED); // display the ghost, looking left pause(40); x--; until(x<=10);

forever

repeat foreverendfunc

© 2011 4D Systems www.4dsystems.com.au Page 72 of 87

Page 73: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

8. Creating and controlling sprites

#platform "PoGa-GOLDELOX"// PoGa Sprite Demo

#inherit "4DGL_16bitColours.fnc"

// There are 2 functions associated with sprites:-

// 1]//func gfx_SpriteSet("bitmaps", "colours", "palette"), 0;// Syntax : gfx_SpriteSet("bitmaps", "colours", "palettes");// Usage : gfx_SpriteSet(mysprites, colours, mypalete);// Notes : 3 sets of data are required by the sprite generator,// : this function sets the internal pointers for the 3 parts.// : 1] the bitmaps for the sprites,// : 2] the colour lookup table (CLUT),// : 3] the 4 colour palettes.

// 2]//func gfx_BlitSprite("spritenumber", "palette", "xpos", "ypos", "orientation"), 0;// Syntax : gfx_BlitSprite("spritenumber", "palette", "xpos", "ypos", "orientation");// Usage : gfx_BlitSprite(1,2,10,10,SOUTH); // example show a cherry upside down using

// the third palette of mypalette// Notes : Places the required sprite bitmap at the origin xpos, ypos using the required 4 colour palette.// : orientation determines in which direction the sprite will be displayed.

// sprite bitmap format:-// Example sprite data, only 2 entry shown for clarity (128 max available)// Each sprite is 32 words long.// The first word (and subsequend even words) are pixel 1-8 of the line.// The second word (and subsequent odd words) are pixels 9-16 of the line.// The most significant pixel pair is the leftmost pixel.// The least significant pixel pair is the rightmost pixel.// Each pixel pair selects 1 of 4 colours from the selected pallette// Each palette has one of 4 colours that are 'wired' to the CLUT (colour lookup table).// Each sprite can be displayed with a different palette, allowing colour cycling// and other special effects.

// part 1] the bitmaps for the sprites#DATA word mysprites// 1) a box with a '+' in the middle 0xFFFF,0xFFFF, // line 1 3333333333333333 0x0003,0xC000, // line 2 3 3 0x0003,0xC000, // line 3 3 3 0x0003,0xC000, // line 4 3 3 0x4003,0xC001, // line 5 3 11 3 0x4003,0xC001, // line 6 3 11 3 0x4003,0xC001, // line 7 3 11 3 0x5503,0xC055, // line 8 3 1111111111 3 0x5503,0xC055, // line 9 3 1111111111 3 0x4003,0xC001, // line 10 3 11 3 0x4003,0xC001, // line 11 3 11 3 0x4003,0xC001, // line 12 3 11 3 0x0003,0xC000, // line 13 3 3 0x0003,0xC000, // line 14 3 3 0x0003,0xC000, // line 15 3 3 0xFFFF,0xFFFF, // line 16 3333333333333333

© 2011 4D Systems www.4dsystems.com.au Page 73 of 87

Page 74: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

//2) cherries 0x0000,0x0000, // line 1 0x0000,0x0000, // line 2 0x0000,0x0500, // line 3 11 0x0000,0x0550, // line 4 1111 0x0000,0x0045, // line 5 11 1 0x4000,0x0040, // line 6 1 1 0x1FC0,0x0010, // line 7 3331 1 0xF7F0,0x0004, // line 8 333133 1 0x3FF0,0x00F7, // line 9 33333 3133 0xCFB0,0x03F7, // line 10 3233 331333 0xCEF0,0x03FF, // line 11 3323 333333 0xCFC0,0x03FE, // line 12 333 323333 0xC000,0x03FB, // line 13 332333 0x0000,0x00FF, // line 14 3333 0x0000,0x0000, // line 15 0x0000,0x0000, // line 16//3) ghost 0x0000,0x0000,0xA000,0x000A,0xAA00,0x00AA,0xAA80,0x02AA, 0xBEA0,0x0BEA,0xFFA0,0x0FFA,0x5FA0,0x05FA,0x5FA8,0x25FA, 0xBEA8,0x2BEA,0xAAA8,0x2AAA,0xAAA8,0x2AAA,0xAAA8,0x2AAA, 0xAAA8,0x2AAA,0x2A28,0x28A8,0x2808,0x2028,0x0000,0x0000

// ..........// more bitmaps can follow.....// .......... #END

// part 2] the colour lookup table (CLUT), with 13 example colour entries (128 max available)#DATA word mycolours BLACK, // 0 RED, // 1 BROWN, // 2 PINK, // 3 CYAN, // 4 CYAN, // 5 BLUE, // 6 LIGHTSLATEGRAY, // 7 ORANGE, // 8 YELLOW, // 9 LIME, // 10 RED, // 11 WHITE // 12#END

// part 3] the palettes, each entry may have 4 colours.// The colours are selected from the CLUT#DATA byte mypalette 0,1,0,9, // black, red, black, yellow (box) 0,9,0,1, // black, yellow, black, red (box alternate colours) 0,10,12,1, // black, lime, white, red (for strawberry) 0,6,1,12 // black, blue, red, white (for red ghost)#END

//=========================================================================func main() var xoffs, yoffs, n;

gfx_SpriteSet(mysprites, mycolours, mypalette); // set the pointers for the sprite generator

gfx_TransparentColour(BLACK); // ucan se transparent mode, black is transparency reference //gfx_Transparency(ON); //txt_Width(2); // tests that the sprite X mag works //txt_Height(2); // tests that the sprite X mag works

// now test all the screen aspects //NORTH 0

© 2011 4D Systems www.4dsystems.com.au Page 74 of 87

Page 75: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

//SOUTH 1 //WEST 2 //EAST 3 //NORTH_MIRRORED 4 //SOUTH_MIRRORED 5 //WEST_MIRRORED 6 //EAST_MIRRORED 7//repeat xoffs := 20; yoffs := 20; for(n:=0;n<8;n++) gfx_BlitSprite(1, 2, xoffs, yoffs, n); // display the cherry sprite in all 8 orientations using pallete 2 xoffs += 20; if(n==3) xoffs :=20; yoffs += 20; endif next

xoffs := 20; yoffs := 80; for(n:=0;n<8;n++) gfx_BlitSprite(2, 3, xoffs, yoffs, n); // display the ghost sprite in all 8 orientations using pallete 3 xoffs += 20; if(n==3) xoffs :=20; yoffs += 20; endif next repeat forever

endfunc

© 2011 4D Systems www.4dsystems.com.au Page 75 of 87

Page 76: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Appendix A: PoGa File System Overview

The PoGa File System is a Fixed Block Architecture (FBA) in which each addressable record on disk is of the same size requiring no 'disk operating system'. It was designed to be as simple as possible, and the position of all files is determined simply by offset.

Each 'file' consists of 4096 sectors (2097152 bytes or 2 megabytes) . There are 512 'files' consuming a little over 1gb of storage, therefore the minimum media storage capacity is 2gb. The remainder of the disk above the PoGa files is classed as a Common Storage Area (CSA) and is available for general purpose usage.

PoGa Disk Architecture

Sector offset #sectors #bytes Usage Notes

F*4096 + 0 1 512 FCB File Control Block

F*4096 + 1 55 28160 PSA Program storage area (compiled *.4DG program becomes *.4XE)

F*4096 + 56 16 8192 GCIMAP GCI image map (created with Graphics Composer, *.DAT file)

F*4096 + 72 64 32768 BIN General purpose data, user defined

F*4096 + 136 3960 2027520 GCI GCI images(created with Graphics Composer, *.GCI file)

Total 4096 2097152

© 2011 4D Systems www.4dsystems.com.au Page 76 of 87

Page 77: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

File Control Block

FCB Nomenclature

EntryWORDoffset

Entry BYTEsize

Usage

FCB_SIG 0 2 Signature 0x AA55 (valid entry), WORD

FCB_NEXT 1 2 Next entry (1 relative), or 0, WORD

FCB_PREV 2 2 Previous entry (1 relative), or 0, WORD

FCB_FIRST 3 2 First entry (1 relative), or 0, valid for first entry only, WORD

FCB_LAST 4 2 Last entry (1 relative), or 0, valid for first entry only, WORD

FCB_MENUFLAG 5 2 0, or 1 for menu program, WORD

FCB_CATEGORY 6 20 Padded with Blanks, Null terminated, STRING

FCB_FILENAME 16 20 first char 0x00 if empty, STRING

FCB_DATE 26 12 File Date, Padded with Blanks, Null terminated, STRING

FCB_TIME 32 10 File Time Padded with Blanks, Null terminated, STRING

FCB_GCI_NAME 37 20 GCI file name Padded with Blanks, Null terminated, STRING

FCB_GCI_DATE 47 12 GCI file date, Padded with Blanks, Null terminated, STRING

FCB_GCI_TIME 53 10 GCI file time, Padded with Blanks, Null terminated, STRING

FCB_PROG_SIZE 58 2 4DGL Program Size, WORD

FCB_PROG_CSUM 59 2 4DGL Program Checksum, WORD

FCB_DESC1 60 32 Reserved, padded with Blanks, Null terminated, STRING

FCB_DESC2 76 32 Reserved, padded with Blanks, Null terminated, STRING

FCB_DESC3 92 32 Reserved, padded with Blanks, Null terminated, STRING

FCB_DESC4 108 32 Reserved, padded with Blanks, Null terminated, STRING

FCB_BIN_NAME 124 20 GP data name, padded with Blanks, Null terminated, STRING

FCB_BIN_DATE 134 12 GP data date, padded with Blanks, Null terminated, STRING

FCB_BIN_TIME 140 10 GP data time, padded with Blanks, Null terminated, STRING

FCB_GCI_SIZE 145 4 GCI file size, DWORD

FCB_BIN_SIZE 147 2 GP data field size, WORD

FCB_CSA_NAME 148 20 Name of GCI loaded at CSA offset 0 (first entry only), STRING

FCB_CSA_MULTI 158 2 1 if CSA written to at other than offset 0, WORD

FCB_CSA_TOP 159 4 Highest CSA size written to since format, DWORD

FCB_RESERVED 161 190 (reserved for future additions)

TOTAL 512

© 2011 4D Systems www.4dsystems.com.au Page 77 of 87

Page 78: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Program Storage Area

PROG nomenclature sector offset Byte Size

PSA F*4096 + 1 28160

GCI Image Map

Image Map Entry Entry WORD Offset

Usage

0 0 Name, offset and position for image 0

1 16 Name, offset and position for image 1

... ... ...

254 224 Name, offset and position for image 254

255 240 Name, offset and position for image 255

Format of individual entries in the Image Map

DAT nomenclatureEntry

WORDoffset

Entry BYTEsize

Usage

IMAGE_NAME 0 20 Image name Padded with Blanks, Null terminated, STRING

IMAGE_OFFSET_HI 10 2 Relative offset to GCI image HI WORD

IMAGE_OFFSET_LO 11 2 Relative offset to GCI image LO WORD

IMAGE_XPOS 12 2 Image display position X co-ordinate

IMAGE_YPOS 13 2 Image display position Y co-ordinate

RESERVED 14 4 reserved

Total 32 (32 bytes per entry)

© 2011 4D Systems www.4dsystems.com.au Page 78 of 87

GCI image map at F*4096 + 56 (created with Graphics Composer, *.DAT file)There are up to 256 entries, Each entry is 32 bytes.

GCI image data at F*4096 + 136 (created with Graphics Composer, *.GCI file)Each image entry in the GCI storage area has the following format.

Page 79: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Single Frame Image Format

GCI nomenclature Byte offset

Usage

IMG_WIDTH_HI 0 HI byte of image width

IMG_WIDTH_LO 1 LO byte of image width

IMG_HEIGHT_HI 2 HI byte of image height

IMG_HEIGHT_LO 3 LO byte of image height

IMG_MODE 4 Mode (set to 16, fixed 16bit colour)

(not used) 5 Always set to zero for single image

Image storage (WORDS) Image size = 6 + IMG_WIDTH * IMG_HEIGHT

Next image.........

Multiple Frame (movie) Image Format

GCI nomenclature Byte offset

Usage

IMG_WIDTH_HI 0 HI byte of image width

IMG_WIDTH_LO 1 LO byte of image width

IMG_HEIGHT_HI 2 HI byte of image height

IMG_HEIGHT_LO 3 LO byte of image height

IMG_MODE 4 Mode (set to 16, fixed 16bit colour)

IMG_DELAY 5 Inter frame delay, 1-255 msec

FRAMECOUNT_HI 6 HI byte of image frame count

FRAMECOUNT_LO 7 LO byte of image frame count

Image storage (WORDS) Image size = 8 + IMG_WIDTH * IMG_HEIGHT * FRAMECOUNT

Next Image..........

© 2011 4D Systems www.4dsystems.com.au Page 79 of 87

Page 80: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Appendix B: PoGa Schematic

© 2011 4D Systems www.4dsystems.com.au Page 80 of 87

Page 81: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Appendix C: Software/Driver Installation Guide

4D WorkshopVisit 4D Workshop3 IDE Product page to download the latest 4D Workshop. It is a complete and free development platform that include Aid tools like, Graphics Composer, Sprite Editor and PmmC Loader.

Double click “Workshop3 installer.exe” file to begin installation. If you already have an older version installed, you will be asked to uninstall the existing version. Clicl Next. Follow the instruction to complete installation.

© 2011 4D Systems www.4dsystems.com.au Page 81 of 87

Page 82: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Once, installation is completed a shortcut will be created on your Desktop. Double click the icon and open the workshop. Click Tools Menu and make sure you can access the Aid tools.

The downloaded setup application will create the required 4DGL-Workshop3 folders and install all the required files. Note that in-line with current Microsoft philosophy all samples and demos are located in the ‘All Users\Shared Documents\4D Labs’ folder (XP) or ‘Users\Public\Documents\4D Labs’ folder (Vista and Windows 7).

PoGa and PoGa Intro folders contain all the PoGa relevant sample source codes.

uUSB-MB5 DriverVisit www.4dsystems.com.au to download uUSB-MB5 driver. Double click the installation file and wait for installation to finish. Now, plug in the uUSB-MB5, it should be detected by your system.

Open 4D Workshop and open any 4DGL program. Now, plug in your uUSB-MB5 in to the PC, a new com port will be detected. As soon as you unplug the uUSB-MB5 it will vanish from the combo box.

Now you are ready to communicate with the PoGa via uUSB-MB5.

© 2011 4D Systems www.4dsystems.com.au Page 82 of 87

New com Port detected

Page 83: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

PoGa PmmC Visit www.4dsystems.com.au to find the latest PoGa PmmC file if needed. Generally PoGa PmmCs are installed on the PoGa unless an upgrade is announced on the website.

The GOLDELOX, PICASO and the DIABLO are highly integrated and configurable custom processors. Their internal architectures are constructed of high level functional blocks that is controlled and supervised by EVE (Extensible Virtual Engine).

EVE is a proprietary, high performance virtual processor engine with an extensive byte-code instruction set optimised to execute compiled 4DGL programs. It is the heart of the 4D range of processors. This implementation across a variety of architectures provides a single unified platform. The same application code developed under 4DGL for the GOLDELOX can run on any other 4D custom processor such as the PICASO.

The combined blocks of EVE, the built-in graphics and system functions and the low level drivers make up and define the personality of the GOLDELOX/PICASO/DIABLO (analogy to that of a soft silicon). This is referred to as the Personality-module-micro-Code or PmmC for short. Future enhancements to the chip level configuration or any of the functional blocks can easily be accommodated with a new PmmC file which can then be uploaded and programmed into the GOLDELOX, PICASO or the DIABLO by the user.

Installing the PmmCConnect the uUSB-MB5 to the PC and the other end to the PoGa board. On the 4D Workshop3 IDE, Go to Tools Menu and click PmmC Loader to open up the PmmC Loader software tool.

© 2011 4D Systems www.4dsystems.com.au Page 83 of 87

Page 84: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Choose the Com port, locate the PoGa PmmC file downloaded from the website. Click Load.

Check the Progress bar and wait for it to complete. On the Load Status you will get a “Programming Successful” notice as soon as PmmC programming is finished. Now, close the PmmC Loader. You are ready once again to develop and download your 4DGL code on the PoGa.

© 2011 4D Systems www.4dsystems.com.au Page 84 of 87

Browse and locate the downloaded

PmmC file

Click Load

Choose the com Port.

Page 85: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Appendix D: Microsoft’s ‘User Account Control’ (UAC) One of the things that Microsoft’s ‘User Account Control’ (UAC) does to ‘protect’ your computer is to prevent programs from using direct disk access.

Both Graphics Composer and PoGa Explorer use direct disk access to manipulate the uSD card destined for PoGa..

If you have UAC turned on (the default) you will always be prompted to ‘Allow’ Graphics Composer and PoGa Explorer to run.

The only way you can prevent this message is to turn UAC off.

To turn off UAC in Vista, go to control panel, User Accounts, Turn User Account Control On or Off and uncheck the ‘Use User Account Control (UAC) to help protect your computer’ and click OK.

© 2011 4D Systems www.4dsystems.com.au Page 85 of 87

Page 86: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

To turn off UAC in Windows 7, go to Control Panel, User Accounts, System and Security, Action Center, Change User Account Settings and set the level to ‘Never Notify’ and click OK.

In both cases you will need to reboot for the changes to take effect.

© 2011 4D Systems www.4dsystems.com.au Page 86 of 87

Page 87: PoGa - 4DGL Portable Game Console Reference Manual

Portable Game Console PoGa-4DGL Reference Manual

Proprietary Information

The information contained in this document is the property of 4D Systems Pty. Ltd. and may be the subject of patents pending or granted, and must not be copied or disclosed with out prior written permission.

4D Systems endeavours to ensure that the information in this document is correct and fairly stated but does not accept liability for any error or omission. The development of 4D Systems products and services is continuous and published information may not be up to date. It is important to check the current position with 4D Systems.

All trademarks belong to their respective owners and are recognised and acknowledged.

Disclaimer of Warranties & Limitation of Liability

4D Systems makes no warranty, either express or implied with respect to any product, and specifically disclaims all other warranties, including, without limitation, warranties for merchantability, non-infringement and fitness for any particular purpose.

Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications.

In no event shall 4D Systems be liable to the buyer or to any third party for any indirect, incidental, special, consequential, punitive or exemplary damages (including without limitation lost profits, lost savings, or loss of business opportunity) arising out of or relating to any product or service provided or to be provided by 4D Systems, or the use or inability to use the same, even if 4D Systems has been advised of the possibility of such damages.

4D Systems products are not fault tolerant nor designed, manufactured or intended for use or resale as on line control equipment in hazardous environments requiring fail – safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines or weapons systems in which the failure of the product could lead directly to death, personal injury or severe physical or environmental damage (‘High Risk Activities’). 4D Systems and its suppliers specifically disclaim any expressed or implied warranty of fitness for High Risk Activities.

Use of 4D Systems’ products and devices in 'High Risk Activities' and in any other application is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold harmless 4D Systems from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any 4D Systems intellectual property rights..

Copyright 4D Systems Pty. Ltd. 2000-2011.

© 2011 4D Systems www.4dsystems.com.au Page 87 of 87