...Shifting it to the left 1 pixel at a time will not make the right hand side vertically jump except all the way on the right hand side of the window.
I'm curious, have you ever programmed direct HW registers for a video display on an Atari 800, or Amiga? Did you not know this is how their internal video processors work the same way. Or are you just used to library calls with do this control 'bit' manipulation under the hood?
So, not even vaguely close. I hadn't even really touched assembly on my Amstrad as a kid; I've learned the vast majority of what I know in the last two years working on my DIY computer. It's been a learning curve! 
Nope, that's wrong. Right now, every time the horizontal address needs to increase, every 8, 4, 2 ,or every pixel, it increments by 1 address. Meaning, 1 byte at a time. We need to double this addition once every 8, 4, 2, or every pixel. This has nothing to do with the vertical increment as that setting specifies the number of horizontal bytes you source image is. So, naturally you would just have the correct number set there by the Z80 defining the number of bytes per line in the source graphic. This is not what I am asking. When MAGGIE is drawing the image, as it requests every single pixel, when the 16bit setting is high, it needs to recognize that every pixel is 2 bytes (16 bit) wide, not 1 byte. How will you adapt MAGGIE to handle this.
Yes, the ram read pointer is being incremented inside the if(run_x).
At line 174.
But if you think about it, you might run into trouble here as the sub-pixel X position is also buried into the X increment here. You don't want to alter how the bit-plane sub pixel positioning is generated.
Try looking at line 98. You might be able to come up with a few ideas there.
ram_read_pointer_x <= ram_read_pointer_x + 2**pixel_per_byte;ram_read_pointer_x <= ram_read_pointer_x + 2**pixel_per_byte + 8 * pixel_16_bit;
Yes, the ram read pointer is being incremented inside the if(run_x).
At line 174.
But if you think about it, you might run into trouble here as the sub-pixel X position is also buried into the X increment here. You don't want to alter how the bit-plane sub pixel positioning is generated.
Try looking at line 98. You might be able to come up with a few ideas there.
Okay, so here's what I'm thinking. This is where the ram_read_pointer is incremented by a value relating to the mode (line 183 in my MAGGIE):Code: [Select]ram_read_pointer_x <= ram_read_pointer_x + 2**pixel_per_byte;
If MAGGIE is operating in 16-bit mode, this needs to add another 8 bits on this line? So something like this?Code: [Select]ram_read_pointer_x <= ram_read_pointer_x + 2**pixel_per_byte + 8 * pixel_16_bit;

Unfortunately, with your code, when in 1 bitplane mode, 16 bit pixel, you will increment the X address every pixel, plus increment the X address twice every 8th pixel. With a 16 bit data pixel, we would still want the X to increment twice every 8 pixels, but not during the middle of the 7 pixels of the bitmap.
Take a long hard look at line 98 once again and ask yourself, this read address increases by 1 at the right time, in 16 bit mode, when it increases by 1, I want it to increase by 2 instead...
assign read_addr[19:0] = ram_read_pointer_x[22:3] + 8*pixel_16_bit;
if (width == 0) begin
ram_read_pointer_x <= ram_read_pointer_x + 8*pixel_16_bit;
end

I think the problem is, I don't fully understand what the existing code is doing. If I did, I'd see the bigger picture and probably find the solution, even if it's not the most efficient way to do what you're asking. But as it is, I'm almost groping in the dark for the solution.ram_read_pointer_x <= ram_read_pointer_x + 2**pixel_per_byte + 8*pixel_16_bit;

Ok, I'll give you half of this one. Line 98 should be:
assign read_addr[19:0] = ram_read_pointer_x[22:3] << pixel_16_bit;
This multiplies the ram read pointer address by 2 when in 16 bit mode.
Now this is where bit operations start to look like a dark art to me.
ram_read_pointer_x is a 20-bit address, pointing to the current pixel. Bit-shifting that value left 1 place if in 16-bit mode doubles the value, why would that doubled value point to the next byte?

Now, you need to patch 4 other lines so that the read address is still correct during reset and image width setting. See lines 137,138, & 146,147.
There's clearly a hole in my understanding here. But bit-wise tantrum aside, here's what I've done with MAGGIE to get 16-bit mode working as you've specified:Line 139: ram_read_pointer_y <= (reset_addr << (3 - pixel_16_bit)) + period_x_rst; // V_TRIG is high during the first active line of video, set the read pointer, both
Line 140: ram_read_pointer_x <= (reset_addr << (3 - pixel_16_bit)) + period_x_rst; // the backup and currrent display address to the exact reset base address + x_offset during this line
Line 151: ram_read_pointer_y <= ram_read_pointer_y + (inc_addr_y[15:0] << (3 - pixel_16_bit)); // vertical increment display position in backup buffer
Line 152: ram_read_pointer_x <= ram_read_pointer_y + (inc_addr_y[15:0] << (3 - pixel_16_bit)); // vertical increment display position in current display address

Ok, I'll give you half of this one. Line 98 should be:
assign read_addr[19:0] = ram_read_pointer_x[22:3] << pixel_16_bit;
This multiplies the ram read pointer address by 2 when in 16 bit mode.Now this is where bit operations start to look like a dark art to me.
ram_read_pointer_x is a 20-bit address, pointing to the current pixel. Bit-shifting that value left 1 place if in 16-bit mode doubles the value, why would that doubled value point to the next byte?
If ram_read_pointer_x is, e.g., 0x40 - doubling that to 0x80 via a <<1 operation won't point to the next byte, it'll point to an arbitrary area of RAM, an increasing distance from the previous memory location as the address increases? If ram_read_pointer_x is operating anywhere in the top half of memory, this operation will put the pointer out of bounds, surely?
EDIT: Ignore the above - boy did my thoughts go off on a tangent there!!
Of course it won't double the number (at least not in the sense that it will exceed the top of memory) as it's capped at 20 bits.Now, you need to patch 4 other lines so that the read address is still correct during reset and image width setting. See lines 137,138, & 146,147.
Our line numbers are out of sync - 147 is an empty line, and the others don't make much sense. Rather than try to guess which lines you're talking about (139,140 and 151, 152 presumably), here's the latest version of MAGGIE; if you use this one, the line numbers you're quoting will match up to what I'm seeing.
EDIT: I'm off to go learn more about bit-shift operations (well, the concepts we're dealing with more than the operations themselves).There's clearly a hole in my understanding here. But bit-wise tantrum aside, here's what I've done with MAGGIE to get 16-bit mode working as you've specified:
Code: [Select]Line 139: ram_read_pointer_y <= (reset_addr << (3 - pixel_16_bit)) + period_x_rst; // V_TRIG is high during the first active line of video, set the read pointer, both
Line 140: ram_read_pointer_x <= (reset_addr << (3 - pixel_16_bit)) + period_x_rst; // the backup and currrent display address to the exact reset base address + x_offset during this line
Line 151: ram_read_pointer_y <= ram_read_pointer_y + (inc_addr_y[15:0] << (3 - pixel_16_bit)); // vertical increment display position in backup buffer
Line 152: ram_read_pointer_x <= ram_read_pointer_y + (inc_addr_y[15:0] << (3 - pixel_16_bit)); // vertical increment display position in current display address
I've just countered the doubling of ram_read_pointer by only shifting it left twice instead of 3 times in 16-bit mode. Seems to work - the image is doubled, as you stated.
Now, 1 last thing before making wiring the MAGGIE into text mode. A font 'Y' coordinate counter.
This one is weird as it sort of sits in parallel with the 'Y' period counter, but, it needs to either be off, count between 0 and 7, or 0 and 15. It needs to increment after every number of period sequence counts for the 'Y' scale, yet, it also needs to prevent the height, height_count and inc_addr_y[15:0] from taking place until it reaches it's end.
Lets add an assign:
assign font_y_size[3:0] = hw_regs[Y_SCALE][7:4];
font_y_size will define the height of the font. With this, you should be able to define a font tile size of '0' being 1 line font, to 15, being a font 16 lines tall.
The second assign will be: (It is actually taking the place of the 'period_y_rst[3:0]')
assign font_y_rst[3:0] = hw_regs[Y_START_SUB][3:0];
This reset position will define the beginning first line to be shown of the font at the top left hand of the window. It performs the equivalent function to the bitplane's period_x_rst.
Now, you will also need a reg:
font_y_pos[3:0]
This reg will reg will hold the counter of the current display's font's 'Y' coordinates.
...it needs to either be off, count between 0 and 7, or 0 and 15.
Remove the old OSD text and wire in 2 MAGGIEs on the first 2 read ports...
...assign H&V + normal HW regs for each, and on the second MAGGIE's ram output...
...wire that one's BART's output into the palette mixer's text layer input and begin to play, except, the current MAGGIE is missing the function to receive the last MAGGIE's memory character and point to a font memory address.
Will have a go this weekend...
I started trying to wire up the two MAGGIEs and their BARTs in the vid_osd_generator a few days back and have come back to it to work on it again for half an hour and spent that time trying to work out where I was with it all instead of progressing it further. 

In the image above, the white fade-out on the right-side of the Z80 image isn't a photographic artefact - could that be caused by capacitance in the output wires?