Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read

Reply
 
Thread Tools Display Modes
Old April 7th, 2007, 12:19   #1
wannabecoder
Registered User
 
Join Date: Apr 2007
Location: -_-ffs
Posts: 2
chip8 emulator --- help needed ---

Allrightz.
Im sure thats the right place to ask my questions().

Here we go!.

First of all , i wanna let you know that im Pascal(delphi) programmer (most) , but i also have basic knowledge of c++(my first "finished" program was a spaceshooter using SDL library...also a noobish opengl application with some falling cubes.. if that counts) and php/sql/js.

I think thats enough for now...now , please answer my questions.


1)
Can i use the console to draw stuff?or its important to use an api?(dx/sdl/gl)


2)
Can you explain me what does the following code ?
Quote:
if ((Opcode >> 4) & 0xf)
{
-....
}
what does the ">>" and "&" operator?
Can you give a basic example so i can understand it?

3) How can i use a "u8" variable?

Thats all (for now)...:

Last edited by wannabecoder; April 7th, 2007 at 12:28..
wannabecoder is offline   Reply With Quote

Advertisement [Remove Advertisement]

Old April 7th, 2007, 13:49   #2
Falcon4ever
Plugin coder / Betatester
 
Falcon4ever's Avatar
 
Join Date: Jun 2003
Posts: 323
1. you can use whatever you want. Some people have used the console for it, but imo you should just try using a simple framework build with directdraw or SDL.

2. Shift the opcode 4 bits to the right and perform an AND operation with 0xF
(An introduction to bitwise operators - The Code Project - C++ / MFC)
Code:
   
  00110010  - some opcode
& 00001111  - & 0xF
  ----------
  00000010  - result
3. just add the type definition yourself: typedef unsigned char u8;

http://emutalk.net/showthread.php?t=19894 <- a great thread for general information about chip8 emu programming.

Last edited by Falcon4ever; April 7th, 2007 at 13:56..
Falcon4ever is offline   Reply With Quote

Old April 7th, 2007, 16:40   #3
refraction
PCSX2 Coder
 
refraction's Avatar
 
Join Date: Jan 2004
Location: Plymouth, UK
Posts: 10,037
just to make what Falcon said more visible, ill do what that line says

Code:
  00110010  - some opcode
  00000011  - some opcode shifted right (>>) 4 bits
& 00001111  - & 0xF
  ----------
  00000011  - result
__________________

http://www.pcsx2.net
Intel i7 920 @ 3.4Ghz, POV GTX 570 1.3Gb, 1.8Tb HD space, 6Gb OCZ Reaper PC3-14400 Triple Channel
Dont PM me for help, use the forums, thats what its for!


My Chip16 Emulator RefChip16 http://code.google.com/p/refchip16/
refraction is offline   Reply With Quote

Old April 7th, 2007, 22:50   #4
wannabecoder
Registered User
 
Join Date: Apr 2007
Location: -_-ffs
Posts: 2
Thanks alot!
Im so happy that i found people that can actually help me in such advanced stuff!.

Very cool!
wannabecoder is offline   Reply With Quote

Old April 8th, 2007, 00:09   #5
Chrono Archangel
 
Chrono Archangel's Avatar
 
Join Date: Dec 2001
Location: Montreal, Canada
Posts: 8,090
Alot of people here made a Chip8 emu (including me ) so if you have any questions, dont be shy

Welcome to Emuforums btw
Chrono Archangel is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 05:51.

© 2006 - 2012 Emu Forums | About Emu Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.