- Timestamp:
- 04/03/11 00:39:38 (2 years ago)
- Location:
- trunk/platform
- Files:
-
- 7 edited
-
g12/sub/100c/stubs_entry_2.S (modified) (2 diffs)
-
g12/sub/100e/stubs_entry_2.S (modified) (2 diffs)
-
g12/wrappers.c (modified) (2 diffs)
-
sx30/sub/100e/stubs_entry_2.S (modified) (2 diffs)
-
sx30/sub/100h/stubs_entry_2.S (modified) (2 diffs)
-
sx30/sub/100l/stubs_entry_2.S (modified) (2 diffs)
-
sx30/wrappers.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/platform/g12/sub/100c/stubs_entry_2.S
r1111 r1123 93 93 NHSTUB(PutOutNdFilter, 0xFFB04E90) 94 94 NHSTUB(PT_MoveDigitalZoomToWide, 0xFF87F5C0) 95 NHSTUB(rand, 0xFFA5B364) // search for 0x41C64E6D. Function before this value is rand. 96 NHSTUB(srand, 0xFFA5B358) // search for 0x41C64E6D. Function before rand is srand. 95 97 96 98 # From stubs_entry_ida.s … … 117 119 NHSTUB(kbd_pwr_off, 0xFF810B1C) // ??? not on sx20 or s95 118 120 NHSTUB(kbd_pwr_on, 0xFF810B1C) // ??? not on sx20 or s95 119 NSTUB(rand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers120 NSTUB(srand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers121 121 NHSTUB(UIFS_WriteFirmInfoToFile, 0xFF810B1C) // Is this needed? 122 122 NHSTUB(rewinddir, 0xFF810B1C) -
trunk/platform/g12/sub/100e/stubs_entry_2.S
r1111 r1123 93 93 NHSTUB(PutOutNdFilter, 0xFFB05040) 94 94 NHSTUB(PT_MoveDigitalZoomToWide, 0xFF87F5C0) 95 NHSTUB(rand, 0xFFA5B370) // search for 0x41C64E6D. Function before this value is rand. 96 NHSTUB(srand, 0xFFA5B364) // search for 0x41C64E6D. Function before rand is srand. 95 97 96 98 # From stubs_entry_ida.s … … 117 119 NHSTUB(kbd_pwr_off, 0xFF810B1C) // ??? not on sx20 or s95 118 120 NHSTUB(kbd_pwr_on, 0xFF810B1C) // ??? not on sx20 or s95 119 NSTUB(rand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers120 NSTUB(srand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers121 121 NHSTUB(UIFS_WriteFirmInfoToFile, 0xFF810B1C) // Is this needed? 122 122 NHSTUB(rewinddir, 0xFF810B1C) -
trunk/platform/g12/wrappers.c
r1008 r1123 1 1 2 #include "../generic/wrappers.c" 2 3 … … 15 16 return _GetCurrentTargetDistance(); 16 17 } 17 18 19 // G12 firmware does not include rand(), srand() so we add them here20 21 #define RAND_MAX 0x7fffffff22 23 static unsigned int next = 1;24 25 int rand_r(unsigned int *seed)26 {27 *seed = *seed * 1103515245 + 12345;28 return (*seed % ((unsigned int) RAND_MAX + 1));29 }30 31 int _rand(void)32 {33 return (rand_r(&next));34 }35 36 void* _srand(unsigned int seed)37 {38 next = seed;39 return 0; // unused return value40 } -
trunk/platform/sx30/sub/100e/stubs_entry_2.S
r1111 r1123 88 88 NHSTUB(Rec2PB, 0xFF8A1B3C) 89 89 NHSTUB(exmem_alloc, 0xFF8944F4) // search for ExMem.AllocCacheable (from reyalp) 90 NHSTUB(rand, 0xFFA4D8C8) // search for 0x41C64E6D. Function before this value is rand. 91 NHSTUB(srand, 0xFFA4D8BC) // search for 0x41C64E6D. Function before rand is srand. 90 92 91 93 # from stubs_entry_ida.S … … 113 115 NHSTUB(kbd_pwr_off, 0xFF810B1C) // ??? not on sx20 or s95 114 116 NHSTUB(kbd_pwr_on, 0xFF810B1C) // ??? not on sx20 or s95 115 NSTUB(rand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers116 NSTUB(srand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers117 117 NHSTUB(UIFS_WriteFirmInfoToFile, 0xFF810B1C) // Is this needed? 118 118 NHSTUB(rewinddir, 0xFF810B1C) -
trunk/platform/sx30/sub/100h/stubs_entry_2.S
r1111 r1123 88 88 NHSTUB(Rec2PB, 0xFF8A1B3C) 89 89 NHSTUB(exmem_alloc, 0xFF8944F4) // search for ExMem.AllocCacheable (from reyalp) 90 NHSTUB(rand, 0xFFA4D984) // search for 0x41C64E6D. Function before this value is rand. 91 NHSTUB(srand, 0xFFA4D978) // search for 0x41C64E6D. Function before rand is srand. 90 92 91 93 # from stubs_entry_ida.S … … 113 115 NHSTUB(kbd_pwr_off, 0xFF810B1C) // ??? not on sx20 or s95 114 116 NHSTUB(kbd_pwr_on, 0xFF810B1C) // ??? not on sx20 or s95 115 NSTUB(rand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers116 NSTUB(srand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers117 117 NHSTUB(UIFS_WriteFirmInfoToFile, 0xFF810B1C) // Is this needed? 118 118 NHSTUB(rewinddir, 0xFF810B1C) -
trunk/platform/sx30/sub/100l/stubs_entry_2.S
r1111 r1123 88 88 NHSTUB(Rec2PB, 0xFF8A1B40) 89 89 NHSTUB(exmem_alloc, 0xFF8944F8) // search for ExMem.AllocCacheable (from reyalp) 90 NHSTUB(rand, 0xFFA4DB2C) // search for 0x41C64E6D. Function before this value is rand. 91 NHSTUB(srand, 0xFFA4DB20) // search for 0x41C64E6D. Function before rand is srand. 90 92 91 93 # from stubs_entry_ida.S … … 113 115 NHSTUB(kbd_pwr_off, 0xFF810B1C) // ??? not on sx20 or s95 114 116 NHSTUB(kbd_pwr_on, 0xFF810B1C) // ??? not on sx20 or s95 115 NSTUB(rand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers116 NSTUB(srand, 0xFF810B1C) // ??? could not find use C version from S95 wrappers117 117 NHSTUB(UIFS_WriteFirmInfoToFile, 0xFF810B1C) // Is this needed? 118 118 NHSTUB(rewinddir, 0xFF810B1C) -
trunk/platform/sx30/wrappers.c
r1008 r1123 1 1 2 #include "../generic/wrappers.c" 2 3 … … 15 16 return _GetCurrentTargetDistance(); 16 17 } 17 18 19 // SX30 firmware does not include rand(), srand() so we add them here20 21 #define RAND_MAX 0x7fffffff22 23 static unsigned int next = 1;24 25 int rand_r(unsigned int *seed)26 {27 *seed = *seed * 1103515245 + 12345;28 return (*seed % ((unsigned int) RAND_MAX + 1));29 }30 31 int _rand(void)32 {33 return (rand_r(&next));34 }35 36 void* _srand(unsigned int seed)37 {38 next = seed;39 return 0; // unused return value40 }
Note: See TracChangeset
for help on using the changeset viewer.