Posts for Alyosha

Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
It may be possible to significantly improve the run in the future when subframe resets become possible.
If you are interested, subframe resetting is available in GBAHawk, though I haven't tested it in a while, but I'm pretty sure it's in working order.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
GoddessMaria wrote:
Do you need an authentic Emerald or LeafGreen cart to do testing?
Well as long as the run doesn't save I don't need it, the run should work for any cart as long as no saves or autosaves happen. But otherwise yes I would need one (I don't have one and I'm not willing to pay ~$200 for one to buy it myself, what's with these crazy prices?) Although with 2.2.0, people can tune runs to their personal carts, so there isn't a need for me in particular to do it, and I think emulation is otherwise accurate enough for a new run to sync on console (of course, testing as you go is recommended.) Pokemon is probably the last run of interest for console verification, so I'm willing to help in whatever way is needed for it to happen. Side note: I heard back from Epilogue and they say Mario Kart save loading will be supported in an upcoming software patch, so eventually that one will be done too.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
With GBAHawk 2.2.0 released, I added check marks to DKC 2 and Super Metroid GBA. At the moment there are no remaining runs to check for games that I have carts for, so, I guess that's all for now.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
GBAHawk 2.2.0 is released, with implementation of Flash chip type selection and manual timings. This also includes the accuracy improvements for DKC 2 and Super Metroid GBA. Next thing to work on is GBP detection / emulation, which is disabled in this release, but all the wiring is done, I just need to understand the commands. Aside from that the only major upgrade I want to make is finishing implementing the LDM^ glitch. Just bug fixing after that.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
No luck resyncing Gunstar Super Heroes or Lady Sia to GBAHawk.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Not sure about emerald, but on saphire the order goes : timer start Flash chip check halt is sued on copyright screen So, as long as RNG isn't used before the copyright screen, the chip check shouldn't matter if it takes less than a frame. And it seems the check doesn't do much more than check the ID, so halt should be able to sync everything up. At least in Sapphire
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
CasualPokePlayer wrote:
Makes more sense. Starting at 225 means it takes 163 scanlines to get to the second frame, 65 scanlines less than the typical 228 total scanlines. I would assume me offsetting by an entire frame more just worked due to how Pokemon polls inputs (once at the start of the main loop, which normally at the beginning of vblank).
Correct. And even though timing tests give 65, I do occasionally have to apply -1 to the GBI inputs if inputs are being polled really close to the start of vblank, so maybe there is a slight offset to when GBi applies inputs and the original -83776 is closer to the precise value that should be used.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
CasualPokePlayer wrote:
That still doesn't make much sense? Startup timing tests indicate that input would be polled sooner on console than emulator? Is it GBI somehow being late with its internal timestamp tracking? (by ~20 PWM frames???) Keep in mind by "1 frame back" I meant I just set the starting cycle from 0 to -CYCLES_PER_FRAME.
Based on my testing, the first frame after power up is shorter. A test called music4.gba, show that the ppu must start either at scanline 161 or 225 (GBAHawk starts at 225, which is where the 65 comes from.) With this timestamps for GBI line up (roughly) with vblank boundaries, which is noticeable when testing games that sample input close to the start of vblank. I imagine this was noticed by whoever put -83776 in the original script as well (1232*65 = 80080 which is pretty close.)
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
CasualPokePlayer wrote:
I already had the cycles per frame add set to the end of the movie. The subtraction of the frame is after that change. (in fact, you have some weird -1232 * 65 offset already? Which doesn't make much sense)
Interesting, well I'll eventually get to Pokemon but I doubt it got the right RNG by chance. That value comes from start up timing tests. Similar to how the tas.bot script has cycle = -83776.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Here's the current loop I use, which is also a modified version of that script:
cycle = -1232 * 65
#cycle = 0
with open("GBItimestamps.txt", "w") as f:
  for line in inputs:
    sline = line.decode().rstrip()
    if sline[0] == "|":
      data = sline[:-1]
      data = data[1:]
      #data = data[25:]
      if data != lastInput:
        if cycle < 0:
          f.write(f"{0:08X} {convert_frame(data):04X}\n")
        else:
          #sometimes need a -1 here, depends on timing of inputs per game
          f.write(f"{cycle//4096:08X} {convert_frame(data):04X}\n")
      lastInput = data
      cycle += CYCLES_PER_FRAME
The most important difference is that cycle_per_frame are added last, which explains why you had to subtract one frame worth of timing. I don't remember actually making that change, but I think it is correct since input should occur at the start of the current frame.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
What script did you use to dump the inputs?
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
jlun2 wrote:
I'm not sure if it was asked here, but are the Pokemon runs console verifiable? I'm especially interestested in the ACE ones.
I don't see why not, it should be just a matter of characterizing cart timings.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
jlun2 wrote:
Wow, that's incredible! How hard was it to resync it? Was it mostly add/remove frames?
It was easy, just adding frames for loading times, which is trivial with RetroEdit's resync script. It seems most GBA games are merciful when it comes to RNG, most runs even from VBA are resyncable.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Cool run. I admire your dedication in being able to keep redoing things and still finish the TAS. After dialing in EEPROM timing and resyncing to GBAHawk I was able to console verify this: Link to video
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Thank you Alyosha, that's great! What did you have to do to resync the video for console verification?
I just changed the console mode in the sync settings in the bk2 to GBA mode, then deleted frames until it synced.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
I was able to console verify this: Link to video
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
I tried console verifying this but I am unable to load SRAM to my cart for some reason (even though it saves fine on console.) I was at least able to verify the first cup with clean SRAM: Link to video It seems flash timings are wrong at the saving part, so only the first cup worked. I don't want to damage my cart so I won't do any more testing until I can access the SRAM properly. Anyway cool run.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
CasualPokePlayer wrote:
Flash ID checking would end up taking differing amounts of time depending on flash ID returned, so that could be useful for letting the user select it regardless.
Oh yeah, I forgot about that. Why can't it just be simple.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
CasualPokePlayer wrote:
By "same chip as in Pokemon" do you mean you checked by unscrewing your own cartridge? Flash 1MB chips come from potentially 2 different manufacturers, Sanyo and Macronix (the latter being more common iirc?). The Pokemon RTA community has noted Sanyo chips apparently are much faster than Macronix chips.
Yes I unscrewed them and I have Macronix in both my carts. I don't know how much effort I should put (or want to put) into characterizing flash timings my manufacturer vs just having a user settable range big enough to cover the possibilities. It seems like the latter option is probably better, knowledgeable users can fill in the correct values.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Link to video After carefully tuning Flash timing parameters to match my cart, I was able to verify a resync of SMB3. I did not have to otherwise add any lag frames, and I starrted from clear SRAM, so emulation seems correct there. I also disabled GBP detection. I had to use very large parameters for flash timing, 1500000 cycles for a sector erase compared to ~350000 I used for Sonic. The chip in SMB3 is the same one as in pokemon, so maybe I need different defaults for those but I can't seem to find a data sheet that is an exact match. Anyway the sync settings for manual flash timing will be included in the next release. I'll try to do all levels this weekend.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
CasualPokePlayer wrote:
Note that with GBI you can just eliminate the GBP detection entirely (it's a configurable option), or alternatively plugging in something to the link port will prevent serial communication from taking place (this is what RTA runners do IIRC).
Woah really? Thanks for the tip! I'll give this a try.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Some minor follow up here. I started testing with SMB3, but GBP does have an effect on sync, so I will need to more carefully emulate GBP before I can sort that one out. GBP detection uses the serial port with a certain protocol, so it takes up some amount of the processing time.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Awesome work, now that is a proper Dedede fight. I console verified this run: Link to video I removed myself as co-author as anything I did previously is superseded by the new run. I'm surprised you were able to find so many frames to save, nice optimization work.
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Nice work! Console verified: Link to video (And, after numerous complaints from youtube commenters, I finally found the setting in OBS for mono sound!)
Alyosha
He/Him
Editor, Emulator Coder, Experienced Forum User, Published Author, Expert player (3821)
Joined: 11/30/2014
Posts: 2829
Location: US
Link to video Recent 101% DKC run verified as well. That's all DKC runs verified (even though I have to wait for next release to put a check mark on DKC2.)