#ifndef _R_BFVM_INCLUDE_
#define _R_BFVM_INCLUDE_

#include <rz_io.h>
#include <rz_util.h>

#define BFVM_SCREEN_ADDR 0x50000
#define BFVM_SCREEN_SIZE 4096
#define BFVM_INPUT_ADDR  0x10000
#define BFVM_INPUT_SIZE  4096
#define BFVM_DATA_ADDR   0xd00000
#define BFVM_DATA_SIZE   4096
#define BFVM_CODE_ADDR   0
#define BFVM_CODE_SIZE   4096 /* XXX */

typedef struct bfvm_cpu_t {
	ut64 eip;
	ut64 esp;
	int ptr;
	int trace;
	int breaked;
	ut64 base;
	ut8 *mem;
	ut32 size;
	ut64 screen;
	int screen_idx;
	int screen_size;
	ut8 *screen_buf;
	ut64 input;
	int input_idx;
	int input_size;
	ut8 *input_buf;
	int circular; /* circular memory */
	RzIOBind iob;
} BfvmCPU;

#ifdef RZ_API
RZ_API BfvmCPU *bfvm_new(RzIOBind *iob);
RZ_API BfvmCPU *bfvm_free(BfvmCPU *c);
RZ_API int bfvm_step(BfvmCPU *c, int over);
#endif

#endif
