Skip to content

Commit

Permalink
romdisk: fix a bug in the "hexdump" command that printed an uninitial…
Browse files Browse the repository at this point in the history
…ized character

After an ldir, DE points to the next character to set and NOT HL...
This resulted in the last character of the buffer being uninitialized, yet
printed at the end of the function.
  • Loading branch information
Zeal8bit committed Jul 27, 2024
1 parent 64159f8 commit 17deb39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion romdisk/hexdump.asm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ hexdump_print_bc_chars:
ldir
pop bc
; Store a newline at the end of the buffer
ld (hl), '\n'
ld a, '\n'
ld (de), a
; Fill the buffer with the actual line to print
; Start by getting the current offset in the file, convert it to ASCII
ld hl, (file_offset)
Expand Down

0 comments on commit 17deb39

Please sign in to comment.