Functions inside of Run-Matrix on the fx-CG50
Posté le 29/03/2025 12:57
I am attempting create a function inside of Run-Matrix on the fx-CG50 similar to how Conversion add-in works on the calculator by clicking (OPTN ⇒ F6 ⇒ F6 ⇒ F3) when inside of Run-Matrix so I can get a popup on screen again similar to Conversion (I have attached a picture to show what I mean) add-in but I don't know how to put it into Run-Matrix I was guessing that this code may be right but I am not too sure
#include <fxcg/display.h>
#include <fxcg/keyboard.h>
#include <fxcg/system.h>
#include <fxcg/app.h>
void show_popup() {
Bdisp_EnableColor(1);
Bdisp_AllClr_DDVRAM();
int x1 = 50, y1 = 30, x2 = 270, y2 = 100;
Bdisp_DrawLineVRAM(x1, y1, x2, y1);
Bdisp_DrawLineVRAM(x1, y2, x2, y2);
Bdisp_DrawLineVRAM(x1, y1, x1, y2);
Bdisp_DrawLineVRAM(x2, y1, x2, y2);
PrintXY(60, 60, "2", TEXT_MODE_NORMAL, TEXT_COLOR_BLACK);
PrintXY(140, 60, "3", TEXT_MODE_NORMAL, TEXT_COLOR_BLACK);
PrintXY(220, 60, "4", TEXT_MODE_NORMAL, TEXT_COLOR_BLACK);
Bdisp_PutDisp_DD();
int key;
while(!GetKey(&key));
Bdisp_AllClr_DDVRAM();
Bdisp_PutDisp_DD();
}
int main() {
if (GetAppID() != APPID_RUN_MATRIX) { //potentially so its in Run-Matrix??
return 1;
}
int key;
int step = 0;
while(1) {
GetKey(&key);
switch(step) {
case 0: if (key == KEY_CTRL_OPTN) step++; break;
case 1: if (key == KEY_CTRL_F6) step++; else step=0; break;
case 2: if (key == KEY_CTRL_F6) step++; else step=0; break;
case 3: if (key == KEY_CTRL_F3) { show_popup(); step=0; }
else step=0;
break;
}
}
return 0;
}
I am planning to make it a .g3a file using fxSDK and also develop using fxSDK which I got using WSL terminal.
Any help appreciated Thank you!
Fichier joint
Citer : Posté le 29/03/2025 13:12 | #
There's no way that's happening unfortunately—your code will only run when you select the add-in the main menu. Conversion works differently, it used to be an add-in and later is was integrated in RUN/MAT. So actually the code is already in RUN/MAT and the Conv.g3a add-in does nothing; RUN/MAT just notices when it's installed and enables the pre-built feature.
Citer : Posté le 29/03/2025 13:18 | #
So there is no way of putting a custom function into Run-Matrix entirely? Or even modifying Run-Matrix for it
Citer : Posté le 29/03/2025 13:37 | #
No, add-ins are only their own apps. You can't modify a built-in app. :x