It is currently Sat Oct 21, 2017 7:12 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: upernes
PostPosted: Fri Sep 11, 2015 11:25 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
Hi

I posted in 2011 about a program to disassemble NES games and make SNES roms nearly automaticly. It was not finished, the assembler code replacing the PPU calls and the code for the interrupt vectors is not working. Many test roms did not pass and I stoped here.
Today a friend told me to put something in GitHub before tonight, so I have chosen this project, nothing to lose.
I have released it with a GPL licence and uploaded it to Github at https://github.com/mandraga/upernes.
For now it is mostly a tech demo but the C code works fine, it is the asm files who do not work that much any more.

Edit: I worked on it for 6 month and I have encouraging results on the snes.
Edit: Super Mario Bros nearly completed, it needs a proper sprite 0 emulation and a fast background refresh.
Edit: Sprite 0 is ok, sound and bg update in progress.
Edit: Sound is working and Super Mario Bros, Excite Bike, Balloon fight are emulated.


Last edited by Patrick FR on Tue Aug 15, 2017 8:16 am, edited 5 times in total.

Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sat Sep 12, 2015 3:44 pm 
Offline
User avatar

Joined: Thu Jan 19, 2006 5:08 pm
Posts: 744
Location: Shelton, Washington.
Is it possible for you to include windows (32bit and 64bit) binaries as well?

I do not want to have to install flex-mingw or something similar because Sourceforge seems to hate using adblockers, and no other trusted mirrors exist right now for flex-mingw!

_________________
AKA SmilyMZX/AtariHacker.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Sep 13, 2015 3:13 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
Hello

I have MSYS2 on my windows and it will not be difficult to "port" it. I will port it maybe in a week or two when I can work with my computer with windows and MSYS2. But you can try MSYS2 (has an installer) and then adding all the tools and all the libs like flex and bison using pacman in command line. Porting from linux to windows is much more easier recently.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Sep 13, 2015 8:45 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1306
This is a great idea. I will build it later tonight and see how it works. If you give it sensitivity to mapper PRG bankswitching, maybe my dream of seeing Gimmick on the SNES can come true.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Thu Oct 08, 2015 9:45 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
Hi
Today I ported it to windows64 using MSYS2.
Recompilation works except if a PORT is accessed by other means than absolute. Indirect port accessed may be used by some rom's audio program SNDSQR1 SNDSQR2.

The binary is called upernes.exe in the source folder.

Usage is: ./upernes.exe romname.nes
The new source code and CHR files are in outsrc/. Copy them to asm/ and build the snes rom.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sat Oct 10, 2015 10:39 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
It looks like the exes compiled with MSYS are not easy to redistribute. Because when you do not have MSYS installed, they lack a lot of DLLs and good luck to find what dll is needed. But I will try to get the proper Dlls in the bin directory.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sat Oct 10, 2015 11:24 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1306
I think you can link to libgcc statically with mingw. You should be able to static link to others as well, and this is a good situation for static linking.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Oct 11, 2015 1:59 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
Yes I have seen this while resolving this problem yesterday. However, I pushed the dlls needed in source/binw64/
Add a outsrc/ fodler to binw64 and you should be able to call "upernes.exe romname.nes". What you see in the graphic window is the code already parsed. I do not remember the color meaning, it should be data/code areas, maybe I will add audio port and graphic port accesses in other colors.

I do not know if it is current usage to keep compiled binaries in a git repository? Is it better to put that on another web page? I was used to sourceforge where you have both source and binaries. Can someone clarify this?

Currently upernes.exe exits if it finds a non absolute address access to an hardware port. It means that if a rom writes in a port using the port adress it is transformed into a call to an emulation routine on the snes. But if a rom writes the port using an indexed something then the code to replace this indexed call needs to be added to the cpp asm rewriting functions.

However, currently, the basic test roms must pass the tests again. upernes.exe rewrites the code but the called routines from the assembler files are not working properly. So the plan is to fix the asm port routines and then add the non absolute port read/writes.

Btw, now that it works on windows, do you know an snes emulator with a good assembler trace and breakpoints? This is crucial to be able to work properly on port emulation. Being too often lost in asm routines was what made me stop working on it.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Oct 11, 2015 5:27 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19113
Location: NE Indiana, USA (NTSC)
cc65 keeps source on GitHub and binaries on SourceForge.net.

(I keep wanting to type SourceForget.)


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Sun Oct 11, 2015 10:32 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1306
I tried to build this under Debian Linux 64-bit. I had to modify the makefile to specify Linux. It would be better to make your different OS choices for cross-compilation different targets, rather than rely on editing the Makefile.

There are some serious permissions issues in your source folder, too. Everything was marked executable, and I was unable to touch any of the source subdirectories from permissions issues. I had to manually fix permissions before I could use this.

When I ran upernes on Donkey Kong (PRG1), a lot of text went by, a window with a strange red smear on it popped up for a second, then I got this output:

Code:
upernes: recompileIO.cpp:133: void CRecompilateur::outReplaceIOport(FILE*, t_pinstr, Copcodes*): Assertion `addressing = Abs' failed.
Aborted


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Mon Oct 12, 2015 4:09 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
Hi

I will check those permission issues right after this post.

The text is the rom source code plus the count to ports and memory accesses, this is normal, look to it. The image is the rom being disassembled as I said before.
And yes, it fails if it finds an indirect access to an hardware PORT.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Mon Oct 12, 2015 7:45 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
I updated the repository, no more x rights (I liked how it appeared green in the console :) ). I used a trick from a slashdot post for the makefile that detects windows using an environment variable.
Thanks for your comments.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Mon Oct 12, 2015 9:00 am 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1306
I see, thanks for the quick clarification.

Are there any commercial titles which use only absolute port access? Or will we just have to wait for this functionality to be implemented?


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Mon Oct 12, 2015 11:42 am 
Offline

Joined: Tue Jan 19, 2010 10:35 am
Posts: 65
Location: Lyon
I checked those addressing modes and I found an old folder where I already added Absolute X indexed and Absolute Y indexed. And I merged with the current branch.
Ballonfight passes the recompilation process (however, without adding the indirect jumps if any).

Now I must merge the assembler files containing the new routines, and this is far from working. But I have seen that snes9x debug version was ported to linux, this may be great for passing the tests roms.


Top
 Profile  
 
 Post subject: Re: upernes
PostPosted: Mon Oct 12, 2015 12:07 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19113
Location: NE Indiana, USA (NTSC)
NO$SNS also works in Wine 1.6.2 in Xubuntu 14.04 LTS.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 78 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 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