<commit_before>#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "mmu.h"
#include "state.h"

#define MIDISIZE 4
#define MIDIBASE 0xfffc04

static BYTE midi_control;
static BYTE midi_status;
static BYTE midi_data;

static BYTE midi_read_byte(LONG addr)
{
  switch(addr) {
  case 0xfffc04:
    return midi_status;
  case 0xfffc06:
    return midi_data;
  default:
    return 0;
  }
}

static WORD midi_read_word(LONG addr)
{
  return (midi_read_byte(addr)<<8)|midi_read_byte(addr+1);
}

static LONG midi_read_long(LONG addr)
{
  return ((midi_read_byte(addr)<<24)|
	  (midi_read_byte(addr+1)<<16)|
	  (midi_read_byte(addr+2)<<8)|
	  (midi_read_byte(addr+3)));<commit_msg>Make sure midi is always accepting data, even though we ignore it<commit_after>#include <stdlib.h>
#include <string.h>
#include "common.h"
#include "mmu.h"
#include "state.h"

#define MIDISIZE 4
#define MIDIBASE 0xfffc04

static BYTE midi_control;
static BYTE midi_status = 0x02; /* Always ready to receive */
static BYTE midi_data;

static BYTE midi_read_byte(LONG addr)
{
  switch(addr) {
  case 0xfffc04:
    return midi_status;
  case 0xfffc06:
    return midi_data;
  default:
    return 0;
  }
}

static WORD midi_read_word(LONG addr)
{
  return (midi_read_byte(addr)<<8)|midi_read_byte(addr+1);
}

static LONG midi_read_long(LONG addr)
{
  return ((midi_read_byte(addr)<<24)|
	  (midi_read_byte(addr+1)<<16)|
	  (midi_read_byte(addr+2)<<8)|
	  (midi_read_byte(addr+3)));
{'fraction_non_alphanumeric': 0.12832764505119454, 'fraction_numerical': 0.030716723549488054, 'mean_word_length': 5.211864406779661, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, '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': '2151115', 'n_tokens_mistral': 642, 'n_tokens_neox': 603, 'n_words': 127}