Garstyciuks
New member
I am glad that you like it
Nice!!
When you're ready , can you please post the source?
I really wanna see how your app works
edit:
By the way , can you tell me how you render the tiles?
With resized quads? or with another way?:
for (i=0; i<32 ; i++) //for all lines...
{
for (j=0; j<64; j++) // ...and rows
{
if (Screen[j + i*64]) // if there is a pixel to draw....
{
glPointSize(10.0); //set the pixel size
glBegin(GL_POINTS); //draw the pixel on the screen
glVertex2i(i*10,j*10);
glEnd();
}
}
}
void sprite(BYTE pX, BYTE pY, BYTE Length) /*drys*/
{
BYTE lineY=0, lineX=0;
BYTE data,offset;
if (V[pY] + Length > 32) Length = 32-V[pY];
for ( ; lineY<Length; lineY++)
{
data = Memory[I + lineY];
for (offset=0 ; data!=0; data<<=1, offset++) //set screen until no more pixel remain in data
{
if (data & 0x80)
{
if (Screen[(V[pX]+64*(V[pY] + lineY) ) + offset] == 0x1) V[15]=1;
Screen[(V[pX]+64*(V[pY] + lineY) ) + offset] ^= 0x1;
}
}
}
}
My screen is a vector Screen[64*32]. I created a 640x320 window and the function that show the screen do this:
Code:for (i=0; i<32 ; i++) //for all lines... { for (j=0; j<64; j++) // ...and rows { if (Screen[j + i*64]) // if there is a pixel to draw.... { glPointSize(10.0); //set the pixel size glBegin(GL_POINTS); //draw the pixel on the screen glVertex2i(i*10,j*10); glEnd(); } } }
glPointSize(10.0);
glBegin(GL_POINTS);
for (i=0; i<32 ; i++)
{
for (j=0; j<64; j++)
{
if (Screen[j + i*64])
{
glVertex2i(i*10,j*10);
}
}
}
glEnd();
Can i ask all emu authors a question?
Can i take some parts of your code , and try to learn from them?
Of course , you'll be in credits!
(flags & a_Random_flag)
flags &= ~CPU_FLAGWAITING;
(mem->memory[pc+0]<<8)
memset(mem->vram, 0, 128*64);
for y = 0 to 64
for x = 0 to 128
vram[x][y] = 0;
x_pos = ((x+i)%64)<<1;
y_pos = ((y+j)%32)<<1;
if (reg[(opcode&0x0F00)>>8] == reg[(opcode&0x00F0)>>4]) pc+=2;
reg[(opcode&0x0F00)>>8]
reg[(opcode&0x00F0)>>4]
Contents of register X as specified by the opcode. If the opcodes look like this: 0xABCD, then it's the contents of register 0xB (or 11 to all you non-hex understanders).PHP:reg[(opcode&0x0F00)>>8]
Contents of register Y as specified by the opcode. Again, using the above example, it's register 0xC, or 12.The fixed memory value?PHP:reg[(opcode&0x00F0)>>4]
The interpreter takes the decimal value of Vx, and places the hundreds digit in memory at location in I, the tens digit at location I+1, and the ones digit at location I+2.
case 0x33:
{
memory[I] = static_cast<char>((VX%1000)*.01f);
memory[I+1] = static_cast<char>((VX%100)*.1f);
memory[I+3] = static_cast<char>(VX%10);
break;
}
#define VX (reg[(instruction >> 8) & 0x0f])