diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-05 22:50:41 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-03-05 22:50:41 +0000 |
commit | e5b4913d19b40176cbaebe9453febadcab87b76c (patch) | |
tree | 15eb25966a44a80eba5b42b59b86c5a57700f892 /apps/plugins/rockboy/dynarec.c | |
parent | fabdf1de6f1a8fa8e281a3d428f484778b818344 (diff) |
Minor bug when writing files; files weren't truncated to 0, so when
writing a file smaller than the previous one, it adds garbage to the end.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6147 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/dynarec.c')
-rw-r--r-- | apps/plugins/rockboy/dynarec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/rockboy/dynarec.c b/apps/plugins/rockboy/dynarec.c index 9d3be22c03..14ec7a5ca9 100644 --- a/apps/plugins/rockboy/dynarec.c +++ b/apps/plugins/rockboy/dynarec.c @@ -384,7 +384,7 @@ void dynamic_recompile (struct dynarec_block *newblock) { newblock->block=dynapointer; #ifdef DYNA_DEBUG snprintf(meow,499,"/dyna_0x%x_asm.rb",PC); - fd=open(meow,O_WRONLY|O_CREAT); + fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC); if(fd<0) { die("couldn't open dyna debug file"); return; @@ -915,6 +915,7 @@ void dynamic_recompile (struct dynarec_block *newblock) { DYNA_BTST_l_r(8,7); /* btst #8,d7 */ DYNA_DUMMYBRANCH(2,0); DYNA_MOVEA_l_i_to_r(&blockclen,3); + DYNA_MOVE_l_i_to_m(tclen,3); DYNA_MOVEA_l_i_to_r(readw(PC),1); DYNA_RET(); DYNA_BCC_c(0x6,2,0); /* jump here if bit is not zero */ @@ -974,7 +975,7 @@ void dynamic_recompile (struct dynarec_block *newblock) { newblock->length=dynapointer-newblock->block; invalidate_icache(); snprintf(meow,499,"/dyna_0x%x_code.rb",PC); - fd=open(meow,O_WRONLY|O_CREAT); + fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC); if(fd>=0) { write(fd,newblock->block,newblock->length); close(fd); |