Language…
8 users online: ASSATAKKU, Bullymario, Dan2point5, h.carrell, RenkoV2, ryuuune, ShadowBoxer_Sandshrew, Tulip Time Scholarship Games - Guests: 86 - Bots: 223
Users: 66,534 (2,385 active)
Latest user: amyysucks

How to insert two VWF Font?


I want to put more than 2 fonts like this one in the VWF Dialogues, but I do not know what to do. Can you tell me how to insert it?

※It would be better if you let me know how to put it in two or more bin files.


http://www.smwcentral.net/?p=section&a=details&id=6863


It's described in more detail in the dialogue's readme, but:


1) Create a folder in the patch's 'fonts' folder, and insert both an empty ASM file and empty BIN file for the font (I recommend copy-pasting existing font files from the patch).


2) Set the 'format' to 2BPP GB, and 'pattern' to FC/NES x16.


3) Draw the font. Each letter must be contained within a 16x16 block (one letter per block), and should always touch the left border (look at one of the existing fonts as an example). Additionally, even though 2BPP graphics technically allow 3 colors per font (plus transparency), you're only allowed to use the last two.
(and as a reminder, even though YY-CHR lets you pick any palette in the list for 2BPP graphics, you can actually only use the palettes in the first two rows)


4) Once you're done, open the ASM file. Here, you need to add values for how wide each of your letters actually are; again, see one of the existing font files for an example of the formatting.


5) Now, you have to actually insert these somewhere into your ROM. Thankfully, the VWF patch already includes some code to make this easier. Open the main patch ('vwfdialogues.asm') and CTRL+F for "external files". Following the 'font1' lines, stick this:

Code
%newbank("1",$288000)
%binary("0","vwffont2.bin")	; change the filename to your BIN file
%source("1","vwffont2.asm")	; change the filename to your ASM file
%endbank()


In addition to the filenames, you'll also need to change the '$288000' value. This needs to be freespace somewhere in the ROM, preferably with a full 0x8000 bytes of space. You can find where space is free using Slogger; run your ROM in that, and it'll create a .txt file containing addresses with freespace and their size (make sure to use the 'LoROM offset' when replacing the value, not the PC offset!).


5) Finally, still in the main patch, CTRL+F for "Fonttable:". You'll find a table with (probably) one row. Just add a new row that looks like this:

Code
dl Bank1Data0,Bank1Data1


Don't replace the values here, that's how they're supposed to look (if you insert more fonts, you'll need to change 'bank1' to 'bank2', then 'bank3', and so forth for each). Now, when finally inserting the patch, assuming you've done it right, your second font should be made available.


6) To actually use the font in your messages, you can either:

- Change the font by changing the first byte of the message header, which corresponds to the default font for the entire message.

- Use the $F2 command within the message, which changes the font for the rest of the message. Just use it like 'db $F2,$xx' where xx is the font you want to use (00 = font 1, 01 = font 2...).

- Use 16-bit mode (change the '!bitmode' value in the main patch to 1). Now all letter values will actually be 16-bit, and the first byte indicates which font to use (e.g. '$0024' is 'a' in font 1, '$0124' is 'a' in font 2). Note that you'll probably still want to use the strings for your fonts rather than raw hex values, so you'll need to modify the 'vwftable.txt' file the patch comes with to add that high byte to every value.



...And, that's it. It might be a bit complicated if you're not familiar with the technical stuff around ASM, but once you get it working once, it should be pretty straightforward.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
I wrote this in vwfdialogues.asm. But it did not insert
Is there anything wrong?
(However, Freespace is properly aligned)

Code
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4490: error: Bad macro name [% newbank ( "1", $ 288000)]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Bad macro name [% binary ( "0", "vwffont2.bin");]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Bad macro name [% source ( "1", "vwffont2.asm");]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Bad macro name [% endbank ()]


Code
(The omitted part has not been modified.)
;;;;;;;;;;;;;;;;
;[CUSTOMTABLES];
;;;;;;;;;;;;;;;;

Fonttable:
	dl Font1,Font1_Width
	dl $268000,$268000+$4000 
	dl Bank1Data0,Bank1Data1

Palettes:
dw $0000,$FFFF,$0000
dw $0A56,$04ED,$0044
dw $45ED,$24E6,$0C41
dw $477D,$2E55,$214D
dw $00C4,$1F7F,$15D1
dw $739C,$5250,$0000
dw $473F,$3EDC,$3258
dw $5235,$290A,$679F
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $45ED,$24E6,$0C41
dw $0A56,$04ED,$0044
dw $19F0,$00CB,$0044
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63





;;;;;;;;;;;;;;;;
;External Files;
;;;;;;;;;;;;;;;;

Frames:
incbin vwfframes.bin

Patterns:
incbin vwfpatterns.bin

Font1:
% newbank ( "1", $ 288000)
% binary ( "0", "vwffont2.bin");
% source ( "1", "vwffont2.asm");
% endbank ()
incbin vwffont1.bin
.Width
incsrc vwffont1.asm
print ""

print "VWF State register at address $",hex(!vwfmode),"."
print "Message register at address $",hex(!message),"."
print "BG GFX register at address $",hex(!boxbg),"."
print "BG Color register at address $",hex(!boxcolor),"."
print "Frame GFX register at address $",hex(!boxframe),"."

print ""
print "See Readme for details!"
print ""

freedata
!PrevFreespace:
Pointers:
incsrc vwfmessagepointers.asm

%nextbank()

Text:
incsrc vwfmessages.asm

;-------------------------------------------------------------
;INSERT DATA HERE!




;END
;-------------------------------------------------------------

freedata : prot !PrevFreespace : Kleenex: db $00;ignore this line, it must be last in the patch for technical reasons


File List
ASAR.EXE
(Omit other files)
📁vwf
📁Blocks
  📁Fonts
  ↳ vwffont2.asm
   vwffont2.bin
  📁Readme
 vwfdialogues.asm
 vwffont1.asm
 vwffont1.bin
 vwffont2.asm
 vwffont2.bin
 vwffont3.asm
 vwffont3.bin
 vwffont4.asm
 vwffont4a.bin
 vwffont4b.bin
 vwffont4c.bin
 vwffont4d.bin
 vwffont4e.bin
 vwffont4f.bin
 vwfframes.bin
 vwfmessagepointers.asm
 vwfmessages.asm
 vwfpatterns.bin
 vwftable.txt


Code
% newbank ( "1", $ 288000)
% binary ( "0", "vwffont2.bin");
% source ( "1", "vwffont2.asm");
% endbank ()


It's probably because of the spaces. You need to have macro names (and addresses, your $288000 has a space too) right next to the % symbol, since that symbol specifically says "the following string is a macro name".
(likewise, the $ says "the following number is an address")

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Freespace?

Code
;;;;;;;;;;;;;;;;
;External Files;
;;;;;;;;;;;;;;;;

Frames:
incbin vwfframes.bin

Patterns:
incbin vwfpatterns.bin

Font1:
% newbank ( "1", $ 288000)
% binary ( "0", "vwffont2.bin");
% source ( "1", "vwffont2.asm");
% endbank ()
incbin vwffont1.bin
.Width
incsrc vwffont1.asm


Code
PC offset		LoROM offset		Size

0x088047		0x10FE47		0x0011
0x08813F		0x10FF3F		0x0008
0x0881EB		0x10FFEB		0x0015
0x08C0BF		0x11BEBF		0x0003
    ⦙  			    ⦙  			   ⦙
0x0CD1CA		0x19CFCA		0x302E
0x0D6F9A		0x1AED9A		0x1266
0x0D8200		0x1B8000		0x8000
0x0E0200		0x1C8000		0x8000
0x0E8200		0x1D8000		0x8000
0x0F0200		0x1E8000		0x8000
0x0F8200		0x1F8000		0x6BD8
0x0FFC4E		0x1FFA4E		0x05B2
0x100200		0x208000		0x8000
0x108200		0x218000		0x8000
0x110200		0x228000		0x8000
0x118200		0x238000		0x8000
0x120200		0x248000		0x8000
0x128200		0x258000		0x8000
0x130200		0x268000		0x8000
0x138200		0x278000		0x8000
0x140200		0x288000		0x8000
0x148200		0x298000		0x8000
0x150200		0x2A8000		0x8000
0x158200		0x2B8000		0x8000
0x160200		0x2C8000		0x8000
0x1701F4		0x2DFFF4		0x000C
0x1781F8		0x2EFFF8		0x0008
0x178200		0x2F8000		0x8000
    ⦙  			    ⦙  			   ⦙


Code
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4490: error: Bad macro name [% newbank ( "1", $ 288000)]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Bad macro name [% binary ( "0", "vwffont2.bin");]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Bad macro name [% source ( "1", "vwffont2.asm");]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Bad macro name [% endbank ()]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Label Bank1data0 not found [dl Bank1Data0,Bank1Data1] ←I did not do this before, sorry.


Originally posted by Thomas
It's probably because of the spaces.


e.g. it needs to be "%newbank" not "% newbank", and "$288000" not "$ 288000".

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Oh, I wrote it wrong. Sorry.
I'm translating it into Korean with a Google translator. (There was a space in this process.)

Code
;;;;;;;;;;;;;;;;
;[CUSTOMTABLES];
;;;;;;;;;;;;;;;;

Fonttable:
	dl Font1,Font1_Width
	dl $268000,$268000+$4000 
	dl Bank1Data0,Bank1Data1

Palettes:
dw $0000,$FFFF,$0000
dw $0A56,$04ED,$0044
dw $45ED,$24E6,$0C41
dw $477D,$2E55,$214D
dw $00C4,$1F7F,$15D1
dw $739C,$5250,$0000
dw $473F,$3EDC,$3258
dw $5235,$290A,$679F
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $45ED,$24E6,$0C41
dw $0A56,$04ED,$0044
dw $19F0,$00CB,$0044
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63





;;;;;;;;;;;;;;;;
;External Files;
;;;;;;;;;;;;;;;;

Frames:
incbin vwfframes.bin

Patterns:
incbin vwfpatterns.bin

Font1:
%newbank("1",$288000)
%binary("0","vwffont2.bin")	; removed space
%source("1","vwffont2.asm")	; removed space
%endbank()
incbin vwffont1.bin
.Width
incsrc vwffont1.asm

print ""

print "VWF State register at address $",hex(!vwfmode),"."
print "Message register at address $",hex(!message),"."
print "BG GFX register at address $",hex(!boxbg),"."
print "BG Color register at address $",hex(!boxcolor),"."
print "Frame GFX register at address $",hex(!boxframe),"."

print ""
print "See Readme for details!"
print ""

freedata
!PrevFreespace:
Pointers:
incsrc vwfmessagepointers.asm

%nextbank()

Text:
incsrc vwfmessages.asm

;-------------------------------------------------------------
;INSERT DATA HERE!




;END
;-------------------------------------------------------------

freedata : prot !PrevFreespace : Kleenex: db $00;ignore this line, it must be last in the patch for technical reasons


But this also causes an error.

Code
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4490: error: Bad macro name [%newbank("1",$288000)]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Bad macro name [%endbank()]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: A bank border was crossed somewhere prior to this point [incsre vwffont1.asm]

Errors were detected while assembling the patch. Assembling aborted. Your ROM has not been modified.


If put 4 lines under INSERT DATA HERE, an error also appears.

Code
;;;;;;;;;;;;;;;;
;[CUSTOMTABLES];
;;;;;;;;;;;;;;;;

Fonttable:
	dl Font1,Font1_Width
	dl $268000,$268000+$4000 
	dl Bank1Data0,Bank1Data1

Palettes:
dw $0000,$FFFF,$0000
dw $0A56,$04ED,$0044
dw $45ED,$24E6,$0C41
dw $477D,$2E55,$214D
dw $00C4,$1F7F,$15D1
dw $739C,$5250,$0000
dw $473F,$3EDC,$3258
dw $5235,$290A,$679F
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $45ED,$24E6,$0C41
dw $0A56,$04ED,$0044
dw $19F0,$00CB,$0044
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63





;;;;;;;;;;;;;;;;
;External Files;
;;;;;;;;;;;;;;;;

Frames:
incbin vwfframes.bin

Patterns:
incbin vwfpatterns.bin

Font1:
incbin vwffont1.bin
.Width
incsrc vwffont1.asm

print ""

print "VWF State register at address $",hex(!vwfmode),"."
print "Message register at address $",hex(!message),"."
print "BG GFX register at address $",hex(!boxbg),"."
print "BG Color register at address $",hex(!boxcolor),"."
print "Frame GFX register at address $",hex(!boxframe),"."

print ""
print "See Readme for details!"
print ""

freedata
!PrevFreespace:
Pointers:
incsrc vwfmessagepointers.asm

%nextbank()

Text:
incsrc vwfmessages.asm

;-------------------------------------------------------------
;INSERT DATA HERE!


%newbank("1",$288000)
%binary("0","vwffont2.bin")	; removed space
%source("1","vwffont2.asm")	; removed space
%endbank()


;END
;-------------------------------------------------------------

freedata : prot !PrevFreespace : Kleenex: db $00;ignore this line, it must be last in the patch for technical reasons


In this way,

Code
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4490: error: Unknown macro [%newbank("1",$288000)]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Unknown macro [%endbank()]
E:\Lunar magic\ASAR\VWF₩vwfdialogues.asm:4491: error: Label Bank1data0 not found [dl Bank1Data0,Bank1Data1]

VWF Dialogues Patch v1.01 - (c) 2014 RPG Hacker

VWF Creation Routine at address $9B9F9C.
Pattern Addition Routine at address $9BA0DA.

VWF State register at address $702000.
Message register at address $702001.
BG GFX register at address $702008
BG Color register at address $702009
Frame GFX register at address $70200F

See Readme for details!

Errors were detected while assembling the patch. Assembling aborted. Your ROM has not been modified.


Is there anything wrong?


Okay, apparently I'm the one doing things wrong. The code I gave you is for an older version of patch I had, before it was updated to Asar.

For the newest patch, you do it slightly differently. Find the area labeled "INSERT DATA HERE" and put these lines there like so:

Code
;-------------------------------------------------------------
;INSERT DATA HERE!

%nextbank()
%binary("2","vwffont2.bin")
%source("2_Width","vwffont2.asm")

;END
;------------------------------------------------------------

And then in the font table:

Code
Fonttable:
	dl Font1,Font1_Width
	dl Data2,Data2_Width


Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
It has succeeded now. thank you.



sussessed code ↓

Code
;;;;;;;;;;;;;;;;
;[CUSTOMTABLES];
;;;;;;;;;;;;;;;;

Fonttable:
	dl Font1,Font1_Width
	dl Data2,Data2_Width
	dl $268000,$268000+$4000 

Palettes:
dw $0000,$FFFF,$0000
dw $0A56,$04ED,$0044
dw $45ED,$24E6,$0C41
dw $477D,$2E55,$214D
dw $00C4,$1F7F,$15D1
dw $739C,$5250,$0000
dw $473F,$3EDC,$3258
dw $5235,$290A,$679F
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63
dw $45ED,$24E6,$0C41
dw $0A56,$04ED,$0044
dw $19F0,$00CB,$0044
dw $3250,$2D09,$0C63
dw $3250,$2D09,$0C63





;;;;;;;;;;;;;;;;
;External Files;
;;;;;;;;;;;;;;;;

Frames:
incbin vwfframes.bin

Patterns:
incbin vwfpatterns.bin

Font1:
incbin vwffont1.bin
.Width
incsrc vwffont1.asm

print ""

print "VWF State register at address $",hex(!vwfmode),"."
print "Message register at address $",hex(!message),"."
print "BG GFX register at address $",hex(!boxbg),"."
print "BG Color register at address $",hex(!boxcolor),"."
print "Frame GFX register at address $",hex(!boxframe),"."

print ""
print "See Readme for details!"
print ""

freedata
!PrevFreespace:
Pointers:
incsrc vwfmessagepointers.asm

%nextbank()

Text:
incsrc vwfmessages.asm

;-------------------------------------------------------------
;INSERT DATA HERE!

%nextbank()
%binary("2","vwffont2.bin")
%source("2_Width","vwffont2.asm")

;END
;-------------------------------------------------------------

freedata : prot !PrevFreespace : Kleenex: db $00;ignore this line, it must be last in the patch for technical reasons
also, why are you translating into korean with google translate? that's the zsnes of translating, it's inaccurate 99% of the time.
Hi, I'm a signature!
Hack Thread
Hack Testing Status: Available.
Layout by Koopster.
I forgot to turn off the translator.