<commit_before>/** \file
   \mainpage
   PZ80emu

   Created by <NAME> on 5/2/15.
   Copyright (c) 2015 <NAME>. All rights reserved.

   Todo:
   - Implement rest of instruction set
   - Implement menu system
   - Implement stepping
   - Implement GetOpt
   - Check all void casts
   - Check implementation of add hl,bc
   - Fix error handling and reporting
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <ncurses.h>
#include "z80.h"
#include "memory.h"
#include "display.h"

/** PZ80 Machine Emulator */
int main(int argc, const char * argv[]) {
	WINDOW *register_display, *memory_display;

	// initialize the CPU
	z80 *cpu;

	// emulated memory
	uint8_t *memory;
	long runcycles;
	// display variables
	int main_row = 0;
	int main_col = 0;

	if (argc < 2) {
		printf("Usage: ./PZ80emu <filename.bin>\n");
		exit(EXIT_FAILURE);
	}

	cpu = new_cpu();
	memory = create_ram();
	runcycles = load_rom(argv[1], memory);
<commit_msg>moving variable declarations around a bit<commit_after>/** \file
   \mainpage
   PZ80emu

   Created by <NAME> on 5/2/15.
   Copyright (c) 2015 <NAME>. All rights reserved.

   Todo:
   - Implement rest of instruction set
   - Implement menu system
   - Implement stepping
   - Implement GetOpt
   - Check all void casts
   - Check implementation of add hl,bc
   - Fix error handling and reporting
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <ncurses.h>
#include "z80.h"
#include "memory.h"
#include "display.h"

/** PZ80 Machine Emulator */
int main(int argc, const char * argv[]) {
	WINDOW *register_display, *memory_display;

	// display variables
	int main_row = 0;
	int main_col = 0;

	if (argc < 2) {
		printf("Usage: ./PZ80emu <filename.bin>\n");
		exit(EXIT_FAILURE);
	}

	z80 *cpu = new_cpu();
	uint8_t *memory = create_ram();
	long runcycles = load_rom(argv[1], memory);

{'fraction_non_alphanumeric': 0.12936124530327428, 'fraction_numerical': 0.024691358024691357, 'mean_word_length': 3.314814814814815, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, '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': '4693831', 'n_tokens_mistral': 701, 'n_tokens_neox': 660, 'n_words': 201}