Posts for Alyosha

Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
feos wrote:
Mesen has been tested and it has an increasing lag.
How much lag feos? Anything quantitative? I wonder if it would be better to just send the client audio/video instead of having it run the movie. They can be streamed as they are generated I suppose which might be faster but i dont know anything about networking.
Post subject: Re: SMSHawk emulation bugs
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
It took quite a bit of digging, but all of this is actually correct.
1. Pause button The pause button seems to be game dependent. - In Batman Returns you can spam pause after the 59th frame to effectively reduce the waiting time 1 frame per 2 frames of pressing p (P, empty) User movie #38852237008685032 edit: TwoMbit doesn't have this feature (game loads at same time)
To understand what's happening here, you first have to realize that the 'pause' button on SMS is actually tied to a non-maskable interrupt. The routine the game is doing is decrementing a counter at $DFE7. The problem is that the decrement happens once per interrupt. So when you press pause every other frame, you get 2 decrements on frames with the pause (1 for NMI and one for VBlank.) The obvious question is then why doesn't TwoMbit have this effect? Well I'm not 100% sure but if they happened to poll input at vblank, what would happen is that the NMI would happen first and then immediately the Vblank IRQ would happen before the decrement could take place. Actually, with subframe inputs there would be enough time to decrement the counter in only a couple of frames. I'm not sure if this would make the game crash though.
- In Zool it only have effect after a game started from the menu. You can use pause on lag frames User movie #38849945715866984 edit: TwoMbit acts same!
This is because Pause is an NMI and not effected by lag.
- In Wonder Boy, you can't use pause on lag frames.
NMI always happens, but depending on the state of the RAM it could have no effect.
2. Reset button The reset button seems to be game dependent. - In Zoom 909 and Zool it has no use (TwoMbit has a reset button in the file menu and it works, but maybe it's a fake power on?) - In Batman Returns and Wonder Boy (UE) you can't reset on lag frames.
Reset on the other hand, is treated as a normal controller input. So if the controller is not being read, the reset won't work. Strange stuff. I'm not sure what TwoMbit is doing exactly but it seems like it's just doing a power cycle. Here is some great SMS info: https://pastebin.com/raw/eU8E2nKi
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
GG/SMS and intellivision could use some compatibility testing for sure. (I just committed a fix for SMS Xyzolog that I saw was broken in your doc.) Ah ok, I see, it's not the core that is throwing the error. The hotkey ctrl+s is acting both in TAStudio and in EMUHawk. CTRL+S in EmuHawk is flush savram, and it apparently doesn't check if there is an instance of saveram available to work with. I'll try to figure out what's going on there. EDIT: fixed in master.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
MESHUGGAH wrote:
(edit: bizhawk 1.12.2 release) PCEHawk 1. on 0th frame (open TAStudio, go to 0th frame,) the emulator height becomes zero px and width something 800px 2. load a pce game, open TAStudio, save project, NullReferenceException - EmuHawk thrown fatal expection. Closes application and saves (correctly) project file.
1- fixed in master (as best i could, still a couple pixels off) 2- works fine for me. What game were you testing with? EDIT: EMU 7800 is pretty buggy, your time might be better spent on other systems. Atari 7800 really needs a modern in house core (unless you plan on fixing the bugs yourself, in which case nevermind me.)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
MESHUGGAH wrote:
(changed name from miscalling A7800Hawk to EMU7800) Two things I'm not sure if bug or working as intended: BizHawk 1.12.1 1. Emulators don't care about (TAStudio's) missing input of power on but EMU7800 won't power on only at the very first time of starting TAStudio. (last one is fixed in next version) BizHawk 1.12.2 1. EMU7800 load a tasproj, error pops up: https://pastebin.com/ZwiZZdRj edit: 2. EMU7800, playing Sentinel (a shooter game), you only have "W Mouse" and the console's 4 key as input. It misses the difficulty switches. 3. EMU7800 has weird greenzoning problem. I'm not sure how BizHawk works internally (just checked the saving options), but I get into situations of loading an invalid state that started the movie by skipping the bios. And also there are places where the frame shouldn't be a lag frame but it's colored red, for example spamming Power On various frames. 4. EMU7800 pausing system is a bit weird. To pause the game, you need to press for at least 2 frames, and then for 1 frame. Even weirder that this also works on lag frames. Even if the game doesn't accepts other controls, it will work. There are even games that able to abuse this, but I don't know if this works in real life the same way.
1.12.1 1 - Not sure what you are asking here, can you give a specific example? Is it fixed in 1.12.2? 1.12.2 1-It looks like you are trying to load a tasproj from a previous version. This will not work since I had to change EMU7800 core states. This means a state variable will be missing in TASproj's from older versions. Export to BK2 then reimport to a tasproj should work, or just clear out the greenzones. 2-fixed in master, try the dev build 3-This should have been fixed, but if you have a file where it happens please send it to me. 4-unsure what's happening here, I'll test it out though.
Post subject: Re: Sprite limit option
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Reinc wrote:
Since a few recent releases, I can't find the Sprite Limit option in Bizhawk menu anymore. Where did it go? Is sprite limit enabled by default and can't be disabled now?
Not sure exactly what you are reffering to, but I'm guessing NES->Graphics Settings->allow more then 8 sprites per scanline is what you want. If not you'll need to be more specific. If you mean for game gear games, its SMS->Sprite Limit
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Sour wrote:
The CPU calls MemoryRead()/MemoryWrite() for every CPU cycle - the first thing done in either of them is to call IncCycleCount(), which runs the PPU/APU. So this is done before actually reading/writing to memory. If what you're checking is vblank-based, it might be worth mentioning that Mesen sets vblank on cycle 0 (scanline 241) and clears it at cycle 1 (scanline -1) - whereas the timing sheet on the wiki says it should be set on cycle 1, iirc. I think Nintendulator also does this, but unsure. I feel like I took a look at this in the simulators before, but can't recall the result.
Oh, I see yeah that is definitely a difference. I'll have to see if changing that will help things sync up.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Really? I must be reading the code wrong then. So far I've only been looking at read2004.nes start up, and I can't get the first 5 frames to sync up (which only involves reading the VBlank flag) so there must be something else different happening there. Back to the drawing board I guess.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
I've been comparing trace logs between Mesen and BizHawk but things don't seem to be working out. I believe the problem is that Mesen emulates the system like CPU_tick->PPU_tickx3 while BizHawk does the opposite. This is a big problem for games, and for tests that rely on absolutely timed code, since the issues that crop up are related to reading the VBlank flag which is sensitive to 1 ppu tick. We rely heavily on relatively timed test ROMs, which sync themselves to a singal PPU tick, but the syncing process masks out how the emulator deals with it. Both ways are almost certainly wrong and mistiming certain situations. I believe this is a significant roadblock to getting many more games to sync on hardware. Probably what we really need is an emulator in between visualNES and Mesen/BizHawk that runs at the master clock tick level without being a chip simulator.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
phoenix1291 wrote:
Version 2 work fine with Lagarith too for you or video dump die like for me?
No Lagarith works fine for me almost at full fps, not sure what to tell you about that one.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
phoenix1291 wrote:
Sure, here are two movies files, one old and a new one, for Astrosmash (1981, Mattel).
Ok, version 1 is broken because the format changed between releases. Version 2 records fine but yeah when you resize the recording it slows down considerably, I'm not sure exactly what is causing this, must be using a lot of computing power trying to rescale, not sure there is anything I can do about it though.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
I tested again using the same game and steps you used above. Everything runs fine and recording happened at 60 FPS. The resulting video looked and played correctly. If you want you can send me your specific movie file and I can try making a recording of it to see if anything happens, but other then that I'm not sure what I can do since everything works correctly for me.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Oh that was fast, thank you! I didn't see that option. One other thing, is it possible to add an option to have the VBlank flag set at power on? Most games are pretty good about checking first but there are important examples where the game just blindly waits for 2 vblanks and obvious differences appear when it is set at power on.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Some console testing needs to be done with paperboy before a new run can be made. The arrangement of customer houses after power on is determined by power up timings in the emulator, and I am almost certain that the configuartion in the currently published run is not accessible at power on.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Thanks for the fixes! One other thing I noticed is that when I pause the emulator, the counters disappear. This makes it a bit difficult to compare frames, is there a way they can be made to stay visible?
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Dwedit wrote:
Why does the Atari 2600 sound chip used by 7800 games sound so awful?
Well, it doesn't sound all that great on console, but also the EMU7800 core used in BizHawk is not partiuclarly strong. Comparing against other video online of this game, there are pretty obvious emulation issues. Might be worth while to make an in house 7800 core that is less buggy.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Sour wrote:
Surprisingly, there wasn't - I've never had a need for one, and nobody ever asked for one until now. I just added one though - it's in Options->Emulation->Advanced Not sure what you mean by powering from a reset routine? Both power & reset in Mesen call CPU::Reset which runs the PPU/APU for a number of clocks while the CPU is starting and fetching the reset vector's value, etc.
Thanks! I mean counting the CPU cycles that takes in the trace logger so it starts at 8 (9?) instead of 0. EDIT: Also I'm noticing that Mesen seems to not be resetting everything completely on reloading a game / doing a power cycle. I am working with the game Bible Buffet (USA) (Unl) (v6.0) and when I first open Mesen and load the game, it takes 9 lag frames to get to the title screen. But, if I subsequently load the game or do a power cycle, it takes 10 lag frames, any ideas what is causing that?
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
@Sour: is there a frame counter in mesen? I found a lag counter but couldn't find the frame counter. Also , what do think of powering on nes from CPU reset routine ? This is what biz hawk currently does and it would make it easier to compare trace logs.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Sour wrote:
Thanks, here are the results: -Both Bionic Commandos sync to the end. -With a small modification (altered the PPU/APU sync after reset in CPU::Reset), Battletoads syncs at first, but then desyncs a bit after the warp. -Both streemerz runs desync. streemerz_joe desyncs almost right away. The other one gets relatively far (maybe ~2 mins in?) and eventually desyncs in a room that had ~10 clowns. For the bugs after compilation, the build process is silly and you need to build 2x for it to work properly (otherwise the resource files will be missing from .exe) - it shouldn't be an issue except the very first time you build it. Also, I just commited support for MD5 hash checks in bk2 files (had only implemented SHA1 ones since it seemed like they were the only thing used), you'll need that if you want to try the Bionic Commando/Battletoads movies.
DId you mean altered PPU/CPU sync? because I don't think battletoads is affected by the APU in any way. Building twice worked! Ok cool now I can do tests. I'll do some more tests as time permits and try to track down where the two emulators differ.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
pirate_sephiroth wrote:
Alyosha wrote:
It's possible with the mini boss skip that doing level 7 first is slightly faster over all then stage 8 first. It probably would be pretty close, at least worth looking into if a serious attempt to optimize this is being made.
We wouldn't have the buster upgrade and the laser to kill enemies faster or escape the capsules and boss door for 2 stages
Oh yeah, I forgot about that one, you are right. Also, are we sure this game is emulated well enough that all these glitches are valid? Some of the glitches seem to strain the system pretty hard, and debugging utilities are currently pretty limited.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Sour, here are a couple of bk2's to test against Mesen, They are for Bionic Commando. I'll get a few more editted into this post by the end of the day too. This is a good test since it requires fairly careful timing but not quite down to the ppu tick. http://tasvideos.org/userfiles/info/37881733414401898 http://tasvideos.org/userfiles/info/37881743719985076 If you are feeling ambitious, this battletoads run is known to sync completely through on console: http://tasvideos.org/userfiles/info/38673693612623545 Battletoads requires exacting ppu level timing from power on to sync, so this run is probably the single strongest piece of evidence that BizHawk is actually doing something correctly beyond what FCEUX is able to do for actual games. You might need to fiddle with power on timing to get it to sync though. EDIT: Here are 2 more test runs for Streemerzzz. They sync on BizHawk but console testing indicates they both should desync. I'll be very interested to see what Mesen does with them. http://tasvideos.org/userfiles/info/36472647975351756 http://tasvideos.org/userfiles/info/36428673262038989 I tried testing myself but after I compile Mesen and try to run it I get errors (both in x86 and x64):
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
It's possible with the mini boss skip that doing level 7 first is slightly faster over all then stage 8 first. It probably would be pretty close, at least worth looking into if a serious attempt to optimize this is being made.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
NES: Works for me, can you give a specific example of a code that doesn't work? SNES: not sure Genesis: known to not work in 1.12.1, should work now in the dev build though so give it a try.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Sour wrote:
Things I recorded in NesHawk and played back in Mesen: -Super Mario Bros: OK -Super Mario Bros V.S: OK -Akumajou Dracula: Desyncs - the FDS implementation between Mesen/NesHawk is pretty different with regards to how the drive is emulated, so this is mostly unavoidable unless we agree on very specific timings. -Contra: Desyncs near the end of level 1 Things I grabbed off TasVideos: -Balloon Fight by Weegeechan: OK -Castlevania 3 (Warp glitch): Desyncs, but seems to desync in NesHawk too? -Addams Family by ventuz: Desyncs, but seems to desync in NesHawk too? The main thing I had to modify in Mesen was the moment the frame number is changed (scanline 241 for NesHawk, was scanline -1 for Mesen), else almost everything was desynced. One thing I noticed in NesHawk, after a reset (Scanline = 0, Cycle = 0), FrameAdvance is called, which calls this: runppu(postNMIlines * kLineTime - delay); This might mean that the CPU and PPU are running for ~20 scanlines, before resyncing back to scanline 0? I'm assuming I'm wrong since that would probably screw up a lot of stuff.. At this point, I guess I would need to use NesHawk's trace logger & compare it with Mesen to see why Contra desyncs - the rest is hard to judge since FDS will desync no matter what at this point, and the other 2 also desync in NesHawk. EDIT: Forgot to mention, this only supports reading bk2 files, not creating them.
Contra uses the DMC so any stray controller read glitches will throw off the run. I imagine we don't emulate that exactly the same so I'm not surprised that one fails. After reset, BizHawk runs a ppudead frame similar to power on, so no it doesn't jump into a frame in that awkward way, but it also isn't exactly the same as hitting reset either. This is a work in progress. I only slightly modified FDS code to improve sound emulation and otherwise have not looked at all into how it is emulated, yeah probably hopeless to sync for now. I'll try to post some BK2's that should sync in mesen in the next couple of days when I have a bit more time.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Wow that ending input early trick. Well done finding that one. Congrats team 4. We only missed 3rd by a couple frames.... ouch. XD I have to say great work to Tompa for basically carrying the team. Also he found an instant mini boss kill that i didn't see in the winning submission, so good work on that too. This game sure was glitchy! Thanks for hosting ThunderAxe31, I didn't really like the game but the time frame to TAS it in seemed sufficient so good job estimating that right.