Language…
6 users online: Darolac, Easy Difficulty, Isikoro, King_Koopa, lancejameslim, Zavok - Guests: 83 - Bots: 79
Users: 70,509 (2,455 active)
Latest user: BananenHaendler

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 418
  • 419
  • 420
LevelASM already does PHB before running the level code, and after running it, it does a PLB. So all you need to do is PHK PLB. No need to make the wrapper longer.

Example code:

Code
level105:
PHK
PLB
LDA.w table
STA $19
RTS
table: db $01

My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
I stuck PHK PLB after the wrapper in my own levelasm file. Kinda silly that it wasn't included in the first place.

Anyway, that's the only difference between levelasm and generators I know, Imamelia.
Hm. Well, the code is one that spawns sprites. It's basically ICB and Iceguy's custom powerups in patch form. The game doesn't crash until I try to throw a hammer/boomerang/whatever, so the problem must be somewhere in the spawning routine. Something rather odd I noticed by accident, though, is that the game doesn't crash when I try to spawn a nonexistent sprite. I get a 16x16 piece of garbled graphics that falls straight down, but no crash.

Edit: This is the code, by the way. I removed the parts that had nothing to do with this.

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
How i can reduce the number of yoshi coins needed to get a 1-UP to 3?
The Cloud Drop sprite created by smkdan... in the asm file, where do I change so that I can have it in-game float a wider range at a range of five to six blocks?

I have it inserted into my game, but it goes only a very short distance (around the length of two or three blocks back in forth).

It's actually not in the ASM file at all. You need to open up the CFG with CFGEditor and change the box that says extra property byte 1 to whatever value you want, and that will be what his range is.
Ah. I see now... hm. *Works with cfg editor*

Hm. Since the code works okay as a generator, I decided to try making a patch that would hijack the generator main routine and temporarily store the sprite number of the powerup generator to $18B9. Unfortunately, I forgot a very important fact: Sprite Tool already hijacks the exact same address, $02AFFE. So I tried $02B003 instead, and pretty much the same thing happened: crash at title screen, and when I try to load a savestate, the overworld glitches up piece by piece. This is the code I'm using:

org $02B003

JML Main

org $1F8000

db "STAR"
dw End-Main-$01
dw End-Main-$01^$FFFF

Main:

LDA $18B9
PHA
PHB
PHK
PLB
;LDA #$D0
;STA $18B9
;JSR PowerupMainRt
PLB
PLA
LDY $9D
BNE NoGen
JML $02B007
NoGen:
JML $02B02A

PowerupMainRt:

LDA $0DC6
CMP #$01 ;
BEQ Powerup1 ;
CMP #$02 ;
BEQ Powerup2 ;
CMP #$03 ;
BEQ Powerup3 ;
CMP #$04 ;
BEQ Powerup4 ;
CMP #$05 ;
BEQ Powerup5 ;
RTS

Powerup1:
JMP HammerAndBoomerang
Powerup2:
JMP HammerAndBoomerang
Powerup3:
JMP WallJump
Powerup4:
JMP LaserAndBomb
Powerup5:
JMP LaserAndBomb

incsrc powerupcodes.asm

End:

Notice the commented-out lines...yeah, I didn't even need the powerup codes to get junk to happen. I don't know what happened here...

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Well obviously check the freespace first, then make sure spritetool doesn't JML to $02B005 (set an execute breakpoint there in a debugger).

EDIT:

Also make sure you have a header to your patch.

Code
HEADER
LOROM

;stuff
*facepalm* I didn't include the header. I R brilyunt.

...

Well, now the patch doesn't crash the game, but it doesn't do anything else either. It not only doesn't generate the powerups, it also apparently disables existing generators.

...

Okay, never mind. I tried hijacking $00A2E6—right after the place LevelASM hijacks—and it worked. Problem solved.

This can be closed...wait, no, this is a public thread. Phooey.

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
I kind of have two quick questions:

1: When you JSL/R, i've been told the stack is used to tell the game where to return back to, at the end. How many bytes of the stack does this use, and would it be at all possible to modify the location to branch back to, by doing something like this:

Code
PLA
LDA #$20
PHA
RTL

Or something?

2: How do I manually upload something to Vram, what are the necessary conditions and so forth?
For the first question, JSR requires 2 bytes of the stack and JSL requires 3 bytes. And yes, it is possible to modify the return address via stack manipulation. In fact, if you look at the "INVALID" portion of GET_DRAW_INFO, it actually does that, pulling the last two bytes off of the stack so that the subsequent RTS terminates the entire GFX routine rather than just returning from GET_DRAW_INFO itself. I think that the low byte is the top one, then the high byte, then the bank byte in the case of a JSL.

For the second question...well, let's wait for somebody else to answer that. I tried to upload data to VRAM, and I never could get it to work, even after a lot of help from smkdan and Alcaro.

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Okay. Another question involving asm. I am making use of the Koopa Guard custom sprite for use of a Koopatrol from the Paper Mario series. So I made a copy of its asm and cfg files and added "2" at the end of "koopa_guard".

But I am having trouble having "koopa_guard2" walk at a faster speed (and still be able to stay on ledges and not walk off them). I have tried messing with the cfg file... not much help (except changing the pallete it uses for its color swap). I worked the asm file a bit, little help there (I got it to walk faster, but it walks off ledges now). Got any idea to help resolve this?

What are the adresses for the switches being pressed.
$1$AD is the blue one, $14AE is the silver one. A simple CTRL-F in the ram map told me that. :)
Originally posted by crushawake
$1$AD is the blue one, $14AE is the silver one. A simple CTRL-F in the ram map told me that. :)

I was talking about the switch place switches
Here you go:

Code
$7E:1F27	4 bytes	Flag	Switch block flags (Green, Yellow, Blue, Red)


$1F27 is the "Green switch hit" flag, $1F28's for the yellow one, and so on. (No offense, but it's really easy to find it yourself. In case you don't know, you can just press Ctrl + F on any site to search for a certain word, like "switch".)


 
Originally posted by WhiteYoshiEgg
Here you go:

Code
$7E:1F27	4 bytes	Flag	Switch block flags (Green, Yellow, Blue, Red)


$1F27 is the "Green switch hit" flag, $1F28's for the yellow one, and so on. (No offense, but it's really easy to find it yourself. In case you don't know, you can just press Ctrl + F on any site to search for a certain word, like "switch".)

Thanks. I'm making an epic hack, and it has an arcade with a few minigames. However some of them are blocked by streams of elecrtricity. You have to find and smash hidden dynamo's that will get rid of them.
Another question, where is SMW's sram, and how can I store to it/read from it?
Hm, it seems I need a piece of code again... How would I spawn a custom sprite via a patch (or anything else that's not a sprite code)? I want a custom sprite to appear when 5 Yoshi/Dragon Coins are collected. Hijacking the routine for that and stuff worked perfectly, it's just the spawning code itself I'm having trouble with. I already tried using the code provided in Iceguy's sprite programming tutorial, but that crashed the game when touched, probably because it's meant to be used in a sprite's code...

So yeah, if someone could tell me how to do that properly (or even post a working sample code), I'd be very grateful.


 
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 418
  • 419
  • 420