DOH! Chars are unsigned on the IIgs! IIgs menus fixed!

This commit is contained in:
Scott Duensing 2020-08-10 19:48:27 -05:00
parent 14866e93ee
commit fb9b6b41bf

View file

@ -146,7 +146,7 @@ void gameSave(void);
void imageShow(jlImgT *image); void imageShow(jlImgT *image);
bool inputRead(byte *key); bool inputRead(byte *key);
byte menuDraw(const char *titleShow, const char *menuItems[], byte *height, byte *offsetX, byte *offsetY); byte menuDraw(const char *titleShow, const char *menuItems[], byte *height, byte *offsetX, byte *offsetY);
char menuHandle(const char *titleShow, const char *menuItems[], char selected); jint16 menuHandle(const char *titleShow, const char *menuItems[], jint16 selected);
bool menuMain(void); bool menuMain(void);
//void paletteShow(void); //void paletteShow(void);
void puzzleComplete(void); void puzzleComplete(void);
@ -413,9 +413,6 @@ byte menuDraw(const char *title, const char *menuItems[], byte *height, byte *of
jint16 y3; jint16 y3;
byte width = 0; byte width = 0;
// 222 223 221
// 222 220 221
// Calculate height, width, and offsets from menu count. // Calculate height, width, and offsets from menu count.
while (menuItems[count]) { while (menuItems[count]) {
if (width < strlen(menuItems[count]) + 6) width = strlen(menuItems[count]) + 6; if (width < strlen(menuItems[count]) + 6) width = strlen(menuItems[count]) + 6;
@ -464,7 +461,7 @@ byte menuDraw(const char *title, const char *menuItems[], byte *height, byte *of
} }
char menuHandle(const char *title, const char *menuItems[], char selected) { jint16 menuHandle(const char *title, const char *menuItems[], jint16 selected) {
byte count = 0; byte count = 0;
byte inMenuYOffset = 7; byte inMenuYOffset = 7;
byte offsetX = 0; byte offsetX = 0;
@ -473,8 +470,8 @@ char menuHandle(const char *title, const char *menuItems[], char selected) {
byte height; byte height;
byte ox; byte ox;
byte oy; byte oy;
char result = -1;
bool inMenu = true; bool inMenu = true;
jint16 result = -1;
jint16 xpos; jint16 xpos;
jint16 ypos; jint16 ypos;
jint16 last; jint16 last;
@ -546,7 +543,7 @@ char menuHandle(const char *title, const char *menuItems[], char selected) {
bool menuMain(void) { bool menuMain(void) {
bool running = true; bool running = true;
char choice = 0; jint16 choice = 0;
while ((choice >= 0) && running && !jlUtilMustExit()) { while ((choice >= 0) && running && !jlUtilMustExit()) {
choice = menuHandle("Main Menu", menuOptions, choice); choice = menuHandle("Main Menu", menuOptions, choice);