diff --git a/.gitignore b/.gitignore index 2eb068e..ac99782 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ toolchain/ majestic.yaml /msposd firmware/ +release/ msposd_goke msposd_hisi msposd_star6b0 diff --git a/README.md b/README.md index 575bf31..bef280d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Usage: msposd [OPTIONS] -d --wfb Monitors wfb.log file and reports errors via HUD messages -s --osd Parse MSP and draw OSD over the video -a --ahi Draw graphic AHI, mode [0-No, 2-Simple 1-Ladder, 3-LadderEx (home indicator on ladder)] - -x --matrix OSD matrix [0- 53:20 , 1- 50:18 chars, 11 Variable font size] + -x --matrix OSD matrix [0- 53:20 , 1- 50:18 chars, 11- Variable font size, 9-bottom align 720p mode, 8-center align 720p mode] --mspvtx Enable alpha mspvtx functionality -v --verbose Show debug info --help Display this help @@ -134,7 +134,7 @@ Copy msposd for the architecture you need on the cam. Prebuild binaries for x86, SigmaStar, Goke and Hisilicon are at release/ folder. **For SigmaStar** based SoC (ssc338q, sc30kq) : ``` -curl -L -o /usr/bin/msposd https://raw.githubusercontent.com/openipc/msposd/main/release/star6e/msposd +curl -L -o /usr/bin/msposd https://github.com/OpenIPC/msposd/releases/download/latest/msposd_star6e chmod 755 /usr/bin/msposd ``` Copy the font files for your flight controller firmware INAV/ Betaflight/ ArduPilot from here https://github.com/openipc/msposd/tree/main/fonts @@ -170,9 +170,9 @@ Start msposd or reference it in OpenIPC boot scripts. ### To install on Goke/HiSilicon camera ``` -curl -L -o /usr/bin/msposd https://raw.githubusercontent.com/openipc/msposd/main/release/goke/msposd +curl -L -o /usr/bin/msposd curl -L -o /usr/bin/msposd https://github.com/OpenIPC/msposd/releases/download/latest/msposd_goke #or -curl -L -o /usr/bin/msposd https://raw.githubusercontent.com/openipc/msposd/main/release/hisi/msposd +curl -L -o /usr/bin/msposd curl -L -o /usr/bin/msposd https://github.com/OpenIPC/msposd/releases/download/latest/msposd_hisi chmod 755 /usr/bin/msposd #Download an additional driver for Region Module curl -k -L -o /lib/modules/4.9.37/goke/gk7205v200_rgn.ko https://github.com/OpenIPC/firmware/raw/89ded200eba00726930b8307ddaf573ac449f076/general/package/goke-osdrv-gk7205v200/files/kmod/gk7205v200_rgn.ko diff --git a/osd.c b/osd.c index 927dc8f..15d16ed 100644 --- a/osd.c +++ b/osd.c @@ -744,7 +744,7 @@ void LineTranspose(uint8_t* bmpData, int posX0, int posY0, int posX1, int posY1, const bool show_center_indicator = false;////m_show_center_indicator; const double ladder_stroke_faktor=0.1; - const int subline_thickness=2; + const int subline_thickness=1; if (OVERLAY_HEIGHT<900){//720p mode horizonWidth = 2; @@ -851,7 +851,7 @@ void LineTranspose(uint8_t* bmpData, int posX0, int posY0, int posX1, int posY1, //right upper line //drawRectangleI4(bmpBuff.pData, px+width_ladder*2/3 , y , width_ladder/3 , stroke_s, m_color,subline_thickness); - LineTranspose(bmpBuff.pData, px+width_ladder*2/3 , y , (px+width_ladder*2/3) + width_ladder/3 , y , m_color, subline_thickness); // Top side + LineTranspose(bmpBuff.pData, px+width_ladder*2/3 , y , (px+width_ladder*2/3) + width_ladder/3 - 1 , y , m_color, subline_thickness); // Top side @@ -1924,6 +1924,7 @@ void getExecutablePath(char *buffer, size_t bufferSize) { } } int majestic_width; +int majestic_height; int fd_mem; static void InitMSPHook(){ @@ -1964,7 +1965,7 @@ static void InitMSPHook(){ int height = GetMajesticVideoConfig(&majestic_width); - + majestic_height=height; #ifdef _x86 if (DrawOSD) Init_x86(&OVERLAY_WIDTH, &OVERLAY_HEIGHT); @@ -2084,11 +2085,20 @@ On sigmastar the BMP row stride is aligned to 8 bytes, that is 16 pixels in PIXE int XOffs=(majestic_width - OVERLAY_WIDTH)/2; if (XOffs<0) XOffs=8; + XOffs = (XOffs + 7) & ~7;//multiple of 8 + + int YOffs=0; + if (matrix_size==8) + YOffs=(majestic_height - OVERLAY_HEIGHT)/2;//vertical center + + if (matrix_size==9) + YOffs=(majestic_height - OVERLAY_HEIGHT);//vertical bottom + //THIS IS NEEDED, the main region to draw inside if (DrawOSD) - rgn=create_region(&osds[FULL_OVERLAY_ID].hand, XOffs, 0, OVERLAY_WIDTH, OVERLAY_HEIGHT); + rgn=create_region(&osds[FULL_OVERLAY_ID].hand, XOffs, YOffs, OVERLAY_WIDTH, OVERLAY_HEIGHT); if (verbose) - printf("Create_region PixelFormat:%d Size: %d:%d X_Offset:%d results: %d \r\n", PIXEL_FORMAT_DEFAULT, OVERLAY_WIDTH,OVERLAY_HEIGHT, XOffs, rgn); + printf("Create_region PixelFormat:%d Size: %d:%d X_Offset:%d Y_Offset:%d results: %d \r\n", PIXEL_FORMAT_DEFAULT, OVERLAY_WIDTH,OVERLAY_HEIGHT, XOffs,YOffs, rgn); if (DrawOSD){ //Show Font Preview #ifdef _x86 diff --git a/release/goke/msposd b/release/goke/msposd deleted file mode 100755 index 7d32153..0000000 Binary files a/release/goke/msposd and /dev/null differ diff --git a/release/hisi/msposd b/release/hisi/msposd deleted file mode 100755 index ade5386..0000000 Binary files a/release/hisi/msposd and /dev/null differ diff --git a/release/star6e/msposd b/release/star6e/msposd deleted file mode 100755 index 066550b..0000000 Binary files a/release/star6e/msposd and /dev/null differ diff --git a/release/x86/msposd b/release/x86/msposd deleted file mode 100755 index c7e9410..0000000 Binary files a/release/x86/msposd and /dev/null differ diff --git a/version.h b/version.h index 0adb010..6254bb2 100644 --- a/version.h +++ b/version.h @@ -1,4 +1,4 @@ #ifndef VERSION_H #define VERSION_H -#define GIT_VERSION "786ee76-dirty" +#define GIT_VERSION "c1ffa36-dirty" #endif // VERSION_H