mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 08:15:33 +01:00
d266be5b56
Makes it more obvious which data is going into the savestate. It also allows PowerPCState and InstructionCache to potentially contain members that don't necessarily need to be saved to the save state. It also gets rid of any potential padding data being put into the save state.
43 lines
912 B
C++
43 lines
912 B
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
class PointerWrap;
|
|
|
|
namespace PowerPC
|
|
{
|
|
const u32 ICACHE_SETS = 128;
|
|
const u32 ICACHE_WAYS = 8;
|
|
// size of an instruction cache block in words
|
|
const u32 ICACHE_BLOCK_SIZE = 8;
|
|
|
|
const u32 ICACHE_EXRAM_BIT = 0x10000000;
|
|
const u32 ICACHE_VMEM_BIT = 0x20000000;
|
|
|
|
struct InstructionCache
|
|
{
|
|
u32 data[ICACHE_SETS][ICACHE_WAYS][ICACHE_BLOCK_SIZE];
|
|
u32 tags[ICACHE_SETS][ICACHE_WAYS];
|
|
u32 plru[ICACHE_SETS];
|
|
u32 valid[ICACHE_SETS];
|
|
|
|
u32 way_from_valid[255];
|
|
u32 way_from_plru[128];
|
|
|
|
u8 lookup_table[1 << 20];
|
|
u8 lookup_table_ex[1 << 21];
|
|
u8 lookup_table_vmem[1 << 20];
|
|
|
|
InstructionCache();
|
|
u32 ReadInstruction(u32 addr);
|
|
void Invalidate(u32 addr);
|
|
void Init();
|
|
void Reset();
|
|
void DoState(PointerWrap& p);
|
|
};
|
|
} // namespace PowerPC
|