Ejemplo n.º 1
0
Archivo: main.c Proyecto: clbr/SGDK
static void refreshDriverParams()
{
    const u16 driver_ind = getCurrentDriverIndex();
    const char* str;
    u16 start;
    u16 len;
    u16 posY;
    u16 i, j;

    VDP_clearTileMapRect(PLAN_A, 0, 3, 40, 8);

    str = driver->name;
    len = strlen(str);
    start = 20 - (len / 2);

    setTextPalette(driver != &drivers[0]);
    VDP_drawText("<", start - 2, 3);
    VDP_setTextPalette(PAL0);
    VDP_drawText(str, start, 3);
    setTextPalette(driver != &drivers[NUM_DRIVER - 1]);
    VDP_drawText(">", start + len + 1, 3);

    posY = 5;

    for(i = 0; i < driver->num_cmd; i++)
    {
        const cmd_def *cur_cmd = &driver->cmds[i];
        u16 posX = 2;

        str = cur_cmd->name;
        VDP_setTextPalette(PAL0);
        VDP_drawText(str, posX, posY);
        posX += strlen(str);

        for(j = 0; j < cur_cmd->num_param; j++)
        {
            const param_def *cur_param = &cur_cmd->params[j];

            str = cur_param->name;
            setTextPalette(params_value[driver_ind][i] == cur_param);
            VDP_drawText(str, posX, posY);
            posX += strlen(str);
        }

        posY++;
    }

    VDP_setTextPalette(PAL0);

    if (cmd == NULL) VDP_drawText("*", 0, 3);
    else VDP_drawText("*", 0, 5 + getCurrentCmdIndex());
}
Ejemplo n.º 2
0
void Video::setLevelPalettes() {
	debug(DBG_VIDEO, "Video::setLevelPalettes()");
	if (_unkPalSlot2 == 0) {
		_unkPalSlot2 = _mapPalSlot3;
	}
	if (_unkPalSlot1 == 0) {
		_unkPalSlot1 = _mapPalSlot3;
	}
	setPaletteSlotBE(0x0, _mapPalSlot1);
	setPaletteSlotBE(0x1, _mapPalSlot2);
	setPaletteSlotBE(0x2, _mapPalSlot3);
	setPaletteSlotBE(0x3, _mapPalSlot4);
	if (_unkPalSlot1 == _mapPalSlot3) {
		setPaletteSlotLE(4, _conradPal1);
	} else {
		setPaletteSlotLE(4, _conradPal2);
	}
	// slot 5 is monster palette
	setPaletteSlotBE(0x8, _mapPalSlot1);
	setPaletteSlotBE(0x9, _mapPalSlot2);
	setPaletteSlotBE(0xA, _unkPalSlot2);
	setPaletteSlotBE(0xB, _mapPalSlot4);
	// slots 0xC and 0xD are cutscene palettes
	setTextPalette();
}
Ejemplo n.º 3
0
Archivo: main.c Proyecto: clbr/SGDK
static void refreshDriverCmd()
{
    VDP_clearTileMapRect(PLAN_A, 0, 12, 40, 8);
    setTextPalette(1);

    switch(driver->id)
    {
    case Z80_DRIVER_PCM:
        VDP_drawText("press A to start/end playback", 1, 12);
        break;

    case Z80_DRIVER_2ADPCM:
        VDP_drawText("press A to start/end channel 1", 1, 12);
        VDP_drawText("press B to start/end channel 2", 1, 13);
        break;

    case Z80_DRIVER_4PCM_ENV:
        VDP_drawText("press A to start/end channel 1", 1, 12);
        VDP_drawText("press B to start/end channel 2", 1, 13);
        VDP_drawText("press C to start/end channel 3", 1, 14);
        VDP_drawText("press START to start/end channel 4", 1, 15);
        break;

    case Z80_DRIVER_MVS:
        VDP_drawText("press A to start/end play MVS music", 1, 12);
        VDP_drawText("press B to play PCM SFX", 1, 13);
        break;

    case Z80_DRIVER_TFM:
        VDP_drawText("press A to start play", 1, 12);
        VDP_drawText("press START to stop play", 1, 13);
        break;

    case Z80_DRIVER_VGM:
        VDP_drawText("press A to play Sonic 1 VGM", 1, 12);
        VDP_drawText("press B to play RoadRash VGM", 1, 13);
        VDP_drawText("press C to play Bad Apple VGM", 1, 14);
        VDP_drawText("press Start to stop/resume VGM", 1, 15);

        VDP_drawText("press X to play PCM SFX", 1, 17);
        break;

    case Z80_DRIVER_XGM:
        VDP_drawText("press A to play Streets Of Rage 2 XGM", 1, 12);
        VDP_drawText("press B to play Bad Apple (PCM) XGM", 1, 13);
        VDP_drawText("press C to play Midnight Resistance XGM", 1, 14);
        VDP_drawText("press START to pause/resume XGM music", 1, 15);

        VDP_drawText("press X to play PCM SFX ch 2", 1, 17);
        VDP_drawText("press Y to play PCM SFX ch 3", 1, 18);
        VDP_drawText("press Z to play PCM SFX ch 4", 1, 19);

        VDP_drawText("Z80 CPU load:", 1, 21);
        break;
    }
}