diff --git a/firmware/hal_keyboard_primeg1.c b/firmware/hal_keyboard_primeg1.c index e0a339d..79a845d 100644 --- a/firmware/hal_keyboard_primeg1.c +++ b/firmware/hal_keyboard_primeg1.c @@ -6942,9 +6942,9 @@ const struct keyhandler_t const __keydefaulthandlers[] = { KEYHANDLER_NAME(backslash)}, - {KM_PRESS | KB_0 | SHIFT_RS | SHIFT_RSHOLD, CONTEXT_ANY, + {KM_PRESS | KB_SPC | SHIFT_RS | SHIFT_RSHOLD, CONTEXT_ANY, KEYHANDLER_NAME(rulesep)}, - {KM_PRESS | KB_0 | SHIFT_ALPHA | SHIFT_RS | SHIFT_RSHOLD, CONTEXT_ANY, + {KM_PRESS | KB_SPC | SHIFT_ALPHA | SHIFT_RS | SHIFT_RSHOLD, CONTEXT_ANY, KEYHANDLER_NAME(rulesep)}, diff --git a/firmware/hal_screen.c b/firmware/hal_screen.c index 4b53cbf..ceea080 100644 --- a/firmware/hal_screen.c +++ b/firmware/hal_screen.c @@ -1979,6 +1979,7 @@ void status_popup_handler() else { DRAWSURFACE scr; cgl_initscr(&scr); + halRedrawMenu1(&scr); halRedrawMenu2(&scr); halRedrawStatus(&scr); } diff --git a/newrpl/lib-30-complex.c b/newrpl/lib-30-complex.c index 7ca5405..d4acf75 100644 --- a/newrpl/lib-30-complex.c +++ b/newrpl/lib-30-complex.c @@ -7262,7 +7262,7 @@ void LIB_HANDLER() return; } // CHECK IF IMAGINARY PART IS A VALID NUMBER - if(!ISNUMBER(*imag)) { + if(!ISNUMBERORANGLE(*imag)) { RetNum = ERR_INVALID; return; } diff --git a/newrpl/lib-48-angles.c b/newrpl/lib-48-angles.c index 4f22d11..5ce3ce8 100644 --- a/newrpl/lib-48-angles.c +++ b/newrpl/lib-48-angles.c @@ -2181,7 +2181,7 @@ void LIB_HANDLER() // LIBRARY MUST RETURN: RetNum=OK_CONTINUE IF OBJECT IS VALID OR RetNum=ERR_INVALID IF IT'S INVALID if(ISPROLOG(*ObjectPTR)) { - if(OBJSIZE(*ObjectPTR) < 2) { + if(OBJSIZE(*ObjectPTR) < 1) { RetNum = ERR_INVALID; return; } diff --git a/newrpl/lib-66-transcendentals.c b/newrpl/lib-66-transcendentals.c index 37f5619..06340b5 100644 --- a/newrpl/lib-66-transcendentals.c +++ b/newrpl/lib-66-transcendentals.c @@ -1706,7 +1706,18 @@ void LIB_HANDLER() // ONLY ACCEPT THE ANGLE IN RADIANS trig_convertangle(&im, angmode, ANGLERAD); - swapReal(&RReg[0], &RReg[9]); + // CHECK IF NOT NORMALIZED + if(re.flags&F_NEGATIVE) { + re.flags^=F_NEGATIVE; + + // ADD/SUBTRACT PI TO THE ANGLE + + REAL pi; + decconst_PI(&pi); + if(im.flags&F_NEGATIVE) addReal(&RReg[9],&RReg[0],&pi); + else subReal(&RReg[9],&RReg[0],&pi); + } + else swapReal(&RReg[0], &RReg[9]); hyp_ln(&re); finalize(&RReg[0]); diff --git a/newrpl/lib-80-bitmaps.c b/newrpl/lib-80-bitmaps.c index 251cbd1..9f0fa51 100644 --- a/newrpl/lib-80-bitmaps.c +++ b/newrpl/lib-80-bitmaps.c @@ -303,6 +303,160 @@ WORDPTR rplBmpToDisplay(WORDPTR bitmap) } #endif +#if DEFAULTBITMAPMODE == BITMAP_RAW64KC + switch (type) { + case BITMAP_RAWMONO: + + { + HALFWORDPTR destptr; + BYTEPTR srcptr; + + BINT mask = 1; + BINT pixel; + + srcptr = (BYTEPTR) (bitmap + 3); + destptr = (HALFWORDPTR) (newbmp + 3); + + while(npixels) { + + // READ A PIXEL FROM SOURCE + pixel = *srcptr & mask; + // CONVERT TO PROPER FORMAT + if(pixel) + pixel = RGB_TO_RGB16(0,0,0); // ASSUME MONOCHROME GRAPHICS ARE BLACK ON WHITE (SAME AS 50G OR A FAX) + else + pixel = RGB_TO_RGB16(255,255,255); + + // WRITE TO DESTINATION + *destptr = (HALFWORD) pixel; + + //INCREASE SOURCE POINTER + mask <<= 1; + if(mask > 128) { + ++srcptr; + mask >>= 8; + } + + // INCREASE DEST PTR + ++destptr; + --npixels; + } + break; + + } + + case BITMAP_RAW16G: + { + HALFWORDPTR destptr; + BYTEPTR srcptr; + + BINT mask = 0xf,rot=4; + BINT pixel; + + srcptr = (BYTEPTR) (bitmap + 3); + destptr = (HALFWORDPTR) (newbmp + 3); + + while(npixels) { + + // READ A PIXEL FROM SOURCE + pixel = 0xf0 - ((*srcptr & mask) << rot); + if(pixel&0x80) pixel|=0xf; + + // CONVERT TO PROPER FORMAT + pixel = RGB_TO_RGB16(pixel,pixel,pixel); // ASSUME GRAY16 GRAPHICS ARE BLACK ON WHITE (SAME AS 50G BITMAPS) + + // WRITE TO DESTINATION + *destptr = (HALFWORD) pixel; + + //INCREASE SOURCE POINTER + mask <<= 4; + rot^=4; + if(mask > 0xf0) { + ++srcptr; + mask >>= 8; + } + + // INCREASE DEST PTR + ++destptr; + --npixels; + } + break; + + } + case BITMAP_RAW256G: + + { + + HALFWORDPTR destptr; + BYTEPTR srcptr; + + BINT pixel; + + srcptr = (BYTEPTR) (bitmap + 3); + destptr = (HALFWORDPTR) (newbmp + 3); + + while(npixels) { + + // READ A PIXEL FROM SOURCE + pixel = *srcptr; + // CONVERT TO PROPER FORMAT + pixel = RGB_TO_RGB16(pixel,pixel,pixel); + + // WRITE TO DESTINATION + *destptr = (HALFWORD)pixel; + + //INCREASE SOURCE POINTER + ++srcptr; + + ++destptr; + + --npixels; + } + break; + } + case BITMAP_RAW64KC: + + { + break; + } + + case BITMAP_RAWARGB: + + { + + HALFWORDPTR destptr; + WORDPTR srcptr; + + BINT destmask = 0; + WORD pixel; + + srcptr = (WORDPTR) (bitmap + 3); + destptr = (HALFWORDPTR) (newbmp + 3); + + while(npixels) { + + // READ A PIXEL FROM SOURCE + pixel=*srcptr; + + // CONVERT TO PROPER FORMAT + pixel = RGB_TO_RGB16((pixel>>16)&0xff,(pixel>>8)&0xff,(pixel)&0xff); + + *destptr = (HALFWORD) pixel; + + //INCREASE SOURCE POINTER + srcptr++; + + // INCREASE DEST PTR + ++destptr; + + --npixels; + } + break; + } + + } +#endif + // ALL PIXELS CONVERTED return newbmp; diff --git a/newrpl/libraries.h b/newrpl/libraries.h index aac1a4b..a274c10 100644 --- a/newrpl/libraries.h +++ b/newrpl/libraries.h @@ -317,6 +317,7 @@ WORD libComputeHash2(WORDPTR start, BINT nwords); #define ISPROGRAM(prolog) ( ISPROLOG(prolog) && ((LIBNUM(prolog)==DOCOL) || (LIBNUM(prolog)==SECO))) #define ISSECO(prolog) ( ISPROLOG(prolog) && (LIBNUM(prolog)==SECO)) #define ISNUMBER(prolog) (ISBINT(prolog)||ISREAL(prolog)||ISREALCONSTANT(prolog)) +#define ISNUMBERORANGLE(prolog) (ISBINT(prolog)||ISREAL(prolog)||ISANGLE(prolog)||ISREALCONSTANT(prolog)) #define ISNUMBERCPLX(prolog) (ISBINT(prolog)||ISREAL(prolog)||ISCOMPLEX(prolog)||ISCONSTANT(prolog)) #define ISSTRING(prolog) (ISPROLOG(prolog) && ((LIBNUM(prolog)&~3)==DOSTRING)) diff --git a/newrpl/newrpl_types.h b/newrpl/newrpl_types.h index 0773a07..64c86b3 100644 --- a/newrpl/newrpl_types.h +++ b/newrpl/newrpl_types.h @@ -15,6 +15,7 @@ typedef void (*LIBHANDLER)(void); typedef uint16_t HALFWORD; typedef uint32_t WORD; typedef uint8_t BYTE; +typedef HALFWORD *HALFWORDPTR; typedef WORD *WORDPTR; typedef BYTE *BYTEPTR; typedef int32_t BINT; diff --git a/newrpl/rpl-objects/lib-104.nrpl b/newrpl/rpl-objects/lib-104.nrpl index fa26864..823fe92 100644 --- a/newrpl/rpl-objects/lib-104.nrpl +++ b/newrpl/rpl-objects/lib-104.nrpl @@ -57,7 +57,7 @@ @#name lib104_menu { -NUMINT ROOT MSOLVE "" "" +NUMINT ROOT MSOLVE { "" } { "" } { { "Finan" 1 } { :: #06801000h TMENULST ; :: #06801000h TMENUOTHR ; } } } diff --git a/newrpl/rpl-objects/lib-66.nrpl b/newrpl/rpl-objects/lib-66.nrpl index 6f1aab9..bef58b2 100644 --- a/newrpl/rpl-objects/lib-66.nrpl +++ b/newrpl/rpl-objects/lib-66.nrpl @@ -30,7 +30,7 @@ @#name lib66_trig { -SIN COS TAN { "" :: ; } { { "Angles" 1 } :: #03000000h TMENULST ; } +SIN COS TAN { "" } { { "Angles" 1 } :: #03000000h TMENULST ; } ASIN ACOS ATAN ATAN2 }