What's new

PC-Engine

AamirM

New member
Hi,

Finally got some free time :) . One important thing first, Avira will give a false positive on the file. Just ignore it :) .

I am curious as to what you mean by "cycle by cycle" - it seems to imply that emulation is done at precision that's higher than one instruction at a time. But with the way you're describing the emulation of VDC and PSG there are no state changes that can happen inbetween instructions. Technically state changes can happen inbetween instructions, but the only feedback that can happen must be done at instruction edges. Likewise, CPU internal state only changes mid-instruction.

It's also unclear if you're referring to CPU cycles or master cycles. But since you mentioned the "fast" clock as being relevant then I'll assume you mean CPU cycles.
In the last cycle of each executed instruction, it is tested if there is any feedback (IRQs). So yes, feedback is done only on instruction edges. And I am referring to CPU cycles.

You may have to emulate it at 3.58MHz, 7.16MHz, or perhaps even 21.477MHz, if you want to be totally completely accurate; some tests I had a friend run on his PC Engine/SuperGrafx/CoreGrafx(can't remember) produced some very peculiar results that led me to believe the HuC6280 is creating different volume levels through high-frequency PWM, though I haven't confirmed it with an oscilloscope or anything. Of course, you don't need to emulate that to get games running acceptably...
I did originally ran the PSG at 3.58MHz. But it was very slow so I had to ditch this option for now. I am now thinking of making use of dual core and doing PSG/resampling on the other core. And in your tests, were you testing in noise mode? Noise levels can behave strangely. Good to see you here, btw.

Does the new TurboEngine handle the "SPEED-UP" password in Youkai Douchuuki correctly?
I haven't checked. Will check it out soon.

AamirM, please upload an example cheat file (in .dat format). And whether you will add built-in cheat finder like ArtMoney?
A cheat searcher will be added. Also if you can give me some cheats then I can make a cheat file ;) .

stay safe,

AamirM
 
OP
E

Exophase

Emulator Developer
In the last cycle of each executed instruction, it is tested if there is any feedback (IRQs). So yes, feedback is done only on instruction edges. And I am referring to CPU cycles.

Every PC-Engine emulator that I'm aware of ends up with effectively the same accuracy; it's just a question of how fast their implementation is. There's no reason why you should have to test it on every instruction because there are usually guarantees that let you run many cycles in a row without there being any risk of IRQs occuring. The exception is when certain memory ranges are accessed or when interrupts transition from disabled to enabled (also can be done by memory accesses), but these things just need to be handled individually.

Of course, doing it the way you are shouldn't necessarily be that slow. Mednafen does it this way and it's still decently fast. Ootake on the other hand...

Er, also, just in case you're wondering, I'm not avoiding you, I think there are major time zone differences between us >_> You can only really count on me being active on IRC or MSN after 6-7PM EST on Monday through Friday, and a few hours before that on the weekends.
 

AamirM

New member
Hi,
Exophase said:
Er, also, just in case you're wondering, I'm not avoiding you
No, no, no. I didn't thought of it that way. I understand everyone has their own job/work etc.. I myself got a bit free just yesterday ;) .

Double Dungeons doesn't work. Every dump ends up with a blank screen.
Yep, I am aware of that problem. Its timer doesn't seems to be working correctly. The other two non-working games that I am aware of is Battle Royale and Champions Forever Boxing.

EDIT:
I fixed both Double Dungeons and Champions Forever Boxing. There was a minor problem is the timer. But Battle Royale still doesn't run.

stay safe,

AamirM
 
Last edited:

Aladar

New member
Hi to all, recently I have completed a first version of my emulator.
This version is experimental and largely incomplete but the emulated CPU,
excluding small things, is INDISTINGUISHABLE from a real CPU.
This is the result of two years of work and hundreds of tests.
Besides, on my site there is a document with the description of the
instruction cycles in each addressing mode. Note: I have tested
every single cycle.
I hope that this can help.
If you are interested, visit my site at www.webalice.it/cicciopetito/.
 

AamirM

New member
Hi,

Aladar said:
Hi to all, recently I have completed a first version of my emulator.
This version is experimental and largely incomplete but the emulated CPU,
excluding small things, is INDISTINGUISHABLE from a real CPU.
This is the result of two years of work and hundreds of tests.
Besides, on my site there is a document with the description of the
instruction cycles in each addressing mode. Note: I have tested
every single cycle.
I hope that this can help.
If you are interested, visit my site at www.webalice.it/cicciopetito/.
O_O Great work! :) . Though the cycle timings are somewhat different in my emulator. How did you tested out the timings? Also, GCC spits out some error during compilation. Nice work again. Its about time some activity happens in PCE emu scene I guess ;) .

stay safe,

AamirM
 

Aladar

New member
Thanks AamirM! Take the revision 'a' from my site.
I have tested the single cycles in various ways, for example, executing code in the
hardware page($FF)(read cycles) or writing the BAT during the visualization(write cycles).
 

Neville

New member
I'm having some trouble here with the v0.2 release, switching to fullscreen causes a fatal error.



I'm running Windows XP SP3, my videocard is an NVIDIA 7600GT AGP and the latest drivers installed (I'm assuming it's a video issue) are release 178.24.

Also, I couldn't help but notice that if I redefine keys for a 6 button pad, the program asks for exactly the same functions as with a 3 button pad.

Still, it's great to see the emulator is still in development, it may be a bit rough around the edges but I prefer it to most of the current PC Engine emulators out there.
 

malducci

New member
Thanks AamirM! Take the revision 'a' from my site.
I have tested the single cycles in various ways, for example, executing code in the
hardware page($FF)(read cycles) or writing the BAT during the visualization(write cycles).

You're only adding an additional CPU cycle for 000-$7ff in the hardware bank, right?

I looked at your instruction cycle chart. Everything looks like it matches up with the Develo manual listing (except for the two known misprints in the manual).

Are you adding an additional 3 cycles (R-M-W) for T flag instructions?
 

Aladar

New member
You're only adding an additional CPU cycle for 000-$7ff in the hardware bank, right?

Yes, for now my emulator simply adds a cycle, but during the tests, for correct results,
I have also considered possible wait states introduced by the register VRR/VWR.

Are you adding an additional 3 cycles (R-M-W) for T flag instructions?

Yes, however, for every doubt on the addressing modes, read the document in the file
'addr_modes.zip' on my site; my emulator faithfully follows it.
 

malducci

New member
Yes, for now my emulator simply adds a cycle, but during the tests, for correct results,
I have also considered possible wait states introduced by the register VRR/VWR.
.

That's going to be a bit tricky if you emulate /BUSY of the VDC. It's fractional of a single cpu cycle and can be even less than a single cpu master clock (21mhz).

Edit:

Doing an approximation would probably be fine. I know of two instances where /BUSY can really effect VRAM read/writes - stalling the cpu for *many* cpu cycles.
 
Last edited:

Aladar

New member
Not only many cycles, modifying the display registers with unusual values and
trying to access the VRAM is also possible to definitely stop the cpu!
The target of my emulator is the perfect reproduction,
for this reason I am not interested in approximate solutions.
Ambitious, I know, but to write another emulator with only enough accuracy for
games and demos doesn't have sense.
 

malducci

New member
Not only many cycles, modifying the display registers with unusual values and
trying to access the VRAM is also possible to definitely stop the cpu!

Yeah. A set of registers sets the VRAM 'speed' in that you get less and less 'cpu' slots per 8pixel dot clock. The lowest setting results in no cpu slots during active display and pauses the processor till the end of the star to of the next scanline. But I was referring to normal VRAM speed settings and normal VDC register settings. There are certain points in the frame where the VDC provides no 'cpu' slots to vram. And of course the length of the stall is variably based on some conditions.

The target of my emulator is the perfect reproduction,
for this reason I am not interested in approximate solutions.
Ambitious, I know, but to write another emulator with only enough accuracy for
games and demos doesn't have sense.

Look forward to seeing you're findings :D
 

mudlord88

Banned
Ambitious, I know, but to write another emulator with only enough accuracy for
games and demos doesn't have sense.

Personally, I think there is. People could code emu's for just lulz :p Or to improve thier programming skills. It doesn't have to be all about documenting hardware to the per-cycle level imo.
 

Aladar

New member
PicchioEngine v0.0.2 (2009/01/23)
- The system now run at exactly 21477272+(8/11)Hz.
- Implemented the linear phase low-pass filter using the BLEP synthesis.
This filter is used to reduce the sampling rate from 3579545+(5/11)Hz to 48kHz.
- Emulated accurately the RC audio filters present on the DUO-R.
- Added a preliminary and incomplete PSG emulation.
 

AamirM

New member
PicchioEngine v0.0.2 (2009/01/23)
- The system now run at exactly 21477272+(8/11)Hz.
- Implemented the linear phase low-pass filter using the BLEP synthesis.
This filter is used to reduce the sampling rate from 3579545+(5/11)Hz to 48kHz.
- Emulated accurately the RC audio filters present on the DUO-R.
- Added a preliminary and incomplete PSG emulation.

Congrats! ;) . Have you got any games/demos/tests displaying anything? (I know VDC in incomplete but still...)
 

Aladar

New member
Thanks AamirM!
Suggestions:
- My emulator doesn't support zip files, only uncompressed rom images.
- If present, remove the header(512byte) from the file.
- For the US games with the regional protection, in the file 'IOPort.cpp' replace
the line 'return (Joypad::read() | 0xF0);' with 'return (Joypad::read() | 0xB0);'.
 
Last edited:

AamirM

New member
I did all that already. I think the games I tried to run depended on some unimplemented VDC feature. Can you name a games (with sound) which runs? I just want to hear the sound :) .
 

Aladar

New member
Try Magical Chase, it is not playable but seems to work in demo mode,
in this way you can listen some music.
 

Top