Previous 199869 Revisions Next

r31949 Saturday 6th September, 2014 at 12:23:40 UTC by O. Galibert
better blending (nw)
[src/mame/drivers]raiden2.c

trunk/src/mame/drivers/raiden2.c
r31948r31949
175175   return m_maincpu->state_int(NEC_IP);
176176}
177177
178int cnt=0, ccol = 0x6f;
178int cnt=0, ccol = -1;
179179
180180WRITE16_MEMBER(raiden2_state::cop_pgm_data_w)
181181{
r31948r31949
10811081   if(layer == -1)
10821082      return;
10831083
1084   const UINT8 alpha_active[0x10] = { // MSB first
1084   // Tuned for raiden2
1085   const UINT8 alpha_active[0x20] = { // MSB first
10851086      //00    08    10    18    20    28    30    38    40    48    50    58    60    68    70    78
1086      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x00
1087      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x3f, 0x73, 0xff, 0xfc, 0xf0, 0x04, 0x67,
1088      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00
10871089   };
10881090
10891091   const pen_t *pens = &m_palette->pen(0);
r31948r31949
10961098         if((val & 0xc000) == layer && (val & 0x000f) != 0x000f) {
10971099            val &= 0x07ff;
10981100            int page = val >> 4;
1099            if(((alpha_active[page >> 3] & (0x80 >> (page & 7))) || page == ccol) && (val & 0xf) == 0xe)
1101            bool active = false;
1102            if((val & 0xf) == 0xe && (alpha_active[page >> 3] & (0x80 >> (page & 7))))
1103               active = true;
1104            if((val & 0x8) == 0x8 && (alpha_active[0x10+(page >> 3)] & (0x80 >> (page & 7))))
1105               active = true;
1106
1107            if(page == ccol)
1108               active = !active;
1109
1110            if(active)
11001111               *dst = alpha_blend_r32(*dst, pens[val], 0x7f);
11011112            else
11021113               *dst = pens[val];
r31948r31949
11231134      if (machine().input().code_pressed(KEYCODE_W))
11241135         ccol++;
11251136   }
1126   ccol &= 0x7f;
1137   if(ccol == 0x80)
1138      ccol = -1;
1139   if(ccol == 0x00)
1140      ccol = 0x40;
1141   if(ccol == 0x3f)
1142      ccol = -1;
1143   if(ccol == -2)
1144      ccol = 0x7f;
1145
11271146   if(ccol != ocol)
11281147      popmessage("%02x", ccol);
11291148

Previous 199869 Revisions Next


© 1997-2024 The MAME Team