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.


Messages - KeiDash

Pages: [1] 2
1
General Jo Engine Help / Re: Questions about storyboard animations
« on: January 08, 2020, 09:41:49 am »
Hi Cobra

I read your post but I can't help you, at the moment I've never use Storyboards. I hope that you solve it.

2
Share your code / Re: 68K Access / Sound Driver Demo
« on: January 07, 2020, 10:22:46 pm »
Oh sorry it's my mistake.

I understood something else about the project. Could you explain to me exactly what it does?

3
General Jo Engine Help / Re: Hey, i'm new here, please, help!
« on: January 07, 2020, 10:19:41 pm »
Hello and wellcome.

Don't worry, all of us have doubts when we start, so, relax.

Answering your questions:

1) You can use the timer function called jo_get_ticks. If I'm not wrong, each tick represent 1 frame, and 60 frames represent 1 second so you will be able to make a piece of code for calculate it. As example, what I would do is create a function that never close and return seconds when I call it, in the second core of the sega saturn (jo_add_slave.....). So, if in a global var you set the time that you need to know if was pased or will come, you will be able to know it.

2) Nope, this doesn't exists. This isn't a game maker by clicks like gamemaker or other softwares. You must to create your desings and implement it in code.

4
Share your code / Re: 68K Access / Sound Driver Demo
« on: January 07, 2020, 03:09:09 pm »
Hello Ponut!

I want to try your demo but the emulator displays this when I run the compiled iso



I'm doing something wrong?

Regards,

5
Free talk / Re: Very busy
« on: December 19, 2019, 01:47:15 pm »
Don't worry Johanne. Sure that we all had the same situation in other moments, so, we are waiting you.

Good luke!!

6
Have you made sure you're using the latest version of mednafen? Loop functionality works perfectly for me and I use mednafen.

Also, are your wav files 16 bits or 32 bits? 16 Bit files are supported on Saturn, but 32 Bit files are not. Just check to make sure. :)

Hi @LackofTrack, thanks for your answer.

About mednafen, yes, I'm using the latest version but my wav files are 32bits, maybe this is the problem. I'm going to try it again with a 16bit files.

Thanks!

7
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,

8
General Jo Engine Help / Re: Removing images/sprites from RAM?
« on: July 12, 2019, 12:28:16 pm »
Researching the case, I'm not solved yet but I found the piece of code that making the game crashes.

I have 3 background images of 320x240 pixels hardcoded (converted to C with JoMapEditor)

If I use 2 of them, the game works fine but if I load more of 2 of them, the games crashes, Regardless of whether you used it or not or the life cycle of the code reaches the loading point.


I have 2 methods, jo_main() and testbg(). In jo_main() I'm doing this:

Code: [Select]
void jo_main(void)
{
    jo_core_init(JO_COLOR_Black);

    currentScreen = 0;

    jo_core_run();
   
}

And in the method testbg I'm doing this:
Code: [Select]
void testbg()
{
    static unsigned int myscreen = 0;
    static int counter = 0;

    jo_img bg1;
    jo_img bg2;
    jo_img bg3;

    if(displayed == 0)
    {
        displayed = 1;

        bg1.width = 320;
        bg1.height = 240;
        bg1.data = (unsigned short *)BG1;

        bg2.width = 320;
        bg2.height = 240;
        bg2.data = (unsigned short *)BG2;

        bg3.width = 320;
        bg3.height = 240;
        bg3.data = (unsigned short *)BG3;
    }
}

If you look at the code, I'm not calling the method testbg() on jo_main(). In spite of this, if I write the 3th image code, the game crashes
Code: [Select]
        bg3.width = 320;
        bg3.height = 240;
        bg3.data = (unsigned short *)BG3;

But if I coment it, the game works fine.
Code: [Select]
        /*bg3.width = 320;*/
        /*bg3.height = 240;*/
        /*bg3.data = (unsigned short *)BG3;*/

And I repeat, I'm not calling to the testbg method.

The image arrays (BG1, BG2 and BG3) it's on one file called bgMain.h (#include "bgMain.h"), that contanis the 3 images exported with JoMagEditor to C. (PNG file to C)

I thought that the problem was the BG3 array maybe, so I made another different and I replace it but still happening the same.

So please, someone know what I'm doing wrong?

Maybe the problem is the size of exported images indepent of they was loaded?

Thanks

9
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,

10
General Jo Engine Help / Re: Best way to: Put an image background
« on: July 03, 2019, 09:05:34 am »
First of all, thank you so mutch about your explanation Mr.Ponut. Feels good when in the community the users help each other.

I think that I understod your explanation. I revice my code again and I found a mistake, something that you are talking about. I'm doing wrong the logic where the backgrounds it's loader because in each cycle of the process,

I'm erasing and load again the background in each cycle and I'm sure that this provoque (as you say) an out of memory exception. I change my code and now the bg it's loaded one time only using the same jo_img var, using the same pointer because the bg's has the same weight and height.

On the other hand, I've changed the TGA image file for a converted image to .c with the JoMapEditor. In this case, the images was loaded more fast than physical files (logically..) on the screen and now I don't have any errors or out of memory exceptions. If someone are interested:

Code: [Select]
void SetBackgroundByScreen()
{

    jo_img bgImage;
    bgImage.data = JO_NULL;
    bgImage.width = 320;
    bgImage.height = 240;

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

            enableBackground = 1;

            bgImage.data = (unsigned short *)BG1;

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

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

            enableBackground = 1;

            bgImage.data = (unsigned short *)BG2;

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

            break;
        default:
            enableBackground = 0;
            bgImage.data = JO_NULL;
           
            break;
    }

}



11
About you / Re: Hello there!
« on: July 01, 2019, 12:40:51 pm »
Oops

hehehe no problem ponut64, you didn't have to know.

We'll see on the discord channel.

12
General Jo Engine Help / Re: Best way to: Put an image background
« on: July 01, 2019, 10:25:59 am »
I use the same message to avoid creating another post.

I'm looking the Samples in the JoEngine to improve my knowledge. I'm trying to put 2 different background images in "2 screens" (one method call other and each one has it own bg).

I'm using the jo_tga_loader function like this:
Code: [Select]
   //SCREEN 1
   imgBackground.data = JO_NULL;
   jo_tga_loader(&imgBackground, "BG", "IMG1.TGA", JO_COLOR_Transparent);
   jo_set_background_sprite(&imgBackground, 0, 0);
   jo_free_img(&imgBackground);

   //SCREEN 2
   imgBackground.data = JO_NULL;
   jo_tga_loader(&imgBackground, "BG", "IMG2.TGA", JO_COLOR_Transparent);
   jo_set_background_sprite(&imgBackground, 0, 0);
   jo_free_img(&imgBackground);

The first screen (the menu) load the IMG1.TGA file. When the A button it's pressed, clear the screen and the background and then loads the IMG2.TGA.

If in the screen 2, the B button it's pressed, clear the screen and the background too and come back to the screen 1 and loads again the IMG1.TGA file.

Up to this point there are no problems. The problem comes now, if I repeat the process. If I press the A button again to change SCREEN 1 to 2, the engine throws an error saying that the file "IM___.TGA" file not found.



1. In the error, the file name not is complete, the complete file name is "IMG2.TGA", whats happening here?
2. To view a possible function anotations, I went to read the documentation of jo_tga_loader, but this method doesn't exists on the original documentation, instead exists the function jo_tga_loader_from_stream

What's going on?
This is the best way to load an image background?
It's a bad idea load a TGA file in the background (for the performance)?
If jo_tga_loader_from_stream is the only one method, how I can convert the image background to binary to use this method?
Exists any other option?

Thanks all.

PD: I'm using Yabause or mednafen to do it, but each emulator works different.

13
About you / Re: Hello there!
« on: June 27, 2019, 01:59:20 pm »
Thanks! I'm already inside the channel with the same nickname.

14
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,

15
1. Use compile.bat and edit compile.bat to ensure it ends with PAUSE. At which point you don't need any command line, just double-click it and it will halt so you can read what happened.
If you're still missing main.o, check the makefile in the project directory. it must list your source files in the SRCS line.

2.

Both function A and B halts the program if you never press A. THE ENTIRE PROGRAM.

Instead:

Code: [Select]
void stuff_for_A(void){

static bool lastTouch = false;

 if(jo_is_pad1_key_pressed(JO_KEY_A)){
 jo_printf(lineX, lineY, "stuff%i", data);
 lastTouch = true;
 } else if(lastTouch == true){
 jo_printf(lineX, lineY, "                                         ");
 lastTouch = false;
}

}
What does this do:
When you press the A button, print text.
When you release the A button, on the next frame, clears that text area off the screen.

If you want to insert a wait, add a timer. Don't try and halt by process, that slows down the entire program.
And of course, I'm not talking about some abstraction of a timer. You make an integer and add to it every frame. When it reaches the number you want, run the associated function and set it back to zero.

Thanks for your reply.

As I see, I'm not on the wrong track. I'm doing something similar to what you explain, with a variable that "prevent" the next action, but, I wans't using a static var. As you say, it's better in this case.

I thought that this "practice" maybe no was the best way to do that.

For the compilation issue, I've checked my makefile and it's right. It has all files that I need in the SRCS line, included main.c. The curious case is that I included a new line in compile.bat. I wrote DEL *.o as second line before throw the compilation and now works always right.

I don't know if this happening only at me or exists more users that has the same issue.

Pages: [1] 2
SMF spam blocked by CleanTalk