raocow wrote:So - is it true that you can LevelASM away the hud? If so, may I please get the code?
If I can that + the feather kill thing to work together, and have all my music together, I think I'll be ready to test it for real, and adjust for gameplay and whatnot.
YCZ or someone might know the best way. I'm not sure off the top of my head.
KingTwelveSixteen wrote:Ok, I MIGHT have overreacted a little. I'm all calmed down now.
I'll give it another try to see if that new code thingy you just put in works.
Probably not. That address should only work in the base rom.
I suppose I'll stick to the original SMW for now, although I'm nervous for when I have to test this to send it in.
[edit] Completely unrelated question. Is there a way to disable the time counter so that you can write to that part of the HUD with LevelASM? Or is that too hardcoded to change? (Setting the time to 0000 doesn't work).
Accepting any and all ASM requests for A2MT. Just send me a PM. Note: If I accepted your ASM request and you never heard back from me, please let me know. I feel like I've forgotten a few of them.
Also the creator of the new A2MT CMS. PM me if you have any questions. Youtube Channel
Kil2 wrote:On the rom you sent me $938E00 worked after following the instructions in the first post.
Wait, you mean you have it working? :o
"oh no my best friend was replaced by a evil demon shadow monster"
"argh i am the evil shadow monster demon shadow"
Vip is pronounced "Beep" nostalgic realtime nitroid let's play playlist
Terry von Feleday wrote:Whee, I made my first working shooty explody thing!
Next question: Is there a way to have a shooter alter the behaviour of te sprite it shoots based on whether its extra bit is set? Say I have a shooter that shoots to the right but if I set the extra bit I want it to shoot left instead, or maybe behave entirely differently.
raocow wrote:So - is it true that you can LevelASM away the hud? If so, may I please get the code?
I have an idea that may or may not work, depending on whether levelASM is run before or after the status bar uploading routine. If it is run after, you ought to be able to get away with simply uploading blank tiles over it; I'll do some experimenting with my layer 3 tile uploading routine and see what happens.
LDA $7FAB10,x ;\ Checks Extra Bit.
AND #$04 ;|
BEQ BitClear ;|
LDA #$01 ;|
STA $1510,y ;| If Bit is set, set this address to 1
BRA BitSet ;|
;|
BitClear: ;|
LDA #$00
STA $1510,y ;/ If bit is clear, set it to 0 instead.
BitSet:
And here's a bit of the main routine of the spawned sprite:
LDA $1510,x ;\ If the sprite that spawns this one sets this address to 1,
BEQ Right ;| it will move to the left.
LDA #$C0 ;|
STA $B6,x ;|
BRA Left ;|
Right: ;| Otherwise, it will move rightwards.
LDA #$40 ;|
STA $B6,x ;|
Left: ;|
JSL $01802A ;/
If I set the value of $1510 within the routine of the spawned sprite, it works just fine - but having the shooter set it doesn't; The sprite always moves rightwards regardless of the shooter's extra bit. What am I not seeing here?[/color]
LDA $7FAB10,x ;\ Checks Extra Bit.
AND #$04 ;|
BEQ BitClear ;|
LDA #$01 ;|
STA $1510,y ;| If Bit is set, set this address to 1
BRA BitSet ;|
;|
BitClear: ;|
LDA #$00
STA $1510,y ;/ If bit is clear, set it to 0 instead.
BitSet:
LDA $179B,x ; \ set x position for new sprite
STA $00E4,y ; |
LDA $17A3,x ; |
STA $14E0,y ; /
...I figured that the same would work for other sprite tables as well. Am I wrong with this?[/color]
That should work, but I have to ask the obvious question. Has Y been set to the new sprite index before you used it? For example, this code will not work because the code is before Y is set to the correct index.
LDA $7FAB10,x ;\ Checks Extra Bit OF CURRENT SPRITE
AND #$04 ;|
BEQ BitClear ;|
LDA #$01 ;|
STA $1510,y ;| USES Y TOO EARLY
BRA BitSet ;|
BitClear: ;|
LDA #$00
STA $1510,y ;/ USES Y TOO EARLY
BitSet:
JSL $02A9DE ;Y IS THE INDEX OF A FREE SPRITE SLOT
;;;NOW Y CAN BE USED
Without seeing the code, this is the only thing I can think of that might be wrong.
CUST_SPRITE_TO_GEN = $44
SOUND_TO_GEN = $09
NEW_SPRITE_NUM = $7FAB9E
EXTRA_BITS = $7FAB10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sprite code JSL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dcb "INIT"
dcb "MAIN"
PHB
PHK
PLB
JSR SPRITE_CODE_START
PLB
RTL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; main bullet bill shooter code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RETURN RTS ; return
SPRITE_CODE_START
LDA $17AB,x ; \ return if it's not time to generate
BNE RETURN ; /
LDA #$30 ; \ set time till next generation = 30
STA $17AB,x ; /
LDA $178B,x ; \ don't generate if off screen vertically
CMP $1C ; |
LDA $1793,x ; |
SBC $1D ; |
BNE RETURN ; /
LDA $179B,x ; \ don't generate if off screen horizontally
CMP $1A ; |
LDA $17A3,x ; |
SBC $1B ; |
BNE RETURN ; /
LDA $179B,x ; \ ?? something else related to x position of generator??
SEC ; |
SBC $1A ; |
CLC ; |
ADC #$10 ; |
CMP #$10 ; |
BCC RETURN ; /
JSL $02A9DE ; \ get an index to an unused sprite slot, return if all slots full
BMI RETURN ; / after: Y has index of sprite being generated
PHX ; \ before: X must have index of sprite being generated
TYX ; / routine clears *all* old sprite values...
GENERATE_SPRITE LDA #SOUND_TO_GEN ; \ play sound effect
STA $1DFC ; /
LDA #$01 ; \ set sprite status for new sprite
STA $14C8,y ; /
LDA #CUST_SPRITE_TO_GEN ; \ set sprite number for new sprite
STA NEW_SPRITE_NUM,x ; /
JSL $07F7D2 ; reset sprite properties
JSL $0187A7 ; get table values for custom sprite
LDA #$88 ; mark as initialized
STA EXTRA_BITS,x
PLX ; call init routine on sprite
LDA $179B,x ; \ set x position for new sprite
STA $00E4,y ; |
LDA $17A3,x ; |
STA $14E0,y ; /
LDA $178B,x ; \ set y position for new sprite
SEC ; | (y position of generator - 1)
SBC #$01 ; |
STA $00D8,y ; |
LDA $1793,x ; |
SBC #$00 ; |
STA $14D4,y ; /
LDA $7FAB10,x ;\ Checks Extra Bit.
AND #$04 ;|
BEQ BitClear ;|
LDA #$01 ;|
STA $1510,y ;| If Bit is set, set this address to 1
BRA BitSet ;|
;|
BitClear: ;|
LDA #$00
STA $1510,y ;/ If bit is clear, set it to 0 instead.
BitSet:
JSR SUB_SMOKE ; display smoke graphic
RTS ; return
The JSL $02A9DE happens quite a ways before the extra bit check thing. Does this mean x indexes something else after that routine and that's why it doesn't work, or something?[/color]
CUST_SPRITE_TO_GEN = $44
SOUND_TO_GEN = $09
NEW_SPRITE_NUM = $7FAB9E
EXTRA_BITS = $7FAB10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sprite code JSL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dcb "INIT"
dcb "MAIN"
PHB
PHK
PLB
JSR SPRITE_CODE_START
PLB
RTL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; main bullet bill shooter code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RETURN RTS ; return
SPRITE_CODE_START
LDA $17AB,x ; \ return if it's not time to generate
BNE RETURN ; /
LDA #$30 ; \ set time till next generation = 30
STA $17AB,x ; /
LDA $178B,x ; \ don't generate if off screen vertically
CMP $1C ; |
LDA $1793,x ; |
SBC $1D ; |
BNE RETURN ; /
LDA $179B,x ; \ don't generate if off screen horizontally
CMP $1A ; |
LDA $17A3,x ; |
SBC $1B ; |
BNE RETURN ; /
LDA $179B,x ; \ ?? something else related to x position of generator??
SEC ; |
SBC $1A ; |
CLC ; |
ADC #$10 ; |
CMP #$10 ; |
BCC RETURN ; /
JSL $02A9DE ; \ get an index to an unused sprite slot, return if all slots full
BMI RETURN ; / after: Y has index of sprite being generated
PHX ; \ before: X must have index of sprite being generated
TYX ; / routine clears *all* old sprite values...
GENERATE_SPRITE LDA #SOUND_TO_GEN ; \ play sound effect
STA $1DFC ; /
LDA #$01 ; \ set sprite status for new sprite
STA $14C8,y ; /
LDA #CUST_SPRITE_TO_GEN ; \ set sprite number for new sprite
STA NEW_SPRITE_NUM,x ; /
JSL $07F7D2 ; reset sprite properties
JSL $0187A7 ; get table values for custom sprite
LDA #$88 ; mark as initialized
STA EXTRA_BITS,x
PLX ; call init routine on sprite
LDA $179B,x ; \ set x position for new sprite
STA $00E4,y ; |
LDA $17A3,x ; |
STA $14E0,y ; /
LDA $178B,x ; \ set y position for new sprite
SEC ; | (y position of generator - 1)
SBC #$01 ; |
STA $00D8,y ; |
LDA $1793,x ; |
SBC #$00 ; |
STA $14D4,y ; /
LDA $7FAB10,x ;\ Checks Extra Bit.
AND #$04 ;|
BEQ BitClear ;|
LDA #$01 ;|
STA $1510,y ;| If Bit is set, set this address to 1
BRA BitSet ;|
;|
BitClear: ;|
LDA #$00
STA $1510,y ;/ If bit is clear, set it to 0 instead.
BitSet:
JSR SUB_SMOKE ; display smoke graphic
RTS ; return
The JSL $02A9DE happens quite a ways before the extra bit check thing. Does this mean x indexes something else after that routine and that's why it doesn't work, or something?[/color]
Everything looks good except "JSL $0187A7" which should break everything.
Huh, well that's curious. I'm not familiar with those kinds of address jumps, so how do I fix it? Do I just change it to JSR, do I need to alter that routine to RTL, or can I just remove that jump entirely because it doesn't look like it actually does anything?
Chibikko wrote:Everything looks good except "JSL $0187A7" which should break everything.
No, it actually doesn't. All shooters that generate custom sprites use it without problem; I would guess that Spritetool hijacks it. And it doesn't seem to mess with any of the registers either.
Okay, then now I'm just plain at a loss as to what's wrong. Could someone make a shooter and sprite that does what I want(Just a shooter that makes the sprite act differently depending on whether its extra bit is set) that works so I could use that as a base?
I guess I could take the easy way out and take an additional sprite and shooter instead, but I'd prefer not to hog up too many sprite slots...
Chibikko wrote:Everything looks good except "JSL $0187A7" which should break everything.
No, it actually doesn't. All shooters that generate custom sprites use it without problem; I would guess that Spritetool hijacks it. And it doesn't seem to mess with any of the registers either.
According to the source code, you are correct. I do not know why I did not think of this: that spot is perfect for a hijack.
Terry von Feleday wrote:I guess I could take the easy way out and take an additional sprite and shooter instead, but I'd prefer not to hog up too many sprite slots...
It appears that shooters do not use the extra bit in the same way as sprites. There are a lot of shooter slots so just use two. If they set $1510,y to a different value, and the sprite tests for this, then only one sprite is needed.
So - is it true that you can LevelASM away the hud? If so, may I please get the code?
Just change the Y pos of layer 3 using the register... 2112 or 2111 one of those.
I also have a code that's probably safer that gets rid of the HUD EXCEPT for the item box. Or we could make a loop of layer 3 upload although that's probably not the best way to go about it.
I already tried that. It doesn't get rid of the hud. By the time the levelasm is run, half of the hud has already been drawn, so it looks like it's being cutoff.
I need to be able to have two music tracks for my level, one for when the o/off switch is in the on position, and one for when it's in the off position. Would anyone be willing to help with that?
Kil2 wrote:The scrolling star code from my level should be drag & droppable into any level with layer 2 stars that doesn't have vertical scrolling. If you know how to patch levelasm you could try copying this to your level number