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
snes9x2002
Commits
4a5c4cad
Unverified
Commit
4a5c4cad
authored
Mar 10, 2022
by
Libretro-Admin
Committed by
GitHub
Mar 10, 2022
Browse files
Merge pull request #51 from jSTE0/miyoo-fast-aligned
platform/miyoo: Fix build flags and use FAST_ALIGNED_LSB_WORD_ACCESS
parents
ef4fa1dd
75325928
Pipeline
#96424
passed with stages
in 11 minutes and 21 seconds
Changes
4
Pipelines
17
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
4a5c4cad
...
...
@@ -255,8 +255,8 @@ else ifeq ($(platform), miyoo)
ASM_CPU
=
0
ASM_SPC700
=
0
SHARED
:=
-shared
-Wl
,--version-script
=
libretro/link.T
-Wl
,--no-undefined
FLAGS
+=
-fomit-frame-pointer
-ffast-math
-
march
=
armv5te
-mtune
=
arm926ej-s
FLAGS
+=
-
fno-unroll-loops
C
FLAGS
+=
-fomit-frame-pointer
-ffast-math
-
fno-unroll-loops
-flto
-mcpu
=
arm926ej-s
C
FLAGS
+=
-
DFAST_ALIGNED_LSB_WORD_ACCESS
# Windows MSVC 2010 x64
else
ifeq
($(platform), windows_msvc2010_x64)
...
...
src/cpuaddr.h
View file @
4a5c4cad
...
...
@@ -145,6 +145,11 @@ static INLINE void AbsoluteLong()
{
#ifdef FAST_LSB_WORD_ACCESS
OpAddress
=
(
*
(
uint32
*
)
CPU
.
PC
)
&
0xffffff
;
#elif defined FAST_ALIGNED_LSB_WORD_ACCESS
if
(((
int
)
CPU
.
PC
&
1
)
==
0
)
OpAddress
=
(
*
(
uint16
*
)
CPU
.
PC
)
+
(
*
(
CPU
.
PC
+
2
)
<<
16
);
else
OpAddress
=
*
CPU
.
PC
+
((
*
(
uint16
*
)
(
CPU
.
PC
+
1
))
<<
8
);
#else
OpAddress
=
*
CPU
.
PC
+
(
*
(
CPU
.
PC
+
1
)
<<
8
)
+
(
*
(
CPU
.
PC
+
2
)
<<
16
);
#endif
...
...
@@ -272,6 +277,11 @@ static INLINE void AbsoluteLongIndexedX()
{
#ifdef FAST_LSB_WORD_ACCESS
OpAddress
=
(
*
(
uint32
*
)
CPU
.
PC
+
Registers
.
X
.
W
)
&
0xffffff
;
#elif defined FAST_ALIGNED_LSB_WORD_ACCESS
if
(((
int
)
CPU
.
PC
&
1
)
==
0
)
OpAddress
=
((
*
(
uint16
*
)
CPU
.
PC
)
+
(
*
(
CPU
.
PC
+
2
)
<<
16
)
+
Registers
.
X
.
W
)
&
0xFFFFFF
;
else
OpAddress
=
(
*
CPU
.
PC
+
((
*
(
uint16
*
)
(
CPU
.
PC
+
1
))
<<
8
)
+
Registers
.
X
.
W
)
&
0xFFFFFF
;
#else
OpAddress
=
(
*
CPU
.
PC
+
(
*
(
CPU
.
PC
+
1
)
<<
8
)
+
(
*
(
CPU
.
PC
+
2
)
<<
16
)
+
Registers
.
X
.
W
)
&
0xffffff
;
#endif
...
...
src/ppu.c
View file @
4a5c4cad
...
...
@@ -257,8 +257,13 @@ void S9xSetCPU(uint8 byte, uint16 Address)
// Multiplicand
uint32
res
=
Memory
.
FillRAM
[
0x4202
]
*
byte
;
#if defined FAST_LSB_WORD_ACCESS || defined FAST_ALIGNED_LSB_WORD_ACCESS
// assume malloc'd memory is 2-byte aligned
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4216
])
=
res
;
#else
Memory
.
FillRAM
[
0x4216
]
=
(
uint8
)
res
;
Memory
.
FillRAM
[
0x4217
]
=
(
uint8
)(
res
>>
8
);
#endif
break
;
}
case
0x4204
:
...
...
@@ -268,15 +273,26 @@ void S9xSetCPU(uint8 byte, uint16 Address)
case
0x4206
:
{
// Divisor
#if defined FAST_LSB_WORD_ACCESS || defined FAST_ALIGNED_LSB_WORD_ACCESS
// assume malloc'd memory is 2-byte aligned
uint16
a
=
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4204
]);
#else
uint16
a
=
Memory
.
FillRAM
[
0x4204
]
+
(
Memory
.
FillRAM
[
0x4205
]
<<
8
);
#endif
uint16
div
=
byte
?
a
/
byte
:
0xffff
;
uint16
rem
=
byte
?
a
%
byte
:
a
;
#if defined FAST_LSB_WORD_ACCESS || defined FAST_ALIGNED_LSB_WORD_ACCESS
// assume malloc'd memory is 2-byte aligned
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4214
])
=
div
;
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4216
])
=
rem
;
#else
Memory
.
FillRAM
[
0x4214
]
=
(
uint8
)
div
;
Memory
.
FillRAM
[
0x4215
]
=
div
>>
8
;
Memory
.
FillRAM
[
0x4216
]
=
(
uint8
)
rem
;
Memory
.
FillRAM
[
0x4217
]
=
rem
>>
8
;
#endif
break
;
}
case
0x4207
:
...
...
src/ppu_.c
View file @
4a5c4cad
...
...
@@ -1496,8 +1496,13 @@ void S9xSetCPU(uint8 byte, uint16 Address)
// Multiplicand
uint32
res
=
Memory
.
FillRAM
[
0x4202
]
*
byte
;
#if defined FAST_LSB_WORD_ACCESS || defined FAST_ALIGNED_LSB_WORD_ACCESS
// assume malloc'd memory is 2-byte aligned
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4216
])
=
res
;
#else
Memory
.
FillRAM
[
0x4216
]
=
(
uint8
)
res
;
Memory
.
FillRAM
[
0x4217
]
=
(
uint8
)(
res
>>
8
);
#endif
break
;
}
case
0x4204
:
...
...
@@ -1507,14 +1512,25 @@ void S9xSetCPU(uint8 byte, uint16 Address)
case
0x4206
:
{
// Divisor
#if defined FAST_LSB_WORD_ACCESS || defined FAST_ALIGNED_LSB_WORD_ACCESS
// assume malloc'd memory is 2-byte aligned
uint16
a
=
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4204
]);
#else
uint16
a
=
Memory
.
FillRAM
[
0x4204
]
+
(
Memory
.
FillRAM
[
0x4205
]
<<
8
);
#endif
uint16
div
=
byte
?
a
/
byte
:
0xffff
;
uint16
rem
=
byte
?
a
%
byte
:
a
;
#if defined FAST_LSB_WORD_ACCESS || defined FAST_ALIGNED_LSB_WORD_ACCESS
// assume malloc'd memory is 2-byte aligned
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4214
])
=
div
;
*
((
uint16
*
)
&
Memory
.
FillRAM
[
0x4216
])
=
rem
;
#else
Memory
.
FillRAM
[
0x4214
]
=
(
uint8
)
div
;
Memory
.
FillRAM
[
0x4215
]
=
div
>>
8
;
Memory
.
FillRAM
[
0x4216
]
=
(
uint8
)
rem
;
Memory
.
FillRAM
[
0x4217
]
=
rem
>>
8
;
#endif
break
;
}
case
0x4207
:
...
...
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