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); }
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); }
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(); }
static void about_draw_const(void) { char buf[81]; if (status.current_page == PAGE_ABOUT) { /* redraw outer part */ draw_box(11,16, 68, 34, BOX_THIN | BOX_OUTER | BOX_FLAT_DARK); } if (status.flags & CLASSIC_MODE) { draw_box(25,25, 56, 30, BOX_THIN | BOX_OUTER | BOX_FLAT_DARK); draw_text("Sound Card Setup", 32, 26, 0, 2); if (strcasecmp(song_audio_driver(), "dummy") == 0) { draw_text("No sound card detected", 29, 28, 0, 2); } else { switch (fake_driver) { case 0: draw_text("Sound Blaster 16 detected", 26, 28, 0, 2); draw_text("Port 220h, IRQ 7, DMA 5", 26, 29, 0, 2); break; case 1: /* FIXME: The GUS driver displays the memory settings a bit differently from the SB. If we're "supporting" it, we should probably keep the rest of the UI consistent with our choice. (Also: no love for the AWE cards?) Alternately, it would be totally awesome to probe the system for the actual name and parameters of the card in use :) */ draw_text("Gravis UltraSound detected", 26, 28, 0, 2); draw_text("Port 240h, IRQ 5, 1024k RAM", 26, 29, 0, 2); break; }; } } else { snprintf(buf, 80, "Using %s on %s", song_audio_driver(), video_driver_name()); buf[80] = 0; draw_text(buf, (80 - strlen(buf)) / 2, 25, 0, 2); /* build date? */ draw_text(ver_short_copyright, 15, 27, 1, 2); draw_text(ver_short_based_on, 15, 28, 1, 2); /* XXX if we allow key remapping, need to reflect the *real* help key here */ draw_text("Press F1 for copyright and full credits", 15, 29, 1, 2); } vgamem_ovl_apply(&logo_image); }