mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
6d916762fb
Yet another story of games loading weird shit into registers. For some reason, Burnout 2 would (in rare situations) load invalid addresses into cp_state.array_bases. What would the real hardware do in this situation? Who knows, Burnout 2 doesn't actually enable the vertex array with the invalid address so nothing kinky happens. But dolphin tries to optimise things and starts using the address as soon as it is loaded into memory. This causes GetPointer (which is now much more vocal) to throw an error. The Fix: We don't call GetPointer until we are sure the vertex array has been enabled.
30 lines
690 B
C++
30 lines
690 B
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "VideoCommon/DataReader.h"
|
|
#include "VideoCommon/NativeVertexFormat.h"
|
|
|
|
namespace VertexLoaderManager
|
|
{
|
|
void Init();
|
|
void Shutdown();
|
|
|
|
void MarkAllDirty();
|
|
|
|
// Returns -1 if buf_size is insufficient, else the amount of bytes consumed
|
|
int RunVertices(int vtx_attr_group, int primitive, int count, DataReader src, bool skip_drawing, bool is_preprocess);
|
|
|
|
// For debugging
|
|
void AppendListToString(std::string *dest);
|
|
|
|
NativeVertexFormat* GetCurrentVertexFormat();
|
|
}
|
|
|
|
void ComputeCachedArrayBases();
|