Improved the Hold status display considerably.

This commit is contained in:
ugetab 2010-05-16 04:50:56 +00:00
parent 046617c693
commit e277aa9e24
3 changed files with 17 additions and 9 deletions

View File

@ -136,7 +136,7 @@ void DrawMessage(bool beforeMovie)
uint8 *t;
guiMessage.howlong--;
if (guiMessage.linesFromBottom)
if (guiMessage.linesFromBottom > 0)
t=XBuf+FCEU_TextScanlineOffsetFromBottom(guiMessage.linesFromBottom)+1;
else
t=XBuf+FCEU_TextScanlineOffsetFromBottom(20)+1;

View File

@ -295,10 +295,11 @@ void UpdateGamepad()
}
}
char inputstr [45];
char inputstr [41];
int disppos=38;
{
uint32 c = JSAutoHeld;
sprintf(inputstr, "1%c%c%c%c%c%c%c%c 2%c%c%c%c%c%c%c%c\n 3%c%c%c%c%c%c%c%c 4%c%c%c%c%c%c%c%c",
sprintf(inputstr, "1%c%c%c%c%c%c%c%c 2%c%c%c%c%c%c%c%c\n3%c%c%c%c%c%c%c%c 4%c%c%c%c%c%c%c%c",
(c&0x40)?'<':' ', (c&0x10)?'^':' ', (c&0x80)?'>':' ', (c&0x20)?'v':' ',
(c&0x01)?'A':' ', (c&0x02)?'B':' ', (c&0x08)?'S':' ', (c&0x04)?'s':' ',
(c&0x4000)?'<':' ', (c&0x1000)?'^':' ', (c&0x8000)?'>':' ', (c&0x2000)?'v':' ',
@ -307,14 +308,19 @@ void UpdateGamepad()
(c&0x010000)?'A':' ', (c&0x020000)?'B':' ', (c&0x080000)?'S':' ', (c&0x040000)?'s':' ',
(c&0x40000000)?'<':' ', (c&0x10000000)?'^':' ', (c&0x80000000)?'>':' ', (c&0x20000000)?'v':' ',
(c&0x01000000)?'A':' ', (c&0x02000000)?'B':' ', (c&0x08000000)?'S':' ', (c&0x04000000)?'s':' ');
if(!(c&0xffffff00))
if(!(c&0xffffff00)) {
inputstr[9] = '\0';
if(!(c&0xffff0000))
disppos = 30;
}
else if(!(c&0xffff0000)) {
inputstr[19] = '\0';
if(!(c&0xff000000))
disppos = 30;
}
else if(!(c&0xff000000)) {
inputstr[30] = '\0';
}
}
FCEU_DispMessage("Held: %s", 40, inputstr);
FCEU_DispMessage("Held:\n%s", disppos, inputstr);
}
else
{
@ -324,7 +330,7 @@ void UpdateGamepad()
if(autoHoldReset)
{
FCEU_DispMessage("Held: ",0);
FCEU_DispMessage("Held: ",30);
JSAutoHeld = 0;
JSAutoHeldAffected = 0;
autoHoldRefire = 0;

View File

@ -275,6 +275,9 @@ void FCEU_PutImage(void)
t[i+j*256] = 0xCF;
c = cur_input_display >> (controller * 8);
// Do this before shifting away data
held &= 255;
// This doesn't work in anything except windows for now.
// It doesn't get set anywhere in other ports.
#ifdef WIN32
@ -291,7 +294,6 @@ void FCEU_PutImage(void)
c &= 255;
ci &= 255;
held &= 255;
//adelikat: I apologize to anyone who ever sifts through this color assignment
//A