Language…
6 users online: Daizo Dee Von, DashGamer, drkrdnk, Isikoro, marvisjj,  Nanako - Guests: 253 - Bots: 328
Users: 64,795 (2,377 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 418
  • 419
  • 420
IRQ fires when the screen drawing hardware reaches a point the CPU specifies. In SMW, it's used to update the layer 3 position.
NMI fires when the screen drawing hardware reaches the bottom of the screen. At this point (called v-blank), a lot more hardware registers are writable than during active display (aka outside of blanls), so various stuff can be written to VRAM/etc. This is used in almost all SNES games.

Very few users ever needs to care about them. Some more advanced users will learn that some stuff must be inside v-blank and therefore should hijack the NMI routine, but very few users will need to care about the details on how it works.
<blm> zsnes users are the flatearthers of emulation
Quote
TAB - Transfer A to Data Bank
MTP - Multiply by #$xx
DVI - Divide by #$xx

I'd just like to point out that there is a register to do that math($211B write, $2134/6 read) and 'TAB' can be done by PHA : PLB

I have a few questions:

Is there a tutorial for HDMA and LevelASM?
When (and if...) I get really good at creating custom sprites for SMW, where would be the best place to head from there?
How do you make a health system? I need a custom one for my hack, but none of the ones I've seen fit very well.
Eh, sure. Why not? Kaizo hacking doesn't seem too ha-aaaaaaand I broke the ROM.
Originally posted by Ixtab
Quote
TAB - Transfer A to Data Bank
MTP - Multiply by #$xx
DVI - Divide by #$xx

I'd just like to point out that there is a register to do that math($211B write, $2134/6 read) and 'TAB' can be done by PHA : PLB

Actually, yeah, I knew about PHA : PLB but the things I write there are just some shortcuts, that almost every ASM new thing. Also, I have heard about the register that do math, but I didn't learn about hardware regs yet so I didn't know how to use it. Thanks, anyway. :)
...Huh?
I've tried to make some macros for writing data to VRAM and CGRAM and for writing data from VRAM and CGRAM to normal RAM. These are what I have:

Code
macro WriteToVRAM(srcbank, srcaddr, destaddr, datasize)
REP #$10			; 16-bit XY
LDA #$80			;
STA $2115			; increment after reading the high byte of the VRAM data write ($2119)
LDY #<destaddr>		;
STY $2116			; VRAM address
LDY #$1801			;
STY $4320			; 2 regs write once, $2118
LDY #<srcaddr>		;
STY $4322			; set the lower two bytes of the source address
LDA.b #<srcbank>	;
STA $4324			;
LDY #<datasize>		; number of bytes to transfer
STY $4325			;
LDA #$04			; DMA channel 2 (TSB $420B messes stuff up...I wonder why?)
STA $420B			;
SEP #$10			; 8-bit XY
endmacro

macro WriteFromVRAM(srcaddr, destbank, destaddr, datasize)
REP #$10			; 16-bit XY
LDA #$80			;
STA $2115			; increment after reading the high byte of the VRAM data write ($2119)
LDY #<srcaddr>		;
STY $2116			; VRAM address
LDY #$1881			;
STY $4320			; 2 regs write once, $2118
LDY #<destaddr>		;
STY $4322			; set the lower two bytes of the destination address
LDA.b #<destbank>	;
STA $4324			;
LDY #<datasize>		; number of bytes to transfer
STY $4325			;
LDA #$04			; DMA channel 2 (TSB $420B messes stuff up...I wonder why?)
STA $420B			;
SEP #$10			; 8-bit XY
endmacro

macro WriteToCGRAM(srcbank, srcaddr, destaddr, datasize)
REP #$10			; 16-bit XY
LDA #<destaddr>		;
STA $2121			;
LDY #$2101			;
STY $4320			; 2 regs write once, $2121
LDY #<srcaddr>		;
STY $4322			; set the lower two bytes of the destination address
LDA.b #<srcbank>	;
STA $4324			;
LDY #<datasize>		; number of bytes to transfer
STY $4325			;
LDA #$04			; DMA channel 2
STA $420B			;
SEP #$10			; 8-bit XY
endmacro

macro WriteFromCGRAM(srcaddr, destbank, destaddr, datasize)
REP #$10			; 16-bit XY
LDA #<srcaddr>		;
STA $2121			;
LDY #$2181			;
STY $4320			; 2 regs write once, $2121
LDY #<destaddr>		;
STY $4322			; set the lower two bytes of the destination address
LDA.b #<destbank>	;
STA $4324			;
LDY #<datasize>		; number of bytes to transfer
STY $4325			;
LDA #$04			; DMA channel 2
STA $420B			;
SEP #$10			; 8-bit XY
endmacro

They look correct, or at least I think they do, but I'm not sure if they work properly. They don't seem to, from what I can tell using them in a patch. Are there modifications I need to make to one or more of these?

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Is it possible to edit this block to make it completely disappear after one payment? (Also, this is just additional, but how would I make it so when you go through, the block above, which I want the same block, to also shatter? Because if I put one above the other, the one below gets broken, whilst the one above stays, when I want both broken.)
Shouldn't it disappear completely already? Anyway for the second part you have to shift the block position up #$10 and do the vanish/shatter subroutine again.
I need help with something. For one of my projects, I need to make an edit of the ExMarioPalette patch, so that the palette is changed not by level, but by how many lives you have left. Is this possible?
Eh, sure. Why not? Kaizo hacking doesn't seem too ha-aaaaaaand I broke the ROM.
Originally posted by MarioEdit
Shouldn't it disappear completely already? Anyway for the second part you have to shift the block position up #$10 and do the vanish/shatter subroutine again.


What I mean by disappear is disappear permanently. If I were to re-enter the level, it would come back, and I want it gone for good once paid for once.
Does anyone know anything about how Layer 2 scrolling sprites like EF (the one in the vertical portion of Morton's Castle) make Mario "stick" to Layer 2 when he is touching it? I've been trying to figure out how this is accomplished for some time now, but I have had no luck.

Many tricks that currently involve Layer 2 movement still have Mario's gravity isolated to Layer 1, so when he is standing on Layer 2, it will scroll out from underneath him.

[?] Miscellaneous Helpful Hints
If I moderated your hack, there was apparently a 90 percent chance it was rejected.
Originally posted by MSAhm3d59113
Originally posted by MarioEdit
Shouldn't it disappear completely already? Anyway for the second part you have to shift the block position up #$10 and do the vanish/shatter subroutine again.


What I mean by disappear is disappear permanently. If I were to re-enter the level, it would come back, and I want it gone for good once paid for once.

The best way to do that would be to use a block and object in conjunction for your desired effects. Simply make the object not appear if a certain flag is set, and, in the block, set said flag.
Yeah you'll need to either use a custom object or use LM's conditional map16. Custom objects are probably easier to wrap your head around.
How would I go about displaying sprite tiles on screen using levelASM? To be precise, how do I look for free OAM space? GET_DRAW_INFO seems to rely on the sprite having a sprite slot and stuff, so...


 
To search for free OAM space I think you just check if the y pos is > $F0. If it is, you will not be able to see it, so it will not matter if you overwrite the bytes that correspond to it.
No, you're supposed to check if the Y position is equal to F0. Y=F8 for an 16x16 tile means half of it is visible at the top of the screen.
Note that your slot may be overwritten later, so use the No More Sprite Tile Limits patch and sprite memory 10 so the sprites won't overwrite you (if the LevelASM codes run before the sprite codes, I never checked which is first).
<blm> zsnes users are the flatearthers of emulation
Most the stuff in the $0200-02FF range is ok to use. They're used by more obscure things like cluster sprites so there's less chance of a conflict.
Okay, so I tried editing the ExMarioPalette patch so that palettes would be decided by lives instead of by level number. All goes well when I have the maximum lives I set in my ROM (which is 6), but when I have less than that, the colors are glitchy. Now, you may think that the problem is that I haven't set palettes. I'm pretty sure thats not the problem, as Mario will randomly change colors. Here is the ASM file.
Eh, sure. Why not? Kaizo hacking doesn't seem too ha-aaaaaaand I broke the ROM.
I have a problem.
When I use HuFlungDu's edit of Romi's Addmusic, the music changing command in VWF cutscene tool doesn't seem to work. The music just stops instead of changing. This doesn't happen when I use the older Romi's Addmusic. Does anyone know what's wrong and if there's a way to fix it?
Addmusic 4.05 uploads only one song at a time instead of four like the old Addmusic did, so just using the music change command as-is won't work. You can use the code in this thread, though. (Someone should probably update that tool to reflect that...)

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Well, an unusual question, but I have counted 92 opcodes for ASM in total. (including WDM) Am I right? I also counted 30 addressing modes: dp ; addr ; long ; imm ; dp,x ; addr,x ; addr,y ; long,x ; (dp) ; (dp,x) ; (dp),y ; [dp] ; [dp],y ; (addr) ; (addr,x) ; [addr] ; sr,s ; (sr,s),y ; N/A ; stack ; stack/interrupt ; stack/addr ; stack/(dp) ; stack/[pc] ; pc ; [pc] ; A ; imp ; rt ; srcbk,destbk

I could miss some. N/A is used by WDM, absolute indirect are used by jumping commands e.g. JMP, stack/addr - PEA, stack/(dp) - PEI, stack/interrupt - COP, stack - PHA, PLX, stack/[pc] - PER, rt - RTS, RTL, RTI; pc - BEQ, BVC; [pc] - BRL, imp - INX, TDC; if I missed something, tell me. Now, registers. I counted 11 registers which are:
A, X, Y, B, D, K, BK, S, PC, P, C [Accumulator, X Index, Y Index, B Register (LDA #$XX00), Direct Page, Program Bank, Data Bank, Stack Pointer, Program Counter, Processor Status, C Register (LDA #$XXXX)]
Am I right?
...Huh?
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 418
  • 419
  • 420