Skip to content

Commit

Permalink
Add text tool, represent text as .txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroDeoxys committed Nov 20, 2024
1 parent b419dbc commit b69e3df
Show file tree
Hide file tree
Showing 18 changed files with 688 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
*.1bpp
*.2bpp

# converted text data
src/text/en/*.bin

# compressed data
*.rle

Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ warioland3: $(rom) compare
clean: tidy
find src/gfx \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.rle' \) -delete
find src/text \( -iname '*.rle' \) -delete
find src/text/en \( -iname '*.bin' \) -delete
find src/data \( -iname '*.rle' \) -delete

tidy:
Expand Down Expand Up @@ -121,7 +122,7 @@ src/gfx/misc/action_help_objects2.2bpp.rle: tools/compressor += --force-trailing
src/gfx/bgmaps/map_b34c3.bin.rle: tools/compressor += --force-trailing-copy

src/text/text_b232f.bin.rle: tools/compressor += --force-trailing-copy
src/text/text_b2424.bin.rle: tools/compressor += --force-trailing-copy
src/text/en/hidden_figure_replenish_power.bin.rle: tools/compressor += --force-trailing-copy

src/data/levels/block_map/the_peaceful_village_1.bin.rle: tools/compressor += --force-trailing-copy
src/data/levels/block_map/tower_of_revival.bin.rle: tools/compressor += --force-trailing-copy
Expand All @@ -147,10 +148,13 @@ src/gfx/wario/%.2bpp: tools/gfx += --interleave --png=$<

### Catch-all graphics rules

%.rle: %
tools/compressor $(tools/compressor) $<

%.2bpp: %.png
$(RGBGFX) $(rgbgfx) -o $@ $<
$(if $(tools/gfx),\
tools/gfx $(tools/gfx) -o $@ $@)

%.bin: %.txt
tools/text $(tools/text) -o $@ $<

%.rle: %
tools/compressor $(tools/compressor) $<
4 changes: 3 additions & 1 deletion src/charmaps.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
CHARMAP "!", $21
CHARMAP "?", $22
CHARMAP "-", $23
CHARMAP "·", $24
CHARMAP "…", $25

CHARMAP "0", $30
CHARMAP "1", $31
Expand Down Expand Up @@ -163,6 +165,6 @@

CHARMAP " ", $7e

CHARMAP "\n", $7f
CHARMAP "\n", $7f

POPC
22 changes: 11 additions & 11 deletions src/engine/bank2b.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1790,11 +1790,11 @@ _InitTempleScene:

ld a, [wLanguage]
and a
ld hl, Text_b232f
ld hl, TextJP_HiddenFigureReplenishPower
jr z, .japanese1
ld hl, Text_b2424
ld hl, TextEN_HiddenFigureReplenishPower
.japanese1
ld a, BANK(Text_b232f) ; aka Text_b2424
ld a, BANK(TextJP_HiddenFigureReplenishPower) ; aka TextEN_HiddenFigureReplenishPower
ld [wTempBank], a
ld bc, wTextBuffer
ld a, [wTempBank]
Expand All @@ -1806,11 +1806,11 @@ _InitTempleScene:
ld [wTempleScene], a
ld a, [wLanguage]
and a
ld hl, BGMap_b1fd7
ld hl, TextJP_HiddenFigureHeadFor
jr z, .japanese2
ld hl, BGMap_b211a
ld hl, TextEN_HiddenFigureHeadFor
.japanese2
ld a, BANK(BGMap_b1fd7) ; aka BGMap_b211a
ld a, BANK(TextJP_HiddenFigureHeadFor) ; aka TextEN_HiddenFigureHeadFor
ld [wTempBank], a
ld bc, wTextBuffer
ld a, [wTempBank]
Expand Down Expand Up @@ -4477,10 +4477,10 @@ _InitPrologueSequence:
and a
jr z, .japanese
; english
decompress_vram0 BGMap_b37f9, wTileBuffer
decompress_vram0 TextEN_HiddenFigureAreYouAware, wTextBuffer
jr .asm_adf63
.japanese
decompress_vram0 BGMap_b3675, wTileBuffer
decompress_vram0 TextJP_HiddenFigureAreYouAware, wTextBuffer
.asm_adf63
call FillClearedTextBuffer

Expand Down Expand Up @@ -6816,11 +6816,11 @@ _InitEpilogue:
call FillClearedTextBuffer
ld a, [wLanguage]
and a
ld hl, Text_15e06b ; japanese
ld hl, TextJP_OldManThankYou ; japanese
jr z, .got_text
ld hl, Text_15e225 ; english
ld hl, TextEN_OldManThankYou ; english
.got_text
ld a, BANK(Text_15e06b) ; aka BANK(Text_15e225)
ld a, BANK(TextJP_OldManThankYou) ; aka BANK(TextEN_OldManThankYou)
ld [wTempBank], a
ld bc, wTextBuffer
ld a, [wTempBank]
Expand Down
18 changes: 9 additions & 9 deletions src/engine/bank2c.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ INCBIN "gfx/cutscenes/prologue.2bpp.rle"
TempleMusicBoxSceneGfx:
INCBIN "gfx/temple_music_box_scene.2bpp.rle"

BGMap_b1fd7:
TextJP_HiddenFigureHeadFor:
INCBIN "gfx/bgmaps/map_b1fd7.bin.rle"

; unreferenced
BGMap_b2107:
INCBIN "gfx/bgmaps/map_b2107.bin"

BGMap_b211a:
INCBIN "gfx/bgmaps/map_b211a.bin.rle"
TextEN_HiddenFigureHeadFor:
INCBIN "text/en/hidden_figure_head_for.bin.rle"

; unreferenced
BGMap_b231c:
INCBIN "gfx/bgmaps/map_b231c.bin"

Text_b232f:
TextJP_HiddenFigureReplenishPower:
INCBIN "text/text_b232f.bin.rle"

; unreferenced
BGMap_b2411:
INCBIN "gfx/bgmaps/map_b2411.bin"

Text_b2424:
INCBIN "text/text_b2424.bin.rle"
TextEN_HiddenFigureReplenishPower:
INCBIN "text/en/hidden_figure_replenish_power.bin.rle"

; unreferenced
BGMap_b2533:
Expand All @@ -68,15 +68,15 @@ INCBIN "gfx/bgmaps/map_b330c.bin.rle"
BGMap_b34c3:
INCBIN "gfx/bgmaps/map_b34c3.bin.rle"

BGMap_b3675:
TextJP_HiddenFigureAreYouAware:
INCBIN "gfx/bgmaps/map_b3675.bin.rle"

; unreferenced
BGMap_b37e6:
INCBIN "gfx/bgmaps/map_b37e6.bin"

BGMap_b37f9:
INCBIN "gfx/bgmaps/map_b37f9.bin.rle"
TextEN_HiddenFigureAreYouAware:
INCBIN "text/en/hidden_figure_are_you_aware.bin.rle"

; unreferenced
BGMap_b39f0:
Expand Down
4 changes: 2 additions & 2 deletions src/engine/bank57.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ EpilogueGfx: INCBIN "gfx/epilogue.2bpp.rle"
BGMap_15df9b: INCBIN "gfx/bgmaps/map_15df9b.bin.rle"
BGMap_15dff8: INCBIN "gfx/bgmaps/map_15dff8.bin.rle"

Text_15e06b: INCBIN "text/text_15e06b.bin.rle"
TextJP_OldManThankYou: INCBIN "text/text_15e06b.bin.rle"
Text_15e212: INCBIN "text/text_15e212.bin" ; unreferenced
Text_15e225: INCBIN "text/text_15e225.bin.rle"
TextEN_OldManThankYou: INCBIN "text/en/old_man_thank_you.bin.rle"
Text_15e437: INCBIN "text/text_15e437.bin" ; unreferenced

OAM_15e44a::
Expand Down
Binary file removed src/gfx/bgmaps/map_b211a.bin
Binary file not shown.
Binary file removed src/gfx/bgmaps/map_b37f9.bin
Binary file not shown.
61 changes: 61 additions & 0 deletions src/text/en/hidden_figure_are_you_aware.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
A hidden@figure:



Are you aware,
Wario ?


This world is in
the music box


you were peering
into.


I was the god
that protected
this world.

But one day,
a wicked being
sealed away my

power, and took
control of this
world.

Wario,



I want you to
find the 5 music
boxes needed to

break the hidden
seal and recover
my powers.

If you find
them, I'll send
you back to

your own world.



Of course,
all the treasure
you find is

yours to keep!



Will you help
me ?


59 changes: 59 additions & 0 deletions src/text/en/hidden_figure_head_for.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
A hidden@figure:
Head for


Out of the Woods

The Peaceful
Village
The Vast Plain

Bank of
the Wild River
The Tidal Coast

Sea Turtle Rocks



Desert Ruins

The Volcano's
Base
The Pool of Rain

A Town in Chaos

Beneath the
Waves
The West Crater



The Grasslands

The Big Bridge

Tower of Revival

The Steep Canyon

Cave of Flames

Above the Clouds



The Stagnant
Swamp
The Frigid Sea

Castle of
Illusions
The Colossal
Hole
The Warped Void

The East Crater

Forest of Fear
41 changes: 41 additions & 0 deletions src/text/en/hidden_figure_replenish_power.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
A hidden@figure:



Wonderful work,
Wario !!


Now, replenish
my power !





Ahh…Ah-hah-HAH!



Finally I am
myself again !


Now I can rule
this world and


the outer one
as well !!


I need you no
longer, Wario!


I shall crush
you like a bug!


Loading

0 comments on commit b69e3df

Please sign in to comment.