Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
34b009cf
There was an error fetching the commit references. Please try again later.
Commit
34b009cf
authored
10 years ago
by
Yuri Kunde Schlesner
Browse files
Options
Downloads
Patches
Plain Diff
Clean-up mem_map constants and fix framebuffer translation errors
parent
64196976
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/hle/service/gsp_gpu.cpp
+6
-4
6 additions, 4 deletions
src/core/hle/service/gsp_gpu.cpp
src/core/mem_map.h
+10
-16
10 additions, 16 deletions
src/core/mem_map.h
src/core/mem_map_funcs.cpp
+11
-7
11 additions, 7 deletions
src/core/mem_map_funcs.cpp
with
27 additions
and
27 deletions
src/core/hle/service/gsp_gpu.cpp
+
6
−
4
View file @
34b009cf
...
...
@@ -204,16 +204,18 @@ static void ReadHWRegs(Service::Interface* self) {
static
void
SetBufferSwap
(
u32
screen_id
,
const
FrameBufferInfo
&
info
)
{
u32
base_address
=
0x400000
;
PAddr
phys_address_left
=
Memory
::
VirtualToPhysicalAddress
(
info
.
address_left
);
PAddr
phys_address_right
=
Memory
::
VirtualToPhysicalAddress
(
info
.
address_right
);
if
(
info
.
active_fb
==
0
)
{
WriteHWRegs
(
base_address
+
4
*
static_cast
<
u32
>
(
GPU_REG_INDEX
(
framebuffer_config
[
screen_id
].
address_left1
)),
4
,
&
info
.
address_left
);
&
phys_
address_left
);
WriteHWRegs
(
base_address
+
4
*
static_cast
<
u32
>
(
GPU_REG_INDEX
(
framebuffer_config
[
screen_id
].
address_right1
)),
4
,
&
info
.
address_right
);
&
phys_
address_right
);
}
else
{
WriteHWRegs
(
base_address
+
4
*
static_cast
<
u32
>
(
GPU_REG_INDEX
(
framebuffer_config
[
screen_id
].
address_left2
)),
4
,
&
info
.
address_left
);
&
phys_
address_left
);
WriteHWRegs
(
base_address
+
4
*
static_cast
<
u32
>
(
GPU_REG_INDEX
(
framebuffer_config
[
screen_id
].
address_right2
)),
4
,
&
info
.
address_right
);
&
phys_
address_right
);
}
WriteHWRegs
(
base_address
+
4
*
static_cast
<
u32
>
(
GPU_REG_INDEX
(
framebuffer_config
[
screen_id
].
stride
)),
4
,
&
info
.
stride
);
...
...
This diff is collapsed.
Click to expand it.
src/core/mem_map.h
+
10
−
16
View file @
34b009cf
...
...
@@ -27,10 +27,16 @@ enum : u32 {
MPCORE_PRIV_PADDR_END
=
(
MPCORE_PRIV_PADDR
+
MPCORE_PRIV_SIZE
),
FCRAM_SIZE
=
0x08000000
,
///< FCRAM size
FCRAM_PADDR
=
0x20000000
,
///< FCRAM physical address
FCRAM_PADDR_END
=
(
FCRAM_PADDR
+
FCRAM_SIZE
),
///< FCRAM end of physical space
FCRAM_VADDR
=
0x08000000
,
///< FCRAM virtual address
FCRAM_VADDR_END
=
(
FCRAM_VADDR
+
FCRAM_SIZE
),
///< FCRAM end of virtual space
FCRAM_PADDR
=
0x20000000
,
///< FCRAM physical address
FCRAM_PADDR_END
=
(
FCRAM_PADDR
+
FCRAM_SIZE
),
HEAP_SIZE
=
FCRAM_SIZE
,
///< Application heap size
HEAP_VADDR
=
0x08000000
,
HEAP_VADDR_END
=
(
HEAP_VADDR
+
HEAP_SIZE
),
HEAP_LINEAR_SIZE
=
FCRAM_SIZE
,
HEAP_LINEAR_VADDR
=
0x14000000
,
HEAP_LINEAR_VADDR_END
=
(
HEAP_LINEAR_VADDR
+
HEAP_LINEAR_SIZE
),
AXI_WRAM_SIZE
=
0x00080000
,
///< AXI WRAM size
AXI_WRAM_PADDR
=
0x1FF80000
,
///< AXI WRAM physical address
...
...
@@ -65,18 +71,6 @@ enum : u32 {
SYSTEM_MEMORY_VADDR
=
0x04000000
,
SYSTEM_MEMORY_VADDR_END
=
(
SYSTEM_MEMORY_VADDR
+
SYSTEM_MEMORY_SIZE
),
HEAP_SIZE
=
FCRAM_SIZE
,
///< Application heap size
//HEAP_PADDR = HEAP_GSP_SIZE,
//HEAP_PADDR_END = (HEAP_PADDR + HEAP_SIZE),
HEAP_VADDR
=
0x08000000
,
HEAP_VADDR_END
=
(
HEAP_VADDR
+
HEAP_SIZE
),
HEAP_LINEAR_SIZE
=
0x08000000
,
///< Linear heap size... TODO: Define correctly?
HEAP_LINEAR_VADDR
=
0x14000000
,
HEAP_LINEAR_VADDR_END
=
(
HEAP_LINEAR_VADDR
+
HEAP_LINEAR_SIZE
),
HEAP_LINEAR_PADDR
=
0x00000000
,
HEAP_LINEAR_PADDR_END
=
(
HEAP_LINEAR_PADDR
+
HEAP_LINEAR_SIZE
),
HARDWARE_IO_SIZE
=
0x01000000
,
HARDWARE_IO_PADDR
=
0x10000000
,
///< IO physical address start
HARDWARE_IO_VADDR
=
0x1EC00000
,
///< IO virtual address start
...
...
This diff is collapsed.
Click to expand it.
src/core/mem_map_funcs.cpp
+
11
−
7
View file @
34b009cf
...
...
@@ -23,10 +23,12 @@ VAddr PhysicalToVirtualAddress(const PAddr addr) {
// to virtual address translations here. This is quite hacky, but necessary until we implement
// proper MMU emulation.
// TODO: Screw it, I'll let bunnei figure out how to do this properly.
if
((
addr
>=
VRAM_PADDR
)
&&
(
addr
<
VRAM_PADDR_END
))
{
if
(
addr
==
0
)
{
return
0
;
}
else
if
((
addr
>=
VRAM_PADDR
)
&&
(
addr
<
VRAM_PADDR_END
))
{
return
addr
-
VRAM_PADDR
+
VRAM_VADDR
;
}
else
if
((
addr
>=
FCRAM_PADDR
)
&&
(
addr
<
FCRAM_PADDR_END
))
{
return
addr
-
FCRAM_PADDR
+
FCRAM
_VADDR
;
}
else
if
((
addr
>=
FCRAM_PADDR
)
&&
(
addr
<
FCRAM_PADDR_END
))
{
return
addr
-
FCRAM_PADDR
+
HEAP_LINEAR
_VADDR
;
}
LOG_ERROR
(
HW_Memory
,
"Unknown physical address @ 0x%08x"
,
addr
);
...
...
@@ -39,10 +41,12 @@ PAddr VirtualToPhysicalAddress(const VAddr addr) {
// to virtual address translations here. This is quite hacky, but necessary until we implement
// proper MMU emulation.
// TODO: Screw it, I'll let bunnei figure out how to do this properly.
if
((
addr
>=
VRAM_VADDR
)
&&
(
addr
<
VRAM_VADDR_END
))
{
return
addr
-
0x07000000
;
}
else
if
((
addr
>=
FCRAM_VADDR
)
&&
(
addr
<
FCRAM_VADDR_END
))
{
return
addr
-
FCRAM_VADDR
+
FCRAM_PADDR
;
if
(
addr
==
0
)
{
return
0
;
}
else
if
((
addr
>=
VRAM_VADDR
)
&&
(
addr
<
VRAM_VADDR_END
))
{
return
addr
-
VRAM_VADDR
+
VRAM_PADDR
;
}
else
if
((
addr
>=
HEAP_LINEAR_VADDR
)
&&
(
addr
<
HEAP_LINEAR_VADDR_END
))
{
return
addr
-
HEAP_LINEAR_VADDR
+
FCRAM_PADDR
;
}
LOG_ERROR
(
HW_Memory
,
"Unknown virtual address @ 0x%08x"
,
addr
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment