* Debugger: disabled breakpoints now don't impose slowdown

* Taseditor: fixed r/w switch in "Old controls scheme"
This commit is contained in:
ansstuff 2012-09-24 15:04:06 +00:00
parent 6f59c32e42
commit 662b69b9d2
6 changed files with 109 additions and 54 deletions

View File

@ -616,78 +616,127 @@ void breakpoint()
case 0x60: stackopstartaddr=X.S+1; stackopendaddr=X.S+2; stackop=WP_R; StackAddrBackup = X.S; StackNextIgnorePC=(GetMem(stackopstartaddr|0x0100)|GetMem(stackopendaddr|0x0100)<<8)+1; break; case 0x60: stackopstartaddr=X.S+1; stackopendaddr=X.S+2; stackop=WP_R; StackAddrBackup = X.S; StackNextIgnorePC=(GetMem(stackopstartaddr|0x0100)|GetMem(stackopendaddr|0x0100)<<8)+1; break;
} }
for (i = 0; i < numWPs; i++) { for (i = 0; i < numWPs; i++)
{
// ################################## Start of SP CODE ########################### // ################################## Start of SP CODE ###########################
if (condition(&watchpoint[i])) if ((watchpoint[i].flags & WP_E) && condition(&watchpoint[i]))
{ {
// ################################## End of SP CODE ########################### // ################################## End of SP CODE ###########################
if (watchpoint[i].flags & BT_P) { //PPU Mem breaks if (watchpoint[i].flags & BT_P)
if ((watchpoint[i].flags & WP_E) && (watchpoint[i].flags & brk_type) && ((A >= 0x2000) && (A < 0x4000)) && ((A&7) == 7)) { {
if (watchpoint[i].endaddress) { // PPU Mem breaks
if ((watchpoint[i].address <= RefreshAddr) && (watchpoint[i].endaddress >= RefreshAddr)) BreakHit(i); if ((watchpoint[i].flags & brk_type) && ((A >= 0x2000) && (A < 0x4000)) && ((A&7) == 7))
} {
else if (watchpoint[i].address == RefreshAddr) BreakHit(i); if (watchpoint[i].endaddress)
{
if ((watchpoint[i].address <= RefreshAddr) && (watchpoint[i].endaddress >= RefreshAddr))
BreakHit(i);
} else
{
if (watchpoint[i].address == RefreshAddr)
BreakHit(i);
} }
} }
else if (watchpoint[i].flags & BT_S) { //Sprite Mem breaks } else if (watchpoint[i].flags & BT_S)
if ((watchpoint[i].flags & WP_E) && (watchpoint[i].flags & brk_type) && ((A >= 0x2000) && (A < 0x4000)) && ((A&7) == 4)) { {
if (watchpoint[i].endaddress) { // Sprite Mem breaks
if ((watchpoint[i].address <= PPU[3]) && (watchpoint[i].endaddress >= PPU[3])) BreakHit(i); if ((watchpoint[i].flags & brk_type) && ((A >= 0x2000) && (A < 0x4000)) && ((A&7) == 4))
{
if (watchpoint[i].endaddress)
{
if ((watchpoint[i].address <= PPU[3]) && (watchpoint[i].endaddress >= PPU[3]))
BreakHit(i);
} else
{
if (watchpoint[i].address == PPU[3])
BreakHit(i);
} }
else if (watchpoint[i].address == PPU[3]) BreakHit(i); } else if ((watchpoint[i].flags & WP_W) && (A == 0x4014))
{
// Sprite DMA! :P
BreakHit(i);
} }
else if ((watchpoint[i].flags & WP_E) && (watchpoint[i].flags & WP_W) && (A == 0x4014)) BreakHit(i); //Sprite DMA! :P } else
} {
else { //CPU mem breaks // CPU mem breaks
if ((watchpoint[i].flags & WP_E) && (watchpoint[i].flags & brk_type)) { if ((watchpoint[i].flags & brk_type))
if (watchpoint[i].endaddress) { {
if (watchpoint[i].endaddress)
{
if (((watchpoint[i].flags & (WP_R | WP_W)) && (watchpoint[i].address <= A) && (watchpoint[i].endaddress >= A)) || if (((watchpoint[i].flags & (WP_R | WP_W)) && (watchpoint[i].address <= A) && (watchpoint[i].endaddress >= A)) ||
((watchpoint[i].flags & WP_X) && (watchpoint[i].address <= _PC) && (watchpoint[i].endaddress >= _PC))) BreakHit(i); ((watchpoint[i].flags & WP_X) && (watchpoint[i].address <= _PC) && (watchpoint[i].endaddress >= _PC)))
BreakHit(i);
} else
{
if (((watchpoint[i].flags & (WP_R | WP_W)) && (watchpoint[i].address == A)) ||
((watchpoint[i].flags & WP_X) && (watchpoint[i].address == _PC)))
BreakHit(i);
} }
else if (((watchpoint[i].flags & (WP_R | WP_W)) && (watchpoint[i].address == A)) || } else
((watchpoint[i].flags & WP_X) && (watchpoint[i].address == _PC))) BreakHit(i); {
}
else if (watchpoint[i].flags & WP_E) {
// brk_type independant coding // brk_type independant coding
if (stackop > 0)
if (stackop>0) { {
// Announced stack mem breaks // Announced stack mem breaks
// PHA, PLA, PHP, and PLP affect the stack data. // PHA, PLA, PHP, and PLP affect the stack data.
// TXS and TSX only deal with the pointer. // TXS and TSX only deal with the pointer.
if (watchpoint[i].flags & stackop) { if (watchpoint[i].flags & stackop)
for (j = (stackopstartaddr|0x0100); j <= (stackopendaddr|0x0100); j++) { {
if (watchpoint[i].endaddress) { for (j = (stackopstartaddr|0x0100); j <= (stackopendaddr|0x0100); j++)
if ((watchpoint[i].address <= j) && (watchpoint[i].endaddress >= j)) BreakHit(i); {
} if (watchpoint[i].endaddress)
else if (watchpoint[i].address == j) BreakHit(i); {
if ((watchpoint[i].address <= j) && (watchpoint[i].endaddress >= j))
BreakHit(i);
} else
{
if (watchpoint[i].address == j)
BreakHit(i);
} }
} }
} }
if (StackNextIgnorePC==_PC) { }
if (StackNextIgnorePC == _PC)
{
// Used to make it ignore the unannounced stack code one time // Used to make it ignore the unannounced stack code one time
StackNextIgnorePC = 0xFFFF; StackNextIgnorePC = 0xFFFF;
} else } else
{ {
if ((X.S < StackAddrBackup) && (stackop==0)) { if ((X.S < StackAddrBackup) && (stackop==0))
{
// Unannounced stack mem breaks // Unannounced stack mem breaks
// Pushes to stack // Pushes to stack
if (watchpoint[i].flags & WP_W) { if (watchpoint[i].flags & WP_W)
for (j = (X.S|0x0100); j < (StackAddrBackup|0x0100); j++) { {
if (watchpoint[i].endaddress) { for (j = (X.S|0x0100); j < (StackAddrBackup|0x0100); j++)
if ((watchpoint[i].address <= j) && (watchpoint[i].endaddress >= j)) BreakHit(i); {
} if (watchpoint[i].endaddress)
else if (watchpoint[i].address == j) BreakHit(i); {
if ((watchpoint[i].address <= j) && (watchpoint[i].endaddress >= j))
BreakHit(i);
} else
{
if (watchpoint[i].address == j)
BreakHit(i);
} }
} }
} }
else if ((StackAddrBackup < X.S) && (stackop==0)) { } else if ((StackAddrBackup < X.S) && (stackop==0))
{
// Pulls from stack // Pulls from stack
if (watchpoint[i].flags & WP_R) { if (watchpoint[i].flags & WP_R)
for (j = (StackAddrBackup|0x0100); j < (X.S|0x0100); j++) { {
if (watchpoint[i].endaddress) { for (j = (StackAddrBackup|0x0100); j < (X.S|0x0100); j++)
if ((watchpoint[i].address <= j) && (watchpoint[i].endaddress >= j)) BreakHit(i); {
if (watchpoint[i].endaddress)
{
if ((watchpoint[i].address <= j) && (watchpoint[i].endaddress >= j))
BreakHit(i);
} else
{
if (watchpoint[i].address == j)
BreakHit(i);
} }
else if (watchpoint[i].address == j) BreakHit(i);
} }
} }
} }

View File

@ -801,7 +801,7 @@ void ApplyMovieInputConfig()
// this getter contains formula to decide whether to record or replay movie // this getter contains formula to decide whether to record or replay movie
bool TaseditorIsRecording() bool TaseditorIsRecording()
{ {
if (movie_readonly || playback.GetPauseFrame() >= 0) if (movie_readonly || playback.GetPauseFrame() >= 0 || (taseditor_config.old_branching_controls && !recorder.state_was_loaded_in_readwrite_mode))
return false; // replay return false; // replay
return true; // record return true; // record
} }

View File

@ -32,6 +32,7 @@ extern TASEDITOR_CONFIG taseditor_config;
extern TASEDITOR_WINDOW taseditor_window; extern TASEDITOR_WINDOW taseditor_window;
extern POPUP_DISPLAY popup_display; extern POPUP_DISPLAY popup_display;
extern PLAYBACK playback; extern PLAYBACK playback;
extern RECORDER recorder;
extern SELECTION selection; extern SELECTION selection;
extern GREENZONE greenzone; extern GREENZONE greenzone;
extern TASEDITOR_PROJECT project; extern TASEDITOR_PROJECT project;
@ -398,6 +399,7 @@ void BOOKMARKS::jump(int slot)
void BOOKMARKS::deploy(int slot) void BOOKMARKS::deploy(int slot)
{ {
recorder.state_was_loaded_in_readwrite_mode = true;
if (taseditor_config.old_branching_controls && movie_readonly) if (taseditor_config.old_branching_controls && movie_readonly)
{ {
jump(slot); jump(slot);

View File

@ -76,7 +76,7 @@ void BRANCHES::init()
hOldBitmap1 = (HBITMAP)SelectObject(hBufferDC, buffer_hbitmap); hOldBitmap1 = (HBITMAP)SelectObject(hBufferDC, buffer_hbitmap);
normal_brush = CreateSolidBrush(0x000000); normal_brush = CreateSolidBrush(0x000000);
border_brush = CreateSolidBrush(0xb99d7f); border_brush = CreateSolidBrush(0xb99d7f);
selected_slot_brush = CreateSolidBrush(0x6161E4); selected_slot_brush = CreateSolidBrush(0x5656CA);
// prepare bg gradient // prepare bg gradient
vertex[0].x = 0; vertex[0].x = 0;
vertex[0].y = 0; vertex[0].y = 0;

View File

@ -70,6 +70,7 @@ void RECORDER::init()
void RECORDER::reset() void RECORDER::reset()
{ {
movie_readonly = true; movie_readonly = true;
state_was_loaded_in_readwrite_mode = false;
multitrack_recording_joypad = MULTITRACK_RECORDING_ALL; multitrack_recording_joypad = MULTITRACK_RECORDING_ALL;
pattern_offset = 0; pattern_offset = 0;
must_increase_pattern_offset = false; must_increase_pattern_offset = false;
@ -121,6 +122,8 @@ void RECORDER::update()
{ {
Button_SetCheck(hwndRecCheckbox, movie_readonly?BST_UNCHECKED : BST_CHECKED); Button_SetCheck(hwndRecCheckbox, movie_readonly?BST_UNCHECKED : BST_CHECKED);
old_movie_readonly = movie_readonly; old_movie_readonly = movie_readonly;
if (movie_readonly)
state_was_loaded_in_readwrite_mode = false;
} }
// reset pattern_offset if current_pattern has changed // reset pattern_offset if current_pattern has changed
if (old_current_pattern != taseditor_config.current_pattern) if (old_current_pattern != taseditor_config.current_pattern)

View File

@ -35,6 +35,7 @@ public:
int multitrack_recording_joypad; int multitrack_recording_joypad;
int pattern_offset; int pattern_offset;
std::vector<uint8> current_joy; std::vector<uint8> current_joy;
bool state_was_loaded_in_readwrite_mode;
private: private:
int old_multitrack_recording_joypad; int old_multitrack_recording_joypad;