Welcome
Welcome to a320

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

Problems with S2D SDK!!!

Any and all A320 homebrew topics

Moderator: Moderators

Re: Problems with S2D SDK!!!

Postby cdesign30 on Fri May 08, 2009 9:56 pm

Hi, try download the "Hello World" from Jorge Hontoria Jiménez blog. There are some resources with S2D SDK using VC++ 2008. Works fine for me. Download from http://blog.tipesoft.com/?p=827. Coverting and compiling from VC++ 6.0, VC++ 2003 and VC++ 2005 is very difficult.

Cheers, Doug
cdesign30
 
Posts: 23
Joined: Sun Apr 26, 2009 8:04 pm

Re: Problems with S2D SDK!!!

Postby SiENcE on Sat May 09, 2009 12:39 am

Project : error PRJ0003 : Error spawning 'cmd.exe'.


this is strange.

Code: Select all
@echo off
SET MIPSLIB=c:/cygwin/mipseltools/lib
SET MIPSTOOLS=c:/cygwin/mipseltools/include
SET S2DINC=c:/s2dsdk/inc
SET S2DLIB=c:/s2dsdk/lib
PATH=c:\cygwin\mipseltools\bin;c:\cygwin\bin;C:\WINDOWS\SYSTEM32;
cmd
@echo on


1. adjust path's
2. put this into a cygwin.bat file
3. start this
4. go via commandline into the ccpmp directory of your sample project and hit build.bat
SiENcE
 
Posts: 67
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

Re: Problems with S2D SDK!!!

Postby Wiredbomb0 on Sat May 09, 2009 2:46 am

I will download that resource when I get home. I'm at my nans now, so I can't really do that.

SiENcE what did you mean by adjust paths? Change them to c:\cygwin\mipseltools\lib or the location that the directories are?
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Problems with S2D SDK!!!

Postby Wiredbomb0 on Sat May 09, 2009 10:22 am

Strike gold! Woot!

Well, thanks for this guys! It was really simple! I downloaded the helloworld (which surprisingly didn't have any 'hello world' text anywhere :P) and compiled that and it gave me that same cmd.exe error. Knowing exactly where cmd.exe was, I just copied it to the win32 VS2008 directory, and bam! It's done!

Thanks so much!

Now, how the hell do I code for it??? XD
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Problems with S2D SDK!!!

Postby cdesign30 on Sat May 09, 2009 2:35 pm

Wiredbomb0,

Put the necessary functions calls or code which is executed during processing in "GameEngine::Render( void )" function from "GameEngne.cpp".

For example, if you wish exit your program in Dingoo pressing "X" button, add the code in end of "Render":

Code: Select all
if( m_pInput->IsKeyClick(KEY_R1) ){
   exit(0);
}


Compile your code in Windows environment and run it. When you wish quit, simply press "Esc" key.

Compile the code with "build.bat", place "target.app" in Dingoo and run it. When you wish exit, press "X" button.

Download anothers code from the blog.tipesoft and examine the sources. You will understand better how the gameengine works.

Cheers, Doug
cdesign30
 
Posts: 23
Joined: Sun Apr 26, 2009 8:04 pm

Re: Problems with S2D SDK!!!

Postby Wiredbomb0 on Sat May 09, 2009 2:42 pm

Perfect! Thank you! Okay, I've managed for something to happen (you press escape and the lines change from green to blue :D). Just wanting to know, what are the corrosponding keycodes and the windows keycode? Like, KEY_R1 = Escape, what does the arrow keys equal?

EDIT: I've found the corrosponding keys for the Dingoo, but do you know what each key is on a keyboard? I have no way to test my games cause I can't use my dingoo.
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Problems with S2D SDK!!!

Postby joyrider on Sat May 09, 2009 4:00 pm

btw your not actually forced to use the whole gameengine system as it is created. You see if you create a new class derived from the GameEngine Class from the engine (with nothing implemented in them, there are a few functions that need to be defined but you can leave them empty like render, init etc) and then create an instance of that new class you can basicly use it more or less like you would use SDL.

For info on the functions etc just check your c:\S2DSDK\Doc\index.html file (allow the content to be displayed if you are using Ineternet Explorer cause it will be blocked by default). It's got all the information you need and even explains certain functions.

there are a few cavecats though for instance you'll have to put the part handling the user input in every procedure where you want to have input. and this is diffrent in windows and on the dingoo itself but you can just compare those statements to a sdl_pollevent statement. Just have a look at loader.cpp for the dingoo and windows versions they are a bit diffrent.

This also means you'll have to adopt your code a bit to make it work on the dingoo itself (because the input handling and initialisation is diffrent ). So you can't just create the whole game in windows and expect it to run on the dingoo if you are doing this (what i'm currently doing)

It should work but i haven't gotten my dingoo yet to test it out (stupid postal service). But it compiles fine to an .app file


Also for the graphics you should use the RGB565 option and convert them using the supplied (chinese) textureconverter tool. You have to use tga files (so if your original game files are in another format, convert to tga first).

The sound files are Raw pcm files. I'm using a program called "Goldwave" to convert my wav to that format. and save them as
Pcm signed 16 bit, little endian, 16000 hz (needs resampling if your's is diffrent), 256 kps, mono

Also i think the booblepop example contained a bug but i'm not sure with the playsound function it used the soundfile->length property but if i tried that my audio got cut off to early or not played completely however if you'd use soundfile->size property it did play perfect :
io g_pEng->m_pAudioPlayer->Play(&m_pAudioData[ID],i,m_pAudioData[ID].GetSize(),255,false); and not GetLength()
but as i said i'm not too sure about that but it does work and fixed my audio problem.
joyrider
 
Posts: 77
Joined: Sun May 03, 2009 4:27 pm

Re: Problems with S2D SDK!!!

Postby Wiredbomb0 on Sat May 09, 2009 10:44 pm

Ahh...I feel so stupid! Always read the documentation! I had even opened it before. Thanks for reminding me, it will help me heaps!

It's not really that complex overall, you just need to know where things are lol. I thought that I should post this:

Image

Thanks guys!
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Re: Problems with S2D SDK!!!

Postby SiENcE on Sun May 10, 2009 12:00 am

It seems your pixel rendering is wrong. Change into this.

Code: Select all
   //Pixel by pixel
   int r = 0;
   int g = 255;
   int b = 0;
   for(int y = 0; y < A320_SCREEN_HEIGHT;y++)
   {
      for (int x=0; x < A320_SCREEN_WIDTH; x++)
      {
         PutPixel(x,y,r,g,b);
      }
      r += 1;
      g -= 1;
      b += 1;
   }


Code: Select all
/// pre-render proccess
void GameEngine::PutPixel(int x, int y, u8 r,u8 g, u8 b )
{
   Pixel* ptr = m_pDraw2D->GetVRAMPtr();
   Pixel color1(r,g,b);
   s32 ofs = (y*A320_SCREEN_WIDTH) + (x);
   ptr[ofs] = color1;
}
SiENcE
 
Posts: 67
Joined: Wed Apr 29, 2009 9:19 am
Location: Berlin/Germany

Re: Problems with S2D SDK!!!

Postby Wiredbomb0 on Sun May 10, 2009 12:32 am

haha, that picture you see is some code I added. If you hold down 'down', the bottom red part shows, else it's just white.
Wiredbomb0
 
Posts: 166
Joined: Thu Apr 23, 2009 10:08 am
Location: Victoria, Australia

Previous

Return to Homebrew

Who is online

Users browsing this forum: nine10 and 2 guests