[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DGR...



Here's the broken code. I actually used a trick like this to DGR, and THAT worked fine. (There are CC65isms in this code.)

-uso.

typedef unsigned char byte;
typedef unsigned short word;

byte ix,iy;

void plot(byte x,byte y,byte c)
{
 byte bank;
 byte cc;

 printf ("(%2d,%2d):%X ",x,y,c);

 bank=!(x&1);
 ix=(x>>1);
 iy=y;
 cc=(((c&0x0F)<<4)|(c&0x0F));
 *((byte*)30)=cc;

 if (bank)
 {
  asm ("ldy %v",ix);
  asm ("lda %v",iy);
  asm ("bit $C082");
  asm ("sta $C005");
  asm ("jsr $F800");
  asm ("sta $C004");
 }
 else
 {
  asm ("ldy %v",ix);
  asm ("lda %v",iy);
  asm ("bit $C082");
  asm ("jsr $F800");
 }
}