core/video_core: Fix a bunch of u64 -> u32 warnings.
This commit is contained in:
parent
9e8608e8b1
commit
93480b10ef
8 changed files with 26 additions and 26 deletions
|
@ -69,8 +69,8 @@ void MemoryInit(u32 mem_type) {
|
||||||
// app_mem_malloc does not always match the configured size for memory_region[0]: in case the
|
// app_mem_malloc does not always match the configured size for memory_region[0]: in case the
|
||||||
// n3DS type override is in effect it reports the size the game expects, not the real one.
|
// n3DS type override is in effect it reports the size the game expects, not the real one.
|
||||||
config_mem.app_mem_alloc = memory_region_sizes[mem_type][0];
|
config_mem.app_mem_alloc = memory_region_sizes[mem_type][0];
|
||||||
config_mem.sys_mem_alloc = memory_regions[1].size;
|
config_mem.sys_mem_alloc = static_cast<u32_le>(memory_regions[1].size);
|
||||||
config_mem.base_mem_alloc = memory_regions[2].size;
|
config_mem.base_mem_alloc = static_cast<u32_le>(memory_regions[2].size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryShutdown() {
|
void MemoryShutdown() {
|
||||||
|
|
|
@ -37,7 +37,7 @@ PageTable* GetCurrentPageTable() {
|
||||||
return current_page_table;
|
return current_page_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MapPages(PageTable& page_table, VAddr base, u32 size, u8* memory, PageType type) {
|
static void MapPages(PageTable& page_table, VAddr base, u64 size, u8* memory, PageType type) {
|
||||||
LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE,
|
LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE,
|
||||||
(base + size) * PAGE_SIZE);
|
(base + size) * PAGE_SIZE);
|
||||||
|
|
||||||
|
@ -58,13 +58,13 @@ static void MapPages(PageTable& page_table, VAddr base, u32 size, u8* memory, Pa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target) {
|
void MapMemoryRegion(PageTable& page_table, VAddr base, u64 size, u8* target) {
|
||||||
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
|
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
|
||||||
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
|
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
|
||||||
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, PageType::Memory);
|
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, PageType::Memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer mmio_handler) {
|
void MapIoRegion(PageTable& page_table, VAddr base, u64 size, MMIORegionPointer mmio_handler) {
|
||||||
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
|
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
|
||||||
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
|
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
|
||||||
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Special);
|
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Special);
|
||||||
|
@ -72,7 +72,7 @@ void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer
|
||||||
page_table.special_regions.emplace_back(SpecialRegion{base, size, mmio_handler});
|
page_table.special_regions.emplace_back(SpecialRegion{base, size, mmio_handler});
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnmapRegion(PageTable& page_table, VAddr base, u32 size) {
|
void UnmapRegion(PageTable& page_table, VAddr base, u64 size) {
|
||||||
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
|
ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: %08X", size);
|
||||||
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
|
ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: %08X", base);
|
||||||
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Unmapped);
|
MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, nullptr, PageType::Unmapped);
|
||||||
|
@ -334,7 +334,7 @@ u8* GetPhysicalPointer(PAddr address) {
|
||||||
return target_pointer;
|
return target_pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerMarkRegionCached(PAddr start, u32 size, int count_delta) {
|
void RasterizerMarkRegionCached(PAddr start, u64 size, int count_delta) {
|
||||||
if (start == 0) {
|
if (start == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -413,13 +413,13 @@ void RasterizerMarkRegionCached(PAddr start, u32 size, int count_delta) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerFlushRegion(PAddr start, u32 size) {
|
void RasterizerFlushRegion(PAddr start, u64 size) {
|
||||||
if (VideoCore::g_renderer != nullptr) {
|
if (VideoCore::g_renderer != nullptr) {
|
||||||
VideoCore::g_renderer->Rasterizer()->FlushRegion(start, size);
|
VideoCore::g_renderer->Rasterizer()->FlushRegion(start, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size) {
|
void RasterizerFlushAndInvalidateRegion(PAddr start, u64 size) {
|
||||||
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
|
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
|
||||||
// null here
|
// null here
|
||||||
if (VideoCore::g_renderer != nullptr) {
|
if (VideoCore::g_renderer != nullptr) {
|
||||||
|
@ -427,7 +427,7 @@ void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode) {
|
void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode) {
|
||||||
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
|
// Since pages are unmapped on shutdown after video core is shutdown, the renderer may be
|
||||||
// null here
|
// null here
|
||||||
if (VideoCore::g_renderer != nullptr) {
|
if (VideoCore::g_renderer != nullptr) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ enum class PageType {
|
||||||
|
|
||||||
struct SpecialRegion {
|
struct SpecialRegion {
|
||||||
VAddr base;
|
VAddr base;
|
||||||
u32 size;
|
u64 size;
|
||||||
MMIORegionPointer handler;
|
MMIORegionPointer handler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -247,17 +247,17 @@ u8* GetPhysicalPointer(PAddr address);
|
||||||
* Adds the supplied value to the rasterizer resource cache counter of each
|
* Adds the supplied value to the rasterizer resource cache counter of each
|
||||||
* page touching the region.
|
* page touching the region.
|
||||||
*/
|
*/
|
||||||
void RasterizerMarkRegionCached(PAddr start, u32 size, int count_delta);
|
void RasterizerMarkRegionCached(PAddr start, u64 size, int count_delta);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flushes any externally cached rasterizer resources touching the given region.
|
* Flushes any externally cached rasterizer resources touching the given region.
|
||||||
*/
|
*/
|
||||||
void RasterizerFlushRegion(PAddr start, u32 size);
|
void RasterizerFlushRegion(PAddr start, u64 size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flushes and invalidates any externally cached rasterizer resources touching the given region.
|
* Flushes and invalidates any externally cached rasterizer resources touching the given region.
|
||||||
*/
|
*/
|
||||||
void RasterizerFlushAndInvalidateRegion(PAddr start, u32 size);
|
void RasterizerFlushAndInvalidateRegion(PAddr start, u64 size);
|
||||||
|
|
||||||
enum class FlushMode {
|
enum class FlushMode {
|
||||||
/// Write back modified surfaces to RAM
|
/// Write back modified surfaces to RAM
|
||||||
|
@ -270,6 +270,6 @@ enum class FlushMode {
|
||||||
* Flushes and invalidates any externally cached rasterizer resources touching the given virtual
|
* Flushes and invalidates any externally cached rasterizer resources touching the given virtual
|
||||||
* address region.
|
* address region.
|
||||||
*/
|
*/
|
||||||
void RasterizerFlushVirtualRegion(VAddr start, u32 size, FlushMode mode);
|
void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode);
|
||||||
|
|
||||||
} // namespace Memory
|
} // namespace Memory
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace Memory {
|
||||||
* @param size The amount of bytes to map. Must be page-aligned.
|
* @param size The amount of bytes to map. Must be page-aligned.
|
||||||
* @param target Buffer with the memory backing the mapping. Must be of length at least `size`.
|
* @param target Buffer with the memory backing the mapping. Must be of length at least `size`.
|
||||||
*/
|
*/
|
||||||
void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target);
|
void MapMemoryRegion(PageTable& page_table, VAddr base, u64 size, u8* target);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a region of the emulated process address space as a IO region.
|
* Maps a region of the emulated process address space as a IO region.
|
||||||
|
@ -26,7 +26,7 @@ void MapMemoryRegion(PageTable& page_table, VAddr base, u32 size, u8* target);
|
||||||
* @param size The amount of bytes to map. Must be page-aligned.
|
* @param size The amount of bytes to map. Must be page-aligned.
|
||||||
* @param mmio_handler The handler that backs the mapping.
|
* @param mmio_handler The handler that backs the mapping.
|
||||||
*/
|
*/
|
||||||
void MapIoRegion(PageTable& page_table, VAddr base, u32 size, MMIORegionPointer mmio_handler);
|
void MapIoRegion(PageTable& page_table, VAddr base, u64 size, MMIORegionPointer mmio_handler);
|
||||||
|
|
||||||
void UnmapRegion(PageTable& page_table, VAddr base, u32 size);
|
void UnmapRegion(PageTable& page_table, VAddr base, u64 size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,11 +36,11 @@ public:
|
||||||
virtual void FlushAll() = 0;
|
virtual void FlushAll() = 0;
|
||||||
|
|
||||||
/// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory
|
/// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory
|
||||||
virtual void FlushRegion(PAddr addr, u32 size) = 0;
|
virtual void FlushRegion(PAddr addr, u64 size) = 0;
|
||||||
|
|
||||||
/// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory
|
/// Notify rasterizer that any caches of the specified region should be flushed to 3DS memory
|
||||||
/// and invalidated
|
/// and invalidated
|
||||||
virtual void FlushAndInvalidateRegion(PAddr addr, u32 size) = 0;
|
virtual void FlushAndInvalidateRegion(PAddr addr, u64 size) = 0;
|
||||||
|
|
||||||
/// Attempt to use a faster method to perform a display transfer with is_texture_copy = 0
|
/// Attempt to use a faster method to perform a display transfer with is_texture_copy = 0
|
||||||
virtual bool AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) {
|
virtual bool AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) {
|
||||||
|
|
|
@ -889,12 +889,12 @@ void RasterizerOpenGL::FlushAll() {
|
||||||
res_cache.FlushAll();
|
res_cache.FlushAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerOpenGL::FlushRegion(PAddr addr, u32 size) {
|
void RasterizerOpenGL::FlushRegion(PAddr addr, u64 size) {
|
||||||
MICROPROFILE_SCOPE(OpenGL_CacheManagement);
|
MICROPROFILE_SCOPE(OpenGL_CacheManagement);
|
||||||
res_cache.FlushRegion(addr, size, nullptr, false);
|
res_cache.FlushRegion(addr, size, nullptr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerOpenGL::FlushAndInvalidateRegion(PAddr addr, u32 size) {
|
void RasterizerOpenGL::FlushAndInvalidateRegion(PAddr addr, u64 size) {
|
||||||
MICROPROFILE_SCOPE(OpenGL_CacheManagement);
|
MICROPROFILE_SCOPE(OpenGL_CacheManagement);
|
||||||
res_cache.FlushRegion(addr, size, nullptr, true);
|
res_cache.FlushRegion(addr, size, nullptr, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@ public:
|
||||||
void DrawTriangles() override;
|
void DrawTriangles() override;
|
||||||
void NotifyPicaRegisterChanged(u32 id) override;
|
void NotifyPicaRegisterChanged(u32 id) override;
|
||||||
void FlushAll() override;
|
void FlushAll() override;
|
||||||
void FlushRegion(PAddr addr, u32 size) override;
|
void FlushRegion(PAddr addr, u64 size) override;
|
||||||
void FlushAndInvalidateRegion(PAddr addr, u32 size) override;
|
void FlushAndInvalidateRegion(PAddr addr, u64 size) override;
|
||||||
bool AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) override;
|
bool AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) override;
|
||||||
bool AccelerateTextureCopy(const GPU::Regs::DisplayTransferConfig& config) override;
|
bool AccelerateTextureCopy(const GPU::Regs::DisplayTransferConfig& config) override;
|
||||||
bool AccelerateFill(const GPU::Regs::MemoryFillConfig& config) override;
|
bool AccelerateFill(const GPU::Regs::MemoryFillConfig& config) override;
|
||||||
|
|
|
@ -21,7 +21,7 @@ class SWRasterizer : public RasterizerInterface {
|
||||||
void DrawTriangles() override {}
|
void DrawTriangles() override {}
|
||||||
void NotifyPicaRegisterChanged(u32 id) override {}
|
void NotifyPicaRegisterChanged(u32 id) override {}
|
||||||
void FlushAll() override {}
|
void FlushAll() override {}
|
||||||
void FlushRegion(PAddr addr, u32 size) override {}
|
void FlushRegion(PAddr addr, u64 size) override {}
|
||||||
void FlushAndInvalidateRegion(PAddr addr, u32 size) override {}
|
void FlushAndInvalidateRegion(PAddr addr, u64 size) override {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue