Blargg, your TMNT GBS rip...

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Blargg, your TMNT GBS rip...
by on (#20155)
...is not working. I downloaded it on your website and played it on various Gameboy emulators and players but none of them seemed to work at all. What gives? Is there something I need to do to play this? Thanks!

by on (#20157)
It appears to have been significantly modified, and lacked an RST table. The modification was probably due to a lack of an RST table, and it would have been a straight-forward rip if that had been added before the modifications.

I don't know what player supported the GBS before, but it works in Nezplug and in GB format now. See my site.

by on (#20158)
Okay, it seems to working now. Thanks! :D

by on (#20163)
Quote:
It appears to have been significantly modified, and lacked an RST table.

What do you mean by an RST table? My understanding is that RST $nn is equivalent to CALL load address + $nn. I traced the old rip and it indeed uses RST $28, which is equivalent to CALL $4028 as the load address is $4000. Maybe the fact that I compacted several routines together on one page (relocating some as necessary) was obscuring things? I figured I'd make the rip as small as possible, so I used some memory-usage profiling to find what was actually used in playing all the songs. The first rip was larger, but had lots of unused holes in pages, so I moved the code together and relocated some of it. I had never done a GBS rip before, so I doubt the result is conventional. :)

That's bizarre that it wasn't working in any player you tried. I'd like to understand the cause of the problem, because I've implemented my GBS player to the GBS spec and TMNT played fine in it from the start.

The init routine seems fine, as it adds $49 to A so that track 0 is the first music track. Perhaps you added a lookup table to include the sound effects?

by on (#20167)
For the sound/song init coding I used, $4000 was called to help init memory. Because there weren't 0x40 bytes at the start of the GBS, RST calls were hitting this chunk of coding. This wasn't the issue though, just something I noticed it would need for a rerip.

The reason your rip wasn't working was because it hit poorly designed op codes. If you're familiar with BGB, and it's debugger, you can use my GBS2GB program, and use the debugger on the GB version of your GBS, and see what happens yourself. You can breakpoint $4240 in the GBS, and see what happens when you hit an unexpected, and probably unused, RST 38.

by on (#20168)
Apparently something really corrupted the copy I have on my site. I compared with the good rip I made and it looks as if something did a character set conversion on all bytes above 128, and, the final evidence, 0x0D bytes were changed to 0x0A (i.e. linefeed conversion). Thanks for bringing this to my attention, KingKongFu, since it definitely would not work in anything. Though ugetab's rip is better since it has the sound effects put just after the music tracks.