Language…
17 users online:  Anorakun, ArisuElysia0718,  Carld923, ECS.98,  GlitchCat7, Heitor Porfirio, hh0962430, JackBooWow248, Jordan, LocoFuzzyPants,  Nanako, PaceTheAce, ProjectPoison_,  shovda, SwedishCowboy420,  Thomas, WONIU - Guests: 91 - Bots: 216
Users: 66,408 (2,330 active)
Latest user: SwedishCowboy420

Lunar Magic suggestions and discussion (LM v3.40)

Tool

Then it sounds like either your mouse or keyboard has issues.
A rather large suggestion, but something I think would be useful for those with large hacks or collabs; the ability to preview and otherwise categorize ExGFX files from within Lunar Magic. The idea comes from a 3rd party addon called 'Super GFX Bypass+' that enables a function to do just that. Here are some previews of what that plugin can do:
https://bin.smwcentral.net/u/32624/exgfxbypassplus.png

The plugin is kind of shotty and doesn't always want to work right, but having a proper version baked into Lunar Magic would be nice. The current addon doesn't always load the correct GFX/ExGFX used in a level, and the labels aren't intuitive. Perhaps an added ability to determine unused ExGFX files for cleanliness would be nice.
I've found a very deadly crash that happens if you have a water level with the dimension sets to any setting other than $00 (any custom dimension) and swim past the top of the level, the game have a tendency of freezing at an infinite loop (you may have to move horizontally along the top of the level):

Code
06f61e tay                    A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V:241 H:  6 F:57
06f61f asl a                  A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V:241 H: 10 F:57
06f620 tax                    A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V:241 H: 13 F:57
06f621 bmi $f639     [06f639] A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V:241 H: 17 F:57
;[...]
06f639 lda $ff8000,x [007ffe] A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V:241 H: 22 F:57
06f63d cmp #$0200             A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V:241 H: 34 F:57
06f640 bcs $f61e     [06f61e] A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V:241 H: 40 F:57


This looks like you've messed up or Vitor when handling map16 processing if the player's collision points are outside the level. Lets look at the code:

Code
06f608 ldy $0d9b     [000d9b] A:0100 X:0004 Y:0025 S:01ea D:0000 DB:00 nvMXdiZc V:166 H:101 F:52
06f60b bpl $f617     [06f617] A:0100 X:0004 Y:0000 S:01ea D:0000 DB:00 nvMXdiZc V:166 H:109 F:52
;[...]
06f617 xba                    A:0100 X:0004 Y:0000 S:01ea D:0000 DB:00 nvMXdiZc V:166 H:114 F:52
06f618 lda $1693     [001693] A:0001 X:0004 Y:0000 S:01ea D:0000 DB:00 nvMXdizc V:166 H:119 F:52
06f61b phx                    A:0025 X:0004 Y:0000 S:01ea D:0000 DB:00 nvMXdizc V:166 H:127 F:52
06f61c rep #$30               A:0025 X:0004 Y:0000 S:01e9 D:0000 DB:00 nvMXdizc V:166 H:133 F:52
;The start of the freeze:
06f61e tay                    A:0025 X:0004 Y:0000 S:01e9 D:0000 DB:00 nvmxdizc V:166 H:148 F:52
06f61f asl a                  A:0025 X:0004 Y:0025 S:01e9 D:0000 DB:00 nvmxdizc V:166 H:152 F:52
06f620 tax                    A:004a X:0004 Y:0025 S:01e9 D:0000 DB:00 nvmxdizc V:166 H:155 F:52
06f621 bmi $f639     [06f639] A:004a X:004a Y:0025 S:01e9 D:0000 DB:00 nvmxdizc V:166 H:159 F:52
06f623 lda $118000,x [11804a] A:004a X:004a Y:0025 S:01e9 D:0000 DB:00 nvmxdizc V:166 H:163 F:52
06f627 cmp #$0200             A:0025 X:004a Y:0025 S:01e9 D:0000 DB:00 nvmxdizc V:166 H:175 F:52
06f62a bcs $f61e     [06f61e] A:0025 X:004a Y:0025 S:01e9 D:0000 DB:00 Nvmxdizc V:166 H:181 F:52
06f62c sty $03       [000003] A:0025 X:004a Y:0025 S:01e9 D:0000 DB:00 Nvmxdizc V:166 H:185 F:52
06f62e sep #$30               A:0025 X:004a Y:0025 S:01e9 D:0000 DB:00 Nvmxdizc V:166 H:193 F:52
06f630 plx                    A:0025 X:004a Y:0025 S:01e9 D:0000 DB:00 NvMXdizc V:166 H:198 F:52
06f631 sta $1693     [001693] A:0025 X:0004 Y:0025 S:01ea D:0000 DB:00 nvMXdizc V:166 H:205 F:52
06f634 xba                    A:0025 X:0004 Y:0025 S:01ea D:0000 DB:00 nvMXdizc V:166 H:213 F:52
06f635 tay                    A:2500 X:0004 Y:0025 S:01ea D:0000 DB:00 nvMXdiZc V:166 H:218 F:52
06f636 lda $08,s     [0001f2] A:2500 X:0004 Y:0000 S:01ea D:0000 DB:00 nvMXdiZc V:166 H:222 F:52
06f638 rts                    A:2526 X:0004 Y:0000 S:01ea D:0000 DB:00 nvMXdizc V:166 H:229 F:52
06f639 lda $ff8000,x [0026de] A:a6de X:a6de Y:d36f S:01e9 D:0000 DB:02 NvmxdizC V: 41 H:228 F:29
06f63d cmp #$0200             A:ffff X:a6de Y:d36f S:01e9 D:0000 DB:02 NvmxdizC V: 41 H:239 F:29 ;Something is wrong here
06f640 bcs $f61e     [06f61e] A:ffff X:a6de Y:d36f S:01e9 D:0000 DB:02 NvmxdizC V: 41 H:245 F:29 ;during a breakpoint
06f642 bra $f62c     [06f62c] A:ffff X:a6de Y:d36f S:01e9 D:0000 DB:02 Nvmxdizc V: 41 H:249 F:29

Give thanks to RPG hacker for working on Asar.
Originally posted by hash
A rather large suggestion, but something I think would be useful for those with large hacks or collabs; the ability to preview and otherwise categorize ExGFX files from within Lunar Magic. The idea comes from a 3rd party addon called 'Super GFX Bypass+' that enables a function to do just that. Here are some previews of what that plugin can do:
https://bin.smwcentral.net/u/32624/exgfxbypassplus.png

The plugin is kind of shotty and doesn't always want to work right, but having a proper version baked into Lunar Magic would be nice. The current addon doesn't always load the correct GFX/ExGFX used in a level, and the labels aren't intuitive. Perhaps an added ability to determine unused ExGFX files for cleanliness would be nice.


Seems a bit much just for ExGFX selection, but will keep it in mind as a possible feature sometime in the future.

Originally posted by GreenHammerBro
I've found a very deadly crash that happens if you have a water level with the dimension sets to any setting other than $00 (any custom dimension) and swim past the top of the level, the game have a tendency of freezing at an infinite loop (you may have to move horizontally along the top of the level):


After running a trace of my own, this appears to be caused by a small flaw in the original game code. It doesn't have anything to do with the new level heights or player collision points. It's actually from the air bubble Mario is generating up there when he swims above screen 0 in a horizontal level. I can fix it though.

But just to confirm we're looking at the same thing, is this happening right after running the code at 2A6E9?
A minor thing: Could the text box for custom sprites that have more than one extra byte leave a space between each one just for ease of reading? (For instance, "0A 28 50 10" is easier to parse than "0A285010".)

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Originally posted by FuSoYa
After running a trace of my own, this appears to be caused by a small flaw in the original game code. It doesn't have anything to do with the new level heights or player collision points. It's actually from the air bubble Mario is generating up there when he swims above screen 0 in a horizontal level. I can fix it though.

But just to confirm we're looking at the same thing, is this happening right after running the code at 2A6E9?


This glitch is hard to reproduce, and I had to delete the file every 5 seconds of the glitch not happening because tracing code can generate a HUGE file. I manage to trace the bug and able to see the code before the crash:

Code
02a6cf ldy $0f       [00000f] A:9ec8 X:0000 Y:0000 S:01ef D:0000 DB:02 NvMXdizc V: 38 H:283 F:39
02a6d1 beq $a6d7     [02a6d7] A:9ec8 X:0000 Y:0000 S:01ef D:0000 DB:02 nvMXdiZc V: 38 H:289 F:39
02a6d7 adc $02       [000002] A:9ec8 X:0000 Y:0000 S:01ef D:0000 DB:02 nvMXdiZc V: 38 H:294 F:39
02a6d9 sta $06       [000006] A:9ec7 X:0000 Y:0000 S:01ef D:0000 DB:02 NvMXdizC V: 38 H:300 F:39
02a6db lda #$7e               A:9ec7 X:0000 Y:0000 S:01ef D:0000 DB:02 NvMXdizC V: 38 H:306 F:39
02a6dd sta $07       [000007] A:9e7e X:0000 Y:0000 S:01ef D:0000 DB:02 nvMXdizC V: 38 H:310 F:39
02a6df ldx $15e9     [0215e9] A:9e7e X:0000 Y:0000 S:01ef D:0000 DB:02 nvMXdizC V: 38 H:316 F:39
02a6e2 lda [$05]     [7ec798] A:9e7e X:0007 Y:0000 S:01ef D:0000 DB:02 nvMXdizC V: 38 H:324 F:39
02a6e4 sta $1693     [021693] A:9e56 X:0007 Y:0000 S:01ef D:0000 DB:02 nvMXdizC V: 38 H:335 F:39
02a6e7 inc $07       [000007] A:9e56 X:0007 Y:0000 S:01ef D:0000 DB:02 nvMXdizC V: 39 H:  3 F:39
02a6e9 lda [$05]     [7fc798] A:9e56 X:0007 Y:0000 S:01ef D:0000 DB:02 nvMXdizC V: 39 H: 13 F:39
02a6eb jsl $06f7a0   [06f7a0] A:9efd X:0007 Y:0000 S:01ef D:0000 DB:02 NvMXdizC V: 39 H: 25 F:39 ;>LM code starts below
06f7a0 jsr $f608     [06f608] A:9efd X:0007 Y:0000 S:01ec D:0000 DB:02 NvMXdizC V: 39 H: 40 F:39
06f608 ldy $0d9b     [020d9b] A:9efd X:0007 Y:0000 S:01ea D:0000 DB:02 NvMXdizC V: 39 H: 52 F:39
06f60b bpl $f617     [06f617] A:9efd X:0007 Y:0000 S:01ea D:0000 DB:02 nvMXdiZC V: 39 H: 60 F:39
06f617 xba                    A:9efd X:0007 Y:0000 S:01ea D:0000 DB:02 nvMXdiZC V: 39 H: 65 F:39
06f618 lda $1693     [021693] A:fd9e X:0007 Y:0000 S:01ea D:0000 DB:02 NvMXdizC V: 39 H: 70 F:39
06f61b phx                    A:fd56 X:0007 Y:0000 S:01ea D:0000 DB:02 nvMXdizC V: 39 H: 78 F:39
06f61c rep #$30               A:fd56 X:0007 Y:0000 S:01e9 D:0000 DB:02 nvMXdizC V: 39 H: 84 F:39
06f61e tay                    A:fd56 X:0007 Y:0000 S:01e9 D:0000 DB:02 nvmxdizC V: 39 H: 89 F:39
06f61f asl a                  A:fd56 X:0007 Y:fd56 S:01e9 D:0000 DB:02 NvmxdizC V: 39 H: 93 F:39
06f620 tax                    A:faac X:0007 Y:fd56 S:01e9 D:0000 DB:02 NvmxdizC V: 39 H: 96 F:39
06f621 bmi $f639     [06f639] A:faac X:faac Y:fd56 S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:100 F:39
06f639 lda $ff8000,x [007aac] A:faac X:faac Y:fd56 S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:105 F:39
06f63d cmp #$0200             A:ffff X:faac Y:fd56 S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:117 F:39
06f640 bcs $f61e     [06f61e] A:ffff X:faac Y:fd56 S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:123 F:39
06f61e tay                    A:ffff X:faac Y:fd56 S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:129 F:39
06f61f asl a                  A:ffff X:faac Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:132 F:39
06f620 tax                    A:fffe X:faac Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:146 F:39
06f621 bmi $f639     [06f639] A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:149 F:39
06f639 lda $ff8000,x [007ffe] A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:155 F:39
06f63d cmp #$0200             A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:167 F:39
06f640 bcs $f61e     [06f61e] A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:173 F:39
06f61e tay                    A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:178 F:39
06f61f asl a                  A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:182 F:39
06f620 tax                    A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:185 F:39
06f621 bmi $f639     [06f639] A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:189 F:39
06f639 lda $ff8000,x [007ffe] A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:194 F:39
06f63d cmp #$0200             A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:206 F:39
06f640 bcs $f61e     [06f61e] A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:212 F:39
06f61e tay                    A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:218 F:39
06f61f asl a                  A:ffff X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:221 F:39
06f620 tax                    A:fffe X:fffe Y:ffff S:01e9 D:0000 DB:02 NvmxdizC V: 39 H:225 F:39


That log file is so huge that notepad++ cannot even edit the file. Although CTRL+F can find text, it cannot count how many they are.

Just to note that SMW had some interactions between the bubble and the blocks - when the bubbles hits a solid block, they disappear instead of going right through them.

PS. Sorry for blaming you.
Give thanks to RPG hacker for working on Asar.
Originally posted by imamelia
A minor thing: Could the text box for custom sprites that have more than one extra byte leave a space between each one just for ease of reading? (For instance, "0A 28 50 10" is easier to parse than "0A285010".)


Alright, I'll consider it.

Originally posted by GreenHammerBro
This glitch is hard to reproduce, and I had to delete the file every 5 seconds of the glitch not happening because tracing code can generate a HUGE file. I manage to trace the bug and able to see the code before the crash:


Yeah, that's the bubble. Thanks, it'll be fixed in the next version.

Originally posted by GreenHammerBro
That log file is so huge that notepad++ cannot even edit the file. Although CTRL+F can find text, it cannot count how many they are.


Yes, big files are pretty normal for SNES tracing. It's best to have a text editor that can quickly handle files that are a couple hundred megs in size. I've used UltraEdit since back in the days of Win9x for that. It also serves pretty well as my hex editor, C/C++ editor, ASM editor, etc.
Why don't direct offsets for ExAnimation correspond to VRAM addresses? And what if you want to ExAnimate a part of VRAM that's not graphics?

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Originally posted by imamelia
Why don't direct offsets for ExAnimation correspond to VRAM addresses?


They do. Remember that VRAM uses word addressing, so divide by 2.

Originally posted by imamelia
And what if you want to ExAnimate a part of VRAM that's not graphics?


So the tilemaps? You can do it to layer 3 if you want. Back in the LM 1.6x days I believe someone did layer 3 rain that way.

I wouldn't touch layer 1/2 like that though. Those get updated dynamically as you scroll through the level...
I've noticed the status bar (not SMW's) on the bottom left corner of the window in level editing mode that displays the block/tile coordinates are in decimal, while other coordinates such as the overworld editor, layer 3 editor and pretty much everything else are in hex, this can confuse some users.
Give thanks to RPG hacker for working on Asar.
Originally posted by FuSoYa
Originally posted by imamelia
Why don't direct offsets for ExAnimation correspond to VRAM addresses?


They do. Remember that VRAM uses word addressing, so divide by 2.

Originally posted by imamelia
And what if you want to ExAnimate a part of VRAM that's not graphics?


So the tilemaps? You can do it to layer 3 if you want. Back in the LM 1.6x days I believe someone did layer 3 rain that way.

I wouldn't touch layer 1/2 like that though. Those get updated dynamically as you scroll through the level...

Yeah, looking at my VRAM document, you're right. I must have thought the different parts of VRAM were in a different order. And it would work with the Layer 1 or 2 tilemap in a level that didn't scroll, at least.

Speaking of VRAM, would it be feasible to make the VRAM mapping in the game customizable? Where does Lunar Magic determine which addresses to upload graphics to anyway?

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Are there any plans for better/improvement exanimation #lm{exan} window? I think its long overdue for an update, its quite pain to use beyond simple and short block or palette animation.
Manually typing bunch of hex addresses to tiny cells isn't fun in the long run, especially with lack of any basic features like undo/redo or being easily able to shift whole thing forward/backward, copy&paste or move multiple cells at once.
Not sure where to post here but...

Some people have found a bug where a goal tape doesn't work:



I hope that'll be fixed in the next version, STAT!
I'm officially now on BlueSky! Follow me at @nanahikari-klug.bsky.social for updates! 『いけいけ団長、頑張れ頑張れ団長!』
Help us raise funds for the Armed Forces of Ukraine. #ДопомагаємоРазом / #HelpTogether
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”
Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery
Originally posted by kamekku14
Some people have found a bug where a goal tape doesn't work:

That sounds like the bug caused by older versions of PIXI. If they're using PIXI 1.2.3 or older, switching to the newest version should fix it.


 
The first image was from me. I didn't use PIXI when the bug occurred. I haven't done anything besides save a single level before it happened.
As for if it's a Lunar Magic bug: I have no idea.
Originally posted by GreenHammerBro
I've noticed the status bar (not SMW's) on the bottom left corner of the window in level editing mode that displays the block/tile coordinates are in decimal, while other coordinates such as the overworld editor, layer 3 editor and pretty much everything else are in hex, this can confuse some users.


Good point, might as well change it to be consistent.

Originally posted by imamelia
Speaking of VRAM, would it be feasible to make the VRAM mapping in the game customizable?


There probably wouldn't be much point to making it completely customizable. Moving the graphics would just make things annoying for tile animations, as you'd have to remap those for both LM and the original game.

Vitor did have some thoughts about maybe having a limited number of configurations for tradeoffs as edit's patch did though. So that might be an option someday.

Originally posted by imamelia
Where does Lunar Magic determine which addresses to upload graphics to anyway?


There are tables for it, just look in the same general area as LM's decompression routine for GFX/ExGFX. For sprite graphics in levels though, the destination is still determined by the original game code.

Originally posted by JP32
Are there any plans for better/improvement exanimation window?


None at the moment.

Originally posted by Mystery Cornucopia
The first image was from me. I didn't use PIXI when the bug occurred. I haven't done anything besides save a single level before it happened.
As for if it's a Lunar Magic bug: I have no idea.


Like WhiteYoshiEgg said, it's likely just the same "old version of sprite tool" issue that people have encountered before. If you think it's not, you'll have to provide directions on how to replicate it on a ROM that has only had LM used on it.
There's some LM code around $02AC3E that changes various things on sprite loading/being carried when loading a level, I'm just wondering if said code is inserted in a static place because I had to mess around with it to get custom sprites to load correctly when being carried into other rooms. Specifically for GIEPY because the sprite number, high byte, extra bit, and extra bytes are all set to 0 by the code. If it is static, I want to update this patch and add it to the hijack list.

Here's some of the code so you can easily tell what I'm talking about:

Code
label_10A5BD:
	SEP #$30
	LDA #$00
	STA $4000A1
	STA $4000A2
	STA $4000A3
	STA $4000FD
	STA $4000FD
	LDX #$07

label_10A5D7:
	STA $400099,X
	STA $400110,X
	DEX
	BPL label_10A5D7
	LDX #$15

label_10A5E4:
	STA $400040,X
	STA $400083,X
	STA $400057,X
	STA $40006D,X
	STA $4000A4,X
	STA $4000BA,X
	STA $4000D0,X
	STA $4000E6,X
	STA $400118,X
	DEX
	BPL label_10A5E4
	RTS
Originally posted by mario90
There's some LM code around $02AC3E that changes various things on sprite loading/being carried when loading a level


LM doesn't insert code at that location, and I don't recognize the code either.

Check the hijack map when you need to figure out if modified code is from LM or not.
Woops, you're right, turns out it was some code from GIEPY itself that I didn't follow correctly. I thought the problem was from the changes made in 3.0 to the sprite loading code, my bad.
Did LM 3.0 do anything special to the way layer 3 backgrounds or main screen/subscreen settings ($212C/D) are handled?

I'm using HDMA to move layer 3 to the subscreen in the top part of the background and to the main screen in the bottom (see the code below). The effect works fine on a 2.53 ROM, but when I save it in 3.02 (doing nothing else but saving) the effect stops working, with layer 3 seeming to no longer be in the main screen.

This might not have to do with LM directly, but I don't know where to start debugging otherwise, and I'd like to have asked in case it's something you (FuSoYa or others) can easily answer.

Code
	!Chnl 		= 2
	!Chnl_mask	= ($10*!Chnl)
	!Mask		= ($01<<!Chnl)

	LDA #$01		;   "2 registers write once"
	STA $4300+!Chnl_mask

	LDA #$2C		;    registers $212C and $212D
	STA $4301+!Chnl_mask	;    (Main/Sub Screen Designation)

	REP #$20
	LDA.w #.table
	STA $4302+!Chnl_mask
	LDY.b #.table>>16
	STY $4304+!Chnl_mask
	SEP #$20

	LDA #!Mask
	TSB $0D9F

	RTL



.table

	db 128,$11,$06		;    for the first 176 scanlines,
	db 48, $11,$06		;    move layer 3 to the subscreen,
	db 32, $15,$02		;    move it to the main screen everywhere else.
	db 16, $0F,$10		;    (move sprites to the subscreen at the very bottom too)
	db $00



 

Tool