Ejemplo n.º 1
0
void draw_sample_data(struct vgamem_overlay *r, song_sample_t *sample)
{
        vgamem_ovl_clear(r, 0);

        if (sample->flags & CHN_ADLIB) {
            vgamem_ovl_clear(r, 2);
            vgamem_ovl_apply(r);
                char buf1[32], buf2[32];

                int y1 = r->y1, y2 = y1+3;

                draw_box(59,y1, 77,y2, BOX_THICK | BOX_INNER | BOX_INSET); // data
                draw_box(54,y1, 58,y2, BOX_THIN | BOX_INNER | BOX_OUTSET); // button
                draw_text_len("Mod", 3, 55,y1+1, 0,2);
                draw_text_len("Car", 3, 55,y1+2, 0,2);

                sprintf(buf1, "%02X %02X %02X %02X %02X %02X", // length:6*3-1=17
                        sample->adlib_bytes[0],
                        sample->adlib_bytes[2],
                        sample->adlib_bytes[4],
                        sample->adlib_bytes[6],
                        sample->adlib_bytes[8],
                        sample->adlib_bytes[10]);
                sprintf(buf2, "%02X %02X %02X %02X %02X",      // length: 5*3-1=14
                        sample->adlib_bytes[1],
                        sample->adlib_bytes[3],
                        sample->adlib_bytes[5],
                        sample->adlib_bytes[7],
                        sample->adlib_bytes[9]);
                draw_text_len(buf1, 17, 60,y1+1, 2,0);
                draw_text_len(buf2, 17, 60,y1+2, 2,0);
                return;
        }

        if (!sample->length || !sample->data) {
                vgamem_ovl_apply(r);
                return;
        }

        /* do the actual drawing */
        int chans = sample->flags & CHN_STEREO ? 2 : 1;
        if (sample->flags & CHN_16BIT)
                _draw_sample_data_16(r, (signed short *) sample->data,
                                sample->length * chans,
                                chans, chans);
        else
                _draw_sample_data_8(r, sample->data,
                                sample->length * chans,
                                chans, chans);

        if ((status.flags & CLASSIC_MODE) == 0)
                _draw_sample_play_marks(r, sample);
        _draw_sample_loop(r, sample);
        _draw_sample_susloop(r, sample);
        vgamem_ovl_apply(r);
}
Ejemplo n.º 2
0
void draw_sample_data_rect_8(struct vgamem_overlay *r, signed char *data,
        int length, unsigned int inputchans, unsigned int outputchans)
{
        vgamem_ovl_clear(r, 0);
        _draw_sample_data_8(r, data, length, inputchans, outputchans);
        vgamem_ovl_apply(r);
}
Ejemplo n.º 3
0
static void vis_fft(void)
{
	int i, y;
	/*this is the size of vis_overlay.width*/
	unsigned char outfft[120];

	if (_vis_virgin) {
		vgamem_ovl_alloc(&vis_overlay);
		_vis_virgin = 0;
	}
	_draw_vis_box();
	song_lock_audio();

	vgamem_ovl_clear(&vis_overlay,0);
	_get_columns_from_fft(outfft,current_fft_data);
	for (i = 0; i < 120; i++) {
		y = outfft[i];
		/*reduce range */
		y >>= 3;
		if (y > 15) y = 15;
		if (y > 0) {
		       vgamem_ovl_drawline(&vis_overlay,i,15-y,i,15,5);
		}
	}
	vgamem_ovl_apply(&vis_overlay);

	song_unlock_audio();
}
Ejemplo n.º 4
0
void show_about(void)
{
        static int didit = 0;
        struct dialog *d;
        unsigned char *p;
        int x, y;

        fake_driver = (rand() & 3) ? 0 : 1;

        if (!didit) {
                vgamem_ovl_alloc(&logo_image);
                it_logo = xpmdata(_logo_it_xpm);
                schism_logo = xpmdata(_logo_schism_xpm);
                didit=1;
        }

        if (status.flags & CLASSIC_MODE) {
                p = it_logo ? it_logo->pixels : NULL;
        } else {
                p = schism_logo ? schism_logo->pixels : NULL;
        }

        /* this is currently pretty gross */
        vgamem_ovl_clear(&logo_image, 2);
        if (p) {
                int c = (status.flags & CLASSIC_MODE) ? 11 : 0;
                for (y = 0; y < LOGO_HEIGHT; y++) {
                        for (x = 0; x < LOGO_WIDTH; x++) {
                                if (p[x]) {
                                        vgamem_ovl_drawpixel(&logo_image, x+2, y+6, c);
                                }
                        }
                        vgamem_ovl_drawpixel(&logo_image, x, y+6, 2);
                        vgamem_ovl_drawpixel(&logo_image, x+1, y+6, 2);
                        p += LOGO_PITCH;
                }
        }

        create_button(widgets_about + 0,
                        33,32,
                        12,
                        0,0,0,0,0,
                        dialog_yes_NULL, "Continue", 3);
        d = dialog_create_custom(11,16,
                        58, 19,
                        widgets_about, 1, 0,
                        about_draw_const, NULL);
        d->action_yes = about_close;
        d->action_no = about_close;
        d->action_cancel = about_close;

        /* okay, in just a moment, we're going to the module page.
         * if your modules dir is large enough, this causes an annoying pause.
         * to defeat this, we start scanning *NOW*. this makes startup "feel"
         * faster.
         */
        status.flags |= DIR_MODULES_CHANGED;
        pages[PAGE_LOAD_MODULE].set_page();
}