{"id":1496,"date":"2015-04-28T01:02:10","date_gmt":"2015-04-28T01:02:10","guid":{"rendered":"http:\/\/blog.system11.org\/?p=1496"},"modified":"2017-05-26T17:58:07","modified_gmt":"2017-05-26T17:58:07","slug":"repair-working-around-a-faulty-gundhara","status":"publish","type":"post","link":"https:\/\/blog.system11.org\/?p=1496","title":{"rendered":"Repair &#8211; working around a faulty Gundhara"},"content":{"rendered":"<p>I picked a Gundhara PCB recently on the forum, it was advertised as a bootleg but it strongly resembled the strange Daioh I got recently and obviously came from the same factory.\u00a0 I think the most likely explanation for these boards is that the factory actually making Allumer boards started making a few side projects of their own, probably without permission which would technically make them a bootleg even if all the parts are correct.\u00a0 That or they&#8217;re weird short runs for China or something.<\/p>\n<p>Sadly one of the things that made the owner think it was a bootleg turned out to be the sound.\u00a0 It was sort of weak and muddled sounding, making odd thump sounds in time to the music where just drums should be, and so on.\u00a0 Before we talk about the issues, let&#8217;s take a look at the PCB.\u00a0 By the way, the ROMs are identical to a normal board, just split into smaller pieces.<\/p>\n<p><a href=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_map.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1497\" src=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_map.png\" alt=\"gundhara_fix_map\" width=\"1280\" height=\"1159\" srcset=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_map.png 1280w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_map-300x272.png 300w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_map-1024x927.png 1024w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_map-768x695.png 768w\" sizes=\"(max-width: 1280px) 100vw, 1280px\" \/><\/a><\/p>\n<p>Someone had definitely noticed the problem and worked on this PCB before.\u00a0 Extensively.\u00a0 The sound chip has been reflowed or replaced, the sound RAM had been socketed (badly), most of the caps and the op-amp had been replaced (badly).\u00a0 I&#8217;ve colour boxed a few of the components for discussion, but this is what the PCB sounded like.\u00a0 You&#8217;ll have to excuse the audio quality, my phone picked up the screen whistling as well as the audio.<\/p>\n<!--[if lt IE 9]><script>document.createElement('audio');<\/script><![endif]-->\n<audio class=\"wp-audio-shortcode\" id=\"audio-1496-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_bad.mp3?_=1\" \/><a href=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_bad.mp3\">https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_bad.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>After quite a bit of diagnosis I found two separate problems.\u00a0 Firstly some buzz was being introduced into the audio by a pair of 74LS273s which I&#8217;ve marked in purple.\u00a0 It was only slight unless placing my finger near either of the chips, the closer I got the worse the sound became.\u00a0 This one was actually a design flaw &#8211; someone forgot to actually hook up the clear pin on the 273s &#8211; as far as I can tell the tracks go nowhere.\u00a0 Won&#8217;t spend too much time on this part suffice to say that running a wire up to the other purple boxed 273 clear fixes this problem, it&#8217;s actually tied to the CPU reset circuit.\u00a0 Other pins to tap that from are closer, but that was the tidiest fix I could see.<\/p>\n<p>So on to the real problem &#8211; what was causing the corruption?\u00a0 The RAM was fine and the ROMs verified to match the set in MAME when combined.\u00a0 Well it took me a while to spot but it was pretty simple in terms of the fault.\u00a0 The RAM, ROM and sound chip (bottom left yellow + red box, plus the quad next to them) share an 8 bit data bus.\u00a0 On a standard data bus only one chip can be actively in output mode while multiple can be inputs.\u00a0 The ROMs are controlled by an \/OE signal (inverted Output Enable), which means that when \/OE is pulled low the chip will start to output.\u00a0 ROM 30 was fine, but 31 was stuck low.\u00a0 This means that any time something went to read the RAM or ROM 30 on the bus, it also got ROM 31 mingled in too.\u00a0 I&#8217;m actually surprised the game even sounded like it did.<\/p>\n<p>I traced the \/OE lines and eventually found they both connected to a PAL chip also boxed in red.\u00a0 This is a programmable logic chip and therefore custom, they really can be the death of a board if you can&#8217;t find a working one and dump it.\u00a0 Problem is, as far as I could tell the components surrounding the PAL looked OK, and being a unique PCB there was no dump.\u00a0 I compared to Daioh but it was too different to be of much use, I actually thought the game was irrepairable at this point.<\/p>\n<p>And while thinking about the problem, I had an idea.\u00a0 Proper control of ROM 31 was no longer possible, but logically the required behaviour was simple &#8211; ROM 31 needed to not output if the RAM or ROM 30 were.\u00a0 Flip that around a moment and ROM 31 could <em>always<\/em> output unless ROM 30 or the RAM wanted to.\u00a0 ROM 30 would be active when \/OE was low, and the RAM would be active if \/OE was low and \/WE was high.\u00a0 And so I came up with this:<\/p>\n<p><a href=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_schem.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1499\" src=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_schem.png\" alt=\"gundhara_fix_schem\" width=\"629\" height=\"200\" srcset=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_schem.png 629w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_schem-300x95.png 300w\" sizes=\"(max-width: 629px) 100vw, 629px\" \/><\/a>Using two chips, the above behaviour can be achieved.\u00a0 Firstly the RAM, we want to perform an AND function (\/OE low AND \/WE high), but AND operations require two signals to be the same.\u00a0 The first thing we do then is to put \/OE through a 74LS04 which is an inverter.\u00a0 The two signals then go to one of the gates in a 74LS00 quad NAND gate.\u00a0 When \/OE on the RAM is low and \/WE is high, LS04\/LS00 combination will output a low signal.\u00a0 The remaining step is that if the RAM is outputting OR ROM 30 is, ROM 31 must have \/OE high, shutting it off.\u00a0 We take the combined RAM low signal and ROM 31 \/OE and pass those through another of the NAND gates.\u00a0 The end result is that if either the RAM is active or ROM 30 is active (and therefore low signals), the second NAND gate will output high, but if both are high signals it will output low.\u00a0 Connect that up to ROM 31 \/OE and we have a ROM which automatically outputs when neither of the other chips try to.\u00a0 Seeing the datasheets helps to understand this:<\/p>\n<p><a href=\"http:\/\/www.ti.com\/lit\/ds\/symlink\/sn74ls00.pdf\">Texas Instruments 74LS00<\/a><\/p>\n<p><a href=\"http:\/\/www.ti.com\/lit\/ds\/symlink\/sn74ls04.pdf\">Texas Instruments 74LS04<\/a><\/p>\n<p>So I knocked up an extremely Heath Robinson looking prototype fix, and burned a replacement ROM 31 since I didn&#8217;t want to damage the original while bending the leg upwards to disconnecting it from the faulty PAL output.<\/p>\n<p><a href=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_proto.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1498\" src=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_proto.jpg\" alt=\"gundhara_fix_proto\" width=\"800\" height=\"629\" srcset=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_proto.jpg 800w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_proto-300x236.jpg 300w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_proto-768x604.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>And then I powered it on not really knowing what to expect, and &#8230; it worked.\u00a0 I haven&#8217;t played through the whole game or checked every possible combination of sounds, but the things which were obviously completely wrong actually sounded OK.\u00a0 Here&#8217;s how it sounds now.\u00a0 Again apologies for audio, got the volume wrong and the mic started to auto adjust during the recording, there aren&#8217;t volume drops in reality.<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-1496-2\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_good.mp3?_=2\" \/><a href=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_good.mp3\">https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_good.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>Feeling pretty smug with myself, the only thing left to do was pull the contraption off and make tidy permanent repairs.\u00a0 I managed to get the required chip count down to 1 additional chip by using an unused inverter on the 74HC04 boxed in yellow.\u00a0 Quite often if you hunt around on PCBs you can find unused sections in dual\/quad chips.\u00a0 The rest has to be done with piggybacking and some kynar patch wire, and to make things tidier I found some unused jumpers on the board and turned those into through hole links rather than soldering to the socketed chips.\u00a0 The finished repairs look something like this:<\/p>\n<p><a href=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_done.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1509\" src=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_done.jpg\" alt=\"gundhara_fix_done\" width=\"640\" height=\"874\" srcset=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_done.jpg 640w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_done-220x300.jpg 220w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Usually when I fix games it&#8217;s direct repairs to faults, this is the first time I&#8217;ve actually had to work around a component and had a happy end result.\u00a0 Of course not everything went to plan, after putting the final fix on and despite only a few weeks ago telling someone off for putting a ROM in backwards and frying it &#8211; that&#8217;s exactly what I did, and I ended up having to make a replacement ROM 31 anyway.<\/p>\n<p><a href=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_final.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1510\" src=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_final.jpg\" alt=\"gundhara_fix_final\" width=\"800\" height=\"710\" srcset=\"https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_final.jpg 800w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_final-300x266.jpg 300w, https:\/\/blog.system11.org\/wp-content\/uploads\/2015\/04\/gundhara_fix_final-768x682.jpg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I picked a Gundhara PCB recently on the forum, it was advertised as a bootleg but it strongly resembled the strange Daioh I got recently and obviously came from the same factory.\u00a0 I think the most likely explanation for these boards is that the factory actually making Allumer boards started making a few side projects [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":50,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,13],"tags":[],"class_list":["post-1496","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arcade","category-tech"],"_links":{"self":[{"href":"https:\/\/blog.system11.org\/index.php?rest_route=\/wp\/v2\/posts\/1496"}],"collection":[{"href":"https:\/\/blog.system11.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.system11.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.system11.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.system11.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1496"}],"version-history":[{"count":16,"href":"https:\/\/blog.system11.org\/index.php?rest_route=\/wp\/v2\/posts\/1496\/revisions"}],"predecessor-version":[{"id":2272,"href":"https:\/\/blog.system11.org\/index.php?rest_route=\/wp\/v2\/posts\/1496\/revisions\/2272"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.system11.org\/index.php?rest_route=\/wp\/v2\/media\/50"}],"wp:attachment":[{"href":"https:\/\/blog.system11.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.system11.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.system11.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}