Language…
12 users online:  AmperSam, CroNo, DanMario24YT, drkrdnk, EvilAdmiralKivi, fsvgm777, Guido_Keller, JezJitzu, mmmdoggy, timothy726, Tomi P, Zavok - Guests: 262 - Bots: 324
Users: 64,795 (2,377 active)
Latest user: mathew

Posts by deffon1993

deffon1993's Profile → Posts

Honestly, I tried that exact thing before, but it didn't work :/.


Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Nope, it doesn't work.
I've tried switching sprites, but that didn't work.

I also tried:

PLY
LDA $157C,y
STA $157C,x
TYX

...instead of PLX.

The last thing I tried was to change the sprite's status to normal (instead of initial), don't work (goes right every time)
The only thing I can think of is to make the sprite always face Mario.



Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I hate to say it, but that doesn't seem to work either.
Also, the sprite spawns at the right location before using this code.

I placed it between (STA $14C8,y) and (LDA $E4,x), should I place it somewhere else?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Originally posted by Kaijyuu
You placed what between what? xD


Just copy/paste what I posted. JSL $07F7D2 needs to be after you set the sprite number to $9E, but before you set anything else. SBC #$00 needs to be between LDA $14D4,x and STA $14D4,y.


I don't think you understand what my problem is.

The sprite spawns - that's fine.
The sprite spawns depending on my sprite's position - that's fine.

The sprite always gets fired in a direction depending on Mario's position - that's crap.


When it's spawned, it runs the INIT routine.
This makes it face Mario, no matter what.
Writing to it's direction is useless, it gets overwritten as soon as the spritecode runs.

I've tried adjusting the code that makes Bowser breath fire, and that doesn't work either !

I don't know what to do anymore :(...

Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Originally posted by smkdan
you're trying to spawn a bullet bill. See that's a wierd sprite, it doesn't care what you set the direction to because it never uses the default table. What you put in $157C,x does not matter.

Code
JSL $02A9DE
BMI SlotsFull ; If sprite slots are full, don't generate.
LDA #$1C
STA $009E,y ; The sprite number is stored to $009E,y.

PHX 		; Push current sprite.
TYX 		; Get sprite to generate into X.
JSL $07F7D2 	; Reset sprite tables, to generate this one.
PLX 		; Restore previous sprite.

LDA #$08
STA $14C8,y ;DO NOT Run sprite's INIT code first.

LDA #$10 ;set initial properties
STA $1540,y
LDA $157C,x ;copy direction, but bullet bill uses a different table for direction
STA $00C2,y

LDA $E4,x
STA $00E4,y ; X position.
LDA $14E0,x
STA $14E0,y ; X position high.
LDA $D8,x
SEC
SBC #$12
STA $00D8,y ; Y position.
LDA $14D4,x
SBC #$00
STA $14D4,y ; Y position high.

RTS


I haven't tested that but give it a try.


YES, YES, YESSSSSSSSSSSSSSS!
It works, thank you so much!

Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
How does the save function work?

Is it so that it saves the entire RAM to a save file, and when you load that save file - it cleans most of the RAM (except events, Mario's X and Y Position on the Overworld and so on)?

Was just wondering, because I want to preserve some additional values when saving.
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Originally posted by Ultimaximus
Originally posted by deffon1993
How does the save function work?

Is it so that it saves the entire RAM to a save file, and when you load that save file - it cleans most of the RAM (except events, Mario's X and Y Position on the Overworld and so on)?

Was just wondering, because I want to preserve some additional values when saving.

No. You see, there are multiple types of RAM, which include RAM and SRAM. RAM is cleared when you turn off the game, and SRAM is the saved stuff, and doee not get cleared when turning off the game. SRAM is stored to and loaded from in the exact same way as standard RAM. Certain things are simply saved to the SRAM, not the entire RAM. A simple LDA STA can be used if you want to store to it.


Okay.
So, where can I find some unused SRAM?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
First of all, the code looks kind of scrambled.
When using codes that never, ever has to to changed, you JSR to them.

When you build your code, JSR from the main routine to the sprite code.
Then, at the very begginning of your sprite code, write: "JSR GET_DRAW_INFO", then put that routine last.

It's important that you JSR and not branch in the beginning, otherwhise the code have to end with an RTL, and every return in the graphics routine ends with RTS.
This caused the crash.

I think that this should work:
Code
dcb "INIT"
RTL

dcb "MAIN"
JSR Routine
RTL
;===================================
; GRAPHICS ROUTINE HERE
;===================================

Routine:
JSR GET_DRAW_INFO

LDA $00
STA $0300,y

LDA $01
STA $0301,y

LDA #$24
STA $0302,y

LDA #%00000110
ORA $64
STA $0303,y

INY
INY
INY
INY

LDY #$02 ; This means the tile drawn is 16x16.
LDA #$00 ; The number of tiles I wrote - 1.

JSL $01B7B3

RTS 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $B760 - graphics routine helper - shared
; sets off screen flags and sets index to OAM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


SPR_T1 dcb $0C,$1C
SPR_T2 dcb $01,$02

GET_DRAW_INFO: 
STZ $186C,x ; reset sprite offscreen flag, vertical
STZ $15A0,x ; reset sprite offscreen flag, horizontal
LDA $E4,x ; \
CMP $1A ; | set horizontal offscreen if necessary
LDA $14E0,x ; |
SBC $1B ; |
BEQ ON_SCREEN_X ; |
INC $15A0,x ; /

ON_SCREEN_X: 
LDA $14E0,x ; \
XBA ; |
LDA $E4,x ; |
REP #$20 ; |
SEC ; |
SBC $1A ; | mark sprite invalid if far enough off screen
CLC ; |
ADC.W #$0040 ; |
CMP.W #$0180 ; |
SEP #$20 ; |
ROL A ; |
AND #$01 ; |
STA $15C4,x ; /
BNE INVALID ;

LDY #$00 ; \ set up loop:
LDA $1662,x ; |
AND #$20 ; | if not smushed (1662 & 0x20), go through loop twice
BEQ ON_SCREEN_LOOP ; | else, go through loop once
INY ; /

ON_SCREEN_LOOP: 
LDA $D8,x ; \
CLC ; | set vertical offscreen if necessary
ADC SPR_T1,y ; |
PHP ; |
CMP $1C ; | (vert screen boundry)
ROL $00 ; |
PLP ; |
LDA $14D4,x ; |
ADC #$00 ; |
LSR $00 ; |
SBC $1D ; |
BEQ ON_SCREEN_Y ; |
LDA $186C,x ; | (vert offscreen)
ORA SPR_T2,y ; |
STA $186C,x ; |
ON_SCREEN_Y: 
DEY ; |
BPL ON_SCREEN_LOOP ; /

LDY $15EA,x ; get offset to sprite OAM
LDA $E4,x ; \
SEC ; |
SBC $1A ; | $00 = sprite x position relative to screen boarder
STA $00 ; /
LDA $D8,x ; \
SEC ; |
SBC $1C ; | $01 = sprite y position relative to screen boarder
STA $01 ; /
RTS ; return

INVALID: 
PLA ; \ return from *main gfx routine* subroutine...
PLA ; | ...(not just this subroutine)
RTS ; /




Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I have a question.
I want my sprite to act differently, only if Mario is a certain X distance away.

How would a code like that look?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Now I've got a new problem, I used Schwa's (edited) proximity code.
However, I only want the sprite to act a certain way if it faces Mario to.
When I try to do use my code, it runs fast no matter if it faces me.

Here's my code:
Code
	LDA #$50
	STA $0B				;store the range you want to check (50 pixles = 5 tiles)
	JSR Proximity1			;checks if the sprite is in range (5 tiles away).
	BEQ NOT_RANGE			;if not, then skip this.
	STA $1504,x			;Otherwise, store if for later.  (if A equals 01, then it's in range)

	JSR SUB_HORZ_POS		;Gets which direction the goomba should look to see you (in Y).
	TYA				;get it into A.
	ORA $02				;now you compare it to it's actual direction.
	BEQ ONE_IS_ZERO			;branch if both aren't ONE.
	BRA BOTH_MATCH			;otherwise they are both one, branch to the Match routine.

ONE_IS_ZERO:
	BNE ONE_IS_ONE			;branch if they don't match.

BOTH_MATCH:
	LDA $157C,x			;simply adds speed depending on direction.
	TAY
	LDA $B6,x
	CLC
	ADC X_ADD,y	
	STA $B6,x
ONE_IS_ONE:
NOT_RANGE:


Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I'm working on a barrel sprite that shoots away Mario with the press of a button.

The problem is that whenever I hit something solid a short period after the blast, Mario goes through it slighly and dies.

I've been checking if the Player blocked status ($77) equals 00,
to stop the launching and nullify his x and y speed.
However, it doesn't work for some reason :/.

Any tip of what I can do?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Is there any easy way change Mario's Palettes (Mario, MFire, Luigi, LFire) (for one frame) simply by storing a value into an adress, or do you have to call a routine or something?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I'm working on a patch that changes mario's palette to Fire Mario no matter what, IF a ram adress flag is set.

Everything is fine except for the fact that the colors are incorrect.

Here's the code:

Code
MARIO_OR_LUIGI:		db $F0,$B2,$04,$B3

MARIO_OR_LUIGI_NORMAL:	db $C8,$B2,$DC,$B2,$C8,$B2,$DC,$B2
                        db $C8,$B2,$DC,$B2,$F0,$B2,$04,$B3



COLOR_ROUTINE:
LDA $79			;checks if the flag is raised.
BEQ NORMAL		;if not, then use the normal routine (which doesn't work either)
LDY $0DB2		;set player 2 flag into Y
REP #$20		;16-bit mode
LDA MARIO_OR_LUIGI,y	;loads fire pallete depending on player 
STA $0D82		;and store it.
SEP #$20		;8-bit mode
BRA END			;end the routine 

NORMAL:
LDA $19				;loads player status into y. 
ASL				;doubles the value (0=small 2=big 4=cape 6=fire)
ORA $0DB3			;get player 2 flag into bit 1.
ASL				;double again.     (0=small 2=player_2 4=big 8=cape 12=fire)
TAY				;store it into Y
REP #$20			;16-bit mode.
LDA MARIO_OR_LUIGI_NORMAL,y	;load palette indexed by status and player 2 flag.
STA $0D82			;and store it
SEP #$20			;8-bit mode
END:		
JML $00E326			;continue on with normal routines.


Also, the NORMAL routine is directly taken from all.log. so I can't understand it...

Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I'm Hijacking Lemmy's/Wendy sprite code and I want him/her to spawn a custom sprite. However, xkas doesn't recognize "STA $7FAB10,y"
What should I do?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
How do I make a sprite always be on the left side of the screen, unaffected by the layer 1 scroll?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Okay, but I need it to interact, so I need to determine it's x position.
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
thanks :) .

Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I can't figure out what's wrong with this graphics routine.

Code
PROPERTIES: dcb $42,$02


TILEMAP: 
       	dcb $00,$01	
	dcb $00,$01	


Graphics:
	JSR GET_DRAW_INFO 	
		 	 	
	LDA $157C,x
	STA $02			



		
	STZ $03

	LDA $14
	LSR
	LSR
	LSR
	AND #$01
	BEQ NO_ADDY

	INC $03

NO_ADDY:

	PHX


	LDA $00			
	STA $0300,y		

	LDA $01			
	STA $0301,y		 

	LDX $03

	LDA TILEMAP,x		
	STA $0302,y		


	LDX $02			
	LDA PROPERTIES,x	
	ORA $64
	STA $0303,y		


	PLX			

	LDY #$02		
	LDA #$00		
				

	JSL $01B7B3		
	RTS 






every time i use the sprite, it uses Mario's tiles, and the tiles it uses depends on Mario's pose (not that it matters).

Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
I've been trying to change the music register with the help of a sprite, but I can only change it to "(SFX)" song.

Any idea how I can get rid of this problem, without the help of levelasm or hijacking, unless nessesary?

Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Nope, LDA #$05 (boss battle) doesn't works, but LDA #$09 (mario dies) does :/.
It causes a problem as I want music 09 to play, and then be overwritten as soon as the music stops.
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.