Skip to content

Commit

Permalink
Stringify script addresses at the end 🪕.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed May 27, 2024
1 parent 1111b81 commit 2a0b5f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scumm-nes",
"version": "0.2.0",
"version": "0.2.1",
"description": "An app to explore and modify the game Maniac Mansion on NES.",
"author": "edo999@gmail.com",
"license": "BlueOak-1.0.0",
Expand Down
14 changes: 6 additions & 8 deletions src/components/ScriptCode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import { Link } from 'react-router-dom';
import ScriptCodeInstruction from './ScriptCodeInstruction.js';
import { hex } from '../lib/utils.js';

const ScriptCode = ({ code }) => {
if (!code) {
Expand All @@ -11,18 +12,15 @@ const ScriptCode = ({ code }) => {
<div className="text-xs">
{code.map(({ 0: address, 1: command }) => (
<div
key={address}
id={`L${address}`}
key={hex(address, 4)}
id={`L${hex(address, 4)}`}
className="flex gap-4 px-2 font-monocode">
<Link
className="font-thin opacity-50"
to={`#L${address}`}>
0x{address}
to={`#L${hex(address, 4)}`}>
0x{hex(address, 4)}
</Link>
<ScriptCodeInstruction
address={address}
command={command}
/>
<ScriptCodeInstruction command={command} />
</div>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/parser/parseScriptCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ const parseScriptCode = (parser, startAddress, parentOffset = 0) => {
break;
}

script.push([hex(rowAddress, 4), scriptRow]);
script.push([rowAddress, scriptRow]);
} while (!stop);

return script;
Expand Down

0 comments on commit 2a0b5f1

Please sign in to comment.