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

Display decimal value of a char in addition to hex #141

Closed
Esshahn opened this issue Feb 28, 2019 · 7 comments
Closed

Display decimal value of a char in addition to hex #141

Esshahn opened this issue Feb 28, 2019 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@Esshahn
Copy link
Collaborator

Esshahn commented Feb 28, 2019

This is a low hanging fruit that would have saved me hours when I was working on the "week in progress" demo:

Display the decimal value in addition to the hex value in these two places:

screenshot 2019-02-28 um 09 56 41
screenshot 2019-02-28 um 09 56 47

So instead of

$20

do

$20 / #32

@Esshahn Esshahn added the enhancement New feature or request label Feb 28, 2019
@Esshahn Esshahn added this to the 0.7 milestone Feb 28, 2019
@Esshahn
Copy link
Collaborator Author

Esshahn commented Feb 28, 2019

Why this would be so helpful:

When exporting asm source with Petmate, decimal values are used instead of hex:

screen_001
!byte 14,6
!byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
!byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
!byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
!byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
!byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32
!byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,160,32,32,32,32,32,32,32,32,32,32,32
!byte 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,160,32,32,32,32,32,32,32,32,32,32

But you never see these values in the editor ;)
Therefore it would be more consistant.

I was using Petmate to create a background screen for my part in "week in progress"

screenshot 2019-02-28 um 10 01 15

This part uses a custom charset where the characters would not match the PETSCII's characters position.

screenshot 2019-02-28 um 10 02 46

I needed to replace a char codes in the export file with the matching ones in the charset and to get the right values to replace, I needed to convert the hex numbers in petmate to the decimal numbers in the export.

@nurpax
Copy link
Owner

nurpax commented Feb 28, 2019

Coming from a coder background, my initial reaction is to have hex only. Decimal feels like clutter. Charcodes are so commonly in hex. But may be as days pass by, I will change my mind. :)

What about switching .asm export to use hex? Or maybe use a slightly more expressive content pipeline? For example, when you include a petscii in your asm project, use something like macros to replace the chars. For example, here's what I did in one of my demos to fix some particular chars in the font (this is in c64jasm but a similar thing works in KA too)

!macro fix_architect_font(charset) {
    !for i in range(64) {
        !if (i == $20) {
            !fill 8, 0
        } elif (i == $2c) { ; ','
            !byte %00000000
            !byte %00000000
            !byte %00000000
            !byte %00000000
            !byte %00000000
            !byte %00110000
            !byte %01100000
            !byte %00000000
        } elif (i == $2e) { ; '.'
            !byte %00000000
            !byte %00000000
            !byte %00000000
            !byte %00000000
            !byte %00000000
            !byte %01100000
            !byte %01100000
            !byte %00000000
        } else {
            !byte charset.data[i]
        }
    }
    ; $40
    !fill 8, $ff
}

A similar thingie for petscii could be:

!macro fix_petscii(petmate) {
    !for i in range(1000) {
        !let sc = petmate.screen[i]
        !if (sc == $76) {
             !byte $31  ; replace 0x76 with 0x31
        } else {
             !byte sc
        }
    }
}

screencodes:
!fix_petscii(loadJson('foo.petmate'))

@og2t
Copy link

og2t commented Feb 28, 2019 via email

@nurpax
Copy link
Owner

nurpax commented Feb 28, 2019

In general, I prefer not to stick stuff into settings. So either it's just hex or hex and decimal. But it's two against one already, so maybe I'll just add the decimal in there.

I've wanted to be able to see the currently selected color indexed in this view (next to charcode). But adding decimal there too (so "C: $20/32 COL: $03/3") would take too much space and would clutter the view. Also the abbreviation "C:" for screenCode might not be the best. Would "SC:" or "S:" be better?

image

@og2t
Copy link

og2t commented Feb 28, 2019 via email

@nurpax
Copy link
Owner

nurpax commented Feb 28, 2019

Or hover on top of hex to see decimal in a tooltip?

Sorry if I'm being obtuse about layout and keeping the look simple, but IMO Petmate is in fact pretty simple and (I like to think) pretty because things like this have had a lot of thought go into them (quite often by @Esshahn).

@og2t
Copy link

og2t commented Feb 28, 2019 via email

@nurpax nurpax closed this as completed in e05efd3 Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants