Banner
Views: 873,659,261
Time:
38 users online: Alex_X8, AppleBoy54321, Aram, AyGaAlPa,  brickblock369, buggy789, chickaDEE Magazine, Dark Prince, Darolac,  DeppySlide, Earthling, Enan63, ExONightZ, Fausateeeee, Fermín Acosta Jr., Flamesofshadow, FODDER, Fullcannon, gaofrisk, Gulaschko, hoagie, K.T.B.,  KevinM, Mega, Metal-Yoshi94, Ottodle, Phyll, Raymondsze, Rilla Roo, Segment1Zone2, SF - The Dark Warrior,  shovda, Sixcorby, Skye, Sping bot,  Tahixham, ThatDamnCatgirl,  Veck - Guests: 78 - Bots: 73 Users: 48,646 (2,409 active)
Latest: zerociaran
Winter C3 2021 Content Spotlight
CosmicTiff's "The More Than Dreamin" Demo!
Not logged in.
Posts by Natshirt
Natshirt's Profile - Posts by Natshirt
Pages: « 1 »
I am currently learning asm and want to create a block which always spawns a flower. The only problem is that it spawns one tile to low and to far right (Screenshot). I would like to know why this happens and what I must add to my code.
Its base state is 130

Code
db $42
JMP MarioBelow : JMP MarioAbove : JMP MarioSide
JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireball
JMP TopCorner : JMP BodyInside : JMP HeadInside

MarioBelow:
    PHB             ;\
    LDA #$02        ; | change bank register to $02
    PHA             ; |
    PLB             ;/
    LDA #$02        ;\
    STA $05         ; | spawn a flower
    JSL $02887D     ;/
    PLB             ; restore bank register

    LDA #$0D        ;\
    STA $9C         ; | change block to used block
    JSL $00BEB0     ;/
RTL

MarioAbove:
MarioSide:

TopCorner:
BodyInside:
HeadInside:

SpriteV:
SpriteH:

MarioCape:
MarioFireball:
RTL

print "Test"

So what tells the sprite where it has to spawn?

I have also read the description for $02887D and cleared $8898 and $889A but it hasn't done anything
I have cleared these bits and it works perfectly. Thank you very much for your help^^

Code
MarioBelow:
    LDA $98         ;\
    AND #$F0        ; |
    STA $98         ; | clear lowest bits of $98 and $9A
    LDA $9A         ; |
    AND #$F0        ; |
    STA $9A         ;/

    LDA #$02        ;\ preserve value to spawn flower(02)
    STA $05         ;/
    PHB             ;\
    LDA #$02        ; | change bank register to $02
    PHA             ; |
    PLB             ;/
    JSL $02887D     ; call spawn subroutine
    PLB             ; restore bank register

    LDA #$0D        ;\
    STA $9C         ; | change block to used block
    JSL $00BEB0     ;/
RTL
I have made block, which is moving every sprite and the player one pixel to the right per frame. Here is a snippet how I did it for the sprites and a clip who shows what the bock is doing at the moment:
Code
SpriteV:
    REP #$20        ; set A to 16-bit mode
    LDA #$0001      ;\
    CLC             ; | add 1 to sprite's position
    ADC $E4, X      ; | $E4 contains low byte (position on screen)
    XBA             ; | $14E0 contains high byte (screen number)
    ADC $14E0, X    ;/
    SEP #$20        ; set A to 8-bit mode
    STA $14E0, X    ;\
    XBA             ; | store sprite's new position
    STA $E4, X      ;/
RTL



Now, I want to move the sprites only every second frame to make the conveyor belt slower. I don't know how I can check if the sprite has been moved the frame before or if there are other possibilities to make the belt slower.
Yes, it works and I understand the concept. Thank you very much.
I am currently trying to write a block which gets destroyed on contact with a sprite. I am using the subroutine $BEB0 to create a blank tile on the block's position and I am loading the sprite's position into $98-9B (the player's position).
Everything is working out except the fact that the tile gets always created on the left from the sprite.
Is there a way to detect if the sprite touches the left or right side of the block or is there a different way to destroy the block?

Here is the my code (I have left out the block where the player's position is pushed into the stack and pulled from the stack)
Code
    LDA $14D4, X    ;\
    XBA             ; |
    LDA $D8, X      ; | Store sprite Y position
    REP #$20        ; | into player Y position
    STA $98         ; |
    SEP #$20        ;/
    LDA $14E0, X    ;\
    XBA             ; |
    LDA $E4, X      ; | Store sprite X position
    REP #$20        ; | into player X position
    STA $9A         ; |
    SEP #$20        ;/

    LDA #$02        ;\
    STA $9C         ; | Gernerate blank tile
    JSL $BEB0       ;/
These were my first lines, but when a sprite touched the block, the tile got generated one tile below the player
I don't know either how it should work. I have only written the first three lines, started debugging the game and discovered that $00BEB0 is using the player's position to generate the block
Yes, that worked. I have only two additional questions. Where can I find the routines from GPS and can I see the code from these routines?

I have found it, it's in the gps/routines folder. Thank you very much^^
Pages: « 1 »
Natshirt's Profile - Posts by Natshirt

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks