mercredi 3 octobre 2007

gpengine

Tout simplement le meilleur emulateur pour la GP32 : gpengine !
c'est un emulateur pc engine : la meilleur console 8/16 Bits de tout les temps avec des shoot em up formidables, des rpg...
http://www.gp32x.com/gpengine/

Another World

Tout simplement un des meilleur portage de jeux sur GP32 : another world.
http://www.distant-earth.co.uk/awgp32/

mercredi 12 septembre 2007

SMC GP32 Faq

SMC GP32 Faq
this is an extract from the very good : Dev'rs GP32 Dev FAQs - Last Update 2002-Mar-30


How is data stored on the SMC cards?
The gp32 supports both FAT12 & FAT16 file formats. Any standard SMC card reader for windows should work fine for reading & writing files on the SMC card. Note that file names can only be up to 8 characters in length, followed by a period, and 3 extension characters. Directory names can only be up to 8 characters long. The EMS 5in1 card reader from LikSang.com is known to work fine for gp32 SMC cards.There is also other SMC info that is read by using SMC command 0x90:The 1st ID byte identifies the manufacturer, being either Samsung (0xEC) or Toshiba (0x98).The 2nd ID byte tells you the type/size of the SMC (0x73 = 3.3V NAND 16MB / Samsung SMC)The 3rd ID byte, if it contains the value 0xA5, indicates that this SMC card contains a unique 16-byte SMC ID. Due to security reasons, Toshiba and others do not provide information for reading SMC IDs without first requiring you to sign a Non-Disclosure Agreement.

Can games access data on the SMC card?
Yes. The gp32 game development libraries treat the SMC like a disk drive in that you can read/write files and create/destroy files and directories.

Are all SMC cards basically the same?
No. Some SMC cards do not contain a unique 16 byte SMC ID and some SMC cards support 3.3 volts while others use 5 volts.The GP32 only supports 3.3 volt cards. When looking at the metallic pins of the SMC card, hold the card such that the pins are at the top of the card. If the notch on the end of the card is on the right then it is a 3.3 volt card, otherwise it is 5 volts.If you ever want to experiment with SMC ID encryption then the SMC card must contain a SMC ID. However, for all other uses the presence of an SMC ID is not required. (i.e. mp3 files, GP32 ID encryption, etc.) Some or all Toshiba SMC cards are known to contain an SMC ID. The SMC Option Code will be 0xA5 if it contains an SMC ID. GP32 games that are all made in one batch will contain the same 16 byte SMC ID code, otherwise they will be different.Due to security reasons, Toshiba and others do not provide information for reading SMC IDs without first requiring you to sign a Non-Disclosure Agreement.

Is it true that gp32 games are encrypted?
Yes. They use secumax.com technology. Here are the two types that are supported:SMC ID Encryption - Games that are encrypted this way will only work on one particular SMC card, but the game will work on any gp32 console. Some SMC cards have their own unique ID that is built into the hardware of the card itself and it can not be changed. The gp32 bios uses this unique ID as a key to unencrypt .gxe files. Most, if not all, commercial games are encrypted this way.GP32 ID Encryption - Each gp32 game console has it's own unique product ID. (This ID can be viewed from the gp32 test screen. Accessing the test screen is covered in another FAQ in this file.) Games which have been encrypted using the GP32 ID will work on only one gp32 console, but can be run from any SMC card.

Where can I find detailed technical specs of SMC cards?
http://www.ssfdc.or.jp/english/spec/index.htm

General GP32 Dev FAQs

General GP32 Dev FAQs
this article is an extract from the very good Dev'rs GP32 Dev FAQs - Last Update 2002-Mar-30

How do I find out what product ID & firmware version is installed on my GP32?
Enter test mode to view the product ID & firmware version by pressing following shoulder buttons sequence:
L - R - R - L - R - R - L – L

Are there any emulators for gp32 development?
There is GeePee32:
http://users.skynet.be/firefly/gp32/

How does internet gaming work on the gp32?
To do this you must have an RF link adapter or a USB cable that connects your gp32 to a PC. The RF link seems to be the standard method proposed by GamePark. However, software could be developed by others to support gaming over USB.

Is there an RF link support in the GP32?
No. You would have to buy a separate hardware adapter that plugs into the EXT port on the bottom.

I don't live in Korea. How do I get the GP Free Launcher?
http://english.gamepark.com

How do I make an .fxe file so I can run my code with the GP Free Launcher?
http://www.devrs.com/gp32/software.php#comp

Why does my code work in the emulator but not on real hardware?
The main reason appears to be due to memory alignment problems. The real ARM processor often requires data to be 4 byte aligned or else you can get unexpected results.

Why do some makefxe tools either crash or cause the emulator/hardware to crash?
This is because some tools for making fxe files REQUIRE that the input file contain a non-empty Read/Write (RW) section due to the algorithm they use to convert to fxe format (and the emu probably requires this as well). [i.e. DWORD at input file offset 0xc should not equal DWORD at input file offset 0x14] B2fxe doesn't care if your RW section is empty and creates an output file that works fine in emulators and hardware.

What do the various file extensions in gp32 dev mean?
The areas of file types that are encrypted are discussed here but there currently are no plans to provide information on the encryption method itself:

.axf - ARM Executable Format (Same as .gxb format but also can contain debug info.)

.fpk - Archive file for free stuff from GamePark

.fxe - Scrambled (light encryption) binary file & graphic icon for free games/apps from GP & third party developers. You have to use Game Park's free launcher to run these on your gp32. When the launcher unscrambles these files and removes the icon, the result is identical to a .gxb file. They are usually found in the gp:\GPMM directory.

.gpm* - Contains an SMC ID

.gps - Generated by GP's PC link software. Contains username, password, and GP32 ID... all in encrypted format.

.gxe - Binary info file : title, company, icon, encrypted stuff,.. This file can also contain the first X number of encypted bytes of the binary. The remainer of the binary is found in the .gxc file with the same name.

.gxc - Encrypted binary file. After a header, every X interval number of bytes in this type of file you will find Y number of bytes of information that is encrypted. The rest of the file is unencrypted.

Header (20 bytes long)
Encypted binary data (Y bytes)
Unencrypted binary data (X-Y bytes)
Encypted binary data (Y bytes)
Unencrypted binary data (X-Y bytes)
...etc...

If you remove the 20 byte header and unencrypt the file (placing it after any unencrypted code from the .gxe file), then the resulting data is identical in all other respects with a .gxb file.

.gxb* - Non-encrypted binary file. This is placed in gp32 ram starting at location 0xc000000. The entry point is the starting location and the entry is performed in ARM (not thumb) mode. Here is the header in ARM SDT format:

b _SkipHeader
DCD Start of Read Only section
DCD End "
DCD Start of Read/Write section
DCD End "
DCD Start of Zero Initialized section
DCD End "
DCD 0x44450011
... sometimes more info here...
_SkipHeader
... Init heap,etc ...
ldr r4,=C_Entry
bx r0

.smc - Raw SMC card data (Similar to how raw CD data = ISO format)

.zpk - Another archive file used by GamePark

* The file extensions marked this way are unofficial extensions from third-party developers.

How do I transfer a file to my gp32?
You can use the GP32<->PC USB cable or you can use a PC SMC card reader/writer such as the EMS 5in1 card reader/writer. There are reports that the EMS card reader is 20 to 30 times faster for transferring files than the USB cable.

Can I play an mp3 while also playing a game?
No. The gp32 has to devote the majority of it's processing power to the decoding & playing of mp3 files so no other functions are supported at the same time.

Where is the unique Product ID stored in each gp32 console?
In the serial IIC-bus eeprom in the gp32.

Where can I find information on the graphics or sound chips?
There basically are no separate chips for graphics or sound processing. The gp32 CPU handles most of these operations. There is an external Samsung LPC3600 LCD timing controller but this is only used for generating correct signal timing for the LCD. There is also an external Phillips UDA1330A stereo filter IIS-bus DAC but this is only used to convert the final composite sound signal from digital to analog.

The gp32 graphics hardware has no layers, tile modes, sprites, or other fancy hardware. It basically just has double-buffering of a bitmap-style screen mode.

What signals are found on the gp32 EXT connector?
Pins: 1=3.3v, 2=nRESET, 3=nTRST, 4=JTAG[TDI], 5=JTAG[TMS], 6=JTAG[TCK], 7=JTAG[TDO], 8=AIN0, 9=RXD0/GPF0, 10=TXD0/GPF2, 11=IIC-bus[SCL], 12=IIC-bus[SDA], 13=nRTS0/GPF4, 14=nCTS0/GPF5, 15=RXD1/GPF1, 16=TXD1/GPF3, 17=NoConnection(?), 18=Ground

Refer to the CPU data sheet for more info on these signals.

How are the console buttons connected to the CPU?
A=GPB14[pin19], B=GPB13[pin18], Start=EINT6/GPE6[pin125], Select=EINT7/GPE7[pin126], L=GPB12[pin17], R=GPB15[pin20], Up=GPB11[pin16], Down=GPB9[pin14], Left=GPB8[pin13], Right=GPB10[pin15]
When read, the values will be 0 when pressed & 1 when released.

What is the clock speed of the GP32?
This is software selectable from many different speeds from ~22MHz up to ~133.5MHz. The slower the selected speed, the longer the battery life that you will experience. However, just because the CPU can be set for very high speeds does not mean that the rest of the system (in particular the SDRAM) can handle this speed as well. Bios v1.5.7 defaults the clock speed to 67.8MHz. FireFly and others have managed to run their GP32 at up to 99MHz, with instruction and data cache on, without noticeable problems. Some people appear to experience problems at this speed.

Why do my assembly language swi calls sometimes cause problems?
If you are using ARM SDT tools then you must make sure that you tell the compiler what registers are being used by bios swi code so that the compiler will know what registers will be safe and what registers will be destroyed by the swi. YOU MUST ALWAYS TELL THE COMPILER THAT THE LR REGISTER WILL BE DESTROYED. Read that last sentence one more time to commit it to memory. ;-) Here is the format for passing that info:
swi 0x?, {input registers}, {output register}, {lr,destroyed registers}
If the swi call requires no input or output registers, then use the following format as an example:
swi 0x?, {}, {}, {lr,destroyed registers}

What C/C++ compiler packages can I use for gp32 development?
There are currently at least 3 approaches:

MS Visual C++ is supported by GamePark in the form of libraries that allow you to develop and test a game on a PC. The resulting compiled code will only run on a PC but this same source code can be compiled on other C compilers to generate binaries that will run on real GP32 hardware. The main drawback to VC++ is that you can not develop optimized ARM assembly language with this setup. GP will make the VC++ libraries available here when they are released: http://www.gameparkdev.co.kr

ARM SDT is a very efficient compiler but it is ~$4000USD.

GCC is also a popular approach. There are several different GCC compilers that have been targeted to the ARM platform as listed below. For each of these packages you will need additional libraries or files that can be found here: http://www.devrs.com/gp32/files/gcc/
1) Dev Kit Advance was originally intended for the GameBoy Advance, but it is basically a generic ARM GCC 3.0.2 C/C++ compiler for windows: http://www.io.com/~fenix/devkitadv Add this to your compile options for smaller code that is tuned for the ARM920T processor: -mtune=arm920
2) GCC 3.0.4 that is available from http://darkfader.net/gp32 is a slightly later version of GCC that is much smaller than Dev Kit Advance

mardi 11 septembre 2007

GP32 Tutorial 01 "Hello World!"

/*
* GP32 Tutorial 01 "Hello World!"
*
* Intro
* -----
* You want to learn coding for the GP32 but have no clue where to start?
* Then you found the right tutorials! These are for you when:
*
* - you have basic programming knowledge (from BASIC,...)
* - you have already installed a compiler and Mr. Mirko's SDK
* - you have a proper development enviroment
* - you can't learn from the examples and manual directly
* - you need more than knowlegde about the SDK
* - you need someone explaining the stuff to you
* - can understand my bad english
*
* These tutorials will:
*
* - introduce you to C programming for the GP32
* - explain how the GP32 works
* - show basic techniques to handle the GP32
* - NOT help you installing a compiler on your PC
* - NOT guide you to a complete game engine
* - NOT help you on makefiles or editor issues
* - NOT show any ARM ASM or Thumb
*
* Why not using the official SDK? There are already some beginner
tutorials
* from rico covering this. Also Mr. Mirko's SDK will become a serious
* replacement, it is minimalistic and fast.
*
* If you have any questions ask the dudes and dudettes at:
* www.gp32x.com or #gp32dev (EFNET) they know everything and are willing
* to help you anytime.
* If you have any c/c, ideas or suggestions mail me: synkro@gmx.net
*
* Let's start!
* ------------
* 1. Open this file in your fav editor and make sure it compiles properly
* without any errors or warnings. Try tp execute the FXE in GeePee32 or
* on your GP32. I will now explain the things in detail some in the
* following paragraphs or directly in the code.
* You won't understand everything on the first go, maybe after some
weeks
* but that's ok! Rome wasn't build on a single day or with one
tutorial.
* Just read everything carefuly...
*
* 2. Every C program starts its execution with the "main" function. Every
* programm has to have one, that's the place the GP32 starts the code.
* The first "void" means that this function won't return any value
after
* execution. The second "void" in braces means that the "main" function
* needs no arguments on execution.
*
* 3. The following commands are in "{,}" These define commands together
into
* a block.
*
* 4. unsigned short *framebuffer;
* This declares a pointer to the primary FRAMEBUFFER. A pointer is a
* memory cell which contains an address of a data element. The variable
* name is preceded by a '*' character. A framebuffer is a memory area
* treated like a screen or any other data element.
*
* 5. Every function starting with "gp_" is part of Mr. Mirko's SDK. Keep
in
* in mind that C is case sensitive.
*
* 6. char text[23] = "Hello World! What else?";
* We can allocate arrays of simple types by adding a pair of square
* brackets enclosing a number which is the size of the array after the
* variable's name. This is an array of chars we fill with a short
* message also called string. This strinh has a lengt of 23.
*
* 7. int x_pos = 50;
* int (Integer) is a data type that stores whole numbers. We declare a
* variable named 'x_pos' as an integer with the value 50.
*
* 8. while (1){}
* This is an endless loop to prevent the program to end before we can
* see anything on the screen. While the condition is true, in this case
* the condition is '1' also always true.
*
* So, that's it so far for this time. Try to re-type (not copy and paste)
* the following code and try to understand what each line does. Before you
* go over to the next chapter fool around with the code:
* A) Add new lines of text
* B) in different colors and on different positions.
* C) Clear the screen in any other color
*
* Disclaimer
* ----------
* This Tutorial is based on Mr. Mirko's SDK (mirko@mirkoroller.de)
* download it at: http://home.t-online.de/home/mirkoroller/gp32/
* THIS TUTORIAL IS NOT WRITTEN BY MR. MIRKO! Parts of this Tutorial
* are from the SDK's examples or manual.
*
* SDK by Mr. Mirko mirko@mirkoroller.de
* Proofreading by rico
* Tutorial by synkro synkro@gmx.net
* 06.03.2004 00:34:20
*/


#include // Includes the SDK header with all
definitions

unsigned short *framebuffer; // A framebuffer pointer

void main(void)
{
gp_setCpuspeed(66);
// We set the CPU clock to 66MHz. It compromises battery
// life and performance. This is also the normal GP32 speed.

framebuffer = (unsigned short*) FRAMEBUFFER;
// We point the framebuffer pointer to a memory area used
// for the screen. We manipulate the screen by manipulating
// this framebuffer.

gp_initFramebuffer(framebuffer, 16, 85);
// We set the framebuffer into 16bit mode. We will always use
// the 16bit mode because I am to lazy to write about palette
// handling and it is just the best screen mode.
// The 85 is the refreshrate of your screen.

int i;
for (i=0; i<320*240; i++) framebuffer[i]=0xFFFF;
// Though the screen is two dimensional, it is possible
// to access the framebuffer linear. All data in memory
// is aligned the same way. In this loop we set every
// pixel white (0xFFFF), we clear the screen.

char text[23] = "Hello World! What else?";
// An array of chars also known as string.

int x_pos = 50; // This int stores the x-position of the text
int y_pos = 110;
int length = 23; // length of the char[] to be drawn
int color = 0xF000; // RGB (RRRRRGGGGGBBBBB0 = 16 bit)

gp_drawString(x_pos, y_pos, length, text, color, framebuffer);
// We draw a string named text with lenght of 23
// at (x_pos, y_pos) on the framebuffer. This function
// is part of the SDK.


while (1) // This while loop ist always true.
{
}

} // End of the "main" function

Technical Specifications

Dimensions
147 mm × 88 mm × 34 mm

Weight
163 g

Display
3.5" TFT
16-bit colour, 320 × 240 pixels

CPU
Samsung S3C2400X01 (ARM920T core), 20 (and under) to 133 MHz (overclockable to 166 MHz+ in some cases. Some have even reached 256 MHz (not always stable, low battery life). Overclocking ability is random, however all GP32s are supposed to reach 133 MHz. A few early "bad" units maxed out at 132 MHz.)

RAM
8 MB SDRAM

ROM
512 KB

Sound
44.1 kHz 16-bit stereo soundfour-channels and up software WAV mixing (it is up to the coder, but four channel is built into the official SDK)16-part polyphonic software MIDI (in official SDK)earphone portstereo speakers

Storage
SmartMedia 8–128 MB

Power Supply
2 × AA batteries or 3-V DC adapter. Batteries last between 6 and 12+ hours, but actual amount depends on a number of factors.

Chatboard tuto and datacable list

Wanted to build some of the things for selling but never get around to finally do it,
so here is the list i have collected.

The samsung a300 datacable seems to be the cheapest way.
CHA-01 and CHA-10 are the only working chatboards for the gp,you can get them cheap at ebay for about 1eur, and one of the following plugs for handys.
Please keep in mind that you need at least 4 pins (you can move them arround), so some chargers/headsets may not work.
also datacables are cheap for some handys, arround 3EUR.One of the names for the conenctor is 3050-18P-0.5 dont remember other ones.

CODE:
  • PCB037DBE
  • samsung A200/A288/A300/A300/A400/T100/R200/R210/R220/N620/N628/SGH-E100/SGH-E700/SGH-S500/SGH-E100/SGH-E600
  • NEC N21i/N22i
  • Sagem My-C2
  • Mistubishi M320
  • Alcatel 531LG G5300

If you know other models/have other sources, please share them.

Now to the building:
solder your 4 wires to the extconenctor to the pinspin/meaning/color used in picture

  • 1=3.3v orange
  • 9=RXD0/GPF0
  • white10=TXD0/GPF2
  • yellow18=Ground blue
  • or (!)1=3.3v
  • orange15=RXD1/GPF1
  • white16=TXD1/GPF3
  • yellow18=Ground blue

It could be that the orange cable (+3.3v) can only be soldered at the smd resitor, not on the pin before it,
and make sure you dont connect anything to the little golden line that is arround the chatboard.

Finish! Have fun with your new selfbuildet chatboard!Maybe some mod can create a post in faq forum with this.