Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - KeiDash

Pages: [1]
1
Hello there,

At present, I'm working in some audio test with joengine. My idea is put in a certain moment a track (as CDDA) in bucle in the game. I get an audio from a original sound track of a game and converted from MP3 to WAV in 44100Hz, stereo and 32bits format.

I reproduce the track in the game with jo_audio_play_cd_track function.
Code: [Select]
jo_audio_play_cd_track(2, 2, 1);

As you can see, the 3th parameter is 1 (true) so the function should put it on loop, but when I run the game the track never put in bucle. Stops at the end and never reproduce it again.

I must say that i run the game on emulator, in mednafen that is the only one that run Saturn games with tracks. I never use this on real hardware. Should be the problem?

Regards,

2
General Jo Engine Help / Removing images/sprites from RAM?
« on: July 10, 2019, 09:33:54 am »
Hi again,

I'm working around 2 weeks with JoEngine and I think that is a good framework to develop games for SS, I Like it and I think that it's so easy to use.

I've just been using BennuGD port for Dreamcast and I leave it for all problems with the audio and the Ram memory management.

When I began with JoEngine, I decide first do some test divided in output text, audio test, gamepad test, image/sprite test and save/load state test, so I try  to merge all in the same project divided in screens, something very simple.

Each screen has its owns image background, vars, functionalities, messages, etc.

I did the output text screen with and background image, some text like date, autor, description, etc.

I'm doing the 3th screen that represents the display of sprite/images with animations, sprites, backgrounds etc.

Well, In this point I'm begin having problems with the game.

The first thing that I detect was that some text were not show and the game stops in the first screen (It worked properly before I made the 3th screen). This happened when I load one more sprite in the game and I assign this to a jo_img var. I tried free the memory and remove from memory all images that I don't use but I don't know really how to do it.

I think that it's possible that I'm loading all images and sprite in the wrong way or something that I'm doing with this images not is correct, for example:

As I say, each screen has its own background image. I'm doing this with this piece of code added in the core with jo_core_add_callback

Code: [Select]
void SetBackgroundByScreen()
{
    jo_img imgBackground;
    imgBackground.width = 320;
    imgBackground.height = 240;

    switch (currentScreen)
    {
        case SCREEN_MAIN:
            if(!enableBackground) { break; }

            enableBackground = true;
            imgBackground.data = (unsigned short *)BG1;

            jo_clear_background(JO_COLOR_Black);
            jo_set_background_sprite(&imgBackground, 0, 0);
            jo_free_img(&imgBackground);

            break;
        case SCREEN_OUTP:
           
            if(!enableBackground) { break; }

            enableBackground = true;
            imgBackground.data = (unsigned short *)BG2;

            jo_clear_background(JO_COLOR_Black);
            jo_set_background_sprite(&imgBackground, 0, 0);
            jo_free_img(&imgBackground);

            break;
        case SCREEN_SPRI:
       
            /* TODO*/

        default:
            enableBackground = false;
            imgBackground.data = JO_NULL;
           
            break;
    }

}

void jo_main(void)
{
   jo_core_init(JO_COLOR_Black);
   jo_core_add_callback(SetBackgroundByScreen);
   jo_core_run();
}


And in the screen 3, I'm loading some sprites (five in particular) with this piece of code:
Code: [Select]
void s_LoadSprites()
{
    static int sprLoaded = 0;
   
   /*
         load only once time
         sprLoading1st it's a global var
   */

    if(sprLoaded == 1)
    {
       return;
    }

    sprLoading1st.width = 48;
    sprLoading1st.height = 48;

    /*sprite 1*/
    sprLoading1st.data = (unsigned short *)sprLoading1;
    idSprLoading1st = jo_sprite_add(&sprLoading1st);
    sprLoading1st.data = JO_NULL;

    /*sprite 2*/
    sprLoading1st.data = (unsigned short *)sprLoading2;
    jo_sprite_add(&sprLoading1st);
    sprLoading1st.data = JO_NULL;
   
    /*sprite 3*/
    sprLoading1st.data = (unsigned short *)sprLoading2;
    jo_sprite_add(&sprLoading1st);
    sprLoading1st.data = JO_NULL;

    /*sprite 4*/
    sprLoading1st.data = (unsigned short *)sprLoading4;
    jo_sprite_add(&sprLoading1st);
    sprLoading1st.data = JO_NULL;
   
    animSprLoading1st = jo_create_sprite_anim(idSprLoading1st, 4, 2);
    jo_start_sprite_anim_loop(animSprLoading1st);

    /*sprite 5*/
    sprLoading1st.width = 24;
    sprLoading1st.height = 40;

    sprLoading1st.data = (unsigned short *)sprKen01;
    sprLoading1st.data = JO_NULL;

    sprLoaded = 1;
}

I must point out that the images are hardcore loaded. I was create it with the JoMapEngine and ported to C and included in the code.

At this point the game doesn't run. I have to remove several image/sprite loads for the game to work.

So please, I need help! What I'm doing wrong? How can I remove images and sprites and liberate it from ram? This is the real problem?

Regards,

3
About you / Hello there!
« on: June 26, 2019, 09:03:49 am »
Hi,

My name is Adrian, knowed in spanish community as KeiDash.

I'm software developer and I began a game for Sega Dreamcast called BeatTendency 2 years ago. Unfortunately, I cancelled the project the last week because the port made code lenguage BennuGD for Dreamcast has so many problems in general but with the audio section the problems comes bigger.

So, in a music game, this is a serious problem.

But the world doesn't stop and a few months ago I began in paralel another game that I want it be a game for Sega Saturn.

I like so mutch JoEngine. I played a bit with it in first version and now I'm doing tests with the different libraries for improve my knowledge in this framework.

Thanks Johannes Fetz for your work, knowing the complex of Sega Saturn hardware, you did a excelent job.

So, If all comes right, I'll show my project in few months.

Regards,

4
General Jo Engine Help / Best way to: Put an image background
« on: June 24, 2019, 03:46:05 pm »
Hi everyone.

In order not to create new entries, I take advantage of this same space to ask the question.

See the question here please



I'm doing some test on JoEngine. I've started with printing some text on screen with jo_printf function based on gamepad keys pressed and would like to know the best way to do this, I'm explain it.

I've two functions, function A and function B. Each one, has a validation that if the key A was pressed, continue doing something. The A method call to B method when A key was pressed.

Code: [Select]
void A()
{
   do
   {
      //do something here
   } while(!jo_is_pad1_key_pressed(JO_KEY_A))

   B();
}

void B()
{
   do
   {
      //do something here too
   } while(!jo_is_pad1_key_pressed(JO_KEY_A))
}

In this case, if in A function the A button was pressed, then call at B function.

The problem? The call from A to B it's so fast that the B function ends because it detected that the A button was pressed. It's something like the A buttom continued pressed in both cases or the time elapsed was very short that function B detected that A buttom was pressed to.

Exists some method or technique that wait between one call to other?


In other side, I've errors continuously making the compilation, but the output doesn't say something like Error in file.c X line X.. throw messages like:

Code: [Select]
sh-coff-gcc.exe: main.o: No such file or directory

I'm making the compilation on Windows Command Line and in the Windows Power Shell. I solved it deleting the *.o files and compiling again, but I don't understand where is the problem.

Thanks at all.

Regards,

Pages: [1]
SMF spam blocked by CleanTalk