Posts for Alyosha
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
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!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
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.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
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
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Samsara is quite right that WIP was only synced up to that part in 4-2, sorry I should have clarified that. Things Are going smoothly, mainly because aside from lag reduction there really isn't a lot to do in the run. I should be able to finish up in the next day or 2.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
So in researching passwords a bit more it seems like you can get a pure 'start game on expert mode' password that is not just a continuation of a normal mode game. Basically I took Cheez's normal mode run and hex-edited the score and power up state to 0 at the end of the game so that the pasword generator will give me a password for expert mode with 0 score and no powerup, exactly the same as normal mode start up. The result is: F,P,P,M,K,2,P,7,8,6 I feel it would be more correct to start the game in this way then with the flame powerup, so I think I will go with it even though it will be a bit slower in level 1. http://tasvideos.org/userfiles/info/30857121059171598 Here is a WIP that implements everything so far. It still needs some work so probably 1-2 more seconds can be saved. It includes 2-2 and 4-1 skip as well as the new start from 0 password. This adds about 8 seconds to the run, but seems worth it to me.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
http://tasvideos.org/userfiles/info/30844685210962094 was playing around with the skip and found another one that skips all of 2-2! Still looking for other places this might occur, pretty neat! I also confirmed that this glitch occurs on NesHawk.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Well overall I saved 50 frames on password input. The password I am currently using is: 0,1,0,5,Q,R,L,2,9,V This removes most of the long distances between entries, while still starting the game in the same manner as the original password. For anyone interested, here is a brief overview of how the passcode works: RAM of passcode: 0300-0309 The last entry (0309) determines the offset for an array that modifies the other entries and stores them in 0120-0129 From there, 0123 determines level you start at, 0125 and 0127 determine lives and powerups you start with. The checks to determine if the passcode is valid is determined by: 1st check: 0129+0125+0128+0121=0120 2nd check: 0122+0123+0126+0127+0129=0124 Conveniently, the array operations that convert 030X to 012X are just subtractions, so you can maunipulate the checks just by balancing changes to the entries for a net sum of zero. It's pretty straight forward, but the number of possibilities are very vast. There are 8 possible arrays as well. I certainly don't plan to check all or even a large subset of them. Saving 50 frames is good enough for me!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
^ yeah that game is known to have quite a few improvements found and should be easy to improve, it's just a matter of someone sitting down and doing it. I do hope someone takes an interest in it!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
After talking with z1mb0bw4y it seems I will be taking over this run. The password was the first thing to get my attention so I decided to look at the code to see how it is implemented. Turns out it is pretty simple. The level you go to is determined entirely by the 4th and 10th entries, so keeping those fixed it is easy to modify the password to get checks to pass while still going to the correct level (i.e. expert mode level 1-1.) The current run uses B,1,0,5,<3,R,J,2,7,V (that's not what appears on the screen but that is what shows up in memory.) z1mb0bw4y used a slightly modified version, but I thought I could do a little better. I used B,1,0,5,<3,G,J,2,0,V which starts the level 18 frames faster then the published run. (It starts with C7 lives but hey not bad for a first attempt.) I'm pretty confident that I can save another ~20 frames here with some more testing. I'll post all my findings once everything is sorted out.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
I'm making this thread similar to the AtariHawk one so I can sort things out easier. This thread is for general bug fixes in NESHawk, please post any issues you have. Things to emulate: DMA on multi-write instructions Exact power on and reset behaviour FDS / NES audio filtering / mixing second look at sprite limit VS Dual System microphone Things to investigate: FDS Metroid FDS Yume Koujou Doki Doki Panic chinese translation for TMNT3 VRC7 sound (ex Lagrange Point) Chaos World (CH) Save Ram Tests to Pass: scanline/scanline tvpassfail/tv Games that don't work: unsupported low priority Lots of pirate and multi cart stuff Test build: https://ci.appveyor.com/project/zeromus/bizhawk-udexo/build/artifacts
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Hurray! After staring at the code for way longer then it should have taken, I finally found the fix to Corvette zr1 Challenge. It turns out the culprit is this bit of code right here (line 304 in NES.Core.cs)
cpu_step &= 31;
This does not properly cycle through the CPU timing sequence. The correct code should be:
if(cpu_step == 5) cpu_step=0;
This also means you only need 1 iteration of the sequence. (3,3,3,3,4) , not the current 40 long one. Making this change fixes the graphics.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
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!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
You can try Bizhawk's movie import feature I don't know if it works for VBA but it will give you a head start. Also now that you know the camera can be frozen, another possibility is to just freeze the camera where you know you need to do a clip and then just wait until sonic gets there. This approach might work better, just another idea to test. Good Luck!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
I'll try to look into this today. It's also possible that camera speed is capped in simple enough way that the ROM can be easily modified to remove the cap, but let's find out. EDIT: That version of VBA seems old so I am testing with BizHawk. So far I found that camera position is at 590X in IWRAM (2 Bytes per value.) So for example freezing bytes 5900-1 successfully freezes the camera at it's current X-posiiton. Apparently sonic can still move on the stage as collision detection is tied to Sonic's position not the camera's, so next I need Sonic's RAM values to see if I can make a cheat or lua or something to tie them together. Here's a LUA script in BizHawk that does roughly what you want, so it is at least possible to do . This produces a bit of camera shaking, but it should always force the camera to be on Sonic.
while (true) do
	
	cam_x=memory.read_u16_le(0x5900)

	sonic_x_low=memory.read_u16_le(0x59E8)
	sonic_x_high=memory.read_u16_le(0x59EA)

	sonic_x=sonic_x_high*65536+sonic_x_low
	
	gui.text(50,20,string.format('%d',sonic_x))
	gui.text(90,50,string.format('%d',cam_x))
	gui.text(90,50,string.format('%d',cam_x))

	memory.write_u16_le(0x5900,math.floor((sonic_x-30000)/256))

emu.frameadvance();

end
This one works in BizHawk, so you might want to test it out there in level 1. The 30000 there is just an offest from the starting post. It might be different in every level. At any rate this should at least get you going in the right direction.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
https://github.com/TASVideos/BizHawk/issues/487 I believe I solved this issue with Little Ninja Brothers (E) cpu_sequence_PAL in NES.CORE.cs should be 3,3,3,3,4 not 4,3,3,3,3 The clock on PAL NES is divided into 3.2 PPU clocks per CPU clock, so we would expect the extra full PPU cycle to appear on the last CPU cycle, not the first. With this change there is no shaking. This also has impact on Corvette ZR-1 Challenge but looks like other timing issues are still effecting that one. EDIT: The other cart mentioned in that issue report, Pro Action Replay (E), appears to not be properly recognized as PAL. When I use the manual override to set it to PAL there is no shaking in that one, even in the current version of BizHawk.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Finding a way to tie camera position to sonic is probably the easiest solution you can hope for, but there is no garauntee there is a simple way to do it. What RAM addresses do you currently know? Have you found and tried manipulating camera coordinates? If you have a basic RAM map of the game I can try to help in making a camhack, it's something I'd be interested in experimenting with anyway. What emulator are you using? I had to solve the same problem of TASing with off screen characters in Donkey Kong Country. What I did was make a LUA HUD that would display an outline of the terrain around Diddy Kong with a representation of Diddy centered on the screen (kind of like a radar.) This was very labor intensive so I'd only recommend it as a last resort, but it proved invaluable.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Amateseru wrote:
Well, Andy, that's actually wrong, Kanata posted a picture on Twitter where we can clearly see the graphical glitch on screen and he's on N64 (https://twitter.com/kanata2s/status/724783344601292800?lang=fr) so for now we just have no idea how he got it, and testing on emu is so annoying the result is always random (sometimes I just get absolutely nothing... So for now I'll try to do that on my N64 PAL but it will take time and I'll also ask some other people who have a N64
It's mysteries and making discoveries like this that keep me iterested in TASing, how do people even think to try something like this? I'll be eagerly awaiting the detailed explanation once it's figured out, but for now, pretty cool stuff!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Wow I never would have expected a play around of this game. It was actually kind of interesting, especially the boss fights, well done!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Wow really cool stuff! I didn't notice before but I see Mario's shadow even moves into the background when he jumps, nice! When will a build be available? (I can't seem to get the online version working.)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
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, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
The AtariHawk bug fixes resolve several issues on the issue tracker: #206: Halo 2600 is Incompatible Game now works properly, the bug was in RESP constantly moving the player to the right as they try to go left #260: Crystal Castles Graphical Glitch The bug was not assigning a color to pixels in Late HBlank region. They are now properly assinged to black. #263: Several Atari 2600 games emulate improperly graphical and gameplay bugs are resolved through numerous bug fixes. I think this one can be closed and a new one opened specifically for the audio emulation, which is known to be incorrect.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
Well it looks like all my updates got committed, so I think all the questions related to this submission are resolved. ENAM delay does indeed change the outcome of the game and is confirmed on console, so this run is based on emulation error. A side effect of all this is that the game is confirmed to be beatable on console, without even picking up the controller, in under 0.5 seconds (TAS timing.) So I wonder if this category is still viable? Maybe it's time go for an ingame time run?
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
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, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
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!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3602)
Joined: 11/30/2014
Posts: 2749
Location: US
It's been a while since I could touch this list, but now, largely thanks to feos, I can cross off 1 player Battletoads! A lot of challenging runs lay ahead, but their number is slowly decreasing, 17 to go! But, losing all my working files has sapped my motivation a bit, so I think I will take a short break from this and work on something simpler. Also if anyone wants to work on one of the remaining runs I'm happy to team up!