Пример #1
0
void
vdp1_init(void)
{
        /* Check if boundaries are correct */
        STATIC_ASSERT((VDP1_CMDT_MEMORY_SIZE +
                VDP1_GST_MEMORY_SIZE +
                VDP1_TEXURE_MEMORY_SIZE +
                VDP1_CLUT_MEMORY_SIZE) == VDP1_VRAM_SIZE);

        /* Initialize the processor to sane values */
        MEMORY_WRITE(16, VDP1(TVMR), 0x0000);
        MEMORY_WRITE(16, VDP1(ENDR), 0x0000);
        MEMORY_WRITE(16, VDP1(FBCR), 0x0000);
        MEMORY_WRITE(16, VDP1(PTMR), 0x0000);

        MEMORY_WRITE(16, VDP1(EWDR), 0x0000);
        MEMORY_WRITE(16, VDP1(EWLR), 0x0000);
        MEMORY_WRITE(16, VDP1(EWRR), (uint16_t)(((320 / 8) << 9) | (223)));

        vdp2_tvmd_vblank_in_wait();

        /* Stop processing command tables */
        uint32_t cmdt_idx;
        for (cmdt_idx = 0; cmdt_idx < VDP1_CMDT_COUNT_MAX; cmdt_idx++) {
                struct vdp1_cmdt *cmdt;
                cmdt = (struct vdp1_cmdt *)CMD_TABLE(cmdt_idx, 0);
                cmdt->cmd_ctrl = 0x8000;
        }

        vdp1_cmdt_list_init();

        MEMORY_WRITE(16, VDP1(PTMR), 0x0002);
}
Пример #2
0
CommandStatus GBOutputSetOption(int opt, int argc, char *argv[],
                                int quoted[], char *err, size_t errsize)
{
    const ValueTable *val;
    int f;

    CMD_ARGC_CHECK(1);

    switch(opt)
    {
        case OPT_COLOUR:
            option.is_colour = ParseTrueFalse(argv[0], TRUE);
            break;

        case OPT_SUPER:
            option.is_super = ParseTrueFalse(argv[0], TRUE);
            break;

        case OPT_CART_RAM:
            CMD_EXPR(argv[0], option.cart_ram);
            break;

        case OPT_CART_TYPE:
            CMD_EXPR(argv[0], option.cart_type);
            break;

        case OPT_IRQ:
            CMD_ARGC_CHECK(2);
            CMD_TABLE(argv[0], irq_table, val);
            CMD_EXPR(argv[1], f);
            option.irq_vector[val->value] = f;
            break;

        default:
            break;
    }

    return CMD_OK;

}