Then either we are long from knowing how the real chip8 did here, or the chip8 simply did what currently our emulators does. Though I doubt that. David's (that was the authors name, right? He who wrote the chip8 doc most everyone uses... david winter I think) emulator emulates it differently from mine.hap said:Doomulation: that would be 'Field'. it, and many other games, look nicer if you implement horizontal and vertical sprite wrapping. what i mean with this is that if you'd draw a 2 by 2 square at 127,63 (bottom right), it would show as 4 pixels; one in each corner of the screen. Blitz has problems with vertical wrapping though, so i've made wrapping optional here.
Doomulation said:Then either we are long from knowing how the real chip8 did here, or the chip8 simply did what currently our emulators does. Though I doubt that. David's (that was the authors name, right? He who wrote the chip8 doc most everyone uses... david winter I think) emulator emulates it differently from mine.
Shrug... well, I think I have near perfect emulation anyway![]()
No... what I find in the debugger doesn't help anymore. And it basically lists all instructions (what they do). Besides, I don't want to do reverse engineering >_< or well... ehh, finding out these things in general. You go get 'em, and i implemt 'em!aprentice said:have you tried disassembling the game and finding out for yourself how it suppose to work?
hap said:if i'm reading it correctly (haven't compiled/tested), your collision detection is broken. let's consider a square collides with a circle, then in your case it wouldn't be a collision, since the last pixel of the square doesn't collide with the circle. instead, put a reg.v[0x0f]=0; at the start of the sprite drawing function, and an if(!reg.v[0x0f]) { .... } around the collision detection. this way, the flag will only be set if it hasn't already been set in a previous spriteline.
I must add that this does indeed fix quite some things. But how does the real system do it? Don't know.refraction said:nah i know exactly why hes done that, chip8 doesnt reset the colision detection anywhere, so if you did that, soon as there's a colision, nothing will get drawn, so its best to reset the collision flag at the beginning of the drawing routine.
hap said:I did Google around. What you've just linked to is the rom collection that's included in Dave Winter's emu, those are found everywhere.
Drawing the 16 x 16 pixels SCHIP sprite in CHIP-8 mode will display an 8 x 16 sprite (because only the first 16 bytes of this sprite will be used). The result is that a 16 x 16 SCHIP sprite will not be correctly displayed in the 64 x 32 resolution. However, this instruction allows drawing an 8 x 16 sprite, which cannot be performed with the standard CHIP-8 drawing instruction.
We saw that a pixel of the 64 x 32 resolution is twice bigger than one of the 128 x 64 one. Another consequence of this is that the vertical scrolling instruction is different in the 64 x 32 resolution. In this one, it will scroll half the lines it would have scrolled in SCHIP mode. Note that if the number of lines to scroll is ODD, the scroll will be performed with a half-pixel shift !