MiSTer-devel / SMS_MiSTer

Sega Master System for MiSTer
45 stars 43 forks source link

Games not working reported by albconde #38

Closed theflynn49 closed 5 years ago

theflynn49 commented 5 years ago

These have been reported by Atari-forum user albconde, and these failures are confirmed.

Some games with problems in gamegear: Bram stokers Dracula : problems when you start to play, Hook : Blackscreen when you start to play Lion King : Blackscreen when you start to play

In some games in gamegear ,like baku baku , Some sprites seem displaced 1 pixel to the right ,to see this problem start playing, when an ítem reaches the bottom ,moves a pixel to the left

theflynn49 commented 5 years ago

Status

Bram stokers Dracula : Done Hook : Done Lion King : Done Baku Baku Animal : Done (Next release PR in progress)

theflynn49 commented 5 years ago

Nice timing improvement with the fix of Baku Baku. Impatient testers can try my own releases

theflynn49 commented 5 years ago

Err, today I rechecked all these games and they all work. So, all done :)

theflynn49 commented 5 years ago

Some more issues from albconde involving the serial port :

In some gamegear games with multiplayer link,there are some errors , for example G-loc some times apear an error "check cartrigde" , and in mortal kombat "link error" and "existence of second fighter established wait" (us version , jap Works)

Evander Holifield : Black screen Ernie Els Golf : only show codemaster logo Micromachines 2 : pink screen (last version works : 20190420 in your repo) Striker ; only show sega logo ( last version works ; 20190411 oficial)

theflynn49 commented 5 years ago

@sorgelig I need a little help here. "Evander Holifield" does not initialize the z80 SP, so it relies on the bios to do it, but the core force the fact that the bios is not loaded for GG game ... Do you know what's supposed to be done here ? I removed the forcing, that solved the game init problem, but I am sure someone put that there for a reason. I could init the sp of the z80 at reset to xFFFA but I am not sure this will please you :D

note: not init the SP is bad, because the next push overwrites the mapper $fffc $ffffd $fffe .. another idea is to XOR the bios_en flag with gg at reset, so it would not load the bios for GG by default, but it would do it if you set the disable bios flag, and we can have both possibilities - needs to change the message though or else it would be confusing.

theflynn49 commented 5 years ago

after a good sleep, I'd make the bios osd "normal/reverse" instead of enable/disable. and of course off by default for gg and on by default for sms. What do you think ? @sorgelig

sorgelig commented 5 years ago

There must be no bios on real console, and SP i believe by default is 0000. Since there is no bios on real console, SP is not used till game ROM executed. Since core requires to load the carts on the fly, it must simulate the power cycle, that's why bios inits some registers. So, probably it doesn't simulate it fully. Even on GG i believe initialization is required, so you still need to use BIOS to simulate power cycle between ROMs. Otherwise next game will receive the state from previous game which is not always work well.

You are free to improve the bios.

theflynn49 commented 5 years ago

Hi Sorgelig, thanks for Ur answer.

The Bios doesn't need to be changed to fix this problem : if I reactivate it as it is, the game works again.

The choice to be done is : should 'No bios" be still the default for GG games ? or should I reinstall Bios-per-default for GG and SMS ?

sorgelig commented 5 years ago

The correct behavior would be reset the registers to default values before launching every ROM. And i think initialization for registers should be different for GG and SMS. Every ROM expects that console was powered off before it starts. Many games don't initialize some registers while still use them - so some default values are expected. This reset can be done in either BIOS or in HDL. In HDL sometimes it's harder to do as sometimes it involves memory cleanup.

theflynn49 commented 5 years ago

Ok, I see what you want now. makes sense.

theflynn49 commented 5 years ago

Status

Evander Holifield : Done (new version of SMSBootLoader) Ernie Els Golf : Done Micromachines 2 : Done Striker ; Done probably will fix other gg games using player-to-player cable

Other problem : It seems that the border OSD option doesn't do much in PAL mode ... anyone has a guess? It's the same horz timing for both modes pal and ntsc, shouldn't it react the same way ?

sorgelig commented 5 years ago

i've tried in latest official release - border option works in both NTSC and PAL modes.

theflynn49 commented 5 years ago

I need to clarify what I said about the border. Depending upon the (small) changes I make in the video/vdp timings, often borders on/off makes the aspect ratio locked in 16:9 mode. Sometimes it depends if it's in PAL or NTSC mode. Let me finish to stabilize the vdp part, once this is done I might come back into this. Maybe you can hint me where to look if the 3:4 ratio mode doesn't do what it should ... ?

sorgelig commented 5 years ago

Aspect ratio is simple ratio between numbers of VIDEO_ARX and VIDEO_ARY. They not exactly must be 4 and 3. But what i've noticed is that border doesn't work correctly on HDMI. When you hide the border (i think correct term is overscan) you need to adjust the hblank and vblank to the same position where you hide the video. In this case scaler will zoom in the remaining video and there won't be black bars around the video. You can see NES core and how "hide overscan" feature works there. I don't mean you need to check the code. Just look how it appears on monitor.

theflynn49 commented 5 years ago

Ok I will check that. I failed to see this before, but on my setup ratio selection is locked on 16:9 on VGA, but it works properly on HDMI. Maybe monitor related. At any rate, not in my priority list for now :)

sorgelig commented 5 years ago

Ah, you mean aspect ratio on VGA? It's impossible to change. OSD Aspect ratio option is only for HDMI.

on VGA output Aspect ratio depends on video signal. For example increasing the pixel clock and appropriate increasing amount of clock cycles per line you will make picture narrower.

theflynn49 commented 5 years ago

Thank you for the clarification... I was just confused about the video behaviour.

I just made a PR, after which the core should be pretty stable. a few subjects that could be discussed :

Maybe a good milestone to generate a core ?

For your entertainment, the reason why "pit fighter" needs a strong mapper protection is their creative delay routine : ld bc,$0000 ld hl,$0000 ld de,$0000 ldir ldir ldir

... sure the mapper logic liked this alot :D

sorgelig commented 5 years ago

In Genesis i've introduced the game detection and made a list with games requiring special tweaks. So, users don't have to deal with cryptic options like lock mapper. So, if it's impossible to detect this game by its behavior (specific mapper for example) then it may be good to parse the ROM while loading to check specific offset which identifies this game and then enable this options internally.

theflynn49 commented 5 years ago

I've seen this in some emulator's sources. Wouldn't do it in a vhdl core, but in the loader app why not. For now I'll write a note in the readme, we'll see how this turns out.

we need rom MD5 list triggering hidden parameters ...

sorgelig commented 5 years ago

Don't do MD5 for rom detection. There can be hacks and mods - they won't work. It's better to check some offsets against some specific strings - so they will remain the same in mods.

gyurco commented 5 years ago

I don't know if it would work in every case - if the game already used the normal SEGA mapper, then lock the others. E.g at about line 358 of system.vhd:

if WR_n='0' and A(15 downto 2)="11111111111111" then
    mapper_lock <= '1';

Seems it works with Pit Fighter, Sangokushi 3 (Korean mapper), Micro Machines.

theflynn49 commented 5 years ago

I tried it. Didn't work well because some codemasters games use both mappers :( They initialize the sega mapper in a very early stage, after that they initialize the codemasters mapper; I suspect they linked with a standard library that init the sega mapper by default and then they do their own things.

gyurco commented 5 years ago

Ahh, so not an original idea :) Now I wonder if the Codemasters mappers are used only in extra height games. Or disable the write to those mappers if the value was read previously from the same address (to detect the LDIR).

theflynn49 commented 5 years ago

ha I see what you want to do here. The thing is : I just added some logic to the Codemasters mapper because of the RAM they map in $A000 if bit7 of $8000 is set. This is used only by one game, Ernie Eels Golf, and it doesn't work yet. So I'd feel a lot more confident if the releases in between have a way to lock all that stuff in case something goes wrong. My idea is : once all these things work, we could try to remove all the parameters one by one. The Region parameter could be removed too.

gyurco commented 5 years ago

I'm with you :) I know in this stage, even the slightest change can make annoying issues. Attached a patch, which implements the LDIR-detection. Maybe you can think about it later. mapperlock.zip

theflynn49 commented 5 years ago

lol :) thanx for the patch - I knew someone would appreciate that ldir stuff :D

theflynn49 commented 5 years ago

@gyurco : I merged your patch , it works well :)