Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 100 users online: 4 members, 71 guests and 25 bots. Members: Ashbad, shundra9, sunset730, Tari. Bots: Spinn3r (1), MSN/Bing (1), Magpie Crawler (2), Googlebot (20), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
jammasterz
New Member

Joined: 20 Apr 2012 Posts: 75 Location: Sweden
|
Posted: 20 Apr 2012 09:14:21 pm Post subject: Starwar |
|
|
Hi. I've been working on a little project, thats actually my first one in z80 asm ever. Why im posting it here is because its finally done. I've been fighting with this little piece of code for about a month, mainly because i didn't have much time, but also because i make a lot of newb mistakes. Now after i have deleted the bad section of code and rewritten it, it worked on its first run
I would like to thank ThunderBolt for helping me to find many bugs and giving me very useful hints.
Of course the game is not done yet, this is only the engine to the multiplayer final version of it.
But im still a little bit confused about the optimalization part. I have optimized everything the best i can, but i just know some of you are going to find some interesting ways to make this program faster
Heres the code:
http://pastebin.com/5gQNMzHY |
|
| Back to top |
|
|
Xeda112358
Power User

Joined: 09 Nov 2010 Posts: 353
|
Posted: 28 Apr 2012 01:34:37 pm Post subject: |
|
|
Hi, I am surprised nobody has responded o.O
Anyways, I am sure it could be rewritten and made faster (most codes can be), but there are a few optimisations and tricks you can use. For example, I am glad you used XOR A, but here are a few more:
Code:
cp 0 == or a
cp 1 == dec a ;This is sometimes useful
cp 255 == inc a ;Also sometimes useful
|
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55749 Location: Earth, Sol, Milky Way
|
Posted: 01 May 2012 01:16:28 am Post subject: |
|
|
I'm not sure how I missed this topic the first two times around, but I'll try to make sure it doesn't happen again. I'm too tired to add much more to what Xeda said, other than pointing out that there's two types of optimizations you can make. There are line-by-line optimizations, perfectly exemplified by the three substitutions that Xeda suggested. There are also larger structural optimizations, which involve re-considering how your functions are structured, how your data is arranged and stored, and similar concerns. _________________
 |
|
| Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.023730 seconds.
|