Open andrew-davie opened 4 years ago
I did experimenting with this, and found that for visualizing bitmaps in code, there are other characters that work even better than dots and Xs. Like for example dashes and @s. IMO the vertical alignment of the dashes make the bitmaps even easier 'see':
PfDataStart
.byte |--@@@---|
.byte |----@---|
.byte |@--@@--@|
.byte |-@@--@@@|
.byte |-@@--@@@|
.byte |@--@@--@|
.byte |----@---|
.byte |--@@@---|
PfDataEnd
compared to dots and Xs:
PfDataStart
.byte |..XXX...|
.byte |....X...|
.byte |X..XX..X|
.byte |.XX..XXX|
.byte |.XX..XXX|
.byte |X..XX..X|
.byte |....X...|
.byte |..XXX...|
PfDataEnd
Maybe we can make the chars configurable?
I was about to say what Thomas just wrote! Could just give a range of characters for "0" and anything else is 1? So, space, dot, dash, underscore, quote, zero.... all mean 0.... anything else (except for |) is 1?
Maybe via pseudo opp?
If only macros had string handling. Then this could all be coded in a macro.
PfDataStart
.byte |..███...|
.byte |....█...|
.byte |█..██..█|
.byte |.██..███|
.byte |.██..███|
.byte |█..██..█|
.byte |....█...|
.byte |..███...|
PfDataEnd
PfDataStart
.byte |░░███░░░|
.byte |░░░░█░░░|
.byte |█░░██░░█|
.byte |░██░░███|
.byte |░██░░███|
.byte |█░░██░░█|
.byte |░░░░█░░░|
.byte |░░███░░░|
PfDataEnd
If only macros had string handling. Then this could all be coded in a macro.
Macros have a lot o of limitations, but that's a different issue (or two, three, four...). 😈
If only macros had string handling. Then this could all be coded in a macro.
Macros have a lot o of limitations, but that's a different issue (or two, three, four...). 😈
Yes. But, to just make the point here while I mentioned it... macros already allow you to access the entire string passed to the macro via {0} -- if we allowed some sort of indexing on that, that would be all that would be needed.
@andrew-davie Do you know how to convert the macro string parameters into values, e.g. to use them for calculations?
@andrew-davie Do you know how to convert the macro string parameters into values, e.g. to use them for calculations?
No. I have tried many many times to do this. I don't think it's possible. I have tried passing the parameters to a 2nd macro... no dice. It's a shame, because it would be incredibly useful to be able to do that.
If we can enhance the macro engine to support indexing of (string) parameters, then that is the preferred way to solve the original issue, right? See Improve macro parameter handling #15
Consider adding Ben Coombe's bitmap changes, as listed in the PATCHES file...
Hi, Andrew... I just started up a 2600 project of my own, and I've done a few local modifications to the DASM source -- most are to make it compile without warnings in CodeWarrior for Windows, but I also added a new integer representation inspired by some of the disassemblies I've seen. I call it bitmap format, and instead of a leading %, you use a leading | followed by dots and Xs. A trailing | is allowed, but not required. Here's an example.
I find it easier to visualize the bitmaps in the code using this format, as 0's and 1's aren't that distinctive.
Here's the code change made to exp.c. I added this new function just before pushbin():
Then I modified the case statement around line 314:
I'd be glad to send the other changes, but they're mostly just adding "static" in front of local functions and cleaning up some loops that used a ";" to do nothing into using "{ }" instead (it tells the compiler that you intended on the empty action rather than just using a semicolon accidentally by habit.