From 23277bc4df54ae79adb87da0fce8e15c99a11faa Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 25 May 2010 04:34:34 +0000 Subject: [PATCH] Win32 - Memwatch - ignore spaces at the beginnign of an address in the address boxes --- changelog.txt | 1 + src/drivers/win/memwatch.cpp | 17 ++++++++++++----- src/movie.cpp | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/changelog.txt b/changelog.txt index 330ad292..fc104514 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +24-may-2010 - adelikat - Win32 - Memwatch - ignore spaces at the beginnign of an address in the address boxes 24-may-2010 - mart0258 - Disable auto-savestates during turbo 24-may-2010 - mart0258 - Prevent .zip files containing no recognized files from causing crash 23-may-2010 - adelikat - Win32 - Replay dialog - fix bug that was causing it to always report savestate movies as soft-reset diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index fc2ba2c9..03be3374 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -233,29 +233,36 @@ static struct MWRec char TempArray[16]; GetDlgItemText(hwndMemWatch,ctl,TempArray,16); TempArray[15]=0; + + int x = 0; + for (x = 0; x < 15; x++) + { + if (!(TempArray[x] == ' ')) + break; + } //The point of this loop is to ignore spaces at the begginning of a address box valid = hex = twobytes = false; - switch(TempArray[0]) + switch(TempArray[x]) { case 0: break; case '!': twobytes=true; - addr=FastStrToU16(TempArray+1,valid); + addr=FastStrToU16(TempArray+x+1,valid); break; case 'x': hex = true; valid = true; - addr=FastStrToU16(TempArray+1,valid); + addr=FastStrToU16(TempArray+x+1,valid); break; case 'X': hex = twobytes = true; valid = true; - addr = FastStrToU16(TempArray+1,valid); + addr = FastStrToU16(TempArray+x+1,valid); break; default: valid = true; - addr=FastStrToU16(TempArray,valid); + addr=FastStrToU16(TempArray+x,valid); break; } } diff --git a/src/movie.cpp b/src/movie.cpp index c2e83caa..89c48152 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -1489,7 +1489,7 @@ void FCEUI_MoviePlayFromBeginning(void) if (currMovieData.savestate.empty()) { movie_readonly=true; - poweron(true); //Bad, this assumes a movie doesn't start from savestate + poweron(true); currFrameCounter=0; movieMode = MOVIEMODE_PLAY; FCEU_DispMessage("Movie is now Read-Only. Playing from beginning.",0);