src/mess/machine/lynx.c
| r13212 | r13213 | |
| 1148 | 1148 | static void lynx_draw_lines(running_machine &machine, int newline) |
| 1149 | 1149 | { |
| 1150 | 1150 | lynx_state *state = machine.driver_data<lynx_state>(); |
| 1151 | | int h,w; |
| 1152 | 1151 | int x, yend; |
| 1153 | 1152 | UINT16 j; // clipping needed! |
| 1154 | 1153 | UINT8 byte; |
| r13212 | r13213 | |
| 1173 | 1172 | if (state->m_mikey.data[0x92] & 0x02) |
| 1174 | 1173 | j -= 160 * 102 / 2 - 1; |
| 1175 | 1174 | |
| 1176 | | /* rotation */ |
| 1177 | | if (state->m_rotate & 0x03) |
| 1175 | if (state->m_mikey.data[0x92] & 0x02) |
| 1178 | 1176 | { |
| 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++) |
| 1181 | 1178 | { |
| 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) |
| 1183 | 1181 | { |
| 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]; |
| 1191 | 1185 | } |
| 1192 | 1186 | } |
| 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 | | } |
| 1206 | 1187 | } |
| 1207 | 1188 | else |
| 1208 | 1189 | { |
| 1209 | | w = 160; h = 102; |
| 1210 | | if (state->m_mikey.data[0x92] & 0x02) |
| 1190 | for ( ; state->m_line_y < yend; state->m_line_y++) |
| 1211 | 1191 | { |
| 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) |
| 1213 | 1194 | { |
| 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]; |
| 1221 | 1198 | } |
| 1222 | 1199 | } |
| 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 | | } |
| 1236 | 1200 | } |
| 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 | | } |
| 1248 | 1201 | } |
| 1249 | 1202 | |
| 1250 | 1203 | |
| r13212 | r13213 | |
| 1807 | 1760 | memory_configure_bank(machine, "bank4", 1, 1, state->m_mem_fffa, 0); |
| 1808 | 1761 | |
| 1809 | 1762 | state->m_audio = machine.device("custom"); |
| 1810 | | state->m_height = -1; |
| 1811 | | state->m_width = -1; |
| 1812 | 1763 | |
| 1813 | 1764 | memset(&state->m_suzy, 0, sizeof(state->m_suzy)); |
| 1814 | 1765 | |
| r13212 | r13213 | |
| 1822 | 1773 | { |
| 1823 | 1774 | lynx_state *state = machine.driver_data<lynx_state>(); |
| 1824 | 1775 | render_target *target = machine.render().first_target(); |
| 1825 | | target->set_view(state->m_rotate0); |
| 1776 | target->set_view(state->m_rotate); |
| 1826 | 1777 | } |
| 1827 | 1778 | |
| 1828 | 1779 | /**************************************** |
| r13212 | r13213 | |
| 1875 | 1826 | |
| 1876 | 1827 | info = hashfile_extrainfo(image); |
| 1877 | 1828 | |
| 1878 | | state->m_rotate0 = 0; |
| 1829 | state->m_rotate = 0; |
| 1879 | 1830 | if (info) |
| 1880 | 1831 | { |
| 1881 | 1832 | if(strcmp(info, "ROTATE90DEGREE") == 0) |
| 1882 | | state->m_rotate0 = 1; |
| 1833 | state->m_rotate = 1; |
| 1883 | 1834 | else if (strcmp(info, "ROTATE270DEGREE") == 0) |
| 1884 | | state->m_rotate0 = 2; |
| 1835 | state->m_rotate = 2; |
| 1885 | 1836 | } |
| 1886 | 1837 | } |
| 1887 | 1838 | |
| r13212 | r13213 | |
| 1958 | 1909 | memcpy(rom, image.get_software_region("rom"), size); |
| 1959 | 1910 | |
| 1960 | 1911 | const char *rotate = image.get_feature("rotation"); |
| 1961 | | state->m_rotate0 = 0; |
| 1912 | state->m_rotate = 0; |
| 1962 | 1913 | if (rotate) |
| 1963 | 1914 | { |
| 1964 | 1915 | if(strcmp(rotate, "RIGHT") == 0) { |
| 1965 | | state->m_rotate0 = 1; |
| 1916 | state->m_rotate = 1; |
| 1966 | 1917 | } |
| 1967 | 1918 | else if (strcmp(rotate, "LEFT") == 0) { |
| 1968 | | state->m_rotate0 = 2; |
| 1919 | state->m_rotate = 2; |
| 1969 | 1920 | } |
| 1970 | 1921 | } |
| 1971 | 1922 | |