virtualSoC  0.6.2
baskett
Vcsos.Komponent.Framebuffer Class Reference
+ Inheritance diagram for Vcsos.Komponent.Framebuffer:

Public Member Functions

 Framebuffer ()
 
void Init ()
 
void Destroy ()
 
void SetPixel (int colorRef, int x, int y)
 Sets the pixel. More...
 
int GetPixel (int x, int y)
 

Public Attributes

const uint FBINFO = 0xAFD0
 
const uint FBBASE = 0xB000
 

Properties

InitFrameBuffer InitFunction [get, set]
 
Size Size [get]
 
Memory Memory [get]
 
string Name [get]
 
string Author [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ Framebuffer()

Vcsos.Komponent.Framebuffer.Framebuffer ( )
138  : base("Referenz GPU", "Anna-Sophia Schroeck")
139  {
140  }

Member Function Documentation

◆ Destroy()

void Vcsos.Komponent.Framebuffer.Destroy ( )
164  {
165  GC.Collect ();
166  }

◆ GetPixel()

int Vcsos.Komponent.Framebuffer.GetPixel ( int  x,
int  y 
)
182  {
183  int offset = (int)(FBBASE + (y * m_pInfo.Width * 3 + x * 3));
184 
185  byte r = MemoryMap.Read8 (offset + 0);
186  byte g = MemoryMap.Read8 (offset + 1);
187  byte b = MemoryMap.Read8 (offset + 2);
188 
189  return ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff);
190  }
const uint FBBASE
Definition: Framebuffer.cs:113
int Width
Definition: Framebuffer.cs:46

◆ Init()

void Vcsos.Komponent.Framebuffer.Init ( )
143  {
144  int colorRef = VM.Instance.CurrentCore.Register.Stack.Pop32 ();
145  int mode = VM.Instance.CurrentCore.Register.Stack.Pop32 ();
146 
147  m_pInfo = new FrameBufferInfo (mode);// = new Size (w, h);
148  m_pMemory = new Memory(m_pInfo.Size, "FrameBuffer");
149  m_pGPUCore = new Core(0);
150 
151 
152  for (int x = 0; x < m_pInfo.Width; x++) {
153  for (int y = 0; y < m_pInfo.Height; y++) {
154  SetPixel (colorRef, x, y);
155  }
156  }
157 
158 
159  if (m_pInitFunction != null)
160  m_pInitFunction (m_pInfo);
161  }
int Size
Definition: Framebuffer.cs:47
void SetPixel(int colorRef, int x, int y)
Sets the pixel.
Definition: Framebuffer.cs:173
int Width
Definition: Framebuffer.cs:46
Definition: Core.cs:26
Definition: Framebuffer.cs:42
Memory Memory
Definition: Framebuffer.cs:132
int Height
Definition: Framebuffer.cs:46

◆ SetPixel()

void Vcsos.Komponent.Framebuffer.SetPixel ( int  colorRef,
int  x,
int  y 
)

Sets the pixel.

Parameters
colorRefColor RGB String
xThe x coordinate.
yThe y coordinate.
174  {
175  int offset = (int)(FBBASE + (y * m_pInfo.Width * 3 + x * 3));
176 
177  MemoryMap.Write((byte)((colorRef & 0xFF0000) >> 16), offset + 0);
178  MemoryMap.Write ((byte)((colorRef & 0x00FF00) >> 8), offset + 1);
179  MemoryMap.Write ((byte)((colorRef & 0x0000FF)), offset + 2);
180  }
const uint FBBASE
Definition: Framebuffer.cs:113
int Width
Definition: Framebuffer.cs:46

Member Data Documentation

◆ FBBASE

const uint Vcsos.Komponent.Framebuffer.FBBASE = 0xB000

◆ FBINFO

const uint Vcsos.Komponent.Framebuffer.FBINFO = 0xAFD0

Property Documentation

◆ Author

string Vcsos.Komponent.vmKomponente.Author
getinherited

◆ InitFunction

InitFrameBuffer Vcsos.Komponent.Framebuffer.InitFunction
getset

◆ Memory

Memory Vcsos.Komponent.Framebuffer.Memory
get

◆ Name

string Vcsos.Komponent.vmKomponente.Name
getinherited

◆ Size

Size Vcsos.Komponent.Framebuffer.Size
get

The documentation for this class was generated from the following file: