trunk/src/mame/drivers/raiden2.c
| r31948 | r31949 | |
| 175 | 175 | return m_maincpu->state_int(NEC_IP); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | | int cnt=0, ccol = 0x6f; |
| 178 | int cnt=0, ccol = -1; |
| 179 | 179 | |
| 180 | 180 | WRITE16_MEMBER(raiden2_state::cop_pgm_data_w) |
| 181 | 181 | { |
| r31948 | r31949 | |
| 1081 | 1081 | if(layer == -1) |
| 1082 | 1082 | return; |
| 1083 | 1083 | |
| 1084 | | const UINT8 alpha_active[0x10] = { // MSB first |
| 1084 | // Tuned for raiden2 |
| 1085 | const UINT8 alpha_active[0x20] = { // MSB first |
| 1085 | 1086 | //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 |
| 1087 | 1089 | }; |
| 1088 | 1090 | |
| 1089 | 1091 | const pen_t *pens = &m_palette->pen(0); |
| r31948 | r31949 | |
| 1096 | 1098 | if((val & 0xc000) == layer && (val & 0x000f) != 0x000f) { |
| 1097 | 1099 | val &= 0x07ff; |
| 1098 | 1100 | 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) |
| 1100 | 1111 | *dst = alpha_blend_r32(*dst, pens[val], 0x7f); |
| 1101 | 1112 | else |
| 1102 | 1113 | *dst = pens[val]; |
| r31948 | r31949 | |
| 1123 | 1134 | if (machine().input().code_pressed(KEYCODE_W)) |
| 1124 | 1135 | ccol++; |
| 1125 | 1136 | } |
| 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 | |
| 1127 | 1146 | if(ccol != ocol) |
| 1128 | 1147 | popmessage("%02x", ccol); |
| 1129 | 1148 | |