...
|
...
|
@@ -157,26 +157,24 @@ screen_deo(Device *d, Uint8 port)
|
157
|
157
|
break;
|
158
|
158
|
}
|
159
|
159
|
case 0xf: {
|
160
|
|
- Uint16 x, y, addr, auto_i;
|
161
|
|
- Uint8 twobpp = !!(d->dat[0xf] & 0x80);
|
|
160
|
+ Uint16 x, y, dx, dy, addr;
|
|
161
|
+ Uint8 i, n, twobpp = !!(d->dat[0xf] & 0x80);
|
162
|
162
|
Layer *layer = (d->dat[0xf] & 0x40) ? &uxn_screen.fg : &uxn_screen.bg;
|
163
|
163
|
DEVPEEK16(x, 0x8);
|
164
|
164
|
DEVPEEK16(y, 0xa);
|
165
|
165
|
DEVPEEK16(addr, 0xc);
|
166
|
|
- if(addr > 0xfff8 - twobpp * 8)
|
|
166
|
+ n = d->dat[0x6] >> 4;
|
|
167
|
+ dx = (d->dat[0x6] & 0x01) << 3;
|
|
168
|
+ dy = (d->dat[0x6] & 0x02) << 2;
|
|
169
|
+ if(addr > 0xfff8 - twobpp * 8 * (n + 1))
|
167
|
170
|
return;
|
168
|
|
- screen_blit(&uxn_screen, layer, x, y, &d->u->ram[addr], d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20, twobpp);
|
169
|
|
- auto_i = d->dat[0x6] + 0x40;
|
170
|
|
- if((auto_i >> 6) > ((auto_i & 0x30) >> 4)) {
|
171
|
|
- d->dat[0x6] = auto_i & 0x3f;
|
172
|
|
- DEVPOKE16(0x8, x + ((auto_i & 0x01) << 3) - ((auto_i & 0x02) * (auto_i & 0x30) >> 2));
|
173
|
|
- DEVPOKE16(0xa, y + ((auto_i & 0x02) << 2) - ((auto_i & 0x01) * (auto_i & 0x30) >> 1));
|
174
|
|
- } else {
|
175
|
|
- d->dat[0x6] = auto_i;
|
176
|
|
- DEVPOKE16(0x8, x + ((auto_i & 0x02) << 2));
|
177
|
|
- DEVPOKE16(0xa, y + ((auto_i & 0x01) << 3));
|
|
171
|
+ for(i = 0; i <= n; i++) {
|
|
172
|
+ screen_blit(&uxn_screen, layer, x + dy * i, y + dx * i, &d->u->ram[addr], d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20, twobpp);
|
|
173
|
+ addr += (d->dat[0x6] & 0x04) << (1 + twobpp);
|
178
|
174
|
}
|
179
|
|
- if(auto_i & 0x04) DEVPOKE16(0xc, addr + 8 + twobpp * 8); /* auto addr+length */
|
|
175
|
+ DEVPOKE16(0xc, addr); /* auto addr+length */
|
|
176
|
+ DEVPOKE16(0x8, x + dx); /* auto x+8 */
|
|
177
|
+ DEVPOKE16(0xa, y + dy); /* auto y+8 */
|
180
|
178
|
break;
|
181
|
179
|
}
|
182
|
180
|
}
|