War2.ru Slogan
News: Back by popular demand, the SMF Arcade!!!
PLAY NOW!!!!!!!!!!!!!!!!!!!!!!!!


Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Welcome to the forums! We're glad to have you here! :) You can register your account here, then feel free to introduce yourself in the Server.War2.ru board & let us know who you are on the server.

Warcraft 1 modding 7177  86

Grunt Posts: 57 Karma: +8/-0 ***

Zelya

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Warcraft 1 modding
« Reply #75 on: August 13, 2019, 05:31:31 AM »
@Storycraft

There are two fonts in War1. Their resources are 215 and 216 (both are compressed).

The font header is next:

//This is index of the first ASCII code in font. In original resources it set to 0x20 (space).
byte FisrtCharIndex;

//In bytes: 4 pixels = 1 byte
byte Width;

//bytes = pixels
byte Height;

//Don't know. Has value 2 for both of fonts
byte Unused;

Then you have 2bit bitmap with character images. Each byte encodes 4 horizontal pixels. Font ends with 128th character and I don't remember if you can enhance it to 256 (maybe yes).



Peon Posts: 14 Karma: +0/-0 **

Storycraft

  • Peon
  • **
  • *
  • Posts: 14
    • View Profile
Re: Warcraft 1 modding
« Reply #76 on: August 13, 2019, 07:15:16 AM »
@ Zelya
Thank you for the advice. Hmm ... 216 was the Blizzard logo image.
213=large font file
214=small font file ... Is it right?
Where is 0x21 (!) or 0x41 (A)? Perhaps I misunderstood what you meant  :sweat:

Grunt Posts: 57 Karma: +8/-0 ***

Zelya

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Warcraft 1 modding
« Reply #77 on: August 13, 2019, 08:06:01 AM »
@Storycraft

Sorry, my fault! Yes it should be 213 and 214!

I don't know why, but Blizzard pass ResourceId + 2 as a function argument. And then just subtract 2 inside function. Some kind of obfuscation?
Peon Posts: 14 Karma: +0/-0 **

Storycraft

  • Peon
  • **
  • *
  • Posts: 14
    • View Profile
Re: Warcraft 1 modding
« Reply #78 on: August 13, 2019, 04:52:42 PM »

It seems difficult to interpret and modify the font header and enhance from (32-128) to (32-256). This is way over my head.
Maybe it is better to wait for Unicode support of WinWar  :slight_smile:
Grunt Posts: 57 Karma: +8/-0 ***

Zelya

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Warcraft 1 modding
« Reply #79 on: August 15, 2019, 05:46:19 AM »
To add UTF I need much more character images. I wanted to support user-defined 8-bit code pages, like CP437 (most known ASCII code page) and CP866 (Cyrillic). But now, I don't know.
Is there acceptable Korean ASCII code page?

PS
Also game chat and save names will support English (ASCII 32 - 128) only to be compatible with original.
Peon Posts: 14 Karma: +0/-0 **

Storycraft

  • Peon
  • **
  • *
  • Posts: 14
    • View Profile
Re: Warcraft 1 modding
« Reply #80 on: August 15, 2019, 06:18:30 PM »
Is there acceptable Korean ASCII code page?

It is bad readability, but it's enough to play. I modified to extend 213 and 214, but WC1 doesn't read 128-255. It seems there is no solution to use with 128-255.
Grunt Posts: 57 Karma: +8/-0 ***

Zelya

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Warcraft 1 modding
« Reply #81 on: August 16, 2019, 05:08:32 AM »
@Storycraft
I mean that I'm not sure about UTF in WinWar. But if you can prepare resource with acceptable Korean ASCII codepage (128-255), we can test it in WinWar any time you want.
Peon Posts: 14 Karma: +0/-0 **

Storycraft

  • Peon
  • **
  • *
  • Posts: 14
    • View Profile
Re: Warcraft 1 modding
« Reply #82 on: August 16, 2019, 08:31:25 AM »
@Zelya
I see, I hope WinWar support the 128-255 letters of ASCII code.




By mistake, I put 213 in data.war instead of 214, and an unexpected result came out. Lowercase letters is available.

issues occurred:
1. I don't know how to edit top value(y position) of "msg:" on bottom panel.
2. WC1 crashes on score screen. I have modified height value of the header part "20 03 0A 02" to "20 03 06 02" (based on the knowhow you provided), this problem was solved.

height pixels
06,07 = ok
08,09,0A = crash
Grunt Posts: 57 Karma: +8/-0 ***

Zelya

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Warcraft 1 modding
« Reply #83 on: August 16, 2019, 08:41:35 AM »
@Storycraft
>>I see, I hope WinWar support the 128-255 letters of ASCII code
Not now, but it easy to support. So, lets say: yes.


>> 1. I don't know how to edit top value(y position) of "msg:" on bottom panel.
In version 1.22 it's here:

cseg01:0002B716                 mov     ebx, ecx
cseg01:0002B718                 mov     edx, 5
cseg01:0002B71D                 mov     eax, 1
cseg01:0002B722                 call    w_PrintString 

Where eax is X and edx Y are offsets inside bottom frame.

>>2. WC1 crashes on score screen.
Looks like you try to print big letters outside some frame. Have no time now for investigation, maybe later.

Peon Posts: 14 Karma: +0/-0 **

Storycraft

  • Peon
  • **
  • *
  • Posts: 14
    • View Profile
Re: Warcraft 1 modding
« Reply #84 on: August 17, 2019, 10:26:04 AM »
I don't know about this logic but, for this issue, i got it, solved by modifying one letter - lower case 'm'  :fro: This makes WC1 possible to display lowercase letters and 10 pixels font available.

The position of the "msg:" frame is (73,193), and I want to move this to (73,190)... y position -3

2B718 ~ 2B71D
HEX= 6B C1 0A 59 C3 25
DEC= 107 193 10 89 195 37

37>>73 reverse?
C1>>193

This hex code seems to be related to "msg:" frame's position. I modified this number but nothing happens(even change them all to "00")
Grunt Posts: 57 Karma: +8/-0 ***

Zelya

  • Grunt
  • ***
  • Posts: 57
    • View Profile
Re: Warcraft 1 modding
« Reply #85 on: August 19, 2019, 04:56:26 AM »
 @Storycraft
Sorry still have no time.
Please post me in PM your e-mail. I'll send you War1 disassembled file compatible with IDA 7.0 free. I think it can help you.
Peon Posts: 14 Karma: +0/-0 **

Storycraft

  • Peon
  • **
  • *
  • Posts: 14
    • View Profile
Re: Warcraft 1 modding
« Reply #86 on: August 19, 2019, 08:49:20 AM »
oh, never mind. I finished well. WC1 Korean translation now available. Thanks anyway  :slight_smile:
and I look forward to playing WinWar soon.