My enhanced NBC/NXC firmware combines the work of Nicolas Schodet, Mindsensors.com, and my own enhancements/fixes into one. You can grab the latest enhanced NBC/NXC sourcecode from the following link using SVN:
https://mindboards.svn.sourceforge.net/ ... rsion_131/
The list of bug fixes and enhancements is really too long to list but here's a rough stab:
Fixes:
1. Fix the unbalanced GetProcArray and SetProcArray lengths. The SetProcArray should have 11 function pointers (not 9) in it just like the GetProcArray does. This will fix the bug when you pass a float type into a function that uses the SetProcArray to set the variable to a new value. Since the float type is not included in the SetProcArray the result is a locked up brick.
2. Fix the use of floating point constants so that they are marked as floats. Currently the compiler uses doubles for these constants and as a results links in library code for double to float conversions that is not necessary.
3. Fix the SET opcode bug where it does not handle 4 byte longs correctly.
4. Fix the bug in cCmdInterpPolyUnop2 where if both types are an array of the same int scalar type it always performs a MOV operation whether the opcode is OP_MOV or not. This function is called with several other opcodes in addition to MOV - none of which work correctly on scalar int arrays due to this bug.
5. Fix the bug in cCmdUnop2Flt where sqrt is called instead of sqrtf, causing unnecessary double to float library code to be linked into the firmware.
6. Fix the bug in the GETIN opcode where it incorrectly checks the type code for argument 1 twice instead of checking the type code of argument 1 and argument 2.
7. Fix the bug in ARRINIT where it assumes the output array type is compatible with the initial value type rather than checking both in the if condition.
8. Fix the bug in cCmdBinopFlt where it casts the left and right float inputs as SLONG for the MOD opcode - resulting in incorrect values in the output. fmodf should be used instead.
9. Fix the REPLACE opcode bug which breaks support for multi-dimensional arrays. As written it only works for arrays with 1 dimension.
10. Fix the STRINGTONUM opcode so that it works correctly with either int or float values in the string.
11. Fix the bug in cCmdLSCalcBytesReady so that it handles 16 byte IIC responses rather than a maximum of 15.
12. Fix the partial/wrong implementation of CommHSWrite, CommHSCheckStatus, and CommHSRead system call functions.
13. Fix the incorrect return type (should be UWORD rather than SBYTE) for the newly added CommBTConnection and CommBTOnOff system call functions.
14. Fix the bug that limits RIC parameters to 16 instead of 256 which should be supported (the IMG_SYMB_ARG mask should be 0x00FF rather than 0x000F).
15. Fix the missing RIC Circle opcode.
16. Fix the incorrect size (IMG_OP_LINE vs IMG_OP_RECT) checked for the RIC Rectangle opcode.
17. Fix the bug in cCommInterpreteCmd (in the POLLCMD case) where the high speed output pointer is limited to the size of the USB buf (64) rather than the size of the hig speed buf (128).
Enhancements:
1. Support multiple ports in the SetOutputState direct command instead of just one or 0xFF == all ports. I have simple code I can provide which supports 0x03 or 0xFC = AB, 0x04 or 0xFD = AC, 0x05 or 0xFE = BC, and 0x06 or 0xFF = ABC.
2. Add support for a user-definable program abort flag (rather than hard coded as BTN1 state == PRESSED_EV) so that you can use the 4th button in a user program.
3. Enable SETOUT opcode to handle scalar values for multiple ports in addition to specifying multiple ports via a byte array containing the port values (e.g., 0x03 == AB, 0x04 == AC, 0x05 == BC, and 0x06 == ABC).
4. Allow user programs to write/read more than 64 bytes at a time via the internal IOMapWrite and IOMapRead system calls.
5. Extensive enhancements to drawing code, including support for polyline/polygon and ellipse both with API functions and in RIC files. Support for RIC-based fonts.
6. Support for precise position based motor regulation (written by Nicolas Schodet)
7. Support for fast I2C communication
8. Support for RS485 baud/mode/uartmode setting (i.e., 9600, N81, RS232).
9. Support for pausing a running program, and single-stepping through the code
10. Enhanced random number generator
11. Support for low level input port digital pin manipulation
12. Support for a FileTell functionality (to check position of read pointer in a file).
13. Memory manager system call function for checking memory usage or forcing a dataspace compaction.
14. Support for DATA_MODE_NXT over RS485 so that the firmware automatically handles direct and system commands sent via RS485
15. Support for multi-NXT addressing via RS485 when in the new DATA_MODE_NXT data mode
16. Native opcodes for (nearly) every math.h standard C library function such as sin, cos, tan, asin, acos, atan, log, pow, etc...
17. Opcodes for low level direct memory addressing (reladdr, and addrex)
18. Support for getting/setting the display contrast.
19. Support for bitwise negation (complement)
20. Support for file system iteration via new system calls (FileFindFirst, FileFindNext, etc...)
21. Native opcodes for stopping another thread/task, formatting a number into a string (simple printf style opcode)
22. Native opcode for several fast array operations (min, max, mean, sort, etc...)
Probably lots more that I have forgotten.
John Hansen