#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cpu.h"
#include "device.h"
#include "devices.h"
#include "float_emul.h"
#include "machine.h"
#include "memory.h"
#include "misc.h"
#include "timer.h"
#include "thirdparty/dreamcast_pvr.h"
#include "thirdparty/dreamcast_sysasicvar.h"
Go to the source code of this file.
Classes | |
struct | pvr_data |
struct | pvr_data_alt |
Macros | |
#define | INTERNAL_FB_ADDR 0x300000000ULL |
#define | PVR_FB_TICK_SHIFT 18 |
#define | PVR_VBLANK_HZ 60.0 |
#define | PVR_MARGIN 16 |
#define | VRAM_SIZE (8*1048576) |
#define | PVR_DMA_MEMLENGTH 0x100 |
#define | N_PVR_DMA_REGS (PVR_DMA_MEMLENGTH / sizeof(uint32_t)) |
#define | PVR_ADDR 0x00 |
#define | PVR_COUNT 0x04 |
#define | PVR_MODE 0x08 |
#define | PVR_LMMODE0 0x84 |
#define | PVR_LMMODE1 0x88 |
#define | REG(x) (d->reg[(x)/sizeof(uint32_t)]) |
#define | DEFAULT_WRITE REG(relative_addr) = idata; |
Functions | |
DEVICE_ACCESS (pvr_ta) | |
void | pvr_dma_transfer (struct cpu *cpu, struct pvr_data *d) |
DEVICE_ACCESS (pvr_dma) | |
DEVICE_ACCESS (pvr_dma_more) | |
void | pvr_fb_invalidate (struct pvr_data *d, int start, int stop) |
void | pvr_geometry_updated (struct pvr_data *d) |
void | pvr_render (struct cpu *cpu, struct pvr_data *d) |
void | pvr_ta_init (struct cpu *cpu, struct pvr_data *d) |
DEVICE_ACCESS (pvr) | |
void | pvr_extend_update_region (struct pvr_data *d, uint64_t low, uint64_t high) |
DEVICE_TICK (pvr_fb) | |
DEVICE_ACCESS (pvr_vram_alt) | |
DEVICE_ACCESS (pvr_vram) | |
DEVINIT (pvr) | |
#define DEFAULT_WRITE REG(relative_addr) = idata; |
Definition at line 160 of file dev_pvr.cc.
#define INTERNAL_FB_ADDR 0x300000000ULL |
Definition at line 77 of file dev_pvr.cc.
#define N_PVR_DMA_REGS (PVR_DMA_MEMLENGTH / sizeof(uint32_t)) |
Definition at line 88 of file dev_pvr.cc.
#define PVR_ADDR 0x00 |
Definition at line 90 of file dev_pvr.cc.
#define PVR_COUNT 0x04 |
Definition at line 91 of file dev_pvr.cc.
#define PVR_DMA_MEMLENGTH 0x100 |
Definition at line 87 of file dev_pvr.cc.
#define PVR_FB_TICK_SHIFT 18 |
Definition at line 78 of file dev_pvr.cc.
#define PVR_LMMODE0 0x84 |
Definition at line 93 of file dev_pvr.cc.
#define PVR_LMMODE1 0x88 |
Definition at line 94 of file dev_pvr.cc.
#define PVR_MARGIN 16 |
Definition at line 82 of file dev_pvr.cc.
#define PVR_MODE 0x08 |
Definition at line 92 of file dev_pvr.cc.
#define PVR_VBLANK_HZ 60.0 |
Definition at line 80 of file dev_pvr.cc.
#define REG | ( | x | ) | (d->reg[(x)/sizeof(uint32_t)]) |
Definition at line 159 of file dev_pvr.cc.
#define VRAM_SIZE (8*1048576) |
Definition at line 84 of file dev_pvr.cc.
DEVICE_ACCESS | ( | pvr | ) |
Definition at line 1558 of file dev_pvr.cc.
References data, debug, DEFAULT_WRITE, MEM_READ, MEM_WRITE, memory_readmax64(), PVR_FOG_TABLE_SIZE, PVR_PALETTE_SIZE, PVR_RESET_PVR, PVRREG_FOG_TABLE, PVRREG_ID, PVRREG_PALETTE, PVRREG_RESET, PVRREG_REVISION, and pvr_data::reg.
DEVICE_ACCESS | ( | pvr_dma | ) |
Definition at line 316 of file dev_pvr.cc.
References data, debug, pvr_data::dma_reg, fatal(), MEM_READ, MEM_WRITE, memory_readmax64(), memory_writemax64(), PVR_ADDR, PVR_COUNT, pvr_dma_transfer(), PVR_LMMODE0, PVR_LMMODE1, and PVR_MODE.
DEVICE_ACCESS | ( | pvr_dma_more | ) |
Definition at line 454 of file dev_pvr.cc.
References data, pvr_data::dma_more_reg, fatal(), MEM_READ, MEM_WRITE, memory_readmax64(), and memory_writemax64().
DEVICE_ACCESS | ( | pvr_ta | ) |
Definition at line 1515 of file dev_pvr.cc.
References data, fatal(), MEM_WRITE, memory_readmax64(), and pvr_data::ta.
DEVICE_ACCESS | ( | pvr_vram | ) |
Definition at line 2502 of file dev_pvr.cc.
References data, fatal(), MEM_READ, pvr_extend_update_region(), and pvr_data::vram.
DEVICE_ACCESS | ( | pvr_vram_alt | ) |
Definition at line 2462 of file dev_pvr.cc.
References addr, pvr_data_alt::d, data, fatal(), MEM_READ, pvr_extend_update_region(), pvr_data::vram, and VRAM_SIZE.
DEVICE_TICK | ( | pvr_fb | ) |
Definition at line 2278 of file dev_pvr.cc.
References addr, vfb_data::bit_depth, pvr_data::border_updated, vfb_data::bytes_per_line, pvr_data::bytes_per_pixel, pvr_data::fb, pvr_data::fb_update_x1, pvr_data::fb_update_x2, pvr_data::fb_update_y1, pvr_data::fb_update_y2, vfb_data::framebuffer, cpu::mem, memory_device_dyntrans_access(), pvr_data::pixelmode, pvr_extend_update_region(), PVR_MARGIN, PVRREG_BRDCOLR, PVRREG_DIWADDRL, REG, SYSASIC_EVENT_PVR_SCANINT1, SYSASIC_EVENT_PVR_SCANINT2, SYSASIC_EVENT_VBLINT, SYSASIC_TRIGGER_EVENT, vfb_data::update_x1, vfb_data::update_x2, vfb_data::update_y1, vfb_data::update_y2, pvr_data::vblank_interrupts_pending, pvr_data::vram, VRAM_SIZE, pvr_data::xsize, vfb_data::xsize, pvr_data::ysize, and vfb_data::ysize.
DEVINIT | ( | pvr | ) |
Definition at line 2532 of file dev_pvr.cc.
References pvr_data::bytes_per_pixel, CHECK_ALLOCATION, pvr_data_alt::d, dev_fb_init(), DM_DEFAULT, DM_DYNTRANS_OK, DM_DYNTRANS_WRITE_OK, DM_READS_HAVE_NO_SIDE_EFFECTS, pvr_data::fb, INTERNAL_FB_ADDR, devinit::machine, machine::memory, memory_device_register(), devinit::name, pvr_data::pixelmode, PVR_DMA_MEMLENGTH, PVR_MARGIN, PVR_VBLANK_HZ, PVRREG_REGSIZE, PVRREG_REGSTART, timer_add(), pvr_data::vblank_timer, VFB_GENERIC, pvr_data::vram, VRAM_SIZE, pvr_data::xsize, pvr_data::ysize, and zeroed_alloc().
Definition at line 166 of file dev_pvr.cc.
References cpu::cd, CHCR_DM, CHCR_DM_DECREMENTED, CHCR_DM_FIXED, CHCR_DM_INCREMENTED, CHCR_IE, CHCR_RS, CHCR_SM, CHCR_SM_DECREMENTED, CHCR_SM_FIXED, CHCR_SM_INCREMENTED, CHCR_TD, CHCR_TE, CHCR_TS, CHCR_TS_1BYTE, CHCR_TS_2BYTE, CHCR_TS_32BYTE, CHCR_TS_4BYTE, CHCR_TS_8BYTE, pvr_data::dma_reg, sh_cpu::dmac_chcr, sh_cpu::dmac_dar, sh_cpu::dmac_sar, sh_cpu::dmac_tcr, fatal(), cpu::mem, MEM_READ, MEM_WRITE, cpu::memory_rw, NO_EXCEPTIONS, PHYSICAL, PVR_ADDR, PVR_COUNT, cpu::sh, SYSASIC_EVENT_PVR_DMA, and SYSASIC_TRIGGER_EVENT.
Referenced by DEVICE_ACCESS().
void pvr_extend_update_region | ( | struct pvr_data * | d, |
uint64_t | low, | ||
uint64_t | high | ||
) |
Definition at line 2244 of file dev_pvr.cc.
References pvr_data::bytes_per_pixel, pvr_data::fb_update_x1, pvr_data::fb_update_x2, pvr_data::fb_update_y1, pvr_data::fb_update_y2, PVRREG_DIWADDRL, REG, pvr_data::xsize, and pvr_data::ysize.
Referenced by DEVICE_ACCESS(), and DEVICE_TICK().
void pvr_fb_invalidate | ( | struct pvr_data * | d, |
int | start, | ||
int | stop | ||
) |
Definition at line 516 of file dev_pvr.cc.
References pvr_data::fb_update_x1, pvr_data::fb_update_x2, pvr_data::fb_update_y1, pvr_data::fb_update_y2, pvr_data::xsize, and pvr_data::ysize.
void pvr_geometry_updated | ( | struct pvr_data * | d | ) |
Definition at line 543 of file dev_pvr.cc.
References pvr_data::border_updated, pvr_data::bytes_per_pixel, debug, pvr_data::display_enabled, DIWCONF_LR, DIWSIZE_DPL_SHIFT, DIWSIZE_LPF_SHIFT, DIWSIZE_MASK, if(), pvr_data::line_double, pvr_data::pixelmode, PVRREG_DIWCONF, PVRREG_DIWSIZE, REG, pvr_data::video_enabled, pvr_data::vram_z, pvr_data::xsize, and pvr_data::ysize.
Definition at line 1043 of file dev_pvr.cc.
References pvr_data::bytes_per_pixel, pvr_data::current_list_type, debug, ieee_float_value::f, fatal(), FB_RENDER_CFG_RENDER_MODE_MASK, IEEE_FMT_S, ieee_interpret_float_value(), pvr_data::n_ta_commands, PVRREG_BGPLANE_Z, PVRREG_FB_RENDER_ADDR1, PVRREG_FB_RENDER_CFG, PVRREG_TSP_CFG, REG, pvr_data::ta_commands, TSP_CFG_MODULO_MASK, pvr_data::vram, pvr_data::vram_z, pvr_data::xsize, and pvr_data::ysize.
Definition at line 1406 of file dev_pvr.cc.
References PVRREG_TA_OB_POS, PVRREG_TA_OB_START, PVRREG_TA_OPB_POS, PVRREG_TA_OPB_START, and REG.