All pastes #906576 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-16 20:20 UTC
rendered paste body
static u32 read32(u32 addr)
{
        u32 x;

        __asm__("lwz %0,0(%1) ; sync" : "=r"(x) : "b"(0x80000000 | addr));

        return x;
}

static void write32(u32 addr, u32 x)
{
        __asm__("stw %0,0(%1) ; eieio" : : "r"(x), "b"(0x80000000 | addr));
}

static void blink(u32 colour)
{
        u32 *fb = (u32 *)0xC0F00000;
        u32 i;

        // blink tray led
        write32(0x0d8000c0, read32(0x0d8000c0) ^ 0x20);
}