Previous 15994 Revisions Next

r13213 Friday 11th November, 2011 at 08:12:31 UTC by Miodrag Milanović
huygens: removed the now unnecessary rotation handling code in lynx(no whatsnew)
[src/mess/drivers]lynx.c
[src/mess/includes]lynx.h
[src/mess/machine]lynx.c

src/mess/machine/lynx.c
r13212r13213
11481148static void lynx_draw_lines(running_machine &machine, int newline)
11491149{
11501150   lynx_state *state = machine.driver_data<lynx_state>();
1151   int h,w;
11521151   int x, yend;
11531152   UINT16 j; // clipping needed!
11541153   UINT8 byte;
r13212r13213
11731172   if (state->m_mikey.data[0x92] & 0x02)
11741173      j -= 160 * 102 / 2 - 1;
11751174
1176   /* rotation */
1177   if (state->m_rotate & 0x03)
1175   if (state->m_mikey.data[0x92] & 0x02)
11781176   {
1179      h = 160; w = 102;
1180      if (((state->m_rotate == 1) && (state->m_mikey.data[0x92] & 0x02)) || ((state->m_rotate == 2) && !(state->m_mikey.data[0x92] & 0x02)))
1177      for ( ; state->m_line_y < yend; state->m_line_y++)
11811178      {
1182         for ( ; state->m_line_y < yend; state->m_line_y++)
1179         line = BITMAP_ADDR16(machine.generic.tmpbitmap, 102 - 1 - state->m_line_y, 0);
1180         for (x = 160 - 2; x >= 0; j++, x -= 2)
11831181         {
1184            line = BITMAP_ADDR16(machine.generic.tmpbitmap, 0, state->m_line_y);
1185            for (x = 160 - 2; x >= 0; j++, x -= 2)
1186            {
1187               byte = lynx_read_vram(state, j);
1188               line[h*(x + 1)] = state->m_palette[(byte >> 4) & 0x0f];
1189               line[h*x + 0] = state->m_palette[(byte >> 0) & 0x0f];
1190            }
1182            byte = lynx_read_vram(state, j);
1183            line[x + 1] = state->m_palette[(byte >> 4) & 0x0f];
1184            line[x + 0] = state->m_palette[(byte >> 0) & 0x0f];
11911185         }
11921186      }
1193      else
1194      {
1195         for ( ; state->m_line_y < yend; state->m_line_y++)
1196         {
1197            line = BITMAP_ADDR16(machine.generic.tmpbitmap, 0, 102 - 1 - state->m_line_y);
1198            for (x = 0; x < 160; j++, x += 2)
1199            {
1200               byte = lynx_read_vram(state, j);
1201               line[h*x + 0] = state->m_palette[(byte >> 4) & 0x0f];
1202               line[h*(x + 1)] = state->m_palette[(byte >> 0) & 0x0f];
1203            }
1204         }
1205      }
12061187   }
12071188   else
12081189   {
1209      w = 160; h = 102;
1210      if (state->m_mikey.data[0x92] & 0x02)
1190      for ( ; state->m_line_y < yend; state->m_line_y++)
12111191      {
1212         for ( ; state->m_line_y < yend; state->m_line_y++)
1192         line = BITMAP_ADDR16(machine.generic.tmpbitmap, state->m_line_y, 0);
1193         for (x = 0; x < 160; j++, x += 2)
12131194         {
1214            line = BITMAP_ADDR16(machine.generic.tmpbitmap, 102 - 1 - state->m_line_y, 0);
1215            for (x = 160 - 2; x >= 0; j++, x -= 2)
1216            {
1217               byte = lynx_read_vram(state, j);
1218               line[x + 1] = state->m_palette[(byte >> 4) & 0x0f];
1219               line[x + 0] = state->m_palette[(byte >> 0) & 0x0f];
1220            }
1195            byte = lynx_read_vram(state, j);
1196            line[x + 0] = state->m_palette[(byte >> 4) & 0x0f];
1197            line[x + 1] = state->m_palette[(byte >> 0) & 0x0f];
12211198         }
12221199      }
1223      else
1224      {
1225         for ( ; state->m_line_y < yend; state->m_line_y++)
1226         {
1227            line = BITMAP_ADDR16(machine.generic.tmpbitmap, state->m_line_y, 0);
1228            for (x = 0; x < 160; j++, x += 2)
1229            {
1230               byte = lynx_read_vram(state, j);
1231               line[x + 0] = state->m_palette[(byte >> 4) & 0x0f];
1232               line[x + 1] = state->m_palette[(byte >> 0) & 0x0f];
1233            }
1234         }
1235      }
12361200   }
1237   if (newline == -1)
1238   {
1239      state->m_line_y = 0;
1240      if ((w != state->m_width) || (h != state->m_height))
1241      {
1242         state->m_width = w;
1243         state->m_height = h;
1244         machine.primary_screen->set_visible_area(0, w - 1, 0, h - 1);
1245         logerror("Visible area %d by %d \n", w-1, h-1);
1246      }
1247   }
12481201}
12491202
12501203
r13212r13213
18071760   memory_configure_bank(machine, "bank4", 1, 1, state->m_mem_fffa, 0);
18081761
18091762   state->m_audio = machine.device("custom");
1810   state->m_height = -1;
1811   state->m_width = -1;
18121763
18131764   memset(&state->m_suzy, 0, sizeof(state->m_suzy));
18141765
r13212r13213
18221773{
18231774   lynx_state *state = machine.driver_data<lynx_state>();
18241775   render_target *target = machine.render().first_target();
1825   target->set_view(state->m_rotate0);
1776   target->set_view(state->m_rotate);
18261777}
18271778
18281779/****************************************
r13212r13213
18751826
18761827   info = hashfile_extrainfo(image);
18771828   
1878   state->m_rotate0 = 0;
1829   state->m_rotate = 0;
18791830   if (info)
18801831   {
18811832      if(strcmp(info, "ROTATE90DEGREE") == 0)
1882         state->m_rotate0 = 1;
1833         state->m_rotate = 1;
18831834      else if (strcmp(info, "ROTATE270DEGREE") == 0)
1884         state->m_rotate0 = 2;
1835         state->m_rotate = 2;
18851836   }
18861837}
18871838
r13212r13213
19581909      memcpy(rom, image.get_software_region("rom"), size);
19591910     
19601911      const char *rotate = image.get_feature("rotation");
1961      state->m_rotate0 = 0;
1912      state->m_rotate = 0;
19621913      if (rotate)
19631914      {
19641915         if(strcmp(rotate, "RIGHT") == 0) {
1965            state->m_rotate0 = 1;
1916            state->m_rotate = 1;
19661917         }
19671918         else if (strcmp(rotate, "LEFT") == 0) {
1968            state->m_rotate0 = 2;
1919            state->m_rotate = 2;
19691920         }
19701921      }
19711922
src/mess/includes/lynx.h
r13212r13213
9292   int m_sign_AB;
9393   int m_sign_CD;
9494   UINT32 m_palette[0x10];
95   int m_rotate0;
9695   int m_rotate;
9796   device_t *m_audio;
9897   SUZY m_suzy;
r13212r13213
10099   UINT8 m_memory_config;
101100   UINT8 m_sprite_collide;
102101   MIKEY m_mikey;
103   int m_height;
104   int m_width;
105102   LYNX_TIMER m_timer[NR_LYNX_TIMERS];
106103   UART m_uart;
107104};
src/mess/drivers/lynx.c
r13212r13213
6969   MCFG_SCREEN_REFRESH_RATE(LCD_FRAMES_PER_SECOND)
7070   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
7171   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
72   /*MCFG_SCREEN_SIZE(160, 102)*/
73   MCFG_SCREEN_SIZE(160, 160)
72   MCFG_SCREEN_SIZE(160, 102)
7473   MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 102-1)
7574   MCFG_SCREEN_UPDATE( generic_bitmapped )
7675   MCFG_DEFAULT_LAYOUT(layout_lynx)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team