MCPcopy Create free account
hub / github.com/TASEmulators/fceux / GetH16

Function GetH16

src/drivers/common/cheat.cpp:44–59  ·  view source on GitHub ↗

Get unsigned 16-bit integer from stdin in hex. */

Source from the content-addressed store, hash-verified

42
43/* Get unsigned 16-bit integer from stdin in hex. */
44static uint32 GetH16(unsigned int def)
45{
46 char buf[32];
47
48 if ( fgets(buf,ARRAY_SIZE(buf),stdin) == nullptr )
49 {
50 return def;
51 }
52 if(buf[0]=='\n')
53 return(def);
54 if(buf[0]=='$')
55 sscanf(buf+1,"%04x",&def);
56 else
57 sscanf(buf,"%04x",&def);
58 return def;
59}
60
61/* Get unsigned 8-bit integer from stdin in decimal. */
62static uint8 Get8(unsigned int def)

Callers 2

ModifyCheatFunction · 0.85
AddCheatParamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected