Sega Saturn Development > General Jo Engine Help

Read file asynchronously without blocking the game

(1/2) > >>

I added some functions to read file asynchronously, because I working on a video reader, but it's working for any file and any usage :)

If you're interested, here 's how it works:

The function bellow will be called when the file is loaded:

--- Code: ---
void            my_async_read(char *contents, int length, int optional_token)

--- End code ---

To read a file asynchronously, you just have to call jo_fs_read_file_async() with the filename, the callback and an optional token (user value for the callback)

--- Code: ---
jo_fs_read_file_async("DEMO.TXT", my_async_read, 0);

--- End code ---

In attachement, you will find a sample code to load a background image (TGA) from the CD asynchronously

Amazing, tks man!

you're welcome  ;)

is it possible to execute this function while the CD is playing some music? I'm trying here but the music stops.

Tks man!!!!

I think the problem is when the console will read a image from the CD it stops to read the music... I don't know if it can read two things at the same time!


[0] Message Index

[#] Next page

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