Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 246 additions & 0 deletions .github/workflows/markdown-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
name: Markdown Content Validation

on:
pull_request:
branches: [ main, master ]
paths:
- 'categories/**/*.md'
- 'pages/**/*.md'
- 'scripts/**'
- '.github/workflows/markdown-validation.yml'

jobs:
validate-markdown:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Check metadata completeness
id: check-metadata
run: |
echo "🔍 Checking metadata completeness..."

# Run metadata check and capture output
if node scripts/check-metadata.js editlink title > metadata-report.txt 2>&1; then
echo "metadata_status=success" >> $GITHUB_OUTPUT
else
echo "metadata_status=failed" >> $GITHUB_OUTPUT
fi

# Extract summary statistics
editlink_coverage=$(grep "editlink:" metadata-report.txt | grep -o '[0-9.]*% coverage' | head -1 || echo "0% coverage")
title_coverage=$(grep "title:" metadata-report.txt | grep -o '[0-9.]*% coverage' | head -1 || echo "0% coverage")

echo "editlink_coverage=$editlink_coverage" >> $GITHUB_OUTPUT
echo "title_coverage=$title_coverage" >> $GITHUB_OUTPUT

echo "✅ Metadata check completed"

- name: Validate tags
id: validate-tags
run: |
echo "🏷️ Validating tags against approved list..."

# Run tag validation and capture exit code
if node scripts/validate-tags.js > tag-validation-report.txt 2>&1; then
echo "validation_status=success" >> $GITHUB_OUTPUT
echo "✅ All tags are valid"
else
echo "validation_status=failed" >> $GITHUB_OUTPUT
echo "❌ Tag validation failed"

# Extract invalid tags for summary
invalid_tags=$(grep -A 1000 "INVALID TAGS SUMMARY" tag-validation-report.txt | grep "❌" | head -5 | sed 's/❌ //' || echo "See detailed report for invalid tags")

# Save invalid tags to output (escape for GitHub Actions)
{
echo 'invalid_tags<<EOF'
echo "$invalid_tags"
echo 'EOF'
} >> $GITHUB_OUTPUT
fi

- name: Generate detailed reports
run: |
echo "📋 Generating detailed reports..."

# Create a comprehensive report
cat > validation-summary.md << 'EOF'
# 📊 Markdown Content Validation Report

## Metadata Completeness

- **editlink field**: ${{ steps.check-metadata.outputs.editlink_coverage }}
- **title field**: ${{ steps.check-metadata.outputs.title_coverage }}

## Tag Validation

**Status**: ${{ steps.validate-tags.outputs.validation_status == 'success' && '✅ All tags valid' || '❌ Invalid tags found' }}

## Detailed Reports

<details>
<summary>📋 Metadata Analysis Report</summary>

```
EOF

cat metadata-report.txt >> validation-summary.md

cat >> validation-summary.md << 'EOF'
```

</details>

<details>
<summary>🏷️ Tag Validation Report</summary>

```
EOF

cat tag-validation-report.txt >> validation-summary.md

cat >> validation-summary.md << 'EOF'
```

</details>

---

*This report was automatically generated by the Markdown Content Validation workflow.*
EOF

- name: Upload validation reports
uses: actions/upload-artifact@v4
with:
name: markdown-validation-reports
path: |
validation-summary.md
metadata-report.txt
tag-validation-report.txt

- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');

// Read the validation summary
const summary = fs.readFileSync('validation-summary.md', 'utf8');

// Determine overall status
const metadataStatus = '${{ steps.check-metadata.outputs.metadata_status }}';
const tagStatus = '${{ steps.validate-tags.outputs.validation_status }}';

let overallStatus = '✅ PASSED';
let statusEmoji = '✅';

if (tagStatus === 'failed') {
overallStatus = '❌ FAILED';
statusEmoji = '❌';
} else if (metadataStatus === 'failed') {
overallStatus = '⚠️ WARNINGS';
statusEmoji = '⚠️';
}

let comment = `${statusEmoji} **Markdown Content Validation ${overallStatus}**

${summary}

## Quick Actions

${tagStatus === 'failed' ? '- ❌ **Fix invalid tags** before merging' : '- ✅ All tags are valid'}
- 📈 **Consider adding missing metadata fields** to improve content completeness
- 📥 **Download detailed reports** from the workflow artifacts
`;

// Add specific invalid tags if validation failed
if (tagStatus === 'failed') {
const invalidTags = `${{ steps.validate-tags.outputs.invalid_tags }}`;
if (invalidTags && invalidTags.trim() !== '' && !invalidTags.includes('See detailed report')) {
comment += `

## ❌ Invalid Tags Found

The following tags are not in the approved list:
${invalidTags}

**Fix Required**: Please remove these invalid tags or add them to the approved tags list before merging.
`;
}
}

comment += `

---

💡 **Tip**: Run \`node scripts/validate-tags.js\` locally to see detailed validation results.
`;

// Find existing comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const existingComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('Markdown Content Validation')
);

if (existingComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.id,
body: comment
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: comment
});
}

- name: Check validation results
run: |
echo "🔍 Final validation check..."

if [ "${{ steps.validate-tags.outputs.validation_status }}" = "failed" ]; then
echo "❌ Tag validation failed - blocking merge"
echo "Please fix invalid tags before merging this PR"
exit 1
fi

echo "✅ All critical validations passed"
echo "Note: Metadata warnings don't block the merge but should be addressed"

- name: Generate status summary
run: |
echo "## 📊 Validation Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Check | Status | Coverage |" >> $GITHUB_STEP_SUMMARY
echo "|-------|---------|----------|" >> $GITHUB_STEP_SUMMARY
echo "| Tag Validation | ${{ steps.validate-tags.outputs.validation_status == 'success' && '✅ Passed' || '❌ Failed' }} | - |" >> $GITHUB_STEP_SUMMARY
echo "| editlink Field | ⚠️ Warnings | ${{ steps.check-metadata.outputs.editlink_coverage }} |" >> $GITHUB_STEP_SUMMARY
echo "| title Field | ⚠️ Warnings | ${{ steps.check-metadata.outputs.title_coverage }} |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🎯 Action Items" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.validate-tags.outputs.validation_status }}" = "failed" ]; then
echo "- ❌ **CRITICAL**: Fix invalid tags (blocks merge)" >> $GITHUB_STEP_SUMMARY
fi
echo "- 📈 Consider adding missing metadata fields" >> $GITHUB_STEP_SUMMARY
echo "- 📥 Download detailed reports from workflow artifacts" >> $GITHUB_STEP_SUMMARY
2 changes: 0 additions & 2 deletions categories/companies/Codemasters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ layout: post
console: codemasters
recommend:
- industry
- codemasters
tags:
- companies
- industry
- codemasters
recommendTitle: All Codemasters Posts
title: Codemasters (Creator of the Game Genie)
image_: /public/images/companies/Codemasters - Company.jpg
Expand Down
2 changes: 1 addition & 1 deletion categories/consoles/GameBoyAdvance.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: post
title: Nintendo Game Boy Advance (GBA) Reverse Engineering
recommend:
- gba
- gb
- gameboy
recommendTitle: All GBA Posts
editlink: ../categories/consoles/GameBoyAdvance.md
console: gba
Expand Down
19 changes: 10 additions & 9 deletions categories/games/FileFormats.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
permalink: /games/fileformats
layout: blog-cards
layout: post
console: fileformats
title: Introduction to Game File Formats
breadcrumbs:
- name: Home
url: /
Expand All @@ -13,11 +14,14 @@ redirect_from:
- /gamefiles
- /fileformat
- /game-file-formats
recommend:
- fileformats
---
<h1>Introduction to Game File Formats </h1>
With the advent of Disc-based video games, developers were free to seperate games into multiple files, such as audio, textures, sprites, 3d models etc.

Before disc based games games used to all be on a single rom chip which could be thought of as a single file with all the assets and game code in one large binary file.
# Introduction to Game File Formats
With the advent of Disc-based video games, developers were free to separate games into multiple files, such as audio, textures, sprites, 3d models etc.

Before disc based games, games used to all be on a single rom chip which could be thought of as a single file with all the assets and game code in one large binary file.

## What are the benefits of external files?
It was much easier for artists or sound designers to modify the game and test on hardware if all they needed to do was replace a single file, instead of the old days when everything needed to be compiled into one.
Expand All @@ -28,7 +32,7 @@ Another benefit is that it makes it much easier for modding of the game if you a

## But what about performance?
There is a performance issue with loading hundreds of small files from a cd so games tended to create their own binary blobs of concatenated (and sometimes compressed) smaller files.
This make some games similar to ROMS in that everything is packed in a single file, this makes loading from disc faster in theory but the bigger the data file the slower it will be.
This makes some games similar to ROMS in that everything is packed in a single file, this makes loading from disc faster in theory but the bigger the data file the slower it will be.

## Are game formats standard?
Some are and some are custom formats created by the developers for efficiency, in more modern games you will get files like .mp3, .dds, .png etc.
Expand All @@ -37,7 +41,7 @@ Some are from middleware providers such as .bik files which play using the Bink

---
# Game Formats by Platform
Although game formats can be used across multiple games consoles or platforms, we have seperated the file formats by platform to make it easier to see the files a developer would be working with when developing for a specific platform.
Although game formats can be used across multiple games consoles or platforms, we have separated the file formats by platform to make it easier to see the files a developer would be working with when developing for a specific platform.

Platform Name | Game Engine List
---|---
Expand All @@ -46,6 +50,3 @@ Nintendo WiiU | [Wii U File Formats](https://www.retroreversing.com/WiiUFileForm
Sony Playstation 1 | [Playstation 1 File Formats](https://www.retroreversing.com/ps1-file-formats)


<div>
{% include console.html %}
</div>
3 changes: 3 additions & 0 deletions categories/games/Games.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
permalink: /games/
layout: post
console: games
title: Games specific posts
breadcrumbs:
- name: Home
url: /
Expand All @@ -10,4 +11,6 @@ breadcrumbs:
redirect_from:
- /games/all
---
This page collects all the posts that are related to reverse engineering a specific game rather than an entire console or platform.

{% include console.html %}
4 changes: 4 additions & 0 deletions categories/games/SourceCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
permalink: /games/sourcecode
layout: post
console: sourcecode
title: Retail Game Source Code
breadcrumbs:
- name: Home
url: /
Expand All @@ -13,4 +14,7 @@ redirect_from:
- /games/source
- /retailsourcecode
---
This page collects all the posts that are related to source code, either officially released or leaked, for retail games (not homebrew or open source games).


{% include console.html %}
9 changes: 5 additions & 4 deletions categories/games/debugSymbols.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
permalink: /games/symbols
layout: post
console: symbols
title: Introduction to Debug Symbols in Game Development
breadcrumbs:
- name: Home
url: /
Expand All @@ -13,14 +14,14 @@ redirect_from:
- /games/debugsymbols
- /unstrippedbinaries
---
<h1>Introduction to Debug Symbols</h1>
# Introduction to Debug Symbols
Finding Debug Symbols when reverse engineering a game is the equivalent of buying a Strategy Guide, all the secrets are unlocked which is awesome but it also removes part of the fun of discovering what each part of the game does.

## Where do debug symbols come from?
Debug symbols are an artifact of compiling a game from a higher level language (e.g. C\C++) down to a lower level language such as Assembly code.
Debug symbols are an artifact of compiling a game from a higher level language (e.g. C/C++) down to a lower level language such as Assembly code.

## What are debug symbols used for?
They are used by developers to allow them to attach a debugger to the game and debug the code line-by-line with all the function and variable names in tact.
They are used by developers to allow them to attach a debugger to the game and debug the code line-by-line with all the function and variable names intact.

## Why are debug symbols only in some games?
Developers *should* remove the debug symbols before the release of the game, a process called `stripping executables`, but due to the high pressures of development and last-minute bugs they can be left in.
Expand All @@ -35,7 +36,7 @@ Also some platforms that used compiled code but were to be released on a small s
Platform Name | List of games that still contain debug symbols
---|---
Sony Playstation 1 | [Playstation 1 Games with Debug Symbols](https://www.retroreversing.com/ps1-debug-symbols)
Sony Playstation 2 | [PS2 Demo Discs](https://www.retroreversing.com/ps2-demos/) && [PS2 Retail Games](https://www.retroreversing.com/ps2-unstripped/)
Sony Playstation 2 | [PS2 Demo Discs](https://www.retroreversing.com/ps2-demos/) and [PS2 Retail Games](https://www.retroreversing.com/ps2-unstripped/)
Sony Playstation Portable | [Playstation Portable Games with Debug Symbols](https://www.retroreversing.com/psp-debug-symbols)
Nintendo DS |
Nintendo 64 | None due to limitations of cart size. But we do have part of Turok source code: [Turok 64 Official Source Code Analysis](https://www.retroreversing.com/turok64sourcecode)
Expand Down
Loading