What's new

Chip 8

bronxbomber92

New member
All right, my Chip8 emu is pretty much finished (a few bugs left, but I don't feel like tracking them done :p).

What would be the next step from here? What would you guys suggest I try to emulate next?
 

d0u6

New member
A Game Boy emu is a good candidate. Or maybe a more complex like a Nes, genesis, pcEngine, etc...
 

Doomulation

?????????????????????????
Gameboy is a pretty big step up from Chip8 though. It's much more complex.
There should be good systems in-between, but I don't know such, though I know there are some. At least one has been mentioned before.
 

pradipna

New member
I am working in this chip 8 emulator project written in VB. I have made pretty much progress in past couple of days and games like blitz and space invaders are playable but I have some problems with font and stuffs. Here are some pictures:

chip86.jpg


chip87.jpg


chip89.jpg


The problem of font not showing is caused by this instruction I guess: FX29 I points to the 4 x 5 font sprite of hex char in VX. I don't really know how to implement it.
 

d0u6

New member
My Fr29 instruction

Code:
void font(BYTE Register) /* fr29  	 font vr*/
{
	I = ((WORD) V[Register]) * 5;
}

And fonts are 8x5 bits, or 5bytes
 
Last edited:

Doomulation

?????????????????????????
I do not see how you cannot. They're bit-encoded. Basically, it's just data the the game points to then calls the draw sprite instruction.
As d0u6 mentioned, store the fonts somewhere in memory, and when the instruction is called, set the I register to the position where that data is stored.
I'm not sure if games can set the I register to font manually without using said instruction, but let's be careful and assume they can. Store font data at position 0 in memory and upwards.
TIP: You can also use Alt+Print Screen to take a snapshot of the current window.
 

Doomulation

?????????????????????????
If you're sure, then it should be a simple matter to find out why it isn't. Look for instructions that sets I to VX font or instructions that sets I to interpreter memory (< 0x200).
 

d0u6

New member
did you do a disassembler? If yes, follow the game instruction and you will find the error. Put some printf in the instructions that use I to make the work easier..... Good luck.....
 

pradipna

New member
My code for font FX29:

Code:
Dim mem(4096) as byte  ' in general declaration

'in form load event

    mem(0) = 240
    mem(1) = 144
    mem(2) = 144
    mem(3) = 144
    mem(4) = 240
    .
    .
    .
    .
    mem(76) = 128
    mem(77) = 240
    mem(78) = 128
    mem(79) = 128

'and then in Sub IPointsSpriteinVX()

addI = (v(opcode2) * 5)

I don't think there's is anything wrong with that code and works perfectly fine with other games except Blitz...
 

pradipna

New member
Finally I found the problem. After going through the Cowgod's Refrence, I found my 'FX33 Store BCD representation of VX in M(I)...M(I+2)' instruction was wrongly implemented, so I re-wrote the code and it worked. Yayyyyyyy....
Here's some latest pictures:

chip813.jpg

chip814.jpg


I checked the compability and most chip 8 games are playable except the one named Hidden. In that game even if I open two wrong cards it says YEP! which should have been OPPS!. lol
 

orphean

New member
Chip8 Disassembler

This is a Chip-8 disassembler I wrote in C#. It requires .NET to be installed. Its based off of David Winter's UNCHIP but supports the few opcodes UNCHIP did not.

Here is an example of output:

Code:
; C8Dasm Version 1.0, Les Harris ([email protected])

; Input File: WIPEOFF (206 bytes)

	ld	I,	2CC
	ld	VA,	#07
	ld	V1,	#00
 0206:
	ld	VB,	#08
	ld	V0,	#00
 020A:
	drw	V0,	V1,	1
	add	V0,	#08
	add	VB,	#FF
	se	VB,	#00
	jp	20A
	add	V1,	#04
	add	VA,	#FF
	se	VA,	#00
	jp	206
	ld	V6,	#00
	ld	V7,	#10
	ld	I,	2CD
	ld	V0,	#20
	ld	V1,	#1E
	drw	V0,	V1,	1
 0228:
	ld	V3,	#1D
	ld	V2,	#3F
	and	V2,	V0
	add	V7,	#FF
	sne	V7,	#00
	jp	2AA
	ld	VF,	K
 0236:
	ld	I,	2CB
	drw	V2,	V3,	1
	ld	V5,	#FF
	rnd	V4,	#01
	se	V4,	#01
	ld	V4,	#FF
 0242:
	ld	I,	2CD
	ld	VC,	#00
	ld	VE,	#04
	sknp	VE
	ld	VC,	#FF
	ld	VE,	#06
	sknp	VE
	ld	VC,	#01
	drw	V0,	V1,	1
	add	V0,	VC
	drw	V0,	V1,	1
	sne	VF,	#01
	jp	298
	sne	V2,	#00
	ld	V4,	#01
	sne	V2,	#3F
	ld	V4,	#FF
	sne	V3,	#00
	ld	V5,	#01
	sne	V3,	#1F
	jp	2A4
	ld	I,	2CB
	drw	V2,	V3,	1
	add	V2,	V4
	add	V3,	V5
	drw	V2,	V3,	1
	se	VF,	#01
	jp	242
	sne	V3,	#1E
	jp	298
	ld	VA,	#02
	ld	ST,	VA
	add	V6,	#01
	sne	V6,	#70
	jp	2AA
	drw	V2,	V3,	1
	rnd	V4,	#01
	se	V4,	#01
	ld	V4,	#FF
	rnd	V5,	#01
	se	V5,	#01
	ld	V5,	#FF
	jp	242
 0298:
	ld	VA,	#03
	ld	ST,	VA
	ld	I,	2CB
	drw	V2,	V3,	1
	add	V3,	#FF
	jp	236
 02A4:
	ld	I,	2CB
	drw	V2,	V3,	1
	jp	228
 02AA:
	ld	I,	2CD
	drw	V0,	V1,	1
	ld	I,	2F0
	bcd	V6,	[I]
	ld	V2,	[I]
	ld	V3,	#18
	ld	V4,	#1B
	ld	F,	V0
	drw	V3,	V4,	5
	add	V3,	#05
	ld	F,	V1
	drw	V3,	V4,	5
	add	V3,	#05
	ld	F,	V2
	drw	V3,	V4,	5
 02C8:
	jp	2C8
	dw	#0180
 02CC:
	sne	V4,	#FF

Source is included.

I doubt anyone is that interested in this but I figured this is probably the only place someone might be interested at all so here it is!

Download: View attachment 37825
 

smcd

Active member
Heh, that's about as far as I got for my emulator/simulator - built a core and disassembler, never implemented graphics. Maybe one of these days I'll finish :(
 

Top