It is currently Mon Nov 20, 2017 5:01 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Jan 18, 2017 11:28 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
In this thread: post stories where you accidentally shipped software with broken code that by some stroke of luck happened to work fine anyway.


In the original run of the 2A03 Puritans music cartridge, I forgot to use a DPCM-safe controller read routine. I was shocked when I noticed, because the music is full of DPCM samples! How did I forget that??

I quickly fixed the code and ROM when I found it, but I was terribly embarrassed that carts had already gone out. Why hadn't we seen it in testing? When I got my finished copy of the cartridge, I couldn't believe it, but there were no signs of the spurious right press symptom I was expecting. The album played fine, no problems at all!

I didn't understand it until Rahsennor discovered last year that OAM DMA could be used to align controller reads to fall between DPCM clocks and avoid the glitch. I'd accidentally implemented this in my ROM!!!



Have you ever shipped bad code that still ran good? Please share!


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 11:45 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19233
Location: NE Indiana, USA (NTSC)
Concentration Room
I fumbled the shuffle directives in such a way as to upload a palette to the PPU in +32 increment mode instead of the intended +1 mode in some builds. As originally shipped, it had little effect because the intended board had CHR ROM. But when included in a multicart with CHR RAM, it started overwriting parts of the menus' pattern table, affecting the top row of tiles with low even numbers. This led to Terriblegate.

Thwaite
The game ran correctly if a certain memory location contained any value but (if I recall correctly) $02. But if $02 was there, a cosmetic problem emerged: player missiles would instead be drawn as balloons. Again, use in a multicart exposed this, as the multicart engine I was using put $02 in that location.

See also: mandelbug; heisenbug; schroedinbug; phase of the moon.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 12:24 pm 
Offline
User avatar

Joined: Sun Nov 09, 2008 9:18 pm
Posts: 987
Location: Pennsylvania, USA
In The Legends of Owlia, the build most people have has a bug on the password screen where if you have just enough gold, it triggers a race condition which results in crashing the game. Only one person ever reported this, so I'm hopeful that by coincidence few people will run into this game simply by virtue of how much gold they will "usually" have in the game. I've since fixed the bug and Rev B is now being put on cart and is in the steam version of my game.

There was a second bug where if you throw two bombs, and then try to throw a third, you'll hear an error sound indicating no bombs, but your inventory depletes anyway. Due to how one uses bombs it is unlikely anybody would be mashing buttons at that point.

But obviously I'm not happy both those ended up in the production version of the game. I like to think of myself as being very very careful with bugs, using source control, and a document enumerating each bug that comes up, and how and when it was fixed with a git hash. I always look for the root cause of a bug, I'm never satisfied with "well, it seems to work." Yet despite my diligence, it happens anyway.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 1:14 pm 
Offline
User avatar

Joined: Sun Nov 09, 2008 9:18 pm
Posts: 987
Location: Pennsylvania, USA
Another interesting example I thought of is I was accessing a variable in Owlia using a quirk of ca65's syntax that produced an incorrect address in RAM. It worked fine on real hardware and emulators because of RAM mirroring--by coincidence the assembler had produced the correct address, only in a different RAM mirror. So in a sense that's not a "bug," though the code was incorrect and worked only by coincidence. I discovered this when running my game in my emulator GGVm, which does not implement RAM mirroring.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 5:39 pm 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3484
Location: Indianapolis
One of the funnier ones I had was in Munchie Attack. I used a PHA instruction but one of the branch paths didn't have PLA afterwards. That would be certain doom in a subroutine, but this was in the main thread of the program, and I didn't use RAM on the $100 page, so it was safe. But if you look in a memory viewer while it's running, you get to see a nice rolling stack. This became apparent when I put it on Garage Cart, I think it was tepples actually who pointed out the bug.

One facepalm moment I had, was also in Garage Cart (that thing was loaded with bugs!). It wasn't long after learning about color $0D being bad, so I went through and changed that in the various binary files that it included. Then I proceeded to either not save it, or included the old files, because when I released it every black color was $0D. So, mid-way through production I fixed that. I had not burned the EPROMs all at once because I didn't know how many orders were going to be for NTSC or PAL.

Also in Garage Cart, this was graphics instead of code, but.. I had a repeating/tiled Membler Industries logo into the background, scrolled by shifting the pattern tables so it had to be pretty small. But long after I drew it and got the code working, I realized I forgot a letter.. it says Membler Industies. I just said "screw it", I didn't care to remake the whole thing since the logo was drawn quickly and sloppily on purpose, and I guess misspelling your own logo just somehow makes sense in that context.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 7:14 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19233
Location: NE Indiana, USA (NTSC)
Memblers wrote:
One of the funnier ones I had was in Munchie Attack. I used a PHA instruction but one of the branch paths didn't have PLA afterwards. That would be certain doom in a subroutine, but this was in the main thread of the program, and I didn't use RAM on the $100 page, so it was safe. But if you look in a memory viewer while it's running, you get to see a nice rolling stack.

Solar Wars by ccovell had the same bug when moving the player's tank. This wasn't apparent in the CNROM original, but once it was hacked to UNROM, which used part of the stack as a buffer to decompress CHR pages, this stack overflow caused a crash.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 7:29 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 950
Memblers wrote:
I realized I forgot a letter.. it says Membler Industies.

You're in good company there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group