PC Engine core

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: PC Engine core

Postby GreyRogue » Sun Sep 16, 2018 2:24 am

Sorgelig wrote:Is there a special Title ID field in PCE ROMs?

Mednafen checks Populous at 0x1F26, but I don't think it's general to other cards.

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: PC Engine core

Postby GreyRogue » Sun Sep 16, 2018 2:34 am

Sorgelig wrote:it seems 512pix mode doesn't run correct. It switches to 512 pixels but somewhere inside it's still clocking at 256 pixels, so text is unreadable.

If I use the Screen Dimension Test and I reduce the Display Width by a few, it suddenly looks clear. The Horizontal must not be completing before the next vertical starts, which causes every background line to be displayed twice (Sprites are ok).

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Sun Sep 16, 2018 2:58 am

GreyRogue wrote:If I use the Screen Dimension Test and I reduce the Display Width by a few, it suddenly looks clear. The Horizontal must not be completing before the next vertical starts, which causes every background line to be displayed twice (Sprites are ok).

If you know how to fix it, then please fix. I don't know how :)

I think, DMAS_ACTIVE need to be fixed to display earth correctly in Final Soldier's title, and then can make a new release. New structure is very different, so i think only you can fix it.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Sun Sep 16, 2018 3:44 am

Added support for Populous ROM (additional 32KB RAM).
Disable SuperGrafx by default. Didn't find the reliable way to auto-detect it yet.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Sun Sep 16, 2018 4:35 am

Now SuperGrafx mode is enabled automatically for ROMs with extension SGX.
I think it's most reliable way to split the titles without affection.

User avatar
Newsdee
Atari God
Atari God
Posts: 1217
Joined: Fri Sep 19, 2014 8:40 am

Re: PC Engine core

Postby Newsdee » Sun Sep 16, 2018 9:49 am

Great progress! Thanks guys!

albconde
Atari freak
Atari freak
Posts: 72
Joined: Thu Nov 30, 2017 8:56 am

Re: PC Engine core

Postby albconde » Sun Sep 16, 2018 9:52 am

Testing the last versión:
As you say dead moon flicker is solved , populus work , fighting run is fixed, and final lap twin is fixed.
Final Soldier earth fliked a second , and then is misplaced .
Drop off has black screen now
F1 circus 92 some time work , some time black screen after you enter the name.
The error in puzzle boy seems random, I play 5 phases without it, and sometimes it fails in the first or second.

Do you need a list with the games with badly drawn lines (lost, bad placed or flickering)?

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Sun Sep 16, 2018 11:02 am

Full list is not required, but some representative and easy to reproduce glitches would be good.

Thank you for testing - this is important part of developing!

albconde
Atari freak
Atari freak
Posts: 72
Joined: Thu Nov 30, 2017 8:56 am

Re: PC Engine core

Postby albconde » Sun Sep 16, 2018 11:20 am

In some cases, it is often difficult to see them if you are not looking for them:

adventure island: miss the last gray line in upper side is drawn at the botton of the screen
Aero blaster miss one line the last in the life markers
devil crash: miss the last line in upper side (see the word ball)
Fantasy zone: the same miss line in the upper side, and the line that replace moves incorrectly
sinistron y psychosis : the lines that join parts of the background that move at different speeds has problems

I think the problem is always that a line is not drawn in a block ( the last one), the subsequent ones are displaced, and in the line that takes the place of the one that is missing, the effects of the missing line are applied (for example the movement)

"Davis cup tennis" now has flicker
"Tatsujin" and "tv sport football" : mising sprites
Volflied: crash now
Last edited by albconde on Sun Sep 16, 2018 1:37 pm, edited 1 time in total.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Sun Sep 16, 2018 1:33 pm

Tried to fix Final Soldier misplaced earth but failed.. If i fix final soldier then dead moon's title gets glitches.. They are mutually exclusive. So, probably only GreyRogue can fix it.

In the meantime i've improved centering. Hope nothing gets worse.

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: PC Engine core

Postby GreyRogue » Mon Sep 17, 2018 2:50 am

GreyRogue wrote:
Sorgelig wrote:it seems 512pix mode doesn't run correct. It switches to 512 pixels but somewhere inside it's still clocking at 256 pixels, so text is unreadable.

If I use the Screen Dimension Test and I reduce the Display Width by a few, it suddenly looks clear. The Horizontal must not be completing before the next vertical starts, which causes every background line to be displayed twice (Sprites are ok).

Fixed hi res mode. RAM access was too slow. Sped it up to fit.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Mon Sep 17, 2018 3:07 am

GreyRogue wrote:Fixed hi res mode. RAM access was too slow. Sped it up to fit.

any news about DMAS?
I was able to modify old DMAS way handle to fix dead moon. And again final soldier earth is misplaced.. So, these two titles are mutually exclusive.. May be besides DMAS, there something else?

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: PC Engine core

Postby GreyRogue » Mon Sep 17, 2018 4:40 am

Sorgelig wrote:
GreyRogue wrote:Fixed hi res mode. RAM access was too slow. Sped it up to fit.

any news about DMAS?
I was able to modify old DMAS way handle to fix dead moon. And again final soldier earth is misplaced.. So, these two titles are mutually exclusive.. May be besides DMAS, there something else?

I think this is another two wrongs making a right situation. My initial looking at Final Soldier looks like it might be an issue with the raster counter interrupt. I'm not certain yet, though.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Mon Sep 17, 2018 4:49 am

GreyRogue wrote:
Sorgelig wrote:
GreyRogue wrote:Fixed hi res mode. RAM access was too slow. Sped it up to fit.

any news about DMAS?
I was able to modify old DMAS way handle to fix dead moon. And again final soldier earth is misplaced.. So, these two titles are mutually exclusive.. May be besides DMAS, there something else?

I think this is another two wrongs making a right situation. My initial looking at Final Soldier looks like it might be an issue with the raster counter interrupt. I'm not certain yet, though.

I found that DMAS fix completely mess Madou King Granzort (SGX) - Even on title the wall is partly drawn. In game there is a lot of missing graphics.
So, this game can be a good candidate to test DMAS tweak.
I've reverted this tweak for now.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Mon Sep 17, 2018 5:10 am

I've pushed other tweak for DMAS based on original code. It fixes Dead Moon and doesn't affect Madou King Granzort.
Final Soldier of course have shifted Earth which really looks like another kind of bug masked previously as you've said.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Mon Sep 17, 2018 6:57 am

By the way, the Earth is not made by sprites, but by background. This makes me feel that sprites DMA having higher priority don't leave enough time for other DMA agents.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Mon Sep 17, 2018 7:23 am

Cleaned the VDC synchronization block from that mess of sporadic assignments. Found and fixed Sprite/Background mismatch - so it may fix line misalignments in different games.
Would be good to check if there are new problems introduced or not.

albconde
Atari freak
Atari freak
Posts: 72
Joined: Thu Nov 30, 2017 8:56 am

Re: PC Engine core

Postby albconde » Mon Sep 17, 2018 4:35 pm

testing latest changes :
    volfiled Works again
    tv sport football Works again
    tatsujin Works again
    Davis cup tennis : some flicker in player 2 , lees flicker in ddr3 than in sdram
    psychosis :bad lines fixed
    sinistrstron : bad lines fixed
    adventure island : bad lines fixed in game , 1 bad line upper side in the screen you chose continue or new game
    aero blaser : bad line fixed
    drop off : game works again , and bad sprites fixed
    after burner 2 : crash , this game do not work in any version
    f1 circus 92 some time work , some time black screen after you enter the name.
    fantasy zone bad line fixed
yo bro : problems in the intro screen part mising , in game Works
It seems a good versión most of the misplaced lines are solved

albconde
Atari freak
Atari freak
Posts: 72
Joined: Thu Nov 30, 2017 8:56 am

Re: PC Engine core

Postby albconde » Mon Sep 17, 2018 5:13 pm

Some games has a problem in first line , it seems like sprites are drawn from another line maybe the last one, a clear example is 1943.
Bomberman 94 crash after the intro
Ghost manor flicker is fixed
Cadash bad placed lines are fixed , but now the image flicker in game
Metal Stroker has misisng sprites now

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: PC Engine core

Postby GreyRogue » Mon Sep 17, 2018 11:44 pm

Sorgelig wrote:any news about DMAS?
I was able to modify old DMAS way handle to fix dead moon. And again final soldier earth is misplaced.. So, these two titles are mutually exclusive.. May be besides DMAS, there something else?

Ok. I think I found it and it didn't have anything to do with the DMA timing.
The Busy bit should always read 0. The busy signal isn't an indicator of it being in the middle of a DMA, it's the same as the (inverted) Busy Signal to the CPU. As such, the CPU is always stalled when the busy bit is high.

Other thoughts...
Timing. Using the wrong horizontal width might cause issues. The timer will get out of sync with the extra cycles. Is it possible to just reset the CLKEN on a new horizontal line so it doesn't have to be divisible by 8?
Other timing issues. I know I had been centering the display, but now I'm not sure if it's a good idea or not. The system has blanking cycles it uses (273 hblank, 3 lines of vblank [but they happen 30 cycles after hblank]).
Low Frequency Oscillator. The LFO in the 6280 isn't implemented.
I prefer to keep registers even if they aren't being used by the code. The running program can read those registers, so they should return the correct values.
If you're interested, I've explained a few things in my check-in, but here's a more thorough explanation. SP1 state table must be running the line before BG. During that line it reads the SATB and looks for 16 sprites that will be in the next line. During HBlank (SP2), it then reads VRAM for those sprites, and finally displays them in the following line (while it's reading the SATB for the next line).
Also, the BG needs two read up to two tiles (16 cycles), plus it a little overhead before rendering. Pushing it too far in one direction loses some of the 16 sprites and pushing the other way messes up vertical lines on the right of the display.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Tue Sep 18, 2018 1:23 am

@GreyRogue:
I've send you private message. Please check.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Tue Sep 18, 2018 1:51 am

GreyRogue wrote:Timing. Using the wrong horizontal width might cause issues. The timer will get out of sync with the extra cycles.

Well.. the whole concept of external sync is to keep display enabled when no ROM loaded. So you can open OSD and choose the ROM.
If you think this may make some games work incorrectly, then can go other way as it's done in other core (NES if i remember correct): When there is no sync from the core like 2 frames in a row, then external sync will kick in to make OSD working.
So far most games are working with current implementation and issues with some games don't point to wrong line length yet. But if you think it should be changed, then it's possible.

GreyRogue wrote:Is it possible to just reset the CLKEN on a new horizontal line so it doesn't have to be divisible by 8?

not by 8. Steps are 24 clocks as it used for 4/6/8 division of clock for CLKEN.
Probably it can be changes in 6260 providing CLKEN by switching to final divided constants to specific pixel clock - in that case it will be possible to define the line length with 1 pixel tolerance instead of 24 cycles of common clock. I will think in this direction.
We need to find a better way to communicate to coordinate our work.

GreyRogue wrote:I prefer to keep registers even if they aren't being used by the code. The running program can read those registers, so they should return the correct values.

I don't see where these registers are reading by CPU. They are write-only. I remove the write to unused registers because i hate to see warnings in Quartus - it's easy to miss a real problem if you have tons of warnings.

GreyRogue
Atari maniac
Atari maniac
Posts: 89
Joined: Thu Mar 22, 2018 3:50 am

Re: PC Engine core

Postby GreyRogue » Tue Sep 18, 2018 5:22 am

Sorgelig wrote:
GreyRogue wrote:I prefer to keep registers even if they aren't being used by the code. The running program can read those registers, so they should return the correct values.

I don't see where these registers are reading by CPU. They are write-only. I remove the write to unused registers because i hate to see warnings in Quartus - it's easy to miss a real problem if you have tons of warnings.

Whoops. You're right. I was thinking you can read them, but I guess not.

Just pushed a fix to keep Burst mode on throughout blanking. Fixes Madou King Ganzort.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Tue Sep 18, 2018 6:54 am

it seems messenger is lagging a lot cause i've already pushed this fix :)

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3090
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: PC Engine core

Postby Sorgelig » Tue Sep 18, 2018 8:39 am

Ok. MKG is fixed, but with new structure many games have misplaced lines. For example Sinistron.


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 3 guests