Exemple #1
0
static TUI_MENU_CALLBACK(attach_tape_callback)
{
    const char *s;

    if (been_activated) {
        char *directory, *default_item;
        char *name, *file;

        s = tape_get_file_name();
        util_fname_split(s, &directory, &default_item);

        name = tui_file_selector("Attach a tape image", directory, "*.t64;*.tap;*.t6z;*.taz;*.zip;*.gz;*.lzh", default_item, tapecontents_read, &file, NULL);

        if (file != NULL) {
            if (autostart_tape(name, file, 0, AUTOSTART_MODE_RUN) < 0) {
                tui_error("Cannot autostart tape image.");
            } else {
                *behavior = TUI_MENU_BEH_RESUME;
            }
            lib_free(file);
        } else if (name != NULL && (s == NULL || strcasecmp(s, name) != 0) && tape_image_attach(1, name) < 0) {
            tui_error("Invalid tape image.");
        }
        ui_update_menus();
        lib_free(directory);
        lib_free(default_item);
        lib_free(name);
    }

    s = tape_get_file_name();
    if (s == NULL || *s == '\0') {
        return "(none)";
    } else {
        return s;
    }
}
Exemple #2
0
static TUI_MENU_CALLBACK(detach_tape_callback)
{
    const char *s;

    if (been_activated) {
        tape_image_detach(1);
        ui_update_menus();
    }

    s = tape_get_file_name();
    if (s == NULL || *s == '\0') {
        return "(none)";
    } else {
        return s;
    }
}
Exemple #3
0
void PS3Graphics::DrawHUD()
{
	static uint8_t  intensity;
	static uint32_t led_color;
	int enabled;
	float yPos=0.00f;
	float ybrk=0.03f;

	if (ui.display_drives)
	{
		resources_get_int("Drive8Type", &enabled);
		if (enabled)
		{
			intensity = ((ui.drive8.led_pwm1 * 0xff) / 1000) & 0xff;
			if (intensity > 0)
			{
				yPos+=ybrk;
				led_color = (ui.drive8.led_color == DRIVE_ACTIVE_RED) ? (0xff000000 | intensity) : (0xff000000 | (intensity << 8));
				cellDbgFontPrintf(0.85f, yPos, Emulator_GetFontSize(), led_color,  "D8  TRK %u", ui.drive8.half_track_number/2);
			}
		}

		resources_get_int("Drive9Type", &enabled);
		if (enabled)
		{
			if (intensity > 0)
			{
				yPos+=ybrk;
				led_color = (ui.drive9.led_color == DRIVE_ACTIVE_RED) ? (0xff000000 | intensity) : (0xff000000 | (intensity << 8));
				cellDbgFontPrintf(0.85f, yPos, Emulator_GetFontSize(), led_color,  "D9  TRK %u", ui.drive9.half_track_number/2);
			}
		}

		resources_get_int("Drive10Type", &enabled);
		if (enabled)
		{
			if (intensity > 0)
			{
				yPos+=ybrk;
				led_color = (ui.drive10.led_color == DRIVE_ACTIVE_RED) ? (0xff000000 | intensity) : (0xff000000 | (intensity << 8));
				cellDbgFontPrintf(0.85f, yPos, Emulator_GetFontSize(), led_color,  "D10 TRK %u", ui.drive10.half_track_number/2);
			}
		}
		resources_get_int("Drive11Type", &enabled);
		if (enabled)
		{
			if (intensity > 0) {
				yPos+=ybrk;
				led_color = (ui.drive11.led_color == DRIVE_ACTIVE_RED) ? (0xff000000 | intensity) : (0xff000000 | (intensity << 8));
				cellDbgFontPrintf(0.85f, yPos, Emulator_GetFontSize(), led_color,  "D11 TRK %u", ui.drive11.half_track_number/2);
			}
		}
	}

	if (ui.tape.status)
	{
		if (tape_get_file_name() != NULL)
		{
			yPos+=ybrk;
			cellDbgFontPrintf  (0.80f, yPos, Emulator_GetFontSize(), (ui.tape.motor) ? GREEN : PURPLE,  "TAPE %d", ui.tape.counter);

			switch (ui.tape.control)
			{
				case DATASETTE_CONTROL_STOP:
					cellDbgFontPuts(0.80f, yPos, Emulator_GetFontSize(), PURPLE,  "         STOP");
					break;
				case DATASETTE_CONTROL_START:
					cellDbgFontPuts(0.80f, yPos, Emulator_GetFontSize(), PURPLE,  "         PLAY");
					break;
				case DATASETTE_CONTROL_FORWARD:
					cellDbgFontPuts(0.80f, yPos, Emulator_GetFontSize(), PURPLE,  "         FWD");
					break;
				case DATASETTE_CONTROL_REWIND:
					cellDbgFontPuts(0.80f, yPos, Emulator_GetFontSize(), PURPLE,  "         REW");
					break;
				case DATASETTE_CONTROL_RECORD:
					cellDbgFontPuts(0.80f, yPos, Emulator_GetFontSize(), PURPLE,  "         REC");
					break;
				case DATASETTE_CONTROL_RESET:
					cellDbgFontPuts(0.80f, yPos, Emulator_GetFontSize(), PURPLE,  "         RESET");
					break;
				case DATASETTE_CONTROL_RESET_COUNTER:
					cellDbgFontPuts(0.80f, yPos, Emulator_GetFontSize(), PURPLE,  "         RESETCNT");
					break;
			}
		}
	}

	if (ui.display_speed)
	{
		cellDbgFontPrintf(0.09f, 0.92f, Emulator_GetFontSize(), PURPLE, "Speed = %f, FPS = %f, Warp = %s", ui.speed, ui.frame_rate, (ui.warp_enabled == 1) ? "On" : "Off");
	}

	cellDbgFontDraw();
}