Git Product home page Git Product logo

gbcam-rev-engineer's People

Contributors

antoniond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gbcam-rev-engineer's Issues

Document setup

I stumbled across this repo, and I'm very impressed.

The idea occurred to me to use the Game Boy Camera as a webcam, by connecting the cartridge to a Teensy and using something like teensy_uvc to show it as a webcam. I'd have to get the actual camera second hand, so it's just idle thought.

Anyway, I was reading through your repo, and had some questions:

  • What kind of Arduino is used? Just a Uno?
  • What is the function of the Due helper?
  • Is a shift register used for the address lines?
  • What is the function of sensor_read_pin and sensor_vout_pin and how are they connected?

processClocks()

Hello, I believe I've arrived a bit late to the project, I hope you're still around. I'm working on a project with Flipper Zero and an ESP32-S2, which has enough pins to read a Game Boy cartridge.

I've successfully managed to read the images stored in the cartridge's RAM and display them on the Flipper's 128x64 screen.

Game Boy Flipper Zero

Now, I wanted to capture photos from the FZ or maybe even do a live video with the GAME BOY Camera, but half of the time, I'm not sure what I'm doing, and I get lost in many parts.

Could you please provide a detailed explanation of what the processClocks method does?

void processClocks(void)
{
setAddress(0xA000);
setReadMode(0xA000 < 0x8000);
asm volatile (
".equ PORTB,0x05 \n"
".equ PIND,0x09 \n"
"cli \n" // Disable interrupts
"L_%=: \n"
"sbi PORTB,5 \n" // 2 Cycles | PORTB.5 = PHI pin = PIN 13
"nop \n" // 1 Cycle
"nop \n"
"nop \n"
"nop \n"
"nop \n"
"nop \n"
"cbi PORTB,5 \n" // 2 Cycles
//"nop \n" // Comment 1 nop: 16 MHz / 15 = 1066667 Hz (closer to 1048576 Hz than 16 MHz / 16 = 1000000 Hz)
"nop \n"
"nop \n"
"sbic PIND,2 \n" // 1 Cycle if set | Skip next instruction if bit cleared.
"rjmp L_%= \n" // 2 Cycles | PIND.2 = data[0] = PIN 2
"sei \n" // Enable interrupts
::);
setWaitMode();
}

Or, if it's possible, could it be written in Arduino code instead of assembly, like in the following?

// Address pins
const static uint32_t ADDRESS_GB_GBC_PINS[16] = 
{
    GAMEBOY_A00,
    GAMEBOY_A01,
    GAMEBOY_A02,
    GAMEBOY_A03,
    GAMEBOY_A04,
    GAMEBOY_A05,
    GAMEBOY_A06,
    GAMEBOY_A07,

    GAMEBOY_A08,
    GAMEBOY_A09,
    GAMEBOY_A10,
    GAMEBOY_A11,
    GAMEBOY_A12,
    GAMEBOY_A13,
    GAMEBOY_A14,
    GAMEBOY_A15
};
// Data pins
const static uint32_t DATA_GB_GBC_PINS[8] = 
{
    GAMEBOY_D00,
    GAMEBOY_D01,
    GAMEBOY_D02,
    GAMEBOY_D03,
    GAMEBOY_D04,
    GAMEBOY_D05,
    GAMEBOY_D06,
    GAMEBOY_D07
};

void generatePulse() {
  digitalWrite(phi_pin, HIGH);
  __asm__("nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t"
          "nop\n\t");
  digitalWrite(phi_pin, LOW);
  __asm__("nop\n\t"
          "nop\n\t");

}
// ... bla
noInterrupts();
generatePulse();
int raw_data = digitalRead(DATA_GB_GBC_PINS[0]);
while (raw_data == 1) {
    generatePulse();
    raw_data = digitalRead(DATA_GB_GBC_PINS[0]);
}
interrupts();

I hope you can assist me; I believe I'm very close to achieving it ๐Ÿ™ ... or maybe quite far, haha. I say "quite far" because the CPU frequency of the ESP32 is much higher than that of an Arduino (240MHz), and I'm not sure if it will work ๐Ÿค”.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.