Commit e74142b9 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Cleanups - get rid of stdio.h in many places

parent ccca8193
Pipeline #67229 failed with stage
in 4 minutes and 4 seconds
......@@ -52,7 +52,6 @@ endif
NEED_CD = 1
NEED_TREMOR = 1
NEED_BPP = 32
WANT_NEW_API = 1
NEED_DEINTERLACER = 1
NEED_THREADING = 1
SET_HAVE_HW = 0
......
......@@ -127,10 +127,6 @@ ifeq ($(NEED_BPP), 32)
FLAGS += -DWANT_32BPP
endif
ifeq ($(WANT_NEW_API), 1)
FLAGS += -DWANT_NEW_API
endif
ifeq ($(NO_COMPUTED_GOTO), 1)
FLAGS += -DNO_COMPUTED_GOTO
endif
......
#include "libretro.h"
#include "mednafen/mednafen-types.h"
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include "mednafen/git.h"
#include "mednafen/psx/frontio.h"
......
......@@ -6,7 +6,6 @@ DEBUG := 0
FRONTEND_SUPPORTS_RGB565 := 1
NEED_CD := 1
NEED_BPP := 32
WANT_NEW_API := 1
NEED_DEINTERLACER := 1
NEED_THREADING := 1
NEED_TREMOR := 1
......
#ifndef __MDFN_CDROMFILE_H
#define __MDFN_CDROMFILE_H
#include <stdio.h>
#include <stdint.h>
#include <boolean.h>
......
......@@ -279,7 +279,6 @@ bool CDAccess_Image::ParseTOCFileLineInfo(CDRFILE_TRACK_INFO *track, const int t
track->FileOffset = offset; // Make sure this is set before calling GetSectorCount()!
sectors = GetSectorCount(track);
//printf("Track: %d, offset: %ld, %ld\n", tracknum, offset, sectors);
if(length)
{
......@@ -354,7 +353,6 @@ int CDAccess_Image::LoadSBI(const char* sbi_path)
memcpy(SubQReplaceMap[aba].data, tmpq, 12);
}
//MDFN_printf("Loaded Q subchannel replacements for %zu sectors.\n", SubQReplaceMap.size());
log_cb(RETRO_LOG_INFO, "[Image] Loaded SBI file %s\n", sbi_path);
filestream_close(sbis);
return 0;
......@@ -442,8 +440,6 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
MDFN_strtoupper(cmdbuf);
}
//printf("%s\n", cmdbuf.c_str()); //: %s %s %s %s\n", cmdbuf.c_str(), args[0].c_str(), args[1].c_str(), args[2].c_str(), args[3].c_str());
if(IsTOC)
{
if(cmdbuf == "TRACK")
......@@ -526,7 +522,6 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
msfoffset = args[1].c_str();
length = args[2].c_str();
}
//printf("%s, %s, %s, %s\n", args[0].c_str(), binoffset, msfoffset, length);
ParseTOCFileLineInfo(&TmpTrack, active_track, args[0], binoffset, msfoffset, length, image_memcache, toc_streamcache);
}
else if(cmdbuf == "DATAFILE")
......@@ -893,12 +888,9 @@ bool CDAccess_Image::ImageOpen(const char *path, bool image_memcache)
Tracks[x].sectors = Tracks[x + 1].index[0] - Tracks[x].index[1]; //Tracks[x + 1].index - Tracks[x].index;
}
//printf("Poo: %d %d\n", x, Tracks[x].sectors);
RunningLBA += Tracks[x].sectors;
RunningLBA += Tracks[x].postgap;
//printf("%d, %ld %d %d %d %d\n", x, FileOffset, Tracks[x].index, Tracks[x].pregap, Tracks[x].sectors, Tracks[x].LBA);
FileOffset += Tracks[x].sectors * DI_Size_Table[Tracks[x].DIFormat];
} // end to cue sheet handling
} // end to track loop
......@@ -994,7 +986,6 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
// Handle pregap and postgap reading
if(lba < (ct->LBA - ct->pregap_dv) || lba >= (ct->LBA + ct->sectors))
{
//printf("Pre/post-gap read, LBA=%d(LBA-track_start_LBA=%d)\n", lba, lba - ct->LBA);
memset(buf, 0, 2352); // Null sector data, per spec
}
else
......@@ -1007,10 +998,7 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
ct->LastSamplePos += frames_read;
if(frames_read < 0 || frames_read > 588) // This shouldn't happen.
{
printf("Error: frames_read out of range: %d\n", frames_read);
frames_read = 0;
}
if(frames_read < 588)
memset((uint8 *)AudioBuf + frames_read * 2 * sizeof(int16), 0, (588 - frames_read) * 2 * sizeof(int16));
......@@ -1083,34 +1071,6 @@ bool CDAccess_Image::Read_Raw_Sector(uint8 *buf, int32 lba)
return false;
}
#if 0
if(qbuf[0] & 0x40)
{
uint8 dummy_buf[2352 + 96];
bool any_mismatch = false;
memcpy(dummy_buf + 16, buf + 16, 2048);
memset(dummy_buf + 2352, 0, 96);
MakeSubPQ(lba, dummy_buf + 2352);
encode_mode1_sector(lba + 150, dummy_buf);
for(int i = 0; i < 2352 + 96; i++)
{
if(dummy_buf[i] != buf[i])
{
printf("Mismatch at %d, %d: %02x:%02x; ", lba, i, dummy_buf[i], buf[i]);
any_mismatch = true;
}
}
if(any_mismatch)
puts("\n");
}
#endif
//subq_deinterleave(buf + 2352, qbuf);
//printf("%02x\n", qbuf[0]);
//printf("%02x\n", buf[12 + 3]);
return true;
}
......@@ -1136,13 +1096,8 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
}
}
//printf("%d %d\n", Tracks[1].LBA, Tracks[1].sectors);
if(!track_found)
{
printf("MakeSubPQ error for sector %u!", lba);
track = FirstTrack;
}
lba_relative = abs((int32)lba - Tracks[track].LBA);
......@@ -1159,10 +1114,7 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
// Handle pause(D7 of interleaved subchannel byte) bit, should be set to 1 when in pregap or postgap.
if((lba < Tracks[track].LBA) || (lba >= Tracks[track].LBA + Tracks[track].sectors))
{
//printf("pause_or = 0x80 --- %d\n", lba);
pause_or = 0x80;
}
// Handle pregap between audio->data track
{
......@@ -1176,12 +1128,9 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
if(pg_offset < -150)
{
if((Tracks[track].subq_control & SUBQ_CTRLF_DATA) && (FirstTrack < track) && !(Tracks[track - 1].subq_control & SUBQ_CTRLF_DATA))
{
//printf("Pregap part 1 audio->data: lba=%d track_lba=%d\n", lba, Tracks[track].LBA);
control = Tracks[track - 1].subq_control;
}
}
}
memset(buf, 0, 0xC);
buf[0] = (adr << 0) | (control << 4);
......@@ -1206,15 +1155,11 @@ void CDAccess_Image::MakeSubPQ(int32 lba, uint8 *SubPWBuf)
if(!SubQReplaceMap.empty())
{
//printf("%d\n", lba);
std::map<uint32, cpp11_array_doodad>::const_iterator it = SubQReplaceMap.find(LBA_to_ABA(lba));
if(it != SubQReplaceMap.end())
{
//printf("Replace: %d\n", lba);
memcpy(buf, it->second.data, 12);
}
}
for (i = 0; i < 96; i++)
SubPWBuf[i] |= (((buf[i >> 3] >> (7 - (i & 0x7))) & 1) ? 0x40 : 0x00) | pause_or;
......
......@@ -568,10 +568,7 @@ int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors)
uint8_t tmpbuf[2352 + 96];
if(!ReadRawSector(tmpbuf, lba))
{
puts("CDIF Raw Read error");
return(false);
}
if(!ValidateRawSector(tmpbuf))
return(false);
......@@ -605,8 +602,6 @@ int CDIF::ReadSector(uint8* pBuf, uint32 lba, uint32 nSectors)
CDIF_ST::CDIF_ST(CDAccess *cda) : disc_cdaccess(cda)
{
//puts("***WARNING USING SINGLE-THREADED CD READER***");
UnrecoverableError = false;
DiscEjected = false;
......
......@@ -22,7 +22,6 @@
* or direct your browser at http://www.gnu.org.
*/
#include <stdio.h>
#include <stdlib.h>
#include "galois.h"
......
......@@ -1323,11 +1323,6 @@ int32_t PS_CDC::Update(const int32_t timestamp)
else if(ArgsReceiveIn < Commands[PendingCommand].args_min ||
ArgsReceiveIn > Commands[PendingCommand].args_max)
{
PSX_DBG(PSX_DBG_WARNING, "[CDC] Bad number(%d) of args(first check) for command 0x%02x", ArgsReceiveIn, PendingCommand);
for(unsigned int i = 0; i < ArgsReceiveIn; i++)
PSX_DBG(PSX_DBG_WARNING, " 0x%02x", ArgsReceiveBuf[i]);
PSX_DBG(PSX_DBG_WARNING, "\n");
WriteResult(MakeStatus(true));
WriteResult(ERRCODE_BAD_NUMARGS);
WriteIRQ(CDCIRQ_DISC_ERROR);
......@@ -1335,12 +1330,6 @@ int32_t PS_CDC::Update(const int32_t timestamp)
else
{
const CDC_CTEntry *command = &Commands[PendingCommand];
PSX_DBG(PSX_DBG_SPARSE, "[CDC] Command: %s --- ", command->name);
for(unsigned int i = 0; i < ArgsReceiveIn; i++)
PSX_DBG(PSX_DBG_SPARSE, " 0x%02x", ArgsReceiveBuf[i]);
PSX_DBG(PSX_DBG_SPARSE, "\n");
next_time = (this->*(command->func))(ArgsReceiveIn, ArgsReceiveBuf);
PendingCommandPhase = 2;
}
......@@ -1680,9 +1669,6 @@ int32 PS_CDC::CalcSeekTime(int32 initial, int32 target, bool motor_on, bool paus
// ret += 1000000;
ret += PSX_GetRandU32(0, 25000);
PSX_DBG(PSX_DBG_SPARSE, "[CDC] CalcSeekTime() %d->%d = %d\n", initial, target, ret);
return(ret);
}
......
......@@ -56,12 +56,6 @@ bool PS_CPU::Halted;
struct PS_CPU::CP0 PS_CPU::CP0;
char PS_CPU::cache_buf[64 * 1024];
#if 0
#define EXP_ILL_CHECK(n) {n;}
#else
#define EXP_ILL_CHECK(n) {}
#endif
#define BIU_ENABLE_ICACHE_S1 0x00000800 // Enable I-cache, set 1
#define BIU_ICACHE_FSIZE_MASK 0x00000300 // I-cache fill size mask; 0x000 = 2 words, 0x100 = 4 words, 0x200 = 8 words, 0x300 = 16 words
#define BIU_ENABLE_DCACHE 0x00000080 // Enable D-cache
......@@ -332,8 +326,6 @@ void PS_CPU::SetBIU(uint32 val)
ICache[i].TV |= 0x1;
}
}
PSX_DBG(PSX_DBG_SPARSE, "[CPU] Set BIU=0x%08x\n", BIU);
}
uint32 PS_CPU::GetBIU(void)
......@@ -623,19 +615,6 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
assert(code < 16);
#ifdef DEBUG
if(code != EXCEPTION_INT && code != EXCEPTION_BP && code != EXCEPTION_SYSCALL)
{
static const char* exmne[16] =
{
"INT", "MOD", "TLBL", "TLBS", "ADEL", "ADES", "IBE", "DBE", "SYSCALL", "BP", "RI", "COPU", "OV", NULL, NULL, NULL
};
PSX_DBG(PSX_DBG_WARNING, "[CPU] Exception %s(0x%02x) @ PC=0x%08x(NP=0x%08x, BDBT=0x%02x), Instr=0x%08x, IPCache=0x%02x, CAUSE=0x%08x, SR=0x%08x, IRQC_Status=0x%04x, IRQC_Mask=0x%04x\n",
exmne[code], code, PC, NP, BDBT, instr, IPCache, CP0.CAUSE, CP0.SR, IRQ_GetRegister(IRQ_GSREG_STATUS, NULL, 0), IRQ_GetRegister(IRQ_GSREG_MASK, NULL, 0));
}
#endif
if(CP0.SR & (1 << 22)) // BEV
handler = 0xBFC00180;
......@@ -682,10 +661,9 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
BACKED_LDValue = LDValue;
//
// Should come before DO_LDS() so the EXP_ILL_CHECK() emulator debugging macro in GPR_DEP() will work properly.
//
#define GPR_DEPRES_BEGIN { uint8 back = ReadAbsorb[0];
#define GPR_DEP(n) { unsigned tn = (n); ReadAbsorb[tn] = 0; EXP_ILL_CHECK(if(LDWhich > 0 && LDWhich < 0x20 && LDWhich == tn) { PSX_DBG(PSX_DBG_WARNING, "[CPU] Instruction at PC=0x%08x in load delay slot has dependency on load target register(0x%02x): SR=0x%08x\n", PC, LDWhich, CP0.SR); }) }
#define GPR_DEP(n) { unsigned tn = (n); ReadAbsorb[tn] = 0; }
#define GPR_RES(n) { unsigned tn = (n); ReadAbsorb[tn] = 0; }
#define GPR_DEPRES_END ReadAbsorb[0] = back; }
......@@ -814,9 +792,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
const uint32 offset = (arg_offset); \
const uint32 mask = (arg_mask); \
const uint32 old_PC = PC; \
\
EXP_ILL_CHECK(if(BDBT) { PSX_DBG(PSX_DBG_WARNING, "[CPU] Branch instruction at PC=0x%08x in branch delay slot: SR=0x%08x\n", PC, CP0.SR);}) \
\
PC = new_PC; \
new_PC += 4; \
BDBT = 2; \
......@@ -1212,7 +1187,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
default:
// Tested to be rather NOPish
DO_LDS();
PSX_DBG(PSX_DBG_WARNING, "[CPU] MFC0 from unmapped CP0 register %u.\n", rd);
break;
}
break;
......@@ -1238,12 +1212,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
break;
case CP0REG_DCIC:
#ifdef DEBUG
if(val)
{
PSX_DBG(PSX_DBG_WARNING, "[CPU] Non-zero write to DCIC: 0x%08x\n", val);
}
#endif
CP0.DCIC = val & 0xFF80003F;
break;
......@@ -1274,11 +1242,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
{
const uint32 immediate = (int32)(int16)(instr & 0xFFFF);
const bool result = (false == (bool)(instr & (1U << 16)));
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] BC0x instruction(0x%08x) @ PC=0x%08x\n", instr, PC);
#endif
DO_BRANCH(result, (immediate << 2), ~0U, false, 0);
}
break;
......@@ -1400,11 +1363,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
{
const uint32 immediate = (int32)(int16)(instr & 0xFFFF);
const bool result = (false == (bool)(instr & (1U << 16)));
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] BC2x instruction(0x%08x) @ PC=0x%08x\n", instr, PC);
#endif
DO_BRANCH(result, (immediate << 2), ~0U, false, 0);
}
break;
......@@ -1433,11 +1391,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
else
{
const uint32 sub_op = (instr >> 21) & 0x1F;
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] COP%u instruction(0x%08x) @ PC=0x%08x\n", (instr >> 26) & 0x3, instr, PC);
#endif
if(sub_op == 0x08 || sub_op == 0x0C)
{
const uint32 immediate = (int32)(int16)(instr & 0xFFFF);
......@@ -1469,14 +1422,8 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
new_PC = Exception(EXCEPTION_ADEL, PC, new_PC, instr);
}
else
{
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] LWC%u instruction(0x%08x) @ PC=0x%08x\n", (instr >> 26) & 0x3, instr, PC);
#endif
ReadMemory<uint32>(timestamp, address, false, true);
}
}
END_OPF;
//
......@@ -1528,13 +1475,6 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
CP0.BADA = address;
new_PC = Exception(EXCEPTION_ADES, PC, new_PC, instr);
}
#ifdef DEBUG
else
{
PSX_DBG(PSX_DBG_WARNING, "[CPU] SWC%u instruction(0x%08x) @ PC=0x%08x\n", (instr >> 26) & 0x3, instr, PC);
//WriteMemory<uint32>(timestamp, address, SOMETHING);
}
#endif
}
END_OPF;
......
......@@ -36,11 +36,6 @@
#include "input/multitap.h"
//#define PSX_FIODBGINFO(format, ...) { /* printf(format " -- timestamp=%d -- PAD temp\n", ## __VA_ARGS__, timestamp); */ }
static void PSX_FIODBGINFO(const char *format, ...)
{
}
InputDevice::InputDevice() :
chair_r(0),
chair_g(0),
......@@ -543,7 +538,6 @@ INLINE void FrontIO::DoDSRIRQ(void)
{
if(Control & 0x1000)
{
PSX_FIODBGINFO("[DSR] IRQ");
istatus = true;
::IRQ_Assert(IRQ_SIO, true);
}
......@@ -554,8 +548,6 @@ void FrontIO::Write(int32_t timestamp, uint32_t A, uint32_t V)
{
assert(!(A & 0x1));
PSX_FIODBGINFO("[FIO] Write: %08x %08x", A, V);
Update(timestamp);
switch(A & 0xF)
......@@ -571,12 +563,6 @@ void FrontIO::Write(int32_t timestamp, uint32_t A, uint32_t V)
break;
case 0xa:
#if 0
if(ClockDivider > 0 && ((V & 0x2000) != (Control & 0x2000)) && ((Control & 0x2) == (V & 0x2)) )
PSX_DBG(PSX_DBG_WARNING, "FIO device selection changed during comm %04x->%04x\n", Control, V);
#endif
//printf("Control: %d, %04x\n", timestamp, V);
Control = V & 0x3F2F;
if(V & 0x10)
......@@ -700,9 +686,6 @@ uint32_t FrontIO::Read(int32_t timestamp, uint32_t A)
break;
}
if((A & 0xF) != 0x4)
PSX_FIODBGINFO("[FIO] Read: %08x %08x", A, ret);
return(ret);
}
......@@ -759,7 +742,6 @@ int32_t FrontIO::Update(int32_t timestamp)
if(!TransmitBitCounter)
{
need_start_stop_check = true;
PSX_FIODBGINFO("[FIO] Data transmitted: %08x", TransmitBuffer);
TransmitInProgress = false;
if(Control & 0x400)
......@@ -783,8 +765,6 @@ int32_t FrontIO::Update(int32_t timestamp)
if(!ReceiveBitCounter)
{
need_start_stop_check = true;
PSX_FIODBGINFO("[FIO] Data received: %08x", ReceiveBuffer);
ReceiveInProgress = false;
ReceiveBufferAvail = true;
......
......@@ -181,7 +181,6 @@ static void Command_FBFill(PS_GPU* gpu, const uint32 *cb)
int32_t width = (((cb[2] >> 0) & 0x3FF) + 0xF) & ~0xF;
int32_t height = (cb[2] >> 16) & 0x1FF;
//printf("[GPU] FB Fill %d:%d w=%d, h=%d\n", destX, destY, width, height);
gpu->DrawTimeAvail -= 46; // Approximate
for(y = 0; y < height; y++)
......@@ -222,7 +221,6 @@ static void Command_FBCopy(PS_GPU* g, const uint32 *cb)
height = 0x200;
InvalidateTexCache(g);
//printf("FB Copy: %d %d %d %d %d %d\n", sourceX, sourceY, destX, destY, width, height);
g->DrawTimeAvail -= (width * height) * 2;
......@@ -313,15 +311,11 @@ static void Command_FBRead(PS_GPU* g, const uint32 *cb)
if (!rsx_intf_has_software_renderer())
{
//fprintf(stderr, "Hard GPU readback (X: %d, Y: %d, W: %d, H: %d)\n", g->FBRW_X, g->FBRW_Y, g->FBRW_W, g->FBRW_H);
/* Need a hard readback from GPU renderer. */
bool supported = rsx_intf_read_vram(
g->FBRW_X, g->FBRW_Y,
g->FBRW_W, g->FBRW_H,
g->vram);
//if (!supported)
// fprintf(stderr, "Game is trying to reading back from VRAM, but SW rendering is not enabled, and RSX backend does not support it.\n");
}
}
......@@ -336,12 +330,7 @@ static void Command_DrawMode(PS_GPU* g, const uint32 *cb)
g->dfe = (cmdw >> 10) & 1;
if (g->dfe)
{
GPU.display_possibly_dirty = true;
//printf("Display possibly dirty this frame\n");
}
//printf("*******************DFE: %d -- scanline=%d\n", dfe, scanline);
}
static void Command_TexWindow(PS_GPU* g, const uint32 *cb)
......@@ -375,13 +364,10 @@ static void Command_DrawingOffset(PS_GPU* g, const uint32 *cb)
{
g->OffsX = sign_x_to_s32(11, (*cb & 2047));
g->OffsY = sign_x_to_s32(11, ((*cb >> 11) & 2047));
//fprintf(stderr, "[GPU] Drawing offset: %d(raw=%d) %d(raw=%d) -- %d\n", OffsX, *cb, OffsY, *cb >> 11, scanline);
}
static void Command_MaskSetting(PS_GPU* g, const uint32 *cb)
{
//printf("Mask setting: %08x\n", *cb);
g->MaskSetOR = (*cb & 1) ? 0x8000 : 0x0000;
g->MaskEvalAND = (*cb & 2) ? 0x8000 : 0x0000;
......@@ -1112,10 +1098,7 @@ static INLINE void GPU_WriteCB(uint32_t InData, uint32_t addr)
if(GPU_BlitterFIFO.in_count >= 0x10
&& (GPU.InCmd != INCMD_NONE ||
(GPU_BlitterFIFO.in_count - 0x10) >= Commands[GPU_BlitterFIFO.Peek() >> 24].fifo_fb_len))
{
PSX_DBG(PSX_DBG_WARNING, "GPU FIFO overflow!!!\n");
return;
}
if(PGXP_enabled())
PGXP_WriteFIFO(ReadMem(addr), GPU_BlitterFIFO.write_pos);
......@@ -1146,7 +1129,6 @@ void GPU_Write(const int32_t timestamp, uint32_t A, uint32_t V)
PSX_WARNING("[GPU] Unknown control command %02x - %06x", command, V);
break;
case 0x00: // Reset GPU
//printf("\n\n************ Soft Reset %u ********* \n\n", scanline);
GPU_SoftReset();
rsx_intf_set_draw_area(GPU.ClipX0, GPU.ClipY0,
GPU.ClipX1, GPU.ClipY1);
......@@ -1198,7 +1180,6 @@ void GPU_Write(const int32_t timestamp, uint32_t A, uint32_t V)
break;
case 0x08:
//printf("\n\nDISPLAYMODE SET: 0x%02x, %u *************************\n\n\n", V & 0xFF, scanline);
GPU.DisplayMode = V & 0xFF;
RSX_UpdateDisplayMode();
break;
......@@ -1252,9 +1233,6 @@ void GPU_Write(const int32_t timestamp, uint32_t A, uint32_t V)
}
else // GP0 ("Data")
{
//uint32_t command = V >> 24;
//printf("Meow command: %02x\n", command);
//assert(!(GPU.DMAControl & 2));
GPU_WriteCB(V, A);
}
}
......@@ -1422,8 +1400,6 @@ int32_t GPU_Update(const int32_t sys_timestamp)
const uint32_t dmw = 2800 / DotClockRatios[dmc]; // Must be <= 768
int32_t sys_clocks = sys_timestamp - GPU.lastts;
//printf("GPUISH: %d\n", sys_timestamp - GPU.lastts);
if(!sys_clocks)
goto TheEnd;
......@@ -1448,10 +1424,7 @@ int32_t GPU_Update(const int32_t sys_timestamp)
int32 dot_clocks;
if(chunk_clocks > GPU.LineClockCounter)
{
//printf("Chunk: %u, LCC: %u\n", chunk_clocks, LineClockCounter);
chunk_clocks = GPU.LineClockCounter;
}
gpu_clocks -= chunk_clocks;
GPU.LineClockCounter -= chunk_clocks;
......@@ -1514,19 +1487,13 @@ int32_t GPU_Update(const int32_t sys_timestamp)
if(GPU.scanline == (GPU.HardwarePALType ? 308 : 256)) // Will need to be redone if we ever allow for visible vertical overscan with NTSC.
{
if(GPU.sl_zero_reached)
{
//printf("Req Exit(visible fallthrough case): %u\n", GPU.scanline);
PSX_RequestMLExit();
}
}
if(GPU.scanline == (GPU.LinesPerField - 1))
{
if(GPU.sl_zero_reached)
{
//printf("Req Exit(final fallthrough case): %u\n", GPU.scanline);
PSX_RequestMLExit();
}
if(GPU.DisplayMode & DISP_INTERLACED)
GPU.field = !GPU.field;
......@@ -1574,11 +1541,6 @@ int32_t GPU_Update(const int32_t sys_timestamp)
memset(dest, 0, 384 * sizeof(int32));
}
//char buffer[256];
//snprintf(buffer, sizeof(buffer), "VIDEO STANDARD MISMATCH");
//DrawTextTrans(surface->pixels + ((DisplayRect->h / 2) - (13 / 2)) * surface->pitch32, surface->pitch32 << 2, DisplayRect->w, (UTF8*)buffer,
//MAKECOLOR(0x00, 0xFF, 0x00), true, MDFN_FONT_6x13_12x13, 0);
}
else
{
......@@ -1619,19 +1581,9 @@ int32_t GPU_Update(const int32_t sys_timestamp)
// FMV(which we don't handle here because low-latency in that case is not so important).
//
if(GPU.scanline >= (GPU.HardwarePALType ? 260 : 232))
{
//printf("Req Exit(vblank case): %u\n", GPU.scanline);
PSX_RequestMLExit();
}
#if 0
else
{
//printf("VBlank too early, chickening out early exit: %u!\n", GPU.scanline);
}
#endif
}
//printf("VBLANK: %u\n", GPU.scanline);
GPU.InVBlank = true;