Path: blob/main/emulators/almostti/files/patch-ATI85_Unix_Unix.c
18157 views
--- ATI85/Unix/Unix.c.orig 2009-12-17 08:32:38 UTC1+++ ATI85/Unix/Unix.c2@@ -228,11 +228,19 @@ int ShowBackdrop(const char *FileName)3printf("error: %d\n", decoder.error);4return(0);5}6+#ifndef PORTRAIT7if (decoder.infoPng.width != WIDTH) {8+#else9+ if (decoder.infoPng.height != WIDTH) {10+#endif11printf("error: skin width != %d\n", WIDTH);12return(0);13}14+#ifndef PORTRAIT15if (decoder.infoPng.height != HEIGHT) {16+#else17+ if (decoder.infoPng.width != HEIGHT) {18+#endif19printf("error: skin height != %d\n", HEIGHT);20return(0);21}22@@ -242,10 +250,20 @@ int ShowBackdrop(const char *FileName)23pixel *P = (pixel *)OutImage.Data;24unsigned char *Q = image;2526+#ifndef PORTRAIT27for (j = HEIGHT * WIDTH; j; j--) {28*P++ = X11GetColor(*Q++,*Q++,*Q++);29Q++;30}31+#else32+ uint k;33+ for (k = 0; k < HEIGHT; k++) {34+ for (j = WIDTH; j > 0; j--) {35+ Q = image + (j * HEIGHT + k) * 4;36+ *P++ = X11GetColor(*Q++,*Q++,*Q++);37+ }38+ }39+#endif4041// Cleanup decoder42free(image);43@@ -291,11 +309,25 @@ void HandleKeys(unsigned int Key)44case XK_Up: KBD_RES(KBD_UP);KeyReady=1;break;45case XK_Down: KBD_RES(KBD_DOWN);KeyReady=1;break;46case XK_greater: KBD_RES(KBD_STO);KeyReady=1;break;47- case XK_Delete:48- case XK_BackSpace: KBD_RES(KBD_DEL);KeyReady=1;break;49- case XK_Home: KBD_RES(KBD_CLEAR);KeyReady=1;break;50+ case XK_Delete: KBD_RES(KBD_DEL);KeyReady=1;break;51+ case XK_BackSpace: KBD_RES(KBD_CLEAR);KeyReady=1;break;52case XK_Alt_L:53case XK_Alt_R: KBD_RES(KBD_ALPHA);KeyReady=1;break;54+ case XK_KP_Home: KBD_RES(KBD_7);KeyReady=1;break;55+ case XK_KP_Up: KBD_RES(KBD_8);KeyReady=1;break;56+ case XK_KP_Page_Up: KBD_RES(KBD_9);KeyReady=1;break;57+ case XK_KP_Left: KBD_RES(KBD_4);KeyReady=1;break;58+ case XK_KP_Begin: KBD_RES(KBD_5);KeyReady=1;break;59+ case XK_KP_Right: KBD_RES(KBD_6);KeyReady=1;break;60+ case XK_KP_End: KBD_RES(KBD_1);KeyReady=1;break;61+ case XK_KP_Down: KBD_RES(KBD_2);KeyReady=1;break;62+ case XK_KP_Page_Down: KBD_RES(KBD_3);KeyReady=1;break;63+ case XK_KP_Insert: KBD_RES(KBD_0);KeyReady=1;break;64+ case XK_KP_Delete: KBD_RES(KBD_DOT);KeyReady=1;break;65+ case XK_KP_Divide: KBD_RES(KBD_DIV);KeyReady=1;break;66+ case XK_KP_Multiply: KBD_RES(KBD_MUL);KeyReady=1;break;67+ case XK_KP_Subtract: KBD_RES(KBD_MINUS);KeyReady=1;break;68+ case XK_KP_Add: KBD_RES(KBD_PLUS);KeyReady=1;break;69default:70Key&=CON_KEYCODE;71if((Key>=' ')&&(Key<0x80)) { KBD_RES(Key);KeyReady=1; }72@@ -343,11 +375,25 @@ void HandleKeys(unsigned int Key)73case XK_Up: KBD_SET(KBD_UP);KeyReady=1;break;74case XK_Down: KBD_SET(KBD_DOWN);KeyReady=1;break;75case XK_greater: KBD_SET(KBD_STO);KeyReady=1;break;76- case XK_Delete:77- case XK_BackSpace: KBD_SET(KBD_DEL);KeyReady=1;break;78- case XK_Home: KBD_SET(KBD_CLEAR);KeyReady=1;break;79+ case XK_Delete: KBD_SET(KBD_DEL);KeyReady=1;break;80+ case XK_BackSpace: KBD_SET(KBD_CLEAR);KeyReady=1;break;81case XK_Alt_L:82case XK_Alt_R: KBD_SET(KBD_ALPHA);KeyReady=1;break;83+ case XK_KP_Home: KBD_SET(KBD_7);KeyReady=1;break;84+ case XK_KP_Up: KBD_SET(KBD_8);KeyReady=1;break;85+ case XK_KP_Page_Up: KBD_SET(KBD_9);KeyReady=1;break;86+ case XK_KP_Left: KBD_SET(KBD_4);KeyReady=1;break;87+ case XK_KP_Begin: KBD_SET(KBD_5);KeyReady=1;break;88+ case XK_KP_Right: KBD_SET(KBD_6);KeyReady=1;break;89+ case XK_KP_End: KBD_SET(KBD_1);KeyReady=1;break;90+ case XK_KP_Down: KBD_SET(KBD_2);KeyReady=1;break;91+ case XK_KP_Page_Down: KBD_SET(KBD_3);KeyReady=1;break;92+ case XK_KP_Insert: KBD_SET(KBD_0);KeyReady=1;break;93+ case XK_KP_Delete: KBD_SET(KBD_DOT);KeyReady=1;break;94+ case XK_KP_Divide: KBD_SET(KBD_DIV);KeyReady=1;break;95+ case XK_KP_Multiply: KBD_SET(KBD_MUL);KeyReady=1;break;96+ case XK_KP_Subtract: KBD_SET(KBD_MINUS);KeyReady=1;break;97+ case XK_KP_Add: KBD_SET(KBD_PLUS);KeyReady=1;break;98default:99Key&=CON_KEYCODE;100if((Key>=' ')&&(Key<0x80)) { KBD_SET(Key);KeyReady=1; }101102103