Sega Saturn Development > General Jo Engine Help

How to autoload game after video

(1/4) > >>

SaturnTeam:
I'm not sure if this is straight forward or not. I'm trying to figure out if there needs to be a jump from one C file to the main or running a header file from the main file. Should the video C or header file be in a separate directory? Right now, I keep running out of memory due to all the assets being loaded at the same time. I want to run the video, clear that, and then load the game assets.

ponut64:
You should have a look at the jo_free command, since you're loading everything with Jo engine.
You should be able to use jo_free to free up the memory allocated by the video.
That said, I don't use jo engine loading features so I am not sure how it works.

SaturnTeam:
Yeah, that seems to be what I'm missing. I'm using the suspend command to hold the game until the video plays, but I need the free command to clear the memory. I'm still trying to figure it out, but I haven't had much luck. I've been looking at addresses that get returned in debug in Yabause, but I'm not totally clear on how to set up the malloc and free commands in the code.

Johannes, can you explain how this is supposed to work? I've been reading up on how malloc normally works in C coding, but I keep getting address or file size errors.

ponut64:
My guess looking at jo_free, whatever variable you are using to reference the data (like jo_get_video_sprite), you put that in jo_free.
Maybe the man himself will come and explain it for cinepaks.

logi:
I am experiencing the same issue.
This is not something that I particularly need to implement, but it would be nice to figure out how to properly clear the memory after a video has been loaded.

When the video sample application is running it is using 71% of dynamic memory and 32% of sprite memory, according to the returned values of jo_memory_usage_percent() and jo_sprite_usage_percent() respectively.

When the video stops playing and the my_video_stopped() callback function is executed, the jo_memory_usage_percent() returns a zero, indicating that the video data is no longer consuming the dynamic memory, but the jo_sprite_usage_percent() returns 32, showing that the data has not been cleared from the sprite memory.

When I call the jo_sprite_free_from() function passing it the jo_get_video_sprite() function for the sprite ID, this then clears the sprite memory, at which point both the jo_memory_usage_percent() and jo_sprite_usage_percent() return a zero.

If I then try to load the background image from the background sample (usually consumes 4% sprite memory) I receive an out of memory error message.
https://www.youtube.com/watch?v=OtGekEpw_ro

Navigation

[0] Message Index

[#] Next page

Sitemap 1 2 3 4 5 6 7 8 9 10 
Go to full version