Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
With the implementation of PRG write delays, many graphical bugs are now fixed (such as the 'O' in power in H.E.R.O. above. ) This fix also correctly implements PRG delays due to HMOVE, which is what the hacked in original 3-2-1 code was trying to do. This also fixes the rather annoying house moving bug in River Raid. At this point pretty much all graphical bugs should be fixed.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
DwangoAC has kindly agreed to do console testing of FlapPing for me to check the ENAM delay case sometime soon. This is the last thing I need checked before getting the code committed to BizHawk. This is a pretty obscure test and I couldn't find any other examples where it might come into play, so I thought I might make some example videos just to make sure the results are exactly what is needed. The test case is an easily reproducible run that I have achieved real time on both BizHawk and Stella with little effort (usually under a minute.) This is convenient since it means console testing doesn't need a complicated playback device, just a few tries by hand until it works. For the purposes of TAS, the inputs are pressing 'select' on frame 12 and then 'reset' on frame 24 after power on. Also the difficulty is on hard mode. This first video is without ENAM delay, it is what will happen in the current version of BizHawk. Link to video This second video is what will happen with ENAM delay. This movie matches what you get from Stella. Link to video So this simple test produces some pretty easy to verify results. Current BizHawk loses, and the version with ENAM delay wins. As an aside this is the fastest win case I have found so far in Stella. Now all that is needed is to see what happens on console.
Samsara
She/They
Senior Judge, Site Admin, Expert player (2122)
Joined: 11/13/2006
Posts: 2794
Location: Northern California
Alyosha wrote:
DwangoAC has kindly agreed to do console testing of FlapPing for me to check the ENAM delay case sometime soon. This is the last thing I need checked before getting the code committed to BizHawk. ... So this simple test produces some pretty easy to verify results. Current BizHawk loses, and the version with ENAM delay wins. As an aside this is the fastest win case I have found so far in Stella. Now all that is needed is to see what happens on console.
dwangoAC just console verified the ENAM delay run on stream: Exact same result as your second video.
TASvideos Admin and acting Senior Judge 💙 | Cohost
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.
Post subject: FlapPing has been console verified (ENAM delay)
Moderator, Senior Ambassador, Experienced player (898)
Joined: 9/14/2008
Posts: 1007
Alyosha wrote:
DwangoAC has kindly agreed to do console testing of FlapPing for me to check the ENAM delay case sometime soon. This is the last thing I need checked before getting the code committed to BizHawk. ~snip~ So this simple test produces some pretty easy to verify results. Current BizHawk loses, and the version with ENAM delay wins. As an aside this is the fastest win case I have found so far in Stella. Now all that is needed is to see what happens on console.
And, indeed it does! I set up a Twitch stream tonight and did some tests with real hardware and some quick fingers. The results - Stella with ENAM delay wins! That's right, on a console I was able to hit the game select and game reset buttons fast enough after console power-on to recreate the exact result in the second of the two videos (https://youtu.be/mf9RSyNCvUY). Alyosha, thanks for all of your hard work on this!
I was laid off in May 2023 and could use support via Patreon or onetime donations as I work on TASBot Re: and TASBot HD. I'm dwangoAC, part of the senior staff of TASVideos as the Senior Ambassador and BDFL of the TASBot community; I post TAS content on YouTube.com/dwangoAC based on livestreams from Twitch.tv/dwangoAC.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
Wow it really worked! That's great! Big thanks to DwangoAC for doing this test. This was the single way I had to test it and finally a definite result, awesome! Well now I will work with Adelikat to get everything merged into BizHawk proper (which is really just updating the TIA file.) With the bug fixes Atari 2600 should have a much higher compatibility. However more testing is needed, and while everything seems to work, I suspect there are some things that are subtly wrong, and might need a second look. But I won't know until a wider audience plays different games and bugs turn up. For now though hurray it works!
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11272
Location: RU
Amazing job gentlemen!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Fog
Experienced player (626)
Joined: 4/5/2014
Posts: 459
If you need any assistance in creating a pull request, feel free to PM me either on IRC or on the forums.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
^ Thanks for the offer, I have done so. I have also updated the opening post with current state of AtariHawk. There are still several things to look into, but things have really improved. There are only a couple of things left before I would say AtariHawk reaches parity with Stella, clearing with Late HBlank flag with a well timed HMove, and sound emulation. The first one should be pretty simple to work out, but I currently can't follow the code well enough to work out the sound emulation errors or how to fix them. After that there are still some open questions with understanding delays at a low level and Cosmic Ark star pattern. I have some hope for the delays, but the stars remain mysterious.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
With the latest code correction to HMove Kool Aid Man can now be played properly! BizHawk 1.11.6 displayed a notorious bug where poor HMove timing caused collision detection to register every frame (with 2 score numbers colliding.) This is now fixed: I also took one more look at Cosmic Ark stars, but all I could come up with is that they are displayed differently based on different TIA revisions. I don't think this can be further resolved without analyzing the circuits, so I'm just going to set this aside and focus on known issues.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
Tapper is a 1983 game by Sega. It has some pretty nice sounding music for a 2600 game. This game also happens to be an excellent emulation test case as it uses several hardware edge cases that I haven't seen in other games. It didn't work at all in BizHawk 1.11.6. This was because an undocumented 6532 instruction was not emulated correctly. Fixing this at least let's the game run. It also has some odd mapping going on. Apparently some of Sega's games have banks that are physically flipped, so even though this game uses a common mapper, the initial bank that gets pointed to is incorrect. But somehow through apparently shear luck the game still runs. This will eventually need to be fixed somehow, but I'm not sure exactly how yet. More seriously, in the above pic we see the middle mug is missing. The reason is due to the uderlying clocking delays in the TIA. When a 'start drawing the player' signal is generated, it actually happens 5 clocks before a pixel appears. What Tipper does is reset the player on the same clock that the signal is generated. On hardware this is fine, but without proper low level emulation of the start signal, this results in the player not being drawn at all in BizHawk. This is going to require quite a significant modification of the code to fix. I guess there is still a lot of work to do!
Post subject: TIA-related crash when pausing
Editor, Experienced player (608)
Joined: 11/8/2010
Posts: 4012
In the latest interim revision of BizHawk, as well as one I have from around May 1, BizHawk crashes whenever I pause an Atari 2600 game or click the File menu to pause. Only A2600 games are affected and the exception thrown mentions the TIA so I thought you might know what it is and how to fix it: System.IndexOutOfRangeException: Index was outside the bounds of the array. at BizHawk.Emulation.Cores.Atari.Atari2600.TIA.GetSamples(Int16[] samples) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Emulation.Cores\Consoles\Atari\2600\Tia\TIA.cs:line 1462 at BizHawk.Emulation.Common.DCFilter.BizHawk.Emulation.Common.ISoundProvider.GetSamples(Int16[] samples) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Emulation.Common\Sound\Utilities\DCFilter.cs:line 109 at BizHawk.Emulation.Common.FakeSyncSound.GetSamples(Int16[]& samples, Int32& nsamp) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Emulation.Common\Interfaces\ISyncSoundProvider.cs:line 38 at BizHawk.Client.EmuHawk.SoundOutputProvider.GetSamplesFromBase(Double& scaleFactor) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Client.EmuHawk\Sound\Utilities\SoundOutputProvider.cs:line 167 at BizHawk.Client.EmuHawk.SoundOutputProvider.GetSamples(Int32 idealSampleCount, Int16[]& samples, Int32& sampleCount) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Client.EmuHawk\Sound\Utilities\SoundOutputProvider.cs:line 108 at BizHawk.Client.EmuHawk.Sound.UpdateSound(Single atten) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Client.EmuHawk\Sound\Sound.cs:line 213 at BizHawk.Client.EmuHawk.MainForm.StepRunLoop_Core(Boolean force) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Client.EmuHawk\MainForm.cs:line 2886 at BizHawk.Client.EmuHawk.MainForm.ProgramRunLoop() in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Client.EmuHawk\MainForm.cs:line 519 at BizHawk.Client.EmuHawk.Program.SubMain(String[] args) in c:\BizHawk-1.11.1\gitsource\trunk\BizHawk.Client.EmuHawk\Program.cs:line 279 This bug does not appear in the released BizHawk 1.11.6.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
var samples31khz = new short[_audioClocks]; // mono
it looks like _audioClocks is either 0 or ill defined when BizHawk tries to save a state (any time the game isn't just normally running, pausing for example.) It looks like some of the commits since 1.11.6 have changed how inconsistancies in states are dealt with in BizHawk. Somehow, this code worked before the changes (I don't know how it could have muddled through this, but it did) but now it gets ill defined and throws an error. Anyway, I patched it up for now, sound emulation is still rough so I'll change it again at some point in the future. Please download and build from here and let me know if it works: https://github.com/alyosha-tas/BizHawk
Editor, Experienced player (608)
Joined: 11/8/2010
Posts: 4012
Thanks for your efforts so far. It no longer crashes, and seems fine when no sound is playing at the moment BizHawk is paused. However, if BizHawk is paused in the middle of the Atari 2600 outputting a sound, a clicking sound will repeatedly play while BizHawk is paused. The frequency of this sound appears to vary; for example, it's faster in Airlock than E.T. when comparing between main menu sounds. Also, I just noticed in the latest master BizHawk interim that Mute Frame Advance appears to be broken for the other cores. In other words, the current tone that was playing upon pausing BizHawk will continue to play/loop until the user unpauses BizHawk no matter what. This is in line with what you said that it's the general state of BizHawk's states and not just the A2600.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
I'm not sure why a sound would play when the emualtor is paused, but anyway I implemented a check in AtariHawk to only even attempt to play a sound if there are non-zero samples available. Now there is no more clicking sound. So try downloading again and make sure everything is fixed. Quicknes does seem to have a similar problem but NesHawk seemed to work ok. I've also been working more on TIA stuff and slowly getting it into a state where the last few bugs can be fixed. It might even be a small step up over Stella in some areas once it's done, since Stella has a graphical bug in Taper while BizHawk doesn't.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11272
Location: RU
Alyosha, why won't you become an actual bizhawk committer?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Editor, Experienced player (608)
Joined: 11/8/2010
Posts: 4012
Unfortunately, I'm still getting the strange clicking/popping sound. It might just be a garbage noise. Here's a sample of it. And you're right about NESHawk, it doesn't produce any sound when paused, just like it should. Looking forward to seeing those TIA fixes when you have them done! It's been kind of exciting following this thread and seeing what progress you're making.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
feos wrote:
Alyosha, why won't you become an actual bizhawk committer?
Well I'm not really an IRC person, but I'm happy fixing bugs on the side, it's fun :) Also it's a nice break from TASing.
CoolKirby wrote:
Unfortunately, I'm still getting the strange clicking/popping sound. It might just be a garbage noise. Here's a sample of it. And you're right about NESHawk, it doesn't produce any sound when paused, just like it should. Looking forward to seeing those TIA fixes when you have them done! It's been kind of exciting following these thread and seeing what progress you're making.
Oops! You are right I uploaded the wrong file, NOW it should be fixed. Also, I finally got Tapper looking correct ! Here is Stella for comparison, note the slight graphical glitch at the end of each bar. This is the only graphical bug I've seen in Stella. And now here is updated BizHawk, having come a long way from not running at all, to missing some mugs, to finally looking correct: Tapper , Kool Aid Man, and Cosmic Ark are 3 of the harder games to emulate correctly, each one pushes the hardware and uses TIA quirks in it's own way so I'm pretty happy to have gotten all 3 working correctly (and with color clock correct code too, not just hacks.) But there is still more to do (try loading up Congo Bongo) so the testing continues!
Editor, Experienced player (608)
Joined: 11/8/2010
Posts: 4012
Yep, works great now, thanks! Also loaded up Tapper and Kool Aid Man and they play perfectly. Good luck with the rest of the bugs!
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11272
Location: RU
Alyosha wrote:
feos wrote:
Alyosha, why won't you become an actual bizhawk committer?
Well I'm not really an IRC person, but I'm happy fixing bugs on the side, it's fun :) Also it's a nice break from TASing.
You don't have to be there all the time. Just log in from time to time (like me). The result is just easier than constant PRs.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 6/8/2005
Posts: 236
Location: Madison, Wisconsin
Alyosha wrote:
feos wrote:
Alyosha, why won't you become an actual bizhawk committer?
Well I'm not really an IRC person, but I'm happy fixing bugs on the side, it's fun :) Also it's a nice break from TASing.
Frequent IRC is not required. I don't log in a whole lot myself. But direct commit access makes things a lot less spammy for everyone. Just ask! :)
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
^ sorry for the spam, I'll make sure the next one is more complete before posting it so I'm not constantly adding things. Now that the TIA is sorted out things should change much more slowly. So it seems the simplest solution for Sega games that use F8 mapper but start in a different bank is just to list them out and make a mapper specifically for them that points the correct bank. Congo Bongo started in the wrong bank before: But with the latest fixes it now is correctly picked up and starts and runs just fine: With the implementation of this change, I am not aware of any more graphical glitches in AtariHawk, hurray! (I'm not counting Cosmic Ark stars since that behaviour is still not understood.) The TIA still isn't perfect, but I don't have any tests I can perform that don't work, so maybe I'll have to scrounge around for some test roms to make some of the really obscure accuracy adjustments. But I think next I'll work on that 45A0 mapper and maybe see if I can do something about the sound emulation.
Experienced player (633)
Joined: 11/23/2013
Posts: 2208
Location: Guatemala
Alyosha wrote:
With the implementation of this change, I am not aware of any more graphical glitches in AtariHawk, hurray!
As far as I remember, there we're some graphical issues with AVGN K.O. Boxing, a homebrew game, which really has no major issues in Stella.
Here, my YouTube channel: http://www.youtube.com/user/dekutony
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
Kurabupengin wrote:
Alyosha wrote:
With the implementation of this change, I am not aware of any more graphical glitches in AtariHawk, hurray!
As far as I remember, there we're some graphical issues with AVGN K.O. Boxing, a homebrew game, which really has no major issues in Stella.
Looks fine to me, maybe download the current build and post a pic if you see something that doesn't look right .
Editor
Joined: 3/31/2010
Posts: 1466
Location: Not playing Puyo Tetris
Alyosha wrote:
Kurabupengin wrote:
Alyosha wrote:
With the implementation of this change, I am not aware of any more graphical glitches in AtariHawk, hurray!
As far as I remember, there we're some graphical issues with AVGN K.O. Boxing, a homebrew game, which really has no major issues in Stella.
Looks fine to me, maybe download the current build and post a pic if you see something that doesn't look right .
I think the HP Bar is wrong, based on Screenshots I saw. But, BizHawk crashes when I try and use any Menu while running the Atari 2600 Core. https://github.com/TASVideos/BizHawk/issues/634
When TAS does Quake 1, SDA will declare war. The Prince doth arrive he doth please.
Alyosha
He/Him
Editor, Expert player (3534)
Joined: 11/30/2014
Posts: 2732
Location: US
^that error with samples should have also been fixed with the last pull request, I even downloaded and compiled from master just to make sure, did you get that error message from a build after the pull request was merged hegyak?