src/mame/video/snes.c
| r7582 | r7583 | |
| 90 | 90 | UINT8 draw_subscreen; |
| 91 | 91 | UINT8 windows_disabled; |
| 92 | 92 | UINT8 transparency_disabled; |
| 93 | UINT8 sprite_reversed; |
| 94 | UINT8 select_oam; |
| 93 | 95 | }; |
| 94 | 96 | static struct DEBUGOPTS debug_options; |
| 95 | 97 | /* red green blue purple yellow cyan grey white */ |
| r7582 | r7583 | |
| 1102 | 1104 | static UINT8 oam_itemlist[32]; |
| 1103 | 1105 | |
| 1104 | 1106 | struct TILELIST { |
| 1105 | | UINT16 x, priority, pal, tileaddr; |
| 1106 | | int hflip; |
| 1107 | INT16 x; |
| 1108 | UINT16 priority, pal, tileaddr; |
| 1109 | int hflip; |
| 1107 | 1110 | }; |
| 1108 | 1111 | |
| 1109 | 1112 | struct TILELIST oam_tilelist[34]; |
| r7582 | r7583 | |
| 1265 | 1268 | /* finally draw the tiles from the tilelist */ |
| 1266 | 1269 | for (i = 0; i < 34; i++) |
| 1267 | 1270 | { |
| 1268 | | if (oam_tilelist[i].tileaddr == 0xffff) |
| 1271 | int tile = i; |
| 1272 | #ifdef SNES_LAYER_DEBUG |
| 1273 | if (debug_options.sprite_reversed) |
| 1274 | tile = 33 - i; |
| 1275 | #endif /* SNES_LAYER_DEBUG */ |
| 1276 | |
| 1277 | if (oam_tilelist[tile].tileaddr == 0xffff) |
| 1269 | 1278 | continue; |
| 1270 | 1279 | |
| 1271 | | priority = table_obj_priority[priority_tbl][oam_tilelist[i].priority]; |
| 1272 | | snes_draw_tile_object(charaddr + oam_tilelist[i].tileaddr, oam_tilelist[i].x, priority, oam_tilelist[i].hflip, oam_tilelist[i].pal); |
| 1280 | priority = table_obj_priority[priority_tbl][oam_tilelist[tile].priority]; |
| 1281 | |
| 1282 | #ifdef SNES_LAYER_DEBUG |
| 1283 | if (debug_options.select_oam) |
| 1284 | { |
| 1285 | int oam_draw = debug_options.select_oam - 1; |
| 1286 | if (oam_draw != oam_tilelist[tile].priority) |
| 1287 | priority = 0; |
| 1288 | } |
| 1289 | #endif /* SNES_LAYER_DEBUG */ |
| 1290 | |
| 1291 | snes_draw_tile_object(charaddr + oam_tilelist[tile].tileaddr, oam_tilelist[tile].x, priority, oam_tilelist[tile].hflip, oam_tilelist[tile].pal); |
| 1273 | 1292 | } |
| 1274 | 1293 | } |
| 1275 | 1294 | |
| r7582 | r7583 | |
| 1675 | 1694 | |
| 1676 | 1695 | if (!debug_options.input_count--) |
| 1677 | 1696 | { |
| 1678 | | UINT8 toggles = input_port_read_safe(machine, "DEBUG2", 0); |
| 1697 | UINT8 toggles = input_port_read_safe(machine, "DEBUG1", 0); |
| 1698 | debug_options.sprite_reversed = BIT(toggles, 7); |
| 1699 | debug_options.select_oam = (toggles & 0x70) >> 4; |
| 1700 | |
| 1701 | toggles = input_port_read_safe(machine, "DEBUG2", 0); |
| 1679 | 1702 | if (BIT(toggles, 0)) |
| 1680 | 1703 | debug_options.bg_disabled[0] = !debug_options.bg_disabled[0]; |
| 1681 | 1704 | if (BIT(toggles, 1)) |
src/mess/drivers/snes.c
| r7582 | r7583 | |
| 295 | 295 | |
| 296 | 296 | |
| 297 | 297 | #ifdef SNES_LAYER_DEBUG |
| 298 | | PORT_START("INTERNAL") |
| 299 | | PORT_CONFNAME( 0x1, 0x1, "Enforce 32 sprites/line" ) |
| 300 | | PORT_CONFSETTING( 0x0, DEF_STR( No ) ) |
| 301 | | PORT_CONFSETTING( 0x1, DEF_STR( Yes ) ) |
| 302 | | |
| 303 | 298 | PORT_START("DEBUG1") |
| 304 | | PORT_CONFNAME( 0x3, 0x0, "Browse tiles" ) |
| 305 | | PORT_CONFSETTING( 0x0, DEF_STR( Off ) ) |
| 306 | | PORT_CONFSETTING( 0x1, "2bpl" ) |
| 307 | | PORT_CONFSETTING( 0x2, "4bpl" ) |
| 308 | | PORT_CONFSETTING( 0x3, "8bpl" ) |
| 309 | | PORT_CONFNAME( 0xc, 0x0, "Browse maps" ) |
| 310 | | PORT_CONFSETTING( 0x0, DEF_STR( Off ) ) |
| 311 | | PORT_CONFSETTING( 0x4, "2bpl" ) |
| 312 | | PORT_CONFSETTING( 0x8, "4bpl" ) |
| 313 | | PORT_CONFSETTING( 0xc, "8bpl" ) |
| 299 | PORT_CONFNAME( 0x70, 0x00, "Select OAM" ) |
| 300 | PORT_CONFSETTING( 0x00, "All" ) |
| 301 | PORT_CONFSETTING( 0x10, "OAM1 only" ) |
| 302 | PORT_CONFSETTING( 0x20, "OAM2 only" ) |
| 303 | PORT_CONFSETTING( 0x30, "OAM3 only" ) |
| 304 | PORT_CONFSETTING( 0x40, "OAM4 only" ) |
| 305 | PORT_CONFNAME( 0x80, 0x00, "Draw sprite in reverse order" ) |
| 306 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 307 | PORT_CONFSETTING( 0x80, DEF_STR( On ) ) |
| 314 | 308 | |
| 315 | 309 | PORT_START("DEBUG2") |
| 316 | 310 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Toggle BG 1") PORT_CODE(KEYCODE_1_PAD) |