Author Topic: Dingear v0.2 (preview) - Another smsplus port but with a major twist.  (Read 10561 times)

hitchhikr (OP)

  • Posts: 66
Hi,

Here is the preview of another port of SMSPLUS but specifically crafted for the Dingoo console.
There's still several small issues and no decent menus yet
however it already have some exclusive features i haven't found in other emulators:

- Fullscreen with bilinear filtering (ipu).
- Hardware vsync on both tvout & lcd.
- Full framerate (obtained via heavy use of the processor mxu and the ipu running in parallel).

http://franck.charlet.pagesperso-orange.fr/temp/DINGEAR.zip

Commands are:

Left trigger: reset (sms)
Right trigger: exit
B: button 1
Y: button 2
Select: full screen on/off
Start: start (gg)
« Last Edit: December 15, 2010, 09:15:30 pm by hitchhikr »

clach04

  • Posts: 256
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #1 on: December 14, 2010, 03:19:36 am »
- Fullscreen with bilinear filtering (ipu).

This is very cool, works great on my (ILI9331_3) machine, I'd be very interested in seeing the code for this.

Commands are:

Left trigger: reset (sms)
Right trigger: exit
B: button 1
Y: button 2
Select: full screen on/off
Start: start (gg)

I tried blockhead and baku maku animal, and the only buttons that work for me are select (full screen), D-pad and Right trigger (quit).  I can't get reset or the fire buttons to work.

This looks very promising (especially the IPU scalar), I'm looking forward to new releases. If we could get  IPU scaling into SDL without messing with YUV that would be very cool!

I thought I'd backed up SMSggoo, and then restored it correctly (after power off), I now can't load SMS/gg roms, getting "simulator not exit, download please!". Any ideas?

[edit, re-copying .sim file a few times seemed to do the trick, not sure why a 1 copy/reset wasn't enough  ::)]
« Last Edit: December 14, 2010, 03:45:42 am by clach04 »

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #2 on: December 14, 2010, 09:20:42 am »
Quote
I tried blockhead and baku maku animal, and the only buttons that work for me are select (full screen), D-pad and Right trigger (quit).  I can't get reset or the fire buttons to work.

Fixed it for Baku Baku Animals, the start button of the title is actually the pause button. (btw, the rom you're referring to is marked "B"(ad) for a reason). I also tried blockhead on another emulator and it doesn't seem to have any fire button implemented, it looks like the preview of a never completed game.

Quote
This looks very promising (especially the IPU scalar), I'm looking forward to new releases. If we could get  IPU scaling into SDL without messing with YUV that would be very cool!

The use of YUV components is mandatory.

Quote
I thought I'd backed up SMSggoo, and then restored it correctly (after power off), I now can't load SMS/gg roms, getting "simulator not exit, download please!". Any ideas?

Delayed writing ?

pcercuei

  • Posts: 1667
    • My devblog
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #3 on: December 14, 2010, 12:14:34 pm »
- Fullscreen with bilinear filtering (ipu).
What's the point to do it using the IPU? It would be faster in software.

- Hardware vsync on both tvout & lcd.
Now, that is interesting, how is it done?
The VBLANK interrupt line of the LCD is not connected on dingoo...

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #4 on: December 14, 2010, 12:34:31 pm »
Quote
What's the point to do it using the IPU? It would be faster in software.

No, it's faster with the IPU, thrust me i tried all other solutions (MXU included).

Quote
Now, that is interesting, how is it done?
The VBLANK interrupt line of the LCD is not connected on dingoo...

Careful calibration & configuration of the LCD.

darfgarf

  • Guest
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #5 on: December 14, 2010, 02:04:13 pm »
thrust me i tried all other solutions (.

well if you really want :P

pcercuei

  • Posts: 1667
    • My devblog
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #6 on: December 14, 2010, 05:01:31 pm »
Quote
What's the point to do it using the IPU? It would be faster in software.

No, it's faster with the IPU, thrust me i tried all other solutions (MXU included).

MXU is useless for scaling, as there are no bit-shifting opcodes.

But I still highly doubt the IPU is faster, as it takes more processing time to convert an entire image to YCbCr rather than scaling it up. I made a software scaler for GBA, that scales 240x160 games up to 320x240, and it eats ~900ms to process 600 frames with bilinear filtering. Could try to do the same with the IPU (process 600 times a 240x160 buffer in memory) so that we can benchmark it? It would be really interesting to see, and I'd be the first working on it if it proves to be faster :)

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #7 on: December 14, 2010, 06:49:51 pm »
Quote
MXU is useless for scaling, as there are no bit-shifting opcodes.

http://dingoowiki.com/index.php?title=Development:MXU#Shift_and_Shuffle_Instructions

The MXU code i didn't use for scaling looks like this (Input is RGB 888, output is RGB 565, rotated 90?):

Code: [Select]
for(j = 0; j < 240; j++)
{
 S32LDI(xr11, table_nibble_y_100, 4);
 S32LDI(xr12, table_nibble_y, 4);
 table_nibble_x_b = table_nibble_x;
 table_nibble_x_100_b = table_nibble_x_100;
 src_y = (int) (tmp_sourceb + table_step_y[j]);
 k = 0;
 for(i = 0; i < 320; i++)
 {
  x1 = (uint32 *) (table_step_x[i] + src_y);
  S32LDI(xr9, table_nibble_x_100_b, 4);
  S32LDI(xr10, table_nibble_x_b, 4);
  S32LDD(xr1, x1, 0);
  S32LDD(xr3, x1, 4);
  S32LDD(xr5, x1, (256 * 4));
  S32LDD(xr7, x1, ((1 + 256) * 4));
  Q8ADDE_AA(xr1, xr1, xr0, xr2);
  Q8ADDE_AA(xr3, xr3, xr0, xr4);
  Q8ADDE_AA(xr5, xr5, xr0, xr6);
  Q8ADDE_AA(xr7, xr7, xr0, xr8);
  D16MADL_AA_WW(xr0, xr1, xr9, xr1);
  D16MADL_AA_WW(xr1, xr3, xr10, xr3);
  D16MADL_AA_WW(xr0, xr5, xr9, xr5);
  D16MADL_AA_WW(xr5, xr7, xr10, xr7);
  Q16SLR(xr3, xr3, xr7, xr7, 8);
  D16MADL_AA_WW(xr0, xr3, xr11, xr3);
  D16MADL_AA_WW(xr3, xr7, xr12, xr7);
  D16MADL_AA_WW(xr0, xr2, xr9, xr2);
  D16MADL_AA_WW(xr2, xr4, xr10, xr4);
  D16MADL_AA_WW(xr0, xr6, xr9, xr6);
  D16MADL_AA_WW(xr6, xr8, xr10, xr8);
  Q16SLR(xr4, xr4, xr8, xr8, 8);
  D16MADL_AA_WW(xr0, xr4, xr11, xr4);
  D16MADL_AA_WW(xr4, xr8, xr12, xr8);
  Q16SLR(xr4, xr4, xr8, xr8, 8);
  r = S32M2I(xr7) & 0xf800;
  g = S32M2I(xr8) >> 11;
  b = S32M2I(xr8);
  dest[k] = r | g | b;
  k += height;
 }
 dest++;
}

This isn't entirely optimal and the inner loop could be improved a bit.

Quote
But I still highly doubt the IPU is faster, as it takes more processing time to convert an entire image to YCbCr rather than scaling it up. I made a software scaler for GBA, that scales 240x160 games up to 320x240, and it eats ~900ms to process 600 frames with bilinear filtering. Could try to do the same with the IPU (process 600 times a 240x160 buffer in memory) so that we can benchmark it? It would be really interesting to see, and I'd be the first working on it if it proves to be faster

I don't have time for all this but the IPU method is necessary faster since it's running in parallel with the CPU which can be devoted to another task meanwhile, so the scaling can almost come for free by correctly scheduling both chips (at first i wasn't sure if the memory bandwidth could handle the strain but it all went ok after all). I avoided the YUV conversion as the colors written by the emulator on a per line basis are already in the correct format and not in RGB when scaling have to be done.
« Last Edit: December 14, 2010, 06:55:02 pm by hitchhikr »

pcercuei

  • Posts: 1667
    • My devblog
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #8 on: December 14, 2010, 07:50:16 pm »
Quote
MXU is useless for scaling, as there are no bit-shifting opcodes.

http://dingoowiki.com/index.php?title=Development:MXU#Shift_and_Shuffle_Instructions

Err I'm sorry, I meant bit masking instructions (and, or, xor...). My bad.

Quote
But I still highly doubt the IPU is faster, as it takes more processing time to convert an entire image to YCbCr rather than scaling it up. I made a software scaler for GBA, that scales 240x160 games up to 320x240, and it eats ~900ms to process 600 frames with bilinear filtering. Could try to do the same with the IPU (process 600 times a 240x160 buffer in memory) so that we can benchmark it? It would be really interesting to see, and I'd be the first working on it if it proves to be faster

I don't have time for all this but the IPU method is necessary faster since it's running in parallel with the CPU which can be devoted to another task meanwhile, so the scaling can almost come for free by correctly scheduling both chips (at first i wasn't sure if the memory bandwidth could handle the strain but it all went ok after all). I avoided the YUV conversion as the colors written by the emulator on a per line basis are already in the correct format and not in RGB when scaling have to be done.

Ok, indeed it is faster if the input is already in the correct form. But that it is not reproductible with other emulators, as they usually output to RGB, and it takes more time to convert to the right form than it takes to scale up the picture.
« Last Edit: December 15, 2010, 07:07:52 am by Ayla »

Reesy

  • Posts: 57
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #9 on: December 14, 2010, 08:52:44 pm »
Hi hitchhikr,

I've tried your port on 9325 hardware and I get

1) no sound at all
2) screen is draw inverted...its very wierd :). If I hold my dingoo to a mirror, the screen looks perfect. In fact even when you exit the emulator the original dingoo menus are inverted too.
3) the emulation resets itself continously.

So not so good I'm afraid.

Later
Reesy

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #10 on: December 14, 2010, 11:24:12 pm »
Quote
Hi hitchhikr,

I've tried your port on 9325 hardware and I get

1) no sound at all
2) screen is draw inverted...its very wierd Smiley. If I hold my dingoo to a mirror, the screen looks perfect. In fact even when you exit the emulator the original dingoo menus are inverted too.
3) the emulation resets itself continously.

So not so good I'm afraid.

Later
Reesy

Thanks for the test, i probably modified a register that have a slightly different meaning on such LCD screens i'll check the docs.
The sound routine is really unstable & lame so that's probably the cause of the resets, i'm rewriting it anyway. Patience.

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.1 (preview) - Another smsplus port but with a major twist.
« Reply #11 on: December 15, 2010, 05:20:54 pm »
v0.2 released.

- Sound engine rewritten.
- Hopefully working properly on ili9325 based consoles.

Reesy

  • Posts: 57
Re: Dingear v0.2 (preview) - Another smsplus port but with a major twist.
« Reply #12 on: December 15, 2010, 08:23:05 pm »
I can hear sound now, which is nice and clear and sounds great...however the emulation stills resets intermittently and the screen is still inverted.

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.2 (preview) - Another smsplus port but with a major twist.
« Reply #13 on: December 15, 2010, 08:28:21 pm »
Is it inverted vertically or horizontally ? And how's the frame rate do animations look smooth ?

Reesy

  • Posts: 57
Re: Dingear v0.2 (preview) - Another smsplus port but with a major twist.
« Reply #14 on: December 15, 2010, 08:44:43 pm »
Framerate looks good, its very smooth.

The screen is inverted vertically only

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.2 (preview) - Another smsplus port but with a major twist.
« Reply #15 on: December 15, 2010, 08:51:06 pm »
http://franck.charlet.pagesperso-orange.fr/temp/DINGEAR_flip.zip

Try that one, for the reset i don't know yet, does it reset in tvout mode too ?

Reesy

  • Posts: 57
Re: Dingear v0.2 (preview) - Another smsplus port but with a major twist.
« Reply #16 on: December 15, 2010, 08:59:40 pm »
The screen now looks correct while running the emulator but the dingoo menus are still vertically inverted when you exit the emulator.  Emulator still crashes all over the place, I do not have my TV out cable at the moment but I'll have a go tomorrow and let you know.

The filtering looks really good by the way, I hope you get this working :)

hitchhikr (OP)

  • Posts: 66

SiENcE

  • Posts: 653
    • Crank Gaming (Dingux Apps)
Re: Dingear v0.2 (preview) - Another smsplus port but with a major twist.
« Reply #18 on: December 16, 2010, 01:31:02 pm »
@hitchhikr: Can you share the IPU and MXU knowledge/code for scaling and bilinear filtering? Wiki is maybe the best way to place/share.

Maybe others would like to add it to thier emus/apps.

hitchhikr (OP)

  • Posts: 66
Re: Dingear v0.2 (preview) - Another smsplus port but with a major twist.
« Reply #19 on: December 16, 2010, 06:01:54 pm »
Not before everything is fine tuned and working perfectly that's for sure.

 

Post a new topic
Post a new topic