Jump to content
IGNORED

ProSystem emulator for the Wii (Wii7800)


raz0red

Recommended Posts

What is is that xenophobe does that makes the screen so crazy in emu7800 aka mess? It plays but the screen jumps around all over the place!

 

Not really sure, I haven't looked into MESS or EMU7800 too much.

 

ok so I set flags=2 in prosystem for windows and the atari logo displays correctly but then the screen itself is wrong, in particular the floor your character walks on. So you made some changes to the wii code that fix that little issue? I'm just trying to keep up with all this. I'm hoping it will give me some insight that I may be able to "transfer" over to mess.

 

If you download the latest ProSystem (1.3), "Kung Fu Master" is 0x2 by default.

 

[f57d0af323d4e173fb49ed447f0563d7]
title=Kung Fu Master
type=0
pokey=false
controller1=1
controller2=1
region=0
flags=2;

 

Flag 0x2 tells the emulator to ignore WSYNCs. That is why when you load Kung Fu Master the Atari Logo does not scroll the colors through it (as the bios code uses WSYNC to change the color for each scan line), and why there are some lines in the upper left corner of the game screen. If you set the flags to 0, the Atari Logo will look fine, but the colors in the game screen will be messed up. That is one of the things I fixed.

 

The other fixes relate to the changes I made to Maria cycle timing.

 

Just to be clear on what the flags mean in the current version of ProSystem and what my changes do:

 

0x1 ~ Include Maria Cycle count times. As you can see by looking in the ProSystem.dat file, very few games use this setting. The reason is that the count is so high that it causes compatibility issues. For example, enable it for Ms. Pac-Man and the game won't be playable. My adjustments to the Maria Cycle count code make it compatible with all the games I have tested with some of the improvements I listed previously.

0x2 ~ Ignore WSYNCs. When the game requests WSYNC, completely ignore it and pretend it didn't happen (continue execution on the same scan line). I actually fixed two different bugs related to this so that it should never be necessary to use it.

 

Also, just to be clear, these are changes that are being made to the upcoming 0.2 release of Wii7800, not in the current 0.1 version.

 

--Raz.

Edited by raz0red
Link to comment
Share on other sites

Whoops sorry, yes I got it backwards. It was set to two and when I changed it to 0 the logo displayed fine but the colors are wacked. Anyways thanks for the explanation! :D I wrote notes about those flags a year ago and have them somewhere. :lol:

 

Anyways looking forward to seeing your code changes. I'm not sure if I'll be able to force them to work in MESS, but that won't stop me from trying! :lol: Always trying to improve compatibility.

 

If you don't mind and could take a peek at xenophobe in emu7800, that'd be great!

Link to comment
Share on other sites

See if the following addresses are jumped to :-

 

0x3FEE - ??

0x3FF1 - ??

0x3FF4 - ??

 

I did some experimenting w/ both Asteroids and Xenophobe. Here is what I came up with:

 

Asteroids:

 

0x3FEE ~ Never executed
0x3FF1 ~ Never executed
0x3FF4 ~ Never executed
0x3FF7 ~ HSCSTAT, executed a few times, during game, also at high score screen, etc. I am guessing it is grabbing the score for display.
0x3FFD ~ HSCENTER, executed
0x3FEB ~ HSCSETRS, executed
0x3FFA ~ HSCATRCT, executed

SRAM (0x1000 - 0x177F):

Small number of writes as you would expect.

 

Xenophobe:

 

0x3FEE, etc. ~ None of these were executed

SRAM (0x1000 - 0x177F):

Writes continuously during gameplay, 50k writes during a single game.

 

It seems I could use the execution of those entry points to determine whether or not to store the cart state on exit.

 

--Raz.

Edited by raz0red
Link to comment
Share on other sites

Centipede will not initialize an HSC cart properly

 

Yeah, I have the same problem. If you initialize the Cart with another game (Asteroids, etc.) then the high score entry screen in Centipede works fine. The "initialize" screen in Centipede doesn't appear to pick up button presses to advance the cursor. Possibly a one/two button issue or just something wrong with the way it initializes the joysticks for that particular screen.

 

If you don't mind and could take a peek at xenophobe in emu7800, that'd be great!

 

Yeah, once I get this release ready for testing I will take a look at it.

 

--Raz.

Edited by raz0red
Link to comment
Share on other sites

The other fixes relate to the changes I made to Maria cycle timing.

 

Just to be clear on what the flags mean in the current version of ProSystem and what my changes do:

 

0x1 ~ Include Maria Cycle count times. As you can see by looking in the ProSystem.dat file, very few games use this setting. The reason is that the count is so high that it causes compatibility issues. For example, enable it for Ms. Pac-Man and the game won't be playable. My adjustments to the Maria Cycle count code make it compatible with all the games I have tested with some of the improvements I listed previously.

0x2 ~ Ignore WSYNCs. When the game requests WSYNC, completely ignore it and pretend it didn't happen (continue execution on the same scan line). I actually fixed two different bugs related to this so that it should never be necessary to use it.

 

Also, just to be clear, these are changes that are being made to the upcoming 0.2 release of Wii7800, not in the current 0.1 version.

 

--Raz.

 

I wonder if this will fix the problems in MIA. Did you happen to test this game after your fixes? It was pretty much unplayable before in all emus.

 

Mitch

Link to comment
Share on other sites

I wonder if this will fix the problems in MIA. Did you happen to test this game after your fixes? It was pretty much unplayable before in all emus.

 

Unfortunately, it doesn't at this time. I am able to play all the levels by using the difficulty switch to select the level, and with "god" mode I can clear them. However, when you die or clear a level, the game goes wacky and you need to select the level again.

 

--Raz.

Link to comment
Share on other sites

I tried it the other night and every rom I threw at it worked. I think the sound is off though, is this a known bug? it has been a while since I played an actual 7800 but it seemed like there was a lot of distortion in the sounds

 

Any PAL versions are way off in the current release (0.1). I have that fixed for 0.2. It is actually a bug in the Windows version as well. It doesn't adjust the sample rate when the system frequency changes. Most NTSC games should sound decent. Although, I think it is still a little bit off, but it shouldn't be distorted.

 

--Raz.

Link to comment
Share on other sites

I tried it the other night and every rom I threw at it worked. I think the sound is off though, is this a known bug? it has been a while since I played an actual 7800 but it seemed like there was a lot of distortion in the sounds

 

Any PAL versions are way off in the current release (0.1). I have that fixed for 0.2. It is actually a bug in the Windows version as well. It doesn't adjust the sample rate when the system frequency changes. Most NTSC games should sound decent. Although, I think it is still a little bit off, but it shouldn't be distorted.

 

--Raz.

 

 

I'll give it another try and pay closer attention to the actual game and the settings

Link to comment
Share on other sites

  • 3 weeks later...

At the time that I wrote the ProSystem emulator there were only a few documents available. I had to make assumptions on timing based on current emulators (MESS and V7800) and the few documents that were available. I've been currently working on a version 2 of the emulator that includes the more exact timing for the Maria processor and takes into account the slow down when accessing TIA and RIOT addresses. The ignore WSYNC was a hack to get Kung-Fu Master working with the current timing numbers.

Link to comment
Share on other sites

Just released 0.2.

 

http://www.wiibrew.org/wiki/Wii7800

 

Thanks to all those who provided great information, help, and testing: gdement, GroovyBee, mimo, PacManPlus, and Curt Vendel.

 

It should also be noted that while I believe I improved the accuracy of Maria cycle counting, it is still not hardware accurate. Recently Greg Stanton posted that he was working on a new version of the ProSystem emulator that would have accurate cycles (including slowdown for TIA/RIOT memory accesses). As soon as that awesome update is released, the Wii version will be updated to incorporate those changes.

 

With that said, all of the games that I have tested (with the exception of MIA) do work with the 0.2 version of Wii7800 (with Maria cycle counting and VSYNC enabled).

 

Here is the list of changes for Wii7800 0.2:

 

	- Lightgun support 
- High score cartridge support
- Increased accuracy of Maria cycle timing, games now run at close to 
	their intended speed (One on One, Tower Toppler, Summer Games, 
	KLAX, Karateka, etc.)
- Increased compatibility for PAL games (Ballblazer, Commando, and Food 
	Fight now work)	
- Audio now sounds as it should regardless of frequency (PAL games and 
	custom frame rates)
- Timers now properly take into consideration cycles generated via Maria 
	and during WSYNC
- Changes to ProSystem database format
	- Maria cycles are now enabled by default (option 0x1 now disables
		Maria, the opposite of before)
	- Ability to adjust the lightgun crosshair offset per game
- All games now have Maria cycles and WSYNC enabled in the ProSystem 
	database (with the exception of MIA)	
- Console switch defaults updated to work with the majority of games
- Additions to debug output (Maria vs. CPU cycles, timer info, etc.)
- Other games improved by various changes
	- Kung Fu Master no longer has the lines in the upper left corner of
		display and the Fuji logo appears as it should (if using BIOS)
	- Midnight Mutants has less graphical glitches
	- Summer Games has less graphical glitches
	- Plutos has slightly less graphical glitches
- Fixed save/restore state issue for games that use RIOT timers.

 

--Raz.

Link to comment
Share on other sites

Cool! Thanks for the update. I meant to check today but never got around to it. Anyways I'll have to look over the source code and see if I can carry anything over to MESS (especially the light gun). Although MESS is a bit odd in how it works (and as confusing as hell).

 

Just a quick question concerning save issues with games that use the RIOT timer. Could you clarify on that? Which games?

 

I know MESS sometimes would have issues with Commando and Dark Chambers where it would get the character graphics screwed up on restores (and rewind).

 

Just released 0.2.

 

http://www.wiibrew.org/wiki/Wii7800

 

Thanks to all those who provided great information, help, and testing: gdement, GroovyBee, mimo, PacManPlus, and Curt Vendel.

 

It should also be noted that while I believe I improved the accuracy of Maria cycle counting, it is still not hardware accurate. Recently Greg Stanton posted that he was working on a new version of the ProSystem emulator that would have accurate cycles (including slowdown for TIA/RIOT memory accesses). As soon as that awesome update is released, the Wii version will be updated to incorporate those changes.

 

With that said, all of the games that I have tested (with the exception of MIA) do work with the 0.2 version of Wii7800 (with Maria cycle counting and VSYNC enabled).

 

Here is the list of changes for Wii7800 0.2:

 

	- Lightgun support 
- High score cartridge support
- Increased accuracy of Maria cycle timing, games now run at close to 
	their intended speed (One on One, Tower Toppler, Summer Games, 
	KLAX, Karateka, etc.)
- Increased compatibility for PAL games (Ballblazer, Commando, and Food 
	Fight now work)	
- Audio now sounds as it should regardless of frequency (PAL games and 
	custom frame rates)
- Timers now properly take into consideration cycles generated via Maria 
	and during WSYNC
- Changes to ProSystem database format
	- Maria cycles are now enabled by default (option 0x1 now disables
		Maria, the opposite of before)
	- Ability to adjust the lightgun crosshair offset per game
- All games now have Maria cycles and WSYNC enabled in the ProSystem 
	database (with the exception of MIA)	
- Console switch defaults updated to work with the majority of games
- Additions to debug output (Maria vs. CPU cycles, timer info, etc.)
- Other games improved by various changes
	- Kung Fu Master no longer has the lines in the upper left corner of
		display and the Fuji logo appears as it should (if using BIOS)
	- Midnight Mutants has less graphical glitches
	- Summer Games has less graphical glitches
	- Plutos has slightly less graphical glitches
- Fixed save/restore state issue for games that use RIOT timers.

 

--Raz.

Link to comment
Share on other sites

Just a quick question concerning save issues with games that use the RIOT timer. Could you clarify on that? Which games?

 

The current version of ProSystem does not save RIOT state information w/ the save game. Thus, when you attempt to restore a save game it will act odd or completely lock up since the timer won't be operating as it should. Games that I noticed this behavior included Commando (PAL), Xevious (PAL), and Beef Drop.

 

--Raz.

Link to comment
Share on other sites

Thanks for the information... Got another question for ya. Looking at the code I think I can get the lightgun stuff going.

 

My second question deals with the maria cycle timing. The way mess is set up it pretty much runs X amount of cpu cycles and then when done it hands control over to the video code (maria) which then generates the display. Obviously not the right order. So for example it pretty much executes all 262 cycles. Doesn't bother with running cycles before or after each screenline, muchless account for stolen cycles. So do you think it would be possible to get games like One on One to work correctly with that restraint?

 

I'll have to ask the MESS people if there is some way to modify the machine driver to allow the cpu execution cycles to be split up or not.

Link to comment
Share on other sites

My second question deals with the maria cycle timing. The way mess is set up it pretty much runs X amount of cpu cycles and then when done it hands control over to the video code (maria) which then generates the display. Obviously not the right order. So for example it pretty much executes all 262 cycles. Doesn't bother with running cycles before or after each screenline, muchless account for stolen cycles. So do you think it would be possible to get games like One on One to work correctly with that restraint?

 

Well, it would probably be possible to get One on One to run a reasonable speed. The issue is that it is consuming too many CPU cycles per frame by not taking into consideration the count of cycles consumed by Maria. So, if you reduce the number of CPU cycles it should run at a decent speed.

 

However, not taking into consideration the amount of Maria versus CPU cycles per scanline will lead to various other issues (graphical glitches and probably worse). Also, what happens when a WSYNC is performed? Seems that will be an issue as well. Also, unless you are able to control what is occurring per scanline, I don't think it will be possible to implement the lightgun support as the timing of the lightgun detecting the beam is critical.

 

--Raz.

Link to comment
Share on other sites

My second question deals with the maria cycle timing. The way mess is set up it pretty much runs X amount of cpu cycles and then when done it hands control over to the video code (maria) which then generates the display. Obviously not the right order. So for example it pretty much executes all 262 cycles. Doesn't bother with running cycles before or after each screenline, muchless account for stolen cycles. So do you think it would be possible to get games like One on One to work correctly with that restraint?

 

Well, it would probably be possible to get One on One to run a reasonable speed. The issue is that it is consuming too many CPU cycles per frame by not taking into consideration the count of cycles consumed by Maria. So, if you reduce the number of CPU cycles it should run at a decent speed.

 

However, not taking into consideration the amount of Maria versus CPU cycles per scanline will lead to various other issues (graphical glitches and probably worse). Also, what happens when a WSYNC is performed? Seems that will be an issue as well. Also, unless you are able to control what is occurring per scanline, I don't think it will be possible to implement the lightgun support as the timing of the lightgun detecting the beam is critical.

 

--Raz.

Whoops nevermind.. Actually it is processing each scanline one at a time. It updates the whole screen at the start of vblank. So the only issue I should have is it executes all cpu cycles per scan line , processes the line, and so one. So no cpu cycles are currently stolen. Sorry about that, I was kinda going from memory (not a good idea).

 

So on the 7800 it works like this right? At the beginning of a line it executes 34 cpu cycles, then the maria takes over right? So when the maria is in charge the CPU stops? The maria does it's processing, stealing cycles. Then the cpu gets to execute whatever is left for that line. If it wsync's it hands over whatever free cycles are left to the cpu? And then the cpu gets all cycles during the Vblank?

 

I'm gonna put the docs on my memstick so I have them more handy.

Link to comment
Share on other sites

Whoops nevermind.. Actually it is processing each scanline one at a time. It updates the whole screen at the start of vblank. So the only issue I should have is it executes all cpu cycles per scan line , processes the line, and so one. So no cpu cycles are currently stolen. Sorry about that, I was kinda going from memory (not a good idea).

 

So on the 7800 it works like this right? At the beginning of a line it executes 34 cpu cycles, then the maria takes over right? So when the maria is in charge the CPU stops? The maria does it's processing, stealing cycles. Then the cpu gets to execute whatever is left for that line. If it wsync's it hands over whatever free cycles are left to the cpu? And then the cpu gets all cycles during the Vblank?

 

I'm gonna put the docs on my memstick so I have them more handy.

 

I think most of that is correct with the exception of WSYNC. A WSYNC operational will halt the processor until the horizontal blank, so the CPU wouldn't get any cycles after the WSYNC on that scanline. However, I am by no means an expert on the 7800 hardware. I would definitely look to GroovyBee or Greg Stanton for specific hardware details.

 

--Raz.

Link to comment
Share on other sites

Well it's a start. I'll see if I can get any info from the mess team about whether there is a way to execute a certain number of cycles before and after the MARIA takes over. They can be a little odd sometimes when it comes to questions.

Link to comment
Share on other sites

I'll add this is quite the nice update. I never played Crossbow with the gun on real hardware; I had to get by with stick mode. Using the Wiimote for a gun was nifty. :cool:

 

I have never played with the gun on real hardware either, and it was very cool to play these games for the first time.

 

Alien Brigade is a complete blast (although I keep shooting the wrong people). I also really enjoy Meltdown as it is a very unique take on a lightgun shooter.

 

--Raz.

Edited by raz0red
Link to comment
Share on other sites

  • 8 months later...

Just released a new version of the Wii emulator (0.3).

 

http://www.wiibrew.org/wiki/Wii7800

 

I went ahead and released this so I could get this tested version out prior to introducing the changes that GroovyBee is working on and having to re-test.

 

The changes are as follows:

 

03/29/10 (0.3)

---------------------

- GX based scaler (smoother scrolling in Plutos, Xevious, Motor Psycho)

- Ability to adjust screen size to any size/dimensions via the

"Screen Size" option under "Display". If this is entered after

loading a cartridge, the last frame will be displayed to assist in

sizing.

- Fixed graphical glitches in Ballblazer

- Implemented RANDOM (read) and SKCTLS (write) for Pokey sound emulation

- Ballblazer now plays all sounds

- Minor refactor of Pokey code

- Some minor adjustments to the Light Gun related code

- Updated palette (from Underball)

- Updated menu code, GX rendering of dip switches and debug information

- Ability to set HBLANK period, Dual-analog support in ProSystem database

 

If you have made changes to the ProSystem.dat file, you will need to manually merge them into the version of ProSystem.dat distributed with this release as several things have changed.

 

Also, although I doubt this will affect anyone, if you have a saved state file for Ballblazer, you should delete it as it will cause issues with the changes introduced in this release.

 

--Raz.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...