branches/alto2/src/emu/cpu/alto2/a2disp.c
| r26449 | r26450 | |
| 247 | 247 | //! update the internal bitmap to a byte array |
| 248 | 248 | void alto2_cpu_device::update_bitmap_word(UINT16* bitmap, int x, int y, UINT16 word) |
| 249 | 249 | { |
| 250 | | /* mixing with the cursor */ |
| 250 | // mixing with the cursor |
| 251 | 251 | if (x == m_dsp.curxpos + 0) |
| 252 | 252 | word ^= m_dsp.cursor0; |
| 253 | 253 | if (x == m_dsp.curxpos + 1) |
| 254 | 254 | word ^= m_dsp.cursor1; |
| 255 | // no change? |
| 255 | 256 | if (word == bitmap[x]) |
| 256 | 257 | return; |
| 257 | 258 | bitmap[x] = word; |
| r26449 | r26450 | |
| 485 | 486 | } |
| 486 | 487 | |
| 487 | 488 | /** |
| 488 | | * @brief f2_evenfield late: branch on evenfield |
| 489 | * @brief branch on evenfield |
| 489 | 490 | * |
| 490 | 491 | * NEXT(09) = even field ? 1 : 0 |
| 491 | 492 | */ |
| 492 | 493 | void alto2_cpu_device::f2_late_evenfield() |
| 493 | 494 | { |
| 494 | 495 | UINT16 r = HLC1024 ^ 1; |
| 495 | | LOG((LOG_DISPL,2," evenfield branch on HLC1024 (%#o | %#o)\n", m_next2, r)); |
| 496 | LOG((LOG_DISPL,2," EVENFIELD branch (%#o | %#o)\n", m_next2, r)); |
| 496 | 497 | m_next2 |= r; |
| 497 | 498 | } |
| 498 | 499 | |
branches/alto2/src/emu/cpu/alto2/alto2cpu.c
| r26449 | r26450 | |
| 2023 | 2023 | * @param smc S function [0-15], M arithmetic/logic flag, C carry |
| 2024 | 2024 | * @return resulting ALU output |
| 2025 | 2025 | */ |
| 2026 | #if 1 |
| 2026 | 2027 | UINT32 alto2_cpu_device::alu_74181(UINT32 a, UINT32 b, UINT8 smc) |
| 2027 | 2028 | { |
| 2028 | 2029 | register UINT32 f; |
| r26449 | r26450 | |
| 2239 | 2240 | } |
| 2240 | 2241 | return f; |
| 2241 | 2242 | } |
| 2243 | #else |
| 2244 | |
| 2245 | #define DO_74181(ci,mp,s0,s1,s2,s3,a,b,_b0,_b1,_b2,_b3,f,co) do { \ |
| 2246 | int a0 = BIT(a,_b0), a1 = BIT(a,_b1), a2 = BIT(a,_b2), a3 = BIT(a,_b3); \ |
| 2247 | int b0 = BIT(b,_b0), b1 = BIT(b,_b1), b2 = BIT(b,_b2), b3 = BIT(b,_b3); \ |
| 2248 | int ap0 = !(a0 | (b0 & s0) | (s1 & !b0)); \ |
| 2249 | int bp0 = !(((!b0) & s2 & a0) | (a0 & b0 & s3)); \ |
| 2250 | int ap1 = !(a1 | (b1 & s0) | (s1 & !b1)); \ |
| 2251 | int bp1 = !(((!b1) & s2 & a1) | (a1 & b1 & s3)); \ |
| 2252 | int ap2 = !(a2 | (b2 & s0) | (s1 & !b2)); \ |
| 2253 | int bp2 = !(((!b2) & s2 & a2) | (a2 & b2 & s3)); \ |
| 2254 | int ap3 = !(a3 | (b3 & s0) | (s1 & !b3)); \ |
| 2255 | int bp3 = !(((!b3) & s2 & a3) | (a3 & b3 & s3)); \ |
| 2256 | int fp0 = !(ci & mp) ^ ((!ap0) & bp0); \ |
| 2257 | int fp1 = (!((mp & ap0) | (mp & bp0 & ci))) ^ ((!ap1) & bp1); \ |
| 2258 | int fp2 = (!((mp & ap1) | (mp & ap0 & bp1) | (mp & ci & bp0 & bp1))) ^ ((!ap2) & bp2); \ |
| 2259 | int fp3 = (!((mp & ap2) | (mp & ap1 & bp2) | (mp & ap0 & bp1 & bp2) | (mp & ci & bp0 & bp1 & bp2))) ^ ((!ap3) & bp3); \ |
| 2260 | f |= (fp0 << _b0) | (fp1 << _b1) | (fp2 << _b2) | (fp3 << _b3); \ |
| 2261 | int g = !((ap0 & bp1 & bp2 & bp3) | (ap1 & bp2 & bp3) | (ap2 & bp3) | ap3); \ |
| 2262 | co = (!(ci & bp0 & bp1 & bp2 & bp3)) | g; \ |
| 2263 | } while (0) |
| 2264 | |
| 2265 | |
| 2266 | UINT32 alto2_cpu_device::alu_74181(UINT32 a, UINT32 b, UINT8 smc) |
| 2267 | { |
| 2268 | // inputs |
| 2269 | int ci = !BIT(smc, 2); |
| 2270 | int mp = !BIT(smc, 3); |
| 2271 | int s0 = !BIT(smc, 4), s1 = !BIT(smc, 5), s2 = !BIT(smc, 6), s3 = !BIT(smc, 7); |
| 2272 | |
| 2273 | // outputs |
| 2274 | UINT32 f = 0; |
| 2275 | int cn_x; |
| 2276 | DO_74181(ci, mp,s0,s1,s2,s3,a,b, 0, 1, 2, 3,f,cn_x); // 74181 #1 |
| 2277 | int cn_y; |
| 2278 | DO_74181(cn_x,mp,s0,s1,s2,s3,a,b, 4, 5, 6, 7,f,cn_y); // 74181 #2 |
| 2279 | int cn_z; |
| 2280 | DO_74181(cn_y,mp,s0,s1,s2,s3,a,b, 8, 9,10,11,f,cn_z); // 74181 #3 |
| 2281 | int co; |
| 2282 | DO_74181(cn_z,mp,s0,s1,s2,s3,a,b,12,13,14,15,f,co); // 74181 #4 |
| 2283 | f |= co << 16; |
| 2284 | return f; |
| 2285 | } |
| 2286 | #endif // 0 |
| 2242 | 2287 | #endif |
| 2243 | 2288 | |
| 2244 | 2289 | /** @brief flag that tells whether to load the T register from BUS or ALU */ |