コミットメタ情報

リビジョン71a4c5463862b1ae5af541b78c4ad5d16d6ab6e6 (tree)
日時2014-03-17 18:12:47
作者hikarupsp <hikarupsp@user...>
コミッターhikarupsp

ログメッセージ

MacOSXで表示画面が更新されない不具合を修正

変更サマリ

差分

--- a/dpndenv.c
+++ b/dpndenv.c
@@ -47,11 +47,20 @@ NSApplication* app;
4747 CGImageRef image = CGBitmapContextCreateImage(_context);
4848 CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
4949 CGContextDrawImage(currentContext, NSRectToCGRect(rect), image);
50-
5150 CFRelease(colorSpace);
5251 CFRelease(image);
5352 }
5453
54+- (void)keyDown:(NSEvent *)theEvent
55+{
56+
57+}
58+
59+- (void)keyUp:(NSEvent *)theEvent
60+{
61+
62+}
63+
5564 @end
5665
5766 @interface Main : NSObject<NSWindowDelegate>
@@ -111,7 +120,7 @@ NSApplication* app;
111120
112121 - (void)flushWin : (NSRect)rect
113122 {
114- [_view drawRect:rect];
123+ [_view setNeedsDisplayInRect:rect];
115124 }
116125
117126 @end
--- a/usetek.c
+++ b/usetek.c
@@ -1,88 +1,88 @@
1-
2-#include "osecpu.h"
3-#if (USE_TEK5 != 0)
4-/*----For using tek Begin----*/
5-#include "tek.h"
6-
7-int appackSub2(const UCHAR **pp, char *pif)
8-{
9- int r = 0;
10- const UCHAR *p = *pp;
11- if (*pif == 0) {
12- r = *p >> 4;
13- } else {
14- r = *p & 0x0f;
15- p++;
16- *pp = p;
17- }
18- *pif ^= 1;
19-
20- return r;
21-}
22-
23-int appackSub3u(const UCHAR **pp, char *pif)
24-{
25- int r = 0, i;
26-
27- r = appackSub2(pp, pif);
28- if (0x8 <= r && r <= 0xb) {
29- r = r << 4 | appackSub2(pp, pif);
30- r &= 0x3f;
31- } else if (0xc <= r && r <= 0xd) {
32- r = r << 4 | appackSub2(pp, pif);
33- r = r << 4 | appackSub2(pp, pif);
34- r &= 0x1ff;
35- } else if (r == 0xe) {
36- r = appackSub2(pp, pif);
37- r = r << 4 | appackSub2(pp, pif);
38- r = r << 4 | appackSub2(pp, pif);
39- } else if (r == 0x7) {
40- i = appackSub3u(pp, pif);
41- r = 0;
42- while (i > 0) {
43- r = r << 4 | appackSub2(pp, pif);
44- i--;
45- }
46- }
47-
48- return r;
49-}
50-
51-int tek5Decomp(UCHAR *buf, UCHAR *buf1, UCHAR *tmp)
52-{
53- static char tek5head[16] = {
54- 0x89, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
55- 0x4f, 0x53, 0x41, 0x53, 0x4b, 0x43, 0x4d, 0x50
56- };
57- memcpy(tmp, tek5head, 16);
58- UCHAR *q = tmp + 16;
59- char iif = 0;
60- int i, tmpsiz;
61- const UCHAR *p = &buf[1];
62- i = appackSub3u(&p, &iif);
63- tmpsiz = appackSub3u(&p, &iif);
64- tmpsiz = tmpsiz << 8 | *p++;
65- *q++ = (tmpsiz >> 27) & 0xfe;
66- *q++ = (tmpsiz >> 20) & 0xfe;
67- *q++ = (tmpsiz >> 13) & 0xfe;
68- *q++ = (tmpsiz >> 6) & 0xfe;
69- *q++ = (tmpsiz << 1 | 1) & 0xff;
70- if (i == 1) *q++ = 0x15;
71- if (i == 2) *q++ = 0x19;
72- if (i == 3) *q++ = 0x21;
73- if (i >= 4) return -9;
74- while (p < buf1){
75- *q++ = *p++;
76- }
77- if(tek_decomp(tmp, buf, tmpsiz) != 0){;
78- // failed
79- fputs("tek decomp error.\n", stderr);
80- exit(1);
81- }
82- //success
83- return tmpsiz;
84-}
85-
86-/*----For using tek End----*/
87-#endif
88-
1+
2+#include "osecpu.h"
3+#if (USE_TEK5 != 0)
4+/*----For using tek Begin----*/
5+#include "tek.h"
6+
7+int appackSub2(const UCHAR **pp, char *pif)
8+{
9+ int r = 0;
10+ const UCHAR *p = *pp;
11+ if (*pif == 0) {
12+ r = *p >> 4;
13+ } else {
14+ r = *p & 0x0f;
15+ p++;
16+ *pp = p;
17+ }
18+ *pif ^= 1;
19+
20+ return r;
21+}
22+
23+int appackSub3u(const UCHAR **pp, char *pif)
24+{
25+ int r = 0, i;
26+
27+ r = appackSub2(pp, pif);
28+ if (0x8 <= r && r <= 0xb) {
29+ r = r << 4 | appackSub2(pp, pif);
30+ r &= 0x3f;
31+ } else if (0xc <= r && r <= 0xd) {
32+ r = r << 4 | appackSub2(pp, pif);
33+ r = r << 4 | appackSub2(pp, pif);
34+ r &= 0x1ff;
35+ } else if (r == 0xe) {
36+ r = appackSub2(pp, pif);
37+ r = r << 4 | appackSub2(pp, pif);
38+ r = r << 4 | appackSub2(pp, pif);
39+ } else if (r == 0x7) {
40+ i = appackSub3u(pp, pif);
41+ r = 0;
42+ while (i > 0) {
43+ r = r << 4 | appackSub2(pp, pif);
44+ i--;
45+ }
46+ }
47+
48+ return r;
49+}
50+
51+int tek5Decomp(UCHAR *buf, UCHAR *buf1, UCHAR *tmp)
52+{
53+ static char tek5head[16] = {
54+ 0x89, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
55+ 0x4f, 0x53, 0x41, 0x53, 0x4b, 0x43, 0x4d, 0x50
56+ };
57+ memcpy(tmp, tek5head, 16);
58+ UCHAR *q = tmp + 16;
59+ char iif = 0;
60+ int i, tmpsiz;
61+ const UCHAR *p = &buf[1];
62+ i = appackSub3u(&p, &iif);
63+ tmpsiz = appackSub3u(&p, &iif);
64+ tmpsiz = tmpsiz << 8 | *p++;
65+ *q++ = (tmpsiz >> 27) & 0xfe;
66+ *q++ = (tmpsiz >> 20) & 0xfe;
67+ *q++ = (tmpsiz >> 13) & 0xfe;
68+ *q++ = (tmpsiz >> 6) & 0xfe;
69+ *q++ = (tmpsiz << 1 | 1) & 0xff;
70+ if (i == 1) *q++ = 0x15;
71+ if (i == 2) *q++ = 0x19;
72+ if (i == 3) *q++ = 0x21;
73+ if (i >= 4) return -9;
74+ while (p < buf1){
75+ *q++ = *p++;
76+ }
77+ if(tek_decomp(tmp, buf, tmpsiz) != 0){;
78+ // failed
79+ fputs("tek decomp error.\n", stderr);
80+ exit(1);
81+ }
82+ //success
83+ return tmpsiz;
84+}
85+
86+/*----For using tek End----*/
87+#endif
88+
旧リポジトリブラウザで表示