What's new

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
Here's a quick test to see that things are lining up. The text image was generated by my script and I simply put it on top of a card I scanned in a photo editor. Since my server is web-based, the final implementation will likely be a blank card picture with the text picture overlaid on top of it via css/html.
card capture.PNG

Note that the card I started with had the code at the bottom burned onto it, while everything else was blank, so the code generated by my script is sitting on top of one that was already on the scanned card. The benefit to having that printed data was I could capture the color from an actual print and make my rendering look pretty close. :thumbsup:

I still need to do something about sizing down text that comes after the HP/, and I'm experimenting with editing fonts themselves to affect spacing and look and feel, but I'm very pleased so far and am confident this is going to work out and give me the solution I have wanted for a while but didn't think I was going to be able to pursue.
 

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
WMMT 1 and 2 card printing done via script based on how many line of print data come through. WMMT1 is 10 lines, while WMMT2 is 11.

I also got the size management after the HP/ figured out.

wmmt1 card example.PNG


I need to get this integrated into my main script and the frontend, and start some more testing.

I'll probably keep messing with font edits throughout.
 

Attachments

  • wmmt2 card example.PNG
    wmmt2 card example.PNG
    158.4 KB · Views: 43

mathewbeall

Grand Master
Joined
Nov 6, 2017
Messages
966
Reaction score
532
Location
Mission Viejo, CA, USA
I have to say - what you have there looks amazingly awesome... I don't think you have to mess with the fonts at all! :)

I am ready to test when you want to send post the code!

Matt
 

rocket

Enthusiast
Joined
Dec 30, 2015
Messages
341
Reaction score
76
I just ran a race and lost one - to see if it would do a open circle, it didn't....

I think the circle/diamond might be what level you are on of the race circuits... circle, then diamond and then triangle - and then maybe star? haven't hit the star yet.

Matt
ok i got this partially figured out now.

open circles mean you have been undefeted totally in story mode. the first time you lose 1 store mode the symbols go solid the pic is from namcos wmmt 2 official website translated in english.

untitled picture from namcos wmmt 3 official website indicates if you complete all 80 episodes without losing you get the bgm from wmmt 1 & 2. so knowing if you are open circle (undefeated) would matter vs.knowing if you lost at least once. (most people would have never known this)

based on what i read i have built another guess about the different symbols. my guess is each time you complete the entire story mode the symbol changes. wmmt2 and later games give rewards each time you complete the entire story mode and replay the entire story mode multiple times.
 

Attachments

  • Screen shot 2019-06-22 at 10.41.18 AM.png
    Screen shot 2019-06-22 at 10.41.18 AM.png
    137.7 KB · Views: 48
  • Untitled.png
    Untitled.png
    96.5 KB · Views: 43
Last edited:

rocket

Enthusiast
Joined
Dec 30, 2015
Messages
341
Reaction score
76
here is how the symbols work in story mode. Full count is 20. at story 21, the symbol changes and all 20 the other are cleared and the bottom right corner gets a circle representing the first 20 completed stories.

For mt2 there are 80 stories. The 3 boxes on the right keep track of 20 stories. Circle at bottom first 20 stories completed. Diamond above the circle indicates 2nd 20 stories. Triangle above diamond indicates 3rd 20 stories completed. Star indicates story 61-80 and stays in the main 20 boxes. in the picture below a wmmt1 card was used on wmmt2 79 stories are completed.

So the 3dx+ card below is at story 50. Player is undefeted. Circle and diamond on the left bottom count 40. There are 10 triangles in the main boxes indicating story 41-50 have been completed.

total game stories:
wmmt 1 60
wmmt 2 80
wmmt 3 80
wmmt 3dx 100+ tuners races appear to not be recorded
wmmt 3dx+ 100+ tuners races appear to not be recorded
 

Attachments

  • IMG_0638.JPG
    IMG_0638.JPG
    96.4 KB · Views: 42
  • 1_1.jpg
    1_1.jpg
    16.1 KB · Views: 182
Last edited:

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
I have the file structure figured out for storing printed data printed data pictures, and I have a method in place for assigning a background card. These are displaying successfully in the frontend.

I have integrated the picture creating method into the wmmt script, but the script is crashing at the print command and I ran out of time to look into it today.
 

mathewbeall

Grand Master
Joined
Nov 6, 2017
Messages
966
Reaction score
532
Location
Mission Viejo, CA, USA
If you need help troubleshooting - more than happy to help.
 

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
If you need help troubleshooting - more than happy to help.
I wish I could quickly send it to you, but it takes forever for me to save down and then post an RPi image. Beyond that, I'm not sure what all specific files are different than your current version to be able to just send change files.
 

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
I forgot to mention that I've got the method down that I think will translate well to ID1-3 printing. I believe the 7D command is the erase print command. When that gets called in WMMT, I delete the print image file. Otherwise, as print commands come in, I will just append onto the existing printed image. I have tested, and appending onto an existing image works. ID1-3 will never see an erase command, so all changes will be appended.

From the logs I've got here in the thread, I passed one of the print commands from ID3 through my current print script, and it seems like it will mostly be the same. There will likely be some special handling of the printing from each game, though.
 

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
I figured out the issue. Print commands were being passed to the new method with a preceding space that broke things...

I am now successfully generating print files, and the frontend is showing an image for a chosen card if a background has been assigned and if a foreground print image is available.
frontend with card.PNG

A couple of things to work through:
-Background image is only assigned for a new card in the normal script workflow. I will probably need to come up with a startup script that assigns background images for existing cards where one does not exist. The idea is that a card gets assigned to your data randomly, just as if it were dispensed from the physical reader.
-(*EDIT: Figured this one out with directory alias in apache config)Management of scanned cards. I would like to have these managed on the boot partition for easier Windows access, but ultimately they need to end up somewhere that the apache server can access and post them on the frontend.
 
Last edited:

rocket

Enthusiast
Joined
Dec 30, 2015
Messages
341
Reaction score
76
Would there be an option to let people pick. I can already see people running through excess cards to just get the image they want.

the frontend with card looks amazing.
 
Last edited:

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
@saturnnights had discovered this already, but as I'm looking closer into replicating printed data, I'm understanding better what is happening. As usually on this forum, the help of others is invaluable, and I very much appreciate the public sharing of discoveries and knowledge.

So, with that in mind, much of this is a rehash of previously posted information, but now its coming from the perspective of using this information for the purposes of generating print images.

On some games, during boot there are a number of commands that get sent to the card reader to establish custom fonts that are used in the printed data for a game.

Initial D3 is an example. It uses these for the icons that are essentially black boxes with white text in them to represent areas cleared and it is also used for the printed icon that says "KEY" which also happens to be a black box with white text.

In my early attempts at passing ID3 data through my current image generator, it had some odd results that I now realize would be custom characters that are not present in the font file I'm using.

The challenge then is going to be:
-Interpret and store custom font data.
-Make use of custom font data.

There are only so many custom characters in a given game, so it would not be unreasonable to set up a font file per game and just use that in the interpreter. I know this would work. I've made some custom characters in my testing already. I think this might be the easiest way forward.

Interpreting the character data is the least of this task. They come in the 7A commands, and they are in the form of 72 byte packets that make up a 24x24 dot image in binary. 0s are blank and 1s are black dots.

If I focus on the KEY character, I found it in one of my ID3 boot initialization logs and the data packet is:
000000000000007FFFFEFFFFFFFFFFFFFFFFFF9C8139998139999F11839F838381838381C7839FC7999FC7999FC79C81C79C81C7FFFFFFFFFFFFFFFFFF7FFFFE0000000000000000

Converted to binary and arranged into 24 rows and columns:
Code:
000000000000000000000000
000000000000000000000000
011111111111111111111110
111111111111111111111111
111111111111111111111111
111111111111111111111111
100111001000000100111001
100110011000000100111001
100110011001111100010001
100000111001111110000011
100000111000000110000011
100000111000000111000111
100000111001111111000111
100110011001111111000111
100110011001111111000111
100111001000000111000111
100111001000000111000111
111111111111111111111111
111111111111111111111111
111111111111111111111111
011111111111111111111110
000000000000000000000000
000000000000000000000000
000000000000000000000000

Converting to blanks and black squares for easier viewing:

Code:
 ■■■■■■■■■■■■■■■■■■■■■■ 
■■■■■■■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■■■■■■■
■  ■■■  ■      ■  ■■■  ■
■  ■■  ■■      ■  ■■■  ■
■  ■■  ■■  ■■■■■   ■   ■
■     ■■■  ■■■■■■     ■■
■     ■■■      ■■     ■■
■     ■■■      ■■■   ■■■
■     ■■■  ■■■■■■■   ■■■
■  ■■  ■■  ■■■■■■■   ■■■
■  ■■  ■■  ■■■■■■■   ■■■
■  ■■■  ■      ■■■   ■■■
■  ■■■  ■      ■■■   ■■■
■■■■■■■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■■■■■■■
■■■■■■■■■■■■■■■■■■■■■■■■
 ■■■■■■■■■■■■■■■■■■■■■■
So interpreting them isn't going to be too bad.

The next steps would be figuring out which character code these get assigned to and edit a font file to contain them at the correct addresses so they'll be used accordingly.

As far as I can tell just based on print data I'm seeing and the results I get from my interpreter, WMMT1/2 don't use these custom characters. ID3 definitely does, and based on a print I see from Mario Kart, it very likely uses them, too.
 

mathewbeall

Grand Master
Joined
Nov 6, 2017
Messages
966
Reaction score
532
Location
Mission Viejo, CA, USA
MKGP for the most part has regular text that I can see..... Name, Number of coins, Rank, Item count.... but under the Grand Prix Champion Cups part it seems as if it's a bitmap - not a font..... And then the password is just regular text.
IMG_0331.jpg
 

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
Another great piece of info in the printer doc is with regards to data interpretation during the print command. There are some control characters that affect the printed data, and being able to interpret them will be helpful, especially when dealing with the custom font data.

Per the translated document:
The following things can be specified as the control code of the print data.
& Hd :new line
& H11 : Double height specified
& H14 : Character size canceled
& H1b + & H73 + yy + xx: character size setting
-yy & H31 (vertical 1 times) ~ & H34 (vertical 4-fold)
-xx & H31 (1 times horizontal) ~ & H34 (Horizontal 4-fold)
& H1b + & H67 + external character No. : External character No. In registered external character font

I had already been interpreting x0d as new line, but the others are very helpful in determining what the commands mean. I now see how sizing changes are controlled. I also see how the established custom characters are addressed.

Here is one line line 1 of data from an ID3 print packet:
Line 1: 20 20 20 20 20 20 20 20 1B 73 32 31 82 60 82 61 82 62 20 20 20 20 14 20 20 20 1B 67 01 37 32 31

That ends up being 8 standard size spaces, then 1B 73 32 31 sets the font to vertical 2x and horizontal 1x. Then it's shift-jis letters JIM, 4 spaces as the same font size. Cancel font changes (i.e. revert back to normal), 3 spaces, call custom character with 1B 67 at spot 01 (KEY character since it was the first character registered, I believe), and then normal characters 721.

I know WMMT1/2 are using some of these sizing codes, so now I can figure out what to do easier.
 

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
MKGP for the most part has regular text that I can see..... Name, Number of coins, Rank, Item count.... but under the Grand Prix Champion Cups part it seems as if it's a bitmap - not a font..... And then the password is just regular text.
IMG_0331.jpg
The "COINS" section at the top would be custom characters. The "100cc Class" and brackets around it may be individual custom characters, too. I could see how that would work. Otherwise there is apparently an option to print an image with the 7B command.

I'll have to get some logs from it to see, but the image printing doesn't seem too terrible, and I would like to think there's a way to make the image generator use that information.

Edit: I'm guessing based on the script I have for Mario Kart that it's not using the 7B command. It doesn't look like there were any accommodations made for that command in the replies being given.
 
Last edited:

winteriscoming

Champion
Joined
Feb 16, 2016
Messages
1,400
Reaction score
1,097
Location
Indiana, US
There are a few things left to implement, but I've got the print image generator handling the special cases from the printed data.

Here is the output for an ID3 print command:
ID3 sample capture.PNG

Here's the output from a WMMT2 print command:
WMMT sample capture.PNG


Both were passed through the same script with no manual overrides or special accommodations for a given issue.

An asterisk is currently printed in place of a custom character (as seen in the ID3 sample), but otherwise, all sizing and spacing is taken from print commands.

WMMT data fits perfectly on the card:
wmmt2 card example2.PNG
 
Top