Ticket #8922: scummvm-trunk-motoezx.patch
File scummvm-trunk-motoezx.patch, 7.6 KB (added by , 16 years ago) |
---|
-
backends/platform/sdl/events.cpp
diff -rNu trunk/backends/platform/sdl/events.cpp trunk-a1200/backends/platform/sdl/events.cpp
old new 187 187 return true; 188 188 } 189 189 190 while ( SDL_PollEvent(&ev)) {190 while (mySDL_PollEvent(&ev)) { 191 191 switch (ev.type) { 192 192 case SDL_KEYDOWN:{ 193 193 b = event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState()); … … 517 517 event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); 518 518 } 519 519 #endif 520 #ifdef MOTOEZX 521 // Quit on MOD+Camera Key on A1200 522 if (ev.key.keysym.sym == SDLK_e) { 523 event.type = Common::EVENT_QUIT; 524 return true; 525 } 526 // '1' Bypass security protection - MOD+Call key 527 if (ev.key.keysym.sym == SDLK_f) { 528 ev.key.keysym.sym=SDLK_1; 529 } 530 // F5 Game Menu - Call key 531 else if (ev.key.keysym.sym == SDLK_SPACE) { 532 ev.key.keysym.sym=SDLK_F5; 533 } 534 // '3' - Mod+Up key 535 else if (ev.key.keysym.sym == SDLK_j) { 536 ev.key.keysym.sym=SDLK_3; 537 } 538 // '6' - Mod+Down key 539 else if (ev.key.keysym.sym == SDLK_i) { 540 ev.key.keysym.sym=SDLK_6; 541 // 'y' - Mod+Right key 542 } 543 else if (ev.key.keysym.sym == SDLK_g) { 544 ev.key.keysym.sym=SDLK_y; 545 } 546 // 'n' - Mod+Left key 547 else if (ev.key.keysym.sym == SDLK_h) { 548 ev.key.keysym.sym=SDLK_n; 549 } 550 // A1200 Joystick to Mouse 551 else if( ev.key.keysym.sym == SDLK_LEFT ) { 552 if( ev.type == SDL_KEYDOWN ) { 553 _km.x_vel = -1; 554 _km.x_down_count = 1; 555 } 556 else { 557 _km.x_vel = 0; 558 _km.x_down_count = 0; 559 } 560 561 event.type = Common::EVENT_MOUSEMOVE; 562 fillMouseEvent(event, _km.x, _km.y); 563 return true; 564 } 565 else if( ev.key.keysym.sym == SDLK_RIGHT ) { 566 if( ev.type == SDL_KEYDOWN ) { 567 _km.x_vel = 1; 568 _km.x_down_count = 1; 569 } 570 else { 571 _km.x_vel = 0; 572 _km.x_down_count = 0; 573 } 574 575 event.type = Common::EVENT_MOUSEMOVE; 576 fillMouseEvent(event, _km.x, _km.y); 577 return true; 578 } 579 else if( ev.key.keysym.sym == SDLK_DOWN ) { 580 if( ev.type == SDL_KEYDOWN ) { 581 _km.y_vel = 1; 582 _km.y_down_count = 1; 583 } 584 else { 585 _km.y_vel = 0; 586 _km.y_down_count = 0; 587 } 588 589 event.type = Common::EVENT_MOUSEMOVE; 590 fillMouseEvent(event, _km.x, _km.y); 591 return true; 592 } 593 else if( ev.key.keysym.sym == SDLK_UP ) { 594 if( ev.type == SDL_KEYDOWN ) { 595 _km.y_vel = -1; 596 _km.y_down_count = 1; 597 } 598 else { 599 _km.y_vel = 0; 600 _km.y_down_count = 0; 601 } 602 603 event.type = Common::EVENT_MOUSEMOVE; 604 fillMouseEvent(event, _km.x, _km.y); 605 return true; 606 } 607 // Volume Up to pressing Right Mouse 608 else if ( ev.key.keysym.sym == SDLK_PLUS) { 609 _km.y_vel = 0; 610 _km.y_down_count = 0; 611 event.type = Common::EVENT_RBUTTONDOWN; 612 fillMouseEvent(event, _km.x, _km.y); 613 return true; 614 } 615 // Volume down to releasing right mouse 616 else if ( ev.key.keysym.sym == SDLK_MINUS) { 617 _km.y_vel = 0; 618 _km.y_down_count = 0; 619 event.type = Common::EVENT_RBUTTONUP; 620 fillMouseEvent(event, _km.x, _km.y); 621 return true; 622 } 623 // MOD+Volume UP to releasing Right Mouse 624 else if ( ev.key.keysym.sym == SDLK_c) { 625 _km.y_vel = 0; 626 _km.y_down_count = 0; 627 event.type = Common::EVENT_RBUTTONUP; 628 fillMouseEvent(event, _km.x, _km.y); 629 return true; 630 } 631 // Camera to releasing Left Mouse 632 else if ( ev.key.keysym.sym == SDLK_PAUSE) { 633 _km.y_vel = 0; 634 _km.y_down_count = 0; 635 event.type = Common::EVENT_LBUTTONUP; 636 fillMouseEvent(event, _km.x, _km.y); 637 return true; 638 } else { 639 // Let the events fall through if we didn't change them, this may not be the best way to 640 // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though. 641 // and yes i have an huge terminal size so i dont wrap soon enough. 642 event.type = Common::EVENT_KEYDOWN; 643 event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym; 644 event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode); 645 } 646 #endif 520 647 return false; 521 648 } 522 649 -
backends/platform/sdl/sdl.cpp
diff -rNu trunk/backends/platform/sdl/sdl.cpp trunk-a1200/backends/platform/sdl/sdl.cpp
old new 641 641 642 642 void OSystem_SDL::setupMixer() { 643 643 SDL_AudioSpec desired; 644 SDL_AudioSpec obtained;644 // SDL_AudioSpec obtained; 645 645 646 646 // Determine the desired output sampling frequency. 647 647 _samplesPerSec = 0; … … 804 804 _cdEndTime = SDL_GetTicks() + _cdrom->track[_cdTrack].length * 1000 / CD_FPS; 805 805 } 806 806 } 807 int OSystem_SDL::mySDL_PollEvent(SDL_Event *event) { 808 int r = SDL_PollEvent(event); 809 if (!r) 810 return 0; 811 if (event->type == SDL_ACTIVEEVENT){ 812 if (event->active.state == SDL_APPINPUTFOCUS && !event->active.gain){ 813 suspendAudio(); 814 for(;;){ 815 printf("wait\n"); 816 r = SDL_WaitEvent(event); 817 printf("wait done\n"); 818 if (!r) 819 continue; 820 if (event->type == SDL_QUIT) 821 return 1; 822 if (event->type != SDL_ACTIVEEVENT) 823 continue; 824 if (event->active.state == SDL_APPINPUTFOCUS && event->active.gain){ 825 resumeAudio(); 826 return 1; 827 } 828 } 829 } 830 } 831 return r; 832 } 833 834 void OSystem_SDL::suspendAudio() { 835 // if (audioSuspended) return; 836 SDL_CloseAudio(); 837 audioSuspended = true; 838 } 839 840 int OSystem_SDL::resumeAudio() { 841 if (!audioSuspended) 842 return -2; 843 if (SDL_OpenAudio(&obtained, NULL) < 0){ 844 printf("audio resumed\n"); 845 return -1; 846 } 847 SDL_PauseAudio(0); 848 audioSuspended = false; 849 return 0; 850 } 851 No newline at end of file -
backends/platform/sdl/sdl.h
diff -rNu trunk/backends/platform/sdl/sdl.h trunk-a1200/backends/platform/sdl/sdl.h
old new 78 78 79 79 80 80 class OSystem_SDL : public OSystem { 81 private: 82 SDL_AudioSpec obtained; 83 bool audioSuspended; 81 84 public: 82 85 OSystem_SDL(); 83 86 virtual ~OSystem_SDL(); … … 445 448 virtual bool remapKey(SDL_Event &ev, Common::Event &event); 446 449 447 450 void handleScalerHotkeys(const SDL_KeyboardEvent &key); 451 452 int mySDL_PollEvent(SDL_Event *event); 453 void suspendAudio(); 454 int resumeAudio(); 448 455 }; 449 456 450 457 #endif -
configure
diff -rNu trunk/configure trunk-a1200/configure
old new 583 583 584 584 Configuration: 585 585 -h, --help display this help and exit 586 --backend=BACKEND backend to build (sdl, x11, morphos, dc, gp2x, iphone, null) [sdl]586 --backend=BACKEND backend to build (sdl, x11, morphos, dc, gp2x, iphone, motoezx, null) [sdl] 587 587 588 588 Installation directories: 589 589 --prefix=DIR use this prefix for installing ScummVM [/usr/local] … … 811 811 _host_os=iphone 812 812 _host_cpu=arm 813 813 ;; 814 motoezx) 815 _host_os=linux 816 _host_cpu=arm 817 ;; 814 818 neuros) 815 819 _host_os=linux 816 820 _host_cpu=arm … … 1708 1712 DEFINES="$DEFINES -DSDL_BACKEND" 1709 1713 MODULES="$MODULES backends/platform/sdl" 1710 1714 ;; 1715 motoezx) 1716 find_sdlconfig 1717 INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" 1718 LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`" 1719 DEFINES="$DEFINES -DSDL_BACKEND" 1720 CXXFLAGS="$CXXFLAGS -DMOTOEZX" 1721 MODULES="$MODULES backends/platform/sdl" 1722 ;; 1711 1723 gp2x) 1712 1724 find_sdlconfig 1713 1725 INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`" -
configure-motoezx.txt
diff -rNu trunk/configure-motoezx.txt trunk-a1200/configure-motoezx.txt
old new 1 ./configure --host=arm-linux --backend=motoezx --disable-scalers --disable-vorbis --enable-tremor --enable-mad --enable-zlib --enable-flac