What's new

Chip 8

TheImpaler

New member
I've been Studying hardware docs and emulation for a few months with the intention of creating an emulator, so what better way to start then with a Chip8. or so I've been told before :p

I hope to produce something in the near future :)

Edit: Hmm, a thought just came into my head, would it be worth my while making this to work on linux and mac also?
 
Last edited:

_pm_

Pathetic Member
TheImpaler said:
I've been Studying hardware docs and emulation for a few months with the intention of creating an emulator, so what better way to start then with a Chip8. or so I've been told before :p

I hope to produce something in the near future :)

Edit: Hmm, a thought just came into my head, would it be worth my while making this to work on linux and mac also?
It's always nice to know that people gets interested in writing new emulators. I'd like to write a NES and a C64 emulator someday, when I have more time, just for fun.
About linux and mac, if you want to make a cross-platform project, I suggest you use a cross-platform media library, like SDL or Allegro, it will make your life easier :)
Btw, I love using SDL for my games :)
 
Last edited:

TheImpaler

New member
_pm_ said:
It's always nice to know that people gets interested in writing new emulators. One of my dreams is to write a NES and a C64 emulator someday, just for fun.
About linux and mac, if you want to make a cross-platform project, I suggest you use a cross-platform media library, like SDL or Allegro, it will make your life easier :)
Btw, I love using SDL for my games :)

lol, I've seen one or two games programmed with SDL, I actually at the moment am using eclipse (Java Based) and Visual C++ 6.0 I'm just going to keep programming for the sake of programming so I can get more experience while I'm going along, I had tried to make a saturn emulator and was literally shot down in flames due to my n00biness lol
 

hap

New member
Astonishment made you say it 3 times in a row ? ;)

But Saturn.. whoa indeed, I'd say even the N64 or Playstation are very simple compared to that.
 

_pm_

Pathetic Member
Yeah, Saturn is probably one of the most complex consoles to emulate (if not the most), that's the reason for the lack of Saturn emulators, compared with PSX, N64 or even GC. If you managed to make it boot, congratulations :)
 
Last edited:

TheImpaler

New member
_pm_ said:
Yeah, Saturn is probably one of the most complex consoles to emulate (if not the most), that's the reason for the lack of Saturn emulators, compared with PSX, N64 or even GC. If you managed to make it boot, congratulations :)

I didn't even get that far lol, but hopefully I should get something on this chip8 done in the near future :p
 

_pm_

Pathetic Member
TheImpaler said:
I didn't even get that far lol, but hopefully I should get something on this chip8 done in the near future :p
Good luck!!! :p
Please keep us updated on your progress! :)
 

Doomulation

?????????????????????????
bcrew1375 said:
Yes... you DID post three times a row, so that's probably to whom he's referring. I know that problem all too well, though. Stupid database or sumethin'.
 

|\/|-a-\/

Uli Hecht
i tried to read the whole thread, to avoid questions which were already asked. but it's too much!!!
i coded a chip8 emu, too. looking in the hex viewer i saw the cause, why pong.ch8 doesn't work: a 224D instruction, call sub-routine @ 0x24D. the binary is 246 bytes long, so @ 0x24D you won't find instructions:

Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F

00000000 6A 02 6B 0C 6C 3F 6D 0C A2 EA DA B6 DC D6 6E 00 j.k.l?m.¢êÚ¶ÜÖn.
00000010 22 D4 66 03 68 02 60 60 F0 15 F0 07 30 00 12 1A "Ôf.h.``ð.ð.0...
00000020 C7 17 77 08 69 FF A2 F0 D6 71 A2 EA DA B6 DC D6 Ç.w.iÿ¢ðÖq¢êÚ¶ÜÖ
00000030 60 01 E0 A1 7B FE 60 04 E0 A1 7B 02 60 1F 8B 02 `.à¡{þ`.à¡{.`.‹.
00000040 DA B6 60 0C E0 A1 7D FE 60 0D E0 A1 7D 02 60 1F Ú¶`.à¡}þ`.à¡}.`.
00000050 8D 02 DC D6 A2 F0 D6 71 86 84 87 94 60 3F 86 02 �.ÜÖ¢ðÖq†„‡”`?†.
00000060 61 1F 87 12 46 02 12 78 46 3F 12 82 47 1F 69 FF a.‡.F..xF?.‚G.iÿ
00000070 47 00 69 01 D6 71 12 2A 68 02 63 01 80 70 80 B5 G.i.Öq.*h.c.€p€µ
00000080 12 8A 68 FE 63 0A 80 70 80 D5 3F 01 12 A2 61 02 .Šhþc.€p€Õ?..¢a.
00000090 80 15 3F 01 12 BA 80 15 3F 01 12 C8 80 15 3F 01 €.?..º€.?..È€.?.
000000A0 12 C2 60 20 F0 18 22 D4 8E 34 22 D4 66 3E 33 01 .Â` ð."ÔŽ4"Ôf>3.
000000B0 66 03 68 FE 33 01 68 02 12 16 79 FF 49 FE 69 FF f.hþ3.h...yÿIþiÿ
000000C0 12 C8 79 01 49 02 69 01 60 04 F0 18 76 01 46 40 .Èy.I.i.`.ð.v.F@
000000D0 76 FE 12 6C A2 F2 FE 33 F2 65 F1 29 64 14 65 00 vþ.l¢òþ3òeñ)d.e.
000000E0 D4 55 74 15 F2 29 D4 55 00 EE 80 80 80 80 80 80 ÔUt.ò)ÔU.€€€€
000000F0 80 00 00 00 00 00 €.....
 

ector

Emulator Developer
If i remember correctly, you shouldn't load the binary into memory position 0, you should load it at 0x200 bytes into memory. Then the branch will hit its target :)
Also there should be a little "font" at the start of memory. I load it like this in my old C# chip8 emu:
Code:
			byte [] chip8_sprites = {
				0xf9,0x99,0xf2,0x62,0x27,
				0xf1,0xf8,0xff,0x1f,0x1f,
				0x99,0xf1,0x1f,0x8f,0x1f,
				0xf8,0xf9,0xff,0x12,0x44,
				0xf9,0xf9,0xff,0x9f,0x1f,
				0xf9,0xf9,0x9e,0x9e,0x9e,
				0xf8,0x88,0xfe,0x99,0x9e,
				0xf8,0xf8,0xff,0x8f,0x88,
			};

			for (int i=0; i<40; i++)
			{
				SetByte(i*2,   (byte)((chip8_sprites[i]&0xf0)));
				SetByte(i*2+1, (byte)(chip8_sprites[i]<<4));
			}
 

|\/|-a-\/

Uli Hecht
oh, sure 0x200, i loaded it to 200 *hahaha*. i wouldn't have noticed it, if you hadn't answered, thanks dude! but i don't know anything about the fonts...
i saw a header in a few games, for example
"BLITZ By David WINTER" ?!
 
Last edited:

refraction

PCSX2 Coder
|\/|-a-\/ said:
oh, sure 0x200, i loaded it to 200 *hahaha*. i wouldn't have noticed it, if you hadn't answered, thanks dude! but i don't know anything about the fonts...
i saw a header in a few games, for example
"BLITZ By David WINTER" ?!


just do what ector said, you can load it into memory for 0x0 onwards, makes it easier to call then

for chip8 font pointer do

I = 0x0 + v(register);

for schip

I = 0x80 + (v(register) *4); (change 80 to where ever your schip fonts start)
 

ector

Emulator Developer
the font only contains characters 0-9 A-F but that's enough for a score display, that's what it's mostly used for :)
 

|\/|-a-\/

Uli Hecht
i use my emu as an debugger. the instruction points to hex char sprite 0x20 (in V1 i think). but you said, there are only 16 chars fopr showing the score. this shows me i still don't know how this works
 

smcd

Active member
OK, so I've actually started on my chip 8 thing. It's not in good form yet, still need graphics and input but everything else is coded. Yeah, I'm slow. Oh well, maybe by next year I'll have it finished.
 

Top