src/mame/video/snes.c
| r7309 | r7310 | |
| 87 | 87 | UINT8 input_count; |
| 88 | 88 | UINT8 bg_disabled[6]; |
| 89 | 89 | UINT8 mode_disabled[8]; |
| 90 | | UINT8 draw_SNES_SUBSCREEN; |
| 90 | UINT8 draw_subscreen; |
| 91 | 91 | UINT8 windows_disabled; |
| 92 | 92 | UINT8 transparency_disabled; |
| 93 | 93 | }; |
| r7309 | r7310 | |
| 115 | 115 | struct SCANLINE |
| 116 | 116 | { |
| 117 | 117 | UINT16 buffer[(SNES_SCR_WIDTH * 2) + 16]; |
| 118 | | UINT8 zbuf[(SNES_SCR_WIDTH * 2) + 16]; |
| 118 | UINT8 priority[(SNES_SCR_WIDTH * 2) + 16]; |
| 119 | UINT8 layer[(SNES_SCR_WIDTH * 2) + 16]; |
| 120 | UINT8 blend_exception[(SNES_SCR_WIDTH * 2) + 16]; |
| 119 | 121 | }; |
| 120 | 122 | |
| 121 | 123 | static struct SCANLINE scanlines[2]; |
| r7309 | r7310 | |
| 273 | 275 | /* Only draw if we have a colour (0 == transparent) */ |
| 274 | 276 | if (colour) |
| 275 | 277 | { |
| 276 | | if ((scanlines[screen].zbuf[ii] <= priority) && (ii >= 0)) |
| 278 | if ((scanlines[screen].priority[ii] <= priority) && (ii >= 0)) |
| 277 | 279 | { |
| 278 | 280 | if (direct_colors) |
| 279 | 281 | { |
| r7309 | r7310 | |
| 284 | 286 | else |
| 285 | 287 | c = snes_cgram[pal + colour]; |
| 286 | 288 | |
| 287 | | /* Only blend main screens and only if the layer is subject to color_math */ |
| 288 | | if (screen == SNES_MAINSCREEN && snes_ppu.layer[layer].color_math) |
| 289 | | snes_draw_blend(ii/snes_htmult, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); |
| 290 | 289 | if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic |
| 291 | 290 | { |
| 292 | 291 | int x_mos; |
| r7309 | r7310 | |
| 295 | 294 | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) |
| 296 | 295 | { |
| 297 | 296 | scanlines[screen].buffer[ii + x_mos] = c; |
| 298 | | scanlines[screen].zbuf[ii + x_mos] = priority; |
| 297 | scanlines[screen].priority[ii + x_mos] = priority; |
| 298 | scanlines[screen].layer[ii + x_mos] = layer; |
| 299 | 299 | } |
| 300 | 300 | ii += x_mos - 1; |
| 301 | 301 | } |
| 302 | 302 | else |
| 303 | 303 | { |
| 304 | 304 | scanlines[screen].buffer[ii] = c; |
| 305 | | scanlines[screen].zbuf[ii] = priority; |
| 305 | scanlines[screen].priority[ii] = priority; |
| 306 | scanlines[screen].layer[ii] = layer; |
| 306 | 307 | } |
| 307 | 308 | } |
| 308 | 309 | } |
| r7309 | r7310 | |
| 382 | 383 | /* Only draw if we have a colour (0 == transparent) */ |
| 383 | 384 | if (colour) |
| 384 | 385 | { |
| 385 | | if (ii >= 0) |
| 386 | if ((scanlines[screen].priority[ii] <= priority) && (ii >= 0)) |
| 386 | 387 | { |
| 387 | 388 | c = snes_cgram[pal + colour]; |
| 388 | | if (blend && screen == SNES_MAINSCREEN && snes_ppu.layer[SNES_OAM].color_math) /* Only blend main screens */ |
| 389 | | snes_draw_blend(ii/snes_htmult, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); |
| 390 | 389 | |
| 391 | 390 | scanlines[screen].buffer[ii] = c; |
| 392 | | scanlines[screen].zbuf[ii] = priority; |
| 391 | scanlines[screen].priority[ii] = priority; |
| 392 | scanlines[screen].layer[ii] = SNES_OAM; |
| 393 | scanlines[screen].blend_exception[ii] = blend; |
| 393 | 394 | if (wide) |
| 394 | 395 | { |
| 395 | 396 | scanlines[screen].buffer[ii + 1] = c; |
| 396 | | scanlines[screen].zbuf[ii + 1] = priority; |
| 397 | scanlines[screen].priority[ii + 1] = priority; |
| 398 | scanlines[screen].layer[ii + 1] = SNES_OAM; |
| 399 | scanlines[screen].blend_exception[ii + 1] = blend; |
| 397 | 400 | } |
| 398 | 401 | } |
| 399 | 402 | } |
| r7309 | r7310 | |
| 703 | 706 | colour &= snes_ppu.clipmasks[layer][xpos]; |
| 704 | 707 | |
| 705 | 708 | /* Draw pixel if appropriate */ |
| 706 | | if (scanlines[screen].zbuf[xpos] <= priority && colour > 0) |
| 709 | if (scanlines[screen].priority[xpos] <= priority && colour > 0) |
| 707 | 710 | { |
| 708 | 711 | UINT16 clr; |
| 709 | 712 | /* Direct select, but only outside EXTBG! */ |
| r7309 | r7310 | |
| 714 | 717 | } |
| 715 | 718 | else |
| 716 | 719 | clr = snes_cgram[colour]; |
| 717 | | /* Only blend main screens */ |
| 718 | | if (screen == SNES_MAINSCREEN && snes_ppu.layer[layer].color_math) |
| 719 | | snes_draw_blend(xpos, &clr, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); /* FIXME: Need to support clip mode */ |
| 720 | 720 | |
| 721 | 721 | scanlines[screen].buffer[xpos] = clr; |
| 722 | | scanlines[screen].zbuf[xpos] = priority; |
| 722 | scanlines[screen].priority[xpos] = priority; |
| 723 | scanlines[screen].layer[xpos] = layer; |
| 723 | 724 | } |
| 724 | 725 | } |
| 725 | 726 | } |
| r7309 | r7310 | |
| 763 | 764 | if (snes_ppu.mode == 5 || snes_ppu.mode == 6) |
| 764 | 765 | widemode = 1; |
| 765 | 766 | |
| 766 | | curline/=snes_ppu.interlace; |
| 767 | | curline*=snes_ppu.obj_interlace; |
| 767 | curline /= snes_ppu.interlace; |
| 768 | curline *= snes_ppu.obj_interlace; |
| 768 | 769 | |
| 769 | 770 | oam = 0x1ff; |
| 770 | 771 | oam_extra = oam + 0x20; |
| r7309 | r7310 | |
| 798 | 799 | if (curline >= y && curline < (y + (snes_ppu.oam.size[size] << 3))) |
| 799 | 800 | { |
| 800 | 801 | /* Only objects using palettes 4-7 can be transparent */ |
| 801 | | blend = (pal < 192) ? 0 : 1; |
| 802 | blend = (pal < 192) ? 1 : 0; |
| 802 | 803 | |
| 803 | 804 | /* Only objects using tiles over 255 use name select */ |
| 804 | 805 | name_sel = (tile < 256) ? 0 : snes_ppu.oam.name_select; |
| r7309 | r7310 | |
| 1145 | 1146 | int x; |
| 1146 | 1147 | int fade; |
| 1147 | 1148 | struct SCANLINE *scanline; |
| 1149 | UINT16 c; |
| 1148 | 1150 | |
| 1149 | 1151 | profiler_mark_start(PROFILER_VIDEO); |
| 1150 | 1152 | |
| r7309 | r7310 | |
| 1160 | 1162 | if (snes_ppu.update_offsets) |
| 1161 | 1163 | snes_update_offsets(); |
| 1162 | 1164 | |
| 1163 | | /* Clear zbuffers */ |
| 1164 | | memset(scanlines[SNES_MAINSCREEN].zbuf, 0, SNES_SCR_WIDTH * 2); |
| 1165 | | memset(scanlines[SNES_SUBSCREEN].zbuf, 0, SNES_SCR_WIDTH * 2); |
| 1165 | /* Clear priority */ |
| 1166 | memset(scanlines[SNES_MAINSCREEN].priority, 0, SNES_SCR_WIDTH * 2); |
| 1167 | memset(scanlines[SNES_SUBSCREEN].priority, 0, SNES_SCR_WIDTH * 2); |
| 1166 | 1168 | |
| 1167 | | /* Clear SNES_SUBSCREEN and draw back colour */ |
| 1169 | /* Clear layers */ |
| 1170 | memset(scanlines[SNES_MAINSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH * 2); |
| 1171 | memset(scanlines[SNES_SUBSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH * 2); |
| 1172 | |
| 1173 | /* Clear blend_exception (only used for OAM) */ |
| 1174 | memset(scanlines[SNES_MAINSCREEN].blend_exception, 0, SNES_SCR_WIDTH * 2); |
| 1175 | memset(scanlines[SNES_SUBSCREEN].blend_exception, 0, SNES_SCR_WIDTH * 2); |
| 1176 | |
| 1177 | /* Draw back colour */ |
| 1168 | 1178 | for (ii = 0; ii < SNES_SCR_WIDTH * 2; ii++) |
| 1169 | 1179 | { |
| 1170 | | /* Not sure if this is correct behaviour, but a few games seem to |
| 1171 | | * require it. (SMW, Zelda etc) */ |
| 1172 | | scanlines[SNES_SUBSCREEN].buffer[ii] = snes_cgram[FIXED_COLOUR]; |
| 1180 | if (snes_ppu.mode == 5 || snes_ppu.mode == 6) |
| 1181 | scanlines[SNES_SUBSCREEN].buffer[ii] = snes_cgram[0]; |
| 1182 | else |
| 1183 | scanlines[SNES_SUBSCREEN].buffer[ii] = snes_cgram[FIXED_COLOUR]; |
| 1184 | |
| 1173 | 1185 | /* Draw back colour */ |
| 1174 | 1186 | scanlines[SNES_MAINSCREEN].buffer[ii] = snes_cgram[0]; |
| 1175 | 1187 | } |
| r7309 | r7310 | |
| 1177 | 1189 | /* Draw SNES_SUBSCREEN */ |
| 1178 | 1190 | snes_draw_screen(SNES_SUBSCREEN, curline); |
| 1179 | 1191 | |
| 1180 | | /* Draw the back plane */ |
| 1181 | | #ifdef MAME_DEBUG |
| 1182 | | if (!debug_options.bg_disabled[5]) |
| 1183 | | #endif /* MAME_DEBUG */ |
| 1184 | | if (snes_ppu.colour.color_math) |
| 1185 | | { |
| 1186 | | for (ii = 0; ii < SNES_SCR_WIDTH * snes_htmult; ii++) |
| 1187 | | { |
| 1188 | | snes_draw_blend(ii/snes_htmult, &scanlines[SNES_MAINSCREEN].buffer[ii], snes_ppu.sub_color_mask, snes_ppu.main_color_mask); |
| 1189 | | } |
| 1190 | | } |
| 1191 | 1192 | |
| 1192 | 1193 | /* Draw SNES_MAINSCREEN */ |
| 1193 | 1194 | snes_draw_screen(SNES_MAINSCREEN, curline); |
| r7309 | r7310 | |
| 1200 | 1201 | } |
| 1201 | 1202 | |
| 1202 | 1203 | /* Toggle drawing of SNES_SUBSCREEN or SNES_MAINSCREEN */ |
| 1203 | | if (debug_options.draw_SNES_SUBSCREEN) |
| 1204 | if (debug_options.draw_subscreen) |
| 1204 | 1205 | scanline = &scanlines[SNES_SUBSCREEN]; |
| 1205 | 1206 | else |
| 1206 | 1207 | #endif /* MAME_DEBUG */ |
| r7309 | r7310 | |
| 1211 | 1212 | |
| 1212 | 1213 | for (x = 0; x < SNES_SCR_WIDTH * 2; x++) |
| 1213 | 1214 | { |
| 1214 | | int r = ((scanline->buffer[x] & 0x1f) * fade) >> 4; |
| 1215 | | int g = (((scanline->buffer[x] & 0x3e0) >> 5) * fade) >> 4; |
| 1216 | | int b = (((scanline->buffer[x] & 0x7c00) >> 10) * fade) >> 4; |
| 1215 | c = scanline->buffer[x]; |
| 1216 | /* perform color math if the layer wants it (except if it's an object > 192) */ |
| 1217 | if (!scanlines[SNES_MAINSCREEN].blend_exception[x] && |
| 1218 | ((scanlines[SNES_MAINSCREEN].layer[x] != SNES_COLOR && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) |
| 1219 | || (scanlines[SNES_MAINSCREEN].layer[x] == SNES_COLOR && snes_ppu.colour.color_math))) |
| 1220 | snes_draw_blend(x, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); |
| 1217 | 1221 | |
| 1222 | int r = ((c & 0x1f) * fade) >> 4; |
| 1223 | int g = (((c & 0x3e0) >> 5) * fade) >> 4; |
| 1224 | int b = (((c & 0x7c00) >> 10) * fade) >> 4; |
| 1225 | |
| 1218 | 1226 | if (snes_htmult == 1) |
| 1219 | 1227 | { |
| 1220 | 1228 | *BITMAP_ADDR32(bitmap, curline, x*2+0) = MAKE_RGB(pal5bit(r), pal5bit(g), pal5bit(b)); |
| r7309 | r7310 | |
| 1251 | 1259 | |
| 1252 | 1260 | #ifdef MAME_DEBUG |
| 1253 | 1261 | |
| 1254 | | static void snes_dbg_draw_maps( bitmap_t *bitmap, UINT32 tmap, UINT8 bpl, UINT16 curline, UINT8 layer ) |
| 1255 | | { |
| 1256 | | UINT32 tile, addr = tmap; |
| 1257 | | UINT16 ii, vflip, hflip, pal; |
| 1258 | | INT8 line; |
| 1259 | | |
| 1260 | | tmap += (curline >> 3) * 64; |
| 1261 | | for (ii = 0; ii < 64; ii += 2) |
| 1262 | | { |
| 1263 | | vflip = (snes_vram[tmap + ii + 1] & 0x80); |
| 1264 | | hflip = snes_vram[tmap + ii + 1] & 0x40; |
| 1265 | | pal = (snes_vram[tmap + ii + 1] & 0x1c); /* 8 palettes of 4 colours */ |
| 1266 | | tile = (snes_vram[tmap + ii + 1] & 0x3) << 8; |
| 1267 | | tile |= snes_vram[tmap + ii]; |
| 1268 | | line = curline % 8; |
| 1269 | | if (vflip) |
| 1270 | | line = -line + 7; |
| 1271 | | |
| 1272 | | if (tile != 0) |
| 1273 | | { |
| 1274 | | switch (bpl) |
| 1275 | | { |
| 1276 | | case 1: |
| 1277 | | snes_draw_tile(SNES_MAINSCREEN, 2, layer, snes_ppu.layer[layer].data + (tile << 4) + ((curline % 8) * 2), (ii >> 1) * 8, 255, hflip, pal, 0); |
| 1278 | | break; |
| 1279 | | case 2: |
| 1280 | | pal <<= 2; |
| 1281 | | snes_draw_tile(SNES_MAINSCREEN, 4, layer, snes_ppu.layer[layer].data + (tile << 5) + ((curline % 8) * 2), (ii >> 1) * 8, 255, hflip, pal, 0); |
| 1282 | | break; |
| 1283 | | case 4: |
| 1284 | | pal <<= 0; // n/a |
| 1285 | | snes_draw_tile(SNES_MAINSCREEN, 8, layer, snes_ppu.layer[layer].data + (tile << 6) + ((curline % 8) * 2), (ii >> 1) * 8, 255, hflip, pal, 0); |
| 1286 | | break; |
| 1287 | | } |
| 1288 | | } |
| 1289 | | } |
| 1290 | | |
| 1291 | | logerror("%d : %8X ", layer, addr ); |
| 1292 | | //ui_draw_text( str, 0, 227 ); |
| 1293 | | } |
| 1294 | | |
| 1295 | | static void snes_dbg_draw_all_tiles( running_machine *machine, bitmap_t *bitmap, UINT32 tileaddr, UINT8 bpl, UINT16 pal ) |
| 1296 | | { |
| 1297 | | UINT16 ii, jj, kk; |
| 1298 | | UINT32 addr = tileaddr; |
| 1299 | | |
| 1300 | | for (jj = 0; jj < 32; jj++) |
| 1301 | | { |
| 1302 | | addr = tileaddr + (jj * bpl * 16 * 32); |
| 1303 | | for (kk = 0; kk < 8; kk++) |
| 1304 | | { |
| 1305 | | UINT32 *destline = BITMAP_ADDR32(bitmap, jj * 8 + kk, 0); |
| 1306 | | |
| 1307 | | /* Clear buffers */ |
| 1308 | | memset(scanlines[SNES_MAINSCREEN].buffer, 0, SNES_SCR_WIDTH * 2); |
| 1309 | | memset(scanlines[SNES_MAINSCREEN].zbuf, 0, SNES_SCR_WIDTH * 2); |
| 1310 | | for (ii = 0; ii < 32; ii++) |
| 1311 | | { |
| 1312 | | switch (bpl) |
| 1313 | | { |
| 1314 | | case 1: |
| 1315 | | snes_draw_tile(SNES_MAINSCREEN, 2, 0, addr, ii * 8, 255, 0, pal, 0); |
| 1316 | | break; |
| 1317 | | case 2: |
| 1318 | | snes_draw_tile(SNES_MAINSCREEN, 4, 0, addr, ii * 8, 255, 0, pal, 0); |
| 1319 | | break; |
| 1320 | | case 4: |
| 1321 | | snes_draw_tile(SNES_MAINSCREEN, 8, 0, addr, ii * 8, 255, 0, pal, 0); |
| 1322 | | break; |
| 1323 | | } |
| 1324 | | addr += (bpl * 16); |
| 1325 | | } |
| 1326 | | for (ii = 0; ii < SNES_SCR_WIDTH * 2; ii++) |
| 1327 | | { |
| 1328 | | int pixdata = scanlines[SNES_MAINSCREEN].buffer[ii]; |
| 1329 | | if (pixdata != 200) |
| 1330 | | destline[ii] = machine->pens[pixdata]; |
| 1331 | | } |
| 1332 | | addr -= (32 * (bpl * 16)) - 2; |
| 1333 | | } |
| 1334 | | } |
| 1335 | | |
| 1336 | | logerror(" %8X ", tileaddr ); |
| 1337 | | //ui_draw_text( str, 0, 227 ); |
| 1338 | | } |
| 1339 | | |
| 1340 | 1262 | static UINT8 snes_dbg_video( running_machine *machine, bitmap_t *bitmap, UINT16 curline ) |
| 1341 | 1263 | { |
| 1342 | | UINT16 ii; |
| 1343 | | |
| 1344 | | #define SNES_DBG_HORZ_POS 545 |
| 1345 | | |
| 1346 | 1264 | /* Check if the user has enabled or disabled stuff */ |
| 1347 | 1265 | if (curline == 0) |
| 1348 | 1266 | { |
| r7309 | r7310 | |
| 1363 | 1281 | if (toggles & 0x10) |
| 1364 | 1282 | debug_options.bg_disabled[4] = !debug_options.bg_disabled[4]; |
| 1365 | 1283 | if (toggles & 0x20) |
| 1366 | | debug_options.draw_SNES_SUBSCREEN = !debug_options.draw_SNES_SUBSCREEN; |
| 1284 | debug_options.draw_subscreen = !debug_options.draw_subscreen; |
| 1367 | 1285 | if (toggles & 0x40) |
| 1368 | 1286 | debug_options.bg_disabled[5] = !debug_options.bg_disabled[5]; |
| 1369 | 1287 | if (toggles & 0x80) |
| r7309 | r7310 | |
| 1493 | 1411 | logerror(" X %5d Y %5d", snes_ppu.mode7.origin_x, snes_ppu.mode7.origin_y ); |
| 1494 | 1412 | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1495 | 1413 | } |
| 1496 | | /* Just for testing, draw as many tiles as possible */ |
| 1497 | | { |
| 1498 | | UINT8 adjust = input_port_read(machine, "PAD1H"); |
| 1499 | | UINT8 dip = input_port_read_safe(machine, "DEBUG1", 0); |
| 1500 | | UINT8 inp = input_port_read_safe(machine, "DEBUG3", 0); |
| 1501 | | UINT8 dt = 1 << ((dip & 0x3) - 1); |
| 1502 | | UINT8 dm = 1 << (((dip & 0xc) >> 2) - 1); |
| 1503 | | if (dt) |
| 1504 | | { |
| 1505 | | static INT16 pal = 0; |
| 1506 | | static UINT32 addr = 0; |
| 1507 | | if (curline == 0) |
| 1508 | | { |
| 1509 | | if (adjust & 0x1) addr += (dt * 16); |
| 1510 | | if (adjust & 0x2) addr -= (dt * 16); |
| 1511 | | if (adjust & 0x4) addr += (dt * 16 * 32); |
| 1512 | | if (adjust & 0x8) addr -= (dt * 16 * 32); |
| 1513 | | if (inp & 0x1) pal -= 1; |
| 1514 | | if (inp & 0x2) pal += 1; |
| 1515 | | if (pal < 0) pal = 0; |
| 1516 | | if (pal > 8) pal = 8; |
| 1517 | | for (ii = 0; ii < SNES_SCR_WIDTH; ii++) |
| 1518 | | { |
| 1519 | | scanlines[SNES_MAINSCREEN].buffer[ii] = 0; |
| 1520 | | } |
| 1521 | | snes_dbg_draw_all_tiles(machine, bitmap, addr, dt, pal * 16 ); |
| 1522 | | } |
| 1523 | | return 1; |
| 1524 | | } |
| 1525 | | if (dm) |
| 1526 | | { |
| 1527 | | static UINT32 tmaddr = 0; |
| 1528 | | static INT8 tmbg = 0; |
| 1529 | | UINT32 *destline = BITMAP_ADDR32(bitmap, curline, 0); |
| 1530 | | if (curline == 0) |
| 1531 | | { |
| 1532 | | if (adjust & 0x1) tmaddr += 2; |
| 1533 | | if (adjust & 0x2) tmaddr -= 2; |
| 1534 | | if (adjust & 0x4) tmaddr += 64; |
| 1535 | | if (adjust & 0x8) tmaddr -= 64; |
| 1536 | | if (inp & 0x1) tmbg -= 1; |
| 1537 | | if (inp & 0x2) tmbg += 1; |
| 1538 | | if (tmbg < 0) tmbg = 0; |
| 1539 | | if (tmbg > 3) tmbg = 3; |
| 1540 | | } |
| 1541 | | /* Clear zbuffer */ |
| 1542 | | memset( scanlines[SNES_MAINSCREEN].zbuf, 0, SNES_SCR_WIDTH ); |
| 1543 | | /* Draw back colour */ |
| 1544 | | for (ii = 0; ii < SNES_SCR_WIDTH; ii++) |
| 1545 | | scanlines[SNES_MAINSCREEN].buffer[ii] = machine->pens[0]; |
| 1546 | | snes_dbg_draw_maps(bitmap, tmaddr, dm, curline, tmbg ); |
| 1547 | | for (ii = 0; ii < SNES_SCR_WIDTH; ii++) |
| 1548 | | { |
| 1549 | | int pixdata = scanlines[SNES_MAINSCREEN].buffer[ii]; |
| 1550 | | if (pixdata != 200) |
| 1551 | | destline[ii] = machine->pens[pixdata]; |
| 1552 | | } |
| 1553 | | return 1; |
| 1554 | | } |
| 1555 | | } |
| 1556 | | #if 0 // 2009-08 FP: what was the purpose of these lines? |
| 1557 | | /* Draw some useful information about the back/fixed colours and current bg mode etc. */ |
| 1558 | | *BITMAP_ADDR32(bitmap, curline, SNES_DBG_HORZ_POS - 26) = machine->pens[dbg_mode_colours[(snes_ram[CGWSEL] & 0xc0) >> 6]]; |
| 1559 | | *BITMAP_ADDR32(bitmap, curline, SNES_DBG_HORZ_POS - 24) = machine->pens[dbg_mode_colours[(snes_ram[CGWSEL] & 0x30) >> 4]]; |
| 1560 | | *BITMAP_ADDR32(bitmap, curline, SNES_DBG_HORZ_POS - 22) = machine->pens[dbg_mode_colours[snes_ram[BGMODE] & 0x7]]; |
| 1561 | | *BITMAP_ADDR32(bitmap, curline, SNES_DBG_HORZ_POS - 12) = machine->pens[32767]; |
| 1562 | | *BITMAP_ADDR32(bitmap, curline, SNES_DBG_HORZ_POS - 2 ) = machine->pens[32767]; |
| 1563 | | for (ii = 0; ii < 5; ii++) |
| 1564 | | { |
| 1565 | | *BITMAP_ADDR32(bitmap, curline, SNES_DBG_HORZ_POS - 19 + ii) = snes_cgram[0]; |
| 1566 | | *BITMAP_ADDR32(bitmap, curline, SNES_DBG_HORZ_POS - 9 + ii) = snes_cgram[FIXED_COLOUR]; |
| 1567 | | } |
| 1568 | | /* Draw window positions */ |
| 1569 | | scanlines[SNES_MAINSCREEN].buffer[snes_ram[WH0]] = machine->pens[dbg_mode_colours[0]]; |
| 1570 | | scanlines[SNES_MAINSCREEN].buffer[snes_ram[WH1]] = machine->pens[dbg_mode_colours[0]]; |
| 1571 | | scanlines[SNES_MAINSCREEN].buffer[snes_ram[WH2]] = machine->pens[dbg_mode_colours[2]]; |
| 1572 | | scanlines[SNES_MAINSCREEN].buffer[snes_ram[WH3]] = machine->pens[dbg_mode_colours[2]]; |
| 1573 | | #endif |
| 1414 | |
| 1574 | 1415 | return 0; |
| 1575 | 1416 | } |
| 1576 | 1417 | |