2017-09-25 04:31:20 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <wchar.h>
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2020-03-29 14:24:42 +02:00
|
|
|
#include <86box/86box.h>
|
|
|
|
|
#include <86box/mem.h>
|
2017-11-05 01:57:04 -05:00
|
|
|
#include "cpu.h"
|
2017-09-25 04:31:20 -04:00
|
|
|
#include "x86_ops.h"
|
2016-06-26 00:34:39 +02:00
|
|
|
#include "codegen.h"
|
|
|
|
|
|
|
|
|
|
void (*codegen_timing_start)();
|
|
|
|
|
void (*codegen_timing_prefix)(uint8_t prefix, uint32_t fetchdat);
|
2020-04-10 01:08:52 +02:00
|
|
|
void (*codegen_timing_opcode)(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t op_pc);
|
2016-06-26 00:34:39 +02:00
|
|
|
void (*codegen_timing_block_start)();
|
|
|
|
|
void (*codegen_timing_block_end)();
|
2020-04-10 01:08:52 +02:00
|
|
|
int (*codegen_timing_jump_cycles)();
|
2016-06-26 00:34:39 +02:00
|
|
|
|
|
|
|
|
void codegen_timing_set(codegen_timing_t *timing)
|
|
|
|
|
{
|
|
|
|
|
codegen_timing_start = timing->start;
|
|
|
|
|
codegen_timing_prefix = timing->prefix;
|
|
|
|
|
codegen_timing_opcode = timing->opcode;
|
|
|
|
|
codegen_timing_block_start = timing->block_start;
|
|
|
|
|
codegen_timing_block_end = timing->block_end;
|
2020-04-10 01:08:52 +02:00
|
|
|
codegen_timing_jump_cycles = timing->jump_cycles;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int codegen_in_recompile;
|
2020-04-10 14:07:25 +02:00
|
|
|
|
|
|
|
|
/* This is for compatibility with new x87 code. */
|
|
|
|
|
void codegen_set_rounding_mode(int mode)
|
|
|
|
|
{
|
|
|
|
|
/* cpu_state.new_npxc = (cpu_state.old_npxc & ~0xc00) | (cpu_state.npxc & 0xc00); */
|
|
|
|
|
cpu_state.new_npxc = (cpu_state.old_npxc & ~0xc00) | (mode << 10);
|
|
|
|
|
}
|