src/mame/video/snes.c
| r7512 | r7513 | |
| 113 | 113 | { |
| 114 | 114 | int enable, clip; |
| 115 | 115 | |
| 116 | | UINT16 buffer[(SNES_SCR_WIDTH * 2)]; |
| 117 | | UINT8 priority[(SNES_SCR_WIDTH * 2)]; |
| 118 | | UINT8 layer[(SNES_SCR_WIDTH * 2)]; |
| 119 | | UINT8 blend_exception[(SNES_SCR_WIDTH * 2)]; |
| 116 | UINT16 buffer[SNES_SCR_WIDTH]; |
| 117 | UINT8 priority[SNES_SCR_WIDTH]; |
| 118 | UINT8 layer[SNES_SCR_WIDTH]; |
| 119 | UINT8 blend_exception[SNES_SCR_WIDTH]; |
| 120 | 120 | }; |
| 121 | 121 | |
| 122 | 122 | static struct SCANLINE scanlines[2]; |
| r7512 | r7513 | |
| 158 | 158 | |
| 159 | 159 | if (snes_ppu.sub_add_mode) /* SNES_SUBSCREEN*/ |
| 160 | 160 | { |
| 161 | | if ((snes_ppu.color_modes & 0x80) == 0x00) |
| 161 | if (!BIT(snes_ppu.color_modes, 7) |
| 162 | 162 | { |
| 163 | | /* add */ |
| 163 | /* 0x00 add */ |
| 164 | 164 | r = (*colour & 0x1f) + (scanlines[SNES_SUBSCREEN].buffer[offset] & 0x1f); |
| 165 | 165 | g = ((*colour & 0x3e0) >> 5) + ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x3e0) >> 5); |
| 166 | 166 | b = ((*colour & 0x7c00) >> 10) + ((scanlines[SNES_SUBSCREEN].buffer[offset] & 0x7c00) >> 10); |
| r7512 | r7513 | |
| 177 | 177 | if (b > 0x1f) b = 0; |
| 178 | 178 | } |
| 179 | 179 | /* only halve if the color is not the back colour */ |
| 180 | | if ((snes_ppu.color_modes & 0x40) && (scanlines[SNES_SUBSCREEN].buffer[offset] != snes_cgram[FIXED_COLOUR])) |
| 180 | if (BIT(snes_ppu.color_modes, 6) && (scanlines[SNES_SUBSCREEN].buffer[offset] != snes_cgram[FIXED_COLOUR])) |
| 181 | 181 | { |
| 182 | 182 | r >>= 1; |
| 183 | 183 | g >>= 1; |
| r7512 | r7513 | |
| 186 | 186 | } |
| 187 | 187 | else /* Fixed colour */ |
| 188 | 188 | { |
| 189 | | if ((snes_ppu.color_modes & 0x80) == 0x00) |
| 189 | if (!BIT(snes_ppu.color_modes, 7) |
| 190 | 190 | { |
| 191 | | /* add */ |
| 191 | /* 0x00 add */ |
| 192 | 192 | r = (*colour & 0x1f) + (snes_cgram[FIXED_COLOUR] & 0x1f); |
| 193 | 193 | g = ((*colour & 0x3e0) >> 5) + ((snes_cgram[FIXED_COLOUR] & 0x3e0) >> 5); |
| 194 | 194 | b = ((*colour & 0x7c00) >> 10) + ((snes_cgram[FIXED_COLOUR] & 0x7c00) >> 10); |
| r7512 | r7513 | |
| 205 | 205 | if (b > 0x1f) b = 0; |
| 206 | 206 | } |
| 207 | 207 | /* halve if necessary */ |
| 208 | | if (snes_ppu.color_modes & 0x40) |
| 208 | if (BIT(snes_ppu.color_modes, 6)) |
| 209 | 209 | { |
| 210 | 210 | r >>= 1; |
| 211 | 211 | g >>= 1; |
| r7512 | r7513 | |
| 271 | 271 | { |
| 272 | 272 | if (scanlines[SNES_MAINSCREEN].enable) |
| 273 | 273 | { |
| 274 | UINT8 clr = colour; |
| 274 | 275 | |
| 275 | 276 | #ifdef SNES_LAYER_DEBUG |
| 276 | 277 | if (!debug_options.windows_disabled) |
| 277 | 278 | #endif /* SNES_LAYER_DEBUG */ |
| 278 | 279 | /* Clip to windows */ |
| 279 | 280 | if (scanlines[SNES_MAINSCREEN].clip) |
| 280 | | colour &= snes_ppu.clipmasks[layer][ii]; |
| 281 | clr &= snes_ppu.clipmasks[layer][ii]; |
| 281 | 282 | |
| 282 | 283 | /* Only draw if we have a colour (0 == transparent) */ |
| 283 | | if (colour) |
| 284 | if (clr) |
| 284 | 285 | { |
| 285 | 286 | if ((scanlines[SNES_MAINSCREEN].priority[ii] <= priority) && (ii >= 0)) |
| 286 | 287 | { |
| 287 | 288 | if (direct_colors) |
| 288 | 289 | { |
| 289 | 290 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ |
| 290 | | c = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); |
| 291 | c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); |
| 291 | 292 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); |
| 292 | 293 | } |
| 293 | 294 | else |
| 294 | | c = snes_cgram[pal + colour]; |
| 295 | c = snes_cgram[pal + clr]; |
| 295 | 296 | |
| 296 | 297 | if (snes_ppu.layer[SNES_MAINSCREEN].mosaic_enabled) // handle horizontal mosaic |
| 297 | 298 | { |
| r7512 | r7513 | |
| 319 | 320 | |
| 320 | 321 | if (scanlines[SNES_SUBSCREEN].enable) |
| 321 | 322 | { |
| 323 | UINT8 clr = colour; |
| 324 | |
| 322 | 325 | #ifdef SNES_LAYER_DEBUG |
| 323 | 326 | if (!debug_options.windows_disabled) |
| 324 | 327 | #endif /* SNES_LAYER_DEBUG */ |
| 325 | 328 | /* Clip to windows */ |
| 326 | 329 | if (scanlines[SNES_SUBSCREEN].clip) |
| 327 | | colour &= snes_ppu.clipmasks[layer][ii]; |
| 330 | clr &= snes_ppu.clipmasks[layer][ii]; |
| 328 | 331 | |
| 329 | 332 | /* Only draw if we have a colour (0 == transparent) */ |
| 330 | | if (colour) |
| 333 | if (clr) |
| 331 | 334 | { |
| 332 | 335 | if ((scanlines[SNES_SUBSCREEN].priority[ii] <= priority) && (ii >= 0)) |
| 333 | 336 | { |
| 334 | 337 | if (direct_colors) |
| 335 | 338 | { |
| 336 | 339 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ |
| 337 | | c = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); |
| 340 | c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); |
| 338 | 341 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); |
| 339 | 342 | } |
| 340 | 343 | else |
| 341 | | c = snes_cgram[pal + colour]; |
| 344 | c = snes_cgram[pal + clr]; |
| 342 | 345 | |
| 343 | 346 | if (snes_ppu.layer[SNES_SUBSCREEN].mosaic_enabled) // handle horizontal mosaic |
| 344 | 347 | { |
| r7512 | r7513 | |
| 364 | 367 | } |
| 365 | 368 | } |
| 366 | 369 | } |
| 367 | | |
| 368 | 370 | else /* hires */ |
| 369 | 371 | { |
| 372 | if (ii >= 0 && (ii & 1) && scanlines[SNES_MAINSCREEN].enable) |
| 373 | { |
| 374 | if ((scanlines[SNES_MAINSCREEN].priority[ii >> 1] <= priority)) |
| 375 | { |
| 376 | UINT8 clr = colour; |
| 377 | |
| 370 | 378 | #ifdef SNES_LAYER_DEBUG |
| 371 | | if (!debug_options.windows_disabled) |
| 379 | if (!debug_options.windows_disabled) |
| 372 | 380 | #endif /* SNES_LAYER_DEBUG */ |
| 373 | | /* Clip to windows */ |
| 374 | | if (scanlines[SNES_MAINSCREEN].clip) |
| 375 | | colour &= snes_ppu.clipmasks[layer][ii >> hires]; |
| 381 | /* Clip to windows */ |
| 382 | if (scanlines[SNES_MAINSCREEN].clip) |
| 383 | clr &= snes_ppu.clipmasks[layer][ii >> 1]; |
| 376 | 384 | |
| 377 | | /* Only draw if we have a colour (0 == transparent) */ |
| 378 | | if (colour) |
| 379 | | { |
| 380 | | if ((scanlines[SNES_MAINSCREEN].priority[ii >> hires] <= priority) && (ii >= 0)) |
| 381 | | { |
| 382 | | if (direct_colors) |
| 385 | /* Only draw if we have a colour (0 == transparent) */ |
| 386 | if (clr) |
| 383 | 387 | { |
| 384 | | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ |
| 385 | | c = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); |
| 386 | | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); |
| 387 | | } |
| 388 | | else |
| 389 | | c = snes_cgram[pal + colour]; |
| 388 | if (direct_colors) |
| 389 | { |
| 390 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ |
| 391 | c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); |
| 392 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); |
| 393 | } |
| 394 | else |
| 395 | c = snes_cgram[pal + clr]; |
| 390 | 396 | |
| 391 | | if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic |
| 392 | | { |
| 393 | | int x_mos; |
| 397 | if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic |
| 398 | { |
| 399 | int x_mos; |
| 394 | 400 | |
| 395 | | //TODO: 512 modes has the h values doubled. |
| 396 | | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) |
| 397 | | { |
| 398 | | if ((ii & 1) && scanlines[SNES_MAINSCREEN].enable) |
| 401 | //TODO: 512 modes has the h values doubled. |
| 402 | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) |
| 399 | 403 | { |
| 400 | 404 | scanlines[SNES_MAINSCREEN].buffer[(ii + x_mos) >> 1] = c; |
| 401 | 405 | scanlines[SNES_MAINSCREEN].priority[(ii + x_mos) >> 1] = priority; |
| 402 | 406 | scanlines[SNES_MAINSCREEN].layer[(ii + x_mos) >> 1] = layer; |
| 403 | 407 | } |
| 404 | | else if (scanlines[SNES_SUBSCREEN].enable) |
| 408 | ii += x_mos - 1; |
| 409 | } |
| 410 | else |
| 411 | { |
| 412 | scanlines[SNES_MAINSCREEN].buffer[ii >> 1] = c; |
| 413 | scanlines[SNES_MAINSCREEN].priority[ii >> 1] = priority; |
| 414 | scanlines[SNES_MAINSCREEN].layer[ii >> 1] = layer; |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | if (ii >= 0 && !(ii & 1) && scanlines[SNES_SUBSCREEN].enable) |
| 421 | { |
| 422 | if ((scanlines[SNES_SUBSCREEN].priority[ii >> 1] <= priority)) |
| 423 | { |
| 424 | UINT8 clr = colour; |
| 425 | |
| 426 | #ifdef SNES_LAYER_DEBUG |
| 427 | if (!debug_options.windows_disabled) |
| 428 | #endif /* SNES_LAYER_DEBUG */ |
| 429 | /* Clip to windows */ |
| 430 | if (scanlines[SNES_SUBSCREEN].clip) |
| 431 | clr &= snes_ppu.clipmasks[layer][ii >> 1]; |
| 432 | |
| 433 | /* Only draw if we have a colour (0 == transparent) */ |
| 434 | if (clr) |
| 435 | { |
| 436 | if (direct_colors) |
| 437 | { |
| 438 | /* format is 0 | BBb00 | GGGg0 | RRRr0, HW confirms that the data is zero padded. */ |
| 439 | c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); |
| 440 | c |= ((pal & 0x04) >> 1) | ((pal & 0x08) << 3) | ((pal & 0x10) << 8); |
| 441 | } |
| 442 | else |
| 443 | c = snes_cgram[pal + clr]; |
| 444 | |
| 445 | if (snes_ppu.layer[layer].mosaic_enabled) // handle horizontal mosaic |
| 446 | { |
| 447 | int x_mos; |
| 448 | |
| 449 | //TODO: 512 modes has the h values doubled. |
| 450 | for (x_mos = 0; x_mos < (snes_ppu.mosaic_size + 1) ; x_mos++) |
| 405 | 451 | { |
| 406 | 452 | scanlines[SNES_SUBSCREEN].buffer[(ii + x_mos) >> 1] = c; |
| 407 | 453 | scanlines[SNES_SUBSCREEN].priority[(ii + x_mos) >> 1] = priority; |
| 408 | 454 | scanlines[SNES_SUBSCREEN].layer[(ii + x_mos) >> 1] = layer; |
| 409 | 455 | } |
| 456 | ii += x_mos - 1; |
| 410 | 457 | } |
| 411 | | ii += x_mos - 1; |
| 412 | | } |
| 413 | | else |
| 414 | | { |
| 415 | | if ((ii & 1) && scanlines[SNES_MAINSCREEN].enable) |
| 458 | else |
| 416 | 459 | { |
| 417 | | scanlines[SNES_MAINSCREEN].buffer[ii >> 1] = c; |
| 418 | | scanlines[SNES_MAINSCREEN].priority[ii >> 1] = priority; |
| 419 | | scanlines[SNES_MAINSCREEN].layer[ii >> 1] = layer; |
| 420 | | } |
| 421 | | else if (scanlines[SNES_SUBSCREEN].enable) |
| 422 | | { |
| 423 | 460 | scanlines[SNES_SUBSCREEN].buffer[ii >> 1] = c; |
| 424 | 461 | scanlines[SNES_SUBSCREEN].priority[ii >> 1] = priority; |
| 425 | 462 | scanlines[SNES_SUBSCREEN].layer[ii >> 1] = layer; |
| r7512 | r7513 | |
| 463 | 500 | { |
| 464 | 501 | UINT8 mask, plane[4]; |
| 465 | 502 | UINT16 c; |
| 466 | | INT16 ii; |
| 503 | INT16 ii, jj; |
| 467 | 504 | |
| 468 | 505 | plane[0] = snes_vram[tileaddr]; |
| 469 | 506 | plane[1] = snes_vram[tileaddr + 1]; |
| r7512 | r7513 | |
| 477 | 514 | |
| 478 | 515 | for (ii = x; ii < (x + 8); ii++) |
| 479 | 516 | { |
| 480 | | UINT8 colour; |
| 517 | UINT8 colour = 0; |
| 481 | 518 | if (flip) |
| 482 | 519 | { |
| 483 | | colour = (plane[0] & mask ? 1 : 0) | (plane[1] & mask ? 2 : 0) | |
| 484 | | (plane[2] & mask ? 4 : 0) | (plane[3] & mask ? 8 : 0); |
| 520 | for (jj = 0; jj < 4; jj++) |
| 521 | colour |= plane[jj] & mask ? (1 << jj) : 0; |
| 522 | |
| 485 | 523 | mask <<= 1; |
| 486 | 524 | } |
| 487 | 525 | else |
| 488 | 526 | { |
| 489 | | colour = (plane[0] & mask ? 1 : 0) | (plane[1] & mask ? 2 : 0) | |
| 490 | | (plane[2] & mask ? 4 : 0) | (plane[3] & mask ? 8 : 0); |
| 527 | for (jj = 0; jj < 4; jj++) |
| 528 | colour |= plane[jj] & mask ? (1 << jj) : 0; |
| 529 | |
| 491 | 530 | mask >>= 1; |
| 492 | 531 | } |
| 493 | 532 | |
| 494 | 533 | if (scanlines[SNES_MAINSCREEN].enable) |
| 495 | 534 | { |
| 535 | UINT8 clr = colour; |
| 496 | 536 | |
| 497 | 537 | #ifdef SNES_LAYER_DEBUG |
| 498 | 538 | if (!debug_options.windows_disabled) |
| 499 | 539 | #endif /* SNES_LAYER_DEBUG */ |
| 500 | 540 | /* Clip to windows */ |
| 501 | 541 | if (scanlines[SNES_MAINSCREEN].clip) |
| 502 | | colour &= snes_ppu.clipmasks[SNES_OAM][ii]; |
| 542 | clr &= snes_ppu.clipmasks[SNES_OAM][ii]; |
| 503 | 543 | |
| 504 | 544 | /* Only draw if we have a colour (0 == transparent) */ |
| 505 | | if (colour) |
| 545 | if (clr) |
| 506 | 546 | { |
| 507 | 547 | if ((scanlines[SNES_MAINSCREEN].priority[ii] <= priority) && (ii >= 0)) |
| 508 | 548 | { |
| 509 | | c = snes_cgram[pal + colour]; |
| 549 | c = snes_cgram[pal + clr]; |
| 510 | 550 | |
| 511 | 551 | scanlines[SNES_MAINSCREEN].buffer[ii] = c; |
| 512 | 552 | scanlines[SNES_MAINSCREEN].priority[ii] = priority; |
| r7512 | r7513 | |
| 518 | 558 | |
| 519 | 559 | if (scanlines[SNES_SUBSCREEN].enable) |
| 520 | 560 | { |
| 561 | UINT8 clr = colour; |
| 521 | 562 | |
| 522 | 563 | #ifdef SNES_LAYER_DEBUG |
| 523 | 564 | if (!debug_options.windows_disabled) |
| 524 | 565 | #endif /* SNES_LAYER_DEBUG */ |
| 525 | 566 | /* Clip to windows */ |
| 526 | 567 | if (scanlines[SNES_SUBSCREEN].clip) |
| 527 | | colour &= snes_ppu.clipmasks[SNES_OAM][ii]; |
| 568 | clr &= snes_ppu.clipmasks[SNES_OAM][ii]; |
| 528 | 569 | |
| 529 | 570 | /* Only draw if we have a colour (0 == transparent) */ |
| 530 | | if (colour) |
| 571 | if (clr) |
| 531 | 572 | { |
| 532 | 573 | if ((scanlines[SNES_SUBSCREEN].priority[ii] <= priority) && (ii >= 0)) |
| 533 | 574 | { |
| 534 | | c = snes_cgram[pal + colour]; |
| 575 | c = snes_cgram[pal + clr]; |
| 535 | 576 | |
| 536 | 577 | scanlines[SNES_SUBSCREEN].buffer[ii] = c; |
| 537 | 578 | scanlines[SNES_SUBSCREEN].priority[ii] = priority; |
| r7512 | r7513 | |
| 544 | 585 | } |
| 545 | 586 | |
| 546 | 587 | /********************************************* |
| 547 | | * snes_update_line() |
| 588 | * snes_get_tmap_addr() |
| 548 | 589 | * |
| 549 | | * Update an entire line of tiles. |
| 590 | * Find the address in VRAM of the tile (x,y) |
| 550 | 591 | *********************************************/ |
| 551 | 592 | |
| 552 | | INLINE UINT32 snes_get_tmap( UINT8 layer, UINT8 tile_size, UINT32 base, UINT32 x, UINT32 y ) |
| 593 | INLINE UINT32 snes_get_tmap_addr( UINT8 layer, UINT8 tile_size, UINT32 base, UINT32 x, UINT32 y ) |
| 553 | 594 | { |
| 554 | 595 | UINT32 res = base; |
| 555 | 596 | x >>= (3 + tile_size); |
| r7512 | r7513 | |
| 566 | 607 | return res; |
| 567 | 608 | } |
| 568 | 609 | |
| 610 | /********************************************* |
| 611 | * snes_update_line() |
| 612 | * |
| 613 | * Update an entire line of tiles. |
| 614 | *********************************************/ |
| 615 | |
| 569 | 616 | INLINE void snes_update_line( UINT8 color_depth, UINT8 hires, UINT8 priority_a, UINT8 priority_b, UINT8 layer, UINT16 curline, UINT8 offset_per_tile, UINT8 direct_colors ) |
| 570 | 617 | { |
| 571 | 618 | UINT32 tmap, tile, xoff, yoff; |
| 619 | UINT32 charaddr; |
| 572 | 620 | UINT16 ii = 0, vflip, hflip, pal; |
| 573 | 621 | INT8 tile_line; |
| 574 | 622 | UINT8 priority; |
| 575 | 623 | /* scrolling */ |
| 576 | | UINT32 charaddr; |
| 577 | | UINT16 vscroll, hscroll; |
| 578 | 624 | UINT16 opt_bit = (layer == SNES_BG1) ? 13 : (layer == SNES_BG2) ? 14 : 0; |
| 579 | 625 | UINT8 vshift, hshift, tile_size; |
| 580 | 626 | /* variables depending on color_depth */ |
| 581 | 627 | UINT8 color_shift = 0; |
| 582 | 628 | UINT8 color_planes = 2; |
| 583 | 629 | UINT8 tile_divider = 1; |
| 630 | UINT32 addr; |
| 631 | UINT16 tilemap; |
| 584 | 632 | |
| 585 | 633 | #ifdef SNES_LAYER_DEBUG |
| 586 | 634 | if (debug_options.bg_disabled[layer]) |
| r7512 | r7513 | |
| 606 | 654 | tile_size = snes_ppu.layer[layer].tile_size; |
| 607 | 655 | |
| 608 | 656 | /* Find scroll info */ |
| 609 | | hscroll = (snes_ppu.layer[layer].hoffs & 0x3ff) >> (3 + tile_size); |
| 610 | | hshift = snes_ppu.layer[layer].hoffs & ((8 << tile_size) - 1); |
| 611 | | vscroll = ((snes_ppu.layer[layer].voffs & 0x3ff) + curline) >> (3 + tile_size); |
| 612 | | vshift = ((snes_ppu.layer[layer].voffs & 0x3ff) + curline) & ((8 << tile_size) - 1); |
| 613 | | |
| 614 | 657 | xoff = snes_ppu.layer[layer].hoffs; |
| 615 | 658 | yoff = snes_ppu.layer[layer].voffs; |
| 659 | hshift = xoff & ((8 << tile_size) - 1); |
| 660 | vshift = (yoff + curline) & ((8 << tile_size) - 1); |
| 616 | 661 | |
| 617 | 662 | /* figure out which line to draw */ |
| 618 | 663 | if (vshift > ((8 << tile_size) - 1)) /* scrolled into the next tile */ |
| 619 | | { |
| 620 | | vscroll++; /* pretend we scrolled by 1 tile line */ |
| 621 | 664 | vshift -= (8 << tile_size); |
| 622 | | } |
| 623 | | if (vscroll >= 128) |
| 624 | | vscroll -= 128; |
| 625 | 665 | |
| 626 | 666 | /* Jump to base map address */ |
| 627 | 667 | tmap = snes_ppu.layer[layer].tilemap << 9; |
| r7512 | r7513 | |
| 649 | 689 | |
| 650 | 690 | while (ii < 256) |
| 651 | 691 | { |
| 652 | | /* |
| 653 | | Tilemap format |
| 654 | | vhopppcc cccccccc |
| 655 | | |
| 656 | | v/h = Vertical/Horizontal flip this tile. |
| 657 | | o = Tile priority. |
| 658 | | ppp = Tile palette. The number of entries in the palette depends on the Mode and the BG. |
| 659 | | cccccccccc = Tile number. |
| 660 | | */ |
| 661 | | |
| 662 | 692 | // determine the horizontal position (Bishojo Janshi Suchi Pai & Desert Figther have tile_size & hires == 1) |
| 663 | 693 | UINT32 xpos = xoff + (ii << (tile_size * hires)); |
| 664 | 694 | UINT32 ypos = yoff + curline; |
| r7512 | r7513 | |
| 675 | 705 | { |
| 676 | 706 | case SNES_OPT_MODE2: |
| 677 | 707 | case SNES_OPT_MODE6: |
| 678 | | haddr = snes_get_tmap(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); |
| 679 | | vaddr = snes_get_tmap(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff) + 8); |
| 708 | haddr = snes_get_tmap_addr(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); |
| 709 | vaddr = snes_get_tmap_addr(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff) + 8); |
| 680 | 710 | hval = snes_vram[haddr] | (snes_vram[haddr + 1] << 8); |
| 681 | 711 | vval = snes_vram[vaddr] | (snes_vram[vaddr + 1] << 8); |
| 682 | 712 | if (BIT(hval, opt_bit)) |
| r7512 | r7513 | |
| 685 | 715 | ypos = curline + vval; |
| 686 | 716 | break; |
| 687 | 717 | case SNES_OPT_MODE4: |
| 688 | | haddr = snes_get_tmap(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); |
| 718 | haddr = snes_get_tmap_addr(SNES_BG3, snes_ppu.layer[SNES_BG3].tile_size, snes_ppu.layer[SNES_BG3].tilemap << 9, (opt_x - 8) + ((snes_ppu.layer[SNES_BG3].hoffs & 0x3ff) & ~7), (snes_ppu.layer[SNES_BG3].voffs & 0x3ff)); |
| 689 | 719 | hval = snes_vram[haddr] | (snes_vram[haddr + 1] << 8); |
| 690 | 720 | if (BIT(hval, opt_bit)) |
| 691 | 721 | { |
| r7512 | r7513 | |
| 700 | 730 | } |
| 701 | 731 | } |
| 702 | 732 | |
| 703 | | UINT32 addr = snes_get_tmap(layer, tile_size, tmap, xpos, ypos); |
| 704 | | UINT16 tilemap = snes_vram[addr] | (snes_vram[addr + 1] << 8); |
| 733 | addr = snes_get_tmap_addr(layer, tile_size, tmap, xpos, ypos); |
| 734 | |
| 735 | /* |
| 736 | Tilemap format |
| 737 | vhopppcc cccccccc |
| 738 | |
| 739 | v/h = Vertical/Horizontal flip this tile. |
| 740 | o = Tile priority. |
| 741 | ppp = Tile palette. The number of entries in the palette depends on the Mode and the BG. |
| 742 | cccccccccc = Tile number. |
| 743 | */ |
| 744 | tilemap = snes_vram[addr] | (snes_vram[addr + 1] << 8); |
| 705 | 745 | vflip = BIT(tilemap, 15); |
| 706 | 746 | hflip = BIT(tilemap, 14); |
| 707 | 747 | priority = BIT(tilemap, 13) ? priority_b : priority_a; |
| r7512 | r7513 | |
| 779 | 819 | UINT8 priority = priority_a; |
| 780 | 820 | UINT8 colour = 0; |
| 781 | 821 | UINT16 *mosaic_x, *mosaic_y; |
| 822 | UINT16 c; |
| 782 | 823 | |
| 783 | 824 | #ifdef SNES_LAYER_DEBUG |
| 784 | 825 | if (debug_options.bg_disabled[layer]) |
| r7512 | r7513 | |
| 889 | 930 | |
| 890 | 931 | if (scanlines[SNES_MAINSCREEN].enable) |
| 891 | 932 | { |
| 933 | UINT8 clr = colour; |
| 934 | |
| 892 | 935 | if (scanlines[SNES_MAINSCREEN].clip) |
| 893 | | colour &= snes_ppu.clipmasks[layer][xpos]; |
| 936 | clr &= snes_ppu.clipmasks[layer][xpos]; |
| 894 | 937 | |
| 895 | 938 | /* Draw pixel if appropriate */ |
| 896 | | if (scanlines[SNES_MAINSCREEN].priority[xpos] <= priority && colour > 0) |
| 939 | if (scanlines[SNES_MAINSCREEN].priority[xpos] <= priority && clr > 0) |
| 897 | 940 | { |
| 898 | | UINT16 clr; |
| 899 | 941 | /* Direct select, but only outside EXTBG! */ |
| 900 | 942 | if (snes_ppu.direct_color && layer == 0) |
| 901 | 943 | { |
| 902 | 944 | /* 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded. */ |
| 903 | | clr = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); |
| 945 | c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); |
| 904 | 946 | } |
| 905 | 947 | else |
| 906 | | clr = snes_cgram[colour]; |
| 948 | c = snes_cgram[clr]; |
| 907 | 949 | |
| 908 | | scanlines[SNES_MAINSCREEN].buffer[xpos] = clr; |
| 950 | scanlines[SNES_MAINSCREEN].buffer[xpos] = c; |
| 909 | 951 | scanlines[SNES_MAINSCREEN].priority[xpos] = priority; |
| 910 | 952 | scanlines[SNES_MAINSCREEN].layer[xpos] = layer; |
| 911 | 953 | } |
| r7512 | r7513 | |
| 913 | 955 | |
| 914 | 956 | if (scanlines[SNES_SUBSCREEN].enable) |
| 915 | 957 | { |
| 958 | UINT8 clr = colour; |
| 959 | |
| 916 | 960 | if (scanlines[SNES_SUBSCREEN].clip) |
| 917 | | colour &= snes_ppu.clipmasks[layer][xpos]; |
| 961 | clr &= snes_ppu.clipmasks[layer][xpos]; |
| 918 | 962 | |
| 919 | 963 | /* Draw pixel if appropriate */ |
| 920 | | if (scanlines[SNES_SUBSCREEN].priority[xpos] <= priority && colour > 0) |
| 964 | if (scanlines[SNES_SUBSCREEN].priority[xpos] <= priority && clr > 0) |
| 921 | 965 | { |
| 922 | | UINT16 clr; |
| 923 | 966 | /* Direct select, but only outside EXTBG! */ |
| 924 | 967 | if (snes_ppu.direct_color && layer == 0) |
| 925 | 968 | { |
| 926 | 969 | /* 0 | BB000 | GGG00 | RRR00, HW confirms that the data is zero padded. */ |
| 927 | | clr = ((colour & 0x07) << 2) | ((colour & 0x38) << 4) | ((colour & 0xc0) << 7); |
| 970 | c = ((clr & 0x07) << 2) | ((clr & 0x38) << 4) | ((clr & 0xc0) << 7); |
| 928 | 971 | } |
| 929 | 972 | else |
| 930 | | clr = snes_cgram[colour]; |
| 973 | c = snes_cgram[clr]; |
| 931 | 974 | |
| 932 | | scanlines[SNES_SUBSCREEN].buffer[xpos] = clr; |
| 975 | scanlines[SNES_SUBSCREEN].buffer[xpos] = c; |
| 933 | 976 | scanlines[SNES_SUBSCREEN].priority[xpos] = priority; |
| 934 | 977 | scanlines[SNES_SUBSCREEN].layer[xpos] = layer; |
| 935 | 978 | } |
| r7512 | r7513 | |
| 1240 | 1283 | |
| 1241 | 1284 | snes_ppu.update_windows = 0; /* reset the flag */ |
| 1242 | 1285 | |
| 1243 | | for (ii = 0; ii < SNES_SCR_WIDTH + 8; ii++) |
| 1286 | for (ii = 0; ii < SNES_SCR_WIDTH; ii++) |
| 1244 | 1287 | { |
| 1245 | 1288 | /* update bg 1, 2, 3, 4, obj & color windows */ |
| 1246 | 1289 | /* jj = layer */ |
| r7512 | r7513 | |
| 1343 | 1386 | snes_update_offsets(); |
| 1344 | 1387 | |
| 1345 | 1388 | /* Clear priority */ |
| 1346 | | memset(scanlines[SNES_MAINSCREEN].priority, 0, SNES_SCR_WIDTH * 2); |
| 1347 | | memset(scanlines[SNES_SUBSCREEN].priority, 0, SNES_SCR_WIDTH * 2); |
| 1389 | memset(scanlines[SNES_MAINSCREEN].priority, 0, SNES_SCR_WIDTH); |
| 1390 | memset(scanlines[SNES_SUBSCREEN].priority, 0, SNES_SCR_WIDTH); |
| 1348 | 1391 | |
| 1349 | 1392 | /* Clear layers */ |
| 1350 | | memset(scanlines[SNES_MAINSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH * 2); |
| 1351 | | memset(scanlines[SNES_SUBSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH * 2); |
| 1393 | memset(scanlines[SNES_MAINSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH); |
| 1394 | memset(scanlines[SNES_SUBSCREEN].layer, SNES_COLOR, SNES_SCR_WIDTH); |
| 1352 | 1395 | |
| 1353 | 1396 | /* Clear blend_exception (only used for OAM) */ |
| 1354 | | memset(scanlines[SNES_MAINSCREEN].blend_exception, 0, SNES_SCR_WIDTH * 2); |
| 1355 | | memset(scanlines[SNES_SUBSCREEN].blend_exception, 0, SNES_SCR_WIDTH * 2); |
| 1397 | memset(scanlines[SNES_MAINSCREEN].blend_exception, 0, SNES_SCR_WIDTH); |
| 1398 | memset(scanlines[SNES_SUBSCREEN].blend_exception, 0, SNES_SCR_WIDTH); |
| 1356 | 1399 | |
| 1357 | 1400 | /* Draw back colour */ |
| 1358 | | for (ii = 0; ii < SNES_SCR_WIDTH * 2; ii++) |
| 1401 | for (ii = 0; ii < SNES_SCR_WIDTH; ii++) |
| 1359 | 1402 | { |
| 1360 | 1403 | if (snes_ppu.mode == 5 || snes_ppu.mode == 6) |
| 1361 | 1404 | scanlines[SNES_SUBSCREEN].buffer[ii] = snes_cgram[0]; |
| 1362 | 1405 | else |
| 1363 | 1406 | scanlines[SNES_SUBSCREEN].buffer[ii] = snes_cgram[FIXED_COLOUR]; |
| 1364 | 1407 | |
| 1365 | | /* Draw back colour */ |
| 1366 | 1408 | scanlines[SNES_MAINSCREEN].buffer[ii] = snes_cgram[0]; |
| 1367 | 1409 | } |
| 1368 | 1410 | |
| r7512 | r7513 | |
| 1386 | 1428 | /* Phew! Draw the line to screen */ |
| 1387 | 1429 | fade = snes_ppu.screen_brightness; |
| 1388 | 1430 | |
| 1389 | | for (x = 0; x < SNES_SCR_WIDTH * 2; x++) |
| 1431 | for (x = 0; x < SNES_SCR_WIDTH; x++) |
| 1390 | 1432 | { |
| 1391 | 1433 | int r, g, b, hires; |
| 1392 | 1434 | UINT16 temp_col; |
| r7512 | r7513 | |
| 1411 | 1453 | c = scanlines[SNES_SUBSCREEN].buffer[x]; |
| 1412 | 1454 | scanlines[SNES_SUBSCREEN].buffer[x] = temp_col; |
| 1413 | 1455 | |
| 1414 | | if (!scanlines[SNES_SUBSCREEN].blend_exception[x] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) |
| 1456 | if (!scanlines[SNES_MAINSCREEN].blend_exception[x] && snes_ppu.layer[scanlines[SNES_MAINSCREEN].layer[x]].color_math) |
| 1415 | 1457 | snes_draw_blend(x, &c, snes_ppu.sub_color_mask, snes_ppu.main_color_mask); |
| 1416 | 1458 | |
| 1417 | 1459 | r = ((c & 0x1f) * fade) >> 4; |
| r7512 | r7513 | |
| 1460 | 1502 | if (!debug_options.input_count--) |
| 1461 | 1503 | { |
| 1462 | 1504 | UINT8 toggles = input_port_read_safe(machine, "DEBUG2", 0); |
| 1463 | | if (toggles & 0x01) |
| 1505 | if (BIT(toggles, 0)) |
| 1464 | 1506 | debug_options.bg_disabled[0] = !debug_options.bg_disabled[0]; |
| 1465 | | if (toggles & 0x02) |
| 1507 | if (BIT(toggles, 1)) |
| 1466 | 1508 | debug_options.bg_disabled[1] = !debug_options.bg_disabled[1]; |
| 1467 | | if (toggles & 0x04) |
| 1509 | if (BIT(toggles, 2)) |
| 1468 | 1510 | debug_options.bg_disabled[2] = !debug_options.bg_disabled[2]; |
| 1469 | | if (toggles & 0x08) |
| 1511 | if (BIT(toggles, 3)) |
| 1470 | 1512 | debug_options.bg_disabled[3] = !debug_options.bg_disabled[3]; |
| 1471 | | if (toggles & 0x10) |
| 1513 | if (BIT(toggles, 4)) |
| 1472 | 1514 | debug_options.bg_disabled[4] = !debug_options.bg_disabled[4]; |
| 1473 | | if (toggles & 0x20) |
| 1515 | if (BIT(toggles, 5)) |
| 1474 | 1516 | debug_options.draw_subscreen = !debug_options.draw_subscreen; |
| 1475 | | if (toggles & 0x40) |
| 1517 | if (BIT(toggles, 6)) |
| 1476 | 1518 | debug_options.bg_disabled[5] = !debug_options.bg_disabled[5]; |
| 1477 | | if (toggles & 0x80) |
| 1519 | if (BIT(toggles, 7)) |
| 1478 | 1520 | debug_options.windows_disabled = !debug_options.windows_disabled; |
| 1479 | 1521 | toggles = input_port_read_safe(machine, "DEBUG4", 0); |
| 1480 | | if (toggles & 0x01) |
| 1522 | if (BIT(toggles, 0)) |
| 1481 | 1523 | debug_options.mode_disabled[0] = !debug_options.mode_disabled[0]; |
| 1482 | | if (toggles & 0x02) |
| 1524 | if (BIT(toggles, 1)) |
| 1483 | 1525 | debug_options.mode_disabled[1] = !debug_options.mode_disabled[1]; |
| 1484 | | if (toggles & 0x04) |
| 1526 | if (BIT(toggles, 2)) |
| 1485 | 1527 | debug_options.mode_disabled[2] = !debug_options.mode_disabled[2]; |
| 1486 | | if (toggles & 0x08) |
| 1528 | if (BIT(toggles, 3)) |
| 1487 | 1529 | debug_options.mode_disabled[3] = !debug_options.mode_disabled[3]; |
| 1488 | | if (toggles & 0x10) |
| 1530 | if (BIT(toggles, 4)) |
| 1489 | 1531 | debug_options.mode_disabled[4] = !debug_options.mode_disabled[4]; |
| 1490 | | if (toggles & 0x20) |
| 1532 | if (BIT(toggles, 5)) |
| 1491 | 1533 | debug_options.mode_disabled[5] = !debug_options.mode_disabled[5]; |
| 1492 | | if (toggles & 0x40) |
| 1534 | if (BIT(toggles, 6)) |
| 1493 | 1535 | debug_options.mode_disabled[6] = !debug_options.mode_disabled[6]; |
| 1494 | | if (toggles & 0x80) |
| 1536 | if (BIT(toggles, 7)) |
| 1495 | 1537 | debug_options.mode_disabled[7] = !debug_options.mode_disabled[7]; |
| 1496 | 1538 | toggles = input_port_read_safe(machine, "DEBUG3", 0); |
| 1497 | 1539 | if (toggles & 0x4) |
| 1498 | 1540 | debug_options.transparency_disabled = !debug_options.transparency_disabled; |
| 1499 | 1541 | debug_options.input_count = 5; |
| 1500 | 1542 | } |
| 1501 | | /* Display some debug info on the screen */ |
| 1543 | |
| 1502 | 1544 | logerror("%s%s", debug_options.windows_disabled?" ":"W", debug_options.transparency_disabled?" ":"T" ); |
| 1503 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1504 | 1545 | logerror("%s1 %s%s%s%s%s%c%s%s%d%s %d %4X %4X", |
| 1505 | 1546 | debug_options.bg_disabled[0]?" ":"*", |
| 1506 | 1547 | (snes_ram[TM] & 0x1)?"M":" ", |
| r7512 | r7513 | |
| 1516 | 1557 | snes_ram[BG1SC] & 0x3, |
| 1517 | 1558 | (snes_ram[BG1SC] & 0xfc) << 9, |
| 1518 | 1559 | snes_ppu.layer[SNES_BG1].charmap << 13); |
| 1519 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1520 | 1560 | logerror("%s2 %s%s%s%s%s%c%s%s%d%s %d %4X %4X", |
| 1521 | 1561 | debug_options.bg_disabled[1]?" ":"*", |
| 1522 | 1562 | (snes_ram[TM] & 0x2)?"M":" ", |
| r7512 | r7513 | |
| 1532 | 1572 | snes_ram[BG2SC] & 0x3, |
| 1533 | 1573 | (snes_ram[BG2SC] & 0xfc) << 9, |
| 1534 | 1574 | snes_ppu.layer[SNES_BG2].charmap << 13); |
| 1535 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1536 | 1575 | logerror("%s3 %s%s%s%s%s%c%s%s%d%s%s%d %4X %4X", |
| 1537 | 1576 | debug_options.bg_disabled[2]?" ":"*", |
| 1538 | 1577 | (snes_ram[TM] & 0x4)?"M":" ", |
| r7512 | r7513 | |
| 1549 | 1588 | snes_ram[BG3SC] & 0x3, |
| 1550 | 1589 | (snes_ram[BG3SC] & 0xfc) << 9, |
| 1551 | 1590 | snes_ppu.layer[SNES_BG3].charmap << 13); |
| 1552 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1553 | 1591 | logerror("%s4 %s%s%s%s%s%c%s%s%d%s %d %4X %4X", |
| 1554 | 1592 | debug_options.bg_disabled[3]?" ":"*", |
| 1555 | 1593 | (snes_ram[TM] & 0x8)?"M":" ", |
| r7512 | r7513 | |
| 1565 | 1603 | snes_ram[BG4SC] & 0x3, |
| 1566 | 1604 | (snes_ram[BG4SC] & 0xfc) << 9, |
| 1567 | 1605 | snes_ppu.layer[SNES_BG4].charmap << 13 ); |
| 1568 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1569 | 1606 | logerror("%sO %s%s%s%s%s%c%s%s%d%d %4X", |
| 1570 | 1607 | debug_options.bg_disabled[4]?" ":"*", |
| 1571 | 1608 | (snes_ram[TM] & 0x10)?"M":" ", |
| r7512 | r7513 | |
| 1578 | 1615 | (snes_ram[WOBJSEL] & 0x8)?((snes_ram[WOBJSEL] & 0x4)?"o":"i"):" ", |
| 1579 | 1616 | snes_ppu.oam.size[0], snes_ppu.oam.size[1], |
| 1580 | 1617 | snes_ppu.layer[SNES_OAM].charmap << 13 ); |
| 1581 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1582 | 1618 | logerror("%sB %s %c%s%s", |
| 1583 | 1619 | debug_options.bg_disabled[5]?" ":"*", |
| 1584 | 1620 | (snes_ram[CGADSUB] & 0x20)?"B":" ", |
| 1585 | 1621 | WINLOGIC[(snes_ram[WOBJLOG] & 0xc)>>2], |
| 1586 | 1622 | (snes_ram[WOBJSEL] & 0x20)?((snes_ram[WOBJSEL] & 0x10)?"o":"i"):" ", |
| 1587 | 1623 | (snes_ram[WOBJSEL] & 0x80)?((snes_ram[WOBJSEL] & 0x40)?"o":"i"):" " ); |
| 1588 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1589 | 1624 | logerror("1) %3d %3d 2) %3d %3d", (snes_ppu.bgd_offset.horizontal[0] & 0x3ff) >> 3, (snes_ppu.bgd_offset.vertical[0] & 0x3ff) >> 3, (snes_ppu.bgd_offset.horizontal[1] & 0x3ff) >> 3, (snes_ppu.bgd_offset.vertical[1] & 0x3ff) >> 3 ); |
| 1590 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1591 | 1625 | logerror("3) %3d %3d 4) %3d %3d", (snes_ppu.bgd_offset.horizontal[2] & 0x3ff) >> 3, (snes_ppu.bgd_offset.vertical[2] & 0x3ff) >> 3, (snes_ppu.bgd_offset.horizontal[3] & 0x3ff) >> 3, (snes_ppu.bgd_offset.vertical[3] & 0x3ff) >> 3 ); |
| 1592 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1593 | 1626 | logerror("Flags: %s%s%s %s %2d", (snes_ram[CGWSEL] & 0x2)?"S":"F", (snes_ram[CGADSUB] & 0x80)?"-":"+", (snes_ram[CGADSUB] & 0x40)?" 50%":"100%",(snes_ram[CGWSEL] & 0x1)?"D":"P", (snes_ram[MOSAIC] & 0xf0) >> 4 ); |
| 1594 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1595 | 1627 | logerror("SetINI: %s %s %s %s %s %s", (snes_ram[SETINI] & 0x1)?" I":"NI", (snes_ram[SETINI] & 0x2)?"P":"R", (snes_ram[SETINI] & 0x4)?"240":"225",(snes_ram[SETINI] & 0x8)?"512":"256",(snes_ram[SETINI] & 0x40)?"E":"N",(snes_ram[SETINI] & 0x80)?"ES":"NS" ); |
| 1596 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1597 | 1628 | logerror("Mode7: A %5d B %5d", snes_ppu.mode7.matrix_a, snes_ppu.mode7.matrix_b ); |
| 1598 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1599 | 1629 | logerror(" %s%s%s C %5d D %5d", (snes_ram[M7SEL] & 0xc0)?((snes_ram[M7SEL] & 0x40)?"0":"C"):"R", (snes_ram[M7SEL] & 0x1)?"H":" ", (snes_ram[M7SEL] & 0x2)?"V":" ", snes_ppu.mode7.matrix_c, snes_ppu.mode7.matrix_d ); |
| 1600 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1601 | 1630 | logerror(" X %5d Y %5d", snes_ppu.mode7.origin_x, snes_ppu.mode7.origin_y ); |
| 1602 | | //ui_draw_text( t, SNES_DBG_HORZ_POS, y++ * 9 ); |
| 1603 | 1631 | } |
| 1604 | 1632 | |
| 1605 | 1633 | return 0; |