Posts for Alyosha

Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Mugen Senshi Valis, for PCE, has been a game unplayable in BizHawk since the release of the PCE core. I just now fixed this game, but I thought I'd write a little bit about what went wrong and why it took so long to fix. As it turns out, this game was running some timed code. It's using a VBlank loop to do a few operations, and using the remainder of frame time to load data from the CD. The VBlank loop counts down, and after a certain number of VBlanks, the last VBlank interrupt turns off VBlanks. The game is expecting the other loading code to not be finished at this point, because at the end of the loading code, it turns VBlanks back on again! BizHawk was loading in data too fast. So the loading code was finished too early, and turned on VBlanks even though they were still on. Once the VBlank loop ended, it turned off VBlanks, but now had no way to turn them back on again! Oops! To fix the problem, I just increased the loading time from CD reads, which seemed likely to be the correct solution. This all probably seems pretty obvious just reading that last paragraph, but getting to that point took many hours of debugging, I'm glad it's finally done! Now an even greater challenge awaits, why is there audio issues when loading gate of Thunder in the 4 in 1 CD? I've spent even more time on that one and still have no idea. EDIT: nevermind, 4-in-1 is fixed in the same way. Oldest issue on the tracker solved!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Something that I think is worth pointing out here is that even though GBC BIOS is used, it is modified internally in Gambatte like so:
	unsigned readBios(const unsigned P) {
		if (gbIsCgb_) {
			if (agbMode && P >= 0xF3 && P < 0x100) {
				return (agbOverride[P - 0xF3] + cgbBios[P]) & 0xFF;
			}
			return cgbBios[P];
		}
		return dmgBios[P];
	}
This changes the last few segments of BIOS execution from this:
00F2:  18 02     JR   00F6h          A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe  Cy:12985836
00F6:  CD D0 05  CALL #05D0h         A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe  Cy:12985848
.
.
.
00F9:  AF        XOR  A              A:43 B:14 C:00 D:00 E:08 F:c0 H:00 L:7c LY:93 SP:fffe  Cy:13053504
00FA:  E0 70     LDH  (#FF70h),A     A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe  Cy:13053508
00FC:  3E 11     LD   A,#11h         A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe  Cy:13053520
00FE:  E0 50     LDH  (#FF50h),A     A:11 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe  Cy:13053528
0100:  00        NOP 
to this:
00F2:  18 01     JR   00F5h          A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe  Cy:12985836
00F5:  CD D0 05  CALL #05D0h         A:12 B:00 C:00 D:ff E:56 F:c0 H:00 L:0d LY:99 SP:fffe  Cy:12985848
.
.
.
00F8:  AF        XOR  A              A:43 B:14 C:00 D:00 E:08 F:c0 H:00 L:7c LY:93 SP:fffe  Cy:13053504
00F9:  E0 70     LDH  (#FF70h),A     A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe  Cy:13053508
00FB:  04        INC  B              A:00 B:14 C:00 D:00 E:08 F:80 H:00 L:7c LY:93 SP:fffe  Cy:13053520
00FC:  3E 11     LD   A,#11h         A:00 B:15 C:00 D:00 E:08 F:00 H:00 L:7c LY:93 SP:fffe  Cy:13053524
00FE:  E0 50     LDH  (#FF50h),A     A:11 B:15 C:00 D:00 E:08 F:00 H:00 L:7c LY:93 SP:fffe  Cy:13053532
0100:  00        NOP  
The GBA identifier being the increment of B to one. @gifvex: how did this realization come about? I'm not aware of the GBA version of GBC BIOS being dumped. Did this solution just match up to observed behaviour and was simple enough to be correct? (I failed to arrive at this solution when looking over the code myself a couple months back so nice work to whoever came up with that!)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Hurray new core! I consider this a pretty big advancement for BizHawk, it's not very often that a totally new system becomes available for TASing written from the ground up. The Spectrum also uses the z80 much more extensively, and has much more rigorous hardware testing programs available then SMS or colecovision. So along with the new system core it can be used to push the z80 core to be a truly cycle accurate core in pretty much all respects. (but that's a little way off still.) Great work putting this together Asnivor!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
For me 18 minutes of Mario can only be so entertaining. Maybe for aficionados like HappyLee there is some ideal of a ‘perfect’ run, but personally I’m not that interested and I find the technical aspects of optimization more fun anyway. I think in this case two projects with the same goal were happening unbeknownst to each other (until near the end) and MrWint just happened to win, it happens sometimes. Anyway I’ll give it a yes vote, mostly for the submission text.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Yes vote . The pace of this was easier for me to follow then super Metroid so I entertained throughout. Nice run. Edit: oh yeah, an audio channel bug was pointed out to me in 2.2.1 that is fixed in 2.2.2, I don’t know if it effects this game but it might be worth encoding it in 2.2.2 just in case.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Fascinating. I really like stuff like this, working right on the edge of what the hardware can do where accuracy is absolutely required to get it right. And when it comes to edge case ACE runs, my feeling is that it needs to work on hardware or it doesn't count, so having a temp encode of a console verification is a nice touch. Yes vote!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
petaQ wrote:
C64 4 in 1 game cart doesn't work currently, unpaused Bizhawk auto-starts the first game, failing that you can use Joystick port 2 on frame 4 to select the second. Fiendish Freddy's Big Top o' Fun + International Soccer + Flimbo's Quest + Klax (Europe) (C 64 Games System).crt SHA1: 0b35ea869239ed1edbc4b31e6d5da185bf88ea19
Fixed.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Not planned, but I guess I'll do it eventually. I'll need to think of the best use interface for it though.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Since the coleco turbo controller was fresh in my mind , I decided to implement the A2600 Driving controller since the concept is identical (and way easier since the angular resolution is much lower.) Now you can play Indy500 (and whatever other games use this controller, if there are any.)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
With a bit more refinement to the ColecoVision core the homebrew game Burn Rubber can now be played using the driving controllers. With this ColecoHawk has really caught up to speed with some of the other in-house cores, and although it doesn't run in single cycle execution yet, it's much more mature then it was when 2.2.1 was released.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
J wrote:
Something that came up on IRC today, the TAStudio state sizes for C64 games seem unusually large for a machine which has 64kB RAM. I tested a few roms, they seem to use either 0.26MB, 1.04MB or 4.26MB: From the cartridge ROMs I tested, one didn't seem to work, it just booted into normal C64 startup. Tested on fresh Vice, worked fine: "Leaderboard Golf (1986)(Access Software).crt"
I have no idea about the various state sizes, 4MB seems way too much though. Leaderboard Golf was incorrectly identified by BizHawk's ROM Loader as having a 128 byte header. It then unhelpfully truncated the actual header before sending it to the core, where it couldn't be processed. Fixing that made the game boot but it crashed before reaching the title screen, haven't tracked down why yet. Fiendish Freddy's Big Top o' Fun + International Soccer + Flimbo's Quest + Klax (Europe) (C 64 Games System) is doing some stuff with the CIA ports that is not being handled correctly, but I don't know how to fix it yet. EDIT: Leaderboard is gettng icorrect NMI's from CIA2. Have to track down what the reason is. EDIT2: For some reason Leaderboard was using the serial port and the core was sending intrrupts related to it incorrectly. For now I just disabled them completely since the current implementation was wrong and I don't think any games use them that I know of (but as always there probably is one out there somewhere.) Anyway leaderboard works now.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
petaQ wrote:
C64 4 in 1 game cart doesn't work currently, unpaused Bizhawk auto-starts the first game, failing that you can use Joystick port 2 on frame 4 to select the second. Member J posted "Can confirm this behaviour with up to date developer version of BizHawk. Works fine on Vice and CCS64. Fiendish Freddy's Big Top o' Fun + International Soccer + Flimbo's Quest + Klax (Europe) (C 64 Games System).crt SHA1: 0b35ea869239ed1edbc4b31e6d5da185bf88ea19 With TAStudio, there's one frame (#4) where you can press down on Joy2 to select the second game. But things don't seem to work further than that. Moving around in TAStudio (after adding the Down on frame 4) also breaks things further, need to reboot core every time for it to run expectedly. " I'm hoping to Tas Flimbo's Quest having recently worked out how the rng functions. I'll try tape images meantime, I can't find a different compatible cart file.
I'll look into this one. But it better not be another scanline interrupt issue...
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
I don't do too much fancy stuff in TAStudio but it seems to work without issue and is quite a bit quicker then before, great work feos!
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
I fixed ColecoVision so that the Turbo controller now works. Games like Turbo and Destructor should now be fully playable / TASable. NOTE: The correct solution here is subframe input that can capture changes in real time, since a sampling rate much greater then once per frame is needed. Instead this is emulated subframe input, which should be indistinguishable from real input but is never the less slightly wrong. NOTE2: make sure you set 'deadzone' to 0% when setting analog controllers, otherwise you will get very jumpy controls.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Looks like a problem with the triangle channel linear counter. Should be an easy fix. I'll look into it in the next couple of days. Thanks for the report. EDIT: fixed
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Ok I finished adding audio. Along with that I refactored the core a bit to make it function closer to the other in house cores. Please test for regressions.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
I have made the initial commits to ColecoHawk to add Super Game Module functionality (as well as Mega Cart compatibility needed for many of the same games.) The sound from the SGM won't work yet though. I need to refactor some stuff in order for it to be combined with the existing sound output from the core. But for now game functionality can be tested. NOTE: you need to select the option in the colecovision menu in order to enable the SGM.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
^Fixed (note: this occured when selecting an invalid number of players. TCI should behave as NOP regardless.)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
[3577] SMS Psycho Fox by The8bitbeast & Sonikkustar in 02:11.87 I think you can get some good commentary from this one. 'Press pause to go faster' is pretty funny and something I don't think many people have seen before.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Aw man, I didn't know it's already been done, well probably no one wants to see a repeat, even if it's on console now.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Ok so the original one has the same sound chip as Intellivision, not sure about the 'pro' version. Should be easy enough to implement.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
So someone made their own hardware add on to expand the capabilities of the ColecoVision? Now that is serious commitment. The memory management stuff looks easy. I'll need to find out about the sound chip though. I wouldn't expect this to happen anytime soon however.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
[1686] NES Mega Man by Shinryuu & finalfighter in 12:23.34 NESHawk and Mesen agree that a slightly modified version of this run should work on console. I think this run would provide a lot of interesting commentary about how NES works, what the NMI glitch is, and how TASers exploited it. It's the same basic glitch throughout the run, so 12 minutes should be more then enough to cover things at a reasonable pace. You could even explain the basic idea with some visuals or something fun. This might be more technical risk then you want though. If you are intereseted, you might to have TASbot run through this file up to the first glitch in Ice Man stage. If it can hit the glitch consistently (which both BizHawk and Mesen do, so it should be fairly stable) maybe it's consistent enough for the event. It still needs to be re-synced to BizHawk though. (you can truncate the movie to right after the delaywatercurrent glitch, it's only synced to there) http://tasvideos.org/userfiles/info/44988607938034213 Also, I can help with anything NES or BizHawk related if it's needed. Also I like keylie's idea, that sounds cool.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
I guess its possible that your NES is running slightly faster then normal. Everything comes from the same master clock including the signals that control the TV signal. Could be some kind of frequency drift I suppose. It's pretty hard to account for 13 frames otherwise. Also I did test that simplified movements without paper deliveries does not effect the level time. So, it seems certain that the same amount of frames are passing here. The question seems to be how much real time each frame is taking.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3572)
Joined: 11/30/2014
Posts: 2744
Location: US
Interesting. I tested your movie in the most recent BizHawk version and it still syncs, so it's not an emulation difference there. I tested it in Mesen and it did de-sync, so that is a strong indication that something is up. The game uses CNROM which isn't anything too special. I'll look into it. EDIT: Some initial results: Car Honks and Crashes in the game use the DMC channel meaning some DMC DMAs happen at those times, but I didn't see anything that would cause slow down there. Mesen ends up 3 frames behind BizHawk by the time of the restart, I haven't tracked down why yet (probably some ppu timing thing since Mesen starts a little differently.) Whatever the case may be slower isn't helping us here. EDIT 2: I'm not seeing anything here that would cause an error of 13 frames. My suggestion would be to send this run through a console replay device. If there is a consistent de-sync it might point out where emulation is going wrong, but right now my guess is that it would in fact sync (at least some of the time) and that the error is somewhere in the video processing. EDIT3: I added 3 frames to the movie right before pressing start to restart the game after the intentional crashes. After doing this the run synced in Mesen all the way up until Friday (~38000 frames.) This is pretty strong evidence the emulation is correct to much better then 13 frames every level.