diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-07-16 16:52:52 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-07-16 16:52:52 +0200 |
| commit | f5549b97bf85c0b169093a3a8478d610ef7c9e2e (patch) | |
| tree | 274a1572f27b07360882dd629b93d422b3335fcb /tests/unused_macro_arg.s | |
| parent | d7b1a895de9e3b78dc4f303de6b5a692849b1cd1 (diff) | |
| download | tools.nes-f5549b97bf85c0b169093a3a8478d610ef7c9e2e.tar.gz tools.nes-f5549b97bf85c0b169093a3a8478d610ef7c9e2e.zip | |
readrom: only read the ROM file once
Since the implementation grew from disassembling a single subroutine,
reading the ROM file from inside print_range() made sense. But since we
have disassembling of full segments and files now, this reading would be
triggered multiple times.
Commit d7b1a895de9e ("readrom: add an option to disassemble the full
file") avoided the exhaustion of the input by using seek(), but that's
just a hack and it's hiding the fact that we are constantly reading the
same thing over and over. Constantly reading ROM files isn't that much
of a performance issue given how small they are, but it's embarrasing
anyways.
Fix this by reading the full file once and passing the slice of bytes to
the same functions that used to require the file to be passed.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'tests/unused_macro_arg.s')
0 files changed, 0 insertions, 0 deletions
