Merge branch 'master' of git://factorcode.org/git/factor

db4
Slava Pestov 2009-05-08 18:01:46 -05:00
commit ded2e792de
3 changed files with 4 additions and 3 deletions

View File

@ -55,7 +55,7 @@ ERROR: game-input-not-open ;
game-input-opened? [ game-input-opened? [
(close-game-input) (close-game-input)
reset-game-input reset-game-input
] when ; ] unless ;
: with-game-input ( quot -- ) : with-game-input ( quot -- )
open-game-input [ close-game-input ] [ ] cleanup ; inline open-game-input [ close-game-input ] [ ] cleanup ; inline

View File

@ -304,6 +304,7 @@ M: iokit-game-input-backend (close-game-input)
f f
] change-global ] change-global
f +keyboard-state+ set-global f +keyboard-state+ set-global
f +mouse-state+ set-global
f +controller-states+ set-global f +controller-states+ set-global
] when ; ] when ;

View File

@ -35,7 +35,7 @@ inline static void *get_call_target(cell return_address)
check_call_site(return_address); check_call_site(return_address);
cell insn = *(cell *)return_address; cell insn = *(cell *)return_address;
cell unsigned_addr = (insn & B_MASK); cell unsigned_addr = (insn & b_mask);
fixnum signed_addr = (fixnum)(unsigned_addr << 6) >> 6; fixnum signed_addr = (fixnum)(unsigned_addr << 6) >> 6;
return (void *)(signed_addr + return_address); return (void *)(signed_addr + return_address);
} }
@ -48,7 +48,7 @@ inline static void set_call_target(cell return_address, void *target)
cell insn = *(cell *)return_address; cell insn = *(cell *)return_address;
fixnum relative_address = ((cell)target - return_address); fixnum relative_address = ((cell)target - return_address);
insn = ((insn & ~B_MASK) | (relative_address & B_MASK)); insn = ((insn & ~b_mask) | (relative_address & b_mask));
*(cell *)return_address = insn; *(cell *)return_address = insn;
/* Flush the cache line containing the call we just patched */ /* Flush the cache line containing the call we just patched */