[FE8] Modular Minimug Box 2018: It's here!

I’m also looking forward to the FEBuilder integration for an easy editor with a live preview function.

Great job Zane. I’m very glad I asked you to revisit this hack back in the day. It’s really going to change things for the better, I’m sure of it. GG

I hope I can edit it with FEBuilderGBA.
However, we have to solve various problems for that.

FEBuilderGBA is suitable for editing structs.
EA is suitable for describing syntax.

MMB is written in syntax rather than struct.
For example, it has the following format.
It is quite difficult to integrate this.

// Unit name options

	// Coordinates and widths are in 8x8 pixel tiles
	#define MMBNameWidth 7
	#define MMBNameColor TextBlack
	#define MMBNameX 5
	#define MMBNameY 3

For example, if it was described with the following structure, it would be easier to integrate it.

struct MMBItem{
	byte	x;
	byte	y;
	byte	color;
	bool	is_static;

	byte	type;	//enum type
	byte	arg1;
	byte	arg2;
	byte	arg3;
}; //sizeof()==8

MMBItem(0, 0 , Black , STATIC_ITEM , UNIT_NAME , 0  , 0 , 0)
MMBItem(0, 10 , Black , STATIC_ITEM , UNIT_ITEMS , 0  , 0 , 0)
MMBItem(0xFF,0xFF,0xFF , 0xFF , 0xFF , 0xFF ,0xFF , 0xFF); //term

Also, items that can be added such as the following are also problems.
These are different from the way you customize after installing FEBuilderGBA, as you will decide which to use when you install the build file.

// Inventory modules

	//#define MMBInventory
	//#define MMBEquippedWeapon
	//#define MMBEquippedWeaponName // uses alt text
	#define MMBInventoryOrEquippedWeaponName // uses alt text

// Bar modules

	//#define MMBHPBar

Probably, in the present situation, when installing the patch it will be in a format that you choose which to use.
I think that editing after installation is difficult.
If you change it, it will be in a form to uninstall the patch once and reinstall it.

Also, FEBuilderGBA does not have a lyn parser.
This is a problem when FEBuilder’s rebuild.
(rebuild is a function to rebuild the ROM and execute defragmentation)

I would need to create a new lyn parser or install it in a specific area below 0x09000000 just like a skill system.

Either way, this is a problem with FEBuilderGBA, so I’d like to do something.
Also , I want to porting to FE8J.

2 Likes

Finally I could transplant.

I would like to give you feedback on the porting on FE8J.
First of all, you’d better create a batch file that creates an elf.

Assemble ARM.bat

@echo off

SET startDir=C:\devkitPro\devkitARM\bin\

@rem Assemble into an elf
SET as="%startDir%arm-none-eabi-as"

cd Internal

for %%i in (*.s) do (
call :gas %%i
)

cd ..
cd Modules

for %%i in (*.s) do (
call :gas %%i
)
cd ..

pause
exit

:gas
echo %1
%as% -g -mcpu=arm7tdmi -mthumb-interwork %1 -o "%~n1.elf"
exit /b

You seem to be collecting definitions in Common Definitions.inc.
However, there was a part whose value was hard-coded in the source code.

Internal\MMBDrawAffinityObjs.s	ldr		r2, =0x08590F4C
Internal\MMBDrawInventoryObjs.s	ldr		r2, =0x08590F4C 
Internal\MMBDrawNumberOAM.s	ldr		r2, =0x08590F44
Modules\MMBDrawAffinity.s	ldr		r0, =0x08599714
Modules\MMBDrawEquippedWeapon.s	ldr		r0, =0x085996F4
Modules\MMBDrawEquippedWeaponName.s	ldr		r0, =0x085996F4
Modules\MMBDrawInventory.s	ldr		r0, =0x085996F4
Modules\MMBDrawInventoryOrEquippedWeaponName.s	ldr		r0, =0x085996F4
Modules\MMBDrawInventoryOrEquippedWeaponName.s	ldr		r0, =0x085996F4
Modules\MMBDrawSkillAlternatingObjs.s	ldr		r2, =0x08590F4C
Modules\MMBDrawSkills.s		ldr		r0, =0x085996F4

Also, the position of Procs is hard-coded.
It might be better to set a definition somewhere here as well.

Internal\UI1 Proc Code.event	ORG 0x00A0190C	
Internal\UI1 Proc Code.event	PROC_WHILE_EXISTS(0x0859A48) // Halt if GENS
Internal\UI1 Proc Code.event	PROTECT 0x00A0190C CURRENTOFFSET

Of course, hard coding is not bad.
We can easily fix it by using the editor’s bulk replacement.

And , I want to feed back the concrete source code after testing the version of FE8J more.

6 Likes

Well done! I’m glad that you were able to get things working. Thank you for taking the time to look at this and give feedback, it has been a long time since I have written anything for GBAFE.

7 Likes

If we’re still suggesting stuff, how about turning the chapter goal window into a skills window which then turns back into a goal window when the cursor is away from the unit? It would allow for more info without impeding normal function (I think)

2 Likes

This looks cool.

1 Like

I posted the modified version of 7z to Discord’s spell academy.

Bug fixes.
MMBDrawInventoryOrEquippedWeaponName.s
Fixed a bug where the enemy’s weapon name is not displayed.

Added new functions.

Supports FE8J.

MMBDrawWeaponNameCentered.s
It is a module that displays only the weapon’s name with center alignment.

I wanted to display the name of the weapon equipped while displaying all my items.

MMBDrawHPBarOrBadStatus.s
HPBar is displayed, but in case of Bad Status, the contents of Bat Status are displayed.

I hated GBAFE’s combination display.
Because I have to wait a few seconds to confirm the turn that an enemy is sleeping on.
Normally, HPBar is displayed, but in the case of Bad Status, its contents are displayed.
There is no need to wait a few seconds.

MMBDrawHPStatusNoCombination.s
Since I implemented “MMBDrawHPBarOrBadStatus”, it was necessary to prevent Bad Status from being displayed in MMBDrawHPStatus.
This module always displays HP only.

Suggest
I changed the installer to call the configuration, but the setting to call the installer.
The more we can make the preset, the convenience will improve.

NG: installer <- data
OK: data -> installer

For example, if we prepare a GFE1R style reset or a REDFE style preset, the user can use it by simply selecting it.
We will be able to satisfy the demands of not only users who want to customize everything, but users who want to use it more easily.

I renamed the dependent program as MMB Core.
And I include it from each style.
#include “MMB Core.event”

I made styles.

MMB Installer 2018 Default.event
It is the default style of MMB2018.

MMB Installer GFE1R Style.event
It is a style of GFE1R style.
I reverse-engineered it from the screenshot of the game. :slight_smile:

MMB Installer REDFE style.event
It is a style of REDFE style.
I reverse-engineered it from the screenshot of the game. :slight_smile:

MMB Installer Kaitou Style.event
It is a style of Kaitou patch style.
This game keeps items in large quantities, so it specializes on items.

I got some screenshots with FE8J.

13 Likes

Maybe it would be better to replace the terrain window with this, so that way you have at least the logical consistency of “this window has information relating to the highlighted map coordinate”. :thinking:

1 Like

Well, it’s just that the terrain window provide information you might want to see as well as normal unit data, where the chapter goal is something that doesn’t really have to be viewed all the time

4 Likes

I agree, while we know most of the vanilla terrains stats, some project can include custom ones

1 Like

I made a routine to change the color of weapons’ strings and notify them When the number of weapons decreases.
If the durability of the weapon falls below 35%, the color of the name of the weapon will be the specified color.

In the case of cheap weapons it is not a problem, but for expensive weapons like sacred weapons, there is a cost to open the menu to check the remaining number.
Since this is troublesome, if the number of uses of weapons is decreasing, I changed the color of letters and warn them.

The latest version of github seems to have changed the code considerably.
I think the way of writing coordinates is different from the previous version.
So I write the changes I made here instead github.

	#define MMBWeaponNameCenteredWarningColor
	#define MMBWeaponNameX 48
	#define MMBWeaponNameY 40
	#define MMBWeaponNameCenteredWarningColor_Parcent	35		//<= 35%
	#define MMBWeaponNameCenteredWarningColor_Color		TextYellow
		#ifdef MMBWeaponNameCenteredWarningColor
			#inctevent lyn "Modules/MMBDrawWeaponNameCenteredWarningColor.elf" "Internal/Definitions.elf"
			SHORT MMBAltTextWidth * 8
			SHORT MMBTextAltColor
			WORD (2 * ((32 * (MMBWeaponNameY/8)) + (MMBWeaponNameX/8))) + 4
			SHORT MMBWeaponNameCenteredWarningColor_Parcent
			SHORT MMBWeaponNameCenteredWarningColor_Color
		#endif // MMBWeaponNameCenteredWarningColor

Modules/MMBDrawWeaponNameCenteredWarningColor.s


.thumb

.include "../Common Definitions.inc"

MMBDrawWeaponNameCenteredWarningColor:

	.global	MMBDrawWeaponNameCenteredWarningColor
	.type	MMBDrawWeaponNameCenteredWarningColor, %function

	.set MMBAltTextWidth	,	EALiterals + 0
	.set MMBTextAltColor,		EALiterals + 2
	.set MMBItemNamePosition,	EALiterals + 4
	.set MMBTextWarningParcent,	EALiterals + 8
	.set MMBTextWarningColor,	EALiterals + 10

	@ Inputs:
	@ r0: pointer to proc state
	@ r1: pointer to unit in RAM

	push	{r4-r7, r14}

	mov		r4, r0

	@ Check if unit has an equipped weapon

	mov		r0, r1
	ldr		r1, =GetEquippedWeapon
	mov		r14, r1
	.short 0xF800

	@ if not, end

	cmp		r0, #0x00
	beq		End

	@ save Weapon Count
	mov		r1, r0
	lsr		r1, #0x08
	mov		r5, r1

	mov		r1, #0xFF
	and		r0, r1

	ldr		r1, =GetROMItemStructPtr
	mov		r14, r1
	.short 0xF800

	mov		r6, r0

	@ get color to r5

	ldrb	r0, [r6,#0x8]  @Item->Attribute1 & INF
	mov     r2, #0x8
	and     r0, r2
	cmp     r0, #0x00
	bne     NormalColor

	ldrb	r1, [r6,#0x14]  @Item->MaxCount
	cmp		r1, #0x00
	beq		NormalColor

	mov		r0, r5
	mov		r2, #100
	mul		r0, r2
	swi		0x6    @ div

	@ Switch the color with the rest of the weapon.

	ldr		r1, =MMBTextWarningParcent
	ldrh	r1, [r1]
	cmp		r0,r1
	ble		WarningColor

NormalColor:
	ldr		r2, =MMBTextAltColor
	ldrh	r5, [r2]
	b       ColorJoin

WarningColor:
	ldr		r2, =MMBTextWarningColor
	ldrh	r5, [r2]
@	b       ColorJoin

ColorJoin:

	@ get item name

	mov		r0, r6
	ldrh	r0, [r0]

	ldr		r1, =TextBufferWriter
	mov		r14, r1
	.short 0xF800

	@ save resulting width for later

	mov		r6, r0
	mov		r1, r0

	ldr		r0, =MMBAltTextWidth 
	ldrh	r0, [r0]             @ multiplied by 8 in EA
	ldr		r2, =GetStringTextCenteredPos
	mov		r14, r2
	.short 0xF800

	@ save resulting padding distance

	mov		r7, r0

	@ write item name

	add		r4, #AltTextStructStart
	mov		r0, r4
	ldr		r1, =TextClear
	mov		r14, r1
	.short 0xF800

	@ we write the text info to the proc state

	mov		r0, r4
	mov		r1, r7
	mov		r2, r5  @ Switch the color with the rest of the weapon.

	ldr		r3, =TextSetParameters
	mov		r14, r3
	.short 0xF800

	@ Write name

	mov		r0, r4
	mov		r1, r6

	ldr		r2, =TextAppendString
	mov		r14, r2
	.short 0xF800

	@ write tilemap

	mov		r0, r4
	ldr		r1, =WindowBuffer
	ldr		r2, MMBItemNamePosition
	add		r1, r1, r2

	ldr		r2, =TextDraw
	mov		r14, r2
	.short 0xF800

End:

	pop		{r4-r7}
	pop		{r0}
	bx		r0

.ltorg

EALiterals:
	@ MMBAltTextWidth
	@ MMBTextAltColor
	@ MMBItemNamePosition
	@ MMBTextWarningColor
	@ MMBTextWarningParcent
8 Likes

Ladies and gentlemen, you’ve heard of the Scraizabox. You’ve heard of the Wanbox. Now, I present for those interested:

The RUNABOX

image
I know, I know. You’re probably gawking in awe over the amazingness of the Runabox. The fact that affinity is prioritized over defense or resistance, avoid or dodge, or even skills. And my answer to that is: “Screw you, affinity is the most important detail of them all.”

Download link can be found here:

Or, if you’d like, there’s a uh… much more cultured minimug box available here. I’ll not put any pictures, but trust me when I say it is absolute perfection.

(@Zane please put the first one in your repo, maybe avoid the second one)

14 Likes

Oh are we sharing our cursed MMBs

2 Likes

Fantastic job with the MMB. Since finding out it exists a week ago, I’ve decided to never play gba FE again without MMB.

I spent today experimenting with editing a build to my own preferences. However, there are some features that I think would improve it.

To start, before finding out what I could do (perhaps unwise), I made a mock up of what I’d like to make it look like.

image

  • First 3 items displayed
  • Last skill to cycle between 5th and 6th skill if exists (but really that many skills would be super obnoxious anyway)
  • Current HP shown only. Green if >66%, red if <34%, yellow inbetween
  • Lvl and exp is unimportant imo

Unfortunately, the default modules don’t support these features.

image
Your options:

  • All items displayed, or just the equipped item.
    • ItemSlot1Icon, ItemSlot2Icon, ItemSlot3Icon etc. would be easier customization.

image
Above skill display isn’t supported. :cry:

  • Shouldn’t there be an option to display all skills (eg. side by side)? (One slot that cycles every 64 frames seems to be the only option.) Or is this an OAM limitation?
    • SkillSlot1Icon, SkillSlot2Icon, SkillSlot3Icon etc. would be easier to customize.

I think this would improve many hacks, especially ones bogged down by skill bloat. (I’ve only given a couple units in my hack a skill so far, but I’d like to patch any hacks I play with a customized improved MMB.)

I’m still new around here and have been slowly going through Tequila’s guide. I don’t really understand the underlying scripts, but perhaps eventually I could figure out how to add in new modules for the MMB I desire (:sob: ASM). In the mean time, though, I thought I’d provide feedback and my thoughts.

I hope that this does not come off as ungrateful. I really appreciate that you’ve created this. After playing hacks with MMB, I don’t think I can ever return to my childhood self of being content checking the stat screen all the time.

4 Likes

Wow just realized this MMB existed, sounds extremely convenient to not cycle through inventory to see skills really excited to try it out.

Glad you like it! Hopefully within the next few days I’ll have incorporated some of the things in this thread into the GitHub repo. As for your suggestions:

Not hard, I’ll probably get this done.

Definitely need more skill display options, hopefully I’ll get around to this.

Showing just the current HP is trivial, but changing the color of the numbers isn’t. You’d need different graphics and another palette in PalRAM (or more, depending on how many colors or sets of graphics you’d commit to).

Agreed, I’ll have to figure something out.

I’ll probably work out a way to configure each individually, with similar plans for items. There’s a pretty large amount of object tile space remaining.

2 Likes

Looking forward to it. Thank you! :grinning:
Very excited to customize one that combats skill bloat. Haha.

Also, I know ModularMinimugBox is literally what it is, but it’s rather a mouthful. I didn’t even realize it was a different thing than ExModularSave in FEBuilder’s patches because what is reading. It sounds like @Memestaralbert didn’t notice it either.

I’d just call it “HoverBox”.

FEBuilder’s patch description:

Expand the upper left panel so that information can be output throughout the time.
This is the style of ModularMinimugBox: 2018 Default.
https://feuniverse.us/t/fe8-modular-minimug-box-2018-its-here/4235/27

TAG:#ENGINE
Patch name:ModularMinimugBox: 2018 Default(Installer) FE8U
Author / Source:ZaneAvernathy [FE8] Modular Minimug Box 2018: It's here! (MIT License)

How I might describe it:

Display unit information on the map such as Atk, Def, and Skills.
Expands the default HoverBox to do this.
This is the style: 2018 Default.
https://feuniverse.us/t/fe8-modular-minimug-box-2018-its-here/4235/27
(Previously named ModularMinimugBox.)

Just an idea.

1 Like

The modular part of the name is in fact, rather important. Because the box is modular.

4 Likes

Vanilla GBAFE calls the box the normal unit window and the config option is called Panel, but Modular Unit Window or Modular Panel or whatever just seem ambiguous. Including the minimug or even making it a box are just precedent, and Hover Box doesn’t describe what you might use to identify it.

Anyway, Modular is the most important part. Even with a name like this, there have been people who didn’t understand that it’s meant to be configured to their liking. If I were to take name suggestions, it’d probably be for whatever name gets this point across the best.

Also, I didn’t pick the description in FEBuilder. I totally forgot that it did patch descriptions. I’d probably go with something like

Edits the "panel" unit window with user-configurable modules, allowing for more than just minimug, health, and name. This installer is pre-configured to the (style) style.
6 Likes

With motivation grinding to a halt, I feel like it’s a good time to post my progress.

There’s been a slight overhaul with the organization of the MMB’s files and repository. Nothing too substantial, things like file renames, moving things around, etc. The biggest change is that the MMB no longer requires lyn (or, at least, shouldn’t, but I might be forgetting something) to install. People editing/creating modules will still need lyn, however.

I’ve included two files, a batch script and a makefile, to help with module development. Instead of using #inctevent lyn I’ve switched to #includeing pregenerated .lyn.events to speed up assembly time for people working with EA buildfiles.

As for changes that users might care about:

  • Item modules have been overhauled
    • Item names and item icons are independent
    • Ability to draw first staff in a unit’s inventory if they don’t have a weapon has been added
    • 7743’s weapon durability warning color has been added
    • The ability to draw as many or as few items at a time has been added. For example, you could choose to draw only the first three items.
    • The ability to position each item icon independently has been added.
    • The ability to draw item icons alternating in one spot has been added. For example, you could alternate between drawing items 4 and 5 to save space.
    • A huge number of shorthand definitions have been added to make choosing inventory options more convenient (hopefully, there’s quite a lot of combinations).
  • Skill modules have been overhauled
    • Ability to draw as many or as few skills at a time has been added.
    • Ability to select which skills are shown alternating has been added.
  • Ability to draw current/max HP numbers alone has been added
  • Runabox and Vesly’s suggested box have been added as installers

I’m probably missing something, but those are pretty important features.

15 Likes