Author Topic: New PCE/TG16, Supergrafx emulator  (Read 758 times)

AamirM

  • Newbie
  • *
  • Posts: 11
New PCE/TG16, Supergrafx emulator
« on: December 06, 2008, 01:41:05 AM »
Hi,

I developed a PCE/TG16, Supergrafx emulator focusing on being as accurate as possible. Just wanted to share it here. Download it from here. Note that Avira antivirus will give a false positive on the included file because I used UPX. It has been reported and it will get fixed (full details here). Also, due to the way it emulates the hardware, it requires a rather powerful PC to run.

Comments, suggestions etc... are welcomed.

stay safe,

AamirM

Tom

  • Guest
Re: New PCE/TG16, Supergrafx emulator
« Reply #1 on: December 06, 2008, 03:04:26 AM »
Comments:

 You have some timing issues for latching X/Y on a scanline.
 No support for B&W mode.
 Some anomalies in the audio hardware. 10bit audio paired channels don't work correctly (might be in your mixing).
 Noticed a weird artifact in VPC emulation for SGX.
 some demos don't run (i.e. blank screen). My LFO test rom doesn't work either, so I couldn't check out LFO accuracy

 

AamirM

  • Newbie
  • *
  • Posts: 11
Re: New PCE/TG16, Supergrafx emulator
« Reply #2 on: December 06, 2008, 03:50:59 AM »
Hi,

Quote
You have some timing issues for latching X/Y on a scanline.
Hmmm.....any examples? I mean, how did you found out? Is there any game which is having a problem because of this?

Quote
No support for B&W mode.
It *is* supported. I just realized I made a silly mistake in the code :oops: . Enable the brighten option and it should work ;) . The bug will be fixed in the next version.

Quote
Some anomalies in the audio hardware. 10bit audio paired channels don't work correctly (might be in your mixing).
Noticed a weird artifact in VPC emulation for SGX.
Again, I will need something which does this to fix it. It seems you have some test program. Can you give them to me?
Also, which wierd artifact are you referring to? Where does it happen?

Quote
some demos don't run (i.e. blank screen). My LFO test rom doesn't work either, so I couldn't check out LFO accuracy
If its possible, give them to me and I'll try to fix my emu. Also, LFO is not supported atm.

Thanks for the comments. Keep them comin' ;) .

stay safe,

AamirM

Tom

  • Guest
Re: New PCE/TG16, Supergrafx emulator
« Reply #3 on: December 06, 2008, 05:10:06 AM »
Quote
Hmmm.....any examples? I mean, how did you found out? Is there any game which is having a problem because of this?


 Here's a *few* to test roms:
http://pcedev.net//test_roms/bloodyw_.pce  - enter the game, the game area screen below the status bar should be jumping. (Yes, jumping) Later levels for vertical scrolling parts, you should see the 'sew' line for when they used an Hsync to sew the BG together, skipping over the status bar section in the BAT. This game tries to access the upper 128k, but that's open BUS. You'll have problems with that later in Camp California if you get into emulating CD games.
http://pcedev.net//test_roms/lfo_test2.pce - LFO test app. Not just LFO, it won't let the user change the first four ram values.
http://pcedev.net//test_roms/pcmplay.pce - 10bit pcmplay demo. It might a sample thing your doing? What rate are you sampling audio register writes?
http://pcedev.net//test_roms/SGXdemo.pce - walk Link under the windows. He appears to have some horizontal interleaving of missing pixels?
http://pcedev.net//test_roms/sigma_star.pce - another scroll latch test. the third cloud scroll from the top. It shouldn't have the line of the next scroll below it (it showing two long pixels of that scroll on TE).

 Some of the other demos are private and I probably don't have permission to give them out (the ones that show a blank screen). You might want to check out Chris Covell's demos too. His axelay SGX demo only showed a black screen.
« Last Edit: December 06, 2008, 05:14:32 AM by Tom »

AamirM

  • Newbie
  • *
  • Posts: 11
Re: New PCE/TG16, Supergrafx emulator
« Reply #4 on: December 06, 2008, 05:28:46 AM »
Thanks. I'll be looking at them shortly. Is there any way you can get permission to give private demos to me? :)

Btw, did B&W mode worked?

EDIT:

Okay just tried them out. All the demos, except the last two, don't work (in mednafen as well). But that maybe because of a problem in the emulator. I'll try to fix the bugs. Also, Chris Covell's axelay demo works here. Are you loading it through "Load Supergrafx ROM"?

stay safe,

AamirM
« Last Edit: December 06, 2008, 06:34:50 AM by AamirM »

Tom

  • Guest
Re: New PCE/TG16, Supergrafx emulator
« Reply #5 on: December 06, 2008, 08:41:54 AM »

 Ohh! The SGX rom you have to rename it with the .sgx extension for mednafen to play it correctly (in SGX mode). Sorry about that.

 Also, Sigma_star shows fine in the version of mednafen that I have (0.8.A). It shows wrong in yame as well.

 Yeah, I forgot the axelay demo rom that I had was modified for SCD :D

nodtveidt

  • Guest
Re: New PCE/TG16, Supergrafx emulator
« Reply #6 on: December 07, 2008, 10:02:01 AM »
Hey, this isn't a half bad emulator. No CD emulation though?

AamirM

  • Newbie
  • *
  • Posts: 11
Re: New PCE/TG16, Supergrafx emulator
« Reply #7 on: December 07, 2008, 05:48:26 PM »
Quote
Hey, this isn't a half bad emulator. No CD emulation though?
Well, I'll be honest and say that CD emulation will be worked on when I get my hands on some CDROMs first ;) . But yeah, my goal is to get it working decently in the next version. The HuCard support is already very good (in terms game compatibility) and there are only three games (Battle Royale, Double Dugneons and Champions Forever Boxing) I am aware of which do not work. Two of them (Double Dugneons and Champions Forever Boxing) I fixed yesterday so there is only one game now that doesn't work. And even that is due to edge case timer behaviour. I wanted to get good VDC/VCE and CPU emulation first so that when there are problems with CDROM games, I can be sure it isn't the CPU or VDC. But as it turns out due to the testing of Tom here, I am not quite there yet.

Mednafen

  • Full Member
  • ***
  • Posts: 140
Re: New PCE/TG16, Supergrafx emulator
« Reply #8 on: December 08, 2008, 01:55:07 PM »
Here's a sadistic test for your HuC6280/VDC emulation: http://sarsie.fobby.net/junk/irq3.zip
It should display a picture of Bob Dole for a fraction of a second, and then the Lord of Nightmares wielding a shovel.

If it only shows Bob Dole, the test fails. :b

Two rather prominent HuCard games that I know rely on correctly emulating what this test tests: Jackie Chan's Action Kung Fu(may work correctly even if you emulate it incorrectly), and Final Soldier(will be in "vibrating mode" unless you emulate it correctly ;)).

The reason this issue comes up is because the games erroneously(I presume, though I didn't read the programmers' minds) do:

cli
lda $0000

when they should've done:

lda $0000
cli

"CLI/SEI changes to the I flag are delayed by 1 instruction" is only a convenient generalization to inner 6502-family behavior, which works on most cases, but not all.

You need to sample the external IRQ inputs masked against the I flag before the action of the last effective cycle of the current instruction is completed(be it setting/clearing the I flag, or doing a read).

This "CLI/acknowledge" double-IRQ issue does not appear to affect timer IRQs, interestingly enough.  Though I acknowledged the timer IRQ with a write...it's always possible that the IRQ sampling semantics are different on a write than a read, though I doubt it, it's probably just a timer nuance. (But I'll try to remember to test it sometime)

AamirM

  • Newbie
  • *
  • Posts: 11
Re: New PCE/TG16, Supergrafx emulator
« Reply #9 on: December 08, 2008, 04:12:41 PM »
Quote
If it only shows Bob Dole, the test fails. :b

Failure :( .

Quote
Two rather prominent HuCard games that I know rely on correctly emulating what this test tests: Jackie Chan's Action Kung Fu(may work correctly even if you emulate it incorrectly), and Final Soldier(will be in "vibrating mode" unless you emulate it correctly ;)).

Both of these games work correctly in TE (Final Soldier isn't vibrating :dance: ). And yes, I am simply just delaying irq by 1 instruction on CLI/SEI. I did this to make Blodia boot. I didn't knew these games relied on it as well.

Quote
You need to sample the external IRQ inputs masked against the I flag before the action of the last effective cycle of the current instruction is completed(be it setting/clearing the I flag, or doing a read).

Thanks. I'll do it this way.

sunteam_paul

  • Hero Member
  • *****
  • Posts: 4732
Re: New PCE/TG16, Supergrafx emulator
« Reply #10 on: December 09, 2008, 05:13:44 AM »
This seems like a really good emulator. It will need something pretty unique to pull me away from Magic Engine though...like a tile viewer/exporter/importer or something neat like that  :D
The PC Engine Software Bible
Quote from: Tatsujin
I just felt in a hole!

AamirM

  • Newbie
  • *
  • Posts: 11
Re: New PCE/TG16, Supergrafx emulator
« Reply #11 on: December 09, 2008, 06:31:33 AM »
Debugging features will come with time ;) . That is, when I have some free time :D .

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: New PCE/TG16, Supergrafx emulator
« Reply #12 on: December 09, 2008, 10:56:49 AM »
Ootake pulled me away from Magic Engine quite handily. It just works better.

It took a while, but PCE emulators are actually in good shape right now. There's a lot of competition. If you want to be a hero, build in all the TAS functions they people at tasvideos.org want so PCE games can start showing up on their site.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

AamirM

  • Newbie
  • *
  • Posts: 11
Re: New PCE/TG16, Supergrafx emulator
« Reply #13 on: December 09, 2008, 08:01:33 PM »
Quote
It took a while, but PCE emulators are actually in good shape right now. There's a lot of competition. If you want to be a hero, build in all the TAS functions they people at tasvideos.org want so PCE games can start showing up on their site.
Well, I am not competing with any emulator ( :^o ). Just doing it for fun. And, I am not trying to be a hero ( :^o x2). Which means I am too lazy to work on TAS stuff atm. I have to get CDROM working first.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: New PCE/TG16, Supergrafx emulator
« Reply #14 on: December 10, 2008, 12:54:24 AM »
Well, either way, I'm sure your hard work will be recognized, especially in this community. Even if it doesn't become the emulator of choice I'm sure you'll end up contributing something valuable.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c