Announcement

Collapse
No announcement yet.

Need help with snes asm Super Mario Kart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with snes asm Super Mario Kart

    I've been working on a code to make the computer karts go as fast as you. A break down of the asm


    $80/87E2 4C 00 93 JMP $9300 [$80:9300] A:2000 X:1700 Y:0004 P:envmxdiZc Jumps to free space
    $80/9300 BD EF 00 LDA $00EF,x[$80:17EF] A:2000 X:1700 Y:0004 P:envmxdiZc load the computers break offset
    $80/9303 C9 FF 00 CMP #$00FF A:00FF X:1700 Y:0004 P:envmxdizc compares computer break value 00 no ff yes
    $80/9306 D0 0B BNE $0B [$9313] A:00FF X:1700 Y:0004 P:envmxdiZC if not breaking so value would be 00 jump to [$9313]
    $80/9308 DA PHX A:00FF X:1700 Y:0004 P:envmxdiZC but if value is ff Push Index Register X
    $80/9309 A2 00 10 LDX #$1000 A:00FF X:1700 Y:0004 P:envmxdiZC loads player ones offset into X
    $80/930C BD D6 00 LDA $00D6,x[$80:10D6] A:00FF X:1000 Y:0004 P:envmxdizC loads player ones top speed into A
    $80/930F FA PLX A:03B0 X:1000 Y:0004 P:envmxdizC pulls back computers offset to Index Register X
    $80/9310 9D EA 00 STA $00EA,x[$80:17EA] A:03B0 X:1700 Y:0004 P:envmxdizC stores player ones tops speed to computer speed
    $80/9313 BD EA 00 LDA $00EA,x[$80:17EA] A:03B0 X:1700 Y:0004 P:envmxdizC puts back high jacked code
    $80/9316 4C E5 87 JMP $87E5 [$80:87E5] A:03B0 X:1700 Y:0004 P:envmxdizC jumps back to normal code

    This part is where the problem is $80/9303 C9 FF 00 CMP #$00FF is there a way to make it only compare FF side of A but still work for all computers so not a Absolute address? the ram address for FF side is 7e17EF. So I don't want 00 side ram address 7E17f0 tobe Compared.

    please help if you can.

  • #2
    Not much you said there makes sense. If you're saying you want to push the top speed of the player to all non-player carts, you'd have to loop through them and write each one individually within the loop.

    I can't tell if "break" should be "brake", or if by "computers break" you mean 00 and FF are identifiers that indicate whether or not a particular cart is being managed by AI or a player (which would also explain the "side" part). Otherwise, you're going to have to explain what you mean by that. In assembly terms a "break" isn't something you're likely to be messing with, unless the SNES uses the concept in some sort of tricksy way. And I don't recall that it does.

    Comment


    • #3
      sorry I mean brake/slow down I worked out a way of doing it now I will up load it in a day or so but I would like to know if anyone can come up with a different way or same way

      8087E24C Jumps to free space
      8087E300
      8087E493
      809300BD load the computers brake offset
      809301EF
      80930200
      809303C9 compares computers brake value 00 no ff yes
      809304FF
      80930500
      809306D0 if not braking so value would be 00 on FF side of A jump to [$9313] #$00FF
      8093070B
      809308DA but if value is FF Push Index Register X
      809309A2 loads player ones offset into X
      80930A00
      80930B10
      80930CBD loads player ones top speed into A
      80930DD6
      80930E00
      80930FFA pulls back computers offset to Index Register X
      8093109D stores player ones top speed to computer speed
      809311EA
      80931200
      809313BD puts back high jacked code
      809314EA
      80931500
      8093164C jumps back to normal code
      809317E5
      80931887

      7e17EF is FF side of A 7e17F0 is for 00 side $80/9303 C9 FF 00 CMP #$00FF

      7e17F0 address is for points of computer so when value is not zero code stops working I have found a way to make code work

      I would like to see if there is another way

      thank you for you reply Pyriel
      Last edited by xxphillips; 04-05-2017, 02:57:34 PM.

      Comment


      • #4
        Sorry Pyriel I didn't reply fully to your reply you don't have to do each computer individually within the loop because the base address
        8087E2 is for all computers the X value is different. If you setup a breakpoint on 8087E2 and keep pressing run it will go through all computers offsets in X

        Comment


        • #5
          Oh, so what you're hooking into is already part of iterating the AI drivers. I don't know what your question ever was then.

          Comment


          • #6
            The code has a problem at this part $80/9303 C9 FF 00 CMP #$00FF 00=7e17F0 FF=7e17EF
            the 00 ram address 7e17F0 is the computers points so after a race if the computer gets a point code stops working because the value is Not Equal to zero so my question was if any body was able to come up with away to make the value be equel if the computers have points. I've worked out away how todo it now and will up load code tomorrow but I wanted to see if there was another way to fix this. let me know if it's still not clear
            thanks for your reply
            Last edited by xxphillips; 04-06-2017, 03:23:19 PM.

            Comment


            • #7
              Oh. You're asking how to only compare the 8-bits you're interested in. Load it to an accumulator, then AND it with 0x00FF or whatever mask you need to screen out the values that are interfering.

              Comment


              • #8
                I had the same idea that's how I fixed the code thanks for your reply

                8087E24C Jump to free space 809300
                8087E300
                8087E493
                809300BD load computers brake address
                809301EF
                80930200
                80930329 And 00ff so value in 00 address wont matter
                809304FF
                80930500
                809306C9 Compares computers brake value 00 no ff yes
                809307FF
                80930800
                809309D0 if not braking so value would be 00 on FF side of A jump to [$9316]
                80930A0B
                80930BDA but if value is FF Push Index Register X
                80930CA2 loads player ones offset into X
                80930D00
                80930E10
                80930FBD loads player ones top speed into A
                809310D6
                80931100
                809312FA pulls back computers offset to Index Register X
                8093139D stores player ones top speed to computer speed
                809314EA
                80931500
                809316BD puts back high jacked code
                809317EA
                80931800
                8093194C jumps back to normal code
                80931AE5
                80931B87
                Last edited by xxphillips; 04-07-2017, 12:41:12 PM.

                Comment

                Working...
                X