Are these cores possible/in the works?

In any case, a core that is compatible with zsnes romhacks would be pretty neat.

I’m going to do the testing tonight to see if it works as promised.

whaoo !

I’ve just tested the new core virtualjaguar-libretro and it’s impressive . bravo for the works.

Works great on my pc ( to be honnest some slowdown if the sound is enable) .

And seems to work also on my old android phone ( anyway a bit slow even with sound disable ) .

Nice work guys !

Looks impressive!!! I’ll have to give it a try over the weekend :slight_smile:

Squarepusher,

Are there plans to improve the Jaguar on the PS3 ?. I notice it works, but all games have a blue tint on everything and no sound… I think it was just the 3d games not working. However speed seemed okay on the titles that did work…

Honestly, I haven’t even tested it out yet on PS3 so it looks like some people already beat me to it :P.

Regarding the speed - Virtual Jaguar libretro is just a port - so if the performance is lacking, it is probably the emulator’s fault. I have noticed that the author has spent over 10 years on this fork and that core improvements are slow to come by. There are also the occasional regressions from time to time.

Anyway, I’m not sure if bundling this with the console and Android/IOS ports will be a good idea - the emulator still seems very experimental and I’d probably be swamped with requests by people to the tune of ‘improve Jaguar emulation’ - not understanding we didn’t write this ourselves and are not the main authors in any case.

Anyway, if you guys think it should be included from now on in the mainline releases then let me know.

I think you’ve just provided the best answer yourself on a “better safe than sorry” basis - DON’T include any core ports that you haven’t maintained yourself for those very reasons you’ve mentioned, but on the other hand - if you are planning to make improvements to the core yourself, then perhaps you can add that core in future revisions of RetroArch.

I haven’t noticed the blue tint on PS3/ANDROID/PC ( but maybe because i have used 16bits colour instead of 32bits ) , and yes 3d games seems to not working (even freeze PS3) . Sound is very bad /slow on PS3/Android ( it’s only good enough on my pc ). But 2D games like Raymans , Pinball Fantasies seems to works well ( with sound on PC and without on Android/PS3 )

Yes , you’re probably right.

I think for now it’s only for testers not end users.

Thanks for the quick reply @squarepusher

Here is the blue i am speaking of on the PS3.

Speed is around 52-59 FPS. Game compatibility is great on 2D games. (only tried a few 3d ones but they didn’t start after the Jaguar logo) No sound Then the blue issue above

Best part of emulating the Jaguar is you don’t have to use the systems controller lol. i think the overall library is about 50 games. as its life span was short however there a few good titles.

Anyway, if you guys think it should be included from now on in the mainline releases then let me know.

If some improvements can be made, then I would yes even if 3d games do not work. If sound can be added and the blue removed then i would say for sure a yes :)., However this is just one man’s opinion :slight_smile:

The more Retro the better :slight_smile:

Lol ,

I’ve read the drama about this emulator ( wasn’t aware when i posting here) . but it does not interest me . Coder had better to code instead of talking , i thinks .

Ok , this is only because you don’t change the video buffer format !

As stated on the source code ( on libretro repository ) // Virtual Jaguar outputs RGBA, so convert to XRGB8888

And this can be simply done by :


//quickly
for(int i=0;i<320*240;i++)videoBuffer[i]=videoBuffer[i]>>8;
// or if you want the alpha component 
for(int i=0;i<320*240;i++)videoBuffer[i]= (videoBuffer[i]&0xff )<<24 |  videoBuffer[i]>>8  ;

otherwise , i’ve tested the v2.1.1 , but no noticeable change for speed or compatibility but i ve only test few game. v2.1.1 seems to kill joypad (up/down/rigth/left) for Rayman game , i had to revert joystick portion to v2.1.0

Edit: many games seems to need the dsp to works /start , so if no sound ,no dsp execution then games hangs :frowning:

Yeah I still don’t get why he acted like that - we tried being friendly at first but after he dissed libretro I felt I had to say something and that’s when the argument occurred.

Anyway - his ‘Qt port’ is in a similar semi-broken state - and it still has patchy gamepad support after over 10 years - so clobber and me just thought that going the libretro route would be a good idea for his emulator fork. Apparently he doesn’t agree.

Oh well.

Perhaps we’ll be looking into creating a MESS port of the Jaguar core as well since that reportedly works better (for a game like Tempest 2000) at this point.

Sorry to hear that @ squarepusher. Yes a MESS port would be great for libretro as well. That would be exciting to see.

On that note, if the N64 driver ever becomes actually usable, I’d like to see a port of that. Well, that or Cen64, but we’d have to wait and see how that thing fares, given that it’s supposed to be cycle-accurate.

[quote=“7rtype”] Lol ,

I’ve read the drama about this emulator ( wasn’t aware when i posting here) . but it does not interest me . Coder had better to code instead of talking , i thinks .

Ok , this is only because you don’t change the video buffer format !

As stated on the source code ( on libretro repository ) // Virtual Jaguar outputs RGBA, so convert to XRGB8888

And this can be simply done by :


//quickly
for(int i=0;i<320*240;i++)videoBuffer[i]=videoBuffer[i]>>8;
// or if you want the alpha component 
for(int i=0;i<320*240;i++)videoBuffer[i]= (videoBuffer[i]&0xff )<<24 |  videoBuffer[i]>>8  ;

otherwise , i’ve tested the v2.1.1 , but no noticeable change for speed or compatibility but i ve only test few game. v2.1.1 seems to kill joypad (up/down/rigth/left) for Rayman game , i had to revert joystick portion to v2.1.0

Edit: many games seems to need the dsp to works /start , so if no sound ,no dsp execution then games hangs :([/quote]

The reason this happens on PS3 is because I don’t bother with ‘color conversion’ on PS3 if the color format in a libretro port is set to RETRO_PIXEL_FORMAT_0RGB1555 (ie. the default in case your libretro port doesn’t use the RETRO_ENVIRONMENT_SET_PIXEL_FORMAT environment callback) - you are expected in a libretro port to either target RGB565 (16-bit) or RGB8888 (32-bit). Anything else most of the time is not an internal color format for most GPUs (and definitely not mobile ones) and will give you bad performance due to it having to ‘software color convert’ inside the OpenGL implementation before blitting.

On PC, if your libretro port doesn’t set color format to either RGB565 or RGB8888, it will fall back on software color converting to RGB8888. On consoles this would be undesirable either way hence why it’s customary for most libretro ports to set the color format explicitly.

Looks like we’ll just have to implicitly color convert to RGB8888 here and set the color format in the libretro port to RETRO_PIXEL_FORMAT_XRGB8888 unless there is a way to set up Virtual Jaguar for RGB565/RGB8888.

I am not sure to understand what if RGB8888 means R8G8B8X8 or X8R8G8B8 after all :frowning:

BTW if you want XRGB in VJAGUAR not very hard , I think you can get X8R8G8B8 in changing few code in tom.cpp . I have tested on PC ( but only with few game) and it’s seem to have good colours.

here is the change i made



/* first the lookup table */

void TOMFillLookupTables(void)
{
    // NOTE: Jaguar 16-bit (non-CRY) color is RBG 556 like so:
    //       RRRR RBBB BBGG GGGG
    for(uint32_t i=0; i<0x10000; i++)
        RGB16ToRGB32[i] = 0xFF000000
            |  (((i>>11)& 0x1f)<<3)<<16
            |  (((i>>6 )& 0x1f)<<3)
            |  (((i    )& 0x3f)<<2)<<8;


    for(uint32_t i=0; i<0x10000; i++)
    {
        uint32_t cyan = (i & 0xF000) >> 12,
            red = (i & 0x0F00) >> 8,
            intensity = (i & 0x00FF);

        uint32_t r = (((uint32_t)redcv[cyan][red]) * intensity) >> 8,
            g = (((uint32_t)greencv[cyan][red]) * intensity) >> 8,
            b = (((uint32_t)bluecv[cyan][red]) * intensity) >> 8;

        CRY16ToRGB32[i] = 0xFF000000 | (r << 16) | (g << 8) | b;
//        CRY16ToRGB32[i] = 0x000000FF | (r << 24) | (g << 16) | (b << 8);
        MIX16ToRGB32[i] = (i & 0x01 ? RGB16ToRGB32[i] : CRY16ToRGB32[i]);
    }
}

/* And elsewhere in the code if you see :*/

    //        uint32_t pixel = 0x000000FF | (r << 24) | (g << 16) | (b << 8);
/*change by*/
            uint32_t pixel = 0xFF000000 | (r << 16) | (g << 8) | (b << 0);

/*And */
    //        *backbuffer++ = 0x000000FF | (r << 24) | (g << 16) | (b << 8);
/*change by*/
            *backbuffer++ = 0xFF000000 | (r << 16) | (g << 8) | (b << 0);


Sounds like we might be able to avoid any color conversion whatsoever, set the pixel format to RGB565 instead on the libretro side and just ‘pass’ the framebuffer directly to video_cb.

Try to see if that’s possible.

RBG556? (seriously, who designs these consoles?) Well, still need some shifting action to RGB565 in that case.

yes strange resolution , but it’s only one of multiple available resolutions for the jag.

void tom_render_16bpp_cry_scanline(uint32_t * backbuffer); void tom_render_24bpp_scanline(uint32_t * backbuffer); void tom_render_16bpp_direct_scanline(uint32_t * backbuffer); void tom_render_16bpp_rgb_scanline(uint32_t * backbuffer); void tom_render_16bpp_cry_rgb_mix_scanline(uint32_t * backbuffer);

BTW , I’ve made the change for use native rgb565 in the emulator instead of rgba8888 . seems to work. now my main problem is sound , how to properly handle interrupt to run DSP and acquire ltxd/rtxd every 1000000/48000 Usec .

Actually , i have tested 2 poor methods : first is to run dsp 800 times after a frame finish . sound but not good. second is to run dsp in the frame loop . sound but worst than first , in 1 frame it only throw 526 dsp executions.

Stupid question , is there a proper way to sync Video / Sound with retroarch ?

Today i have tested for the first time VirtualJaguar on my I7 laptop ( on windows ) and now the speed is too high even with sound enable , audio sync enable , video sync on and hard gpu sync on . (around 200Fps for AVP / Rayman , 120 FPS for Tempest / Atarikart …) this change me from my old linux laptop ( witch i have around 45/60FPS)

So how can i slow down and sync it to 60 FPS ?


$ ../../../RetroArch/retroarch.exe  -L retro.dll -v  -c ./retroarch.cfg ../../.
./TMP/VJAG/Alien\ vs\ Predator\ \(1994\).jag
=== Build =======================================
Compiler: MinGW (4.8.0) 64-bit
Built: May 29 2013
=================================================
RetroArch: [CPUID]: Vendor: GenuineIntel
RetroArch: [CPUID]: SSE:  1
RetroArch: [CPUID]: SSE2: 1
RetroArch: [CPUID]: AVX:  1
RetroArch: Loading config from: ./retroarch.cfg.
=== Config ===
video_vsync = "true"
input_player1_a = "x"
input_player1_b = "z"
input_player1_x = "s"
input_player1_start = "enter"
input_player1_select = "rshift"
input_player1_l = "q"
input_player1_r = "w"
input_player1_y = "nul"
input_player1_left = "left"
input_player1_right = "right"
input_player1_up = "up"
input_player1_down = "down"
input_player1_joypad_index = "0"
input_player1_a_btn = "15"
input_player1_b_btn = "14"
input_player1_x_btn = "12"
input_player1_y_btn = "13"
input_player1_l_btn = "10"
input_player1_r_btn = "11"
input_player1_l2_btn = "8"
input_player1_r2_btn = "9"
input_player1_l3_axis = "+13"
input_player1_r3_btn = "2"
input_player1_start_btn = "3"
input_player1_select_btn = "0"
input_player1_left_btn = "7"
input_player1_up_btn = "4"
input_player1_right_btn = "5"
input_player1_down_btn = "6"
input_player1_l_x_plus_axis = "-0"
input_player1_l_y_plus_axis = "+1"
input_player1_l_x_minus_axis = "+0"
input_player1_l_y_minus_axis = "-1"
input_player1_r_x_plus_axis = "+2"
input_player1_r_y_plus_axis = "+3"
input_player1_r_x_minus_axis = "-2"
input_player1_r_y_minus_axis = "-3"
input_enable_hotkey = "f12"
=== Config end ===
RetroArch [WARN] :: system_directory is not set in config. Assuming system direc
tory is same folder as game: "../../../TMP/VJAG/".
RetroArch: Loading dynamic libretro from: "c:\LIBRETRO\1virtualjaguar-libretro-m
aster\virtualjaguar-libretro-master\libretro\retro.dll"
RetroArch: Version of libretro API: 1
RetroArch: Compiled against API: 1
RetroArch: Environ PERFORMANCE_LEVEL: 3.
RetroArch: ROM loading skipped. Implementation will load it on its own.
RetroArch: Environ SET_PIXEL_FORMAT: XRGB8888.
RetroArch: Set audio input rate to: 23980.00 Hz.
RetroArch: Adjusting aspect ratio to 1.33
RetroArch: Video @ 960x720
RetroArch: Setting multimedia scheduling for DWM.
RetroArch: Found GL context: wgl
RetroArch: Detecting screen resolution 1600x900.
RetroArch: [WGL]: wglSwapInterval(1)
RetroArch: Querying GL extension: ARB_sync => doesn't exist
RetroArch: GL: Using resolution 960x720
RetroArch: [GL]: Not loading any shader.
RetroArch: GL: Loaded 0 program(s).
RetroArch: Enumerating DInput joypads ...
RetroArch: Done enumerating DInput joypads ...
RetroArch: Found joypad driver: "dinput".
RetroArch: Using font rendering backend: freetype.
RetroArch: DirectSound devices:
RetroArch:      0: PÚriphÚrique audio principal
RetroArch:      1: JM01-22 (Son Intel(R) pour Úcrans)
RetroArch:      2: Haut-parleur/Ecouteurs (Realtek High Definition Audio)
RetroArch: [DirectSound]: Setting buffer size of 12288 bytes
RetroArch: [DirectSound]: Latency = 64 ms
RetroArch: Sinc resampler [SSE]
RetroArch: SINC params (8 phase bits, 16 taps).
RetroArch: [RGUI]: Opening history: ./.retroarch-history.txt.
RetroArch: Saving regular SRAM.
RetroArch: SRM: ../../../TMP/VJAG/Alien vs Predator (1994).srm
RetroArch: RTC: ../../../TMP/VJAG/Alien vs Predator (1994).rtc
RetroArch: Average audio buffer saturation: 41.43 %, standard deviation (percent
age points): 37.48 %.
RetroArch: Amount of time spent close to underrun: 46.94 %. Close to blocking: 2
8.01 %.
RetroArch: Average monitor Hz: 226.911731 Hz. (93.466 % frame time deviation, ba
sed on 2048 last samples).

The libretro core would have to block on audio.

sigh