diff options
Diffstat (limited to 'apps/plugins/doom/i_video.c')
-rw-r--r-- | apps/plugins/doom/i_video.c | 81 |
1 files changed, 38 insertions, 43 deletions
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 0e9d20f8cf..0ddede09fa 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.25 2006/10/26 13:38:04 barrywardell | 19 | * Revision 1.26 2006/12/13 04:44:17 kkurbjun |
20 | * Dehacked and BEX support for Doom - currently only supports a DEHACKED file in a WAD (not as a standalone file yet). | ||
21 | * | ||
22 | * Revision 1.25 2006-10-26 13:38:04 barrywardell | ||
20 | * Allow the Sansa e200 UI simulator to be built. Thanks to Andre Smith for the nice image of the Sansa. Lots more to be done including testing and tweaking the keymaps and modifying the plugins for the Sansa's 176x220 LCD. | 23 | * Allow the Sansa e200 UI simulator to be built. Thanks to Andre Smith for the nice image of the Sansa. Lots more to be done including testing and tweaking the keymaps and modifying the plugins for the Sansa's 176x220 LCD. |
21 | * | 24 | * |
22 | * Revision 1.24 2006-09-05 00:23:06 barrywardell | 25 | * Revision 1.24 2006-09-05 00:23:06 barrywardell |
@@ -418,45 +421,45 @@ void I_FinishUpdate (void) | |||
418 | #if (CONFIG_LCD == LCD_H300) && !defined(SIMULATOR) | 421 | #if (CONFIG_LCD == LCD_H300) && !defined(SIMULATOR) |
419 | 422 | ||
420 | #if 1 | 423 | #if 1 |
421 | /* ASM screen update (drops 600 tics (100 asm)) */ | 424 | /* ASM screen update (drops 200 tics (100 asm)) */ |
422 | asm ( | 425 | asm ( |
423 | "move.w #33,(%[LCD]) \n" /* Setup the LCD controller */ | 426 | "move.w #33,(%[LCD]) \n" /* Setup the LCD controller */ |
424 | "clr.w (%[LCD2]) \n" | 427 | "clr.w (%[LCD2]) \n" |
425 | "move.w #34,(%[LCD]) \n" /* End LCD controller setup */ | 428 | "move.w #34,(%[LCD]) \n" /* End LCD controller setup */ |
426 | "move.l #220,%%d0 \n" | 429 | "clr.l %%d1 \n" |
427 | "move.l #176,%%d1 \n" | 430 | "clr.l %%d0 \n" |
428 | "clr.l %%d3 \n" | ||
429 | "clr.l %%d2 \n" | ||
430 | "widthloop: \n" | 431 | "widthloop: \n" |
431 | "move.l (%[screenptr])+, %%d2 \n" | 432 | "move.l (%[screenptr])+, %%d0 \n" |
432 | "swap.w %%d2 \n" | 433 | "swap.w %%d0 \n" |
433 | "move.w %%d2, %%d3 \n" | 434 | "move.w %%d0, %%d1 \n" |
434 | "lsr.l #8,%%d3 \n" | 435 | "lsr.l #8,%%d1 \n" |
435 | "move.w (%[palette], %%d3.l:2), (%[LCD2]) \n" | 436 | "move.w (%[palette], %%d1.l:2), (%[LCD2]) \n" |
436 | "move.b %%d2,%%d3 \n" | 437 | "move.b %%d0,%%d1 \n" |
437 | "move.w (%[palette], %%d3.l:2), (%[LCD2]) \n" | 438 | "move.w (%[palette], %%d1.l:2), (%[LCD2]) \n" |
438 | "swap.w %%d2 \n" | 439 | "swap.w %%d0 \n" |
439 | "move.w %%d2, %%d3 \n" | 440 | "move.w %%d0, %%d1 \n" |
440 | "lsr.l #8,%%d3 \n" | 441 | "lsr.l #8,%%d1 \n" |
441 | "move.w (%[palette], %%d3.l:2), (%[LCD2]) \n" | 442 | "move.w (%[palette], %%d1.l:2), (%[LCD2]) \n" |
442 | "move.b %%d2,%%d3 \n" | 443 | "move.b %%d0,%%d1 \n" |
443 | "move.w (%[palette], %%d3.l:2), (%[LCD2]) \n" | 444 | "move.w (%[palette], %%d1.l:2), (%[LCD2]) \n" |
444 | "subq.l #4,%%d0 \n" | 445 | "subq.l #4,%[WIDTH] \n" |
445 | "bne widthloop \n" | 446 | "bne widthloop \n" |
446 | "move.w #220,%%d0 \n" | 447 | "move.w #220,%[WIDTH] \n" |
447 | "subq.l #1,%%d1 \n" | 448 | "subq.l #1,%[HEIGHT] \n" |
448 | "bne widthloop \n" | 449 | "bne widthloop \n" |
449 | : /* outputs */ | 450 | : /* outputs */ |
450 | : /* inputs */ | 451 | : /* inputs */ |
451 | [screenptr] "a" (d_screens[0]), | 452 | [screenptr] "a" (d_screens[0]), |
452 | [palette] "a" (palette), | 453 | [palette] "a" (palette), |
453 | [LCD] "a" (0xf0000000), | 454 | [LCD] "a" (0xf0000000), |
454 | [LCD2] "a" (0xf0000002) | 455 | [LCD2] "a" (0xf0000002), |
456 | [WIDTH] "d" (220), | ||
457 | [HEIGHT] "d" (176) | ||
455 | : /* clobbers */ | 458 | : /* clobbers */ |
456 | "d0", "d1", "d2", "d3" | 459 | "d0", "d1" |
457 | ); | 460 | ); |
458 | #else | 461 | #else |
459 | /* C version of above (drops 500 tics) */ | 462 | /* C version of above (drops 100 tics) */ |
460 | 463 | ||
461 | // Start the write | 464 | // Start the write |
462 | *(volatile unsigned short *) 0xf0000000 = 0x21; // register | 465 | *(volatile unsigned short *) 0xf0000000 = 0x21; // register |
@@ -464,37 +467,29 @@ void I_FinishUpdate (void) | |||
464 | *(volatile unsigned short *) 0xf0000000 = 0x22; // GRAM | 467 | *(volatile unsigned short *) 0xf0000000 = 0x22; // GRAM |
465 | 468 | ||
466 | unsigned char *screenptr=d_screens[0]; | 469 | unsigned char *screenptr=d_screens[0]; |
467 | int wcnt=0, hcnt=0; | 470 | int hcnt=LCD_HEIGHT*LCD_WIDTH; |
468 | 471 | ||
469 | while(hcnt<LCD_HEIGHT) | 472 | while(hcnt--) |
470 | { | 473 | { |
471 | while(wcnt<LCD_WIDTH) | 474 | *(volatile unsigned short *)0xf0000002 = palette[*screenptr]; |
472 | { | 475 | screenptr++; |
473 | *(volatile unsigned short *)0xf0000002 = palette[*screenptr]; | ||
474 | screenptr++; | ||
475 | wcnt++; | ||
476 | } | ||
477 | wcnt=0; | ||
478 | hcnt++; | ||
479 | } | 476 | } |
480 | #endif | 477 | #endif |
481 | 478 | ||
482 | #else | 479 | #else |
483 | unsigned char paletteIndex; | 480 | unsigned char paletteIndex; |
484 | int x, y; | 481 | int y; |
485 | 482 | ||
486 | #ifdef HAVE_LCD_COLOR | 483 | #ifdef HAVE_LCD_COLOR |
487 | for (y = 0; y < LCD_HEIGHT; y++) | 484 | |
485 | for (y = 0; y < LCD_HEIGHT*LCD_WIDTH; y++) | ||
488 | { | 486 | { |
489 | for (x = 0; x < LCD_WIDTH; x++) | 487 | paletteIndex = d_screens[0][y]; |
490 | { | 488 | rb->lcd_framebuffer[y] = palette[paletteIndex]; |
491 | paletteIndex = d_screens[0][y*SCREENWIDTH + x]; | ||
492 | rb->lcd_framebuffer[y * LCD_WIDTH + x] = palette[paletteIndex]; | ||
493 | } | ||
494 | } | 489 | } |
495 | rb->lcd_update(); | 490 | rb->lcd_update(); |
496 | #else /* !HAVE_LCD_COLOR */ | 491 | #else /* !HAVE_LCD_COLOR */ |
497 | int yd = 0; | 492 | int x, yd = 0; |
498 | 493 | ||
499 | for (y = 0; y < LCD_HEIGHT; y++) | 494 | for (y = 0; y < LCD_HEIGHT; y++) |
500 | { | 495 | { |