Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Unnamed
Friday, January 26th, 2007 at 11:55:14pm UTC 

  1. Index: apps/plugins/rockboy/cpu.c
  2. ===================================================================
  3. --- apps/plugins/rockboy/cpu.c  (revision 12103)
  4. +++ apps/plugins/rockboy/cpu.c  (working copy)
  5. @@ -246,10 +246,10 @@
  6.  
  7.  void cpu_reset(void)
  8.  {
  9. -       union reg acc;
  10.  #ifdef DYNAREC
  11. -        int i;
  12. -        dynapointer=0;
  13. +    union reg acc;
  14. +    int i;
  15. +    dynapointer=0;
  16.  #endif
  17.         cpu.speed = 0;
  18.         cpu.halt = 0;
  19. @@ -262,6 +262,7 @@
  20.         
  21.         PC = 0x0100;
  22.         SP = 0xFFFE;
  23. +#ifdef DYNAREC
  24.         W(acc) = 0x01B0;
  25.         A=HB(acc);
  26.         F=LB(acc);
  27. @@ -271,6 +272,11 @@
  28.         W(acc) = 0x00D8;
  29.         D=HB(acc);
  30.         E=LB(acc);
  31. +#else
  32. +       AF = 0x01B0;
  33. +       BC = 0x0013;
  34. +       DE = 0x00D8;
  35. +#endif
  36.         HL = 0x014D;
  37.  
  38.          if (hw.cgb) A = 0x11;
  39. Index: apps/plugins/rockboy/lcd.c
  40. ===================================================================
  41. --- apps/plugins/rockboy/lcd.c  (revision 12103)
  42. +++ apps/plugins/rockboy/lcd.c  (working copy)
  43. @@ -910,12 +910,35 @@
  44.          else pal_expire();
  45.      }
  46.  */
  47. +#if (LCD_WIDTH>=160) && (LCD_HEIGHT>=144)
  48. +#define S1  ((LCD_HEIGHT-144)/2)*LCD_WIDTH + ((LCD_WIDTH-160)/2)
  49. +#define S2  0
  50.  
  51. -    if(options.fullscreen)
  52. -        vdest = fb.ptr;
  53. +#elif (LCD_WIDTH>=160) && (LCD_HEIGHT<=144)
  54. +#define S1  ((LCD_WIDTH-160)/2)
  55. +#define S2  ((LCD_WIDTH-160)/2)
  56. +
  57. +#elif (LCD_WIDTH<=160) && (LCD_HEIGHT>=144)
  58. +#define S1  ((LCD_HEIGHT-144)/2)*LCD_WIDTH
  59. +#define S2  ((LCD_HEIGHT-144)/2)*LCD_WIDTH
  60. +
  61. +#else
  62. +#define S1  0
  63. +#define S2  0
  64. +#endif
  65. +
  66. +#if (LCD_WIDTH>LCD_HEIGHT)
  67. +#define S3  ((LCD_WIDTH-(160*LCD_HEIGHT/144))/2)
  68. +#else
  69. +#define S3  ((LCD_HEIGHT-(144*LCD_WIDTH/160))/2)*LCD_WIDTH
  70. +#endif
  71. +
  72. +    if(options.fullscreen == 0)
  73. +        vdest=fb.ptr+S1;
  74. +    else if (options.fullscreen == 1)
  75. +        vdest=fb.ptr+S2;
  76.      else
  77. -        vdest=fb.ptr+((LCD_HEIGHT-144)/2)*LCD_WIDTH + ((LCD_WIDTH-160)/2);
  78. -
  79. +        vdest=fb.ptr+S3;
  80.      WY = R_WY;
  81.  }
  82.  
  83. @@ -930,11 +953,28 @@
  84.  {
  85.      switch(mode)
  86.      {
  87. -        case 1: /* Full screen scale */
  88. +        case 1:
  89. +#if (LCD_WIDTH>=160) && (LCD_HEIGHT>=144) /* Full screen scale */
  90.              SCALEWL=DX;
  91.              SCALEWS=DXI;
  92.              SCALEHL=DY;
  93.              SCALEHS=DYI;
  94. +#elif (LCD_WIDTH>=160) && (LCD_HEIGHT<144) /* scale the height */
  95. +            SCALEWL=1<<16;
  96. +            SCALEWS=1<<16;
  97. +            SCALEHL=DY;
  98. +            SCALEHS=DYI;
  99. +#elif (LCD_WIDTH<160) && (LCD_HEIGHT>=144) /* scale the width */
  100. +            SCALEWL=DX;
  101. +            SCALEWS=DXI;
  102. +            SCALEHL=1<<16;
  103. +            SCALEHS=1<<16;           
  104. +#else
  105. +            SCALEWL=DX;
  106. +            SCALEWS=DXI;
  107. +            SCALEHL=DY;
  108. +            SCALEHS=DYI;
  109. +#endif
  110.              break;
  111.          case 2: /* Maintain Ratio */
  112.              if (DY<DX)
  113. @@ -952,18 +992,11 @@
  114.                  SCALEHS=DXI;
  115.              }
  116.              break;
  117. -        default: /* No Scaling (or fullscreen for smaller screens) */
  118. -#if LCD_WIDTH>160
  119. +        default:
  120.              SCALEWL=1<<16;
  121.              SCALEWS=1<<16;
  122.              SCALEHL=1<<16;
  123.              SCALEHS=1<<16;
  124. -#else
  125. -            SCALEWL=DX;
  126. -            SCALEWS=DXI;
  127. -            SCALEHL=DY;
  128. -            SCALEHS=DYI;
  129. -#endif
  130.      }
  131.      swidth=(160*SCALEWL)>>16;
  132.      sremain=LCD_WIDTH-swidth;
  133. @@ -982,7 +1015,7 @@
  134.      if (!(R_LCDC & 0x80))
  135.          return; /* should not happen... */
  136.  
  137. -#if LCD_HEIGHT < 144
  138. +#if (LCD_HEIGHT <= 128) && !defined(HAVE_LCD_COLOR)
  139.      if ( (fb.mode==0&&(R_LY >= 128)) ||
  140.           (fb.mode==1&&(R_LY < 16)) ||
  141.           (fb.mode==2&&(R_LY<8||R_LY>=136)) ||
  142. @@ -1046,8 +1079,7 @@
  143.              vid_update(L-((int)(L/9)));
  144.  #else
  145.      {
  146. -    /*  Universial Scaling pulled from PrBoom and modified for rockboy  */
  147. -    /*  Needs some thought for screens smaller than the gameboy though */
  148. +    /*  Universal Scaling pulled from PrBoom and modified for rockboy  */
  149.  
  150.      static int hpt IDATA_ATTR=0x8000;
  151.  
  152. @@ -1059,9 +1091,24 @@
  153.          register unsigned int remain=sremain;
  154.          while(wcount--)
  155.          {
  156. +#if LCD_HEIGHT<144  /* cut off the bottom part of the screen that won't fit */
  157. +            if (options.fullscreen==0 && (hpt>>16)>LCD_HEIGHT)
  158. +                break;
  159. +#endif
  160. +
  161. +#if LCD_WIDTH<160 /* cut off the right part of the screen that won't fit */
  162. +            if(options.fullscreen==0 && wcount<(160-LCD_WIDTH)) {
  163. +                vdest+=wcount;
  164. +                wcount = 0;
  165. +            }
  166. +#endif
  167. +               
  168.              *vdest++ = scan.pal2[scan.buf[srcpt>>16]];
  169.              srcpt+=SCALEWS;
  170.          }
  171. +#if LCD_HEIGHT<144
  172. +        if (options.fullscreen!=0 || (hpt>>16)<(LCD_HEIGHT))
  173. +#endif
  174.          vdest+=remain;
  175.      }
  176.  
  177. Index: apps/plugins/rockboy/menu.c
  178. ===================================================================
  179. --- apps/plugins/rockboy/menu.c (revision 12103)
  180. +++ apps/plugins/rockboy/menu.c (working copy)
  181. @@ -13,6 +13,13 @@
  182.  #define MENU_BUTTON_DOWN BUTTON_SCROLL_FWD
  183.  #define MENU_BUTTON_LEFT BUTTON_LEFT
  184.  #define MENU_BUTTON_RIGHT BUTTON_RIGHT
  185. +
  186. +#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
  187. +#define MENU_BUTTON_UP BUTTON_SCROLL_UP
  188. +#define MENU_BUTTON_DOWN BUTTON_SCROLL_DOWN
  189. +#define MENU_BUTTON_LEFT BUTTON_LEFT
  190. +#define MENU_BUTTON_RIGHT BUTTON_RIGHT
  191. +
  192.  #else
  193.  #define MENU_BUTTON_UP BUTTON_UP
  194.  #define MENU_BUTTON_DOWN BUTTON_DOWN
  195. @@ -322,9 +329,9 @@
  196.      };
  197.  
  198.      static const struct opt_items fullscreen[]= {
  199. -        { "Off", -1 },
  200. -        { "Fullscreen", -1 },
  201. -        { "Full - Maintain Ratio", -1 },
  202. +        { "Unscaled", -1 },
  203. +        { "Scaled", -1 },
  204. +        { "Scaled - Maintain Ratio", -1 },
  205.      };
  206.  
  207.      static const struct opt_items frameskip[]= {
  208. @@ -338,7 +345,7 @@
  209.          { "Max Frameskip", NULL },
  210.          { "Sound"        , NULL },
  211.          { "Stats"        , NULL },
  212. -        { "Fullscreen"   , NULL },
  213. +        { "Screen Options"   , NULL },
  214.          { "Set Keys (Buggy)", NULL },
  215.      };
  216.  
  217. Index: apps/plugins/rockboy/sys_rockbox.c
  218. ===================================================================
  219. --- apps/plugins/rockboy/sys_rockbox.c  (revision 12103)
  220. +++ apps/plugins/rockboy/sys_rockbox.c  (working copy)
  221. @@ -32,6 +32,13 @@
  222.  #define ROCKBOY_PAD_UP BUTTON_MENU
  223.  #define ROCKBOY_PAD_DOWN BUTTON_PLAY
  224.  
  225. +#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
  226. +
  227. +#define ROCKBOY_PAD_LEFT BUTTON_LEFT
  228. +#define ROCKBOY_PAD_RIGHT BUTTON_RIGHT
  229. +#define ROCKBOY_PAD_UP BUTTON_SCROLL_UP
  230. +#define ROCKBOY_PAD_DOWN BUTTON_SCROLL_DOWN
  231. +
  232.  #else
  233.  
  234.  #define ROCKBOY_PAD_LEFT BUTTON_LEFT
  235. @@ -178,11 +185,7 @@
  236.  #else
  237.          if(pressed & options.MENU) {
  238.  #endif
  239. -#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
  240. -    (CONFIG_KEYPAD == IRIVER_H300_PAD) || \
  241. -    (CONFIG_KEYPAD == IPOD_4G_PAD) || \
  242. -    (CONFIG_KEYPAD == GIGABEAT_PAD) || \
  243. -    (CONFIG_KEYPAD == SANSA_E200_PAD)
  244. +#ifdef HAVE_LCD_COLOR
  245.  #ifdef HAVE_WHEEL_POSITION
  246.              rb->wheel_send_events(true);
  247.  #endif
  248. @@ -378,7 +381,7 @@
  249.     elap=mytime-*oldtick;
  250.     *oldtick=mytime;
  251.     return elap;*/
  252. -//   return ((*rb->current_tick-(*oldtick))*1000000)/HZ;
  253. +   //return ((*rb->current_tick-(*oldtick))*1000000)/HZ;
  254.     return *oldtick;
  255.  }
  256.  
  257. Index: apps/plugins/rockboy/rockboy.c
  258. ===================================================================
  259. --- apps/plugins/rockboy/rockboy.c      (revision 12103)
  260. +++ apps/plugins/rockboy/rockboy.c      (working copy)
  261. @@ -136,12 +136,30 @@
  262.        options.START=BUTTON_SCROLL_UP;
  263.        options.SELECT=BUTTON_SCROLL_DOWN;
  264.        options.MENU=BUTTON_POWER;
  265. +     
  266. +#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
  267. +      options.A=BUTTON_PLAY;
  268. +      options.B=BUTTON_REC;
  269. +      options.START=BUTTON_SELECT;
  270. +      options.SELECT=BUTTON_NONE;
  271. +      options.MENU=BUTTON_POWER; 
  272. +     
  273. +#elif CONFIG_KEYPAD == IRIVER_H10_PAD
  274. +      options.A=BUTTON_PLAY;
  275. +      options.B=BUTTON_FF;
  276. +      options.START=BUTTON_REW;
  277. +      options.SELECT=BUTTON_NONE;
  278. +      options.MENU=BUTTON_POWER;
  279.  #endif
  280.  
  281.        options.maxskip=4;
  282.        options.fps=0;
  283.        options.showstats=0;
  284. +#if (LCD_WIDTH>=160) && (LCD_HEIGHT>=144)
  285.        options.fullscreen=0;
  286. +#else
  287. +      options.fullscreen=1;
  288. +#endif
  289.        options.sound=1;
  290.     }
  291.     else
  292. Index: apps/plugins/rockboy/main.c
  293. ===================================================================
  294. --- apps/plugins/rockboy/main.c (revision 12103)
  295. +++ apps/plugins/rockboy/main.c (working copy)
  296. @@ -84,11 +84,8 @@
  297.         PUTS("Emu reset");
  298.         emu_reset();
  299.         PUTS("Emu run");
  300. -#if (LCD_HEIGHT > 144) || (LCD_WIDTH > 160)
  301.      rb->lcd_clear_display();
  302. -//    rb->lcd_drawrect((LCD_WIDTH-160)/2-1, (LCD_HEIGHT-144)/2-1, 162, 146);
  303.      rb->lcd_update();
  304. -#endif
  305.         emu_run();
  306.  
  307.         // never reached
  308. Index: apps/plugins/rockboy/emu.c
  309. ===================================================================
  310. --- apps/plugins/rockboy/emu.c  (revision 12103)
  311. +++ apps/plugins/rockboy/emu.c  (working copy)
  312. @@ -45,11 +45,14 @@
  313.  
  314.  /* This mess needs to be moved to another module; it's just here to
  315.   * make things work in the mean time. */
  316. +
  317. +//void *sys_timer();
  318. +
  319.  void emu_run(void)
  320.  {
  321.  //     void *timer = sys_timer();
  322. +//     int delay;
  323.      int framesin=0,frames=0,timeten=*rb->current_tick, timehun=*rb->current_tick;
  324. -//     int delay;
  325.  
  326.      setvidmode(options.fullscreen);
  327.      vid_begin();
  328. Index: apps/plugins/SUBDIRS
  329. ===================================================================
  330. --- apps/plugins/SUBDIRS        (revision 12103)
  331. +++ apps/plugins/SUBDIRS        (working copy)
  332. @@ -5,11 +5,7 @@
  333.  /* For various targets... */
  334.  #if (CONFIG_KEYPAD == RECORDER_PAD) || \
  335.      (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
  336. -    (CONFIG_KEYPAD == IRIVER_H300_PAD) || \
  337. -    defined(IPOD_COLOR) || \
  338. -    defined(IPOD_VIDEO) || \
  339. -    defined(TOSHIBA_GIGABEAT_F) || \
  340. -    defined(SANSA_E200)
  341. +    defined(HAVE_LCD_COLOR)
  342.  rockboy
  343.  #endif
  344.  

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right
worth-right