repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
rzf45/98fmplayer | win32/wavewrite.c | <gh_stars>10-100
#include "wavewrite.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
struct wavefile {
HANDLE file;
uint32_t written_frames;
};
static void write16le(uint8_t *ptr, uint16_t data) {
ptr[0] = data;
ptr[1] = data >> 8;
}
static void write32le(uint8_t *... |
rzf45/98fmplayer | soundout/soundout.c | <reponame>rzf45/98fmplayer
#include "soundout.h"
#include "jackout.h"
#include "pulseout.h"
#include "alsaout.h"
struct sound_state *sound_init(const char *clientname, unsigned srate, sound_callback cbfunc, void *userptr) {
struct sound_state *ss = 0;
#ifdef ENABLE_JACK
ss = jackout_init(clientname, srate, cbfunc,... |
rzf45/98fmplayer | fmdriver/ppz8.c | <reponame>rzf45/98fmplayer<filename>fmdriver/ppz8.c
#include "ppz8.h"
#include "fmdriver_common.h"
#include <string.h>
#include "ppz8-sinctable.inc"
unsigned ppz8_get_mask(const struct ppz8 *ppz8) {
return ppz8->mask;
}
void ppz8_set_mask(struct ppz8 *ppz8, unsigned mask) {
ppz8->mask = mask & 0xffu;
}
void ppz8_... |
rzf45/98fmplayer | tonedata/tonedata.h | #ifndef MYON_FMPLAYER_TONEDATA_H_INCLUDED
#define MYON_FMPLAYER_TONEDATA_H_INCLUDED
#include <stdint.h>
#include <stdbool.h>
struct fmplayer_tonedata {
struct fmplayer_tonedata_channel {
struct fmplayer_tonedata_slot {
uint8_t ar;
uint8_t dr;
uint8_t sr;
uint8_t rr;
uint8_t sl;
... |
rzf45/98fmplayer | libopna/opna.h | <gh_stars>10-100
#ifndef LIBOPNA_OPNA_H_INCLUDED
#define LIBOPNA_OPNA_H_INCLUDED
#include "opnafm.h"
#include "opnassg.h"
#include "opnadrum.h"
#include "opnaadpcm.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
LIBOPNA_CHAN_FM_1 = 0x0001,
LIBOPNA_CHAN_FM_2 = 0x0002,
LIBOPNA_CHAN_FM_3 = 0x0004,
LIBOPNA_CHAN... |
rzf45/98fmplayer | gtk/toneview.h | <filename>gtk/toneview.h
#ifndef MYON_FMPLAYER_GTK_TONEVIEW_H_INCLUDED
#define MYON_FMPLAYER_GTK_TONEVIEW_H_INCLUDED
#include "tonedata/tonedata.h"
#include <stdatomic.h>
extern struct toneview_g {
struct fmplayer_tonedata tonedata;
atomic_flag flag;
} toneview_g;
void show_toneview(void);
#endif // MYON_FMPLAY... |
rzf45/98fmplayer | common/fmplayer_fontrom_unix.c | #include "fmplayer_fontrom.h"
#include "fmdsp/font.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "fmdsp/fontrom_shinonome.inc"
#define DATADIR "/.local/share/98fmplayer/"
static struct {
uint8_t fontrombuf[FONT_ROM_FILESIZE];
} g;
bool fmplayer_font_rom_load(struct fmd... |
rzf45/98fmplayer | gtk/oscilloview.c | #include <gtk/gtk.h>
#include <cairo.h>
#include "oscilloview.h"
#include <string.h>
struct oscilloview oscilloview_g = {
.flag = ATOMIC_FLAG_INIT
};
enum {
VIEW_SAMPLES = 1024,
VIEW_SKIP = 2,
};
static struct {
GtkWidget *win;
struct oscillodata oscillodata[LIBOPNA_OSCILLO_TRACK_COUNT];
} g;
static void ... |
rzf45/98fmplayer | win32/guid.c | #include <rpc.h>
const CLSID CLSID_DirectSound8 = {
0x3901cc3f,
0x84b5,
0x4fa4,
{
0xba, 0x35,
0xaa,
0x81,
0x72,
0xb8,
0xa0,
0x9b
}
};
const IID IID_IDirectSound8 = {
0xc50a7e93,
0xf395,
0x4834,
{
0x9e, 0xf6,
0x7f,
0xa9,
0x9d,
0xe5,
0x09,
0x66
... |
rzf45/98fmplayer | common/fmplayer_file.c | #include "common/fmplayer_file.h"
#include <string.h>
#include <stdlib.h>
void fmplayer_file_free(const struct fmplayer_file *fmfileptr) {
struct fmplayer_file *fmfile = (struct fmplayer_file *)fmfileptr;
if (!fmfile) return;
free((void *)fmfile->filename_sjis);
free(fmfile->path);
free(fmfile->buf);
free(... |
rzf45/98fmplayer | win32/wasapiout.h | #ifndef MYON_WASAPIOUT_H_INCLUDED
#define MYON_WASAPIOUT_H_INCLUDED
#include "soundout.h"
struct sound_state *wasapi_init(HWND hwnd, unsigned srate, unsigned sectlen,
sound_callback cbfunc, void *userptr);
#endif // MYON_WASAPIOUT_H_INCLUDED
|
rzf45/98fmplayer | fft/fft.c | #include "fft.h"
#include <math.h>
#include <string.h>
void fft_write(struct fmplayer_fft_data *data, const int16_t *buf, unsigned len) {
if (len > FFTLEN) {
unsigned discard = len - FFTLEN;
buf += discard*2;
len = FFTLEN;
}
unsigned towrite = FFTLEN - data->ind;
if (towrite > len) towrite = len;
... |
rzf45/98fmplayer | libopna/opnassg.h | #ifndef LIBOPNA_OPNASSG_H_INCLUDED
#define LIBOPNA_OPNASSG_H_INCLUDED
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#ifdef LIBOPNA_ENABLE_LEVELDATA
#include "leveldata/leveldata.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define OPNA_SSG_SINCTABLEBIT 7
#define OPNA_SSG_SINCTABLELEN (1<<OPNA_SSG_... |
rzf45/98fmplayer | libopna/opnatimer.c | #include "opnatimer.h"
#include "opna.h"
#include "oscillo/oscillo.h"
enum {
TIMERA_BITS = 10,
TIMERB_SHIFT = 4,
TIMERB_BITS = 8 + TIMERB_SHIFT,
};
void opna_timer_reset(struct opna_timer *timer, struct opna *opna) {
timer->opna = opna;
timer->status = 0;
timer->interrupt_cb = 0;
timer->interrupt_userpt... |
rzf45/98fmplayer | fft/fftwindow.h | <reponame>rzf45/98fmplayer
static const uint16_t window[8192] = {
5242, 5242, 5242, 5242, 5243, 5243, 5243, 5243,
5243, 5243, 5243, 5243, 5244, 5244, 5244, 5244,
5245, 5245, 5245, 5246, 5246, 5246, 5247, 5247,
5247, 5248, 5248, 5249, 5249, 5250, 5250, 5251,
5251, 5252, 5253,... |
rzf45/98fmplayer | version.h | <filename>version.h<gh_stars>10-100
#ifndef MYON_FMPLAYER_VERSION_H_INCLUDED
#define MYON_FMPLAYER_VERSION_H_INCLUDED
#define FMPLAYER_VERSION_0 "0"
#define FMPLAYER_VERSION_1 "1"
#define FMPLAYER_VERSION_2 "14"
#define FMPLAYER_VERSION_STR FMPLAYER_VERSION_0 "." FMPLAYER_VERSION_1 "." FMPLAYER_VERSION_2
#endif // M... |
rzf45/98fmplayer | common/fmplayer_file_unix.c |
#define _POSIX_C_SOURCE 200809l
#include "common/fmplayer_file.h"
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
#include <strings.h>
#include <iconv.h>
#ifdef __APPLE__
#include <xlocale.h>
#else
#include <locale.h>
#endif
#include <langinfo.h>
static void *fileread(const char *path, ... |
rzf45/98fmplayer | win32/waveout.h | <reponame>rzf45/98fmplayer
#ifndef MYON_WAVEOUT_H_INCLUDED
#define MYON_WAVEOUT_H_INCLUDED
#include "soundout.h"
struct sound_state *waveout_init(HWND hwnd, unsigned srate, unsigned sectlen,
sound_callback cbfunc, void *userptr);
#endif // MYON_WAVEOUT_H_INCLUDED
|
rzf45/98fmplayer | common/fmplayer_drumrom_win.c | #include "fmplayer_drumrom.h"
#include "libopna/opnadrum.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shlwapi.h>
#include <wchar.h>
static struct {
char drum_rom[OPNA_ROM_SIZE];
bool loaded;
} g;
static void loadrom(void) {
const wchar_t *path = L"ym2608_adpcm_rom.bin";
wchar_t exepath[MAX_PAT... |
rzf45/98fmplayer | fmdriver/fmdriver_pmd.c | <filename>fmdriver/fmdriver_pmd.c
#include "fmdriver_pmd.h"
#include "fmdriver_common.h"
#include <stddef.h>
#include <string.h>
enum {
SSG_ENV_STATE_OLD_AL,
SSG_ENV_STATE_OLD_SR,
SSG_ENV_STATE_OLD_RR,
SSG_ENV_STATE_OLD_OFF,
SSG_ENV_STATE_OLD_NEW = 0xff
};
enum {
SSG_ENV_STATE_NEW_OFF,
SSG_ENV_STATE_NEW... |
rzf45/98fmplayer | fmdsp/fmdsp-vramlookup-c.c | <filename>fmdsp/fmdsp-vramlookup-c.c
#include "fmdsp/fmdsp.h"
void fmdsp_vramlookup_c(uint8_t *vram32, const uint8_t *vram, const uint8_t *palette, int stride) {
uint32_t palette32[FMDSP_PALETTE_COLORS];
for (int i = 0; i < FMDSP_PALETTE_COLORS; i++) {
uint8_t r = palette[i*3+0];
uint8_t g = palette[i*3+1]... |
rzf45/98fmplayer | libopna/opnassg-sinc-sse2.c | #include "libopna/opnassg.h"
#include <emmintrin.h>
void opna_ssg_sinc_calc_sse2(unsigned resampler_index, const int16_t *inbuf, int32_t *outbuf) {
inbuf += (resampler_index >> 1) * 4;
const int16_t *sinctable = opna_ssg_sinctable;
if (!(resampler_index & 1u)) sinctable += OPNA_SSG_SINCTABLELEN;
__m128i outacc... |
rzf45/98fmplayer | win32/wasapiout.c | #include "wasapiout.h"
//#include "srcloader.h"
#include <windows.h>
#include <mmdeviceapi.h>
#include <audioclient.h>
enum {
SRCBUFFRAMES = 256,
};
struct wasapi_state {
struct sound_state soundout;
IAudioClient *ac;
IAudioRenderClient *rc;
HANDLE t_update;
HANDLE e_update;
HANDLE mtx_cbproc;
sound_c... |
rzf45/98fmplayer | win32/dsoundout.c | #include "dsoundout.h"
#include <windows.h>
#include <dsound.h>
struct dsound_state {
struct sound_state soundout;
IDirectSound8 *ds;
DWORD sectlen;
IDirectSoundBuffer *dsbuf;
HANDLE e_posnotf;
HANDLE t_update;
DWORD terminate;
DWORD currsect;
DWORD playing;
HANDLE mtx_cbproc;
sound_callback cbfu... |
rzf45/98fmplayer | libopna/opnadrum.c | <filename>libopna/opnadrum.c
#include "opnadrum.h"
static const uint16_t steps[49] = {
16, 17, 19, 21, 23, 25, 28,
31, 34, 37, 41, 45, 50, 55,
60, 66, 73, 80, 88, 97, 107,
118, 130, 143, 157, 173, 190, 209,
230, 253, 279, 307, 337, 371, 408,
449, 494, 544, 598, ... |
rzf45/98fmplayer | common/winfont.c | <reponame>rzf45/98fmplayer
#include "winfont.h"
#include <windows.h>
struct font_win32 {
HFONT font;
HDC dc;
HBITMAP bitmap;
HBRUSH white;
HBRUSH black;
uint8_t *data;
uint8_t buf[16];
};
/*
#include "jisunih.h"
uint16_t jis2unih(uint8_t jis) {
if (jis & 0x80) {
const uint16_t *tab = jis2unicode_... |
rzf45/98fmplayer | common/fmplayer_fontrom.h | #ifndef MYON_FMPLAYER_FONTROM_H_INCLUDED
#define MYON_FMPLAYER_FONTROM_H_INCLUDED
#include <stdbool.h>
struct fmdsp_font;
// true if font rom available, false if using alternatives
bool fmplayer_font_rom_load(struct fmdsp_font *font);
#endif // MYON_FMPLAYER_FONTROM_H_INCLUDED
|
rzf45/98fmplayer | gtk/oscilloview.h | #ifndef MYON_FMPLAYER_GTK_OSCILLOVIEW_H_INCLUDED
#define MYON_FMPLAYER_GTK_OSCILLOVIEW_H_INCLUDED
#include "libopna/opna.h"
#include "oscillo/oscillo.h"
#include <stdatomic.h>
extern struct oscilloview {
atomic_flag flag;
struct oscillodata oscillodata[LIBOPNA_OSCILLO_TRACK_COUNT];
} oscilloview_g;
void show_os... |
rzf45/98fmplayer | soundout/pulseout.c | #include "pulseout.h"
#include <stdbool.h>
#include <stdlib.h>
#include <pulse/thread-mainloop.h>
#include <pulse/stream.h>
struct pulseout_state {
struct sound_state ss;
bool paused;
bool flush;
unsigned srate;
sound_callback cbfunc;
void *userptr;
pa_threaded_mainloop *pa_tm;
pa_context *pa_c;
pa_... |
rzf45/98fmplayer | soundout/jackout.c | <reponame>rzf45/98fmplayer<filename>soundout/jackout.c<gh_stars>10-100
#include "jackout.h"
#include <stdbool.h>
#include <stdlib.h>
#include <jack/jack.h>
#include <soxr.h>
typedef jack_default_audio_sample_t sample_t;
enum {
RFRAMES = 1024,
JFRAMES = 2048,
};
struct jackout_state {
struct sound_state ss;
... |
rzf45/98fmplayer | libopna/opnatables.h | #define LOGSINTABLEBIT 8
#define LOGSINTABLELEN (1<<LOGSINTABLEBIT)
// round(-256.0*log2((sin((2*i+1)*PI/1024.0))))
static const uint16_t logsintable[LOGSINTABLELEN] = {
2137, 1731, 1543, 1419, 1326, 1252, 1190, 1137,
1091, 1050, 1013, 979, 949, 920, 894, 869,
846, 825, 804, 785, 767, 749, 732, 717,
... |
rzf45/98fmplayer | common/fmplayer_drumrom_unix.c | #include "fmplayer_drumrom.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libopna/opnadrum.h"
static struct {
uint8_t drum_rom[OPNA_ROM_SIZE];
bool loaded;
} g;
#define DATADIR "/.local/share/98fmplayer/"
static void loadfile(void) {
const char *path = "ym2608_adpcm_rom.bin";
const c... |
rzf45/98fmplayer | libopna/opnadrum.h | <reponame>rzf45/98fmplayer<filename>libopna/opnadrum.h<gh_stars>10-100
#ifndef LIBOPNA_OPNADRUM_H_INCLUDED
#define LIBOPNA_OPNADRUM_H_INCLUDED
#include <stdint.h>
#include <stdbool.h>
#ifdef LIBOPNA_ENABLE_LEVELDATA
#include "leveldata/leveldata.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define OPNA_ROM_BD_ST... |
rzf45/98fmplayer | win32/wavesave.c | <filename>win32/wavesave.c<gh_stars>10-100
#include "wavesave.h"
#include <commdlg.h>
#include <stdint.h>
#include "common/fmplayer_file.h"
#include "common/fmplayer_common.h"
#include "libopna/opnatimer.h"
#include "libopna/opna.h"
#include "wavewrite.h"
#include <stdlib.h>
#include <windowsx.h>
#include <commctrl.h>
... |
rzf45/98fmplayer | fmdsp/fmdsp_platform_mach.c | #include "fmdsp_platform_info.h"
#include <mach/mach.h>
#include <mach/clock.h>
#include <sys/times.h>
#include <stdbool.h>
#include <limits.h>
static struct {
clock_t lastall;
clock_t lastcpu;
mach_timespec_t lasttimespec;
bool clock_initialized;
clock_serv_t clock;
} g;
int fmdsp_cpu_usage(void) {
struc... |
rzf45/98fmplayer | win32/configdialog.c | <gh_stars>10-100
#include "configdialog.h"
#include <windowsx.h>
#include <commctrl.h>
#include <math.h>
#include <wchar.h>
#include <stdlib.h>
static double mix_to_db(uint32_t mix) {
return 20.0 * log10((double)mix / 0x10000);
}
static uint32_t db_to_mix(double db) {
return round(pow(10.0, db / 20.0) * 0x10000);... |
rzf45/98fmplayer | gtk/configdialog.h | #ifndef MYON_FMPLAYER_GTK_CONFIGDIALOG_H
#define MYON_FMPLAYER_GTK_CONFIGDIALOG_H
#include <gtk/gtk.h>
#include "libopna/opna.h"
#include "fmdriver/ppz8.h"
extern struct fmplayer_config {
bool fm_hires_env;
bool fm_hires_sin;
bool ssg_ymf288;
uint32_t ssg_mix;
enum ppz8_interp ppz8_interp;
} fmplayer_config... |
rzf45/98fmplayer | libopna/opnafm.c | <reponame>rzf45/98fmplayer<gh_stars>10-100
#include "opnafm.h"
#ifdef LIBOPNA_ENABLE_OSCILLO
#include "oscillo/oscillo.h"
#endif
#include "opnatables.h"
#if 1
#define LIBOPNA_DEBUG(...)
#else
#include <stdio.h>
#define LIBOPNA_DEBUG(...) fprintf(stderr, __VA_ARGS__)
#endif
//#define LIBOPNA_ENABLE_HIRES_SIN
//#defin... |
rzf45/98fmplayer | libopna/opnassg.c | <reponame>rzf45/98fmplayer
#include "opnassg.h"
#ifdef LIBOPNA_ENABLE_OSCILLO
#include "oscillo/oscillo.h"
#endif
// if (i < 2) voltable[i] = 0;
// else voltable[i] = round((0x7fff / 3.0) * pow(2.0, (i - 31)/4.0));
/*
static const int16_t voltable[32] = {
0, 0, 72, 85,
101, 121, 144, 17... |
rzf45/98fmplayer | fmdsp/fmdsp_sprites.h | enum {
TRACK_H = 32,
TRACK_H_S = 24,
TNAME_W = 26,
TNAME_H = 5,
TINFO_X = 47,
TDETAIL_X = 67,
TDETAIL_KN_V_X = TDETAIL_X+13,
TDETAIL_TN_X = TDETAIL_KN_V_X+28,
TDETAIL_TN_V_X = TDETAIL_TN_X+13,
TDETAIL_VL_X = TDETAIL_TN_V_X+20,
TDETAIL_VL_C_X = TDETAIL_VL_X+9,
TDETAIL_VL_V_X = TDETAIL_VL_X+12,
... |
rzf45/98fmplayer | fmdsp/fmdsp.h | <reponame>rzf45/98fmplayer<gh_stars>10-100
#ifndef MYON_FMDSP_H_INCLUDED
#define MYON_FMDSP_H_INCLUDED
#include <stdint.h>
#include <stdbool.h>
#include "font.h"
#include "fmdriver/fmdriver.h"
#include "fft/fft.h"
#ifdef __cplusplus
extern "C" {
#endif
struct opna;
enum {
PC98_W = 640,
PC98_H = 400
};
enum {
... |
rzf45/98fmplayer | fmdsp/fmdsp.c | #include "fmdsp.h"
#include "fmdsp_sprites.h"
#include "font.h"
#include "fmdriver/fmdriver.h"
#include <stdio.h>
#include "libopna/opna.h"
#include "fmdsp_platform_info.h"
#include "version.h"
#include <math.h>
#include <string.h>
fmdsp_vramlookup_type fmdsp_vramlookup_func = fmdsp_vramlookup_c;
static void vramblit... |
rzf45/98fmplayer | pacc/pacc-win.h | #ifndef MYON_PACC_WIN_H_INCLUDED
#define MYON_PACC_WIN_H_INCLUDED
#include "pacc.h"
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <stdbool.h>
typedef void pacc_rendercb(void *ptr);
struct pacc_win_vtable {
void (*renderctrl)(struct pacc_ctx *ctx, bool enable);
};
st... |
rzf45/98fmplayer | win32/waveout.c | <reponame>rzf45/98fmplayer
#include "waveout.h"
enum {
HDRCNT = 4
};
struct waveout_state {
struct sound_state soundout;
HWAVEOUT wo;
HANDLE t_update;
HANDLE e_waveout;
HANDLE mtx_cbproc;
DWORD firstout;
DWORD paused;
DWORD terminate;
sound_callback cbfunc;
void *userptr;
WAVEHDR waveheaders[H... |
rzf45/98fmplayer | win32/oscilloview.c | <reponame>rzf45/98fmplayer
#include "oscilloview.h"
#include <mmsystem.h>
#include <shellapi.h>
#include <windowsx.h>
enum {
TIMER_UPDATE = 1
};
struct oscilloview oscilloview_g = {
.flag = ATOMIC_FLAG_INIT
};
enum {
VIEW_SAMPLES = 1024,
VIEW_SKIP = 2,
};
static struct {
HINSTANCE hinst;
HWND parent;
... |
rzf45/98fmplayer | win32/dsoundout.h | #ifndef MYON_DSOUNDOUT_H_INCLUDED
#define MYON_DSOUNDOUT_H_INCLUDED
#include "soundout.h"
struct sound_state *dsound_init(HWND hwnd, unsigned srate, unsigned sectlen,
sound_callback cbfunc, void *userptr);
#endif // MYON_DSOUNDOUT_H_INCLUDED
|
rzf45/98fmplayer | fmdriver/fmdriver_common.c | #include "fmdriver/fmdriver_common.h"
uint8_t fmdriver_fm_freq2key(uint16_t freq) {
int block = freq >> (8+3);
int f_num = freq & ((1<<(8+3))-1);
if (!f_num) return 0x00;
while (!(f_num & (1<<(8+3-1)))) {
f_num <<= 1;
block--;
}
static const uint16_t freqtab[0xc] = {
0x042e, // < 9 (a)
0x04... |
rzf45/98fmplayer | win32/toneview.c | #include "toneview.h"
#include <stdbool.h>
#include <windowsx.h>
enum {
TIMER_UPDATE = 1
};
enum {
ID_COPY0 = 0x10,
ID_COPY1,
ID_COPY2,
ID_COPY3,
ID_COPY4,
ID_COPY5,
ID_NORMALIZE,
ID_LIST,
};
struct toneview_g toneview_g = {
.flag = ATOMIC_FLAG_INIT
};
static struct {
HINSTANCE hinst;
HWND t... |
rzf45/98fmplayer | win32/toneview.h | #ifndef MYON_FMPLAYER_WIN32_TONEVIEW_H_INCLUDED
#define MYON_FMPLAYER_WIN32_TONEVIEW_H_INCLUDED
#include "tonedata/tonedata.h"
#include <stdatomic.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern struct toneview_g {
struct fmplayer_tonedata tonedata;
atomic_flag flag;
} toneview_g;
void toneview_open(H... |
rzf45/98fmplayer | pacc/pacc-gl.c | <reponame>rzf45/98fmplayer
#include "pacc-gl.h"
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "pacc-gl-inc.h"
#ifdef NDEBUG
#define DPRINTF(fmt, ...)
#else
#include <stdio.h>
#define DPRINTF(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
#endif
/*
OpenGL versions:
OpenGL 2.0 / GLSL 1.10
... |
rzf45/98fmplayer | libopna/opnaadpcm.c | <gh_stars>10-100
#include "opnaadpcm.h"
enum {
C1_START = 0x80,
C1_REC = 0x40,
C1_MEMEXT = 0x20,
C1_REPEAT = 0x10,
C1_RESET = 0x01,
C1_MASK = 0xf9,
};
enum {
C2_L = 0x80,
C2_R = 0x40,
C2_8BIT = 0x02,
C2_MASK = 0xcf,
};
static const uint8_t adpcm_table[8] = {
57, 57, 57, 57, 77, 102, 128, 153,
}... |
rzf45/98fmplayer | fmdriver/fmdriver_fmp.c | #include "fmdriver_fmp.h"
#include "fmdriver_common.h"
#include <string.h>
static uint8_t fmp_rand71(struct driver_fmp *fmp) {
// on real PC-98, read from I/O port 0x71 (8253 Timer)
uint8_t val = fmp->rand71;
fmp->rand71 = (val>>1) | ((((val>>7)^(val>>5)^(val>>4)^(val>>3)^1)&1)<<7);
return fmp->rand71;... |
rzf45/98fmplayer | fft/fft.h | #ifndef MYON_FMPLAYER_FFT_FFT_H_INCLUDED
#define MYON_FMPLAYER_FFT_FFT_H_INCLUDED
#include <stdint.h>
enum {
FFTLEN = 8192,
FFTDISPLEN = 70,
};
struct fmplayer_fft_data {
int16_t buf[FFTLEN];
unsigned ind;
};
struct fmplayer_fft_input_data {
struct fmplayer_fft_data fdata;
int16_t work[FFTLEN];
double... |
rzf45/98fmplayer | fmdriver/pmd_ssgeff.h | enum {
PMD_SSGEFF_CNT = 0x28
};
// 0x00: 0x01: 0x0078
static const struct pmd_ssgeff_data pmd_ssgeff_00[] = {
{0x01, 0x05dc, 0x1f, true, true, 0x0f, 0x0000, 0x00, 127, 0, 0},
{0x08, 0x06a4, 0x00, true, false, 0x10, 0x04b0, 0x00, 127, 0, 0},
{0xff, 0x0000, 0x00, false, false, 0x00, 0x0000, 0x00, 0... |
rzf45/98fmplayer | soundout/pulseout.h | #ifndef MYON_PULSEOUT_H_INCLUDED
#define MYON_PULSEOUT_H_INCLUDED
#include "soundout.h"
struct sound_state *pulseout_init(const char *clientname, unsigned srate, sound_callback cbfunc, void *userptr);
#endif // MYON_PULSEOUT_H_INCLUDED
|
rzf45/98fmplayer | tonedata/tonedata.c | <gh_stars>10-100
#include "tonedata.h"
#include "libopna/opna.h"
#include <stdio.h>
void tonedata_from_opna(
struct fmplayer_tonedata *tonedata,
const struct opna *opna
) {
const struct opna_fm *fm = &opna->fm;
for (int c = 0; c < 6; c++) {
const struct opna_fm_channel *op_ch = &fm->channel[c];
struct f... |
rzf45/98fmplayer | gtk/configdialog.c | #include "configdialog.h"
#include <math.h>
static double mix_to_db(uint32_t mix) {
return 20.0 * log10((double)mix / 0x10000);
}
static uint32_t db_to_mix(double db) {
return round(pow(10.0, db / 20.0) * 0x10000);
}
static struct {
GtkWidget *configwin;
config_update_func *func;
void *ptr;
GtkWidget *ra... |
rzf45/98fmplayer | libopna/opnafm.h | <gh_stars>10-100
#ifndef LIBOPNA_OPNAFM_H_INCLUDED
#define LIBOPNA_OPNAFM_H_INCLUDED
#include <stdint.h>
#include <stdbool.h>
#ifdef LIBOPNA_ENABLE_LEVELDATA
#include "leveldata/leveldata.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define LIBOPNA_FM_ENV_MAX 1023
enum {
ENV_ATTACK,
ENV_DECAY,
ENV_SUSTAIN,... |
rzf45/98fmplayer | win32/wavesave.h | #ifndef MYON_FMPLAYER_WIN32_WAVESAVE_H_INCLUDED
#define MYON_FMPLAYER_WIN32_WAVESAVE_H_INCLUDED
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
void wavesave_dialog(HWND parent, const wchar_t *fmpath);
#endif // MYON_FMPLAYER_WIN32_WAVESAVE_H_INCLUDED
|
rain-kun/competitive | temp.c | <reponame>rain-kun/competitive<gh_stars>0
#include <stdio.h>
#include <math.h>
// #define mod 1000000007
#define ll long long
#define rep(i,n) for (i = 0; i < n; ++i)
// #define REPA(i,k,n) for (i = k; i <= n; ++i)
// #define REPR(i,k,n) for (i = k; i >= n; --i)
int main() {
ll n,q;
scanf("%lld %lld",... |
Marcopt98/Cacher | Sources/Cacher/Cacher.h | <filename>Sources/Cacher/Cacher.h
//
// Cacher.h
// Cacher
//
// Created by <NAME> on 2017-07-08.
// Copyright © 2017 <NAME>. All rights reserved.
//
@import Foundation;
//! Project version number for Cacher.
FOUNDATION_EXPORT double CacherVersionNumber;
//! Project version string for Cacher.
FOUNDATION_EXPORT c... |
mirogon/M1_Spacewar_Server | src/Global.h | <filename>src/Global.h<gh_stars>0
#pragma once
#include <iostream>
#include <stdlib.h>
#include <vector>
#include <boost\thread.hpp>
#include <SDL.h>
#include <SDL_net.h>
#include <thread>
#include <M1Timer.h>
#include <M1Random.h>
/*
playerIndex 0 = first Client 1 = second Client
*/
extern bool gameEnded;
extern c... |
mirogon/M1_Spacewar_Server | src/C_M1_Spacewar_Server.h | #pragma once
#include "Global.h"
class C_M1_Spacewar_Server
{
public:
C_M1_Spacewar_Server();
~C_M1_Spacewar_Server() = default;
//Wait for the clients to register
unsigned short RegisterClients();
//Send the game start time to the clients
void SendStartTime();
void Reset();
void Start();
void Stop();
... |
cancerberoSgx/magica | apps/node-gtk-tests/test/probes/mouse_events.c | /* alpha blended rubber band using canvas, demonstrating mouse intercation
*
* only things that are new compared to hello.c are commented
*/
#include <gtk/gtk.h>
#include <cairo.h>
#define DEFAULT_WIDTH 400
#define DEFAULT_HEIGHT 200
/* a structure keeping information about
* the selection */
typedef struct
{... |
cancerberoSgx/magica | apps/node-gtk-tests/test/probes/hello.c | /* hello world for gtk with cairo support, by <NAME>
*/
#include <gtk/gtk.h>
#include <cairo.h>
#define DEFAULT_WIDTH 400
#define DEFAULT_HEIGHT 200
/* forward definition of actual painting function for our drawing area widget
*/
static void paint (GtkWidget *widget,
GdkEventExpose *eev,
... |
try1117/DES | DES/Utils.h | <filename>DES/Utils.h<gh_stars>0
#pragma once
#include <string>
#include <vector>
bool EqualFiles(std::string in1, std::string in2);
template<class ArgType, class ResType>
ResType ApplyPermutation(ArgType arg, std::vector<std::vector<int>> &perm)
{
ResType res = 0;
for (int i = 0; i < perm.size(); ++i)
for (int j... |
try1117/DES | DES/Cipher.h | #pragma once
#include <bitset>
#include <vector>
#include <map>
typedef std::bitset<4> int4;
typedef std::bitset<6> int6;
typedef std::bitset<8> int8;
typedef std::bitset<28> int28;
typedef std::bitset<32> int32;
typedef std::bitset<48> int48;
typedef std::bitset<56> int56;
typedef std::bitset<64> int64;
int64 Enc... |
CachyOS/fastfetch | tests/performance.c | <filename>tests/performance.c
#include "fastfetch.h"
#include <time.h>
#define FASTFETCH_TEST_PERFORMANCE(func) \
{ \
struct timespec start, end; \
clock_gettime(CLOCK_REALTIME, &start); \
func; \
clock_gettime(CLOCK_REALTIME, &end); \
long nanos = end.tv_nsec - start.tv_ns... |
CachyOS/fastfetch | src/modules/localip.c | <gh_stars>0
#include "fastfetch.h"
#define FF_LOCALIP_MODULE_NAME "Local IP"
#define FF_LOCALIP_NUM_FORMAT_ARGS 1
#include <sys/types.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <string.h>
#include <arpa/inet.h>
static void printValue(FFinstance* instance, const char* ifaName, const char* addressBuffer)... |
stojanov/fractal-drawer | src/Mandelbrot/Mandelbrot.h | <gh_stars>0
#ifndef MANDELBROT_H
#define MANDELBROT_H
#include "SFML/Graphics.hpp"
#include "PixelStore.h"
class Mandelbrot
{
private:
int m_width;
int m_height;
PixelStore<sf::Uint8>* m_store;
static int s_MAX_ITERATIONS;
static int s_THREADS;
static int iterations(int, int, int, int);
... |
stojanov/fractal-drawer | src/Mandelbrot/PixelStore.h | #ifndef PIXEL_STORE_H
#define PIXEL_STORE_H
#include <iostream>
template<typename pixelType>
class PixelStore
{
private:
int m_pixelSize;
int m_width;
int m_height;
pixelType *m_data{nullptr};
public:
PixelStore(int pixelSize, int width, int height)
: m_pixelSize(pixelSize),
... |
souzafcharles/Data-Structure | Class_F6_Graphs/Example_Graphs.c | <reponame>souzafcharles/Data-Structure
/*
Class title: Data Structure
Lecturer: Prof. Dr. <NAME>
Example adapted by: <NAME>
Date: October 26, 2021
*/
#include<stdio.h>
#include <stdlib.h>
typedef struct No {
int v;
struct No *prox;
} No;
typedef struct {
No **adjacencia;
int n;
} Grafo;
void inicia_... |
souzafcharles/Data-Structure | Class_A1_Stack_Queue/Example_Queue.c | <reponame>souzafcharles/Data-Structure
/*
Class title: Data Structure
Lecturer: Prof. Dr. <NAME>
Example adapted by: <NAME>
Date: August 10, 2021
*/
#include <stdio.h>
#include <stdlib.h>
struct QUEUE {
int queueCapacity;
float *data;
int first;
int last;
int numeroItems;
};
void createQueue(stru... |
souzafcharles/Data-Structure | Class_E5_Binary_Search_Tree/Example_Binary_Search_Tree.c | <reponame>souzafcharles/Data-Structure<filename>Class_E5_Binary_Search_Tree/Example_Binary_Search_Tree.c
/*
Class title: Data Structure
Lecturer: Prof. Dr. <NAME>
Wagner Gaspar's Example adapted by: <NAME>
Date: September 28, 2021
*/
#include<stdio.h>
#include <stdlib.h>
typedef struct no{
int valor;
struct no... |
souzafcharles/Data-Structure | EAD_AsynchronousContent_AVL_tree/main.c | #include <stdio.h>
#include <stdlib.h>
#include "ArvoreAVL.h"
int main(){
ArvAVL* avl;
int res,i;
int N = 10, dados[10] = {1,2,3,10,4,5,9,7,8,6}; //busca a chave 10
avl = cria_ArvAVL(); //chamada da função para criação da árvore
for(i=0;i<N;i++){
printf("========================\n");
... |
souzafcharles/Data-Structure | Class_D4_Linked_List/Example_LinkedList.c | <filename>Class_D4_Linked_List/Example_LinkedList.c
/*
Class title: Data Structure
Lecturer: Prof. Dr. <NAME>
Example adapted by: <NAME>
Date: August 31, 2021
*/
#include <stdio.h>
#include <stdlib.h>
struct NoDuplo {
int informacao;
struct NoDuplo *anterior;
struct NoDuplo *proximo;
};
typedef struct NoD... |
souzafcharles/Data-Structure | Subjectwork_Part_01/Subjectwork_Part_01.c | <reponame>souzafcharles/Data-Structure
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#include <time.h>
//Structs para as estruturas das musicas ------------------------------------------------------------------
typedef struct musica {//Estrutura para o tipo de dado musica (equivalante ... |
souzafcharles/Data-Structure | Subjectwork_Part_02/Subjectwork_Part_02.c | <filename>Subjectwork_Part_02/Subjectwork_Part_02.c
#include <stdio.h>
#include <stdlib.h>
#define NUM_PESSOAS 7
//------------------------------------- ÁRVORE AVL -------------------------------------
typedef struct pessoa {
int id;
char CPF[12];
char nome[200];
char sobrenome[200];
} pessoa;
typedef struct no{
... |
souzafcharles/Data-Structure | EAD_AsynchronousContent_AVL_tree/ArvoreAVL.h | <reponame>souzafcharles/Data-Structure<gh_stars>0
typedef struct NO* ArvAVL;
ArvAVL* cria_ArvAVL();
void libera_ArvAVL(ArvAVL *raiz);
int insere_ArvAVL(ArvAVL *raiz, int data);
int remove_ArvAVL(ArvAVL *raiz, int valor);
int estaVazia_ArvAVL(ArvAVL *raiz);
int altura_ArvAVL(ArvAVL *raiz);
int totalNO_ArvAVL(ArvAVL *r... |
souzafcharles/Data-Structure | EAD_AsynchronousContent_AVL_tree/ArvoreAVL.c | /*
Class title: Data Structure
Lecturer: Prof. Dr. <NAME>
Exercise by: <NAME>
Date: November 01, 2021
*/
#include <stdio.h>
#include <stdlib.h>
#include "ArvoreAVL.h" //inclui os Protótipos
struct NO{
int info; // Elementos dos nós
int altura; //Altura da sub-arvore para utilizar em uma função para calcular ... |
souzafcharles/Data-Structure | Class_A1_Stack_Queue/Example_Stack.c | <reponame>souzafcharles/Data-Structure
/*
Class title: Data Structure
Lecturer: Prof. Dr. <NAME>
Example adapted by: <NAME>
Date: August 10, 2021
*/
#include <stdio.h>
#include <stdlib.h>
#define STACKSIZE 100
struct stack {
int top;
int items[STACKSIZE];
};
int empty(struct stack *ps){
if (ps->top == -... |
souzafcharles/Data-Structure | Class_C3_Linked_List/Example_LinkedList.c | <reponame>souzafcharles/Data-Structure<gh_stars>0
/*
Class title: Data Structure
Lecturer: Prof. Dr. <NAME>
Example adapted by: <NAME>
Date: August 24, 2021
*/
#include <stdio.h>
#include <stdlib.h>
struct No {
int informacao;
struct No *proximo;
};
typedef struct No No;
void insere(No *ponteiro, int item){... |
ameeuwsen/vac | vac.h | <reponame>ameeuwsen/vac<filename>vac.h<gh_stars>0
/*
Puff.h - Library for arduino 8-wire manifold air ride systems.
Script also includes functions for leveling with rotary position sensors.
Created by <NAME>, November 28, 2013.
Released into the public domain.
*/
#include "Arduino.h"
#ifndef Vac_h
#define Vac... |
chenming-wu/pydubins | dubins/dubins.c | /* Generated by Cython 0.27.3 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython ... |
chenming-wu/pydubins | dubins/include/dubins.h | <filename>dubins/include/dubins.h<gh_stars>100-1000
/*
* Copyright (c) 2008-2018, <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitati... |
auborg/MBFaker | MBFaker Demo/MBFaker Demo/MBPerson.h | //
// MBPerson.h
// MBFaker Demo
//
// Created by <NAME> on 11/9/12.
// Copyright (c) 2012 <NAME>. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MBPerson : NSObject
+ (MBPerson*)personWithFakeData;
@property(nonatomic,copy)NSString* name;
@property(nonatomic,copy)NSString* email;
@propert... |
auborg/MBFaker | MBFaker/MBFakerName.h | <gh_stars>10-100
//
// MBFakerName.h
// Faker
//
// Created by <NAME> on 10/29/12.
// Copyright (c) 2012 <NAME>. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MBFakerName : NSObject
+ (NSString*)name;
+ (NSString*)firstName;
+ (NSString*)lastName;
+ (NSString*)prefix;
+ (NSString*)suffix;
... |
auborg/MBFaker | MBFaker Demo/MBFaker Demo/MBAppDelegate.h | //
// MBAppDelegate.h
// MBFaker Demo
//
// Created by <NAME> on 11/9/12.
// Copyright (c) 2012 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
@class MBViewController;
@interface MBAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nona... |
auborg/MBFaker | MBFaker Demo/MBFaker Demo/MBTableCell.h | <reponame>auborg/MBFaker
//
// MBTableCell.h
// MBFaker Demo
//
// Created by <NAME> on 11/9/12.
// Copyright (c) 2012 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MBPerson.h"
@interface MBTableCell : UITableViewCell
+ (MBTableCell*)tableCell;
- (void)setPerson:(MBPerson*)person;
@property ... |
auborg/MBFaker | MBFaker/MBFakerCompany.h | //
// MBFakerCompany.h
// Faker
//
// Created by <NAME> on 11/6/12.
// Copyright (c) 2012 <NAME>. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MBFakerCompany : NSObject
+ (NSString*)name;
+ (NSString*)suffix;
@end
|
auborg/MBFaker | MBFaker Demo/MBFaker Demo/MBViewController.h | <filename>MBFaker Demo/MBFaker Demo/MBViewController.h
//
// MBViewController.h
// MBFaker Demo
//
// Created by <NAME> on 11/9/12.
// Copyright (c) 2012 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MBViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
@property (... |
electricimp/examples | WirelessGateway_LoRaBall/ArduinoLibraries/Adafruit_LIS3DH/Adafruit_LIS3DH.h | <gh_stars>10-100
/**************************************************************************/
/*!
@file Adafruit_LIS3DH.h
@author <NAME> / <NAME> (Adafruit Industries)
@license BSD (see license.txt)
This is a library for the Adafruit LIS3DH Accel breakout board
----> https://www.adafruit.com... |
electricimp/examples | Older Examples - enter at your own risk/Shelf/Shelf/ShelfHomeViewController.h | <reponame>electricimp/examples
//
// ShelfHomeViewController.h
// Shelf
//
// Created by <NAME> on 16/07/2014.
//
// Copyright (c) 2014 Electric Imp
// This file is licensed under the MIT License
// http://opensource.org/licenses/MIT
#import <UIKit/UIKit.h>
// If you have the BlinkUp SDK import the framework an... |
electricimp/examples | Older Examples - enter at your own risk/Shelf/Shelf/ShelfAppDelegate.h | //
// ShelfAppDelegate.h
// Shelf
//
// Created by <NAME> on 16/07/2014.
//
// Copyright (c) 2014 Electric Imp
// This file is licensed under the MIT License
// http://opensource.org/licenses/MIT
#import <UIKit/UIKit.h>
@interface ShelfAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonato... |
electricimp/examples | Older Examples - enter at your own risk/Shelf/Shelf/TempBook.h | //
// ShelfSensor.h
// Shelf
//
// Created by <NAME> on 16/07/2014.
//
// Copyright (c) 2014 Electric Imp
// This file is licensed under the MIT License
// http://opensource.org/licenses/MIT
@class ShelfHomeViewController;
#define hot1 [UIColor colorWithRed:255.0/255.0 green:100.0/255.0 blue:080.0/255.0 alpha:... |
electricimp/examples | Older Examples - enter at your own risk/vanessa/iOS/Vanessa/ViewController.h | //
// ViewController.h
// Vanessa
//
// Created by <NAME> on 12/6/13.
// Copyright (c) 2013 Electric Imp. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate>
@end
|
electricimp/examples | Older Examples - enter at your own risk/vanessa/iOS/Vanessa/AppDelegate.h | <filename>Older Examples - enter at your own risk/vanessa/iOS/Vanessa/AppDelegate.h
//
// AppDelegate.h
// Vanessa
//
// Created by <NAME> on 12/6/13.
// Copyright (c) 2013 Electric Imp. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong... |
hansel163/miniweb | miniweb/httpauth.c | /////////////////////////////////////////////////////////////////////////////
//
// http.c
//
// MiniWeb HTTP authentication implementation
//
/////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include... |
hansel163/miniweb | miniweb/httpapi.h | ///////////////////////////////////////////////////////////////////////
//
// httpapi.h
//
// External API header file for http protocol
//
///////////////////////////////////////////////////////////////////////
#ifndef _HTTPAPI_H_
#define _HTTPAPI_H_
#include <stdio.h>
#include <string.h>
#include <stdl... |
hansel163/miniweb | miniweb/procpil.c | <reponame>hansel163/miniweb
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "procpil.h"
#define SHELL_BUFFER_SIZE 256
#ifdef WIN32
const int w32Priority[]={
IDL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.