Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
flycast
Commits
d3d3e838
Commit
d3d3e838
authored
Apr 11, 2021
by
Libretro-Admin
Browse files
Backport
https://github.com/flyinghead/flycast/commit/913fbef952bf0c881d8a3a517bd4c90a489960ba
parent
9a897f5a
Changes
20
Hide whitespace changes
Inline
Side-by-side
core/hw/naomi/awcartridge.cpp
View file @
d3d3e838
...
...
@@ -386,11 +386,11 @@ void AWCartridge::recalc_dma_offset(int mode)
}
}
void
*
AWCartridge
::
GetDmaPtr
(
u32
&
limit
)
void
*
AWCartridge
::
GetDmaPtr
(
u32
&
size
)
{
limit
=
std
::
min
(
std
::
min
(
limit
,
(
u32
)
32
),
dma_limit
-
dma_offset
);
size
=
std
::
min
(
std
::
min
(
size
,
32u
),
dma_limit
-
dma_offset
);
u32
offset
=
dma_offset
/
2
;
for
(
u32
i
=
0
;
i
<
limit
/
2
;
i
++
)
for
(
u32
i
=
0
;
i
<
size
/
2
;
i
++
)
decrypted_buf
[
i
]
=
decrypt16
(
offset
+
i
);
// printf("AWCART Decrypted data @ %08x:\n", dma_offset);
...
...
core/hw/naomi/awcartridge.h
View file @
d3d3e838
...
...
@@ -23,7 +23,7 @@ public:
virtual
u32
ReadMem
(
u32
address
,
u32
size
)
override
;
virtual
void
WriteMem
(
u32
address
,
u32
data
,
u32
size
)
override
;
virtual
void
*
GetDmaPtr
(
u32
&
limit
)
override
;
virtual
void
*
GetDmaPtr
(
u32
&
size
)
override
;
virtual
void
AdvancePtr
(
u32
size
)
override
;
virtual
std
::
string
GetGameId
()
override
;
...
...
core/hw/naomi/m4cartridge.cpp
View file @
d3d3e838
...
...
@@ -150,7 +150,7 @@ bool M4Cartridge::Read(u32 offset, u32 size, void *dst) {
return
NaomiCartridge
::
Read
(
offset
&
0x1ffffffe
,
size
,
dst
);
}
void
*
M4Cartridge
::
GetDmaPtr
(
u32
&
limit
)
void
*
M4Cartridge
::
GetDmaPtr
(
u32
&
size
)
{
static
u8
retzero
[
2
]
=
{
0
,
0
};
...
...
@@ -158,7 +158,7 @@ void *M4Cartridge::GetDmaPtr(u32 &limit)
int
fpr_num
=
m4id
&
0x7f
;
if
(((
rom_cur_address
>>
26
)
&
0x07
)
<
fpr_num
)
{
limit
=
min
(
limit
,
(
u32
)
2
);
size
=
std
::
min
(
size
,
2u
);
return
&
cfidata
[
rom_cur_address
&
0xffff
];
}
}
...
...
@@ -176,7 +176,7 @@ void *M4Cartridge::GetDmaPtr(u32 &limit)
}
if
(
encryption
)
{
limit
=
min
(
limit
,
(
u32
)
sizeof
(
buffer
));
size
=
std
::
min
(
size
,
(
u32
)
sizeof
(
buffer
));
return
buffer
;
}
...
...
@@ -184,12 +184,12 @@ void *M4Cartridge::GetDmaPtr(u32 &limit)
{
if
((
DmaOffset
&
0x1ffffffe
)
<
RomSize
)
{
limit
=
min
(
limit
,
RomSize
-
(
DmaOffset
&
0x1ffffffe
));
size
=
std
::
min
(
size
,
RomSize
-
(
DmaOffset
&
0x1ffffffe
));
return
RomPtr
+
(
DmaOffset
&
0x1ffffffe
);
}
else
{
limit
=
2
;
size
=
2
;
return
retzero
;
}
}
...
...
core/hw/naomi/naomi.h
View file @
d3d3e838
...
...
@@ -8,15 +8,15 @@ void naomi_reg_Init();
void
naomi_reg_Term
();
void
naomi_reg_Reset
(
bool
Manual
);
u32
ReadMem_naomi
(
u32
Addr
,
u32
s
z
);
void
WriteMem_naomi
(
u32
Addr
,
u32
data
,
u32
s
z
);
u32
ReadMem_naomi
(
u32
Addr
,
u32
s
ize
);
void
WriteMem_naomi
(
u32
Addr
,
u32
data
,
u32
s
ize
);
void
NaomiBoardIDWrite
(
const
u16
Data
);
void
NaomiBoardIDWriteControl
(
const
u16
Data
);
u16
NaomiBoardIDRead
();
u16
NaomiGameIDRead
();
void
NaomiGameIDWrite
(
const
u16
Data
);
void
naomi_process
(
u32
r3c
,
u32
r40
,
u32
r44
,
u32
r48
);
void
naomi_process
(
u32
command
,
u32
offset1
,
u32
parameterl
,
u32
parameterh
);
extern
u32
reg_dimm_command
;
// command, written, 0x1E03 some flag ?
extern
u32
reg_dimm_offsetl
;
...
...
core/hw/pvr/pvr_regs.h
View file @
d3d3e838
...
...
@@ -9,9 +9,7 @@
extern
u8
pvr_regs
[
pvr_RegSize
];
void
Regs_Reset
(
bool
Manual
);
void
Regs_Reset
(
bool
hard
);
#define ID_addr 0x00000000 // R Device ID
#define REVISION_addr 0x00000004 // R Revision number
...
...
core/hw/sh4/dyna/blockmanager.h
View file @
d3d3e838
...
...
@@ -110,7 +110,7 @@ void bm_Periodical_1s();
void
bm_Init
();
void
bm_Term
();
void
bm_vmem_pagefill
(
void
**
ptr
,
u32
PAGE_SZ
);
void
bm_vmem_pagefill
(
void
**
ptr
,
u32
size_bytes
);
bool
bm_RamWriteAccess
(
void
*
p
);
void
bm_RamWriteAccess
(
u32
addr
);
static
inline
bool
bm_IsRamPageProtected
(
u32
addr
)
...
...
core/hw/sh4/dyna/driver.cpp
View file @
d3d3e838
...
...
@@ -477,17 +477,17 @@ static bool recSh4_IsCpuRunning(void)
return
Sh4_int_IsCpuRunning
();
}
void
Get_Sh4Recompiler
(
sh4_if
*
rv
)
void
Get_Sh4Recompiler
(
sh4_if
*
cpu
)
{
rv
->
Run
=
recSh4_Run
;
rv
->
Stop
=
recSh4_Stop
;
rv
->
Start
=
recSh4_Start
;
rv
->
Step
=
recSh4_Step
;
rv
->
Skip
=
recSh4_Skip
;
rv
->
Reset
=
recSh4_Reset
;
rv
->
Init
=
recSh4_Init
;
rv
->
Term
=
recSh4_Term
;
rv
->
IsCpuRunning
=
recSh4_IsCpuRunning
;
rv
->
ResetCache
=
recSh4_ClearCache
;
cpu
->
Run
=
recSh4_Run
;
cpu
->
Stop
=
recSh4_Stop
;
cpu
->
Start
=
recSh4_Start
;
cpu
->
Step
=
recSh4_Step
;
cpu
->
Skip
=
recSh4_Skip
;
cpu
->
Reset
=
recSh4_Reset
;
cpu
->
Init
=
recSh4_Init
;
cpu
->
Term
=
recSh4_Term
;
cpu
->
IsCpuRunning
=
recSh4_IsCpuRunning
;
cpu
->
ResetCache
=
recSh4_ClearCache
;
}
#endif // FEAT_SHREC != DYNAREC_NONE
core/hw/sh4/dyna/ngen.h
View file @
d3d3e838
...
...
@@ -76,7 +76,7 @@ void emit_SetBaseAddr();
DynarecCodeEntryPtr
DYNACALL
rdv_FailedToFindBlock
(
u32
pc
);
DynarecCodeEntryPtr
DYNACALL
rdv_FailedToFindBlock_pc
();
//Called when a block check failed, and the block needs to be invalidated
DynarecCodeEntryPtr
DYNACALL
rdv_BlockCheckFail
(
u32
pc
);
DynarecCodeEntryPtr
DYNACALL
rdv_BlockCheckFail
(
u32
addr
);
//Called to compile code @pc
DynarecCodeEntryPtr
rdv_CompilePC
(
u32
blockcheck_failures
);
//Finds or compiles code @pc
...
...
core/hw/sh4/interpr/sh4_interpreter.cpp
View file @
d3d3e838
...
...
@@ -190,19 +190,19 @@ static void sh4_int_resetcache()
}
//Get an interface to sh4 interpreter
void
Get_Sh4Interpreter
(
sh4_if
*
rv
)
{
rv
->
Run
=
Sh4_int_Run
;
rv
->
Stop
=
Sh4_int_Stop
;
rv
->
Start
=
Sh4_int_Start
;
rv
->
Step
=
Sh4_int_Step
;
rv
->
Skip
=
Sh4_int_Skip
;
rv
->
Reset
=
Sh4_int_Reset
;
rv
->
Init
=
Sh4_int_Init
;
rv
->
Term
=
Sh4_int_Term
;
rv
->
IsCpuRunning
=
Sh4_int_IsCpuRunning
;
rv
->
ResetCache
=
sh4_int_resetcache
;
void
Get_Sh4Interpreter
(
sh4_if
*
cpu
)
{
cpu
->
Run
=
Sh4_int_Run
;
cpu
->
Stop
=
Sh4_int_Stop
;
cpu
->
Start
=
Sh4_int_Start
;
cpu
->
Step
=
Sh4_int_Step
;
cpu
->
Skip
=
Sh4_int_Skip
;
cpu
->
Reset
=
Sh4_int_Reset
;
cpu
->
Init
=
Sh4_int_Init
;
cpu
->
Term
=
Sh4_int_Term
;
cpu
->
IsCpuRunning
=
Sh4_int_IsCpuRunning
;
cpu
->
ResetCache
=
sh4_int_resetcache
;
}
void
Sh4_int_Init
()
...
...
core/hw/sh4/modules/mmu.h
View file @
d3d3e838
...
...
@@ -83,7 +83,7 @@ u32 mmu_instruction_translation(u32 va, u32& rv);
template
<
u32
translation_type
,
typename
T
>
extern
u32
mmu_data_translation
(
u32
va
,
u32
&
rv
);
void
DoMMUException
(
u32
addr
,
u32
error
_code
,
u32
access_type
);
void
DoMMUException
(
u32
addr
,
u32
mmu_
error
,
u32
access_type
);
template
<
u32
translation_type
>
bool
mmu_is_translated
(
u32
va
,
u32
size
)
...
...
@@ -127,7 +127,7 @@ bool mmu_is_translated(u32 va, u32 size)
template
<
typename
T
>
void
DYNACALL
mmu_WriteMem
(
u32
adr
,
T
data
);
bool
mmu_TranslateSQW
(
u32
ad
d
r
,
u32
*
mapped
);
bool
mmu_TranslateSQW
(
u32
adr
,
u32
*
out
);
template
<
typename
T
>
T
DYNACALL
mmu_ReadMemNoEx
(
u32
adr
,
u32
*
exception_occurred
)
...
...
core/hw/sh4/sh4_interrupts.h
View file @
d3d3e838
...
...
@@ -119,7 +119,7 @@ static inline void InterruptMask(InterruptID intr, u32 v)
int
UpdateINTC
();
bool
Do_Exception
(
u32
lvl
,
u32
expEvn
,
u32
CallVect
);
bool
Do_Exception
(
u32
epc
,
u32
expEvn
,
u32
CallVect
);
bool
SRdecode
(
void
);
void
SIIDRebuild
(
void
);
...
...
core/hw/sh4/sh4_mem.h
View file @
d3d3e838
...
...
@@ -62,7 +62,7 @@ void WriteMemBlock_nommu_dma(u32 dst,u32 src,u32 size);
//Init/Res/Term
void
mem_Init
();
void
mem_Term
();
void
mem_Reset
(
bool
Manual
);
void
mem_Reset
(
bool
hard
);
void
mem_map_default
();
//Get pointer to ram area , 0 if error
...
...
core/hw/sh4/sh4_mmr.h
View file @
d3d3e838
...
...
@@ -28,7 +28,7 @@ void sh4_mmr_init();
void
sh4_mmr_reset
(
bool
hard
);
void
sh4_mmr_term
();
void
sh4_rio_reg
(
Array
<
RegisterStruct
>&
arr
,
u32
addr
,
RegIO
flags
,
u32
sz
,
RegReadAddrFP
*
r
p
=
0
,
RegWriteAddrFP
*
w
p
=
0
);
void
sh4_rio_reg
(
Array
<
RegisterStruct
>&
arr
,
u32
addr
,
RegIO
flags
,
u32
sz
,
RegReadAddrFP
*
r
f
=
0
,
RegWriteAddrFP
*
w
f
=
0
);
#define A7_REG_HASH(addr) (((addr) >> 16) & 0x1FFF)
...
...
core/log/LogManager.h
View file @
d3d3e838
...
...
@@ -35,9 +35,9 @@ public:
static
void
Shutdown
();
void
Log
(
LogTypes
::
LOG_LEVELS
level
,
LogTypes
::
LOG_TYPE
type
,
const
char
*
file
,
int
line
,
const
char
*
f
m
t
,
va_list
args
);
const
char
*
f
orma
t
,
va_list
args
);
void
LogWithFullPath
(
LogTypes
::
LOG_LEVELS
level
,
LogTypes
::
LOG_TYPE
type
,
const
char
*
file
,
int
line
,
const
char
*
f
m
t
,
va_list
args
);
int
line
,
const
char
*
f
orma
t
,
va_list
args
);
LogTypes
::
LOG_LEVELS
GetLogLevel
()
const
;
void
SetLogLevel
(
LogTypes
::
LOG_LEVELS
level
);
...
...
core/rend/CustomTexture.h
View file @
d3d3e838
...
...
@@ -31,7 +31,7 @@ public:
~
CustomTexture
()
{
Terminate
();
}
u8
*
LoadCustomTexture
(
u32
hash
,
int
&
width
,
int
&
height
);
void
LoadCustomTextureAsync
(
BaseTextureCacheData
*
texture_data
);
void
DumpTexture
(
u32
hash
,
int
w
,
int
h
,
TextureType
textype
,
void
*
temp_tex
_buffer
);
void
DumpTexture
(
u32
hash
,
int
w
,
int
h
,
TextureType
textype
,
void
*
src
_buffer
);
void
Terminate
();
private:
...
...
core/rend/gles/gldraw.cpp
View file @
d3d3e838
...
...
@@ -6,7 +6,7 @@ Drawing and related state management
Takes vertex, textures and renders to the currently set up target
*/
const
static
u32
CullMode
[]
=
const
static
u32
CullMode
s
[]
=
{
GL_NONE
,
//0 No culling No culling
GL_NONE
,
//1 Cull if Small Cull if ( |det| < fpu_cull_val )
...
...
@@ -69,14 +69,14 @@ extern u32 gcflip;
GLuint
vmuTextureId
[
4
]
=
{
0
,
0
,
0
,
0
};
GLuint
lightgunTextureId
[
4
]
=
{
0
,
0
,
0
,
0
};
void
SetCull
(
u32
Cull
i
Mode
)
void
SetCull
(
u32
CullMode
)
{
if
(
CullMode
[
Cull
i
Mode
]
==
GL_NONE
)
if
(
CullMode
s
[
CullMode
]
==
GL_NONE
)
glcache
.
Disable
(
GL_CULL_FACE
);
else
{
glcache
.
Enable
(
GL_CULL_FACE
);
glcache
.
CullFace
(
CullMode
[
Cull
i
Mode
]);
//GL_FRONT/GL_BACK, ...
glcache
.
CullFace
(
CullMode
s
[
CullMode
]);
//GL_FRONT/GL_BACK, ...
}
}
...
...
core/rend/sorter.h
View file @
d3d3e838
...
...
@@ -29,4 +29,4 @@ struct SortTrigDrawParam
};
// Sort based on min-z of each triangle
void
GenSorted
(
int
first
,
int
count
,
vector
<
SortTrigDrawParam
>&
sorted_pp
,
vector
<
u32
>&
sorted_idx
);
void
GenSorted
(
int
first
,
int
count
,
std
::
vector
<
SortTrigDrawParam
>&
pidx_sort
,
std
::
vector
<
u32
>&
vidx_sort
);
core/rend/vulkan/drawer.h
View file @
d3d3e838
...
...
@@ -161,7 +161,7 @@ private:
void
SortTriangles
();
void
DrawPoly
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
u32
listType
,
bool
sortTriangles
,
const
PolyParam
&
poly
,
u32
first
,
u32
count
);
void
DrawSorted
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
const
std
::
vector
<
SortTrigDrawParam
>&
polys
);
void
DrawList
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
u32
listType
,
bool
sortTriangles
,
const
List
<
PolyParam
>&
polys
,
u32
first
,
u32
coun
t
);
void
DrawList
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
u32
listType
,
bool
sortTriangles
,
const
List
<
PolyParam
>&
polys
,
u32
first
,
u32
las
t
);
void
DrawModVols
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
int
first
,
int
count
);
void
UploadMainBuffer
(
const
VertexShaderUniforms
&
vertexUniforms
,
const
FragmentShaderUniforms
&
fragmentUniforms
);
...
...
core/rend/vulkan/oit/oit_drawer.h
View file @
d3d3e838
...
...
@@ -112,10 +112,10 @@ protected:
vk
::
CommandBuffer
currentCommandBuffer
;
private:
void
DrawPoly
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
u32
listType
,
bool
sort
Triangles
,
Pass
pass
,
void
DrawPoly
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
u32
listType
,
bool
auto
sort
,
Pass
pass
,
const
PolyParam
&
poly
,
u32
first
,
u32
count
);
void
DrawList
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
u32
listType
,
bool
sortTriangles
,
Pass
pass
,
const
List
<
PolyParam
>&
polys
,
u32
first
,
u32
coun
t
);
void
DrawList
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
u32
listType
,
bool
sortTriangles
,
Pass
pass
,
const
List
<
PolyParam
>&
polys
,
u32
first
,
u32
las
t
);
template
<
bool
Translucent
>
void
DrawModifierVolumes
(
const
vk
::
CommandBuffer
&
cmdBuffer
,
int
first
,
int
count
);
void
UploadMainBuffer
(
const
OITDescriptorSets
::
VertexShaderUniforms
&
vertexUniforms
,
...
...
core/types.h
View file @
d3d3e838
...
...
@@ -677,7 +677,7 @@ void plugins_Reset(bool Manual);
//PVR
s32
libPvr_Init
(
void
);
void
libPvr_Reset
(
bool
Manual
);
void
libPvr_Reset
(
bool
hard
);
void
libPvr_Term
(
void
);
void
*
libPvr_GetRenderTarget
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment