Language…
14 users online:  AmperSam, dotCoockie, Fiblizo, Golden Yoshi, Guido_Keller, itsmefigs, JezJitzu, LightAligns, Maw, playagmes169, Serena, signature_steve,  Telinc1, timothy726 - Guests: 251 - Bots: 352
Users: 64,795 (2,377 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 418
  • 419
  • 420
Oh. Thanks. Yeah, I guess that makes sense with the hex number. But I can't really believe what you said about BPL. Wouldn't BPL and BCS would be the exact same thing then? I mean BCS branches if A is greater then the compared value. So you say that BPL does the exact same thing?

Oh yeah, I have another question. I often see commands like this:

Code
INC $1602,x 


I read that this means, that the X is added to the adress. So in this case if X would be 4 for exmaple, $1606 would be incremented by 1. But when do you need something like that? Doesn't that mean that the adress something is written to always changes? Isn't there an easy way to find out, what adress that opcode changes? I mean if I don't know the exact adress, then the RAM Map doesn't really help me at all, does it?

EDIT:
Also the first question is still in the room. Can you use offsets as pointers in xkas patches?
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Originally posted by RPG Hacker
So you say that BPL does the exact same thing?


As far as I know, yes... I've never really used BPL or BCS though, so I'm not completely sure.



 
Originally posted by RPG Hacker
Oh yeah, I have another question. I often see commands like this:

Code
INC $1602,x 

This means that there is a table at the address given. The value in the X register determines what value in the table should be increased.
My YouTube channel
Get the official ASMT resource pack here!

Originally posted by yoshicookiezeus
Originally posted by RPG Hacker
Oh yeah, I have another question. I often see commands like this:

Code
INC $1602,x 

This means that there is a table at the address given. The value in the X register determines what value in the table should be increased.


Oh, thanks! That makes sense I guess. I have one problem however: I can't find any of the tables in the game code. What does the 1602 mean? Does it mean offset 1602? Cause I tried going to 001602 and 011602. Both tries failed and I ended up on 009602. So how do I find the tables? Or do they refer to something else?

EDIT:
Wait, is it reffering to the RAM Adress? So 1602 would be
Code
$7E:1602	12 bytes	Sprites	Sprite Image Table

So if x is a 4, then the fourth byte of the Sprite Image Table is the Adress I'm Incrementing?
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Alright two things this time.

One, I've fixed the previous problem by looking at other sprites...But now the second tile will only use palette 8, ignoring the cfg file's palette. This is my current routine (sorry for the size):

Code
TILEMAP             dcb $C2,$E2,$C4,$E4

SUB_GFX             JSR GET_DRAW_INFO       ; sets y = OAM offset
                    LDA $157C,x             ; \ $02 = direction
                    STA $02                 ; / 
                    LDA $14                 ; \ 
                    LSR A                   ;  |
                    LSR A                   ;  |
                    LSR A                   ;  |
                    CLC                     ;  |
                    ADC $15E9               ;  |
                    AND #$01                ;  |
                    STA $03                 ;  | $03 = index to frame start (0 or 1)
                    PHX                     ; /
                    
                    LDA $14C8,x
                    CMP #$02
                    BNE LOOP_START_2
                    STZ $03
                    LDA $15F6,x
                    ORA #$80
                    STA $15F6,x

LOOP_START_2        LDA $00                 ; \ tile x position = sprite x location ($00)
                    STA $0300,y             ; /

                    LDA $01                 ; \ tile y position = sprite y location ($01)
                    STA $0301,y             ; /

                    LDA $15F6,x             ; tile properties xyppccct, format
                    LDX $02                 ; \ if direction == 0...
                    BNE NO_FLIP_1           ;  |
                    ORA #$40                ; /    ...flip tile
NO_FLIP_1           ORA $64                 ; add in tile priority of level
                    STA $0303,y             ; store tile properties

                    LDX $03                 ; \ store tile
                    LDA TILEMAP,x           ;  |
                    STA $0302,y             ; /

                    INY                     ; \ increase index to sprite tile map ($300)...
                    INY                     ;  |    ...we wrote 1 16x16 tile...
                    INY                     ;  |    ...sprite OAM is 8x8...
                    INY                     ; /    ...so increment 4 times

                    LDA $00                 ; \ tile x position = sprite x location ($00)
                    STA $0300,y             ; /

                    LDA $01                 ; \ tile y position = sprite y location ($01)
		    CLC                     ;  |
		    ADC #$F0		    ;  |Shift up one tile
                    STA $0301,y             ; /

                    LDA $15F6,x             ; tile properties xyppccct, format
                    LDX $02                 ; \ if direction == 0...
                    BNE NO_FLIP_2           ;  |
                    ORA #$40                ; /    ...flip tile
NO_FLIP_2           ORA $64                 ; add in tile priority of level
                    STA $0303,y             ; store tile properties

                    LDX $03                 ; \ store tile
		    INX                     ;  |
		    INX                     ;  |Add 2 to x for values 3 and 4
                    LDA TILEMAP,x           ;  |
                    STA $0302,y             ; /

                    INY                     ; \ increase index to sprite tile map ($300)...
                    INY                     ;  |    ...we wrote 1 16x16 tile...
                    INY                     ;  |    ...sprite OAM is 8x8...
                    INY                     ; /    ...so increment 4 times            

                    PLX                     ; pull, X = sprite index
                    LDY #$02                ; \ 460 = 2 (all 16x16 tiles)
                    LDA #$01                ;  | A = (number of tiles drawn - 1)
                    JSL $01B7B3             ; / don't draw if offscreen
                    RTS                     ; return


And two...Does anyone know the routine that causes a sprite to follow a line-guide, similar to Fuzzies?
Originally posted by RPG Hacker
Oh, thanks! That makes sense I guess. I have one problem however: I can't find any of the tables in the game code. What does the 1602 mean? Does it mean offset 1602? Cause I tried going to 001602 and 011602. Both tries failed and I ended up on 009602. So how do I find the tables? Or do they refer to something else?

EDIT:
Wait, is it reffering to the RAM Adress? So 1602 would be
Code
$7E:1602	12 bytes	Sprites	Sprite Image Table

So if x is a 4, then the fourth byte of the Sprite Image Table is the Adress I'm Incrementing?

You're correct; it's incrementing the fourth byte if x is 4.

Side note: you cannot, in any way, edit the ROM with ASM. If you see a code that stores, increments, decrements, ect ect to any address, it's a RAM address. Always.

(Further side note: if you want to know why it chose $7E1602 when the code only refered to $1602, that's because of the bank. At the start of the sprite routine you'll see stuff like PHB, PHK, PLB. Those set what the implied number will be in such addressing.)
Originally posted by Kaijyuu
You're correct; it's incrementing the fourth byte if x is 4.


OK. Thanks for the help. Is there a thread that tells me, what those bytes do? Or do I have to guess?

Originally posted by Kaijyuu
Side note: you cannot, in any way, edit the ROM with ASM. If you see a code that stores, increments, decrements, ect ect to any address, it's a RAM address. Always.

(Further side note: if you want to know why it chose $7E1602 when the code only refered to $1602, that's because of the bank. At the start of the sprite routine you'll see stuff like PHB, PHK, PLB. Those set what the implied number will be in such addressing.)


Yeah. I knew that. But thanks anyways.
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Really quick question:

Is there a list of all the sprite states somewhere?

EDIT: Found it.
I am having a slight problem with a custom block.

The block is supposed to act like a vine after a certain criteria is met. I'm sure I programmed that part of the block right, but the issue I am having is actually making it act like a vine after the requirement is met. Before, it is supposed to act like air, and I did set the block to act like 25.

Anyway, this is the part of the code I'm using to make it act like a vine.

Code
LDA #$06 ; Map16 tile
STA $1693 ; Store it to the value 7E:$1693
LDY #$00 ; Map16 Page the Map16 tile is on 


However, when I load this routine, it still acts like an air tile (25). Yes, I tried putting the "LDY #$00" before the "STA $1693" as well, same problem. I remember seeing somewhere that you can't load block properties from the first page of the Map16 with an "LDY #$00", but couldn't find a solution.

Any ideas?
Are you using it like this:

LDY #$00
LDA #$06
STA $1693


If that doesn't work, then you could make your code like this:

MarioTouch:
Whatever your code is
BEQ Vine
Act like whatever it is supposed to if the requirement is not met (here)
Vine:
LDY #$00 ;remain tile 6


And make it act like tile 6 (if that is the vine).

I haven't tested it, but it should work.

edit - sorry, I meant BEQ instead of BNE.
Well, I did try the first part of the code you suggested, that still doesn't work.

But anyway...I tried your second suggestion and it worked, so thanks. :)
I'm having a slight problem of my own here:

dcb "INIT"
dcb "MAIN"
LDA $15
AND #$08
BNE INVI
RTL
INVI
LDA #$01
STA $1497


This generator is supposed to make mario invincible if he presses the up button. But when I test it out, Mario still dies if I press up. Is anything wrong here?
Try this code:

dcb "INIT"
RTL
dcb "MAIN"
LDA $15
AND #$08
BNE INVI
RTL
INVI:
LDA #$01
STA $1497
RTL


Seems like you only forgot some RTLs. :P


 
OK, I really apreciate some help with this...
Can someone help me to recreate the fludd engine for caped mario?

I have the "hover" thing and the graphics, but I need to know how can I make a custom counter for the status bar and how to link it with the floating time.The problem is that I haven't found adresses for "floating", "in air" or "falling". Can somoeone tell me , by start, how can I check if mario is floating with the cape??(with knowing if mario is in air I think is enough)

Thank you for reading this.


Check my profile to see the updates of smheroes!
Using 2 different patch of this site (and helping by a member) I'm arrived to create this code:

Code
NewRoutine:
    LDA $0DB3 ;If $0660 is zero, branch to mario
    BEQ M
    BRA Return
M:
    LDA $75 ;If in water, return
    BNE Return
    LDA $187A ;If on yoshi, return
    BNE Return
    LDA $77 ;If in air, continue
    AND #$04
    BNE R
    LDA $0660 ;If spin jumping, branch to fall2
    BNE f2
    LDA $15 ;If press Down, branch to fall
    CMP #$04
    BEQ f
    BRA Return
f:
    LDA $15
    AND #$04
    BNE Invi
    BRA Return
    Invi:
    LDA #$1c
    STA $13E0
    BRA f2
f2:
    INC $140D  ;Start spin jump
    LDA $7D ;If rising, return
    CMP #$80
    BCS Return
    STZ $7B ;prevent horizontal movement
    LDA #$50 ;Increase fall speed
    STA $7D
    BRA Return
R:
    STZ $0660
    BRA Return
Return:
        LDA $0DBE
        INC A
    RTL


But i have a problem... If i continue to pres down he swom me the different graphics but if i release the button it change on the normal spin jump... How can i fix it???
I'm using Shop blocks BTSD version, and I'm wondering, is there a list of items in hex you there, according to the readme, !Item = #$03 is a fire flower. I COULD guess and check, but I was wondering if there was some sort of reference page for things like this.
Yeah, there is. This document contains a list of items you can use in the item reserve box. Some of them may be glitchy though, so be careful when choosing the item to put.
Thanks, you saved me LOTS of work.
Can anyone tell me why the hell this is giving me an error in ST?

Code
        LDA $7FAB10,x           ;extra bits check
	AND #$04
	BEQ TYPE2
        ;stuff

TYPE2   ;more stuff


I know it's these because when I comment them out, there's no error. Predictably, it doesn't branch to the alternate behavior when I insert it anyway.
Try running the .asm file itself through TRASM, and you should get a .err file that tells you exactly where the error is and what kind of error it is.
My YouTube channel
Get the official ASMT resource pack here!

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 418
  • 419
  • 420