Author Topic: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)  (Read 8582 times)

dimap

  • Guest
Sorry for my bad english. I'm russian)
(Warning! Google translate!)
-----------------
Hi all. I make a port of the game Open Syobon Action for Dingux. Although everything works fine (sound, buttons, screen ...), but the screen resolution remains the standard. I've tried everything - nothing worked. Help please! :'(
Compiled from Cygwin.

Part with video initialisation:
Code: [Select]
/* Initialise SDL Video */

if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
printf("Could not initialize SDL: %s\n", SDL_GetError());

exit(1);
}


screen = SDL_SetVideoMode(320, 240, 32, SDL_SWSURFACE|SDL_FULLSCREEN);

if (screen == NULL)
{
printf("Couldn't set screen mode to 320 x 240: %s\n", SDL_GetError());

exit(1);
}

If anyone wants to - make video with game work.
« Last Edit: February 20, 2011, 05:43:47 pm by dimap »

Poligrafowicz

  • Posts: 213
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #1 on: February 20, 2011, 05:36:24 pm »
I see you initialise 32bit color, but dingux supports only 16bit color (not sure if its 565 or 555). I have no idea what happens when you initialize other color depth than 16, but 16 is the way to go.

As for screen resolution remaining standard (why is?), maybe graphics location is hard coded. The cheap way to go around this, would be render everything on a temporary surface (with the same resolution as the game used natively) and then downscale the temporary surface and display it on actual screen surface.

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #2 on: February 20, 2011, 05:42:04 pm »
With 16bit lost transparency. With 32bit all works fine.

About surface. Dingux does not perceive surface (and i don't know why!)
If needed, i can share the sources, but code is so bad(( (Yeap, i'm noob!)

Poligrafowicz

  • Posts: 213
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #3 on: February 20, 2011, 06:29:15 pm »
With 16bit lost transparency. With 32bit all works fine.

About surface. Dingux does not perceive surface (and i don't know why!)
If needed, i can share the sources, but code is so bad(( (Yeap, i'm noob!)

Ok I dont really understand what is the problem. Maybe the sourcecode would shed some light, do post it please.

clach04

  • Posts: 256
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #4 on: February 20, 2011, 06:39:39 pm »
It may be worth hanging on IRC, http://webchat.freenode.net/?channels=dingoonity

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #5 on: February 20, 2011, 06:44:05 pm »
All sources.
http://www.box.net/shared/8bg6e97pv5
"Makefile" based on makefile from Labyrinth and work fine. Error in DxLib.cpp , in begin.

Poligrafowicz

  • Posts: 213
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #6 on: February 20, 2011, 07:15:36 pm »
So what resolution the game used originally?

It appears that location of all graphics is hardcoded to use the original resolution. If you want the game to fit 320x240 Dingoo screen, you have to downscale it. Add a new SDL_Surface (make sure it has 32bit depth and same resolution as the game had originally). Next find the main drawing routine, make it draw stuff on that surface instead of your screen surface. Then downscale that temporary surface to 320x240 and draw it on screen surface.

It may be worth hanging on IRC, http://webchat.freenode.net/?channels=dingoonity

And that is a good tip.

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #7 on: February 20, 2011, 07:18:59 pm »
Original resolution - 480x420

Poligrafowicz

  • Posts: 213
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #8 on: February 20, 2011, 07:28:02 pm »
In fact it'll be easier to name the temporary surface screen (like ho the actual screen surface is named now). This way there will be less code to change.

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #9 on: February 20, 2011, 09:39:20 pm »
Well... I absolutely do not know how to do it. Sorry guys  :'(

Poligrafowicz

  • Posts: 213
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #10 on: February 20, 2011, 11:17:11 pm »
I wrote a quick (written quickly rather than working fast) and dirty downscaler for the game, which seems to work (I get the image on screen), but for some reason the game hangs (sort off). That is I can still quit it with select.

http://www.mediafire.com/?ppsn1e8wzndcdzh
« Last Edit: February 20, 2011, 11:27:14 pm by Poligrafowicz »

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #11 on: February 20, 2011, 11:18:34 pm »
Can you share the code? Maybe i found cause.
---------
Oh! I think I figured out how to fix the button)
« Last Edit: February 20, 2011, 11:26:53 pm by dimap »


dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #13 on: February 20, 2011, 11:32:35 pm »
It's working (buttons too)! But realy VERY slow... strange...

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #14 on: February 21, 2011, 01:06:15 am »
I try: change resolution, change bits per pixels, change flags, change core clock, add and delete SDL_DOUBLEBUF,SDL_SWSURFACE , SDL_HWSURFACE, SDL_FULLSCREEN , add palete.
Nothing!  ::)
Any ideas?

By the way. Sound is working very fine, without lags. Buttons too. I delete video initialisation, but game already work!

Poligrafowicz

  • Posts: 213
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #15 on: February 21, 2011, 06:42:49 am »
It's working (buttons too)! But realy VERY slow... strange...

Maybe its my downscalers fault, go join the irc channel and ask for help there. I'm no SDL expert and the folks there have much more experience than me.

zear

  • * Moderator
  • Posts: 2381
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #16 on: February 21, 2011, 10:59:34 am »
Changing the resolution of the screen doesn't automatically scale the game.
If the original game runs in 480x420, it means you'd have to scale the screen output to 320x240.
So far you've set the screen surface to 320x240, but the rest of the game still tries to draw off screen into the original 480x420.
Edit:
Oh, I see you've used the scaler. It is slow because the game first renders to 480x420 and then software scales the whole thing to 320x240. Software scaling will always be slow. Another thing you could do is to resize all the graphics and modify the code and change all the appropriate variables to work with the scaled graphics.
« Last Edit: February 21, 2011, 11:03:12 am by zear »

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #17 on: February 21, 2011, 04:41:14 pm »
Maybe there are other ways?
sdl_videoresize?

Poligrafowicz

  • Posts: 213
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #18 on: February 21, 2011, 05:29:45 pm »
I wrote a faster downscaler now it works ok (though the image isn't all that good).

Here it is:
http://www.mediafire.com/?hstmtud9g45cx

You can post it in release section, or should I do it?

dimap

  • Guest
Re: Cat Mario (Open Syobon Action) for Dingux (screen resolution problem)
« Reply #19 on: February 21, 2011, 05:46:42 pm »
It's great! Thank you!
I release this in release section, but it will be a beta version. I have some ideas about fonts and resources resolutions...