204 lines
5.4 KiB
HTML
204 lines
5.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Old Man Glitch Decoder — Pokémon Red/Blue/Yellow</title>
|
|
<script src="./jquery-4.0.0.min.js"></script>
|
|
<style>
|
|
:root {
|
|
color-scheme: light dark;
|
|
--bg: #f4f1e8;
|
|
--panel: #ffffff;
|
|
--ink: #202020;
|
|
--muted: #6b6b6b;
|
|
--accent: #cc0000;
|
|
--accent-dim: #e8d7d7;
|
|
--border: #202020;
|
|
}
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg: #16171a;
|
|
--panel: #232529;
|
|
--ink: #eceff1;
|
|
--muted: #9aa0a6;
|
|
--accent: #ff5c5c;
|
|
--accent-dim: #3a2626;
|
|
--border: #4a4d52;
|
|
}
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
padding: 2rem 1rem 4rem;
|
|
background: var(--bg);
|
|
color: var(--ink);
|
|
font-family: "Courier New", Courier, monospace;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
main { width: 100%; max-width: 720px; }
|
|
h1 {
|
|
font-size: 1.4rem;
|
|
margin: 0 0 0.25rem;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
.subtitle {
|
|
color: var(--muted);
|
|
margin: 0 0 1.5rem;
|
|
font-size: 0.9rem;
|
|
}
|
|
.panel {
|
|
background: var(--panel);
|
|
border: 2px solid var(--border);
|
|
border-radius: 6px;
|
|
padding: 1.25rem 1.5rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
.name-row {
|
|
display: flex;
|
|
gap: 0.6rem;
|
|
flex-wrap: wrap;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
.slot {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 0.35rem;
|
|
}
|
|
.slot .index {
|
|
font-size: 0.7rem;
|
|
color: var(--muted);
|
|
}
|
|
.slot .role {
|
|
font-size: 0.65rem;
|
|
color: var(--accent);
|
|
font-weight: bold;
|
|
min-height: 1em;
|
|
}
|
|
.slot input {
|
|
width: 2.4rem;
|
|
height: 2.6rem;
|
|
text-align: center;
|
|
font-size: 1.3rem;
|
|
font-family: inherit;
|
|
background: var(--bg);
|
|
color: var(--ink);
|
|
border: 2px solid var(--border);
|
|
border-radius: 4px;
|
|
}
|
|
.slot input:focus {
|
|
outline: none;
|
|
border-color: var(--accent);
|
|
}
|
|
.symbols {
|
|
display: flex;
|
|
gap: 0.2rem;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
max-width: 2.4rem;
|
|
}
|
|
.symbols button {
|
|
font-family: inherit;
|
|
font-size: 0.7rem;
|
|
padding: 0.1rem 0.3rem;
|
|
cursor: pointer;
|
|
background: var(--accent-dim);
|
|
color: var(--ink);
|
|
border: 1px solid var(--border);
|
|
border-radius: 3px;
|
|
}
|
|
.symbols button:hover { background: var(--accent); color: #fff; }
|
|
.hint {
|
|
font-size: 0.75rem;
|
|
color: var(--muted);
|
|
margin-top: 0.75rem;
|
|
}
|
|
.results {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
gap: 0.75rem;
|
|
margin-top: 1rem;
|
|
}
|
|
.encounter {
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
padding: 0.75rem 0.9rem;
|
|
background: var(--bg);
|
|
}
|
|
.encounter .from {
|
|
font-size: 0.7rem;
|
|
color: var(--muted);
|
|
margin-bottom: 0.35rem;
|
|
}
|
|
.encounter .species {
|
|
font-size: 1.1rem;
|
|
font-weight: bold;
|
|
}
|
|
.encounter .level {
|
|
color: var(--accent);
|
|
font-size: 0.95rem;
|
|
}
|
|
h2 {
|
|
font-size: 1rem;
|
|
margin: 0 0 0.5rem;
|
|
}
|
|
p { line-height: 1.5; font-size: 0.9rem; }
|
|
code {
|
|
background: var(--accent-dim);
|
|
padding: 0.1rem 0.3rem;
|
|
border-radius: 3px;
|
|
}
|
|
footer {
|
|
color: var(--muted);
|
|
font-size: 0.75rem;
|
|
text-align: center;
|
|
margin-top: 2rem;
|
|
}
|
|
#load-error {
|
|
display: none;
|
|
color: var(--accent);
|
|
font-size: 0.85rem;
|
|
margin-top: 0.75rem;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<h1>Old Man Glitch Decoder</h1>
|
|
<p class="subtitle">Pokémon Red / Blue / Yellow — trainer-name encounter preview</p>
|
|
|
|
<div class="panel">
|
|
<div class="name-row" id="name-row">
|
|
<!-- 7 slots injected by app.js -->
|
|
</div>
|
|
<div class="hint">
|
|
Type up to 7 characters (letters, digits, or the symbols below each box). The 1st character has no effect — the glitch never reads it.
|
|
</div>
|
|
<div id="load-error">Couldn't load <code>data/charmap.json</code>. If you opened this file directly, the browser blocks local JSON loads — serve the folder instead, e.g. <code>python3 -m http.server</code> from this directory, then open <code>http://localhost:8000</code>.</div>
|
|
|
|
<div class="results" id="results"></div>
|
|
</div>
|
|
|
|
<div class="panel">
|
|
<h2>How this works</h2>
|
|
<p>
|
|
In Gen 1, walking away from the Old Man in Viridian City right after he "shows you how to catch a Pokémon" can trigger a glitch encounter built from bytes of your trainer's name. Positions <strong>3, 5, and 7</strong> of the name are read as a Pokémon species byte, and positions <strong>2, 4, and 6</strong> are read as that encounter's level byte — three separate (species, level) pairs.
|
|
</p>
|
|
<p>
|
|
The species comes from the game's internal index table: every nameable character (A–Z, a–z, digits, and a handful of symbols) has a raw byte value from 128–255, and that byte doubles as a species ID in the Pokémon index.
|
|
</p>
|
|
<p>
|
|
The "level" isn't computed at all — it's <em>the same raw byte value</em>, printed as-is. That's why these encounters always show absurd levels (128–255) instead of the normal 1–100: the game is misreading a name-entry character as if it were a level.
|
|
</p>
|
|
</div>
|
|
|
|
<footer>
|
|
Data source: internal Gen 1 index table (decimal / R-B-Y Pokémon / R-B-Y Letter columns). Based on the "Old Man Name Generator 2" tool archived from Glitch City Laboratories.
|
|
</footer>
|
|
</main>
|
|
|
|
<script src="app.js"></script>
|
|
</body>
|
|
</html>
|