Close
0%
0%

Gameboy Clock

Turn a good old Gameboy into a chiptunes alarm clock

Similar projects worth following
The project started by a question "What happens when a Ikea clock mates with a Gameboy case?"
The answer is "a rather cool but somewhat limited Gameboy clock"
Then, the project turned into a gameboy development to make a good old DMG behave as alarm clock.

It's been a long time since I wanted to make a Gameboy shaped alarm clock,
So long, that Nintendo did release an official Gameboy clock, and so so long that it ran out of stock!
Ikea does a nice cheap clock, the Klockis, it is a clock with a inclinometer: depending on how you flip it it has a different functionality (clock, timer, alarm, thermometer). Its screen is a bit smaller than the Gameboy's but it looked like it could work.
I already had a few Klokis laying around, so I ordered a Gameboy aftermarket case and started the project.
I managed to assemble the console and the clock together. The result is ok, it could have been better but I followed the advice on "How to finish your weekend projects in a weekend", I decided to call it a day and switch to another project.
What was appealing about this project was I could use to commonly available items that roughly fit together. I think it would require much more work to have a more polished result, for example finding a slightly bigger LCD clock that fit better in the Gameboy would be nice but I think I would end up ordering a lot of useless LCD clocks before finding the right one. I also thought about using Xiaomi LCD thermometer since their firmware is updatable, but it seems smaller and it is not designed to display time.

I also tried a more retro approach: writing code and flashing it on a cartridge on a real Gameboy. Powering a gameboy 24/24 just to act is a clock would be a bit overkill energy wise, plus the screen has no light, but it is the perfect excuse to do some GB development ;-)
So far, both approaches  can be perfected but I'm quite happy with the result.

Writing code for the Gameboy feels good. This project was a nice way for me to get started with retro console dev, I will probably make a very basic game later.

I hope this project will inspire you, don't hesitate if you have any questions!

clockboy - the other alarm clock.gb

improved GBcompo21 version

gb - 128.00 kB - 12/14/2021 at 20:57

Download

alarm_clock.gb

Early version of an alarm clock cartridge you can flash on a real Gameboy

x-gameboy-rom - 32.00 kB - 06/23/2021 at 21:48

Download

clockboy-support-B.stl

vertical part

sla - 7.89 kB - 05/12/2021 at 07:58

Download

clockboy-support-A.stl

support base

sla - 8.09 kB - 05/12/2021 at 07:57

Download

  • 1 × V1:DMG gameboy case for the hardware version
  • 1 × V1:Ikea Klockis for the hardware version
  • 2 × V1:tactile switch buttons for the hardware version
  • 1 × V1:prototype board for the hardware version
  • 1 × V2:A real DMG Gameboy for the software version

View all 8 components

  • Hack it back!

    PixJuan07/23/2022 at 03:27 0 comments

    I entered the Clockboy project for the "Hack it back" contest.

    It kind of fits the requirements : even if I love it, my good old Gameboy was just collecting dust, now with this project, it is displaying time for me an my guests!

    The Ikea hack version runs 24/7 on my desk, and the real Gameboy version is only running when friends are visiting, without this project, it would just sit in a drawer.

  • GBcompo21 version

    PixJuan12/14/2021 at 20:53 0 comments

    My quick hack to play LSDJ songs didn't work, so I decided to fully rewrite Clockboy in assembly. As it was a bit frightening to start from scratch a new project in assembly, I disassembled the existing one and started to modify bits here and there until I rewrote most of it and enter GBcompo21 with this new version. I struggled a bit with the DMA and the timings but at the end it now works on the emulators AND the real hardware. I added a little sprite animation when the tune is playing.

    I published the code on Github, the assembly is not pretty, but the goal is to allow people to recompile the project to include their own chiptune.

    You can download the new version here.

    I have a few ideas I might implement if I find the time and motivation, but otherwise I consider this project to be finished!

  • Playing Lsdj songs on a gameboy

    PixJuan06/28/2021 at 18:54 0 comments

    LSDJ is a popular music tracker for Gameboy, and lsdpack allows playing lsdj songs from a custom application.
    The project is developed in assembler using RGBDS while I used another Gameboy SDK for my project, GBDK.
    Unfortunately, both SDK are incompatible, they use a different assembler syntax and a different obj file format...

    So I tried a quick hack :

    • Using assembler directives in lsdpack I forced the code to be at located at higher addresses, leaving the bottom of the memory map empty
    SECTION "setup",ROM0[$3000]
    • Then I compiled the lsdpack example and kept only the upper part of the binary
    • And I compiled my alarm clock project and cut the end of the file
    • Then I merged both files
    dd if=alarm_clock.gb of=alarm_bottom.bin count=24
    dd if=lsdpack_test.gb of=lsdpack_top.bin skip=24
    cat alarm_bottom.bin > fullrom.gb
    cat lsdpack_top.bin >> fullrom.gb 
    • In my code, I use inline assembly to call the addresses of lsdjpack functions I need
      void play_lsdj_song()
      {
      	__asm
      		call 0x3D07
      	__endasm;
      } 

    So far, it doesn't work yet, I will insist a bit more to get my hack working and if it doesn't, I will probably convert my code from C to assembly, it will give me more control for the tight timings lsdpack requires.

  • Custom RTC dongle

    PixJuan06/28/2021 at 11:22 0 comments

    In order to avoid having to set the time every time I switch my Gameboy on, I wanted to make use of an RTC clock.

    Certain expensives flash cartridges do have an embedded RTC but mine hasn't. So I decided to add a RTC feature through the link port.

    ArduinoBoy is an existing project that allows you to control by sending MIDI instructions through the link port, it happens to support the Teensy 3, which is quite nice because the Teensy3 has an embedded RTC, so no need to add an external component, just an external battery. Or at least that what I thought, because when I read carefully the Teensy 3.1 spec, it requires an oscillator, unlike the 3.5 and 3.6.

    I struggled a bit to get the link port to work. I wanted to use other ports that those used by ArduinoBoy, but I hadn't noticed that ArduinoBoy access the pins through port commands, and not digitalWrite()!

    So, currently my Teensy code works with the GBDK Comm example, but I'll wait to have receive the oscillator to make modifications on my alarm_clock GB code.

    The schematic is quite simple :

    The implementation is a bit more messy ;-)

    At first I tried to do a home made link connector but as I was debugging my Teensy software, I wanted a reliable hardware to only fix one bug at a time, so I ended up using an old gba cable connector.

    My plan is to do some more soldering and fit everything in a Mario candy box

  • Konami code

    PixJuan06/23/2021 at 22:17 0 comments

    I uploaded a new version of the alarm_clock cartridge, and I also uploaded the source to a github repo

    One of the new features is that now there is a mode where you need to enter a Konami code to stop the alarm ;-)

    On my TODO list:

    • Use the RTC of the cartridge if present, so I don't need to set the date everytime
    • Make some kind of RTC dongle for the Link port, because my flash cartridge doesn't have a RTC

  • Running on the real thing

    PixJuan06/20/2021 at 22:22 0 comments

    After finishing the simple hardware version I started coding  on a Gameboy emulator to try to display time and play "a-russian-tune-that-looks-like-a-famous-game-music-that-gets-a-lot-of-copyright-complaints"

    The controls are :

    • button A             : set time
    • button B             : set alarm
    • up/down  : select hours or minutes
    • left/right  : increase/decrease time (minutes or seconds, choose with up and down)

    I wrote the code in C and use GBDK to compile it. I will put the source code on Github soon, for now you can find the .gb file in the files section.

    I contacted Eric from The Other Days and he pointed me to Lsdpack which would allow me to play proper LSDJ chiptunes on my "gameboy alarm clock" so I will try it soon.


View all 6 project logs

  • 1
    Step 1

    First, drill holes in the prototype PCB , cut the part so that it fits.
    Then, solder the buttons on the top and the cables on the back.
    Drill the PCB case so that there is room for the cables. Retrospectively it would probably have been better to solder the cables on the top, I wouldn't have had to slaughter the case so much, but it works
    I soldered buttons for the cross, even I didn't use them in the end.

  • 2
    Step 2

    With a Dremel or a similar tool saw the sides of the clock.
    Drill holes in what remains of the frame of the clock so that you can screw it later to the front of the Gameboy case.

  • 3
    Step 3

    Now we need to solder some cables on the clock.
    Unsolder the battery holders, and keep them for later, then solder some jumper cables to power the clock.
    Then solder cables on the button pads, I tried to remove the "vernish" on the PCB but it didn't work very well, for one of the button,I ended up following the lines and soldering on the other side of the clock.

    before I soldered the button cables

View all 6 instructions

Enjoy this project?

Share

Discussions

PixJuan wrote 05/10/2021 at 17:27 point

Thanks Mike.

Yes, I just ordered a empty case, I suppose the Gameboy is still popular and a lot of people are refurbishing old consoles with new cases so it is easy to find them on ebay or Ali-express.

It's also why I didn't do this little hack earlier, I didn't know it could do it without scarifying a real gameboy.

  Are you sure? yes | no

Mike Szczys wrote 05/10/2021 at 15:31 point

Oh that's interesting, you didn't gut a Game Boy but just ordered an empty case? Was this one someone else removed the guts from or is it new for replacing damaged cases?


Clock is a nice look. I think the sideways orientation of the Game Boy actually makes it look a lot more interesting.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates