Author Topic: the source code for SNES/SFC Myth Cart menu v0.05  (Read 54072 times)

0 Members and 1 Guest are viewing this topic.

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #45 on: March 25, 2010, 03:00:49 AM »
Nice! Every little bit helps.  :D

Offline sanni

  • Neo MOD
  • Hero Member
  • *
  • Posts: 502
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #46 on: March 25, 2010, 05:03:37 AM »
Just out of curiosity, the menu is a rom(like a game), so it "runs" on the SNES cpu and not in the fpga thingie in the Neo Myth Cart?
So for making a menu for MD Myth you need to know how to code for MD, for a SNES menu you need to know about SNES development and for the N64 menu you would need to know about N64 dev?
And that menu, which runs on the snes, has access to the Neo2 cart and then loads a game rom into the Neo Myth cart and tells the SNES: "here is your game"?

So if one would take your SNES code and do some magic and then put it in the N64 Myth, it would not work because it is coded for SNES and not N64 right?

So this:
LDA.W   $0000,X    ; READ GBA CARD
STA.L   $500000,X  ; WRITE PSRAM
tells the SNES, go there and do that, it doesn't tell the  fpga thingie in the Neo Myth Cart to do it?

(sorry for offtopic and stupid questions  ::sm-02::)

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #47 on: March 25, 2010, 05:12:31 AM »
I figured I might as well unroll the loop one extra step (to 16 bytes/iteration): http://jiggawatt.org/badc0de/myth_menu_wla-0.08.zip
Should be about 6.6% faster than the previous improvement.

I think 16 bytes/iteration pretty much is as far as it's worth unrolling the loop. If you doubled it to 32 bytes it would start getting kinda bloated, and the additional gain in speed would only be something like 3.5%.

@sanni: Yes. The menu code runs on the host console's CPU. In this case it's the SNES so it's 65816 code. If it was the MD Myth it would be M68000 code. The only thing special about those LDA/STA instructions you mentioned is that the memory areas they reference ($4xxxxx and $5xxxxx) are mapped to the Neo2 card and PSRAM in the Myth, respectively. That mapping is something I guess the FPGA handles, unless there's some additional hardware for that.


« Last Edit: March 25, 2010, 05:19:29 AM by mic_ »

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #48 on: March 26, 2010, 05:42:24 AM »
Generally speaking - the flash card in the Myth presents the menu flash to the console at power-on for it to boot from. Native code for the console in question is loaded and run - that code is the menu. The menu does what is need to run a selected game - that may be to copy the game from flash or SD into RAM inside the Myth, or perhaps to simply point to where the game is in flash so the console can access it directly. Then the menu simulates a reset so that the console starts the selected game as if it were booting for the first time.

For the MD Myth, the code is 68000, but my extended menu (in the works right now) will also run on the 32X for a nicer (and maybe faster) menu if the user has a 32X. In that case, the menu code will be SH2.

For the SNES Myth, the code is 65816. I'm not sure if we can take advantage of coprocessors on the SNES, but it's something I will be looking into eventually.

For the N64, the code is MIPS64. If you want to work on all of them, you should look into coding for those CPUs. You don't have to be an expert at assembly - all the above have C compilers, and the bulk of the current MD menu is in C, not assembly. It will be the same for the others once I get the updated menu going - mostly C with a little assembly for certain low-level tasks.

Also, while you can't DIRECTLY use (assembly) code for one CPU on another, you can use the lessons learned to make the code for the other CPU faster/better.

Offline the|Gamer

  • Jr. Member
  • **
  • Posts: 67
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #49 on: March 27, 2010, 11:54:47 PM »
Hi,
O.K.

I get everything ready for compile !
Then I try to design the User Interface so we can split the work ;)

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #50 on: March 28, 2010, 02:06:34 AM »
Then I try to design the User Interface

What do you mean exactly  ???

Offline the|Gamer

  • Jr. Member
  • **
  • Posts: 67
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #51 on: March 28, 2010, 05:14:33 AM »
Hi,
a german SNES Coder "Dforce300 or D4S" had a project named "Ultra16" I want a NEO SNES Myth Menu that looks like his menĂ¼ :

http://www.youtube.com/watch?v=Jpn7J2OUy7k&feature=player_embedded

Offline sanni

  • Neo MOD
  • Hero Member
  • *
  • Posts: 502
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #52 on: March 28, 2010, 05:24:46 PM »
Here are some things to read about N64 coding: http://tinyurl.com/ylshxj5

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #53 on: March 28, 2010, 06:16:36 PM »
Quote
Here are some things to read about N64 coding:
Huh? Wrong forum? This is the SNES dev section.

Anyway, I find it hard to see who's going to want to spend all that time working on something that's just a copy of some existing UI. The Ultra16 probably has features that the Myth doesn't, so it would be better to come up with a new UI that's made specifically for the Myth.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #54 on: March 28, 2010, 07:01:05 PM »
I agree with mic_ , and regarding the asm menu , i prefer it the way it is now , and i like how mic_ keeps working on it and cleaned up some parts.

That way , the C(with asm support code) menu will be much easier to be implemented , and once the important features are finished(SD,FS,Better detection,Region patching) then maybe it wouldn't hurt to create a gui.

But to work right now on a full gui menu i think its unrealistic  :P
(Not to mention that the official programmer still has the 64KB menu code limit and we will have to wait until madmonkey is done with SNES support)
« Last Edit: March 28, 2010, 07:06:48 PM by Conle »

Offline madmonkey

  • Neo MOD
  • Full Member
  • *
  • Posts: 178
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #55 on: March 28, 2010, 08:22:35 PM »
you don't have to wait for the snes support, you can use raw io command line options to write whatever you like to the menu flash.
of course menu entries(for roms on flash) will be erased in this case, but it doesn't matter for test builds, or if you only plan on using sd cart with it.
but I agree that gui should not be a priority.

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #56 on: March 29, 2010, 12:38:12 AM »
I've got another menu update for you guys to try: http://jiggawatt.org/badc0de/myth_menu_wla-0.09.zip

The biggest news here is that it lists up to 8 games at once. The choise of colors are a bit bad since I haven't bothered changing the palette. This list of games should probably be some shade of gray instead, with the currently highlighted game in white. Would make it easier to read IMO.

Screenshot:


I've also made a small improvement to the game loading code once again, so it should be about 4% faster than v0.08. Some of the old code has also been rewritten, changed or moved around by me. Since the original code is written in a pretty obfuscated way it was easier for me to just write my own routines.

There's one downgrade in this version; namely that it doesn't show the games' save type. That's something that could be put back in, though. I just haven't done it yet.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #57 on: March 29, 2010, 01:20:43 AM »
Great job mic_   >:D , posted it on news http://www.neoflash.com/go/index.php        ~sm-77.gif~.gif

Offline spinal

  • Coder of DSision
  • Neo MOD
  • Hero Member
  • *
  • Posts: 796
    • spinalcode
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #58 on: March 29, 2010, 01:58:55 AM »
Excellent work mic_ I can't wait to try it.

Offline ronaldo_76

  • Full Member
  • ***
  • Posts: 196
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #59 on: March 29, 2010, 02:05:32 AM »
thanks mic_  :-*