May 18, 2024, 10:22:27 AM

Author Topic: NFL Blitz Data File Editor (work in progress)  (Read 25871 times)

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
NFL Blitz Data File Editor (work in progress)
« on: March 14, 2020, 05:24:06 PM »
Creating this new topic from the original topic "Can't figure out how to update arcade Blitz" - http://nflblitzfans.com/index.php?topic=574.0

So Jaker3... The extraction of images seems to moving along and I made a shocking discovery: blitz2k.chd contains NBA Jam images...


jaker3

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #1 on: March 14, 2020, 06:46:55 PM »
Awesome, how are you going about doing it? I suppose now that we know a little more about the Image header it would be as simple as looking for that pattern for pulling the images out.

I did run the PC images versus the arcade and it looks like only 447/1,015 PC files are shared between the two.

I've attached the image name and offsets to this post.

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #2 on: March 14, 2020, 09:42:13 PM »
Right now, I'm just finding images based on the occurrence of 0x05800000 to start of the record.  I don't know what image files they map to, although some of the one's I outputted match the offsets you've posted.

There's also WMS file records that are 44 blocks wide starting at position 0x056C0F2C.  But those pointers don't seem to match anything.

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #3 on: March 15, 2020, 08:33:41 AM »
I've pushed the image code in the branch
Code: [Select]
image-support

FYI: This is how I'm planning for this solution to be structured:
  • NFLBlitzDataEditor.Core:  A .NET standard assembly that contains the core functionality around processing the data file
  • NFLBlitzDataEditor.UI:  A .NET Core WPF application that uses NFLBlitzDataEditor.Core.  This is what users will use to modify the data file

Right now, I'm just trying to get some bits and pieces together.  Ultimately, this is the structure I will have for the solution.

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #4 on: March 16, 2020, 07:08:57 PM »
Jaker, how did you get those offsets?  Are you using the NFL Blitz Gold CHD or the NFL Blitz Classic CHD?  I'm using NFL Blitz 2000 (Gold?) and not seeing how you got that.

Searching for ARHLML.WMS seems to find only 1 match in a list of WMS records (starts at offset 91337612).  Those records appear to be 48 bytes long and none of the values in the ARHLML.WMS seem to match what you got there.

jaker3

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #5 on: March 17, 2020, 08:43:49 AM »
NFL Blitz PC 2000 Images compared against the Blitz2k Arcade raw drive. I just took the directory of PC Images, and looked up their bytes against the arcade .bin. What you see at offset 91337612 is related to how to draw it / sprite info? I'm just calling it image metadata at the moment. Similar to what I've pointed out here:
https://i.ibb.co/GHtSJWY/spritesheet.png

So decimal offset 24659972 is the actual image bytes for ARHLML.WMS
Offset 91337612 seems to contain a pointer and info needed to draw it (where on the screen, x1,y1,x1,x2, ect...).

EDIT: Also the solution structure sounds good to me!


 
« Last Edit: March 17, 2020, 08:45:25 AM by jaker3 »

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #6 on: March 17, 2020, 10:25:24 AM »
Hmm, I'm looking at the ARHLML.WMS entry in the data file.  This is what I see:
Code: [Select]
Offset(d) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

00000000  41 52 48 4C 4D 4C 2E 57 4D 53 00 00 84 AB 24 80 00 00 2A 43 00 00 00 43 00 00 AA 42 00 00 80 C2 00 00 00 00 00 00 2A 3F 00 00 00 00 00 00 80 3F  ARHLML.WMS..„«$€..*C...C..ªB..€Â......*?......€?
I don't see the values you wrote out there.  I'm noticing some oddities in extracting the image data as well.  For example, the Cowboys helmets (PC version = DAHLML.WMS and DAHLMR.WMS) aren't pulled properly.  The image header record is saying the image is 256x256, where every other helmet image is 256x128.

Looks like I need to do more investigating...

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #7 on: March 17, 2020, 12:06:23 PM »
I figured out the issue with some images not being extracted properly.  So the UInt32 value stored prior to the format appears to be a version number.  When the value is 2, the image data comes immediately after the header.  When the value is 3, the image data is offset by 2,560 bytes.  I'm not sure why it's 2,560 bytes. 

One thing that I saw while trying to build the image processing code was that the images are padded at the end.  Each image block (start of image to end of image + padding) is a data block that is evenly dividable by 512.  I'm wondering if the reason to add the padding in there is to move past a boundary and ensure that the image doesn't pick up any artifacts.  Not sure, but it looks like those trouble images are extracting properly now.

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #8 on: March 17, 2020, 12:23:13 PM »
Ugh, nevermind about the previous post regarding the Versions.  Not every V3 has the same offset.  Some don't have an offset at all...  :(


jaker3

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #9 on: March 17, 2020, 07:49:03 PM »
Hmm, I'm looking at the ARHLML.WMS entry in the data file.  This is what I see:
Code: [Select]
Offset(d) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

00000000  41 52 48 4C 4D 4C 2E 57 4D 53 00 00 84 AB 24 80 00 00 2A 43 00 00 00 43 00 00 AA 42 00 00 80 C2 00 00 00 00 00 00 2A 3F 00 00 00 00 00 00 80 3F  ARHLML.WMS..„«$€..*C...C..ªB..€Â......*?......€?
I don't see the values you wrote out there.  I'm noticing some oddities in extracting the image data as well.  For example, the Cowboys helmets (PC version = DAHLML.WMS and DAHLMR.WMS) aren't pulled properly.  The image header record is saying the image is 256x256, where every other helmet image is 256x128.

Looks like I need to do more investigating...
The values in my notepad screenshot? Those are for TMSEL00.WMS a Sprite sheet that has 53 sprites.

Your only seeing 48 bytes because ARHLML.WMS is only a single sprite. Lookup a sprite sheet with multiple sprites.

jaker3

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #10 on: April 20, 2020, 10:53:51 AM »
Hey dmgambone,

Been awhile since I heard from you. Hope all is doing well. I was going to start building out the UI. Any ideas on how you want it to work? Come up with a mock up first? I was thinking we could possibly start defining the interfaces also. Would be nice if the UI could be used with different back-ends (Arcade, N64, ect...)

Edit: What do you think about using Blazor and WebWindow:
https://blog.stevensanderson.com/2019/11/18/2019-11-18-webwindow-a-cross-platform-webview-for-dotnet-core/


Also bought a separate Blitz Seattle board to make testing easier.... Just need to get it running first haha.
« Last Edit: April 20, 2020, 11:01:12 AM by jaker3 »

jaker3

  • Administrator
  • Sr. Member
  • *****
  • Posts: 333
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #11 on: April 28, 2020, 04:20:24 PM »
Alright,

So I pretty much confirmed the PC version is a direct Arcade port to PC. The first NFL Blitz seems to have shipped with its debug symbols intact (Watcom). So we can step through (with Open Watcom) the PC version to help better understand the Arcade game. I'm also going to take a look around to see if there is a relatively easy way to get it to decompile to C. According to the debug symbols most of the source was written in C with only a few in assembly.

If your interested I can hook you up with a copy of NFL Blitz for the PC.

Else I noticed the demo released by midway and archived here:
https://archive.org/download/BlitzDemo/Blitz-Demo.rar
Also contains the debug symbols.

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #12 on: May 12, 2020, 01:35:23 PM »
Sorry, I don't know why I haven't received notifications of these posts.  Let me give you an update and some responses to your questions:

Where I'm at:
With the whole COVID-19 lockdown, work actually got more significant in the business I'm in (software development against health care data).  You can image the amount of demand we're getting right now.  Anyway, where I last left things is trying out modifying the data file and re-export a CHD to MAME.  That failed miserably.  I even tried extracting a CHD and recompressing the CHD only to have it fail as well.  So that testing approach isn't going to work.

Anyway, I'm back to working on the code and so let's pick up with your questions:

1) Thoughts on Blazor/WebWindow
TBH: Not a Blazor fan.  I'm a web developer so I embrace JavaScript to do my client-side development.  But that doesn't mean it doesn't have value as a tool to build desktop apps.  So if you think that it would work for the desktop, I'm fine with that.

2) When building UIs, I do generally come up with some wireframes around what I'm trying to accomplish.  It helps see things first before putting them in code.  That being said, I'm often building complex UIs where this is likely fairly straight forward in what we are trying to accomplish.  Writing out the goals of what the UI is supposed to let the user do would be the first step and then we can mock some things up from there.  Balsamiq is a great mockup tool.

3) PC version vs Arcade version: Are all Blitz Arcade versions similar (ie: Blitz classic, Blitz '99, and Blitz 2000) compared to the PC version?  I would targeting only Blitz 2000 to start with as it's easy to upgrade any arcade to the Blitz 2000 with a couple of chip swaps.  If PC is compatible with Arcade, that would also help there.  Ideally, the way I see NFLBlitzDataEditor.Core would contain readers and writers for specific platforms/version.  This would allow the UI to simply swap between which ones they want use the interfaces to access the methods to read/write.

I have an NFL Blitz classic and need to install the Blitz 2000 upgrade + Flash Drive mod, but I may have to get myself another board so that I can develop and test on the hardware without constantly taking apart my arcade cabinet.

Let me refreshed with the code again and see where we stand.  I remember I was facing a challenge of there being some odd image files mixed around.  Maybe that code with debugger logic in it will help.

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #13 on: May 12, 2020, 01:50:39 PM »
Oh, one other thought I had about the UI.  I would be really nice if it were to tie into an actual NFL database, like https://www.pro-football-reference.com/, to allow the user to import a specific season.  The team rankings would be generated from that as well as allow the user to import players based on that season's current players list.

dmgambone

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: NFL Blitz Data File Editor (work in progress)
« Reply #14 on: May 12, 2020, 02:03:10 PM »
Does the demo work on Windows 10?  Do I need a specific version of DirectX?