Author Topic: Gambatte for Opendingux (accurate gameboy emulator)  (Read 8091 times)

abhoriel (OP)

  • Posts: 188
Gambatte for Opendingux (accurate gameboy emulator)
« on: February 12, 2012, 01:51:40 am »
This is a port of Gambatte to Opendingux. It's an accuracy-focused gameboy/gameboy color emulator, and is much more accurate than gnuboy. In spite of this, it seems to run all the gameboy games I've tried at full speed 60fps on the dingoo without overclocking.

This port has a simple menu, supports save/load/select state, and it uses Ayla's fullscreen scaler (as in his port of gnuboy).

Let me know if you have any problems or feature requests.

Source coming soon.

Binary, with icon:
http://www.mediafire.com/download.php?ac36rguxjsalf99

edit: Doesn't work on legacy.
« Last Edit: February 12, 2012, 12:03:18 pm by abhoriel »

zear

  • * Moderator
  • Posts: 2381
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #1 on: February 12, 2012, 03:25:53 am »
It segfaults for me on OD.

qbertaddict

  • * Former Staff
  • The Doctor
  • Posts: 1184
    • about.me
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #2 on: February 12, 2012, 08:58:58 am »
works for me in opendingux using the browser but it does not work in legacy dingux at all

no1

  • Posts: 9
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #3 on: February 12, 2012, 11:22:37 am »
I have ILI9338 and all the recent O.Dingux ports are crashing for me. Pre-release 2.
« Last Edit: February 12, 2012, 12:03:19 pm by sirrozha »

abhoriel (OP)

  • Posts: 188
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #4 on: February 12, 2012, 12:02:52 pm »
It segfaults for me on OD.

What version of OD are you using? I'm still using prerelease 2. I should probably test it on a newer build :)

hi-ban

  • Posts: 886
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #5 on: February 12, 2012, 12:05:35 pm »
Here is the code for a 1.5x scaler Ayla wrote for Ohboy. You can use it in Gambatte if you want.

Code: [Select]
/*Ayla's 1.5x Upscaler - 160x144 to 240x216 */
/* Before:
*    a b c d
*    e f g h
*
* After (parenthesis = average):
*    a      (a,b)      b      c      (c,d)      d
*    (a,e)  (a,b,e,f)  (b,f)  (c,g)  (c,d,g,h)  (d,h)
*    e      (e,f)      f      g      (g,h)      h
*/
void ayla_scale15x(uint32_t *to, uint32_t *from){
uint32_t reg1, reg2, reg3, reg4, reg5;
size_t x, y;

for (y=0; y<216/3; y++) {
for (x=0; x<240/6; x++) {
__builtin_prefetch(to+4, 1);

// Read b-a
reg1 = *from;
reg5 = reg1 >> 16;
reg2 = (reg1 & 0xf7de0000) >> 1;
reg1 &= 0xffff;
reg1 |= reg2 + ((reg1 & 0xf7de) << 15);

// Write (a,b)-a
*to = reg1;
reg1 = (reg1 & 0xf7def7de) >> 1;

// Read f-e
reg3 = *(from++ + 160/2);
reg2 = reg3 >> 16;
reg4 = (reg3 & 0xf7de0000) >> 1;
reg3 &= 0xffff;
reg3 |= reg4 + ((reg3 & 0xf7de) << 15);

// Write (e,f)-e
*(to + 2*320/2) = reg3;
reg3 = (reg3 & 0xf7def7de) >> 1;

// Write (a,b,e,f)-(a,e)
*(to++ + 320/2) = reg1 + reg3;

// Read d-c
reg1 = *from;

// Write c-b
reg5 |= (reg1 << 16);
*to = reg5;
reg5 = (reg5 & 0xf7def7de) >> 1;

// Read h-g
reg3 = *(from++ + 160/2);

// Write g-f
reg2 |= (reg3 << 16);
*(to + 2*320/2) = reg2;
reg2 = (reg2 & 0xf7def7de) >> 1;

// Write (c,g)-(b,f)
*(to++ + 320/2) = reg2 + reg5;

// Write d-(c,d)
reg2 = (reg1 & 0xf7def7de) >> 1;
reg1 = (reg1 & 0xffff0000) | ((reg2 + (reg2 >> 16)) & 0xffff);
*to = reg1;
reg1 = (reg1 & 0xf7def7de) >> 1;

// Write h-(g,h)
reg2 = (reg3 & 0xf7def7de) >> 1;
reg3 = (reg3 & 0xffff0000) | ((reg2 + (reg2 >> 16)) & 0xffff);
*(to + 2*320/2) = reg3;
reg3 = ((reg3 & 0xf7def7de) >> 1);

// Write (d,h)-(c,d,g,h)
*(to++ + 320/2) = reg1 + reg3;
}

to += 2*360/2;
from += 160/2;
}
}

zear

  • * Moderator
  • Posts: 2381
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #6 on: February 12, 2012, 12:07:21 pm »
It segfaults for me on OD.

What version of OD are you using? I'm still using prerelease 2. I should probably test it on a newer build :)
I'm using a newer version than the latest preview release. My build should be close to the final one.

qbertaddict

  • * Former Staff
  • The Doctor
  • Posts: 1184
    • about.me
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #7 on: February 12, 2012, 12:14:37 pm »
Im using pre-release 2

abhoriel (OP)

  • Posts: 188
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #8 on: February 12, 2012, 12:17:29 pm »
ok, so it works fine in prerelease 2, but not in very new OD builds. I'll compile a newer OD and see if I can get this issue fixed.

hi-ban, thanks, I didn't know about that scaler :) I'll add it. As it retains the original aspect ratio, it would be a good one to have.

elrichard

  • Posts: 35
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #9 on: February 12, 2012, 03:22:48 pm »
This is probably the ultimate GB/GBC emulator for OD, I tested it on prerelease 2 and works flawlessly. I have to give it a try with some other games to see if performance is affected. Great job guys!

abhoriel (OP)

  • Posts: 188
Re: Gambatte for Opendingux (accurate gameboy emulator)
« Reply #10 on: February 12, 2012, 05:03:25 pm »
This is probably the ultimate GB/GBC emulator for OD, I tested it on prerelease 2 and works flawlessly. I have to give it a try with some other games to see if performance is affected. Great job guys!

Yeah, most games perform very well. A few games don't however!

Some people have been having seg faults when using this. I believe this is because you are using newer versions of OD. I am using OD prerelease 2, and this is compiled with the OD prerelease 2 toolchain. Ayla compiled a binary using a newer toolchain, and his binary works fine on his newer version of OD (although it crashes on my OD). This makes it impossible to have a binary that works for everyone.

If you are using a newer version of OD, then you can compile the source yourself using a newer toolchain. The source is here: https://code.google.com/p/gambatte-opendingux/

When OpenDingux is actually released (which I am told will be very soon), I will release a binary for it and it should work for everyone, as everyone will be using the same build and the same toolchain :)

Here is a binary update:
http://www.mediafire.com/download.php?vstgnqxafp9bf0b

This binary includes Ayla's 1.5x scaler as hi-ban suggested :)

edit: if you had a seg fault before, you will still have a seg fault now. This build will work for people who are using OD prerelease 2.
« Last Edit: February 12, 2012, 05:06:35 pm by abhoriel »

 

Post a new topic