volatile ushort *pw;
pw = (ushort *) GFXCNTL;
*pw = 0x8016; /* reg. 0 - Enable HBL */
*pw = 0x8174; /* reg. 1 - Enable display, VBL, DMA + VCell size */
*pw = 0x8230; /* reg. 2 - Plane A =$30*$400=$C000 */
*pw = 0x832C; /* reg. 3 - Window =$2C*$400=$B000 */
*pw = 0x8407; /* reg. 4 - Plane B =$7*$2000=$E000 */
*pw = 0x855E; /* reg. 5 - sprite table begins at $BC00=$5E*$200 */
*pw = 0x8600; /* reg. 6 - not used */
*pw = 0x8700; /* reg. 7 - Background Color number*/
*pw = 0x8800; /* reg. 8 - not used */
*pw = 0x8900; /* reg. 9 - not used */
*pw = 0x8a01; /* reg 10 - HInterrupt timing */
*pw = 0x8b00; /* reg 11 - $0000abcd a=extr.int b=vscr cd=hscr */
*pw = 0x8c81; /* reg 12 - Screen width set to 320 and no shadow/hightlight*/
*pw = 0x8d2E; /* reg 13 - HScoll Table = $B800 */
*pw = 0x8e00; /* reg 14 - not used */
*pw = 0x8f02; /* reg 15 - auto increment data */
*pw = 0x9011; /* reg 16 - scrl screen v&h size (64x64) */
*pw = 0x9100; /* reg 17 - window hpos */
*pw = 0x92ff; /* reg 18 - window vpos */
// Field Address Defines
//***************************
#define APLAN 0xC000
#define WPLAN 0xB000
#define BPLAN 0xE000
#define SLIST 0xBC00
#define HSCRL 0xB800
void scrollh(posA, posB)
int posA;
int posB;
{
register int *pw;
register ulong *pl;
pl = (ulong *) GFXCNTL;
*pl = GFX_WRITE_ADDR(HSCRL);
pw = (int *) GFXDATA;
*pw = posA;
*pw = posB;
/* you must scroll fieldA before fieldB....(?) */
wait_sync();
}
init_gfx();
// Set Palettes
set_colors(0,charset_pal);
set_colors(1,bg_pal);
// Load Tiles into Memory
load_tiles(bg,(bg_VSize*bg_HSize),1);
load_tiles(charset,(charset_VSize*charset_HSize),(bg_VSize*bg_HSize)+1);
// Show Background on Plane B
show_tiles(1,(28*40),1,40,BPLAN);
// Print Hello World on Plane A
print((bg_VSize*bg_HSize)+1,"HELLO WORLD!!!",2,2,0,APLAN);
// Wait for VBL
wait_sync();
scrollh(30,30);