void *copperlist = AllocMem(1000, MEMF_CHIP|MEMF_CLEAR); UWORD *copperlist_ptr = (UWORD *)copperlist; // add a bitplane *(copperlist_ptr)++ = BPL1PTH; *(copperlist_ptr)++ = ((ULONG)bitplane >> 16) & 0xffff; *(copperlist_ptr)++ = BPL1PTL; *(copperlist_ptr)++ = (ULONG)bitplane & 0xffff; // add a color *(copperlist_ptr)++ = COLOR00; *(copperlist_ptr)++ = 0x000; // add a WAIT *(copperlist_ptr)++ = ((currentY & 0xff) << 8) | 0x26 | 0x1; *(copperlist_ptr)++ = 0xfffe; // do a PAL workaround if (currentY == 255) { *(copperlist_ptr++) = 0xffdf; *(copperlist_ptr++) = 0xfffe; } // add an END *(copperlist_ptr)++ = 0xffff; *(copperlist_ptr)++ = 0xfffe;