<commit_before>
/*
 * Copyright (C) 2017 - 2018 FIX94
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <malloc.h>
#include <string.h>
#include <ctype.h>
#include <inttypes.h>
#include <time.h>
#include <math.h>
#include "mapper.h"
#include "cpu.h"
#include "ppu.h"
#include "mem.h"
#include "input.h"
#include "fm2play.h"
#include "apu.h"
#include "audio.h"
#include "audio_fds.h"
#include "audio_vrc7.h"
#include "mapper_h/nsf.h"
#include "libretro.h"

static retro_log_printf_t log_cb;
static retro_video_refresh_t video_cb;
static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
static retro_audio_sample_batch_t audio_batch_cb;
static retro_environment_t environ_cb;

int nesEmuLoadGame(const char* filename);
void nesEmuMainLoop(void);
void nesEmuDeinit(void);
#ifdef COL_32BIT
extern uint32_t textureImage[0xF000];
#else //case COL_16BIT
extern uint16_t textureImage[0xF000];
#endif //end COL_32BIT
extern uint8_t inValReads[8];
static bool inDiskSwitch = false;
extern const char *VERSION_STRING;

void retro_get_system_info(struct retro_system_info *info)
{
   info->library_name = "fixNES";
   info->library_version = VERSION_STRING + 7;
   info->need_fullpath = true;
   info->block_extract = false;
   info->valid_extensions = "nes|fds|qd|nsf";
}

#define DOTS 341
#define VISIBLE_DOTS 256
#define VISIBLE_LINES 240
extern bool nesPAL;

void retro_get_system_av_info(struct retro_system_av_info *info)
{
   info->geometry.base_width    = VISIBLE_DOTS;
   info->geometry.base_height   = VISIBLE_LINES;
   info->geometry.max_width     = VISIBLE_DOTS;
   info->geometry.max_height    = VISIBLE_LINES;
   info->geometry.aspect_ratio  = 0.0f;
   info->timing.fps             = nesPAL ? 50.0070 : 60.0988;
   info->timing.sample_rate     = apuGetFrequency();
}

void retro_init(void)
{
   struct retro_log_callback log;

   if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log))
      log_cb = log.log;
}<commit_msg>remove redefines<commit_after>
/*
 * Copyright (C) 2017 - 2018 FIX94
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <malloc.h>
#include <string.h>
#include <ctype.h>
#include <inttypes.h>
#include <time.h>
#include <math.h>
#include "mapper.h"
#include "cpu.h"
#include "ppu.h"
#include "mem.h"
#include "input.h"
#include "fm2play.h"
#include "apu.h"
#include "audio.h"
#include "audio_fds.h"
#include "audio_vrc7.h"
#include "mapper_h/nsf.h"
#include "libretro.h"

static retro_log_printf_t log_cb;
static retro_video_refresh_t video_cb;
static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
static retro_audio_sample_batch_t audio_batch_cb;
static retro_environment_t environ_cb;

int nesEmuLoadGame(const char* filename);
void nesEmuMainLoop(void);
void nesEmuDeinit(void);
#ifdef COL_32BIT
extern uint32_t textureImage[0xF000];
#else //case COL_16BIT
extern uint16_t textureImage[0xF000];
#endif //end COL_32BIT
extern uint8_t inValReads[8];
static bool inDiskSwitch = false;
extern const char *VERSION_STRING;

void retro_get_system_info(struct retro_system_info *info)
{
   info->library_name = "fixNES";
   info->library_version = VERSION_STRING + 7;
   info->need_fullpath = true;
   info->block_extract = false;
   info->valid_extensions = "nes|fds|qd|nsf";
}

extern bool nesPAL;

void retro_get_system_av_info(struct retro_system_av_info *info)
{
   info->geometry.base_width    = VISIBLE_DOTS;
   info->geometry.base_height   = VISIBLE_LINES;
   info->geometry.max_width     = VISIBLE_DOTS;
   info->geometry.max_height    = VISIBLE_LINES;
   info->geometry.aspect_ratio  = 0.0f;
   info->timing.fps             = nesPAL ? 50.0070 : 60.0988;
   info->timing.sample_rate     = apuGetFrequency();
}

void retro_init(void)
{
   struct retro_log_callback log;

   if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log))
      log_cb = log.log;
}
{'fraction_non_alphanumeric': 0.1126658624849216, 'fraction_numerical': 0.024849215922798554, 'mean_word_length': 4.982683982683983, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7178303', 'n_tokens_mistral': 1664, 'n_tokens_neox': 1577, 'n_words': 344}