Quote:
Originally Posted by runawayprisoner
Then check if you are not drawing the first pixel at 10 or something?
|
Yep man, you are right again...
Quote:
Originally Posted by runawayprisoner
I have more, but I still can't find the time to compose all of them into a text file, it's just taking notes at this point. I have with me now a few timing tips, and a lot of sound tips, apparently... after having hell with implementing them the right way.
As for the MegaChip, I haven't seen anything much of it aside from MegaTwister and MegaBlinky. It seems to have a 256 x 128 framebuffer, and 256 colors support, though I really fail to see the point of having that many colors. Seems like we're going to have to deal with quite a bizarre drawing function next... most likely something with fixed sprite size, and the pallete (16 colors max for each sprite, maybe?) would be right in front of the sprite data. Dunno... just a guess. They made the tech demo look so different (and slow) that I'm having weird feelings about this.
|
Thanks for the info... I was just curios about the MegaChip ...
For a while I'll release my chip8 schip8 implementation and source code too... I hope it can help anyone that are looking for info to chip8 schip8....
The language was Java and the render was Java2D (you can

but it can be slow if you are a bad coder as I'm). So it is the Chip8 Emulator made with Java.
The chip8 games running under JChip8BR
The schip8 games running under JChip8BR
Dissambler with two differents ways.
You can see the memory values and address.
You can debug step by step and see the registers values thus like the Screen. (pong is doing that here)
You can config some values at runtime.
* check the "just draw at .... " there if you are playing pong is better put 1 however if you are playing schip games you can "skip" more frames.
The JChip8BR and source code too are attached.
2shared - download jchip8br.rar
Some notes:
* The drw insctruction can draw "outside" of 64x32 or 128x64.
* The chip8/schip8 rom doesn't have header, you can just load it starting from address 0x200.
* The initial state of this "machine" is:
programCounter = 0x200;
stackPointer = 0x00;
delayTimerDT = 0x00;
soundTimerST = 0x00;
v[0-f] = 0x00;
* All the instruction are 2Bytes size, you get it by bigEndian way.
* If you are using java, did you know about the unsigned types... on java. Well the insctruction
ADD V[X],VALUE give me a lot of pain. Tetris game sends to you add 0xFF + 0x0F = ??? If you were
using short you will have 0x10E however the right is 0x0E:
jchip8br.util.Util.readUnsignedByte((byte) ((byte) 0xFF + (byte) 0x0f));
* Keep in mind the importance of V[F] as a "flag".
* For graphics is better keep the 0s and 1s in a array is easy to handle.
* Scroll Down X (easily with array way).
Code:
--timesToScroll;
int[][] newvram = new int[xboundary][yboundary];
for (int y = 0; y < yboundary; y++) {
for (int x = 0; x < xboundary; x++) {
if (y <= timesToScroll) {
newvram[x][y] = 0x0;
} else {
newvram[x][y] = vram[x][y - (timesToScroll + 1)];
}
}
}
vram = newvram;
* Scroll left/rigth is easier too. (keep in mind that I made my array bigger than resolution.)
Code:
public void scroll4PixelsToLeft() {
log.debug("scroll left " + pixelsToShift);
int[][] newvram = new int[xboundary][yboundary];
for (int y = 0; y < yboundary; y++) {
for (int x = 0; x < xboundary; x++) {
if (pixelsToShift == 4) {
if (x == 134 || x == 135 || x == 136 || x == 137) {
newvram[x][y] = 0x0;
} else {
newvram[x][y] = vram[x + 4][y];
}
} else {
if (x == 62 || x == 63) {
newvram[x][y] = 0x0;
} else {
newvram[x][y] = vram[x + 2][y];
}
}
}
}
vram = newvram;
}
public void scroll4PixelsToRigth() {
log.debug("scroll right " + pixelsToShift);
int[][] newvram = new int[xboundary][yboundary];
for (int y = 0; y < yboundary; y++) {
for (int x = 0; x < xboundary; x++) {
if (pixelsToShift == 4) {
if (x == 0 || x == 1 || x == 2 || x == 3) {
newvram[x][y] = 0x0;
} else {
newvram[x][y] = vram[x - 4][y];
}
} else {
if (x == 0 || x == 1) {
newvram[x][y] = 0x0;
} else {
newvram[x][y] = vram[x - 2][y];
}
}
}
}
vram = newvram;
}
* Always that you start the drw instruction set the V[F] = 0x0;so if has some colision you set
V[F] = 0x1;
* Thanks for
runawayprisoner & all docs info provide by Internet.
ps: the problem quoted by runawayprisoner still exists in schip8 games.
Last edited by dreampeppers99; January 9th, 2009 at 16:26..