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