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

0 Members and 2 Guests 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 #15 on: February 23, 2010, 11:59:10 PM »
could someone point me please to the maximum size for the menu? I assume it has one, right? :)

Like on the MD Myth, it's not so much about size as it is about making sure the "compatible" areas are reserved. You need to leave $C800 to $1FFFF reserved for the menu, and keep the total length below where the bad blocks are stored (madmonkey mentioned where the bad block list is once, but I forget the value - I think you can go to 512KB).

Offline King Of Chaos

  • Full Member
  • ***
  • Posts: 117
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #16 on: February 24, 2010, 02:00:12 AM »
So that means a deluxe version is possible, correct?

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #17 on: February 24, 2010, 02:16:05 AM »
According to v3.01 of the programmer the menu capacity is 16 Mbit. Dunno if you can use all of that though.

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 #18 on: February 24, 2010, 02:33:25 AM »
Yes, a "deluxe" menu is possible. I'm not sure what the largest size the Neo2 Ultra Menu will write - it was 64KB on the MD. It might be the same here with the SNES. You'd have to use madmonkeys writer to write a bigger menu if that is indeed the case. That's what I use to write the MD deluxe menu.

Now that the SNES menu is released, madmonkey can start adding support for the SNES Myth in his writer as well.
 :D

Offline ~tak

  • Newbie
  • *
  • Posts: 46
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #19 on: February 24, 2010, 04:32:25 AM »
Here's what I've got so far: http://jiggawatt.org/myth_menu_wla.asm

It's nearly done, but some directives haven't been translated, and I might have missed a couple of labels here and there so it probably won't assemble in its current form. I'll continue this tomorrow (today actually, since it's after midnight here :P )

Some more of the code should also be macrofied.

Since you've done a great job so far, let me contribute as well :)

Replace:
Code: [Select]
       .ORG    $FFC0
        .DB    "NEO TEAM (C) 2010        "
        .ORG    $FFD5
        .DB     $21,$01,$08,$03,$00,$00,$00
with:
Code: [Select]
.SNESHEADER
NAME    "NEO TEAM (C) 2010    " ; ROM Name in Header // 21Char Max!
HIROM ; Set ROM Type
FASTROM
CARTRIDGETYPE $01
ROMSIZE $08
SRAMSIZE $03
COUNTRY $00
LICENSEECODE $33
VERSION $00
.ENDSNES

Replace:
Code: [Select]
       HEX     000000with:
Code: [Select]
       .PRINTV        HEX     000000

I'm not sure if this should be changed as well from 2_Break to 1_Break?:
Code: [Select]
JMP    MOV_BOOT_TO_SRAM\2_BREAK

btw, can someone please explain me what this means? havent got it yet *CONFUSED*
Code: [Select]
       .ORG     $ABCD   ;MYTH
« Last Edit: February 25, 2010, 03:29:00 AM by ~tak »

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #20 on: February 24, 2010, 02:15:45 PM »
Quote
I'm not sure if this should be changed as well from 2_Break to 1_Break?:
Code:

   JMP    MOV_BOOT_TO_SRAM\2_BREAK
Nope, that's not a typo. It's a the same behaviour that was in the original code. But since that will in practice skip all subsequent tests, the code should be rewritten so that it jumps past all the tests at once instad of chaining JMPs like this.

Offline Dr.neo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3826
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #21 on: February 24, 2010, 02:59:10 PM »
hehe, i like the open source more and more now  ::sm-18.gif::
In my world,have 0 and 1 only ......Matrix World......

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 #22 on: February 25, 2010, 04:31:49 AM »
[unrelated]
I wish I could learn asm quick enough to help you guys.

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #23 on: February 26, 2010, 12:13:38 AM »
Quote
Replace:
Code:

        HEX     000000

with:
Code:

        .PRINTV        HEX     000000

Actually I think it'd be equivalent to .DB $00,$00,$00. PRINTV HEX 000000 does something different.
But all those .ORG $ABCD / .DB '-' / HEX 000000 / .DB 'h'  don't seem to fill any purpose. I couldn't find anything like that in the menu binary, and the area starting at $ABCD only contains zeroes.


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 #24 on: February 26, 2010, 12:47:26 AM »
Well, remember that the 0.05 menu was a test menu - probably a number of those "random" values stuck here and there were merely to act as markers when looking at the data later, say after dumping the menu flash, just to be sure things were being written to the correct place.

Notice that the largest block of code is the test code. It's not really needed for the menu. Diagnostics should really be a different program that is burned and run if something is wrong. The menu really shouldn't need to do any more testing than is needed to run.

Separating the menu and diagnostic also allows you to be more comprehensive on both - the menu can be larger with more features since it isn't "wasting" space on unneeded tests, and the diagnostic can do more testing since it's not "wasting" space on menu code.

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #25 on: February 26, 2010, 12:51:49 AM »
A lot of that code can be macrofied, which will make it a lot more compact than it is now. It can then be IFDEF:ed so that it only will be included when building with a DEBUG flag.

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #26 on: February 26, 2010, 06:15:24 PM »
Here's an update: http://jiggawatt.org/myth_menu_wla-2.zip

I haven't done anything about the self-modifying code yet. But I've macrofied some more code, and I've replaced nearly all hardcoded IO-register addresses with defines. I've also moved some of the defines and macros into separate files for clarity.

Offline ~tak

  • Newbie
  • *
  • Posts: 46
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #27 on: February 27, 2010, 01:00:31 AM »
_mic, thank you so much for all your effort on this! appriciate it

since I'm new to this kind of ASM and SNES, and try to make your source working with wla-dx too, can you help me on this?
Code: [Select]
-:      LDA     SDATA1,X
shouldn't it be like that?
Code: [Select]
-:      LDA.w     SDATA1,X
I'm not quite sure yet...

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #28 on: February 27, 2010, 01:06:24 AM »
That should only be necessary if the SDATA1 evaluated to something <=0xFF, in order to disambiguate between a direct page address and an absolute address.
For some reason you still have to write .L for 24-bit addresses (you'd think the assembler would figure that out automatically). WLA-DX is weird in some ways..  :-X

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: the source code for SNES/SFC Myth Cart menu v0.05
« Reply #29 on: February 27, 2010, 08:30:42 PM »
Good work mic_! This cleanup will help alot the development of the new menu  ~sm-42.gif~