Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2018-02-24 12:57:46

rebb
New member
Registered: 2015-11-12
Posts: 4

Sending IR codes with assembler

I'm trying to build remote shutter for my Canon camera. This is my IR send routine

Code:

irsend:
        ld      b,$0F
irloop:
        ld      a,$1
        ld      [rRP],a
        nop                 ; wait approx 10uS (10 nop's 10x4clock cycles)
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        ld      a,$0
        ld      [rRP],a
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        dec     b
        jr      nz,irloop
        ret

Anything stupid done there?
I'm calling this from mainloop, waiting little while and calling again.
Tried debugging code with BGB, but seems that io register shows FF whatever i do.
Also tried with my phones camera if I could see the IR led flashing. I can see my TV remote but nothing from GBC.
Is there any test rom that I could use to test that IR led is actually working on my GBC. Tested Super Mario bros. Deluxe
send scores but cannot see anything either.

Offline

 

#2 2018-02-24 16:48:23

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 242

Re: Sending IR codes with assembler

If the register ($FF56) always shows $FF that's a sign that it's emulating a non-GBC. Check BGB settings that you have the platform type set for example to GBC or automatic, prefer GBC. Also make sure that your ROM header has the appropriate values set to enable GBC support. You can do this by adding the -c flag to your RGBFIX command.

Perhaps a silly question, but are you sure you have a GBC? The IR port was removed from all version of GBA, for one thing. Also, if you have the bootleg GB Boy Colour, that also lacks the IR port. On this hardware, the IR window is just fake.


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#3 2018-02-24 16:48:35

ssjason123
Member
Registered: 2017-03-21
Posts: 45

Re: Sending IR codes with assembler

I was playing with mine. I see the IR LED with my phone. I tested Super Mario bros. Deluxe send score and it flashes very briefly. I also made a simple test app that just turns it on forever. The only catch I saw was making sure the binary was built with GBC support in the header:
http://gbdev.gg8.se/wiki/articles/The_C … -_CGB_Flag

When I initially built as GB only it didn't work.

As a side note I saw the same issue with BGB it only showed 0xFF in the IO.

Offline

 

#4 2018-02-24 16:49:41

tmk
Member
Registered: 2017-05-01
Posts: 63
Website

Re: Sending IR codes with assembler

rebb wrote:

Is there any test rom that I could use to test that IR led is actually working on my GBC.

Infrared Investigator by Ken Kaarvik (PD) [C].gbc

Offline

 

#5 2018-02-25 03:50:04

rebb
New member
Registered: 2015-11-12
Posts: 4

Re: Sending IR codes with assembler

Thanks for the answers!
Yes using real GBC of course, header is set to GBC too.
I can read codes with Infrared Investigator, anyone got the universal remote program from same guy? So i could test the sending part too.

Offline

 

#6 2018-02-25 07:30:29

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 242

Re: Sending IR codes with assembler

You could try the Mission Impossible game, which has a remote control emulator as part of its "agent organizer".


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#7 2018-03-01 02:10:00

Shonumi
New member
Registered: 2016-07-03
Posts: 8

Re: Sending IR codes with assembler

I actually just wrote some homebrew that records IR input on the GBC. It also has the ability to playback recorded IR signals too. I've been using it to record IR communications between another GBC and the Pocket Pikachu 2 and it seems to work as intended so far. It's not real fancy, but I can share it if anyone wants it.

nitro2k01 wrote:

If the register ($FF56) always shows $FF that's a sign that it's emulating a non-GBC. Check BGB settings that you have the platform type set for example to GBC or automatic, prefer GBC.

I don't think BGB supports the IR sensor or anything related to $FF56. The only emulators I know of that do anything with it are TGB-Dual (somehow works with Pokemon G/S/C Mystery Gift???), SameBoy, and my own GBE+. Not sure what the status of SameBoy currently is, but GBE+ successfully emulates most games that use it (still some gaps though).

Last edited by Shonumi (2018-03-01 02:10:34)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson