Thursday, May 17, 2018

Game Boy Advance Development 101: Compiling Tank Advance

If you've happen to download Tank Advance source code from Loirak Development, chances are you're having a problem compiling a working GBA file with devkitPro.

That's because of the compiler.

The pre-compiled GBA file inside the Tank Advance ZIP file was compiled 2002 -- that's more than a decade and a half.  Last 2002, GCC was just version 3.  As of this writing, devkitPro is using GCC version 7.

Without much further ado, use the following lines in MSYS2:
arm-none-eabi-gcc -c gfx.c -mthumb-interwork -mthumb -O2 -o gfx.o
arm-none-eabi-gcc -c main.c -mthumb-interwork -mthumb -O2 -o main.o
arm-none-eabi-gcc main.o gfx.o -mthumb-interwork -mthumb -specs=gba.specs -o tank.elf
arm-none-eabi-objcopy -v -O binary tank.elf tank.gba

If successful, you should have a freshly compiled Tank Advance and you can start changing the code to understand how it works so you can start writing your own Game Boy Advance game. :)

Happy GBA deving!


Friday, May 4, 2018

Game Boy Advance Retro Gaming with Supercard

Why Retro Gaming?

On my early 30s now, and such a nostalgia seeing game boy games being played with Smart Phone.  But the little boy inside me still wants to play these games in a real Game Boy device.

How to do Retro Gaming?

Option 1, buy Chinese knock-off game device that natively runs emulators which then runs your ROM (the game file of your favorite Game Boy game).  Amazon and Ebay lists Game Boy Console but I'm not sure on their authenticity -- so, buy at your own risk!
Option 2, buy used Game Boy and used games -- a little harder approach but I was able to find one used Game Boy Advance SP and a used game which isn't my kind of game.
So, I had to resort to a Supercard, a cartridge that used SD Card (to which you save your ROM and plays on your Game Boy) -- this Supercard was a hit some 15 years ago when ROMs plagued the Internet.  I learned about this when I was learning how to write a game for Game Boy Advance using free Game Boy SDK -- thanks to Jonathan Harbour's Unofficial Guide!
This Supercard only costs about $18 USD which is available online -- the card is also supported by NDS.

Common Problems and Solutions

Where to find ROM -- Internet is still plagued with ROMs, and you are not going to get those links from me.

"not find SD" --  there could be lots of reasons and these are possible solutions:
  • check that your SD card IS NOT SDHC card; if it is, buy a new one -- the SD one!
  • check that your SD card is formatted with FAT and NOT FAT32; it it is, reformat it to FAT!
  • check that your SD card is 2GB and NOT MORE THAN 2G; if it is, buy a new 2GB one.
Cannot read ROM -- you need to convert the ROM to be compatible with Supercard;  I found version 2.71 dated 2010.03.25

Cannot SAVE game -- make sure to Run Supercard converter as Administrator to enable SAVE in your ROM


That's pretty much it!  Comment down for questions and if you happen to have additional information, kindly share them in comments :) Happy Retro Gaming! 

DISCLAIMER: Yes, my approach is technically "Piracy" and I'm not trying to justify -- it's just that these games are not being sold anymore.  So, NO, I'm not promoting piracy.  Read more on Nintendo's stand on ROMs.

SIDE NOTE:  Nintendo might be able to make money if it had a ROM store much like Apple's App Store or Google's Play Store since it already re-released NES, and SNES -- might as well re-release a WIFI-enabled Game Boy! :)

Saturday, April 16, 2016

Lenovo VIBE K4 Note, ANTVR PhoneGlass, and Google Cardboard

So, Lenovo Philippines decided to sell their Lenovo VIBE K4 Note with free VR glass.  Yes, you read that right -- a FREE Virtual Reality glass for every new Lenovo VIBE K4 Note.

To tell you the truth, I didn't bother with the phone's specs.  I just wanted to have my own VR glass!  So, yeah, this is not a post about a phone review.  Though, I'm generally okay with the phone given the price of US$220~ (some store sells it for US$230) that it already comes with VR glass.  So, there's that.

Now onto the VR glass.

Nothing fancy, really.  It's just a plastic version of Google Cardboard with head strap.  Which, for someone like me who really needs to experience this VR thing that's been trending for quite awhile now, it's my kind of poor man's Occulus Rift. I say, hell yeah! I finally have an Occulus Rift! -- a cheap one of course but to hell with CEOs saying VR for the mass market will take a longer while.

So how does it work?

Like Google Cardboard, you will have to put the phone in front of the glass, clipped into place -- which is kind of a lousy engineering if you ask me.  Placing the phone into place by having it clipped comes the risk of the phone falling off if not properly clipped -- I mean, it took me awhile to actually safely clip the phone.  I was thinking, it would have been better if you just slide it on the side of the VR glass and have some locking mechanism to lock it into place -- maybe, slide it on then clip for locking.  I hope Lenovo would be reading this and tap ANTVR to revise the glass with my inputs.

Demo, anyone?

Sadly, the phone does not have videos or apps ready for demo purposes.  So I had to search Google Playstore only to find apps that are compatible only to Google Cardboard.

Good thing though that VR Roller Coaster app has the same configuration that fits Lenovo's ANTVR.

So, these are the steps that configured Lenovo's ANTVR for VR apps that were designed for Google Cardboard:
1. Install Google Cardboard
2. Install VR Roller Coaster
3. Run VR Roller Coaster, select any of the 2 sample rides, then click configure.
4. Then focus the phone to the image below, which I got from the internet by simply googling: 'qr code "vr roller coaster"'
VR Roller Coaster configuration
I know it's rather small but VIBE K4 Note can actually scan it and configure VR Roller Coaster's view that will fit Lenovo's ANTVR glass.

(This post was written at 3AM, just after a few hours of tinkering with ANTVR; if something is not clear, put it in the comments below :) -- if everything works, please do let me know as well by commenting)