Fix code for handling sign extension of negative 12-bit values.

Previous code was incorrect; this code is also faster and simpler

Example: 
  gCount = 0xfff.

Old code:
  ~gCount = 0xf000
  ~gCount + 1 = 0xf001
  - ( ~gCount + 1 ) = 0x1001

New code:
  0xfff - 0x1000 = 0xffff