Emuforums.com

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


Reply
 
LinkBack Thread Tools Display Modes
Old April 2nd, 2009   #101 (permalink)
Bruce Willis as Ichigo...
 
strike105x's Avatar
 
Join Date: Apr 2007
Location: ...means Bleach ends after episode 1
Posts: 3,557
Great going ^^ nice to see your progressing with your emu .
strike105x is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old April 2nd, 2009   #102 (permalink)
Regular User ;)
 
Phil's Avatar
 
Join Date: Oct 2007
Location: Naples Florida
Posts: 9,964
Cant wait to try the finished product
Phil is offline   Reply With Quote
Old April 2nd, 2009   #103 (permalink)
No sir. I don't like it.
 
masta.g.86's Avatar
 
Join Date: Oct 2008
Location: Alabama
Posts: 2,455
Nice work, Dax.

NOW GET TO WORK ON MY PS3 EMU! (the noobz are getting restless)

<cracks whip>
__________________
Quote:
The truth is there for those who choose to see it.
Phenom II X4 @ 3.6GHz | 4GB OCZ Dominator DDR3 @ 1600MHz
Sapphire Vapor-X Radeon HD4850 | Samsung TOC 24" 1920x1200
Auzentech X-Fi Forte 7.1 | Klipsch Promedia 5.1 THX
LG H20L BD-RE | WD Caviar Black 1TB 7200RPM
GIGABYTE GA-MA790FXT-UD5P | Windows 7 x64 Ultimate

Join the NGEmu Folding@Home Team! Info
Download the standard client here OR preferably download the GPU or SMP client here.
Set your team ID to: 161326
NGEmu Stats Page: Here
masta.g.86 is offline   Reply With Quote
Old April 2nd, 2009   #104 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
Blitz shows BBBBB instead of BLITZ and goes ingame, and gives you a game over 3 seconds into it. I'm looking into why. If my frequent updates annoy you, let me know. I just think it's cool to stay in touch.

Edit: BBBBB bug fixed. Was an error in my addition code. Now to figure out why Space Invaders' marquee is garbled.

Edit 2: Space Invaders Marquee was garbled due to the Fx65 opcode not checking for <= 0, instead of < 0, so it skipped the loop. Now it's perfect!

Last edited by Dax; April 2nd, 2009 at 09:43..
Dax is offline   Reply With Quote
Old April 2nd, 2009   #105 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
Minor update: I'm having a bug with my input: If you hold down any keys in pong, then you cannot move the opposite paddle. Why is my input limited to one "movement" at a time? Any ideas are welcome.

Code:
void get_input(void)
{
	static BYTE keystate[256];
	dx_keyboard->GetDeviceState(256, (LPVOID)keystate);

	for(i = 0x0; i <= 0xF; i++)
		keys_pressed[i] = false;

	//if the keys are down..
	if(keystate[DIK_X] & 0x80)
		keys_pressed[0x0] = true;
	if(keystate[DIK_1] & 0x80)
		keys_pressed[0x1] = true;
	if(keystate[DIK_2] & 0x80)
		keys_pressed[0x2] = true;
	if(keystate[DIK_3] & 0x80)
		keys_pressed[0x3] = true;
	if(keystate[DIK_Q] & 0x80)
		keys_pressed[0x4] = true;
	if(keystate[DIK_W] & 0x80)
		keys_pressed[0x5] = true;
	if(keystate[DIK_E] & 0x80)
		keys_pressed[0x6] = true;
	if(keystate[DIK_A] & 0x80)
		keys_pressed[0x7] = true;
	if(keystate[DIK_S] & 0x80)
		keys_pressed[0x8] = true;
	if(keystate[DIK_D] & 0x80)
		keys_pressed[0x9] = true;
	if(keystate[DIK_Z] & 0x80)
		keys_pressed[0xA] = true;
	if(keystate[DIK_C] & 0x80)
		keys_pressed[0xB] = true;
	if(keystate[DIK_4] & 0x80)
		keys_pressed[0xC] = true;
	if(keystate[DIK_R] & 0x80)
		keys_pressed[0xD] = true;
	if(keystate[DIK_F] & 0x80)
		keys_pressed[0xE] = true;
	if(keystate[DIK_V] & 0x80)
		keys_pressed[0xF] = true;

	//resets the CPU
	if(keystate[DIK_F3] & 0x80)
	{
		//prevent multiple resets
		if(!f3_locked)
		{
			CLS();
			ResetMemory(false);
		}
		
	}
	if(!(keystate[DIK_F3] & 0x80))
		f3_locked = false;
	
	//quit
	if(keystate[DIK_ESCAPE] & 0x80)
	{
		int_AppRunning = 0;
		return;
	}

	//pause the emu if not locked
	if(keystate[DIK_P] & 0x80)
	{
		if(!p_locked)
		{
			p_locked = true;
			pause = !pause;
		}
	}
	if(!(keystate[DIK_P] & 0x80))
		p_locked = false;
}
Dax is offline   Reply With Quote
Old April 2nd, 2009   #106 (permalink)
Registered User
 
Join Date: Mar 2009
Location: United States
Posts: 9
Quote:
Originally Posted by Dax View Post

Code:
	for(i = 0x0; i <= 0xF; i++)
		keys_pressed[i] = false;
I think it might have to do with this part of your code. The getInput function, are you calling it everytime? If so, this is erasing all of your currently pressed keys. When a key gets released, set it to false instead of clearing all of the keys everytime.
jaskt7 is offline   Reply With Quote
Old April 2nd, 2009   #107 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
From what I remember, having the additional 16 ifs instead of the for made no difference. And yeah, I call it just before executing anything in my main loop.
Dax is offline   Reply With Quote
Old April 2nd, 2009   #108 (permalink)
Registered User
 
Join Date: Mar 2009
Location: United States
Posts: 9
Have you tried printing out the keystate array to see if there is multiple keys pressed?
jaskt7 is offline   Reply With Quote
Old April 2nd, 2009   #109 (permalink)
Administrator
 
Chrono Archangel's Avatar
 
Join Date: Dec 2001
Location: Montreal, Canada
Posts: 7,842
hehe Dax you made me decide to fix my input stuff.
I used GetAsyncKeyState to poll the keys i need in the 3 instructions and now my paddles in pong seem to be working fine. (i think i remember seeing them move at the same time)

some stuff i need to fix:
- crash when pong goes up to 10 (displays A, then crashes with out-of-bound array error)
- timing... emu goes too fast
-space invaders displays only half the ship (wtf?)

minor stuff... when that's done I'll work on Gekko XD

Last edited by Chrono Archangel; April 3rd, 2009 at 13:52..
Chrono Archangel is offline   Reply With Quote
Old April 3rd, 2009   #110 (permalink)
Emu Author
 
Hatorijr's Avatar
 
Join Date: Dec 2004
Location: North Carolina
Posts: 374
way i handled timing was that i set up a timer object(did mine in c#) that called my op decoding function once per frame for 60 frames while testing which basically was 60 ops per second and when i finished the emulator i boosted it to run that function 10 times per frame so the finished version runs at around 600 ops per second.
Hatorijr is offline   Reply With Quote
Old April 4th, 2009   #111 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
I'm restructuring my emu currently, so that I can learn about plugins and stuff. I'm really going out of my way with this first emu to make sure I have the knowledge I need for later endeavours. My source is also now available for viewing at chip8-emu - Google Code if anyone cares.

Edit: Make sure to check out recent revisions if you end up wanting the code for whatever reason. The ones from March 09 and earlier are old broken code that never worked.
Edit2: Note that the source doesn't work in its current state.

Last edited by Dax; April 4th, 2009 at 17:05..
Dax is offline   Reply With Quote
Old April 4th, 2009   #112 (permalink)
******
 
Join Date: Jul 2008
Posts: 1,188
Good work on the core Dax :P. Now to sort the DirectX crap :P.
omegadox is offline   Reply With Quote
Old April 4th, 2009   #113 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
xD Thanks. Big thanks to Omegadox for organizing the project so nicely. It uses a similar format to Dolphin now, which is a very clean project it seems.
Dax is offline   Reply With Quote
Old April 5th, 2009   #114 (permalink)
******
 
Join Date: Jul 2008
Posts: 1,188
Quote:
Originally Posted by Dax View Post
xD Thanks. Big thanks to Omegadox for organizing the project so nicely. It uses a similar format to Dolphin now, which is a very clean project it seems.
Yep, I took the idea from Dolphin mostly. Separating things to their own lib.
omegadox is offline   Reply With Quote
Old April 5th, 2009   #115 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
Now I just have to figure out how to link this stuff together. Never had a project this way before..
Dax is offline   Reply With Quote
Old April 5th, 2009   #116 (permalink)
******
 
Join Date: Jul 2008
Posts: 1,188
Just set the "Additional Library" to include the path to the libs you are using.
omegadox is offline   Reply With Quote
Old April 8th, 2009   #117 (permalink)
Registered User
 
Join Date: Mar 2009
Location: United States
Posts: 9
I found out that something was wrong with the graphics in my original flash chip8 emu (it didn't wrap). Anyways, my goal now is to add support for schip. One problem though, BLINKY is having serious issues. Basically, the graphics are not drawing correctly. The link below will bring you to the page with the swf file on it and the complete code. Any answers will be appreciated.

chip

Also, i posted a while back about a chip8 to action script converter. I was wondering if anybody tried it out? The link for that again is below. (you have to have flash to do this)

http://babbage.cs.missouri.edu/~jask...m=breakout.ch8


Thanks,
Justin
jaskt7 is offline   Reply With Quote
Old April 8th, 2009   #118 (permalink)
Emu Author
 
Hatorijr's Avatar
 
Join Date: Dec 2004
Location: North Carolina
Posts: 374
why not post a picture so we can see whats going on with it?
Hatorijr is offline   Reply With Quote
Old April 8th, 2009   #119 (permalink)
Mobile Fanatic
 
runawayprisoner's Avatar
 
Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,203
Massive reply!!

Quote:
Originally Posted by masta.g.86 View Post
NOW GET TO WORK ON MY PS3 EMU!
Ask IBM to release an opcode table for the Cell BE. That'll be a good first step.

Quote:
Originally Posted by Chrono Archangel View Post
hehe Dax you made me decide to fix my input stuff.
I used GetAsyncKeyState to poll the keys i need in the 3 instructions and now my paddles in pong seem to be working fine. (i think i remember seeing them move at the same time)

some stuff i need to fix:
- crash when pong goes up to 10 (displays A, then crashes with out-of-bound array error)
- timing... emu goes too fast
-space invaders displays only half the ship (wtf?)

minor stuff... when that's done I'll work on Gekko XD
When pong goes up to 10 and crashes, you need to check your BCD implementation to see if it's not punching out weird stuffs, then when that suspect is cleared, check your font-fetching routine. I remember seeing a font-check rom somewhere on Zophar. That would be a good one for this kind of test. If everything goes fine, check your arithmetic flags.

For Space Invaders, it's recommended that you check your flag like tomorrow is apocalypse. Additionally, it can also be a problem with the way you fetch the next bits for drawing, so look closely there. Make sure you're fetching exactly 8 bits per scanline for the sprite.

For timing... well, there's none. Chip-8 or Super Chip have no timing. The only timings you have are the DT and the ST. If you feel like your emulator is running too fast, use a timer to execute codes only at intervals. Alternatively, poll useless stuffs in between instructions... such as extra drawing routines, extra screen buffer filters... etc...

Quote:
Originally Posted by jaskt7 View Post
I found out that something was wrong with the graphics in my original flash chip8 emu (it didn't wrap). Anyways, my goal now is to add support for schip. One problem though, BLINKY is having serious issues. Basically, the graphics are not drawing correctly. The link below will bring you to the page with the swf file on it and the complete code. Any answers will be appreciated.

chip

Also, i posted a while back about a chip8 to action script converter. I was wondering if anybody tried it out? The link for that again is below. (you have to have flash to do this)

http://babbage.cs.missouri.edu/~jask...m=breakout.ch8


Thanks,
Justin
Better research ActionScript 3.0 while you're at it. ActionScript 3.0 adds ByteArray, which would be more useful (and takes up less memory) than an array of numbers or integers.

Another good feature would be the graphics interface, which makes drawing vector graphics much less painful than it was back in ActionScript 2.0.

Quote:
Originally Posted by Hatorijr View Post
why not post a picture so we can see whats going on with it?
Um... you could just click on his link to go see the source code and the emulator itself.
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10
runawayprisoner is offline   Reply With Quote
Old April 8th, 2009   #120 (permalink)
Registered User
 
Join Date: Mar 2009
Location: United States
Posts: 9
Quote:
Originally Posted by runawayprisoner View Post
...Better research ActionScript 3.0 while you're at it. ActionScript 3.0 adds ByteArray, which would be more useful (and takes up less memory) than an array of numbers or integers.

Another good feature would be the graphics interface, which makes drawing vector graphics much less painful than it was back in ActionScript 2.0....
I know a little bit of AS 3.0 (from the attempt to convert my AS 2.0 Stratego game to it), but my concern right now is just getting it to work. Also, I am not to concerned about memory since CHIP8 games are so small in the first place.
jaskt7 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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 19:57.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5