Example #1
0
static void Action(void)
{
    struct RastPort *rp;
    struct Region *dr;
    struct RegionRectangle *rr;
    WORD x, y, x1, y1, x2, y2, i, count = 0;
    
    PutStr("Activate the window whose damagelist you want to see.\n");
    PutStr("You have 3 seconds of time!\n\n");
    
    Delay(3*50);

    win = IntuitionBase->ActiveWindow;
    if (!win) Cleanup("No active window!");

    scr = win->WScreen;

    lay = win->WLayer;

    dr = lay->DamageList;
    if (!dr) Cleanup("Layer does not have a damagelist!");
    rr = dr->RegionRectangle;
    if (!rr) Cleanup("Damagelist is empty!");
    
    if (!(rp = CloneRastPort(&win->WScreen->RastPort)))
    {
    	Cleanup("CanĀ“t clone screen rastport!");
    }
    SetDrMd(rp,JAM1);
    
    while(rr)
    {
    	x1 = lay->bounds.MinX + dr->bounds.MinX + rr->bounds.MinX;
	y1 = lay->bounds.MinY + dr->bounds.MinY + rr->bounds.MinY;
	x2 = lay->bounds.MinX + dr->bounds.MinX + rr->bounds.MaxX;
	y2 = lay->bounds.MinY + dr->bounds.MinY + rr->bounds.MaxY;

    	Printf("#%04d (%4d,%4d) - (%4d, %4d)  Size: %4d x %4d\n",
		++count,
		x1,
		y1,
		x2,
		y2,
		x2 - x1 + 1,
		y2 - y1 + 1);

	
	for(i = 0; i < (Args[ARG_FAST] ? 1 : 8);i++)
	{
	    SetAPen(rp,1 + (i & 1));
	    
	    if (Args[ARG_RECTFILL])
	    {
	    	RectFill(rp,x1,y1,x2,y2);
	    } else {
		RectFill(rp,x1,y1,x2,y1);
		RectFill(rp,x2,y1,x2,y2);
		RectFill(rp,x1,y2,x2,y2);
		RectFill(rp,x1,y1,x1,y2);
	    }
	    
	    if (!Args[ARG_FAST]) Delay(10);
	}
	
	if (Args[ARG_NUMBERS])
	{
	    __sprintf(s,"%d",count);
	    i = TextLength(rp,s,strlen(s));
	    
	    x = (x1 + x2 - i) / 2;
	    y = (y1 + y2 - rp->TxHeight) / 2;
	    
	    if (x < 0)
	    {
	    	x = 0;
	    } else if (x >= scr->Width - i)
	    {
	    	x = scr->Width - i - 1;
	    }
	  
	    if (y < 0)
	    {
	    	y = 0;
	    } else if (y >= scr->Height - rp->TxHeight)
	    {
	    	y = scr->Height - rp->TxHeight - 1;
	    }
	    
	    i = strlen(s);
	    
	    SetAPen(rp,1);
	    Move(rp,x + 1, y + 1 + rp->TxBaseline);
	    Text(rp,s,i);
	    
	    SetAPen(rp,2);
	    Move(rp,x, y + rp->TxBaseline);
	    Text(rp,s,i);
	}
    	rr = rr->Next;
    }
    
    FreeRastPort(rp);
}
Example #2
0
OOP_Object *PCVesa__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg)
{
    struct TagItem pftags[] =
    {
	{aHidd_PixFmt_RedShift,     0}, /*  0 */
	{aHidd_PixFmt_GreenShift,   0}, /*  1 */
	{aHidd_PixFmt_BlueShift,    0}, /*  2 */
	{aHidd_PixFmt_AlphaShift,   0}, /*  3 */
	{aHidd_PixFmt_RedMask,      0}, /*  4 */
	{aHidd_PixFmt_GreenMask,    0}, /*  5 */
	{aHidd_PixFmt_BlueMask,     0}, /*  6 */
	{aHidd_PixFmt_AlphaMask,    0}, /*  7 */
	{aHidd_PixFmt_ColorModel,   0}, /*  8 */
	{aHidd_PixFmt_Depth,        0}, /*  9 */
	{aHidd_PixFmt_BytesPerPixel,0}, /* 10 */
	{aHidd_PixFmt_BitsPerPixel, 0}, /* 11 */
	{aHidd_PixFmt_StdPixFmt,    0}, /* 12 */
	{aHidd_PixFmt_CLUTShift,    0}, /* 13 */
	{aHidd_PixFmt_CLUTMask,     0}, /* 14 */
	{aHidd_PixFmt_BitMapType,   0}, /* 15 */
	{TAG_DONE, 0UL }
    };
    struct TagItem sync_mode[] =
    {
	{aHidd_Sync_PixelClock, 0},
	{aHidd_Sync_HDisp,      0},
	{aHidd_Sync_VDisp,      0},
	{aHidd_Sync_Description,0},
	{aHidd_Sync_HSyncStart, 0},
	{aHidd_Sync_HSyncEnd,   0},
	{aHidd_Sync_HTotal,     0},
	{aHidd_Sync_VSyncStart, 0},
	{aHidd_Sync_VSyncEnd,   0},
	{aHidd_Sync_VTotal,     0},
	{TAG_DONE, 0UL}
    };
    struct TagItem modetags[] =
    {
	{aHidd_Gfx_PixFmtTags, (IPTR)pftags},
	{aHidd_Gfx_SyncTags,   (IPTR)sync_mode},
	{TAG_DONE, 0UL}
    };
    struct TagItem yourtags[] =
    {
	{aHidd_Gfx_ModeTags, (IPTR)modetags},
	{TAG_MORE, 0UL}
    };
    struct pRoot_New yourmsg;

    pftags[0].ti_Data = XSD(cl)->data.redshift;
    pftags[1].ti_Data = XSD(cl)->data.greenshift;
    pftags[2].ti_Data = XSD(cl)->data.blueshift;
    pftags[3].ti_Data = 0;
    pftags[4].ti_Data = XSD(cl)->data.redmask;
    pftags[5].ti_Data = XSD(cl)->data.greenmask;
    pftags[6].ti_Data = XSD(cl)->data.bluemask;
    pftags[7].ti_Data = 0;
    pftags[8].ti_Data = (XSD(cl)->data.depth > 8) ? vHidd_ColorModel_TrueColor : vHidd_ColorModel_Palette;
    pftags[9].ti_Data = (XSD(cl)->data.depth > 24) ? 24 : XSD(cl)->data.depth;
    pftags[10].ti_Data = XSD(cl)->data.bytesperpixel;
    pftags[11].ti_Data = (XSD(cl)->data.bitsperpixel > 24) ? 24 : XSD(cl)->data.bitsperpixel;
    pftags[12].ti_Data = vHidd_StdPixFmt_Native;
    pftags[14].ti_Data = (1 << XSD(cl)->data.depth) - 1;
    pftags[15].ti_Data = vHidd_BitMapType_Chunky;

    sync_mode[1].ti_Data = XSD(cl)->data.width;
    sync_mode[2].ti_Data = XSD(cl)->data.height;
    __sprintf(syncdescription, "VESA:%ldx%ld", XSD(cl)->data.width, XSD(cl)->data.height);
    sync_mode[3].ti_Data = (IPTR)syncdescription;

    yourtags[1].ti_Data = (IPTR)msg->attrList;
    yourmsg.mID = msg->mID;
    yourmsg.attrList = yourtags;
    msg = &yourmsg;
    EnterFunc(bug("VesaGfx::New()\n"));
    o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
    if (o)
    {
	D(bug("Got object from super\n"));
	XSD(cl)->vesagfxhidd = o;
	XSD(cl)->mouse.shape = NULL;
	ReturnPtr("VesaGfx::New", OOP_Object *, o);
    }
    ReturnPtr("VesaGfx::New", OOP_Object *, NULL);
}
Example #3
0
//
// Start Kernel
asmlinkage void start_kernel(void) {

  char buf[255];
  int _i = 0;
  int _diff = 0;
  _video_draw_char('O', 79, 10);
  _video_draw_char('c', 79, 11);
  _video_draw_char('t', 79, 12);
  _video_draw_char('a', 79, 13);
  _video_draw_char('n', 79, 14);
  _video_draw_char('e', 79, 15);
  _video_draw_char(' ', 79, 16);
  _video_draw_char(' ', 79, 17);

  // Draw a banner line of the right side of the screen
  for (_i = 0; _i < 10; _i++)  { _video_draw_char(' ', 79,_i); }
  for (_i = 18; _i < 22; _i++) { _video_draw_char(' ', 79,_i); }  
   
  load_misc_kprint();  
  __sprintf(buf, "=========== Octane ===========\n"); __puts(buf);
  __sprintf(buf, "@INFO: Build: %ld; since (10/15/2007) %s\n", 
		  	main_get_build_count, main_get_version); __puts(buf);

  //memory_end = (1<<20) + (EXT_MEM_K<<10);
  //  memory_end &= PAGE_MASK;
  memory_end = 16*1024*1024;
  memory_start = 1024*1024;
  low_memory_start = (unsigned long) &_end;

  // now lets load the IDT
  load_exception_table();

  init_interrupts();
  sched_init();
  load_keyboard_driver();
  
  //memory_start = blk_dev_init(memory_start, memory_end);
  sti();
  //calibrate_delay();
  
  //memory_start = inode_init(memory_start, memory_end);
  //memory_start = file_table_init(memory_start, memory_end);  
  //mem_init(low_memory_start, memory_start, memory_end);
  //buffer_init();
  time_init();
 
  // Print the current time.
  printk("INFO: current time: %d\n", xtime.tv_sec);
  printk("INFO: %d/%d/%d %d:%d\n", cur_simpletime.mon,
		 cur_simpletime.day, cur_simpletime.year,
		 cur_simpletime.hour, cur_simpletime.min);

  floppy_init();
  sti();

  //__debug_floppy_open();
  //__debug_floppy_release();
  test_time_1();
  test_block_1();

  tests();
  for(;;) {  
	  _nop();
  }
}