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
Stella
Commits
1dfc221a
Commit
1dfc221a
authored
Dec 08, 2018
by
thrust26
Browse files
fixed RWP by using the last access type
parent
33e300b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/debugger/CartDebug.cxx
View file @
1dfc221a
...
...
@@ -172,8 +172,7 @@ void CartDebug::triggerReadFromWritePort(uInt16 addr)
mySystem
.
setDirtyPage
(
addr
);
if
(
myRWPortTriggersBreak
&&
mySystem
.
m6502
().
lastReadAddress
()
&&
(
mySystem
.
getPageAccessType
(
addr
)
&
System
::
PA_WRITE
)
==
System
::
PA_WRITE
)
!
mySystem
.
m6502
().
lastWasGhostPeek
())
{
ostringstream
msg
;
msg
<<
"RWP[@ $"
<<
Common
::
Base
::
HEX4
<<
addr
<<
"]: "
;
...
...
@@ -191,8 +190,7 @@ int CartDebug::readFromWritePort()
// port address space AND the last access was actually a read (the latter
// differentiates between reads that are normally part of a write cycle vs.
// ones that are illegal)
if
(
mySystem
.
m6502
().
lastReadAddress
()
&&
(
mySystem
.
getPageAccessType
(
addr
)
&
System
::
PA_WRITE
)
==
System
::
PA_WRITE
)
if
(
!
mySystem
.
m6502
().
lastWasGhostPeek
())
return
addr
;
else
return
0
;
...
...
src/emucore/M6502.cxx
View file @
1dfc221a
...
...
@@ -74,7 +74,8 @@ M6502::M6502(const Settings& settings)
myOnHaltCallback
(
nullptr
),
myHaltRequested
(
false
),
myGhostReadsTrap
(
true
),
myStepStateByInstruction
(
false
)
myStepStateByInstruction
(
false
),
myFlags
(
DISASM_NONE
)
{
#ifdef DEBUGGER_SUPPORT
myDebugger
=
nullptr
;
...
...
@@ -118,6 +119,7 @@ void M6502::reset()
myLastSrcAddressS
=
myLastSrcAddressA
=
myLastSrcAddressX
=
myLastSrcAddressY
=
-
1
;
myDataAddressForPoke
=
0
;
myFlags
=
DISASM_NONE
;
myHaltRequested
=
false
;
myGhostReadsTrap
=
mySettings
.
getBool
(
"dbg.ghostreadstrap"
);
...
...
@@ -140,6 +142,7 @@ inline uInt8 M6502::peek(uInt16 address, uInt8 flags)
////////////////////////////////////////////////
mySystem
->
incrementCycles
(
SYSTEM_CYCLES_PER_CPU
);
icycles
+=
SYSTEM_CYCLES_PER_CPU
;
myFlags
=
flags
;
uInt8
result
=
mySystem
->
peek
(
address
,
flags
);
myLastPeekAddress
=
address
;
...
...
@@ -442,6 +445,7 @@ bool M6502::save(Serializer& out) const
out
.
putBool
(
myStepStateByInstruction
);
out
.
putBool
(
myGhostReadsTrap
);
out
.
putLong
(
myLastBreakCycle
);
out
.
putShort
(
myFlags
);
}
catch
(...)
{
...
...
@@ -490,6 +494,7 @@ bool M6502::load(Serializer& in)
myStepStateByInstruction
=
in
.
getBool
();
myGhostReadsTrap
=
in
.
getBool
();
myLastBreakCycle
=
in
.
getLong
();
myFlags
=
in
.
getShort
();
}
catch
(...)
{
...
...
src/emucore/M6502.hxx
View file @
1dfc221a
...
...
@@ -143,18 +143,11 @@ class M6502 : public Serializable
uInt16
getPC
()
const
{
return
PC
;
}
/**
Return the last address that was part of a read/peek. Note that
reads which are part of a write are not considered here, unless
they're not the same as the last write address. This eliminates
accesses that are part of a normal read/write cycle.
Check the type of the last peek().
@return
The address of the la
st read
@return
true, if the last peek() was a gho
st read
.
*/
uInt16
lastReadAddress
()
const
{
return
myLastPokeAddress
?
(
myLastPokeAddress
!=
myLastPeekAddress
?
myLastPeekAddress
:
0
)
:
myLastPeekAddress
;
}
bool
lastWasGhostPeek
()
const
{
return
myFlags
==
0
;
}
// DISASM_NONE
/**
Return the last address that was part of a read/peek.
...
...
@@ -379,6 +372,8 @@ class M6502 : public Serializable
/// Indicates the last base (= non-mirrored) address which was
/// accessed specifically by a peek or poke command
uInt16
myLastPeekBaseAddress
,
myLastPokeBaseAddress
;
// Indicates the type of the last access
uInt8
myFlags
;
/// Indicates the last address used to access data by a peek command
/// for the CPU registers (S/A/X/Y)
...
...
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