RayFan::RayFan(const sys::system &system, enum rayfan_plane_e plane)
   : _tracer(system),
     _processed_trace(false),
     _entrance(0),
     _exit(0),
     _dist(trace::SagittalDist, 15)
 {
   set_plane(plane);
 }
Exemple #2
0
static void write_font(unsigned char *buf, unsigned font_height)
{
	unsigned char seq2, seq4, gc4, gc5, gc6;
	unsigned i;

/* save registers
set_plane() modifies GC 4 and SEQ 2, so save them as well */
	outport(VGA_SEQ_INDEX, 2);
	seq2 = inport(VGA_SEQ_DATA);

	outport(VGA_SEQ_INDEX, 4);
	seq4 = inport(VGA_SEQ_DATA);
/* turn off even-odd addressing (set flat addressing)
assume: chain-4 addressing already off */
	outport(VGA_SEQ_DATA, seq4 | 0x04);

	outport(VGA_GC_INDEX, 4);
	gc4 = inport(VGA_GC_DATA);

	outport(VGA_GC_INDEX, 5);
	gc5 = inport(VGA_GC_DATA);
/* turn off even-odd addressing */
	outport(VGA_GC_DATA, gc5 & ~0x10);

	outport(VGA_GC_INDEX, 6);
	gc6 = inport(VGA_GC_DATA);
/* turn off even-odd addressing */
	outport(VGA_GC_DATA, gc6 & ~0x02);
/* write font to plane P4 */
	set_plane(2);
/* write font 0 */
	for(i = 0; i < 256; i++)
	{
		//vmemwr(16384u * 0 + i * 32, buf, font_height);
		memcpy((char*)buf, (char*)(i*32 + 0xA0000), font_height);
		buf += font_height;
	}
#if 0
/* write font 1 */
	for(i = 0; i < 256; i++)
	{
		vmemwr(16384u * 1 + i * 32, buf, font_height);
		buf += font_height;
	}
#endif
/* restore registers */
	outport(VGA_SEQ_INDEX, 2);
	outport(VGA_SEQ_DATA, seq2);
	outport(VGA_SEQ_INDEX, 4);
	outport(VGA_SEQ_DATA, seq4);
	outport(VGA_GC_INDEX, 4);
	outport(VGA_GC_DATA, gc4);
	outport(VGA_GC_INDEX, 5);
	outport(VGA_GC_DATA, gc5);
	outport(VGA_GC_INDEX, 6);
	outport(VGA_GC_DATA, gc6);
}
Exemple #3
0
static void vga_generic_unset_mode(vgageneric_handle_t *dev)
{
	set_plane(0);
	memcpy(0xC00A0000, dev->mem0, 128*1024);
	set_plane(1);
	memcpy(0xC00A0000, dev->mem1, 128*1024);
	set_plane(2);
	memcpy(0xC00A0000, dev->mem2, 128*1024);
	set_plane(3);	
	memcpy(0xC00A0000, dev->mem3, 128*1024);
	set_plane(0);

	free(dev->mem0);
	free(dev->mem1);
	free(dev->mem2);
	free(dev->mem3);

	write_regs(dev->regs);
	free(dev->regs);
	dev->regs = 0;
}
Exemple #4
0
////////////////////////////////////////////////////////////////////////////////
// Functions
////////////////////////////////////////////////////////////////////////////////
static int vga_generic_set_mode(vgageneric_handle_t *dev, int width, int height, int bpp)
{
	dev->regs = malloc(128);
	read_regs(dev->regs);

	write_regs(g_640x480x16);

	dev->mem0 = malloc(128*1024);
	dev->mem1 = malloc(128*1024);
	dev->mem2 = malloc(128*1024);
	dev->mem3 = malloc(128*1024);

	set_plane(0);
	memcpy(dev->mem0, 0xC00A0000, 128*1024);
	set_plane(1);
	memcpy(dev->mem1, 0xC00A0000, 128*1024);
	set_plane(2);
	memcpy(dev->mem2, 0xC00A0000, 128*1024);
	set_plane(3);	
	memcpy(dev->mem3, 0xC00A0000, 128*1024);

	return 1;
}
Exemple #5
0
void VGA_clear_screen() {
   unsigned int x=0;
   unsigned int y=0;
   //qVGA_map_color(0, 0xFF, 0xFF, 0xFF);
   for(int p = 0; p < 4; p++)
   {
	set_plane(p);
	memset(VGA_address, 0, 64*1024);
   }
   /*for(y=0; y<VGA_height; y++){
      for(x=0; x<VGA_width; x++){
         VGA_address[VGA_width*y+x]=0x00;
      }
   }*/
}
Exemple #6
0
void
QtUtil :: Grid3DView :: contextMenuEvent (QContextMenuEvent * e)
{
	QMenu m;

	QMenu set_plane (tr ("Plane"));
	{
		set_plane .addAction (tr ("XY (Front)"), this, SLOT (set_xy()));
		set_plane .addAction (tr ("XZ (Top)"),   this, SLOT (set_xz()));
		set_plane .addAction (tr ("YZ (Side)"),  this, SLOT (set_yz()));
	}
	
	m .addMenu (& set_plane);

	m .exec (mapToGlobal (e -> pos ()));
}
Exemple #7
0
static void write_pixel4p(unsigned x, unsigned y, unsigned c)
{
	unsigned wd_in_bytes, off, mask, p, pmask;

	wd_in_bytes = VGA_width / 8;
	off = wd_in_bytes * y + x / 8;
	x = (x & 7) * 1;
	mask = 0x80 >> x;
	pmask = 1;
	for(p = 0; p < 4; p++)
	{
		set_plane(p);
		if(pmask & c)
			*(char*)(0xA000*16+off) = (*(char*)((unsigned int)0xA000*16 + off))|mask;
		else
			*(char*)(0xA000*16+off) = (*(char*)((unsigned int)0xA000*16 + off))&~mask;
		pmask <<= 1;
	}
}
Exemple #8
0
PlaneShape::PlaneShape() : Shape( PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_PLANE)) {

	set_plane(Plane(0,1,0,0));
}
 inline PlanarDomain(const Vector3D& normal, const Vector3D& point)
   { set_plane( normal, point ); }
Exemple #10
0
void
QtUtil :: Grid3DView :: set_yz ()
{
	set_plane (Plane :: YZ);
}
Exemple #11
0
void
QtUtil :: Grid3DView :: set_xz ()
{
	set_plane (Plane :: XZ);
}
Exemple #12
0
void
QtUtil :: Grid3DView :: set_xy ()
{
	set_plane (Plane :: XY);
}