Merge pull request #2815 from Cacodemon345/voodoo-unimpl-regs
voodoo: Partial implementation of cmdStatus0 register
This commit is contained in:
@@ -320,6 +320,8 @@ typedef struct voodoo_t {
|
|||||||
uint32_t cmdfifo_amin, cmdfifo_amax;
|
uint32_t cmdfifo_amin, cmdfifo_amax;
|
||||||
int cmdfifo_holecount;
|
int cmdfifo_holecount;
|
||||||
|
|
||||||
|
atomic_uint cmd_status;
|
||||||
|
|
||||||
uint32_t sSetupMode;
|
uint32_t sSetupMode;
|
||||||
vert_t verts[4];
|
vert_t verts[4];
|
||||||
unsigned int vertex_ages[3];
|
unsigned int vertex_ages[3];
|
||||||
|
@@ -178,6 +178,7 @@ enum {
|
|||||||
cmdRdPtrH0 = 0x30,
|
cmdRdPtrH0 = 0x30,
|
||||||
cmdAMin0 = 0x34,
|
cmdAMin0 = 0x34,
|
||||||
cmdAMax0 = 0x3c,
|
cmdAMax0 = 0x3c,
|
||||||
|
cmdStatus0 = 0x40,
|
||||||
cmdFifoDepth0 = 0x44,
|
cmdFifoDepth0 = 0x44,
|
||||||
cmdHoleCnt0 = 0x48,
|
cmdHoleCnt0 = 0x48,
|
||||||
|
|
||||||
@@ -1170,6 +1171,10 @@ banshee_cmd_read(banshee_t *banshee, uint32_t addr)
|
|||||||
// banshee_log("Read cmdfifo_depth %08x\n", ret);
|
// banshee_log("Read cmdfifo_depth %08x\n", ret);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case cmdStatus0:
|
||||||
|
ret = voodoo->cmd_status;
|
||||||
|
break;
|
||||||
|
|
||||||
case 0x108:
|
case 0x108:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2981,6 +2986,7 @@ banshee_init_common(const device_t *info, char *fn, int has_sgram, int type, int
|
|||||||
banshee->voodoo->tex_mem[1] = banshee->svga.vram;
|
banshee->voodoo->tex_mem[1] = banshee->svga.vram;
|
||||||
banshee->voodoo->tex_mem_w[1] = (uint16_t *) banshee->svga.vram;
|
banshee->voodoo->tex_mem_w[1] = (uint16_t *) banshee->svga.vram;
|
||||||
banshee->voodoo->texture_mask = banshee->svga.vram_mask;
|
banshee->voodoo->texture_mask = banshee->svga.vram_mask;
|
||||||
|
banshee->voodoo->cmd_status = (1 << 28);
|
||||||
voodoo_generate_filter_v1(banshee->voodoo);
|
voodoo_generate_filter_v1(banshee->voodoo);
|
||||||
|
|
||||||
banshee->vidSerialParallelPort = VIDSERIAL_DDC_DCK_W | VIDSERIAL_DDC_DDA_W;
|
banshee->vidSerialParallelPort = VIDSERIAL_DDC_DCK_W | VIDSERIAL_DDC_DDA_W;
|
||||||
|
@@ -106,6 +106,7 @@ voodoo_queue_command(voodoo_t *voodoo, uint32_t addr_type, uint32_t val)
|
|||||||
fifo->addr_type = addr_type;
|
fifo->addr_type = addr_type;
|
||||||
|
|
||||||
voodoo->fifo_write_idx++;
|
voodoo->fifo_write_idx++;
|
||||||
|
voodoo->cmd_status &= ~(1 << 24);
|
||||||
|
|
||||||
if (FIFO_ENTRIES > 0xe000)
|
if (FIFO_ENTRIES > 0xe000)
|
||||||
voodoo_wake_fifo_thread(voodoo);
|
voodoo_wake_fifo_thread(voodoo);
|
||||||
@@ -283,6 +284,8 @@ voodoo_fifo_thread(void *param)
|
|||||||
voodoo->time += end_time - start_time;
|
voodoo->time += end_time - start_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
voodoo->cmd_status |= (1 << 24);
|
||||||
|
|
||||||
while (voodoo->cmdfifo_enabled && (voodoo->cmdfifo_depth_rd != voodoo->cmdfifo_depth_wr || voodoo->cmdfifo_in_sub)) {
|
while (voodoo->cmdfifo_enabled && (voodoo->cmdfifo_depth_rd != voodoo->cmdfifo_depth_wr || voodoo->cmdfifo_in_sub)) {
|
||||||
uint64_t start_time = plat_timer_read();
|
uint64_t start_time = plat_timer_read();
|
||||||
uint64_t end_time;
|
uint64_t end_time;
|
||||||
@@ -296,9 +299,13 @@ voodoo_fifo_thread(void *param)
|
|||||||
|
|
||||||
// voodoo_fifo_log(" CMDFIFO header %08x at %08x\n", header, voodoo->cmdfifo_rp);
|
// voodoo_fifo_log(" CMDFIFO header %08x at %08x\n", header, voodoo->cmdfifo_rp);
|
||||||
|
|
||||||
|
voodoo->cmd_status &= ~7;
|
||||||
|
voodoo->cmd_status |= (header & 7);
|
||||||
|
voodoo->cmd_status |= (1 << 11);
|
||||||
switch (header & 7) {
|
switch (header & 7) {
|
||||||
case 0:
|
case 0:
|
||||||
// voodoo_fifo_log("CMDFIFO0\n");
|
// voodoo_fifo_log("CMDFIFO0\n");
|
||||||
|
voodoo->cmd_status = (voodoo->cmd_status & 0xffff8fff) | (((header >> 3) & 7) << 12);
|
||||||
switch ((header >> 3) & 7) {
|
switch ((header >> 3) & 7) {
|
||||||
case 0: /*NOP*/
|
case 0: /*NOP*/
|
||||||
break;
|
break;
|
||||||
@@ -323,6 +330,7 @@ voodoo_fifo_thread(void *param)
|
|||||||
default:
|
default:
|
||||||
fatal("Bad CMDFIFO0 %08x\n", header);
|
fatal("Bad CMDFIFO0 %08x\n", header);
|
||||||
}
|
}
|
||||||
|
voodoo->cmd_status = (voodoo->cmd_status & ~(1 << 27)) | (voodoo->cmdfifo_in_sub << 27);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
|
Reference in New Issue
Block a user