Pages: 12 »
Posted on 07-21-16, 02:45 pm (rev. 5 by  MeroMero on 11-30-16, 09:55 pm)
Death by cuteness

Karma: 6499
Posts: 478/598
Since: 05-01-13


Map icons with 256 colors each:
@Sub Sprite Ext Palette can only be mapped into Bank I @But Bank I already hosts Sub Sprite @Change this! repl_020CFD08_ov_08: MOV R0, #1 @Force Main BG to be mapped into Bank A BX LR repl_020CFD38_ov_08: MOV R0, #8 @Force Sub Sprite to be mapped into Bank D BX LR repl_020CFD40_ov_08: STMFD SP!, {LR} MOV R0, #0x100 BL .SetBankForSubOBJExtPal LDR R1, =0x2085B18 LDMFD SP!, {PC} @repl_020BD2A0_ov_00: @ LDMFD SP!, {R4, PC} @Exit the Map-icons function earlier as to not write the palette at address 0x5000600 repl_020D0194_ov_08: STMFD SP!, {LR} BL 0x20099C8 MOV R0, #0x780 MOV R1, #0 MOV R2, R1 BL .PrepareSubOBJExtPal LDMFD SP!, {PC} .PrepareSubOBJExtPal: STMFD SP!, {R4-R6, LR} MOV R6, R1 CMP R2, #0 BEQ .LoadFileByExtId BL 0x200869C MOV R5, R0 B .Begin .LoadFileByExtId: BL 0x20087F0 MOV R5, R0 .Begin: CMP R5, #0 LDMEQFD SP!, {R4-R6, PC} LDR R0, =0x208B72C MOV R1, R5 LDR R0, [R0] BL 0x2044CC8 MOV R4, R0 BL .BeginLoadSubOBJExtPal MOV R0, R5 MOV R1, R6 MOV R2, R4 BL .LoadSubOBJExtPal BL .EndLoadSubOBJExtPal MOV R0, R5 BL 0x20087C0 LDMFD SP!, {R4-R6, PC} repl_020CDD9C_ov_09: LDR R0, =0x216E72C ADD R0, R0, #1 MOV R2, #0 .LoopPaletteMode: LDRB R1, [R0] ANDS R1, R1, #0x20 LDREQB R1, [R0] ADDEQ R1, R1, #0x20 STREQB R1, [R0], #8 ADD R2, R2, #1 CMP R2, #0x69 BCC .LoopPaletteMode LDMFD SP!, {PC} repl_020CDD8C_ov_09: LDR R0, =0x216E730 LDRH R1, [R0] LDR R2, =0x3FF AND R1, R1, R2 CMP R1, #0x48 BNE .Return MOV R1, #0 .LoopTileNumber: LDRH R2, [R0] STMFD SP!, {R1} MOV R1, R2, LSL #0x16 MOV R1, R1, LSR #0x15 AND R2, R2, #0xC00 ADD R2, R2, R1 LDMFD SP!, {R1} STRH R2, [R0], #8 ADD R1, R1, #1 CMP R1, #0x69 BCC .LoopTileNumber .Return: LDR R0, =0x778 MOV R1, #0 BX LR repl_020D0D58_ov_08: MOV R0, #0xF7 @Common coefficient for un-greying map-icons STR R0, [SP, #0x1C] STR R0, [SP, #0x20] STR R0, [SP, #0x24] STR R0, [SP, #0x28] BX LR repl_020D0E88_ov_08: repl_020D0E90_ov_08: repl_020D0E98_ov_08: repl_020D0EA0_ov_08: LDR R2, [SP, #0x1C] ADD R2, R2, R8 @Add World number (R8) to map-icon coefficient (R2) BX LR repl_020D0F08_ov_08: MOV R7, #0xF7 @Coefficient for un-greying roads BX LR repl_020CF6C4_ov_08: MOV R3, #9 @Change Palette for Nodes not affected by Challenge Mode BX LR .SetBankForSubOBJExtPal: STMFD SP!, {LR} SUB SP, SP, #4 LDR R1, =0x2094248 MVN R12, R0 LDRH R2, [R1, #0x18] LDRH R3, [R1] CMP R0, #0 STRH R0, [R1, #0x18] ORR R2, R3, R2 AND R2, R12, R2 STRH R2, [R1] BEQ .AlternateMethod CMP R0, #0x100 BNE .VRAMCountLCDC LDR R3, =0x4001000 LDR R0, =0x4000249 LDR R2, [R3] MOV R1, #0x83 ORR R2, R2, #0x80000000 STR R2, [R3] @Enable Sub Sprite Ext Palette by setting [B]DISPCNT bit 31 at 1 STRB R1, [R0] @Set Bank I (0x4000249) as Sub Sprite Ext Palette (0x83) B .VRAMCountLCDC .AlternateMethod: LDR R1, =0x4001000 LDR R0, [R1] BIC R0, R0, #0x80000000 STR R0, [R1] @Disable Sub Sprite Ext Palette by setting [B]DISPCNT bit 31 at 0 .VRAMCountLCDC: LDR R0, =0x2094248 LDRH R0, [R0] BL 0x2061D7C ADD SP, SP, #4 LDMFD SP!, {LR} BX LR .BeginLoadSubOBJExtPal: STMFD SP!, {LR} SUB SP, SP, #4 BL 0x2061164 LDR R1, =VariableSubOBJExtPal STR R0, [R1] ADD SP, SP, #4 LDMFD SP!, {LR} BX LR .LoadSubOBJExtPal: STMFD SP!, {R4-R5, LR} SUB SP, SP, #0xC LDR R3, =0x2085714 MVN R12, #0 LDR LR, [R3] MOV R5, R0 MOV R4, R1 MOV R3, R2 CMP LR, R12 BEQ .AlternateMethod2 LDR R2, =0x68A0000 MOV R12, #0 STR R12, [SP, #0] MOV R0, LR MOV R1, R5 ADD R2, R4, R2 STR R12, [SP, #4] BL 0x2066A60 ADD SP, SP, #0xC LDMFD SP!, {R4-R5, LR} BX LR .AlternateMethod2: LDR R1, =0x68A0000 ADD R1, R4, R1 BL 0x2066EAC ADD SP, SP, #0xC LDMFD SP!, {R4-R5, LR} BX LR .EndLoadSubOBJExtPal: STMFD SP!, {LR} SUB SP, SP, #4 LDR R0, =0x2085714 MVN R1, #0 LDR R0, [R0] CMP R0, R1 BEQ .AfterDMA BL 0x1FFA358 .AfterDMA: LDR R0, =VariableSubOBJExtPal LDR R0, [R0] BL .SetBankForSubOBJExtPal LDR R0, =VariableSubOBJExtPal MOV R1, #0 STR R1, [R0] ADD SP, SP, #4 LDMFD SP!, {LR} BX LR .data .balign 4 VariableSubOBJExtPal: .word 0x0




You will need the 3 files below (more so the 3rd one) to put in the uiStudio folder:
UI_O_1P_course_select_o_ud_ncl.bin
UI_O_1P_course_select_u_ncg.bin
UI_O_1P_course_select_d.nce.bncd


The first is the 4096 colors-palette that will replace UI_O_1P_course_select_o_ud_ncl.bin
The second is the worldmap graphics used for the top screen that will replace UI_O_1P_course_select_u_ncg.bin
The third is the bncd file with all of its images upgaded to 8bpp mode that will replace UI_O_1P_course_select_d.nce.bncd

Palette 0 normally should have only 90 colors, but due to an earlier fail of mine, well it has 255 colors instead, but the basic idea stays the same:
_Palette 0 is for UI_O_1P_course_select_u.ncg.bin as well as the vast majority of the icons contained in the bncd.
_Palette 1 to 8 is for the World-map icons, in the same order
_Palette 9 is for the roads that are not unlocked yet, as well as for nodes/levels ignoring Challenge Mode
_Palette 10 is for all the worlds that are not unlocked yet
_Palette 11 to 15 are copies of the 4 main palettes

The bncd is a must! Especially considering that not only were the OAM properties changed, but also all the textures were doubled in size!

Download this modified version of NSMBe to easily import your 8bpp icons:
nsmb-editor-380b.zip

Now you can enjoy your new map-icons with 256 colors


Works on a NDS!
Posted on 07-21-16, 03:31 pm


Karma: 19562
Posts: 461/1100
Since: 04-02-13
Cool stuff!
Posted on 07-21-16, 09:08 pm
Death by cuteness

Karma: 6499
Posts: 479/598
Since: 05-01-13
Oops… I forgot a file, this one:


OP was updated to fix that mistake.
Posted on 07-21-16, 09:59 pm (rev. 1 by xKitten on 07-21-16, 09:59 pm)
Koopa
banned: childish fight with Super-toad 65

Karma: 255
Posts: 84/101
Since: 05-14-16
Posted by MeroMero
At this point, I'm just feeling like a one-trick pony lol.


How do you even feel like a one-trick pony given all your great contributions to NSMB ASM?

Nevertheless, nice job.
_________________________
It's time we take a stand.
Posted on 07-22-16, 10:57 am (rev. 2 by  gridatttack on 07-22-16, 04:22 pm)
Panser


Karma: 572
Posts: 100/332
Since: 04-09-16
I never used the ASM hack and therefore did not understand anything

Posted on 07-22-16, 11:01 am


Karma: 19562
Posts: 469/1100
Since: 04-02-13
Mico, was it entirely necessary to quote that giant post?
Posted on 07-22-16, 11:10 am (rev. 1 by ImageBot on 11-21-16, 03:22 am)
Fire Brother


Karma: 3602
Posts: 877/1102
Since: 11-29-11
"You got ninja'd"

I was just going to say that
Posted on 08-07-16, 11:43 am (rev. 1 by  MeroMero on 08-07-16, 11:44 am)
Death by cuteness

Karma: 6499
Posts: 525/598
Since: 05-01-13
OP updated with a much better method to import 8bpp icons into bncd files.
Posted on 08-07-16, 11:49 am


Karma: 19562
Posts: 560/1100
Since: 04-02-13
Very nice!
Posted on 08-07-16, 12:00 pm (rev. 1 by  KingYoshi on 08-07-16, 12:01 pm)
Fire Brother


Karma: 3602
Posts: 945/1102
Since: 11-29-11
Posted by MeroMero
Download this modified version of NSMBe to easily import your 8bpp icons:
nsmb-editor-380b.zip


Did you also add this feature to NSMBe on GitHub?
Posted on 08-07-16, 12:03 pm (rev. 1 by  MeroMero on 08-07-16, 12:04 pm)
Death by cuteness

Karma: 6499
Posts: 526/598
Since: 05-01-13
No, for the simple reason that this modification is an answer to an ASM Hack, not the original behaviour.
Posted on 08-07-16, 01:27 pm (rev. 1 by ImageBot on 11-21-16, 03:22 am)
Panser


Karma: 572
Posts: 130/332
Since: 04-09-16
meromero why does this happen?

Posted on 08-07-16, 01:58 pm
Death by cuteness

Karma: 6499
Posts: 527/598
Since: 05-01-13
Have you downloaded the 3 files in the opening post?
Also did you import the ASM Hack properly?
Posted on 08-07-16, 02:28 pm
Panser


Karma: 572
Posts: 131/332
Since: 04-09-16
Posted by MeroMero
Have you downloaded the 3 files in the opening post?
Also did you import the ASM Hack properly?


I imported the files and I clicked "run make insert"
Posted on 08-07-16, 06:09 pm
Death by cuteness

Karma: 6499
Posts: 529/598
Since: 05-01-13
Well, I see that you used an ASM Hack (by RicBent I think) that allows you to change the World names.
Both his and my hack might interfere with each other.
Posted on 11-30-16, 11:22 am (rev. 1 by  skawo on 11-30-16, 12:08 pm)


Karma: 19562
Posts: 847/1100
Since: 04-02-13
...Erm.

Does this work in conjunction with the 256 color titlescreen?
Seems like the repl_020CDD8C_ov_09 clashes with the titlescreen drawing function.
Posted on 11-30-16, 12:33 pm
Death by cuteness

Karma: 6499
Posts: 593/598
Since: 05-01-13
1) As far as I'm aware yes both Hacks should be compatible.

2) Custom codes in that vicinity present in overlay 9 between both ASM hacks are hooked at:
20CDD88
20CDD8C
20CDD94
20CDD9C
They are all pretty close but none of them appear more than once.
Posted on 11-30-16, 12:38 pm (rev. 1 by  skawo on 11-30-16, 12:46 pm)


Karma: 19562
Posts: 848/1100
Since: 04-02-13
It's repl_020CDD8C_ov_09 of this and nsub_020CDD94_ov_09 of the TS hack that clashes with eachother.

Could you please fix?
Posted on 11-30-16, 09:57 pm
Death by cuteness

Karma: 6499
Posts: 594/598
Since: 05-01-13
First post updated with some slight improvements to the code + a new download link for the palette.

It should work well now.
Posted on 12-01-16, 07:23 am


Karma: 19562
Posts: 849/1100
Since: 04-02-13
Excellent.
Pages: 12 »