Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,530,728
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 05-04-24 09:32 AM
Guest: Register | Login

Main - Posts by Goldensunboy

Pages: 1 2

Goldensunboy
Posted on 07-10-07 06:15 AM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 53614


Goomba
Level: 15

Posts: 1/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
How would I go about popping a sprite out of thin air in mid-level, once certain conditions are met? I have a code I'm working on (called each frame by LevelASM, thanks BMF) that requires, at a certain point, a sprite to be spawned, move, and transform into a map16 block. (I found out how to do that finally)

I have taken a long break from SMW hacking until now, and I am a bit rusty on which sprite tables are important in spawning a sprite, and what the bytes written to the tables would have to be. (ex: write byte Y to table Z and it will spawn sprite Y) Help would be very much appreciated, because I can't find (or at least haven't found yet) any threads with information on important sprite tables.

Also, could I have a little help on how to find the sprite index of the first unused sprite? Of course, that would be necessary in creating a sprite from scratch, because the current sprite's index isn't easily accessible anywhere. (the code isn't contained in a sprite's code)

Thanks!

Goldensunboy
Posted on 07-10-07 07:36 AM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 53637


Goomba
Level: 15

Posts: 2/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
I already read the stickies and found no useful information about updating tables concerning sprite creation.

Goldensunboy
Posted on 07-10-07 08:33 AM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 53649


Goomba
Level: 15

Posts: 3/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Unbelievable.

And most of the work's already done for me? I really want to thank you, mikeyk! This is very helpful and has made my day.

I just wanted to spawn a sprite out of nowhere. The sprite I'm trying to spawn (as in spawn, 1 - initialization, maybe?) is a custom sprite I made that moves in one of four linear directions, determined by a RAM byte that's pretty much just set before the sprite's ever spawned. It moves two pixels per frame for eight frames in that direction, then disappears and turns the map16 block under it into another one (determined by other RAM addresses)

I am attempting to make it look like a block moves, or sort of slides, in a direction one block length. (16 pixels) The code works like a charm so far, and if I finish this code, I will release a mini-hack in which it will all be clear why I am doing that.

I'm not quite sure what you mean by regular or custom sprite, all I know is that the one that I'm trying to spawn is already inserted with SpriteTool, and is working properly, and I just tweak it a little as needed as I'm working on code.

Oh, and which byte should be written to have the initialization run, #$00 or #$08, and which part of the code does this byte go in?

Thanks again, mikeyk!

Goldensunboy
Posted on 07-10-07 09:25 AM, in Question: Spawning a sprite in-level? [ASM] (rev. 2 of 07-10-07 08:52 PM) Link | Quote | ID: 53658


Goomba
Level: 15

Posts: 4/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Then I might as well go to bed now.

I am currently hand-documenting the routine and outlining everything in the notepad file i'm using to make the assembly. Those darn tracers always so no to me, so I find it easier (although more tedious) to do it that way. All I need to do now is turn a map16 location into a sprite's x/y low bytes.

G'night, and thanks again, mikeyk!

Edit: I set it up as a test so that if I press left, it spawns the sprite at a set location. (I'm just trying to perfect this process right now, I'll get to setting where it spawns later) It seems like it's spawning a different sprite, because I also had one of my sprites added in at the beginning of the level anyway with Lunar Magic; I set a breakpoint in Geiger's SNES debugger to a ram address that's only used by the sprite.

It broke every frame that that ram address was read or written to for the sprite that was there anyway from Lunar Magic (good so far...) then, it never broke when I pressed left and spawned the sprite out of nothing. it didn't crash, but it behaved differently, because it was rapidly moving left and right, which isn't what it's supposed to do. I know it spawned properly, but I'm thinking it spawned the wrong one? Does it have to do with Lunar Magic's "Extra Info" field required by SpriteTool sprites?

Some extra information: The graphics of the sprite that pressing left spawned were the same as the sprite I would have gotten if I inserted one with Lunar Magic and left the "Extra Info" as 0.

Goldensunboy
Posted on 07-10-07 11:31 PM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 53726


Goomba
Level: 15

Posts: 5/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
After putting in this information, I tried it and it froze. It didn't crash (the animation stopped but the music kept going), but it got stuck in an endless loop:


$06/F620 A8 TAY A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F621 0A ASL A A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F622 AA TAX A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F623 BF 00 E0 12 LDA $12E000,x[$12;DFFE] A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F627 C9 00 02 CMP #$0200 A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F62A B0 F4 BCS $F4 [$F620] A:FFFF X:FFFE Y:FFFF P:eNvmxDizC

$06/F620 A8 TAY A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F621 0A ASL A A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F622 AA TAX A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F623 BF 00 E0 12 LDA $12E000,x[$12;DFFE] A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F627 C9 00 02 CMP #$0200 A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F62A B0 F4 BCS $F4 [$F620] A:FFFF X:FFFE Y:FFFF P:eNvmxDizC

$06/F620 A8 TAY A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F621 0A ASL A A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F622 AA TAX A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F623 BF 00 E0 12 LDA $12E000,x[$12;DFFE] A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F627 C9 00 02 CMP #$0200 A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F62A B0 F4 BCS $F4 [$F620] A:FFFF X:FFFE Y:FFFF P:eNvmxDizC

$06/F620 A8 TAY A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F621 0A ASL A A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F622 AA TAX A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F623 BF 00 E0 12 LDA $12E000,x[$12;DFFE] A:FFFE X:FFFE Y:FFFF P:eNvmxDizC
$06/F627 C9 00 02 CMP #$0200 A:FFFF X:FFFE Y:FFFF P:eNvmxDizC
$06/F62A B0 F4 BCS $F4 [$F620] A:FFFF X:FFFE Y:FFFF P:eNvmxDizC

It got stuck in this loop a good while after the code, I pressed "step into" many times and never reached it manually.

I really don't understand what's going on here, I need some help please!

Thanks!

Goldensunboy
Posted on 07-11-07 03:59 AM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 53784


Goomba
Level: 15

Posts: 6/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
------------------+---handles left-moving sprite creation

LDA $7E0016 | AD 16 00 \
CMP #$02 | C9 02 |-executes this code block if
BNE "next" | D0 43 / left is pressed
|
LDA #$00 | A9 00 \
STA $7FFF1F | 8F 1F FF 7F |-sets up RAM bytes for sprite
LDA $7FFF1A | AF 1A FF 7F | code: direction, and number
TAX | AA | of graphic tile.
INX | E8 |
LDA $7FFF00,x | BF 00 FF 7F |
STA $7FFF1D | 8F 1D FF 7F /
LDA $7FFF19 | AF 19 FF 7F \
INC A | 1A |-disables controller for 8
STA $7FFF19 | 8F 19 FF 7F | frames if left was pressed
LDA #$08 | A9 08 |
STA $7FFF1E | 8F 1E FF 7F /
------------------|
JSL $02A9E4 | 22 E4 A9 02 \---get index for first free sprite
BMI "end" | 30 1A / slot
|
LDA #$08 | A9 08 \-create sprite
STA $14C8,y | 99 C8 14 /
|
PHX | DA
TYX | BB
LDA #$11 | A9 11
STA $7FAB9E,x | 9F 9E AB 7F
PLX | FA
|
LDA #$00 | A9 00 \
STA $14E0,y | 99 E0 14 |-set hardcoded X/Y high bytes for
LDA #$01 | A9 01 | sprite creation
STA $14D4,y | 99 D4 14 /
|
BRA "past end" | 80 01 <---temporary code finisher reached by branching
RTL | 6B
|
LDA #$00 | A9 00 \
STA $00D8,y | 99 D8 00 |-temporarily hardcoded low bytes for sprite
LDA #$10 | A9 10 | creation
STA $00E4,y | 99 E4 00 /
PHY | 5A
PHX | DA
TYX | BB
JSL $07F7D2 | 22 D2 F7 07
JSL $0187A7 | 22 A7 87 01
LDA $08 | A9 08
STA $7FAB10,x | 9F 10 AB 7F
|
PLX | FA
PLY | 7A
RTL | 6B


The "sets up RAM bytes for direction, and number of graphic tile" uses some free ram to remember some custom info; for direction, I (respectively) store 0, 1, 2,or 3 to 7FFF1F. (in this case, left, since this code is executed only if you press left at any time) At 7FFF00 is a table of 25 bytes used for a secondary internal tilemapping. (graphics determined by the bytes in the table)

Everything below the line about 35% of the way through the code is adapted from your code. The "hardcoded x/y high bytes" for the sprite will never change, and the "temporarily hardcoded" bytes are just there for the time being to set an easily visible spawn point for the sprite until I start working on the routine that determines where it spawns under certain conditions.

Goldensunboy
Posted on 07-11-07 05:34 AM, in Dancing Games Thread Link | Quote | ID: 53805


Goomba
Level: 15

Posts: 7/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
There isn't enough dancing in this Dancing Games thread.



Paranoia Respect Doubles. And those other arcade machines are pretty freakin' loud.

Goldensunboy
Posted on 07-11-07 09:18 AM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 53847


Goomba
Level: 15

Posts: 8/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Thanks, that one byte change worked! However, the sprite now spawns, but turns into a map16 block immediately. I had it set so that upon initialization, a free RAM byte is STZ'd and is used as a counter until the sprite becomes a block. I'm thinking the sprite isn't running the "dcb init" thing, and so it sees the un-reset counter, and just turns into a block immediately. Now, this is when I spawned a sprite after already having one in the level to see if it works properly when the one spawned is a second one. When I took the sprite out of the level then spawned one, it kept going to the left for a few seconds, then turned into a map16 block. Pressing left after that first one then just started making the ones that spawn and immidiately transform.

Is there a way to make it run the "dcb INIT" code, too? If it's really too much of a hassle to do that, I can and already have an idea of how I could be able to change the sprite's code to work around that. However, I might run into a few more problems later if I do that.

Thanks for all your help so far! I think I'm learning alot about these sprites from this experience, and I could maybe make a custom sprite or two in the future from what I'm learning here.

Goldensunboy
Posted on 07-11-07 07:00 PM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 53922


Goomba
Level: 15

Posts: 9/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
I don't think it's running the sprite code now. The sprite spawns and just falls through everything offscreen now.

Since you can only write one byte to $14C8,y, would it be impossible to run both? Or too much of a hassle? Again, you've done more than enough for me, and if it would be hard to do so, I could write the code in such a way that it works around it.

Goldensunboy
Posted on 07-11-07 07:05 PM, in Dancing Games Thread Link | Quote | ID: 53924


Goomba
Level: 15

Posts: 10/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Sorry, I didn't think ONE embedded YT video would mess up anyone's connection, I didn't plan on ever putting any more in there. I just thought this dancing game thread needed more dancing.

Goldensunboy
Posted on 07-11-07 07:31 PM, in Recover Lunar Magic Link | Quote | ID: 53926


Goomba
Level: 15

Posts: 11/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Put it and the rom in the same directory, then open command prompt and navigate to the folder with RLM and the locked rom. Make sure the rom's name has no spaces; rename if you have to.

In this example, I'll use "mario.smc" as the filename. Type "rlm.exe mario.smc mariounlocked.smc", you can name mariounlocked.smc whatever you want as long as it's different from the input name. It should unlock it.

If that doesn't work, then I can't help you... that's exactly how it's always worked for me in the past.

Why would you want to unlock someone else's hack? I can't really think of any other reason than stealing graphics, level design, or ASM hacks... or maybe you are just stuck in the game or curious...?

Goldensunboy
Posted on 07-11-07 10:31 PM, in Recover Lunar Magic Link | Quote | ID: 53940


Goomba
Level: 15

Posts: 12/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Ah, forgot about that. Stupid, stupid me!

And that was RLM's purpose, too.

So, did it work?

Goldensunboy
Posted on 07-12-07 02:13 AM, in Dancing Games Thread Link | Quote | ID: 53994


Goomba
Level: 15

Posts: 13/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Posted by cpubasic13
Here's some dancing.

And bar helps me in the arcade, especially with bad pads. =\
Good job, I've never played PIU because it's nowhere near me, though.

Goldensunboy
Posted on 07-12-07 06:44 PM, in Question: Spawning a sprite in-level? [ASM] (rev. 2 of 07-12-07 07:07 PM) Link | Quote | ID: 54181


Goomba
Level: 15

Posts: 14/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
I've decided at this point that I'll just make it so all the code is in the sprite code, nothing in the "dcb INIT" stuff. Time to do some heavy tracing.

Edit: It all works! Thank you mikeyk! The sprite spawns when I press left, moves left 16 pixels, and turns into a map16 block. You have been a great help. I can do the rest without any extra help (hopefully), and it certainly shouldn't involve generating sprites.

Oh, thanks to you too, Sukasa; I didn't think anything was wrong with my code, but there was an error in it that wasn't significant until some other codes I put in were in play. I wouldn't have checked if I thought there was something wrong with the sprite routine.

I'll finish up the code and release a mini-hack soon, maybe a few days or so.

Goldensunboy
Posted on 07-12-07 08:22 PM, in Question: Spawning a sprite in-level? [ASM] Link | Quote | ID: 54196


Goomba
Level: 15

Posts: 15/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Well, it's a little late now, I already reprogrammed the sprite so it doesn't have any necessary codes in "dcb INIT". Your edit may help in the future though, if I felt like using this thread as a reference if I tried to spawn a sprite or custom sprite again.

Sorry to have troubled you so much about this sprite issue, but it is coming together now; thanks for bearing with me. I already programmed the same routine to work when you press up; that is, the sprite moves up 16 pixels and turns into a map16 block. Just two more directions, and a few more critical routines, and it'll be done.

Goldensunboy
Posted on 07-16-07 07:36 AM, in Anyone have a clue as how to solve this? Link | Quote | ID: 55378


Goomba
Level: 15

Posts: 16/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
I usually solve this thing by getting the eight tiles around each center the same color, then I line up the edge pieces so adjacent edge pieces match (although not necissarily [how do you spell that anyway?] touching the correct center color) I then solve it like a 3x3x3, and all the rules apply and it works.

However, 50% of the time, I get this.

Notice the inverted red and blue edge pieces.

I'm basically trying to line up these three edge pieces so the colors are fine. By the way, all the other edges are lined up and the centers are okay.

I have brainstormed as hard as I could, and I can't figure it out. I tried rearranging it many times, and the only way I've been able to get around it so far is by mixing up the whole cube and starting over again, and just hoping that I don't get this again.

A little help, anyone?

Goldensunboy
Posted on 07-16-07 09:21 AM, in Anyone have a clue as how to solve this? (rev. 3 of 07-16-07 10:14 AM) Link | Quote | ID: 55396


Goomba
Level: 15

Posts: 17/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
Thanks! Does this 4x4x4 strategy work with a 5x5x5? I don't have a Rubik's Revenge.

Edit: Yep, it worked. Thanks!

Oh, and the link didn't work, it redirected me to www.myspace.com

Goldensunboy
Posted on 07-17-07 05:04 AM, in Anyone have a clue as how to solve this? Link | Quote | ID: 55576


Goomba
Level: 15

Posts: 18/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
I'm pretty sure (since our minds are only programmed to interpret images up to the third dimension) that a 4-dimensional object is basically TWO overlapping three dimensional objects that are connected at corresponding verteces. Picture two skeletons of cubes (you know, the 12 lines that make one). One is partially inside the other. Now, keeping the distance between corresponding verteces all the same length as a side of the cubes, connect vertex A on one cube to vertex A on the other, vertex B to vertex B on the other, etc. to get a 4-dimensional cube. In the third dimension, it looks a bit like a hexagonal prism.

Goldensunboy
Posted on 07-18-07 05:29 AM, in Bowser's Puzzle Challenge (short ASM hack) (rev. 2 of 07-19-07 02:11 AM) Link | Quote | ID: 55830


Goomba
Level: 15

Posts: 19/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
It's only one level long, but you shouldn't be disappointed. I thought some totally new, ASM-based puzzles would be a neat idea to see in some hacks, so I made these over the past week and a half. Go ahead and try it!

The hack really isn't that big on story, plot, level design or graphics - it's meant for the puzzles. You'll see them when you come to them. There's three, and here's some info:



Slide Puzzle: Pretty simple concept, coding was a major pain in the rear. If anyone saw my last thread with problems spawning sprites, this is what that's all about. Big thanks to mikeyk for helping make this work out. Just slide the pieces to un-scramble the photo.



Sudoku: This one was the easiest to code, but easily takes the longest to solve. (unless you aren't good with the concept in #3)



Rubik's Pocket Cube: The hardest, it certainly isn't easy to beat. I just hope people don't have a hard time seeing this; after all, there's only so much you can do with 2d-graphics. The black on the top of the screen is there because it flickers like crazy during this puzzle, because of all the processing it has to do. You can't see the flickering if it's black, but be warned: you might as well drop whatever's in your item reserve before you get to this puzzle so you don't get distracted by the flickering.

Download the IPS here.

People have reached and played the levels by now, so now I have screenshots up. Have fun!

Goldensunboy
Posted on 07-18-07 06:20 AM, in Bowser's Puzzle Challenge (short ASM hack) (rev. 3 of 07-18-07 06:56 AM) Link | Quote | ID: 55842


Goomba
Level: 15

Posts: 20/32
EXP: 14282
Next: 2102

Since: 04-19-07
From: Albany, GA

Last post: 5716 days
Last view: 5716 days
That's the missing one. Of course you can't figure it out.

Try working the puzzle from the bottom up.

Edit: Actually, in case you were referring to the top right corner, that's the piece that's a blank yellow tile (mostly, but it has 2 pixels on it).

The empty space is in the top left corner.
Pages: 1 2


Main - Posts by Goldensunboy

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.231 seconds. (328KB of memory used)
MySQL - queries: 130, rows: 162/162, time: 0.221 seconds.