/******************************************************************************************* * * Definitions used when calling MMBasic Interpreter API Functions from CFunctions * For PicoMite MMBasic V6.00.01 * * This file is public domain and may be used without license. * * Use with AMRCFGENV144.bas * * V1.6.2 * NB: Base address has changed from previous versions to match V5.07.05 * V1.6.3 struct option_s updated to match 5.07.05 as defined in fileIO.h * V1.6.4 Additional links * v1.6.5 Latest Beta29 and PICOMITEVGA PICOMITEWEB Compiled with GCC 11.2.1 * v1.6.6 Updated to match 5.07.07 and 5.07.08b5 updates for fixed IP address * v1.6.7 Updated to match 5.07.08 release matches option_s and CSubComplete now char * v2.0.0 Updated for MMBasic 6.00.00 and also for RP2350 chip. * BaseAddress is different for PICO and PICO2 Set the correct #define * Note: Use ? HEX$(MM.INFO(CALLTABLE)) to verify the location of the calltable. * struct option_s updated to match v6.00.00RC15 * v2.0.1 struct option_s updated to match v6.00.01 Release * ******************************************************************************************/ /*** Uncomment one of these three ***/ #define PICOMITE //#define PICOMITEVGA //#define PICOMITEWEB /*** Uncomment this define if using PICO2 Chip ***/ #define PICORP2350 /*** Uncomment this define if HDMI pins required ***/ #define GUICONTROLS /*****************************************************************************************/ #define MAXVARLEN 32 // maximum length of a variable name #define MAXDIM 5 // maximum nbr of dimensions to an array #define MMFLOAT double #define MAXKEYLEN 64 //Addresses in the API Table for the pointers to each function #ifdef PICORP2350 #define BaseAddress 0x1000023C #else #define BaseAddress 0x100002D4 #endif #define Vector_uSec (*(unsigned int *)(BaseAddress+0x00)) // void uSec(unsigned int us) #define Vector_putConsole (*(unsigned int *)(BaseAddress+0x04)) // void putConsole(int C)) #define Vector_getConsole (*(unsigned int *)(BaseAddress+0x08)) // int getConsole(void) #define Vector_ExtCfg (*(unsigned int *)(BaseAddress+0x0C)) // void ExtCfg(int pin, int cfg, int option) #define Vector_ExtSet (*(unsigned int *)(BaseAddress+0x10)) // void ExtSet(int pin, int val) #define Vector_ExtInp (*(unsigned int *)(BaseAddress+0x14)) // int ExtInp(int pin) #define Vector_PinSetBit (*(unsigned int *)(BaseAddress+0x18)) // void PinSetBit(int pin, unsigned int offset) #define Vector_PinRead (*(unsigned int *)(BaseAddress+0x1C)) // int PinRead(int pin) #define Vector_MMPrintString (*(unsigned int *)(BaseAddress+0x20)) // void MMPrintString(char* s) #define Vector_IntToStr (*(unsigned int *)(BaseAddress+0x24)) // void IntToStr(char *strr, long long int nbr, unsigned int base) #define Vector_CheckAbort (*(unsigned int *)(BaseAddress+0x28)) // void CheckAbort(void) #define Vector_GetMemory (*(unsigned int *)(BaseAddress+0x2C)) // void *GetMemory(size_t msize); #define Vector_GetTempMemory (*(unsigned int *)(BaseAddress+0x30)) // void *GetTempMemory(int NbrBytes) #define Vector_FreeMemory (*(unsigned int *)(BaseAddress+0x34)) // void FreeMemory(void *addr) #define Vector_DrawRectangle *(unsigned int *)(BaseAddress+0x38 ) // void DrawRectangle(int x1, int y1, int x2, int y2, int C)) #define Vector_DrawBitmap *(unsigned int *)(BaseAddress+0x3c ) // void DrawBitmap(int x1, int y1, int width, int height, int scale, int fg, int bg, unsigned char *bitmap ) #define Vector_DrawLine (*(unsigned int *)(BaseAddress+0x40)) // void DrawLine(int x1, int y1, int x2, int y2, int w, int C)) #define Vector_FontTable (*(unsigned int *)(BaseAddress+0x44)) // const unsigned char *FontTable[FONT_NBR] #define Vector_ExtCurrentConfig (*(unsigned int *)(BaseAddress+0x48)) // int ExtCurrentConfig[NBRPINS + 1]; #define Vector_HRes (*(unsigned int *)(BaseAddress+0x4C)) // HRes #define Vector_VRes (*(unsigned int *)(BaseAddress+0x50)) // VRes #define Vector_SoftReset (*(unsigned int *)(BaseAddress+0x54)) // void SoftReset(void) #define Vector_error (*(unsigned int *)(BaseAddress+0x58)) // void error(char *msg) #define Vector_ProgFlash (*(unsigned int *)(BaseAddress+0x5C)) // ProgFlash #define Vector_vartbl (*(unsigned int *)(BaseAddress+0x60)) // g_vartbl #define Vector_varcnt (*(unsigned int *)(BaseAddress+0x64)) // g_varcnt #define Vector_DrawBuffer *(unsigned int *)(BaseAddress+0x68 ) // void DrawRectangle(int x1, int y1, int x2, int y2, int C)) #define Vector_ReadBuffer *(unsigned int *)(BaseAddress+0x6c ) // void DrawRectangle(int x1, int y1, int x2, int y2, int C)) #define Vector_FloatToStr (*(unsigned int *)(BaseAddress+0x70)) // convert a float to a string including scientific notation if necessary #define Vector_ExecuteProgram (*(unsigned int *)(BaseAddress+0x74)) // void ExecuteProgram(char *fname) #define Vector_CFuncmSec (*(unsigned int *)(BaseAddress+0x78)) // CFuncmSec #define Vector_CFuncRam (*(unsigned int *)(BaseAddress+0x7C)) // StartOfCFuncRam #define Vector_ScrollLCD *(unsigned int *)(BaseAddress+0x80 ) // void scrollLCD(int lines, int blank) #define Vector_IntToFloat (*(unsigned int *)(BaseAddress+0x84)) // MMFLOAT IntToFloat(long long int a) #define Vector_FloatToInt (*(unsigned int *)(BaseAddress+0x88)) // long long int FloatToInt64(MMFLOAT x) #define Vector_Option (*(unsigned int *)(BaseAddress+0x8C)) // Option #define Vector_Sine (*(unsigned int *)(BaseAddress+0x90)) // MMFLOAT sin(MMFLOAT) #define Vector_DrawCircle (*(unsigned int *)(BaseAddress+0x94)) // DrawCircle(int x, int y, int radius, int w, int c, int fill, MMFLOAT aspect) #define Vector_DrawTriangle (*(unsigned int *)(BaseAddress+0x98)) // DrawTriangle(int x0, int y0, int x1, int y1, int x2, int y2, int c, int fill) #define Vector_Timer (*(unsigned int *)(BaseAddress+0x9C)) // uint64_t timer(void) #define Vector_FMul (*(unsigned int *)(BaseAddress+0xA0)) // MMFLOAT FMul(MMFLOAT a, MMFLOAT b){ return a * b; } #define Vector_FAdd (*(unsigned int *)(BaseAddress+0xA4)) // MMFLOAT FAdd(MMFLOAT a, MMFLOAT b){ return a + b; } #define Vector_FSub (*(unsigned int *)(BaseAddress+0xA8)) // MMFLOAT FSub(MMFLOAT a, MMFLOAT b){ return a - b; } #define Vector_FDiv (*(unsigned int *)(BaseAddress+0xAC)) // MMFLOAT FDiv(MMFLOAT a, MMFLOAT b){ return a / b; } #define Vector_FCmp (*(unsigned int *)(BaseAddress+0xB0)) // int FCmp(MMFLOAT a,MMFLOAT b){if(a>b) return 1;else if(a