Language…
6 users online: Anas, CONLUSH666, Danik2343, Firstnamebutt, masl, Zavok - Guests: 200 - Bots: 393
Users: 64,795 (2,380 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 418
  • 419
  • 420
Originally posted by yoshicookiezeus
Using that routine but changing it to aim at a position one tile lower will make it always hit Mario.


In this case, that's not the problem. What I need is about twice as much accuracy. As in, if Mario moves 4 pixels to the left, then the angle should change to accommodate. Right now it takes 8 or so pixels for any change to occur. In my case, 4 would probably be the minimum that would be allowable, but more accuracy is always better.
I should get a new layout.

Probably won't, though.
Originally posted by Kipernal
Does anybody have an aiming routine I could use? I'd use the default one that Magikoopas use but it's too inaccurate for what I'm trying to do.


Replace "inaccurate" with "uncustomizable", and you'd get what I've always said about the aiming routine edit1754 used for some of his dynamic sprites. I really wish he'd make a version of that that was more flexible; it could really be useful.

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
What I really need is a routine that will fire an object from point A to point B with a large amount of precision (within 4 or so pixels to any side), hence why SMW's default routine won't work. But I've found a formula for finding the value of an arctangent, only problem is it involves a lot of division and multiplication. In that case, can the division and multiplication registers work at the same time? If not then this method might not be so feasible.
I should get a new layout.

Probably won't, though.
Quick question:

Is it possible reference a register using long addressing? Or are they only writable using absolute?
If you mean hardware registers, LDA #$80 STA $002100 works fine. It's just a little slower and larger than STZ $2100, but that shouldn't matter.
<blm> zsnes users are the flatearthers of emulation
So they use bank 00 then. Alright.
They actually exist in all of banks 00 through 3F. LDA #$00 STA $292100 would give exactly the same results. Using bank 00 is probably less confusing, that's the only difference.
<blm> zsnes users are the flatearthers of emulation
Well it was my biggest fear if I ever had to use banks $40+ for code that I wouldn't be able to write to registers without changing the bank. Guess I don't need to worry.
Does anyone know anything about the GFX uploading routine beginning at $00AA6B? I'm trying to figure out what $1BA2-$1BE2 are for, but I'm getting nowhere fast. About all I can figure out is that $1BBC-$1BBD seem to be either FFFF or 0000 depending on whether or not the GFX file being uploading is GFX01 (to check for the Special World GFX). I also discovered that $1BA2 is definitely used in some of the Mode 7 bosses, including Reznor and Bowser.

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Is there a part of the whole palette that's not used by anything?
I'm trying to find space for extra Mario palettes.
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Originally posted by deffon1993
Is there a part of the whole palette that's not used by anything?
I'm trying to find space for extra Mario palettes.

well let's see, the second half of Palettes C-F and there's also the second half of Palettes 5-7 that aren't used at all in levels so you can use those.
I change my layout every 4-5 months
Could somebody tell me what I'm doing wrong here?
Code
LDA $C681
CLC
ADC #$01
STA $0DBF
STA $C681

INC $0DBE


In theory, this should add one to $C681 (which is free RAM according to the SNES9x debug) and then write that to the coin counter, and back to itself. But for some reason it writes 1 to the coin counter every frame (this is in LevelASM).

Also the last INC works fine (I just put that in to make sure the code was being run).
the problem is with the $C681, if anything is past $8000, it's considered loading the ROM Address from Bank 00. you have to use long addressing mode instead, so $C681 would become $7EC681

Edit: Also, are you trying to make it so when the freeram is a specified value, it increses your coin counter? if so, then you would use this code instead

Code
LDA $7EC681
CMP #$xx       ; replace xx with the specified value
BCC +            ; If less than specified value, branch
INC $0DBF
LDA #$00         ;\ Can't STZ $7EC681 since it's
STA $7EC681    ;/ a invalid opcode/command
RTS
+:
LDA $7EC681
CLC
ADC #$01
STA $7EC681
RTS
I change my layout every 4-5 months
That was actually an extremely simplified version of my code, the actual thing is much different. But putting 7E in front fixed the problem perfectly, thanks!
Hi everybody.
I'm trying to use Multiple Midway Points patch. Whenever I touch in a midway point and die, I am redirected to level 0. Any suggestions?
I'm inserting the midway point custom blocks. But nothing changes.
Code
dw $01C0 : dw $11C1 : dw $11C2 : dw $11C3 : dw $11C4 : dw $11C5 : dw $11C6 : dw $11C7 : dw $11C8 : dw $11C9


This happens in all levels.
First, make sure you're not loading from a savestate to check. The title screen needs to be run.


Still it's rather baffling that you'd always be sent to level 0. Does it do the same on a lunar magic edited but otherwise clean ROM?
It works properly when I don't expand the table. I'm trying to expand to 10. After this change nothing works normally.

Code
!MIDWAY_NUMBER	= $0009	; max number of midway points per level
			; using more vastly increases the size of the table
			; if you changed it to, for example, 0003
			; the tables for EVERY level would look similar to this:
			; dw $0001 : dw $0001 : dw $0001
			; the maximum of midway points would be 00FF (256 decimal)


LEVEL_TABLES:
;levels 0-F
dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000		; 
dw $0001 : dw $0001 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000		; place the level number which you want to use here
dw $0002 : dw $0002 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000 : dw $0000		; 

etc...
Ah, are you using $000A or $0010?
I tried using $000A and nothing happens. I'm still being transferred to level 0.
I want Ladida's scroll code to effect layer 3, but when I change the 1E to 22, nothing happens. Why is that? It's especially odd because it will work fine on layer two when it is 1E.
(Here's the code.)

Init.
Code
        LDX #$06 ; The amount of bytes in the scroll table.
LOOP:
	LDA ScrollTable,x
	STA $7FA000,x
	DEX
	BPL LOOP
	RTS

ScrollTable:
	db $7F,$01,$01
	db $10,$01,$01
	db $00 	; End byte, don't remove it

Level.

Code
	REP #$20
	LDA #$0F02
	STA $4330
	SEP #$20

	LDA #$00 ; Last byte of free RAM address
	STA $4332 

	LDA #$A0 ; Middle byte of RAM address
	STA $4333

	LDA #$7F ; First byte of RAM address
	STA $4334

	REP #$20
	LDA $22 ; Layer 3 X-position
	STA $7FA000+$4
	LSR
	STA $7FA000+$1
	SEP #$20

	LDA #$08
	TSB $0D9F
	RTS


Thanks.
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 418
  • 419
  • 420