Draft: Blocks wordset#554
Conversation
|
|
||
| \ buf block id's | ||
| create bbi 0 , 0 , 0 , 0 , 0 , 0 c, | ||
| create dirty 0 , 0 , 0 , 0 , 0 , 0 c, |
There was a problem hiding this comment.
if it stays an odd number, say 5, then any block editor that does shadow blocks will still be able to use all 5 buffers while you browse +2 and -2
There was a problem hiding this comment.
whoops nvm I should have read more, I see you're doing #11 mod please ignore.
There was a problem hiding this comment.
It is really nice that you take a look at things. It is maybe getting closer to first release. Test and documentation are still missing.
There was a problem hiding this comment.
Also to be done: update EVALUATE, \ and REFILL to support blocks.
Edit: Done
There was a problem hiding this comment.
Probably need to support:
- disk change
- release/delete blocks
There was a problem hiding this comment.
I've avoided the problem by only using ( in my blocks. FWIW my vote is 40 to (1) make editors simpler to implement and because (2) horizontal scrolling is kinda gross UX. It's definitely unorthodox though. Perhaps a poll is in order?
There was a problem hiding this comment.
I don't think a poll is needed, just need to work out the pros and cons. I agree 40-width makes a lot of sense for the reasons you mention.
The strongest argument for 64 is that long strings can be useful, for example, it allows defining a S" string that is 40 characters long or more. I am not sure if there is a clean way to do the same with 40-width.
There was a problem hiding this comment.
Actually: I realize now, long lines is not a problem for blocks. When LOADing a block, S" will parse until the next ", even if it is on another line.
It is a problem if the code is later copied from block to file, but then it can be resolved by joining the string lines to a single long line.
I think altogether, that makes a strong case for 40-width.
There was a problem hiding this comment.
Unlike files, block LOAD is specified to use the entire block source as the input buffer, so words like s" and ( should be able to span across lines portably if I understand correctly (if I don't understand correctly please let me know).
Another strong argument for 64 is to make it more likely to be able to directly reuse any Forth source already in 16x64 screens out there that have \ comments. I'm personally ambivalent to that though.
There was a problem hiding this comment.
For the most part, I don't think porting from 16x64 to 25x40+24 would be a big problem. At least not compared to all the other problems when porting code from a Forth to another.
|
You can compact the string code a bunch more, if you care: : holds ( c*n n -- ) 0 do hold loop ;
: _0_t_s ( t s -- 0d ) decimal
0 #s bl hold 2drop
0 #s bl '0' bl 3 holds ;
( ... )
<# _0_t_s 'b' '-' 'a' 3 holds #>
<# $d hold _0_t_s 'u' '2' 2 holds #>
<# _0_t_s 'u' '1' bl '5' 4 holds #>Though I think |
|
@ekipan thanks for the tip. however. i will leave that code unoptimized until later. in case my solution turns out to be wrong. |
|
Another difficult decision: Allocate blocks once upfront, or just-in-time? I am toying with the idea to allowing addressing blocks 1-199, but that block sectors are only allocated on first write. The good thing about this is that it allows sparse sequences, i.e. using blocks 1, 10 and 100 will only allocate 3kb worth of disk sectors. This might make things more manageable, for example one set of words can be on blocks 10-13, another on 20-25, et.c., with some unallocated blocks inbetween. The drawback is of course the risk of sudden and unexpected "disk full" errors. Also, adjacent blocks would no longer be guaranteed to be physically close to each other on disk (leading to longer seek times). What do you think? |
|
Another idea that kind of dodges all problems, but adds complexity and other problems in return: I guess the problem with this approach is especially for new users, who might need to go through hassle of creating empty .d64 image, mounting to drive 8/9, and learning BLOCKS command, before even entering the editor. Also, it is just a hassle that it is not at all DOS compatible. |
|
It's interesting that a 4 block file has 1016 max data bytes in it. That could be a screen full, and a filename for the next screen. This is also how screen memory is arranged. 1000 bytes of screen memory then 16 unused bytes. |
|
The 40x25=1000 bytes most importantly leaves space for eight sprite data pointers. |
|
Yeah, the sprite pointers start at 2040. |
|
This might be fun: |
|
Applications that require large amounts of data to be processed are best stored in relative disk files. These will use the least amount of time and provide the best flexibility for the programmer. |
No description provided.