<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Gameboy Genius</title>
	<atom:link href="http://blog.gg8.se/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://blog.gg8.se/wordpress</link>
	<description>Explore, modify, create (This is the blog of Gameboy musician nitro2k01)</description>
	<pubDate>Mon, 28 Oct 2024 11:46:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>nitro2k01&#8217;s SGB Enabler for EZ Flash Jr</title>
		<link>https://blog.gg8.se/wordpress/2021/08/19/nitro2k01s-sgb-enabler-for-ez-flash-jr/</link>
		<comments>https://blog.gg8.se/wordpress/2021/08/19/nitro2k01s-sgb-enabler-for-ez-flash-jr/#comments</comments>
		<pubDate>Thu, 19 Aug 2021 01:44:32 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://blog.gg8.se/wordpress/?p=469</guid>
		<description><![CDATA[EZ Flash Jr is an SD card based flash cartridge for the Gameboy and Gameboy Color. While economical, there&#8217;s one feature that has been missing from it, namely good support for SGB (Super Gameboy). You can sometimes get it to work by hitting the reset button at exactly the right time, but even then any [...]]]></description>
			<content:encoded><![CDATA[<p>EZ Flash Jr is an SD card based flash cartridge for the Gameboy and Gameboy Color. While economical, there&#8217;s one feature that has been missing from it, namely good support for SGB (Super Gameboy). You can sometimes get it to work by hitting the reset button at exactly the right time, but even then any SGB enabled game would lack any SGB enhancements, like custom borders. The SGB Enabler is a modified version of EZ Flash Jr Kernel 1.04e which mostly solves these problems. </p>
<p>This is a beta version - feedback appreciated. Especially from people using a NTSC SNES or a SGB2.</p>
<h2>What was the problem and how does the SGB Enabler work?</h2>
<p>The SGB contains a full Gameboy CPU and the SNES is used to show the graphics and sound from the Gameboy. But before the SNES allows an image to be shown, it needs a message from the Gameboy to validate the cartridge. Unfortunately, EZ Flash Jr holds the CPU in reset (basically locks it up) while it&#8217;s loading its own firmware. Because of this, the timing is thrown off. The SNES never gets the message and only shows a black screen forever.</p>
<p>But the Gameboy CPU is still running in the background. The SGB Enabler sends the same commands as the Gameboy boot ROM would normally send, and the SNES allows an an image to be shown.</p>
<h2>How do you use the SGB Enabler?</h2>
<p>Simply copy the included ezgb.dat file to the root of the SD card, overwriting the existing file. Then start the Super Gameboy. (download link at the bottom of the page.) You do not need to touch the reset button on either the cartridge or SNES. It just works.</p>
<h2>Does the SGB Enabler restore all SGB functions?</h2>
<p>Yes, it enables the game to use colorization and border graphics, and even special sound effects in the few games that use those. And Space Invaders 94&#8217;s SNES arcade mode works as well.</p>
<h2>Is the SGB Enabler safe to use?</h2>
<p>Yes. The SGB Enabler only modifies the kernel (menu), and doesn&#8217;t touch the firmware (FPGA). Therefore, you can simply restore it to its original state by copying the original ezgb.dat file from EZ Flash Team onto the SD card, and there&#8217;s no risk of bricking. You do not need to upgrade to FW5 (which Team EZ Flash removed). It&#8217;s recommended to use FW4.</p>
<h2>Can I still use the SGB Enabler on a DMG/GBC?</h2>
<p>Yes, the only downside is that the boot time is longer because it always tries to send the commands to wake up the SGB as explained above. I will try to figure out a way to fix this later, but this is just an early beta version to get feedback from users. If this is a problem, simply replace ezgb.dat with the original file from EZ Flash. (Detecting the hardware is not as straightforward as it seems because the EZ Flash Jr has an internal boot ROM that erases the initial registers that programmers normally use to detect which type of hardware the game is running on.)</p>
<h2>Does the SGB Enabler work on both PAL and NTSC Super Gameboys?</h2>
<p>I only have a PAL SNES, but I&#8217;ve region modded it so I can select PAL or NTSC. In my testing, I&#8217;ve made sure the SGB Enabler works in both PAL and NTSC mode, but feedback from someone who has a real NTSC SGB would be appreciated.</p>
<h2>The SNES reset button doesn&#8217;t work!</h2>
<p>Please use the reset button on the cartridge, or power cycle the SNES to restart.</p>
<h2>Download</h2>
<p><a href='https://blog.gg8.se/wordpress/wp-content/uploads/kernel104-sgbenabler.zip'>Download kernel104-sgbenabler.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2021/08/19/nitro2k01s-sgb-enabler-for-ez-flash-jr/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LittleFM 0.5.2 released</title>
		<link>https://blog.gg8.se/wordpress/2016/11/21/littlefm-052-released/</link>
		<comments>https://blog.gg8.se/wordpress/2016/11/21/littlefm-052-released/#comments</comments>
		<pubDate>Mon, 21 Nov 2016 03:54:24 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=467</guid>
		<description><![CDATA[LittleFM 0.5.2 is a bug fix release which fixes a bug where some files would incorrectly fail to load with the message “no blockjump”.
Get it here.
]]></description>
			<content:encoded><![CDATA[<p>LittleFM 0.5.2 is a bug fix release which fixes a bug where some files would incorrectly fail to load with the message “no blockjump”.</p>
<p><a href="//blog.gg8.se/wordpress/gameboy-resources/littlefm-an-alternative-file-manager-for-lsdj/">Get it here.</a></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2016/11/21/littlefm-052-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pushpin modded for Arduinoboy/nanoloop MIDI</title>
		<link>https://blog.gg8.se/wordpress/2016/11/14/pushpin-modded-for-arduinoboynanoloop-midi/</link>
		<comments>https://blog.gg8.se/wordpress/2016/11/14/pushpin-modded-for-arduinoboynanoloop-midi/#comments</comments>
		<pubDate>Mon, 14 Nov 2016 10:39:22 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=464</guid>
		<description><![CDATA[Get it here.
Pushpin modded for Arduinoboy/nanoloop MIDI
===========================================
This is a version of Pushpin which has been modded to use the regular link port
protocol instead of Pushpin's original hack of reading MIDI UART directly on a
digital IO pin on the GBC link port. This version works with Arduinoboy in mGB
mode or the nanoloop MIDI adapter in MIDI [...]]]></description>
			<content:encoded><![CDATA[<p>Get it <a href="//gbdev.gg8.se/files/musictools/MIDI-related/Pushpin-aboy/">here</a>.</p>
<p><code>Pushpin modded for Arduinoboy/nanoloop MIDI<br />
===========================================<br />
This is a version of Pushpin which has been modded to use the regular link port<br />
protocol instead of Pushpin's original hack of reading MIDI UART directly on a<br />
digital IO pin on the GBC link port. This version works with Arduinoboy in mGB<br />
mode or the nanoloop MIDI adapter in MIDI mode. This version no longer works<br />
with Pushpin's original MIDI UART mode.</p>
<p>It has been modified to be able to run on non-GBC Gameboys, since Pushpin hangs<br />
when it tries to switch to GBC double speed mode. The display is slightly<br />
glitched on monochrome Gameboy but otherwise it should work fine.</p>
<p>This version works just like the original. Press up/down to select MIDI channel<br />
assignment, then press start to begin receiving MIDI. Refer to Pushpin's manual<br />
for advanced usage and MIDI CC assignment.</p>
<p>Since I don't have a GBDK environment set up, it was easier for me to do this<br />
by modifying the ROM using BGB. For this reason there's currently no source<br />
code. I should probably make a proper release source code at some point. Such<br />
a version could offer a mode selection at boot time to allow either MIDI UART<br />
mode or SPI mode.</p>
<p>nitro2k01 - 2016-11-14<br />
<a href="//blog.gg8.se/wordpress/">http://blog.gg8.se/wordpress/</a></p>
<p>Pushpin documentation and source code:<br />
<a href="https://github.com/bwhitman/pushpin">https://github.com/bwhitman/pushpin</a></code></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2016/11/14/pushpin-modded-for-arduinoboynanoloop-midi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>eBay error: &#8220;The seller has disallowed combined payments and shipping discounts.&#8221;</title>
		<link>https://blog.gg8.se/wordpress/2016/07/14/ebay-error-the-seller-has-disallowed-combined-payments-and-shipping-discounts/</link>
		<comments>https://blog.gg8.se/wordpress/2016/07/14/ebay-error-the-seller-has-disallowed-combined-payments-and-shipping-discounts/#comments</comments>
		<pubDate>Thu, 14 Jul 2016 10:53:59 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=458</guid>
		<description><![CDATA[I recently scored a few auctions from an eBay seller who promised combined shipping. Upon requesting a new quote to reflect the combined shipping fee, I got the following error:
&#8220;The seller has disallowed combined payments and postage discounts. Please proceed to checkout to complete your purchase.&#8221; (Error code 80016)
When researching it, some people pointed out [...]]]></description>
			<content:encoded><![CDATA[<p>I recently scored a few auctions from an eBay seller who promised combined shipping. Upon requesting a new quote to reflect the combined shipping fee, I got the following error:</p>
<p><em>&#8220;The seller has disallowed combined payments and postage discounts. Please proceed to checkout to complete your purchase.&#8221; (Error code 80016)</em></p>
<p>When researching it, some people pointed out that it&#8217;s up to the seller whether they want to allow combined shipping. This was irrelevant in my case since the seller clearly stated in the description that they support combined shipping. Someone even suggested that a seller could lie, and that you would need to contact the seller in advance to get a written confirmation before bidding. However, I&#8217;m skeptical that it would be permitted by eBay&#8217;s rules to lie about something like that in the item description. Other results were not helpful either,</p>
<p>At last I figured out the probably cause the issue. For whatever reason, I was logged in to <strong>ebay.co.uk</strong>. When I instead tried logging in at <strong>ebay.com</strong> I could request a new quote. In my case, they got back within minutes of receiving the request, with a new price.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2016/07/14/ebay-error-the-seller-has-disallowed-combined-payments-and-shipping-discounts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>You learn something new everyday</title>
		<link>https://blog.gg8.se/wordpress/2015/04/08/you-learn-something-new-everyday/</link>
		<comments>https://blog.gg8.se/wordpress/2015/04/08/you-learn-something-new-everyday/#comments</comments>
		<pubDate>Wed, 08 Apr 2015 02:49:02 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=457</guid>
		<description><![CDATA[The other day, for whatever reason, I wanted to know how fast the Nintendo logo scrolls down the screen on a DMG. The boot ROM has been dumped since forever and this is a simple matter to investigate in BGB. In BGB select Gameboy as the system type in the system tab, check &#8220;bootroms enabled&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, for whatever reason, I wanted to know how fast the Nintendo logo scrolls down the screen on a DMG. The boot ROM has been dumped since forever and this is a simple matter to investigate in BGB. In BGB select Gameboy as the system type in the system tab, check &#8220;bootroms enabled&#8221;, and click ok. Then reset the CPU. Now, assuming the boot ROM is in the specified location, you can debug it. </p>
<p>I added a breakpoint (debug, breakpoints) with condition (FF44)=90. This breakpoint triggers on every VBlank, ie when register FF44, LY, the LCD line counter, reaches value $90. This is a more certain way of triggering on VBlank than the interrupt vector for cases when the regular interrupt may not be triggered in time due to interrupts being disabled, or (as in this case) when the code doesn&#8217;t use interrupts at all.</p>
<p>By pressing F9 repeatedly and seeing how much the logo would move every time, it seemed that the logo moved 1 pixel every 2 frames. Or not. It actually alternates between waiting 2 and 3 frames between every progression. The code responsible for this is the following, at position $0060 in the boot ROM:</p>
<pre>  00:0060 ld   e,$02
  00:0062 ld   c,$0C
  00:0064 ldh  a,[$FF44]
  00:0066 cp   a,$90
  00:0068 jr   nz,$0064
  00:006A dec  c
  00:006B jr   nz,$0064
  00:006D dec  e
  00:006E jr   nz,$0062
</pre>
<p>This is the wait for VBlank routine. We have three layers of loops here. Outermost, we have a countdown using the E register, to wait for two frames. The innermost loop (0064-0068) wait until LY=$90, which just like with the breakpoint above signifies the start of the VBlank period. Both straightforward mechanisms.</p>
<p>The interesting part is the dec c/jr nz,$0064 mechanism. On the surface, it seems to be added to prevent the outer loop from exiting too early. On the second iteration of the outer loop, LY would still be $90, and the loop would immediately fall through instead of waiting for another frame. The C loop iterates 12 ($C) times, but interestingly jumps through the inner loop as well. This means that LY may or may not stop being $90 before the middle loop ends, depending on the exact time that the loop is entered. In other words, sometimes the code gets stuck in the inner loop for an extra frame when C=1, and then the last dec C is executed, and the outer loop exits.</p>
<p>The animation jitters between 2 and 3 frames consumed between each pixel move, so the animation takes 25% longer time than a naïve reading of the code would suggest. (5 frames per 2 pixels vs 4 frames per 2 pixels.) Now the question is if this was intentional to make the animation go slightly slower, or just a bug. If it was just a bug, it would have been easy to fix by making the dec C loop jump back to 006A (the dec C instruction) and setting a higher initial value for C. </p>
<p>Bug or intentional slowdown of the animation? Would be interesting to know.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2015/04/08/you-learn-something-new-everyday/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gradual Decline - A quick Gameboy glitch ROM</title>
		<link>https://blog.gg8.se/wordpress/2014/12/17/gradual-decline-a-quick-gameboy-glitch-rom/</link>
		<comments>https://blog.gg8.se/wordpress/2014/12/17/gradual-decline-a-quick-gameboy-glitch-rom/#comments</comments>
		<pubDate>Wed, 17 Dec 2014 00:38:48 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=456</guid>
		<description><![CDATA[Gradual Decline - A quick Gameboy glitch ROM by nitro2k01
=========================================================
This ROM explores the idea of what would happen if you wrote random data to
random IO registers and random positions in video RAM. If you like audiovisual
glitches, this is for you. The ROM generates randomized graphics, and bleeps,
bloops and static. Sometimes it will even produce tones [...]]]></description>
			<content:encoded><![CDATA[<p><code>Gradual Decline - A quick Gameboy glitch ROM by nitro2k01<br />
=========================================================</p>
<p>This ROM explores the idea of what would happen if you wrote random data to<br />
random IO registers and random positions in video RAM. If you like audiovisual<br />
glitches, this is for you. The ROM generates randomized graphics, and bleeps,<br />
bloops and static. Sometimes it will even produce tones that are vaguely<br />
melodic, even if dissonant.</p>
<p>How to use<br />
==========<br />
Burn to a flash cartridge and run. It's a unique experience each time you run<br />
it. Even though this will not perceivably change the output of the ROM, you<br />
may press buttons to seed external entropy into the random number generator.</p>
<p>https://blog.gg8.se</p>
<p>2014-12-17</code></p>
<p><a href="//gbdev.gg8.se/files/musictools/nitro2k01/gradual_decline.zip">Download</a></p>
<p>Video:</p>
<p><iframe width="560" height="315" src="//www.youtube.com/embed/YfE7S1UNky8" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2014/12/17/gradual-decline-a-quick-gameboy-glitch-rom/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dumping the boot ROM of the Gameboy clone Game Fighter</title>
		<link>https://blog.gg8.se/wordpress/2014/12/09/dumping-the-boot-rom-of-the-gameboy-clone-game-fighter/</link>
		<comments>https://blog.gg8.se/wordpress/2014/12/09/dumping-the-boot-rom-of-the-gameboy-clone-game-fighter/#comments</comments>
		<pubDate>Tue, 09 Dec 2014 08:29:19 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Game Fighter]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=455</guid>
		<description><![CDATA[
Game Fighter posts:

Teardown
Dumping the boot ROM

Inside every Gameboy there&#8217;s a small boot ROM, which scrolls the Nintendo logo down from the top of the screen, and plays the iconic po-ling sound. This 256 byte boot ROM also checks that said Nintendo logo is present in the ROM chip of the cartridge, and validates the checksum [...]]]></description>
			<content:encoded><![CDATA[<p><img align="right" src="/images/nintendologo.bmp" class="imagebox"></p>
<p><strong>Game Fighter posts:</strong></p>
<ul>
<li><a href="//blog.gg8.se/wordpress/2012/11/11/gameboy-clone-game-fighter-teardown/">Teardown</a></li>
<li><strong>Dumping the boot ROM</strong></li>
</ul>
<p>Inside every Gameboy there&#8217;s a small boot ROM, which scrolls the Nintendo logo down from the top of the screen, and plays the iconic po-ling sound. This 256 byte boot ROM also checks that said Nintendo logo is present in the ROM chip of the cartridge, and validates the checksum of the header. Up until the 1992 legal case <a href="https://en.wikipedia.org/wiki/Sega_v._Accolade">Sega v. Accolade</a> it was believed that this check gave Nintendo the legal authority to control which games were allowed to run on the console, as the &#8220;Nintendo&#8221; logo was copyrighted by Nintendo, but the the ruling gave a strong precedent that using this small piece of copyrighted data to achieve interoperability was allowable.</p>
<p>The boot ROM locks itself out from being read before leaving control of the CPU to the program running on the cartridge, maybe more due to necessity than preventing read-out of the ROM, since the bottom memory area near the CPU entry point also covers the interrupt vectors, which the game needs access to. But as a result, this boot ROM remained an elusive secret, which was assumed would never see the light of day.</p>
<p>It was not until 2003 that <a href="https://dot-matrix-game.blogspot.se/2014/01/boot-roms.html">Neviksti</a> extracted this ROM from a DMG, decapping the CPU chip, looking at the CPU die with a scanning electron microscope and painstakingly reading out the bits visually, all 2048 (8*256) of them. </p>
<p>In 2009, <a href="//www.its.caltech.edu/~costis/sgb_hack/">costis extracted the SGB boot ROM</a> by externally overclocking the CPU right at the time when the boot ROM shuts itself out, which causes the write to the lock-out register to be ignored, and then it could be copied to the outside world. The GBC boot ROM was also dumped this way by costis soon after. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/15979363801" title="Nintendo Gameboy wire clock glitching by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm9.staticflickr.com/8680/15979363801_a202e3a758.jpg" width="500" height="375" alt="Nintendo Gameboy wire clock glitching" class="imagebox"></a></center></p>
<p>Just this year (2014) <a href="//web.archive.org/web/20151014210143/http://www.bennvenn.com/MGB.htm">BennVenn</a> made the process child&#8217;s play with a silly but effective method. All you need to perform the attack is a piece of wire! You solder one end of the wire to one of the crystal oscillation circuit, and scrape the other end of the wire against any grounded surface in the Gameboy, such as copper shielding plate. This causes the CPU to glitch to jump to a random location. If you&#8217;re lucky, this allows you take control of the code execution and, again, dump the boot ROM.</p>
<p><center><a href="//www.flickr.com/photos/gameboygenius/6936647499/" title="Game Fighter, Gameboy clone by nitro2k01 (Gameboy Genius), on Flickr"><img src="//farm8.staticflickr.com/7064/6936647499_6e9b76bb87.jpg" width="500" height="375" alt="Game Fighter, Gameboy clone" class="imagebox"></a></center></p>
<p>But, what about pirate Gameboy clones? For example this Game Fighter, which is a horizontal Gameboy clone. Also see my detailed <a href="//blog.gg8.se/wordpress/2012/11/11/gameboy-clone-game-fighter-teardown/">teardown and analysis</a> of this beauty. It also has a boot ROM, though slightly different in function. The Game Fighter, instead of scrolling the logo down the screen, starts the game immediately. I also knew from before that it checked that the logo was correct, but not the game&#8217;s ROM header checksum.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/15795346119" title="Nintendo Gameboy clone Game Fighter wire clock glitching by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7582/15795346119_bc7a41b074.jpg" width="500" height="375" alt="Nintendo Gameboy clone Game Fighter wire clock glitching" class="imagebox"></a></center></p>
<p>So I wrote a small program, did the glitching procedure and voila! I had the boot ROM. You can download it here: </p>
<p><a href="//gbdev.gg8.se/files/roms/bootroms/gamefighter_boot.bin">Game Fighter boot ROM download</a></p>
<p>If you really wanted, you could use this ROM with <a href="//bgb.bircd.org/">BGB</a> and for example single step through it in BGB&#8217;s debugger. To do this, go into BGB&#8217;s settings, go to the system tab, then check the bootroms enabled option, and point the DMG boot ROM field to the ROM file. </p>
<p>Since the Game Fighter boots immediately, unlike an original &#8216;boy, I made the ROM have an invalid logo in its header so it would lock up and give me time to try to glitch the execution. The procedure was the same as on an original Gameboy: Find the one the pins of the crystal driver that is the input, solder a wire to it, (pictured above) and brush the other side to a part of the board that is ground. For the Game Fighter, I found that I had better luck getting it to work if I first shorted it to ground (for example the negative battery terminal) on power on, then brushing it against the surface as I let it go.</p>
<p>I will post the program I used for dumping the boot ROM later, along with a more detailed description of how it works.</p>
<p>Here&#8217;s the boot ROM disassembled, which holds an interesting secret! (<a href="//gbdev.gg8.se/wiki/articles/Gameboy_Bootstrap_ROM#Contents_of_the_ROM">Disassembly of the original DMG boot ROM</a> for comparison.)</p>
<pre style="background-color:white;">        ld   sp,$FFFE           ;  0000  Set up the stack pointer.

        ; Clear VRAM.
        xor  a                  ;  0003
        ld   hl,$9FFF           ;  0004
Addr_0007:
        ldd  [hl],a             ;  0007
        bit  7,h                ;  0008
        jr   nz,Addr_0007       ;  000A

        ; Set up sound.
        ld   hl,$FF26           ;  000C
        ld   c,$11              ;  000F
        ld   a,$80              ;  0011
        ldd  [hl],a             ;  0013  [$FF26] = $80 Turn on sound

        ld   [$ff00+c],a        ;  0014  [$FF11] = $80 Channel 1 wave duty
        inc  c                  ;  0015
        ld   a,$F3              ;  0016
        ld   [$ff00+c],a        ;  0018  [$FF12] = $F3 Channel 1 envelope
        ldd  [hl],a             ;  0019  [$FF25] = $F3 Channel routing
        inc  c                  ;  001A
        ld   a,$C1              ;  001B
        ld   [$ff00+c],a        ;  001D  [$FF13] = $C1 Channel 1 low frequency byte
        ld   a,$77              ;  001E
        ld   [hl],a             ;  0020  [$FF24] = $77 Master volume

        ; Set up graphics.
        ld   a,$FC              ;  0021
        ldh  [$FF47],a          ;  0023  [$FF47] = $FC BG palette
        ld   a,$91              ;  0025
        ldh  [$FF40],a          ;  0027  [$FF40] = $91 Turn on LCD

        ; Compare the second half of the logo in the header against
        ; the second half of the Nintendo logo stored in the boot ROM.
        ld   de,Addr_0043       ;  0029
        call Addr_0073          ;  002C
        cp   a,$34              ;  002F  Will return $34 if successful.
        jr   nz,Addr_0036       ;  0031  If not, jump to a second compare operation.
        jp   Addr_00FC          ;  0033

        ; Compare the second half of the logo in the header against
        ; the second half of the mystery logo stored in the boot ROM.
Addr_0036:
        ld   de,Addr_005B       ;  0036
        call Addr_0073          ;  0039
        cp   a,$34              ;  003C  Will return $34 if successful.
Addr_003E:
        jr   nz,Addr_003E       ;  003E  If not, get stuck in an endless loop.
        jp   Addr_00FC          ;  0040

        ; Second half of the Nintendo logo, $18 bytes
Addr_0043:
        db   $DC, $CC, $6E, $E6, $DD, $DD, $D9, $99
        db   $BB, $BB, $67, $63, $6E, $0E, $EC, $CC
        db   $DD, $DC, $99, $9F, $BB, $B9, $33, $3E

        ; Second half of mysterious RIS or KIS logo, $18 bytes
Addr_005B:
        db   $00, $00, $00, $00, $76, $66, $C6, $31
        db   $00, $19, $66, $FF, $01, $88, $38, $C7
        db   $C6, $C8, $00, $00, $00, $00, $00, $00

        ; Subroutine: Compare the cartridge header&#8217;s logo against
        ; a given memory location
Addr_0073:
        ld   hl,$011C           ;  0073  Start comparing halfway into the logo
Addr_0076:
        ld   a,[de]             ;  0076
        inc  de                 ;  0077
        cp   [hl]               ;  0078
        jr   nz,Addr_0082       ;  0079
        inc  hl                 ;  007B
        ld   a,l                ;  007C
        cp   a,$34              ;  007D  $xx34 = The first byte after the header logo
        jr   nz,Addr_0076       ;  007F
        ret                     ;  0081
Addr_0082:
        ld   a,$85              ;  0082  Compare failed!
        ret                     ;  0084

        ; $77 filler bytes
Addr_0085:
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
        db   $ff, $ff, $ff, $ff, $ff, $ff, $ff

        ; Disable the boot ROM and hand over control to the game cartridge.
Addr_00FC:
        ld   a,$01              ;  00FC Write to the ROM disable register
        ldh  [$FF50],a          ;  00FE
</pre>
<p>It&#8217;s mostly like a stripped down version of the original Nintendo bootstrap. It turns on the sound circuit even though it does not play any sound. Perhaps this is for compatibility with some game that expects it to be turned on on start-up. The boot ROM also clears the video RAM, sets the background palette and finally turns on the LCD circuit.</p>
<p>The boot ROM interestingly enough only stores a reference copy of the second half of the Nintendo logo, even though there&#8217;s plenty of unused space. So the first half of the logo could be incorrect and the program would still start. Incidentally, Gameboy Color has a similar bug where only the <em>first</em> half of the logo is checked, which has prompted some pirate publishers to get creative and make logo combinations like HotKid, Niutoude and Yiutoudz using the bottom half of the logo that they can control freely. Read more on <a href="http://fuji.drillspirits.net/?post=87">Neofuji</a>. It wouldn&#8217;t matter in this case anyway, as the logo isn&#8217;t shown on the screen, only checked.</p>
<p><img align="right" src="/images/nintendologo-wtf.bmp" class="imagebox"><br />
But what&#8217;s weirder is what the boot ROM does if the Nintendo logo check fails. It then does a second check, against an alternative logo that perhaps says KIS or RIS, simulated to the right for illustrative purposes. Again, the boot ROM only stores half the logo in this case as well, so there&#8217;s no way of getting the full logo without finding a matching game that contains the full logo in it header.</p>
<p>It may be checking specifically for a certain game by the same publisher. But why would the game have an alternative logo, when this logo is not shown on the Game Fighter, and would hang a genuine Gameboy? The only logical conclusion I can come to is that the game that this check was made for does a logo swap. Some examples of logo swaps (apart form the half logo hacks) can be found in the Neofuji post linked above. A logo swap works by switching in memory containing your own logo when the boot ROM copies the logo the into VRAM, and then switching back to the real logo when the check is done. This would normally fail on the Game Fighter, since it checks the logo much earlier than a real Gameboy. </p>
<p>But in the end, we may never know. If you have any clue which pirate publisher KIS/RIS/??? is please let me know!</p>
<p><em>Thanks to BennVenn for coming up with this method of accessing the boot ROM!</em></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2014/12/09/dumping-the-boot-rom-of-the-gameboy-clone-game-fighter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Where the donk does mGB store its channel 3 waveforms?</title>
		<link>https://blog.gg8.se/wordpress/2014/06/30/where-the-donk-does-mgb-store-its-channel-3-waveforms/</link>
		<comments>https://blog.gg8.se/wordpress/2014/06/30/where-the-donk-does-mgb-store-its-channel-3-waveforms/#comments</comments>
		<pubDate>Mon, 30 Jun 2014 06:50:28 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=453</guid>
		<description><![CDATA[
mGB, trash80&#8217;s Gameboy MIDI synth for use with Arduinoboy has support for selecting various waveforms for use with channel 3. If you look at the data loaded into wave RAM and search for it in the ROM you find nothing. Is the data generated algorithmically, perhaps? Let&#8217;s look into it.
I may actually have the mGB [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.flickr.com/photos/gameboygenius/14351082810/"><img align="right" src="//farm4.staticflickr.com/3865/14351082810_2cb6c4acc0_m.jpg"></a><br />
mGB, trash80&#8217;s Gameboy MIDI synth for use with <a href="https://code.google.com/p/arduinoboy/">Arduinoboy</a> has support for selecting various waveforms for use with channel 3. If you <a href="//chipmusic.org/forums/post/212063/#p212063">look at the data loaded into wave RAM and search for it in the ROM</a> you find nothing. Is the data generated algorithmically, perhaps? Let&#8217;s look into it.</p>
<p>I may actually have the mGB source code lying around somewhere, but this is easy to figure out using BGB. First add an access breakpoint (debug, access breakpoints) to <strong>FF30</strong> (the lowest address in the channel 3 wave buffer) and hit run. If mGB was already started, change the waveform or reset the CPU to make the write happen again.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14353539647/"><img src="//farm4.staticflickr.com/3849/14353539647_2fd4e7308d_o.png"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14560121363/"><img src="//farm6.staticflickr.com/5516/14560121363_138e7e9e08_o.png"></a></center></p>
<p>If you read the code, it seems like the waveform index is loaded from somewhere, and is then added to <strong>C14D</strong>, an address in RAM. If you go to that address in the data panel in the bottom of the window you can confirm that there are indeed waveforms there. Let&#8217;s place a write breakpoint to the address in RAM, maybe disable the old one, and rinse and repeat.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14516959286/"><img src="//farm4.staticflickr.com/3850/14516959286_f191f22241_o.png"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14536686821/"><img src="//farm6.staticflickr.com/5573/14536686821_07dd1cc122_o.png"></a></center></p>
<p>The code that creates the waveforms in RAM consists of a long row of instructions on the form</p>
<pre>ld  de,C14D
ld  a,01
ld  (de),a
ld  de,C14E
ld  a,23
ld  (de),a</pre>
<p>This is likely the GBDK C compiler&#8217;s output from something like&#8230;</p>
<pre>waveforms[0]=0&#215;01;
waveforms[1]=0&#215;23;</pre>
<p>&#8230;and so on. Or this may just be an example of the compiler doing something really stupid when you define a const array. The performance and size of such code compared to an optimized alternative is not exactly flattering, but that doesn&#8217;t matter much in this case. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14353707367/"><img src="//farm4.staticflickr.com/3879/14353707367_cbaf8a811e.jpg"></a></center></p>
<p>In other words, the actual data starts at address <strong>3C9C</strong> and is spaced out so every 6th byte is waveform data. Above, the bytes for 0th waveform (starting at the hex editor&#8217;s cursor) are marked in a light, not-quite-cyan, blue. Click for a bigger image.</p>
<p>Can we do it better? Let&#8217;s try to patch the ROM to store the data in a linear fashion and then copy it into the position in RAM where it is later used. Or even better – as the wave data is not likely to be modified after the being copied into RAM – make the program read them directly from ROM instead of from RAM.</p>
<p>First start mGB and grab the wave data from RAM, for use later. First a back of the envelope calculation: there are 16 waveforms, each of size 16 bytes, leading to a total of 256 bytes. When mGB is at the main screen, select file, memory dump in the debugger. Choose a place to save the dumped file. We know from above that the data is stored starting at <strong>C14D</strong>, so enter that as the starting address. As size, enter <strong>100</strong>, hex for 256.</p>
<p>Then go to <strong>3C98</strong> in the disassembly, which is the first instruction of the row of instructions that are used to fill up the wave data in RAM. The similar instructions before that one are used to initialize other memory. Don&#8217;t touch those. </p>
<p>We know form above that there are 256 bytes of wave data. We also know that it takes 6 bytes worth of instructions to copy one byte to memory. This means we can now calculate the end of this code area, or rather, the first address containing other code as <strong>3C98+(100*6)=4298</strong> (all hex, mind you!) You can now go to this address in the disassembly to confirm it&#8217;s correct. Press ctrl+G and enter 4298. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14353814148/"><img src="//farm6.staticflickr.com/5566/14353814148_e9249a5497_o.png"></a></center></p>
<p>The group before that position reads</p>
<pre>ld  de,C24C
ld  a,03
ld  (de),a</pre>
<p><strong>C24C</strong> is 255 bytes after <strong>C14D</strong>, and the next byte being written to, <strong>C254</strong>, is non-consecutive. This means <strong>4298</strong> seems like the correct address to jump to.</p>
<p>Now go back to <strong>3C98</strong> and create a jump to <strong>4298</strong>. You can do this by simply placing the cursor at the correct place and starting to type <strong>jp 4298</strong>. When you type the first character, an assembler winow pops up to let you continue writing the instruction. Pressing enter or clicking ok will assemble the opcode. If all goes well you will now see it in the disassembly.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14537048231/"><img src="https://farm3.staticflickr.com/2906/14537048231_3ee96dd5e4_o.png"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14537067201/"><img src="https://farm3.staticflickr.com/2905/14537067201_ed58c6d019_o.png"></a></center></p>
<p>So, now to plan for where to put the 256 (100 hex) block of data. The area <strong>3C9B-4297</strong> is now &#8220;dead&#8221;, consisting of code that will never be executed. We could now place the data directly at <strong>3C9B</strong> and <strong>100</strong> (hex) bytes forward. Or we could make our lives easier when editing and put the data at something easy to remember <strong>4000</strong> and <strong>100</strong> (hex) bytes forward. Any area that fits within the now dead memory area is ok, which is true for <strong>4000-40FF</strong>. </p>
<p>Now press ctrl+G and go to 28B3, which is the place where the base address for the waveform lookup is loaded into the HL register. Start typing ld hl,4000 and press enter. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14560619803/"><img src="https://farm4.staticflickr.com/3911/14560619803_0c09c34536_o.png"></a></center></p>
<p>Time to save the file. Normally I would recommend to do file, fix checksums at this point, but since the file will be further edited, the checksum will change later anyway. So select file, save ROM as and save the file, preferably under a new name. Use whatever method your hex editor provides (or doesn&#8217;t provide) to overwrite <strong>100</strong> (hex) bytes from <strong>4000-40FF</strong>. In my trusty ol&#8217; xvi32, I had to first delete <strong>100</strong> bytes, then select file, insert and select the file previously saved containing the waveforms. </p>
<p>You can select an address to go to by pressing ctrl+G. You can select characters by selecting edit, select <n> chars.</p>
<p>A better hex editor may have a better method of overwriting an area with data form another file.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14537162781/"><img src="https://farm3.staticflickr.com/2929/14537162781_8d3b1481bb.jpg"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14354116437/"><img src="https://farm4.staticflickr.com/3896/14354116437_21b1067000.jpg"></a></center></p>
<p>Confirm that the newly inserted waveform data is located at <strong>4000</strong> and not anywhere else. Press ctrl+page down to go to the last address. Confirm that the file is the right size by checking that the last address is <strong>FFFF</strong> or 65535 (depending on whether you are on the hex or character side of the display.) Save.</p>
<p>Load in BGB and confirm that the ROM doesn&#8217;t crash. To get the right warm fuzzy feeling inside, select file, fix checksums and then file, save ROM as, again.</p>
<p>For your convenience, you can download the modified ROM <a href="//gbdev.gg8.se/files/musictools/MIDI-related/mGB/mGB_1_3_3-waveform-mod.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2014/06/30/where-the-donk-does-mgb-store-its-channel-3-waveforms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Furrtek&#8217;s Airaki: quick game review and ROM dump download</title>
		<link>https://blog.gg8.se/wordpress/2014/05/14/furrteks-airaki-quick-game-review-and-rom-dump-download/</link>
		<comments>https://blog.gg8.se/wordpress/2014/05/14/furrteks-airaki-quick-game-review-and-rom-dump-download/#comments</comments>
		<pubDate>Wed, 14 May 2014 18:07:11 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=451</guid>
		<description><![CDATA[

I&#8217;ve got mail! What&#8217;s inside? A cartridge of Furrtek&#8217;s second, and so far, latest game Airaki. The envelope (as well as the title field in the ROM header) is marked with the number 1, suggesting I&#8217;m receiving the first cartridge of this batch. The cartridge comes in a resealable &#8220;drug bag&#8221;, and there&#8217;s also an [...]]]></description>
			<content:encoded><![CDATA[<div style="background-image: url('/images/airaki/topkek.png')">
<center><a href="https://www.flickr.com/photos/gameboygenius/13991180910" title="Furrtek&#x27;s Airaki: envelope and contents by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5484/13991180910_9a55820c61.jpg" width="500" height="375" alt="Furrtek&#x27;s Airaki: envelope and contents" class="imagebox"></a></center></p>
<p>I&#8217;ve got mail! What&#8217;s inside? A cartridge of Furrtek&#8217;s second, and so far, latest game <a href="http://furrtek.free.fr/fse/?p=airakien">Airaki</a>. The envelope (as well as the title field in the ROM header) is marked with the number 1, suggesting I&#8217;m receiving the first cartridge of this batch. The cartridge comes in a resealable &#8220;drug bag&#8221;, and there&#8217;s also an instruction sheet explaining the game mechanics.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14154678006" title="Furrtek&#x27;s Airaki: front of the cartridge by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2933/14154678006_9cb284e6a1.jpg" width="500" height="375" alt="Furrtek&#x27;s Airaki: front of the cartridge"></a></center></p>
<p>The game comes in a generic &#8220;game&#8221; shell, a type often used by pirates. The cartridge has a label with our muscular furry hero holding his massive sword in an erect position. <em>*cough*</em><br />
<span id="more-451"></span><br />
<center><a href="https://www.flickr.com/photos/gameboygenius/13991139639" title="Furrtek&#x27;s Airaki: back of the cartridge by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7377/13991139639_34ef8e8fa8.jpg" width="500" height="375" alt="Furrtek&#x27;s Airaki: back of the cartridge"></a></center></p>
<p>Looking at the back of the cartridge, we find the Philips head screw holding the case together, and the PCB doesn&#8217;t take up the full internal area of the cartridge. (Why would it when it doesn&#8217;t need to. <img src='https://blog.gg8.se/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13991150509" title="Furrtek&#x27;s Airaki: back of the cartridge PCB by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7344/13991150509_90e7f30e99.jpg" width="500" height="375" alt="Furrtek&#x27;s Airaki: back of the cartridge PCB"></a></center></p>
<p>Looking closer at the back of the PCB, you can see hints of the clever trick used to fit a through-hole DIP chip into the cartridge. The legs have simply been trimmed off so the bottom surface of the board is flat, and the chip&#8217;s legs are soldered from the top.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13991175340" title="Furrtek&#x27;s Airaki: front of the cartridge PCB by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2897/13991175340_87c534b550.jpg" width="500" height="375" alt="Furrtek&#x27;s Airaki: front of the cartridge PCB"></a></center></p>
<p>Looking at the top side of the PCB, you can see the memory chip used in the cartridge, an <a href="http://www.atmel.com/Images/doc0006.pdf">AT28C256</a>, a 32 <a href="//en.wikipedia.org/wiki/Binary_prefix#IEC_prefixes">kibi</a>byte EEPROM chip which could be reprogrammed. The PCB helpfully provides an option for this. As seen to the left of the chip, there&#8217;s a solder blob. There are three solder pads. The middle one goes to the flash chip&#8217;s /WR (write enable) line, whereas the other two go to Vcc (+5V), and a mostly unused pin on the cartridge slot. The cartridge came with a solder blob between the /WR pin and Vcc, making the cartridge look like a normal ROM chip. You could also remove this blob and put a new blob between the middle pin and the lower pin, turning the cartridge into a 32 kiB flash cartridge, given a suitable flasher. I will add support for this combination into my Gameboy cartridge flasher/reader, <a href="//chipmusic.org/forums/topic/13110/introducing-altane-nitro2k01s-cartridge-flasher-project/">ALTANE</a> which will soon be released and is accepting <a href="//www.asmretro.com/altane/">preorders</a>. And speaking of which, time to dump the ROM!</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13991270490" title="Furrtek&#x27;s Airaki: Dumping the ROM. by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7363/13991270490_958236d61d.jpg" width="500" height="375" alt="Furrtek&#x27;s Airaki: Dumping the ROM."></a></center></p>
<p><center><img src="/images/airaki/airaki-fuck-you.png"></center></p>
<p>In keeping with the tradition from Furrtek&#8217;s first game, <a href="http://furrtek.free.fr/superconnard/">Super Connard</a> (literally Super Asshole in French) the game has an emulator check and greets you with a rude message if you try to run it in an emulator. The game still runs perfectly on hardware, of course, either using the original cartridge, or if you put it on a flash cartridge.</p>
<p><center><img src="/images/airaki/bgb00099.png" class="imagebox"> <img src="/images/airaki/bgb00100.png" class="imagebox"></center></p>
<p>So the gameplay&#8230; </p>
<p>At first glance, the game might look like just another Candy Crush clone, which it sort of is. The left part of the screen contains a 9*7 of tiles, from which you can create combos by swapping the items at the cursor, and new items fall from the top of the screen. The unique gameplay element is the adventure part of the game. A combo of 3 or more items in a row will attack the enemy using the weapon in the combo, give you a power-up or give you a shield that you can use to block the enemy&#8217;s attack. One of the power-ups is a glass of beer which will both restore your health slightly and make you temporarily drunk, which is indicated by distorting the screen image in a wavy pattern.</p>
<p>There&#8217;s also a 2 player more, which I haven&#8217;t tried. The game functionality is described on the instruction sheet, which I&#8217;ve scanned and attached below. The game is slightly addictive, but could have used some music in the game, and not just an intro tune.</p>
<p>And on a technical note&#8230; After I started obsessing about latency, I&#8217;ve started to test the latency (lag) for Gameboy games. The lag in Airaki is 2 frames, that is, the time from when a button is registered as pressed by the CPU until a change can be seen on the screen is ~33 milliseconds longer than it theoretically needs to be. this is hardly a major issue, but if you know to look for it, you can notice it. This may have been needed for the link cable two player mode, but apart from that, I&#8217;m pretty sure it should have been possible to cut this down to 0 or at least 1 frames of lag.</p>
<p>The game is compatible with monochrome Gameboy, and Gameboy Color with enhanced coloring. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14177579065" title="Airaki instruction sheet front scan by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5037/14177579065_f1f800157d.jpg" width="500" height="355" alt="Airaki instruction sheet front scan"></a></center></p>
<p>And finally, for those who want it, here&#8217;s the ROM.<br />
<center style="font-size: 400%; font-weight: bold; margin-bottom:20px; margin-top:20px;"><a href="/images/airaki/airaki.zip">DOWNLOAD</a></center>
</div>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2014/05/14/furrteks-airaki-quick-game-review-and-rom-dump-download/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dell PSU third pin fix</title>
		<link>https://blog.gg8.se/wordpress/2014/04/25/dell-psu-third-pin-fix/</link>
		<comments>https://blog.gg8.se/wordpress/2014/04/25/dell-psu-third-pin-fix/#comments</comments>
		<pubDate>Fri, 25 Apr 2014 03:34:42 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.gg8.se/wordpress/?p=450</guid>
		<description><![CDATA[A few years ago, I bought a PSU for my Dell D600 on eBay which turned out to be a really crappy Chinese pirate PSU which suffered badly from interference. When I wanted to fix the interference by connecting the plug to a different, and genuine Dell PSU, I stumbled upon a problem. All modern [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago, I <a href="//blog.gg8.se/wordpress/2009/10/20/the-chinese-pirate-dell-psu/">bought a PSU for my Dell D600</a> on eBay which turned out to be a really crappy Chinese pirate PSU which suffered badly from interference. When I wanted to fix the interference by connecting the plug to a different, and genuine Dell PSU, I stumbled upon a problem. All modern Dell PSU&#8217;s have a ID feature to confirm that the PSU is genuine, using a 3rd pin center pin connected to an EEPROM. If this chip does not match, the laptop won&#8217;t allow the battery to be charged. While a less scrupulous 3rd party manufacturer can nag one of those ID chips from a broken genuine Dell PSU and pass the test with a any poor quality PSU, I had to transplant this ID chip somehow, to make the PSU work.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/4029122360" title="New PSU cable splice by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2676/4029122360_3801eab8b0_m.jpg" width="240" height="180" alt="New PSU cable splice"></a> <a href="https://www.flickr.com/photos/gameboygenius/4029122150" title="New PSU cable splice by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2438/4029122150_feccc0a79a_m.jpg" width="240" height="180" alt="New PSU cable splice"></a></center></p>
<p>I recently got another Dell laptop with a broken PSU, which I could have if I could fix the PSU. Like last time, I decided to splice the cable with a board containing the chip. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999841214" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5175/13999841214_207200e453.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>This board was made from veroboard, and ws a bit bulky, so I decided to design and order a new one. This posted is an illustrated guide to how this board is used.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14019440913" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7093/14019440913_8101f965ac.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><span id="more-450"></span><br />
To use this board, it is assumed you already have a working ID chip, a three pin Dell plug, and a working PSU that can deliver 19-20 V at the required wattage. The ID chip could come form either a broken Dell charger, or a pirate PSU (which in turn probably got its chip from a  broken PSU.) Here&#8217;s our victim, the TO92 package chip marked QID. Desolder this chip. Optionally snag the zener diode (the small black component) and the 130 ohm resistor (marked 1300).</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13006404864" title="Dell charger ID EEPROM chip by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm4.staticflickr.com/3794/13006404864_e7d89f4341.jpg" width="500" height="375" alt="Dell charger ID EEPROM chip"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13006396154" title="Dell charger ID EEPROM chip by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm4.staticflickr.com/3527/13006396154_5c2096cd12.jpg" width="500" height="375" alt="Dell charger ID EEPROM chip"></a></center></p>
<p>First, file down the board edge around the snap-off points to prevent sharp edges that may puncture the heatshrink tubing that will be used lately. I also rounded the edges, as I neglected to round them when designing the board.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999825694" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2922/13999825694_9dd32b861e.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Attach the zener diode to the footprint D12V. This component is polarized, meaning that the orientation of it matters. When oriented correctly, it should show diode voltage drop of around 0.7 V, when probed in your multimeter&#8217;s diode mode as indicated in the images below. (Note that the right multimeter probe is black, ground and left probe is the test probe, red.) This component may be omitted, which would offer less protection in case of a short circuit between the positive power conductor and the center ID wire.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999373375" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7109/13999373375_fb562e9b19_m.jpg" width="240" height="180" alt="Dell power adapter ID chip board"></a> <a href="https://www.flickr.com/photos/gameboygenius/13999380315" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7391/13999380315_cb8625ee95_m.jpg" width="240" height="180" alt="Dell power adapter ID chip board"></a></center></p>
<p>Attach the 130 ohm resistor. In case you don&#8217;t have a 130 ohm resistor, the E12 standard values 120 ohm or 150 ohm will work as well. As you might be able to notice, the footprint is slightly too small for the footprint I had designed for, but it turned out ok anyway.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13976269116" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5286/13976269116_f7dfcf3129.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Take your working PSU and cut the cable and peel it. Peel the inner conductor (positive voltage) and leave a suitable length of isolation to be able to feed it through the hole. Make sure you don&#8217;t nick the isolation of the inner conductor, risking a short-circuit between the two. If your cable is different, ensure that you are aware which conductor is the negative and positive voltage. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13996187861" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2927/13996187861_261fa0e6e9.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>When you are confident that the peeling is done correctly, attach the cable firmly using a cable tie which attaches to the cut-outs in the board. You will also be routing the negative voltage wire (in this case the shield of this coaxial cable) through to the bottom side, through the one cut-out that is bigger than the other. If your cable is different, again ensure that you know which wire is which.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13976243126" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5269/13976243126_6797f8df06.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Trim the positive conductor so that it&#8217;s almost flat to the board surface.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13996177481" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2926/13996177481_fd957830a3.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Apply solder. Trim the negative conductor such that it reaches across the big pad.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13976238306" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7323/13976238306_ed69b9dd8a.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Apply solder. Ensure proper wetting of the solder joint. Feel free to trim any strands that didn&#8217;t stick, to avoid that they deform and create shorts. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14019339963" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7036/14019339963_85f1eeb064.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>At this point, ensure that the positive conductor, going through the hole, doesn&#8217;t short anything else, including the right terminal of the zener diode. (The other terminal may however short to ground as shown here, as it is already soldered to ground.)</p>
<p>The ID chip should now be placed on the board, with the flat side facing down and each leg connecting to one of the pads. Start forming the legs. When soldering the components into place, you may want to start with the NC (not connected) pin as it is not connected anywhere and has the least thermal and is the easiest to solder. End with the G (ground) pin as it has the largest thermal mass.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999327165" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7175/13999327165_a36ae63197.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/14019329903" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7060/14019329903_04eea94621.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13996129612" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7318/13996129612_b40a11c308.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Now it is time to prepare a suitable piece of heatshrink tubing, as it may be impossible to get piece over the plug if you try to do this step after attaching the plug end. Find a diameter of tube that fits snugly over the PCB. Cut a length that is slightly longer than the PCB. Move the tubing over to the wire for later use. I&#8217;m using two layers of tubing for redundancy. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999836034" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5082/13999836034_0162501515.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999308455" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7197/13999308455_5b48234079.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Get the cable end with the plug. Similar to before, prepare the cable by peeling it and leaving appropriate amounts of isolation. Attach the cable using a cable tie. Wrap the outer (negative/ground) connector around the bigger cut-out, to the bottom side and solder it to the big pad. Route the middle connector (positive voltage) through the hole, trim its length and solder it in place. Route the innermost connector, the ID wire, through the extra cut-out and solder it to the PIN3 pad. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999729474" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm3.staticflickr.com/2915/13999729474_c838d9327f.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999723924" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7115/13999723924_c2c0047b38.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999718714" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5295/13999718714_203b9d77fc.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Now, make sure there are no shorts circuits where you don&#8217;t want them. If you dare, power up the PSU without plugging it in to the laptop. Measure the voltage between the ground/negative pin and the positive voltage pin. It should show around 19-20V. If it shows lower than what is specified for the PSU, you may have a short circuit.</p>
<p>Ensure that the voltage between ground/negative, and any point connected to the ID chip reads 0V. If any point reads a higher voltage while not plugged in to the computer, you have a short between the ID wire and the positive voltage wire, which may be fatal for the computer when plugged in.</p>
<p>If everything seems ok, try plugging it in. The BIOS should indicate which type of PSU it thinks is connected.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999272705" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7455/13999272705_3c1ef92cd8.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Lastly, I added a bit of hot snot to some strategic locations to prevent short circuits by, say, having a strand of a cable coming lose. </p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13996095181" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7369/13996095181_23b2b1718c.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13996090241" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7176/13996090241_0c5f05cc92.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Double check that the BIOS identifies the PSU correctly. Then apply the heatshrink tubing. First one layer&#8230;</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13999255535" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7210/13999255535_4bc1e07ed9.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13996075751" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm8.staticflickr.com/7067/13996075751_06613856fd.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>Then a second layer.</p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13996050362" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5329/13996050362_12246f25bd.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p><center><a href="https://www.flickr.com/photos/gameboygenius/13976132376" title="Dell power adapter ID chip board by nitro2k01 (Gameboy Genius), on Flickr"><img src="https://farm6.staticflickr.com/5082/13976132376_72e064a1e6.jpg" width="500" height="375" alt="Dell power adapter ID chip board"></a></center></p>
<p>That&#8217;s all. You now have (assuming you used a good  PSU and followed the instructions) a PSU that works with Dell laptops. If there is a demand, I might share the board files and/or make the board available for sale as a shared project on OSHPark.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gg8.se/wordpress/2014/04/25/dell-psu-third-pin-fix/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
