cen64/vi/controller.h
Tyler J. Stachecki fb94bbacb0 device: Temporarily 'overclock' RSP by 20%.
The RSP pipeline should dual issue vector and scalar insns
in certain configurations, but we don't have it emulated
yet. To account for this, give the RSP some extra cycles
until we model that part of the pipeline correctly.
2016-07-17 12:28:29 -04:00

82 lines
1.7 KiB
C

//
// vi/controller.h: Video interface controller.
//
// CEN64: Cycle-Accurate Nintendo 64 Emulator.
// Copyright (C) 2015, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#ifndef CEN64_VI_CONTROLLER_H
#define CEN64_VI_CONTROLLER_H
#include "common.h"
#include "gl_common.h"
#include "gl_context.h"
#include "gl_display.h"
#include "gl_screen.h"
#include "gl_window.h"
#include "timer.h"
struct bus_controller *bus;
enum vi_register {
#define X(reg) reg,
#include "vi/registers.md"
#undef X
NUM_VI_REGISTERS
};
#ifdef DEBUG_MMIO_REGISTER_ACCESS
extern const char *vi_register_mnemonics[NUM_VI_REGISTERS];
#endif
struct render_area {
struct {
unsigned start;
unsigned end;
} x;
struct {
unsigned start;
unsigned end;
} y;
unsigned height;
unsigned width;
int hskip;
};
struct vi_controller {
struct bus_controller *bus;
uint32_t regs[NUM_VI_REGISTERS];
uint32_t counter;
// Client rendering structures.
cen64_gl_display display;
cen64_gl_screen screen;
cen64_gl_window window;
cen64_gl_context context;
struct render_area render_area;
float viuv[8];
float quad[8];
cen64_time last_update_time;
uint32_t latched_origin;
unsigned intr_counter;
unsigned frame_count;
unsigned field;
};
cen64_cold int vi_init(struct vi_controller *vi, struct bus_controller *bus,
bool no_interface);
cen64_flatten cen64_hot void vi_cycle(struct vi_controller *vi);
cen64_cold int read_vi_regs(void *opaque, uint32_t address, uint32_t *word);
cen64_cold int write_vi_regs(void *opaque, uint32_t address, uint32_t word, uint32_t dqm);
#endif