Picaso PmmC version 1.08 Release Notes 10/03/2009 Fixes:- bugfix 15/01/2009 function uSD_WrSector now returns TRUE if uSD response was ok bugfix 21/01/2009 Inability to read FAT16 disks with Partition tables. bugfix 21/01/2009 GRAM write direction was at times not fully reset. bugfix 17/02/2009 file_Erase, file_Run and file_Exec would only accept string arguments bugfix 17/02/2009 X_RES and Y_RES were returning 1 less than actual bugfix 23/02/2009 MIDI baud rate incorrect bugfix 27/02/2009 kill high-light line on exit from gfx_Button, high-light was left switched on bugfix 17/03/2009 last line was clipped on full display of video, possibly still some issues with certain aspects of large image displaying. bugfix 10/01/2009 Some Displays operated inconsistently or not at all with 1.07 bugfix 10/01/2009 OLED Herringbone Problem – background fill gave strange results under certain conditions. Limitations:- Known issue with 1.0x video speed. Video's are slower compared to original. serial platform versions due to operating system overheads. Additions:- All global program variables and arrays are zeroed at program start. All local variables are zeroed on entry to the function. New error codes displayed by EVE core:- Note that if your main FLASH program returns, you will either get the version number, ie: "1.08" followed by the Ok> message,or possibly one of the following error codes if some kind of failure returned to the main operating system. glb_error = 1; // failed to mount glb_error = 2; // failed to open file glb_error = 3; // incorrect header ID glb_error = 4; // out of memory for code glb_error = 5; // code memory allocation error glb_error = 6; // code memory allocation error glb_error = 7; // failed to read correct number of code-bytes glb_error = 8; // if checksum failed, set error glb_error = 9; // unexpected error, could not allocate mem seg glb_error = 10; // runtime failed to load file for exec glb_error = 11; // too many levels glb_error = 12; // failed to write file glb_error = 13; // file program loader bad byte-count glb_error = 20; // stack error glb_error = 500; // runtime failed to load file for run The display will now show a message if a return to the system level occurs. This usually can only happen if there is A] no program at all in the FLASH, or B] the FLASH program has returned. Also, while displaying the version number eg: 1.08 followed by the Ok> message, the following is also happening:- Each half second, look to see if a uSD card is present, if there is, try and mount a FAT16 system, and look for a file named "sysboot.4DS" which will be loaded and run if it is present. You can simply name "*.4DG" to "sysboot.4DS" and it will become your main program that will run - but only if your program in FLASH does a return. when "sysboot.4DS" does a return, the FLASH program is loaded again and run. So sysboot can contain a 'front end' for the disk you are running, and maybe show some operating instruction to the user, or some kind of menu options. 1.07 Replicated comms functions for com1 func com1_Init("buffer", "bufsize", "qualifier"), 0; func com1_Reset(), 0; func com1_Count(), 1; func com1_Full(), 1; func com1_Error(), 1; func com1_Sync(), 1; func com_SetBaud("comport","baudrate/10"), 1; func serin1(), 1; func serout1("char"), 0; Added I2C support func I2C_Open("speed"), 0; func I2C_Close(), 0; func I2C_Start(), 0; func I2C_Stop(), 0; func I2C_Restart(), 0; func I2C_Read(), 1; func I2C_Write("byte"), 1; func I2C_Ack(), 0; func I2C_Nack(), 0; func I2C_AckStatus(), 0; func I2C_AckPoll("control"), 1; func I2C_Idle(), 0; func I2C_Gets("buffer", "size"), 1; func I2C_Getn("buffer", "size"), 1; func I2C_Puts("buffer"), 1; func I2C_Putn("buffer", "count"), 1; I2C timing related constants I2C_SLOW, I2C_MED, I2C_FAST func gfx_Panel("state", "x", "y", "width", "height", "colour"), 0; Draws a panel, basically a button with no text, uses bevel property. related constants PANEL_SUNKEN, PANEL_RAISED, PANEL_HIDE func gfx_Selection("index", "backcolor", "textcolor"), 0; Called prior to drawing a button, this function hilites the required text line on a multiline button. func sys_Sleep("units"), 1; Sets the display into low power mode for a period of time. Touching the touch screen will also wake from sleep. Returns remaining sleep units. func sys_Function("func", "userstack"), 1; Runs any internal function with a user stack holding the parameter instead of passing them with the usual function parameter list. Returns a return value if function called has one, else returns uncertain value. Note that the users stack pointer MUST be held first variable in your program. This is done so as to eliminate the need to pass a stack pointer argument each time this function is called, saving code-space and execution time. func sys_Op("operator"), 1; Execute a stack operation on the users stack (see functions below) ( see Stack engine operator tokens below :-) Note that the users stack pointer MUST be held as the first variable in your program. This is done so as to eliminate the need to pass a stack pointer argument each time this function is called, saving code space and execution time. Returns the stack pointer value (which is mem[0] ). Stack engine operator tokens OPR_AND 0 // AND and leave result ( N1 N2 --- (N1&N2) ) OPR_OR 1 // OR and leave result ( N1 N2 --- (N1|N2) ) OPR_XOR 2 // OR and leave result ( N1 N2 --- (N1^N2) ) OPR_EQ 3 // compare and leave result ( N1 N2 --- (N1==N2) ) OPR_NE 4 // compare and leave result ( N1 N2 --- (N1!=N2) ) OPR_LT 5 // compare and leave result ( N1 N2 --- (N1<=N2) ) OPR_LE 6 // compare and leave result ( N1 N2 --- (N1>N2) ) OPR_GT 7 // compare and leave result ( N1 N2 --- (N1>=N2) ) OPR_RSH 17 // left shift top element, leave result ( N1 N2 --- (N1<<=N2) ) OPR_NOT 18 // unary not ( N --- (!N) ) OPR_NEG 19 // unary negate ( N --- (-N) ) OPR_DUP 20 // duplicate top element ( N --- N N ) OPR_SWAP 21 // Swap top two stack elements ( N1 N2 --- N2 N1 ) OPR_OVER 22 // Push second element on the stack ( N1 N2 --- N1 N2 N1 ) OPR_PICK 23 // Copy the N1'th element to top ( N1 --- N2=S[N] ) OPR_DROP 24 // drop top 1 element off stack ( N --- ) OPR_DROP2 25// drop top 2 element off stack ( N N --- ) OPR_DROP3 26// drop top 3 element off stack ( N N N--- ) OPR_DROP4 27// drop top 4 element off stack ( N N N N --- ) func sys_Push("VorC"), 1; Push any value to the user stack. "value" can be a constant, pointer, string constant or the result of an expression. Note that the users stack pointer MUST be held as the first variable in your program. This is done so as to eliminate the need to pass stack pointer argument each time this function is called, saving code space and execution time. NB:- Returns the stack pointer value (which is mem[0] ). improved image control, refer to on-line docs for more info new image control constants I_AUTO_STEP 0x0040 // bit 6, movie auto frame step mode I_REVERSE 0x0020 // bit 5, movie step direction I_COLOUR16 0x0010 // bit 4, indicates 16 bit colour mode I_SERVICE 0x0008 // bit 3, image update request (internal) I_LOOPED 0x0004 // bit 2, movie loop forever I_SYNC 0x0002 // bit 1, movie looped I_PAUSE 0x0001 // bit 0, movie halted extended image control variables IMAGE_FRAMES 8 // number of frames IMAGE_INDEX 9 // current frame IMAGE_LOOP_START 10 // looping start point IMAGE_LOOP_END 11 // looping end point IMAGE_DELAY 12 // inter frame delay IMAGE_TIMER 13 // timer for frame delay func file_Index("handle", "HiSize", "LoSize","recordnum"), 1; HiSize:LOHiSize is multiplied by recordnum to set seek position for the file handle so subsequent data may be read from that record position onwards with file_GetC(...), file_GetW(...) or file_GetS(...), or an image can be displayed with file_Image(...) func file_Tell("handle", "&HiWord", "&LoWord"), 1; Reads the 32 bit file pointer and stores it into 2 variables. returns true if function succeeded func file_ScreenCapture("x", "y", "width", "height", "handle"), 1; Saves a image from screen to file at the current file position. The image can later be displayed with file_Image(...); The file may be opened in append mode to accumulate multiple images. Later, the images can be accessed with file_Seek(...); The image is saved from x, y (with respect to top left corner) and the capture area is determined by "width" and "height". returns 0 if function succeeded func file_Run("fname.4xe", "arglistptr"), 1; The current program is dumped. The new program recovers all resources. If arglistptr is 0, no arguments are passed, else it points to the arglist func 'main' in the called program accepts the arguments, if any. func file_Exec("fname.4xe", "arglistptr"), 1; Returns like a function to the current program. Calling program is kept active and control returns to it. If arglistptr is 0, no arguments are passed.