Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Comodore prg mode #209

Closed
schorsch3000 opened this issue Nov 16, 2023 · 1 comment
Closed

Feature request: Comodore prg mode #209

schorsch3000 opened this issue Nov 16, 2023 · 1 comment

Comments

@schorsch3000
Copy link

I'm super unsure if this really should be a part of hexyl, but let me explain:
I heavily use hexyl in my C64 developement process.
a comodore .prg files is prefixed with 2 bytes that are not actually part of the files content.
When loading a prg file to memory, the first two bytes pointing to the address in memory that file is loaded.

It would be super helpful if hexyl could set it's display-offset automatically.

i currently have a the following wrapper-script around hexyl to achive that:

#!/usr/bin/env bash
set -e
# file is the last parameter
file="${*: -1}"
highByte="$(dd if="$file" bs=1 skip=1 count=1 status=none | hexdump -v -e '/1 "%02X"')"
lowByte="$(dd if="$file" bs=1 count=1 status=none | hexdump -v -e '/1 "%02X"')"
offset=$((0x$highByte * 256 + 0x$lowByte))
hexyl -o "$((offset - 2))" "$@"
@schorsch3000 schorsch3000 changed the title Feature request: Comorore prg mode Feature request: Comodore prg mode Nov 17, 2023
@sharkdp
Copy link
Owner

sharkdp commented Nov 29, 2023

Thank you. I think a wrapper script like you have is the best solution here. This seems a bit too specialized a use case in order for it to be integrated into hexyl. Thank you for sharing though!

@sharkdp sharkdp closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants