andrew-hoffman / halfnes

An accurate NES/Famicom emulator
GNU General Public License v3.0
163 stars 65 forks source link

add PAL and Dendy mode #7

Closed eugene-s-nesdev closed 9 years ago

eugene-s-nesdev commented 9 years ago

Hi, Andrew.

Can you add PAL and Dendy (NTSC/PAL Hybrid) modes to halfnes please?

"Dendy-mode" is name for pirate PAL timing, which allow to run most of NTSC games (Jap, USA) on 50 Hz without glitches, with correct DPCM sound pitch also, unlike official PAL NES timing. No need to "autodetect" it via "auto-region". It must be set by user, and emulator should "remember" it.

Complete Information: Cycle Reference Chart - nesdev wiki Table of differences between NTSC, official PAL NES and Dendy pirate PAL timings Global Nesdev F.A.Q.

Dendy timings have specific behavior, causing some in-game glitches, so here is ROMs to-test it: 240pee by Tepples (Damian Yerrick) must show timing: 240pee_timing

Battletoads and Double Dragon (U).nes Must have glitches like this: BTDD_Dendy

"Choujin Sentai - Jetman (J)" intro glitch: Jetman_Dendy

Noise and DMC APU pitch tables are same as NTSC NES/Famicom, so Sunsoft NTSC games must have correct pitch

P.S: "Dendy-mode" is only euphonic name. A thousands of "NTSC/PAL hybrid" famiclones work on this timings. They have different labels/names in CIS countries ("Dendy", "Lifa", "Kenga", "Subor", etc), Eastern Europe (i know "Pegasus" in Poland) and Asian region ("MicroGenius" in Taiwan).


Thank you for support.

andrew-hoffman commented 9 years ago

I can do some work on this but I'm not in a PAL country and so I won't have any real PAL hardware (of either type) to compare to. Also I intend to leave NTSC as the default region, because most PAL ROMs currently in distribution do not have any of the 3 possibilities for region bits set in the header and I do not want to maintain a ROM database.

This is also a good excuse to at least attempt to read iNES 2 style headers, even if I don't support the Playchoice 10 or any of the newer multicart/pirate mappers that have numbers over 255

eugene-s-nesdev commented 9 years ago

Anyway, you need to add force region (NTSC/PAL/Dendy) selector to GUI. Dendy-mode was designed only for run actual NTSC-games at 50FPS So, none of exclusive software/games was written special for dendy-mode and region detection (based on NstDatabase.xml or similar) can't detect Dendy.

andrew-hoffman commented 9 years ago

Well I've done most of this now. Still some problems if the region is changed while a game is running. If you can build it let me know how it is; if you can't build it I'll send you a zip file.

andrew-hoffman commented 9 years ago

For the authentic Dendy experience (according to Kinaman) I probably also need to add turbo A and B buttons and the snowy black-and-white picture you get from an old SECAM TV. (And maybe ducktales) b116e9385 But I probably won't do those yet.

eugene-s-nesdev commented 9 years ago

Sent me zip file please and I'll try it.

Отправлено из Mail.Ru для Android пятница, 10 июля 2015г., 05:20 +0300 от Andrew Hoffman < notifications@github.com> :

Well I've done most of this now. Still some problems if the region is changed while a game is running. If you can build it let me know how it is; if you can't build it I'll send you a zip file. — Reply to this email directly or view it on GitHub .

eugene-s-nesdev commented 9 years ago

Четверг, 9 июля 2015, 21:00 -07:00 от Andrew Hoffman notifications@github.com:

For the authentic Dendy experience (according to Kinaman) I probably also need to add turbo A and B buttons and the snowy black-and-white picture you get from an old SECAM TV. (And maybe ducktales)

Oh, no need to emulate pirate DuckTales or black-and-white old CRT. Turbo-buttons support will be nice ( turboA="S", turboB="A" on default keyb input ). The standard Dendy turbo-controller toggle every frame, like this: http://savepic.su/2525036.htm

I have a question about halfnes 0.58 also: when i set 4x scale window or fullscreen emulator higly slowdown, 23FPS. I use Core i7-2600K/HD Graphics300/Win7x64 and lastest java

eugene-s-nesdev commented 9 years ago

http://savepic.ru/7546066.png

andrew-hoffman commented 9 years ago

Turn smooth scaling off and things will run faster. The Swing UI in Java is really slow at doing binary interpolation now, it's gotten worse over time instead of better, I should move everything to SDL or LWJGL but there are reasons that I haven't.

Anyway, I've uploaded a preview release of HalfNES 059 if you want to try it, which should run Dendy stuff OK as long as you don't change regions while a game is running.

eugene-s-nesdev commented 9 years ago

Hi, PAL and Dendy timings work good. I've tested Battletoads&D.D and some other timing-specific stuff. But here is strange issue: Gamespeed and music tempo is too slow in PAL and Dendy modes, like 35FPS, despite emulator shows me 50FPS. Maybe problem with syncro.

eugene-s-nesdev commented 9 years ago

Also, tepples timing/overclock demo ROM, work good and correct too: https://user-images.githubusercontent.com/13199529/98018347-7cae3100-1e11-11eb-9571-927bab3019d7.png

andrew-hoffman commented 9 years ago

Fixed the gamespeed. (I was still outputting a frame of audio every 262 lines so it was blocking on the audio buffer.)

andrew-hoffman commented 9 years ago

I think that's everything except the occasional deadlock when changing regions (and that has to be a threading bug, I know it)

eugene-s-nesdev commented 9 years ago

Thank you. I'll wait updated 059beta. Also, i can run any test roms on Dendy via flashcartridge, if you need it. http://forums.nesdev.com/viewtopic.php?f=22&t=12499#p146813

eugene-s-nesdev commented 9 years ago

Yes, updated beta-2 work correct.