Posted By
 Harry Potter on 2025-03-22 19:18:07
| Help needed w/ TmpCreatP4
Hi! I have a program for several systems called Template Creator. It is a utility to create, handle, organize and use template files. I have DOS, Windows and C64 and 128 versions at https://sourceforge.net/projects/tmpcreat/files/. I'm trying to port it to the Plus4 but am getting garbage on the main menu when I go up from the top choice. Following is the code that handles displaying the menu:
------------------------- /* Display pull-down menu with options in menuitems[] at (xloc, yloc) in * specified len. and get # selection from user. * xlen and ylen are assumed to be correct. * This routine doesn't clear the screen. */ unsigned char __fastcall__ pulldown (char** menuitems, unsigned char xloc, unsigned char yloc, unsigned char xlen, unsigned char ylen) { //unsigned char i; //fldzp.ptrchr[0]=yloc; /* Top of menu. */ //fldzp.ptrchr[1]=ylen;//yloc-1; /* # options in menu. */ //leftwindow=xloc; //X-offset to menu text location. //widwindow=xlen; //Width of menu entries. fldzp.sx=0; /* Draw the border around the menu. */ //drawborder (xloc,yloc,xlen,ylen); /* Write menu options. xlen and ylen are assumed to be correct. */ while (1) { //Set to unselected color. //WBck(); reversoff(); textcol=menucolor; for (fldzp.i=0; fldzp.i { /* Write menu option. */ //Function clears the text on screen then fills it with //with the text given in Parameter #4. //DrawField (leftwindow, fldzp.i+fldzp.ptrchr[0], widwindow, menuitems[fldzp.i]); gotoxy(leftwindow, fldzp.i+fldzp.ptrchr[0]); prints (menuitems[fldzp.i]); //getkey(); } //Hilight and print current entry. //WHi(); textcol=menuhicolor; reverson(); //revers(1); //DispMenuOp (s+top, menuitems[s]); //DrawField (leftwindow, fldzp.sx+fldzp.ptrchr[0], widwindow, menuitems[fldzp.sx]); gotoxy(xloc, fldzp.sx+yloc); prints (menuitems[fldzp.sx]); //} //Get key press. switch (getkey()) { case CH_CURS_UP: //If up, decrease current item # w/ wrap-around. --fldzp.sx; if ((signed char)fldzp.sx<0) fldzp.sx+=ylen; break; case CH_CURS_DOWN: //If down, increase. // fldzp.sx=(++fldzp.sx)%fldzp.ptrchr[1]; ++fldzp.sx; if (fldzp.sx>=ylen) fldzp.sx=0; break; case CH_ENTER: //If Enter, return item #. return fldzp.sx; case CH_ESC: #ifdef CH_STOP case CH_STOP: #endif //If cancel, return -1 for cancel. reversoff(); return -1; } //This function will *not* clean up the screen upon exit. } } ------------------ Any help would be appreciated. |