Showing posts with label Hardware. Show all posts
Showing posts with label Hardware. Show all posts

Thursday, September 22, 2016

How to replace the battery of Game Boy games.

Today I was doing something very different than what I am usually working on, I decided to fix my old Game Boy Color game of Pokemon Gold.
The method I explain can be used on any Game Boy Color, and other Nintendo games.

The problem with the game was that you could not save the game and load your saved games.
You do not see the "continue" option in the menu when you start the game. This is due to the little battery inside the card, which is needed to remember the save games and the internal clock.
To make the save games work again we need to replace the internal battery that has run dry over the years with a new one.

The battery inside the game is a CR2025, this flat round battery that you can buy almost anywhere.
CR2025 battery you need
There are basically two ways of replacing this battery:

  1. The professional way: by using a solder to unsold the old battery and put in place a new one.
  2. The easy way: by using electronic tape to hold the new battery in place and some subtle torque to undo the old battery.
Since I do not have a solder, and I do have electronic tape, the choice was easy.

To replace the battery, whichever method you choose the first thing you need to do is open the game card. The Game Boy games and other Nintendo games are closed with a little special security screw. The easiest way to open these is with a security bit, you can buy one for 4 euro online.
How the Pokemon Gold game looks just after opening using the security bit.
 After opening the game, we can see the old battery clearly in the top right corner. The battery is held into place by two iron brackets that are soldered to the board.
We can use a little screwdriver or another small object to carefully put strength on the positions where the iron brackets are attached to the battery. There are two times two attachments points on the top and the same amount on the bottom of the battery. This is the most tricky part since we do not want to hit anything else, so carefully put enough strength to break the battery free from its position. If you choose to go with the solder method, then you can heat up the solder points next to the battery to remove it.
I used a little twister to break the attachments points and was able to remove the battery fairly easy without damaging anything else.

Removed the old battery with the twisters on the right. 
The battery has the + side at the bottom, so make sure that you also put the new battery with the plus side at the bottom. Once the old battery is out you can use a piece of electrical tape to hold the new battery against the two iron brackets. Put some tape below the lower bracket and lay the battery on top, close the above bracket firmly on top of the battery and put the remainder of the tape over the bracket and battery to hold everything firmly in place.


The end result can be seen in the image on the right. The new battery is snug and tight in the electrical tape and the game is almost ready.

Last step is to slide the lid back on and put the security screw back in.
The final result: We can save and load the game again!

It works again! Continue a previous saved game.

Tuesday, April 30, 2013

Hardware Acceleration in Android


Beginning in Android 3.0 (API level 11) we have the option to enable hardware acceleration.
Now what is hardware acceleration and why should we use it?

Hardware acceleration means that we use the GPU to do the drawing work instead of the CPU. The views on canvas will be exported to textures that will be drawn to the screen by using OpenGL libraries. This process is much faster then drawing them by using the CPU, however also much more memory consuming. Loading the OpenGL libraries takes 2 to 8 MB of main memory, if we eat even more memory by using large images or a lot of objects then on phones with limited memory we run into problems.

Because of the memory consumption Android does not allow images larger than 2048x2048 to be used during hardware accelerated events. Note that the actual image size might be even smaller since the image is first transformed to a texture, it is wise to not use images above 2000x2000. This means that if you want to work with larger images coming from camera's for example, you have to disable it.

Hardware acceleration can be switched on globally for the entire app in the manifest file.
<application android:hardwareAccelerated="true" ...>
But you can also enable it per activity and in the near future per window (not supported yet though), which would be more preferable since most applications would not profit from accelerated hardware in the main menu for example.

Crossplatform apps and hardware acceleration

In HTML5/JS cross-platform apps made by, for instance Phonegap/Cordova, hardware acceleration can improve the app significantly.
If we create a simple webapp with jQuery mobile and run it using Phonegap on a phone, we see that the transitions between pages are a bit staggering, the scrolling is not smooth and the reaction time is a bit slow, even on high-end phones.
Now we enable hardware acceleration and run the same app again. The transitions look amazing, scrolling is super smooth and the app reacts in no time!
 

In short: Hardware acceleration is an awesome new feature that Android 3.0 and above offers, but only use it when needed.