diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2006-04-03 17:11:42 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2006-04-03 17:11:42 +0000 |
commit | 6e3371110e6606b38b79ea96d73c487c00659e27 (patch) | |
tree | 2a66448e3f19cef468988518f37981244e704a77 /apps/plugins/doom | |
parent | 9f4898a3f2f67c8b3323c8a1829f74087ac22eb9 (diff) | |
download | rockbox-6e3371110e6606b38b79ea96d73c487c00659e27.tar.gz rockbox-6e3371110e6606b38b79ea96d73c487c00659e27.zip |
Finishing touches
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9460 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom')
-rw-r--r-- | apps/plugins/doom/i_system.c | 8 | ||||
-rw-r--r-- | apps/plugins/doom/i_video.c | 21 | ||||
-rw-r--r-- | apps/plugins/doom/rockdoom.c | 8 | ||||
-rw-r--r-- | apps/plugins/doom/rockmacros.h | 1 |
4 files changed, 28 insertions, 10 deletions
diff --git a/apps/plugins/doom/i_system.c b/apps/plugins/doom/i_system.c index d21777361b..ffed416109 100644 --- a/apps/plugins/doom/i_system.c +++ b/apps/plugins/doom/i_system.c | |||
@@ -16,7 +16,10 @@ | |||
16 | // GNU General Public License for more details. | 16 | // GNU General Public License for more details. |
17 | // | 17 | // |
18 | // $Log$ | 18 | // $Log$ |
19 | // Revision 1.4 2006/04/03 17:00:56 dave | 19 | // Revision 1.5 2006/04/03 17:11:42 kkurbjun |
20 | // Finishing touches | ||
21 | // | ||
22 | // Revision 1.4 2006-04-03 17:00:56 dave | ||
20 | // Doom can't use the user timer at the same time as using the grayscale lib. | 23 | // Doom can't use the user timer at the same time as using the grayscale lib. |
21 | // | 24 | // |
22 | // Revision 1.3 2006-04-02 12:45:29 amiconn | 25 | // Revision 1.3 2006-04-02 12:45:29 amiconn |
@@ -134,9 +137,6 @@ void I_Error (char *error, ...) | |||
134 | // Shutdown. Here might be other errors. | 137 | // Shutdown. Here might be other errors. |
135 | if (demorecording) | 138 | if (demorecording) |
136 | G_CheckDemoStatus(); | 139 | G_CheckDemoStatus(); |
137 | /* | ||
138 | I_ShutdownGraphics(); | ||
139 | */ | ||
140 | 140 | ||
141 | I_Quit(); | 141 | I_Quit(); |
142 | rb->sleep(HZ*2); | 142 | rb->sleep(HZ*2); |
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 61cd3f3fe2..473f349b0c 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c | |||
@@ -16,7 +16,10 @@ | |||
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
17 | * | 17 | * |
18 | * $Log$ | 18 | * $Log$ |
19 | * Revision 1.7 2006/04/03 16:30:12 kkurbjun | 19 | * Revision 1.8 2006/04/03 17:11:42 kkurbjun |
20 | * Finishing touches | ||
21 | * | ||
22 | * Revision 1.7 2006-04-03 16:30:12 kkurbjun | ||
20 | * Fix #if | 23 | * Fix #if |
21 | * | 24 | * |
22 | * Revision 1.5 2006-04-03 08:51:08 bger | 25 | * Revision 1.5 2006-04-03 08:51:08 bger |
@@ -27,7 +30,11 @@ | |||
27 | * Properly ifdef H300 video code, fix commented line handling rockbox volume | 30 | * Properly ifdef H300 video code, fix commented line handling rockbox volume |
28 | * | 31 | * |
29 | * Revision 1.3 2006-04-02 01:52:44 kkurbjun | 32 | * Revision 1.3 2006-04-02 01:52:44 kkurbjun |
30 | * Update adds prboom's high resolution support, also makes the scaling for platforms w/ resolution less then 320x200 much nicer. IDoom's lookup table code has been removed. Also fixed a pallete bug. Some graphic errors are present in menu and status bar. Also updates some headers and output formatting. | 33 | * Update adds prboom's high resolution support, also makes the scaling for |
34 | * platforms w/ resolution less then 320x200 much nicer. IDoom's lookup table | ||
35 | * code has been removed. Also fixed a pallete bug. Some graphic errors are | ||
36 | * present in menu and status bar. Also updates some headers and output | ||
37 | * formatting. | ||
31 | * | 38 | * |
32 | * Revision 1.2 2006-03-28 17:20:49 christian | 39 | * Revision 1.2 2006-03-28 17:20:49 christian |
33 | * added good (tm) button mappings for x5, and added ifdef for HAS_BUTTON_HOLD | 40 | * added good (tm) button mappings for x5, and added ifdef for HAS_BUTTON_HOLD |
@@ -38,6 +45,7 @@ | |||
38 | * | 45 | * |
39 | * DESCRIPTION: | 46 | * DESCRIPTION: |
40 | * DOOM graphics and buttons. H300 Port by Karl Kurbjun | 47 | * DOOM graphics and buttons. H300 Port by Karl Kurbjun |
48 | * H100 Port by Dave Chapman, Karl Kurbjun and Jens Arnold | ||
41 | * IPOD port by Dave Chapman and Paul Louden | 49 | * IPOD port by Dave Chapman and Paul Louden |
42 | * Additional work by Thom Johansen | 50 | * Additional work by Thom Johansen |
43 | * | 51 | * |
@@ -56,7 +64,7 @@ | |||
56 | 64 | ||
57 | #ifndef HAVE_LCD_COLOR | 65 | #ifndef HAVE_LCD_COLOR |
58 | #include "../lib/gray.h" | 66 | #include "../lib/gray.h" |
59 | static fb_data graybuffer[LCD_HEIGHT*LCD_WIDTH]; /* off screen buffer */ | 67 | static unsigned char graybuffer[LCD_HEIGHT*LCD_WIDTH]; /* off screen buffer */ |
60 | static unsigned char *gbuf; | 68 | static unsigned char *gbuf; |
61 | static unsigned int gbuf_size = 0; | 69 | static unsigned int gbuf_size = 0; |
62 | #endif | 70 | #endif |
@@ -72,6 +80,9 @@ static fb_data *paldata=NULL; | |||
72 | // | 80 | // |
73 | void I_ShutdownGraphics(void) | 81 | void I_ShutdownGraphics(void) |
74 | { | 82 | { |
83 | #ifndef HAVE_LCD_COLOR | ||
84 | gray_release(); | ||
85 | #endif | ||
75 | } | 86 | } |
76 | 87 | ||
77 | // | 88 | // |
@@ -313,7 +324,7 @@ static void I_UploadNewPalette(int pal) | |||
313 | int b = gtable[pall[2]]; | 324 | int b = gtable[pall[2]]; |
314 | pall+=3; | 325 | pall+=3; |
315 | #ifndef HAVE_LCD_COLOR | 326 | #ifndef HAVE_LCD_COLOR |
316 | paldata[i]=(r+g+b)/3; | 327 | paldata[i]=(3*r+6*g+b)/10; |
317 | #else | 328 | #else |
318 | paldata[i] = LCD_RGBPACK(r,g,b); | 329 | paldata[i] = LCD_RGBPACK(r,g,b); |
319 | #endif | 330 | #endif |
@@ -422,6 +433,8 @@ void I_InitGraphics(void) | |||
422 | 433 | ||
423 | printf("Starting Graphics engine\n"); | 434 | printf("Starting Graphics engine\n"); |
424 | 435 | ||
436 | noprintf=1; | ||
437 | |||
425 | /* Note: The other screens are allocated as needed */ | 438 | /* Note: The other screens are allocated as needed */ |
426 | 439 | ||
427 | #ifndef HAVE_LCD_COLOR | 440 | #ifndef HAVE_LCD_COLOR |
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index 1810acdff5..bc433e7f1d 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c | |||
@@ -105,6 +105,8 @@ int my_close(int id) | |||
105 | struct plugin_api* rb; | 105 | struct plugin_api* rb; |
106 | #define MAXARGVS 100 | 106 | #define MAXARGVS 100 |
107 | 107 | ||
108 | bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates | ||
109 | |||
108 | // Here is a hacked up printf command to get the output from the game. | 110 | // Here is a hacked up printf command to get the output from the game. |
109 | int printf(const char *fmt, ...) | 111 | int printf(const char *fmt, ...) |
110 | { | 112 | { |
@@ -118,13 +120,15 @@ int printf(const char *fmt, ...) | |||
118 | va_end(ap); | 120 | va_end(ap); |
119 | 121 | ||
120 | rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); | 122 | rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); |
121 | rb->lcd_update(); | 123 | if (!noprintf) |
124 | rb->lcd_update(); | ||
122 | 125 | ||
123 | p_xtpt+=8; | 126 | p_xtpt+=8; |
124 | if(p_xtpt>LCD_HEIGHT-8) | 127 | if(p_xtpt>LCD_HEIGHT-8) |
125 | { | 128 | { |
126 | p_xtpt=0; | 129 | p_xtpt=0; |
127 | rb->lcd_clear_display(); | 130 | if (!noprintf) |
131 | rb->lcd_clear_display(); | ||
128 | } | 132 | } |
129 | return 1; | 133 | return 1; |
130 | } | 134 | } |
diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h index e428331de8..8f028d4893 100644 --- a/apps/plugins/doom/rockmacros.h +++ b/apps/plugins/doom/rockmacros.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "z_zone.h" | 25 | #include "z_zone.h" |
26 | 26 | ||
27 | extern struct plugin_api* rb; | 27 | extern struct plugin_api* rb; |
28 | extern bool noprintf; | ||
28 | 29 | ||
29 | /* libc functions */ | 30 | /* libc functions */ |
30 | int printf(const char *fmt, ...); | 31 | int printf(const char *fmt, ...); |