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 January 14th, 2009   #61 (permalink)
Registered User
 
dreampeppers99's Avatar
 
Join Date: Jul 2006
Location: you know...
Posts: 506
Quote:
Originally Posted by Shendo View Post
Cool emu dreampeppers99.
Thanks
__________________
The Empyrean
dreampeppers99 is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old January 14th, 2009   #62 (permalink)
Moderator
 
ShendoXT's Avatar
 
Join Date: Feb 2006
Location: Croatia
Posts: 4,191
Quote:
Originally Posted by runawayprisoner View Post
You will also see this in Pong when you move your paddle past the top and bottom of the screen..
Actually pong is programmed to wrap paddles around (though it needs to completly disappear from the screen to appear on the other side).
Quote:
Originally Posted by runawayprisoner View Post
Also among the undocumented features is that for subtraction, when the result is zero or lower, the flag is set. It's not a carry flag there, it's a carry and zero flag. Cowgod didn't state it so in his document, and neither did David Winter.
Nice find. Explains why Ant doesn't work properly on my emu.
__________________
C2D E8400 3.00 Ghz | EP45-DS3 | HD4850 512MB | 4GB DDR2 800 | 640 + 250 GB HDD
SyncMaster 2233BW 22" | Logitech G5 | Logitech G15 | Windows 7 x64
ShendoXT is offline   Reply With Quote
Old January 14th, 2009   #63 (permalink)
Registered User
 
dreampeppers99's Avatar
 
Join Date: Jul 2006
Location: you know...
Posts: 506
Quote:
Originally Posted by Shendo View Post
Nice find. Explains why Ant doesn't work properly on my emu.
in my too
__________________
The Empyrean
dreampeppers99 is offline   Reply With Quote
Old January 17th, 2009   #64 (permalink)
Registered User
 
dreampeppers99's Avatar
 
Join Date: Jul 2006
Location: you know...
Posts: 506
The source code from JChip8BR is on svn google's.
jchip8br - Google Code
The code is not so beautiful and faster but I hope you can take some acknoledges.
__________________
The Empyrean
dreampeppers99 is offline   Reply With Quote
Old January 17th, 2009   #65 (permalink)
Mobile Fanatic
 
runawayprisoner's Avatar
 
Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
Quote:
Originally Posted by Shendo View Post
Actually pong is programmed to wrap paddles around (though it needs to completly disappear from the screen to appear on the other side).
Ah... yep. Just checked the source code again, and it seems the game has its own check. But anyway, try Tank. That game doesn't seem to work right (or at all) if you don't wrap the sprite around to the other side of the screen.

Quote:
Nice find. Explains why Ant doesn't work properly on my emu.
Yeah... it boggled my mind for quite a while. It didn't look like anything was wrong, and indeed nothing was wrong except for the flag.
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10
runawayprisoner is offline   Reply With Quote
Old February 27th, 2009   #66 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
Once I get a bit more free time, I think I'm going to rewrite my emulator from scratch in proper C++/SDL[it was a horrible mix of C/C++ before]. Yeah, I didn't finish it the first time, but it was crappy anyway. Really hacky and too much guesswork involved, and worst of all, I didn't hardly document it. I'm going to try and brush up on bit logic and such a bit more this time. It's still confusing to me.

If you want to see my crappy source of it: http://code.google.com/p/chip8-emu/ It's under the BSD license[I'm so lazy I never even copy pasted the license in the code xD], do what you want with it, just remember who wrote it.

It never had graphics or anything. It was a CLI app since I wanted to do graphics last.

Last edited by Dax; February 27th, 2009 at 09:39..
Dax is offline   Reply With Quote
Old February 27th, 2009   #67 (permalink)
Mobile Fanatic
 
runawayprisoner's Avatar
 
Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
I kinda think it's better to include your opcode interpreter into the main opcode table to avoid function calls, and possibly improve a bit of performance. Though indeed it's a bit harder to manage that way.

(to be honest, I split them into functions with my Gameboy emulator, anyway)
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10
runawayprisoner is offline   Reply With Quote
Old February 27th, 2009   #68 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
Isn't the code really ugly?
Dax is offline   Reply With Quote
Old February 27th, 2009   #69 (permalink)
Mobile Fanatic
 
runawayprisoner's Avatar
 
Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
You haven't seen ugly yet. Ugly is 30 different files, headers and definitions, in separate folders, each with over 5000 lines of codes. ;p

You're doing fine.

As for optimization practices, no comment. The more you work on something, the better you are at optimizing for it.
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10
runawayprisoner is offline   Reply With Quote
Old February 27th, 2009   #70 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
Thanks. I personally thought the code was ugly..
Dax is offline   Reply With Quote
Old February 27th, 2009   #71 (permalink)
Mobile Fanatic
 
runawayprisoner's Avatar
 
Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
Well, you can stick a flower in it to make it look pretty then.

Sufficient codes are not always pretty, though. And some "deprecated" stuffs might still be faster and more efficient than the "new" stuffs. But they're still "deprecated" because they're harder to use and maintain. Hmm... as is the case with ActionScript and Java.

Fun note: ActionScript 3.0 should be Action language instead of an "Action" script, but I think it'd just sound stupid as Action... and they stuck "script" in the back of it in the end.
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10
runawayprisoner is offline   Reply With Quote
Old February 27th, 2009   #72 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
I know not all code is pretty, but there're usually better ways of doing things.

Usually the same applies to my case/situation.
Dax is offline   Reply With Quote
Old February 27th, 2009   #73 (permalink)
Mobile Fanatic
 
runawayprisoner's Avatar
 
Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
Whooel... for instance,

byte >> 3 & 1
byte >> 2 & 1
byte >> 1 & 1
byte & 1

...is definitely faster to fetch binary code than a look-up table that requires you to convert to hex before hand. But hell... I wonder why people still do that sometimes... hmm...
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10
runawayprisoner is offline   Reply With Quote
Old February 27th, 2009   #74 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
I've never messed with lookup tables before.
Dax is offline   Reply With Quote
Old March 9th, 2009   #75 (permalink)
Dax
ライチュウ
 
Dax's Avatar
 
Join Date: Nov 2006
Location: USA
Posts: 3,289
The CHIP8 returneth! Hatori and I have been chatting on MSN tonight, and I'm going to clean up my code, and learn more about bitshifting again after my long absence. I want to make this thing a reality.
Dax is offline   Reply With Quote
Old March 13th, 2009   #76 (permalink)
Registered User
 
Join Date: Mar 2009
Location: United States
Posts: 9
Hi, I was wondering if somebody that knew actionscript could help me out on my CHIP8 emu. I have not tested many games on it, but I know for sure that a few work, however; it seems that Space Invaders' home screen is not working correctly.

The swf can be found here on this page, it automatically loads Space Invaders by default. The source code is also included below it.

chip

*the emu is not the fastest thing in the world, I am just trying to get it to work.

Thanks for any feedback I get.
jaskt7 is offline   Reply With Quote
Old March 13th, 2009   #77 (permalink)
Registered User
 
Join Date: Mar 2009
Location: United States
Posts: 9
Okay, I found the error. Apparently when I was loading the rom from the php script, I did not convert the "string number" into an "actual number" in Flash. Honestly, I do not even know why any game worked in the emu in the first place.

Strangely enough, I found this bug by displaying the hex values of the rom after it loaded...but it was not displaying hex, rather decimal. After a few head scratches I realized that the numbers were still strings.
jaskt7 is offline   Reply With Quote
Old March 13th, 2009   #78 (permalink)
Administrator
 
Chrono Archangel's Avatar
 
Join Date: Dec 2001
Location: Montreal, Canada
Posts: 7,842
did you update your link? I still see garbled text scrolling.

on a side note, I finally fix a few issues that was in my emu...
-it now runs semi-fullspeed (drawing the WHOLE screen everytime is just a bad idea... can't believe I made that mistake)
-added fonts
-fix outofbound errors when paddle would wrap in pong (offscreen drawing).

Screenshot!
Attached Images
File Type: jpg chip8.jpg (180.6 KB, 12 views)
Chrono Archangel is offline   Reply With Quote
Old March 13th, 2009   #79 (permalink)
Registered User
 
Join Date: Mar 2009
Location: United States
Posts: 9
No, I did not update the link last night, however; I did just put the new file up online.

You have a good idea not to draw the whole screen every time, I might implement that into my emu. But, first things first; I am probably going to convert it over to C++ in a couple of weeks (I cannot right now, too busy).
jaskt7 is offline   Reply With Quote
Old March 13th, 2009   #80 (permalink)
Mobile Fanatic
 
runawayprisoner's Avatar
 
Join Date: Nov 2006
Location: Santa Cruz, CA
Posts: 6,205
Quote:
Originally Posted by jaskt7 View Post
Hi, I was wondering if somebody that knew actionscript could help me out on my CHIP8 emu. I have not tested many games on it, but I know for sure that a few work, however; it seems that Space Invaders' home screen is not working correctly.

Thanks for any feedback I get.
Space Invaders may suffer from wrong collision flag set... a whole lot. So pay attention to that one.

Also you should try to load the binary file directly into the URLLoader then convert it to a ByteArray instead of waiting for php to pass it to you. That's quite messy imo.

Unless, of course, you are using ActionScript 2. Which then makes this an even more troublesome experience. Not that it's impossible but it's just quite difficult.

Quote:
Originally Posted by Chrono Archangel View Post
did you update your link? I still see garbled text scrolling.

on a side note, I finally fix a few issues that was in my emu...
-it now runs semi-fullspeed (drawing the WHOLE screen everytime is just a bad idea... can't believe I made that mistake)
-added fonts
-fix outofbound errors when paddle would wrap in pong (offscreen drawing).

Screenshot!
Looking good. Do Super Chip games work?
__________________
cChip interpreter WIP - current status: Release Candidate
LRx Filter RC - current performance rating: 9/10
runawayprisoner 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 01:46.

© 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