Spooky ASM

This’ll be my topic for my ASM shenanigans.

Text wall ahead.

Modular Minimug Box Mod

MMMB Beta Download

If you’ve checked this thread before, you probably know that most of my work involves a single box. This mod is no different. It aims to allow for (nearly) full customization of the minimug box. This is done through three stages: setup, static calculations, and dynamic calculations.

Setup

The setup stage controls, well, setting up the box. It clears space for the box, writes its tilemap, and determines its palette. Afterwards, it moves to the other stages.


Pictured: max tile width box.

Editing the tilemap is very easy. The file \Setup\MMBTilemap.event contains the tilemap itself. Adding additional rows is currently not possible, but you are free to add up to 18d columns. The example above has the following file:

Max Width MMB Tilemap File
MMBTilemap:

//Remember that this starts on the bottom
//row and works its way up.

#define MMBWidth 18

//Remember, this is the number of tiles wide. Each tile is 2 bytes

#define MMBHeight 06

MMBTilemapStart:
BYTE MMBWidth-1 MMBHeight-1

BYTE $1A $00 $1B $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1C $00 $1D $00 $1E $00 $1F $00 
BYTE $0B $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $50 $00 $52 $00 $54 $00 $56 $00 $57 $00 
BYTE $0B $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $50 $00 $52 $00 $54 $00 $55 $00 
BYTE $0B $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $50 $00 $52 $00 $53 $00 
BYTE $17 $00 $18 $00 $19 $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $0E $00 $50 $00 $51 $00 
BYTE $10 $00 $11 $00 $12 $00 $13 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $03 $00 $04 $00 $05 $00 

MMBTilemapEnd:

Static Calculations

Static calculations don’t need to be updated every frame. They include background tiles, minimugs, text, and a few other things.


Pictured: Static calculation examples. Here, the minimug and name only need to be drawn when the box is first made.

It should be noted, however, that your static calculations need to include everything from your dynamic calculations. Otherwise, your dynamic things, like numbers, will not appear until a few frames after the box is done moving.

Dynamic Calculations

Dynamic calculations are updated every frame, allowing for things like sprites to be drawn. This allows for parts to be aligned to a pixel grid, rather than a tile grid.


Pictured: Dynamic calculation example. In this example, the numbers are not aligned to the tile grid and also need to be updated every frame, so they’re dynamic.

Putting it All Together

I realize that I’ve just made a long version of the vanilla box. Let’s spice it up a bit, shall we?


Pictured: Eliwan’s monstrous MMB (Still WIP).

The ‘modular’ part of this mod makes it easy to deck the box out with whatever you’d like.

That Modular Part I Mentioned

'Wan’s box looks really complicated, but it’s assembled from a bunch of easy-to-use macros.

'Wanbox Static/Dynamic Calculations
DrawMinimug(0,0)
HPWithStatus(0,4)
ELabels(3,1)
ShowInventory(0x38,0x18)
Prepstats
AttackGetter(0x27,0x09)
DefenseGetter(0x27,0x11)
ResistanceGetter(0x27,0x19)
HitGetter(0x1D,0x09)
AvoidGetter(0x1D,0x11)
CritGetter(0x64,0x09)
ASGetter(0x81,0x09)

These macros follow a predictable set of rules, with x and y coordinates usually being their parameters. There’s a file called \Modules\ModuleSetup.txt that gives some hints on a macro’s parameters.

ASM Details on Macros

The macros consist of the following:

mov r0, #XX
mov r1, #YY
    @@ Other optional parameters
ldr r4, Routine
bl  Goto_r4
b   NextMacro
nop @@ nop until aligned 4
Routine:
.long Calculation+1
NextMacro:

If you’re interested in writing your own routines, read the file marked README.txt. It explains the standard inputs and register usage. Also, in the Modules folder there are numberous .asm files with comments, if you’re interested in calling their routines.

Updates, changes, etc.

  • [1/24/2017] Initial Release! Contents:
    • Calculation framework
    • Tilemap framework
    • 6 Character Modules
    • 3 Number Modules
    • Macros for these modules
    • Macros for getting various stats
    • Known issues:
    • Sliding numbers may display random numbers
    • Sliding box may shrink when exiting screen
    • Names do not write properly past the default box width

Old stuff

Equipped item Preview [FE8]:

Equipped Item Preview

This mod widens the minimug box while also adding some things to control what’s on it and how they look. It also display’s a unit’s inventory and droppable items. Here’s an example from my project:

http://puu.sh/teReP/4b03783c48.png

And here’s the section of FE Direct #1 about it:

https://youtu.be/alWcpcPci04?t=2m53s

If you want my notes on the minimug box without downloading the rest of it, you can do so here:

Master MMB Doc


Here’s some doc, if you’re interested:

Read the doc!


Here’s a goofy project for writing thumb code in EA:

Thumblib V.02

Thumblib is a set of language raws for use with the Everything Event Assembler and a set of macros to make using it easier. Throw ‘Thumb.txt’ into your language raws folder and #include thumblib.event to use it.

Suggestions, macros, gripes, etc. should be posted here.


Custom Map Sprite Palette [FE7/8]:
Currently undergoing major revisions, I’d avoid using this for now.

Custom Map Sprite Palette

Currently the FE7 version works better than the FE8 one. Use EA to assemble “FE# CMSP Installer.txt” where # is either 7 or 8. Instructions are included within the installer.

http://puu.sh/qWXa2/88549abb9a.png

Purple Eirika is kind of subtle, but it works. A few issues: It overrides the link arena. All characters using custom palettes will keep the palette in the arena. Conversely, it does not work on the world map, so Eirika, for instance, would still be her usual blue.

This list will probably be updated often with fixes and new stuff. If you want a different style of installation (.dmp, .asm source, something without thumblib, etc) ask.

12 Likes

Great, thanks a bunch!
By the way, is there a way to change the color of the HP numbers to white with black outlines, like the name? I think it’s looks better with outlined numbers if the names is outlined as well

The HP numbers don’t have an outline, but you could probably edit the image that they’re a part of if you wanted an outline.

http://cdn.thedailybeast.com/content/dailybeast/articles/2015/10/31/who-invented-the-bedsheet-ghost/jcr:content/image.crop.800.500.jpg/48208570.cached.jpg

I spy something spooky over yonder.

1 Like

Updated thread to include the newest iteration of the equipped item preview, which was showcased in the first FE Direct. I’m writing a large set of notes on the minimug box, hopefully I’ll have enough info to make it fully customizable.

1 Like

Updated to include the new and improved revamp of the minimug box, complete with doc, macros, and other goodies.

4 Likes