It is currently Sun Jan 22, 2017 1:05 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 144 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10
Author Message
PostPosted: Tue Dec 13, 2016 3:37 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 1967
Are the optimizations already implemented?


Top
 Profile  
 
PostPosted: Wed Dec 14, 2016 3:09 am 
Offline

Joined: Mon Jul 01, 2013 11:25 am
Posts: 214
Yeah, a big part of them and the most complexes ones. The only part remaining is the intermediate code to target assembly code translation, which also need optimizations in the process (as register allocation..) but it's much more simpler that handling a complete compiler from scratch :)
Here you have a nice tutorial about compiler design :
https://www.tutorialspoint.com/compiler ... /index.htm
You can see how far is the intermediate code generation in the process, it's why it's interesting to only consider that last step of intermediate code to target code translation if possible.


Top
 Profile  
 
PostPosted: Wed Dec 14, 2016 3:21 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 1967
So is this last step what is still needed?

Code:
Step 5:
Allocate variables to A, X and Y

a = b | c
d = a & e
gets rewritten as
A = b | c                // A = a
a = A                     // A = a
A = A & e               // A = d
d = A                     // A = d

a = b | c
b = b + d
d = a & e
gets rewritten as
X = b                     // X = b
A = X | c                // A = a, X = b
Y = A                     // A = a, X = b, Y = a
A = X + d               // A = b, Y = a
b = A                     // A = b, Y = a
A = Y & e               // A = d, Y = a
d = A                     // A = d, Y = a
a = Y                     // A = d, Y = a


Top
 Profile  
 
PostPosted: Thu Dec 15, 2016 6:46 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 283
Yes, and it's far from trivial.


Top
 Profile  
 
PostPosted: Sat Dec 17, 2016 8:37 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 1967
Quote:
Quote:
Everybody says Konami has well-optimized assembly

What!? Who says this? Like many Japanese companies; great game design, mediocre code efficiency (speed) at best.


Most people on the internet do.


Top
 Profile  
 
PostPosted: Sat Dec 17, 2016 10:19 am 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 226
Location: FL
Which people? "Most people say [x]" is way too vague to be meaningful, and "everybody says [x]" is just outright bullshit.


Top
 Profile  
 
PostPosted: Sat Dec 17, 2016 1:12 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 1967
Websites like Sega16 and Atariage.


Top
 Profile  
 
PostPosted: Wed Jan 11, 2017 2:55 pm 
Offline

Joined: Wed Jan 11, 2017 2:16 pm
Posts: 1
Hello!

Some time ago I decided I wanted to learn Super Nintendo development. I managed to write 12 small programs, for example one for changing the background color, and another one for moving a sprite. I learned a lot from repeatedly reading documentation found on the web. I tested my programs on an emulator ('higan' if I remember correctly). I wanted to test them on real hardware, so I obtained a back-up device outfitted with a floppy drive emulator. Unfortunately about half of my programs did not work on real hardware. I obtained an official development kit hoping it would help me debug, but its power supply is broken and I've been too lazy to get that fixed. And even then, I'd have to get an ancient computer with Japanse software to interface with the unit, so I have all but given up on the dream of debugging my code on real hardware.

Anyway, here's the code, the documentation I wrote as I was developing and learning how the Super Nintendo works, and the slides for a presentation I once gave on the topic.

https://github.com/michielvoo/SNES
https://github.com/michielvoo/SNES/wiki
http://michielvoo.github.io/SNES/introduction

The code is for the WLA assembler, and I've added some library code for init, registers and some constants, just to make the example code more readable. I was about to write a sprite tool but then I lost interest ¯\_(ツ)_/¯

I still think the Super Nintendo is an awesome console, but not because of its system design; the games I played on it when I was young were my main inspiration.

Good luck with any endeavours in this space, I think you guys are amazing!


Top
 Profile  
 
PostPosted: Wed Jan 11, 2017 4:18 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3180
Location: Mountain View, CA, USA
michielvoo wrote:
I wanted to test them on real hardware, so I obtained a back-up device outfitted with a floppy drive emulator. Unfortunately about half of my programs did not work on real hardware. I obtained an official development kit hoping it would help me debug, but its power supply is broken and I've been too lazy to get that fixed. And even then, I'd have to get an ancient computer with Japanse software to interface with the unit, so I have all but given up on the dream of debugging my code on real hardware.

Maybe these products didn't exist when you were doing your dev work, but it's a little surprising you didn't consider the SD2SNES, SNES PowerPak, Super EverDrive -- especially considering how much pain you must have gone through to try and get an official devkit + hardware.

Thanks for putting your stuff online!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 144 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group