DC and SDL
- BlueCrab
- The Crabby Overlord
- Posts: 5658
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
-
- DC Developer
- Posts: 9951
- Joined: Sun Dec 30, 2001 9:02 am
- Has thanked: 0
- Been thanked: 1 time
Go right ahead, if you can work out what they are. It's mostly this bit:The bitshifts scale the DC's axes up from -127...127 and 0...255 to -32K...32K.
Code: Select all
// Process axes
DC_Process_Axis(state->joyx, oldstate->joyx, 0, state->joyx << 8)
DC_Process_Axis(state->joyy, oldstate->joyy, 1, state->joyy << 8)
DC_Process_Axis(state->ltrig, oldstate->ltrig, 2, state->ltrig << 7)
DC_Process_Axis(state->rtrig, oldstate->rtrig, 3, state->rtrig << 7)
DC_Process_Axis(state->joy2x, oldstate->joy2x, 4, state->joy2x << 8)
DC_Process_Axis(state->joy2y, oldstate->joy2y, 5, state->joy2y << 8)
-
- DC Developer
- Posts: 2648
- Joined: Sun Mar 24, 2002 7:48 pm
- Has thanked: 0
- Been thanked: 0
- Contact:
THank you for showing the time and effort you spent on that game
is the source in SDL i like to take a look if i could
reaperangel@yahoo.com
B A and BC .>have posted the dc controler drivers now
thanks bombshell! cool man!
is the source in SDL i like to take a look if i could
reaperangel@yahoo.com
B A and BC .>have posted the dc controler drivers now
thanks bombshell! cool man!
http://homebrew.dcemulation.com/dcgames/ *homebrew webbrowser games *
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
-
- DC Developer
- Posts: 2648
- Joined: Sun Mar 24, 2002 7:48 pm
- Has thanked: 0
- Been thanked: 0
- Contact:
thanks i emailed you what i did with the source some think may be wrong with SDL_IMAGE so can you test what i sent you ?
IT only gives me a blank screen only made small changes to make it more suited to the DC like the screen res
ok off to sleep i go 24 hour session!
IT should work at lest i think so
IT only gives me a blank screen only made small changes to make it more suited to the DC like the screen res
ok off to sleep i go 24 hour session!
IT should work at lest i think so
http://homebrew.dcemulation.com/dcgames/ *homebrew webbrowser games *
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
BlueCrab Well id like to have JPG because of the amount of space BMPs take up but i dont feel like reprogramming the source ATM, BTW how do you program Functions suchs as SDL_image which can display images can you give an example of how to start programming them or maybe a page so that i could do it myslef.
- BlueCrab
- The Crabby Overlord
- Posts: 5658
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has thanked: 9 times
- Been thanked: 69 times
- Contact:
Ok, here's how you can load and display images in SDL_Image, it is very similar to doing it with BMPs in SDL. This is an adapted form of something I posted earlier (in a different topic).
I'll get a copy of SDL_image up after I get back from youth group. It'll have support for all types that KOS supports (meaning that you need to add -ljpeg -lpng etc. to your linker line). And to answer your question, I've never written (and released) anything of the sort, the best way to do it is to study the documentation that comes with the library for that image type. It'll usually give you an idea of how to program with it. Oh, and if you are looking to conserve space, PNG files are generally smaller than JPEG files.
Code: Select all
#include "SDL.h"
#include "SDL_image.h"
int main(int argc, char *argv[]) {
uint32 flags = SDL_HWSURFACE | SDL_DOUBLEBUF;
SDL_Surface * screen, * image;
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
return -1;
}
/* Set our video mode to 640x480 16bpp */
screen = SDL_SetVideoMode(640, 480, 16, flags);
/* This stuff, right now, is only applicable to the DC version. */
#ifdef _arch_dreamcast
/* Load up disclaimer */
image = IMG_Load("/cd/images/image.jpg"); /* This is the only difference between using SDL_image, and SDL's builtin BMP function, all other stuff works just the same */
/* Put up the Disclaimer */
SDL_BlitSurface(image, NULL, screen, NULL);
SDL_Flip(screen);
SDL_Delay(20000);
/* Get rid of the image */
SDL_FreeSurface(image);
#endif
/* put the rest of your game here, of course, in different functions */
return 0;
}
-
- DC Developer
- Posts: 2648
- Joined: Sun Mar 24, 2002 7:48 pm
- Has thanked: 0
- Been thanked: 0
- Contact:
GREAT i wondered why when i used it black screen is all i got SO OFF to test this version i thought the one i compiled for me was working to
http://homebrew.dcemulation.com/dcgames/ *homebrew webbrowser games *
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
-
- DC Developer
- Posts: 2648
- Joined: Sun Mar 24, 2002 7:48 pm
- Has thanked: 0
- Been thanked: 0
- Contact:
TO BOMBSHELL AKA LUCIOUS
ive now got it working on the dc so no worrys iam going to really work on it thanks for doing this I HAVE to really fix the grafix and the real effect is not right other then that with a bit of work i may be able to get it looking almost like my webgame
DUDE if you want to join R.A.D software my site it be no worrys i can provide hosting and stuff like that and ive got a web site maker freind ....
SO im going to try turn your port of my game into a full game iwt music and a new effect ive been working on .....
bombshell NEEDS DEVVER STARS ANY one listening ???
thanks again it would of taken me years to do that i had it half done so ill add those bits and grafix
I should say 4 weeks or so it be finshed ill give you the first beta to try
back to SDL it rocks
ive now got it working on the dc so no worrys iam going to really work on it thanks for doing this I HAVE to really fix the grafix and the real effect is not right other then that with a bit of work i may be able to get it looking almost like my webgame
DUDE if you want to join R.A.D software my site it be no worrys i can provide hosting and stuff like that and ive got a web site maker freind ....
SO im going to try turn your port of my game into a full game iwt music and a new effect ive been working on .....
bombshell NEEDS DEVVER STARS ANY one listening ???
thanks again it would of taken me years to do that i had it half done so ill add those bits and grafix
I should say 4 weeks or so it be finshed ill give you the first beta to try
back to SDL it rocks
http://homebrew.dcemulation.com/dcgames/ *homebrew webbrowser games *
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
-
- DC Developer
- Posts: 2648
- Joined: Sun Mar 24, 2002 7:48 pm
- Has thanked: 0
- Been thanked: 0
- Contact:
I think the sound problem is somethink like this
/* #define dc_snd_base ((volatile unsigned char *)0x00800000) */ /* arm side */
#define dc_snd_base ((volatile unsigned char *)0xa0700000) /* dc side */
this bit use to be 0x00800000 as well and it dont work it that same as SDL silent whenchanged to 0xa0700000 the sound then plays its prolly nothing to do with it but im sure there just one wrong thin in it that needs changing
/* Some convienence macros */
#define SNDREGADDR(x) (0xa0700000 + (x))
#define CHNREGADDR(ch,x) SNDREGADDR(0x80*(ch)+(x))
just some think that happend in quake i thought it may help
SDL sound does work for DC bero had it on and siad some think about the paths not being right to me in email once you change them and sound works he told me but i dont know what to change them to
/* #define dc_snd_base ((volatile unsigned char *)0x00800000) */ /* arm side */
#define dc_snd_base ((volatile unsigned char *)0xa0700000) /* dc side */
this bit use to be 0x00800000 as well and it dont work it that same as SDL silent whenchanged to 0xa0700000 the sound then plays its prolly nothing to do with it but im sure there just one wrong thin in it that needs changing
/* Some convienence macros */
#define SNDREGADDR(x) (0xa0700000 + (x))
#define CHNREGADDR(ch,x) SNDREGADDR(0x80*(ch)+(x))
just some think that happend in quake i thought it may help
SDL sound does work for DC bero had it on and siad some think about the paths not being right to me in email once you change them and sound works he told me but i dont know what to change them to
http://homebrew.dcemulation.com/dcgames/ *homebrew webbrowser games *
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
http://r2k2gate.topcities.com *dev site and my releases*
Im' a Commodorian are you?
-
- DC Developer
- Posts: 78
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: USA
- Has thanked: 0
- Been thanked: 0
- Contact:
could someone send me your latest sdl files? dragonsimoto@yahoo.com
unless there isnt much changed from cvs current.
Thanks hope to develop here again shortly.
unless there isnt much changed from cvs current.
Thanks hope to develop here again shortly.
"If your a 'tard use the pictures on the left for navigation."
<img src="http://www.caskam.com/images/plan9avatar.gif"></img>
<img src="http://www.caskam.com/images/plan9avatar.gif"></img>