|
20 | 20 | - Verify that X/Y center has 10 bits of resolution when zooming and
|
21 | 21 | 9 when not.
|
22 | 22 |
|
23 |
| - - In svf (the field) and radr (on the field), they use tilemap-specific |
24 |
| - flip in conjunction with rowscroll AND rowselect. According to Charles, |
25 |
| - in this case, the rowselect lookups should be done in reverse order, |
26 |
| - but this results in an incorrect display. For now, we assume there is |
27 |
| - a bug in the procedure and implement it so that it looks correct. |
| 23 | + - Sonic while globally flipped via the service menu, fails to flip |
| 24 | + the "SEGA" and "SEGASONIC" sprite based logos on the title screen. |
28 | 25 |
|
29 | 26 | - titlef NBG0 and NBG2 layers are currently hidden during gameplay.
|
30 | 27 | It sets $31ff02 with either $7be0 and $2960 (and $31ff8e is $c00).
|
|
61 | 58 | $31FF00 : w--- ---- ---- ---- : Screen width (0= 320, 1= 412)
|
62 | 59 | ---- f--- ---- ---- : Bitmap format (1= 8bpp, 0= 4bpp)
|
63 | 60 | ---- -t-- ---- ---- : Tile banking related
|
64 |
| - ---- --f- ---- ---- : 1= Global X/Y flip? (most games?) |
65 |
| - ---- ---f ---- ---- : 1= prohbit Y flip? (Air Rescue 2nd screen title, also gets set on one of the intro sequence screens) |
| 61 | + ---- --f- ---- ---- : 1= Global X/Y flip (enabled via service menu) |
| 62 | + ---- ---f ---- ---- : 1= Prohibit layer Y flip (NBG0 - NBG3) |
66 | 63 | ---- ---- ---- 4--- : 1= X+Y flip for NBG3
|
67 | 64 | ---- ---- ---- -2-- : 1= X+Y flip for NBG2
|
68 | 65 | ---- ---- ---- --1- : 1= X+Y flip for NBG1
|
@@ -544,7 +541,7 @@ TILE_GET_INFO_MEMBER(segas32_state::get_tile_info)
|
544 | 541 |
|
545 | 542 | int segas32_state::compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, extents_list *list)
|
546 | 543 | {
|
547 |
| - int flip = (m_videoram[0x1ff00/2] >> 9) & 1; |
| 544 | + int flip = BIT(m_videoram[0x1ff00 / 2], 9); |
548 | 545 | rectangle tempclip;
|
549 | 546 | rectangle clips[5];
|
550 | 547 | int sorted[5];
|
@@ -646,20 +643,14 @@ int segas32_state::compute_clipping_extents(screen_device &screen, int enable, i
|
646 | 643 |
|
647 | 644 | void segas32_state::compute_tilemap_flips(int bgnum, int &flipx, int &flipy)
|
648 | 645 | {
|
649 |
| - /* determine if we're flipped */ |
650 |
| - int global_flip = (m_videoram[0x1ff00 / 2] >> 9)&1; |
651 |
| - |
652 |
| - flipx = global_flip; |
653 |
| - flipy = global_flip; |
654 |
| - |
655 |
| - int layer_flip = (m_videoram[0x1ff00 / 2] >> bgnum) & 1; |
| 646 | + // determine flip bits |
| 647 | + int global_flip = BIT(m_videoram[0x1ff00 / 2], 9); |
| 648 | + int layer_flip = BIT(m_videoram[0x1ff00 / 2], bgnum); |
| 649 | + int prohibit_flipy = BIT(m_videoram[0x1ff00 / 2], 8); |
656 | 650 |
|
657 |
| - flipy ^= layer_flip; |
658 |
| - flipx ^= layer_flip; |
| 651 | + flipx = (layer_flip) ? !global_flip : global_flip; |
659 | 652 |
|
660 |
| - // this bit is set on Air Rescue (screen 2) title screen, during the Air Rescue introduction demo, and in f1en when you win a single player race |
661 |
| - // it seems to prohibit (at least) the per-tilemap y flipping (maybe global y can override it) |
662 |
| - if ((m_videoram[0x1ff00 / 2] >> 8) & 1) flipy = 0; |
| 653 | + flipy = (layer_flip && !prohibit_flipy) ? !global_flip : global_flip; |
663 | 654 | }
|
664 | 655 |
|
665 | 656 | /*************************************
|
@@ -705,7 +696,7 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, segas32_state::la
|
705 | 696 | //if (screen.machine().input().code_pressed(KEYCODE_X) && bgnum == 1) opaque = 1;
|
706 | 697 | int flipx, flipy;
|
707 | 698 |
|
708 |
| - // todo determine flipping |
| 699 | + // determine flipping |
709 | 700 | compute_tilemap_flips(bgnum, flipx, flipy);
|
710 | 701 |
|
711 | 702 | /* determine the clipping */
|
@@ -863,7 +854,7 @@ void segas32_state::update_tilemap_rowscroll(screen_device &screen, segas32_stat
|
863 | 854 |
|
864 | 855 | int flipx, flipy;
|
865 | 856 |
|
866 |
| - // todo determine flipping |
| 857 | + // determine flipping |
867 | 858 | compute_tilemap_flips(bgnum, flipx, flipy);
|
868 | 859 |
|
869 | 860 |
|
@@ -914,21 +905,24 @@ void segas32_state::update_tilemap_rowscroll(screen_device &screen, segas32_stat
|
914 | 905 | }
|
915 | 906 |
|
916 | 907 | int srcy;
|
| 908 | + int ylookup; |
917 | 909 | if (!flipy)
|
918 | 910 | {
|
919 | 911 | srcy = yscroll + y;
|
| 912 | + ylookup = y; |
920 | 913 | }
|
921 | 914 | else
|
922 | 915 | {
|
923 | 916 | const rectangle &visarea = screen.visible_area();
|
924 | 917 | srcy = yscroll + visarea.max_y - y;
|
| 918 | + ylookup = visarea.max_y - y; |
925 | 919 | }
|
926 | 920 |
|
927 | 921 | /* apply row scroll/select */
|
928 | 922 | if (rowscroll)
|
929 |
| - srcx += table[0x000 + 0x100 * (bgnum - 2) + y] & 0x3ff; |
| 923 | + srcx += table[0x000 + 0x100 * (bgnum - 2) + ylookup] & 0x3ff; |
930 | 924 | if (rowselect)
|
931 |
| - srcy = (yscroll + table[0x200 + 0x100 * (bgnum - 2) + y]) & 0x1ff; |
| 925 | + srcy = (yscroll + table[0x200 + 0x100 * (bgnum - 2) + ylookup]) & 0x1ff; |
932 | 926 |
|
933 | 927 |
|
934 | 928 | /* look up the pages and get their source pixmaps */
|
@@ -996,7 +990,7 @@ void segas32_state::update_tilemap_text(screen_device &screen, segas32_state::la
|
996 | 990 | bitmap_ind16 &bitmap = layer.bitmap;
|
997 | 991 |
|
998 | 992 | /* determine if we're flipped */
|
999 |
| - int flip = (m_videoram[0x1ff00/2] >> 9) & 1; |
| 993 | + int flip = BIT(m_videoram[0x1ff00 / 2], 9); |
1000 | 994 |
|
1001 | 995 | /* determine the base of the tilemap and graphics data */
|
1002 | 996 | uint16_t const *const tilebase = &m_videoram[((m_videoram[0x1ff5c/2] >> 4) & 0x1f) * 0x800];
|
|
0 commit comments