47 #include <X11/Xutil.h> 55 #define BT459_TICK_SHIFT 14 111 int i, x,y, xmax=0, ymax=0;
116 for (x=0; x<64; x+=4) {
123 for (i=0; i<4; i++) {
124 int color = (data >> (6-2*i)) & 3;
127 if (color != 0 && color != 3)
147 for (y=0; y<=ymax; y++) {
148 for (x=0; x<=xmax; x+=4) {
153 for (i=0; i<4; i++) {
154 int color = (data >> (6-2*i)) & 3;
168 case 2: pixelvalue = (d->
173 case 3: pixelvalue = 15 -
183 #ifdef WITH_CURSOR_DEBUG 188 #ifdef WITH_CURSOR_DEBUG 192 #ifdef WITH_CURSOR_DEBUG 193 printf(
"color 1,2,3 = 0x%02x, 0x%02x, 0x%02x\n",
216 static void bt459_update_cursor_position(
struct bt459_data *d,
232 debug(
"[ bt459: cursor = %03i,%03i ]\n",
252 bt459_update_X_cursor(
cpu, d);
253 bt459_update_cursor_position(d, old_cursor_on);
286 uint64_t idata = 0, odata = 0;
292 fatal(
"[ bt459: IRQ ack ]\n");
309 uint64_t idata = 0, odata = 0;
310 int btaddr, old_cursor_on = d->
cursor_on, modified;
316 fatal(
"[ bt459: write to addr 0x%02x: %08x ]\n",
317 (
int)relative_addr, (
int)idata);
342 switch (relative_addr) {
346 debug(
"[ bt459: write to Low Address Byte, " 347 "0x%02x ]\n", (
int)idata);
353 debug(
"[ bt459: read from Low Address Byte: " 354 "0x%0x ]\n", (
int)odata);
360 debug(
"[ bt459: write to High Address Byte, " 361 "0x%02x ]\n", (
int)idata);
367 debug(
"[ bt459: read from High Address Byte: " 368 "0x%0x ]\n", (
int)odata);
374 debug(
"[ bt459: write to BT459 register " 375 "0x%04x, value 0x%02x ]\n", btaddr,
377 modified = (d->
bt459_reg[btaddr] != idata);
393 switch (idata & 0xff) {
397 debug(
"[ bt459: video OFF ]\n");
403 debug(
"[ bt459: video ON ]\n");
408 switch (idata & 0xff) {
413 fatal(
"[ bt459: unimplemented CCR " 414 "value 0x%08x ]\n", (
int)idata);
421 fatal(
"[ bt459: write to BT459 " 422 "register 0x%04x, value 0x%02x ]\n",
434 odata = (odata >> 16) & 255;
437 debug(
"[ bt459: read from BT459 register " 438 "0x%04x, value 0x%02x ]\n", btaddr,
451 debug(
"[ bt459: write to BT459 colormap " 452 "0x%04x subaddr %i, value 0x%02x ]\n",
455 if (btaddr < 0x100) {
478 debug(
"[ bt459: read from BT459 colormap " 479 "0x%04x subaddr %i, value 0x%02x ]\n",
495 debug(
"[ bt459: unimplemented write to address 0x%x, " 496 "data=0x%02x ]\n", (
int)relative_addr, (
int)idata);
498 debug(
"[ bt459: unimplemented read from address " 499 "0x%x ]\n", (
int)relative_addr);
504 bt459_update_cursor_position(d, old_cursor_on);
511 fatal(
"[ bt459: read from addr 0x%02x: %08x ]\n",
512 (
int)relative_addr, (
int)idata);
557 if (vfb_data->
xsize == 1280) {
574 if (baseaddr_irq != 0)
576 dev_bt459_irq_access, (
void *)d,
DM_DEFAULT, NULL);
uint64_t memory_readmax64(struct cpu *cpu, unsigned char *buf, int len)
#define CURSOR_COLOR_INVERT
void fatal(const char *fmt,...)
#define CURSOR_COLOR_TRANSPARENT
#define BT459_REG_CCOLOR_3
unsigned char cur_addr_lo
#define CHECK_ALLOCATION(ptr)
int need_to_redraw_whole_screen
int interrupt_time_reset_value
struct vfb_data * vfb_data
void dev_bt459_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, uint64_t baseaddr_irq, struct vfb_data *vfb_data, int planes, const char *irq_path, int type)
int dev_bt459_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *)
struct fb_window * fb_window
unsigned char * rgb_palette
#define INTERRUPT_ASSERT(istruct)
unsigned char cur_addr_hi
#define INTERRUPT_CONNECT(name, istruct)
int need_to_update_cursor_shape
void memory_writemax64(struct cpu *cpu, unsigned char *buf, int len, uint64_t data)
#define BT459_REG_CRAM_BASE
void memory_device_register(struct memory *mem, const char *, uint64_t baseaddr, uint64_t len, int(*f)(struct cpu *, struct memory *, uint64_t, unsigned char *, size_t, int, void *), void *extra, int flags, unsigned char *dyntrans_data)
addr & if(addr >=0x24 &&page !=NULL)
unsigned char local_rgb_palette[256 *3]
#define BT459_REG_CCOLOR_1
int cursor_pixels[CURSOR_MAXY][CURSOR_MAXX]
void machine_add_tickfunction(struct machine *machine, void(*func)(struct cpu *, void *), void *extra, int clockshift)
uint32_t bt459_reg[DEV_BT459_NREGS]
unsigned char rgb_palette[256 *3]
#define BT459_REG_CCOLOR_2
void dev_fb_setcursor(struct vfb_data *d, int cursor_x, int cursor_y, int on, int cursor_xsize, int cursor_ysize)
#define INTERRUPT_DEASSERT(istruct)