Closed mills32 closed 2 years ago
There was no special work done after porting ao486 to MiSTer, but attaching relevant documentation for those who wants to make VGA controller replica.
There also expected shortage in Cyclone V FPGA blocks. Probably there will be compromise - either to have full VGA controller supported OR soundblaster, not both.
VGA ports information here: https://wiki.osdev.org/VGA_Hardware
Why shortage? VGA memory is fully implemented. So fixing some problems or add feature should not increase BRAM usage. We are not talking about SVGA implementation, right?
Hi.
I was talking about VGA (not SVGA). VGA has hardware scrolling that moves 4 pixels at a time, (or entire scanlines, so it is used for page flipping), and also has "per pixel panning".
I don't think we have to add more features, or use more blocks, because per pixel panning is kind of working. The problem is, it moves the wrong amount of pixels and makes the screen shake.
There is also a menu option in Dyna Blaster, which tests the VGA scrolling, and it works smoothly, (but the palette is wrong). So maybe it is just a little "bug".
I'd love to help, but I have no idea about fpga programming (maybe I should learn).
Thanks anyway :).
no one is born with fpga programming ability :)
Seems it's combined BIOS + VGA controller "Mode X" feature. VGA bios sources can be found here https://github.com/qemu/vgabios, VGA controller logic and specifically 4-bit latches described here http://ohlandl.ipv7.net/books/ps2_50-60_techref_ch4b_system_board_io_controllers_video.pdf but brief reading through ao486 didn't get me to the point where such 4 bit operations / latches might be located
Could be non-implemented parts in https://github.com/alfikpl/ao486/blob/master/rtl/soc/vga/vga.v
// not implemented sequencer regs: reg seq_not_impl_shift_load_2; reg seq_not_impl_shift_load_4;
Sequencer -> Clocking mode register, bits 2 and 4
More details about what's sent to registers during switching to "Mode X" and operations with video planes https://www.singlix.com/trdos/archive/vga_bios/vga_mode_x.pdf. Good news - seems BIOS is not involved. Bad news - seems it's not implemented in Verilog code in ao486 VGA controller
More archeology digging info about VGA - https://www.singlix.com/trdos/archive/vga_bios/
it's already happening. Commander keen shows it.
Disabling cache (1 and 2, so set CPU speed to 90 because it is very slow), seems to solve the smooth panning issue. There is still some shaking at the borders of the display area.
I tried "secret agent" with 15hz and disabled caches and I have the issue as well.
@mills32 tried as well and same issue.
I tried both with a VGA and HDMI and different screens (none of them CRT)
yes, it is already happening.
I can confirm this problem is happening on both VGA and HDMI for me. I haven’t found any settings that help. All of the following games are unplayable: Secret Agent Monster Bash Bio Menace
I’ll add more as I find them.
This bug (missing pixels in vga hardware scroll in supaplex and keen4 etc.) can be fixed by removing from "vga.v" the last part of
assign dot_memory_load = ( (seq_8dot_char && ~(seq_dotclock_divided) && dot_cnt_enable && dot_cnt == 4'd3) || (seq_8dot_char && seq_dotclock_divided && ~(dot_cnt_enable) && dot_cnt == 4'd6) || (~(seq_8dot_char) && ~(seq_dotclock_divided) && dot_cnt_enable && dot_cnt == 4'd4) || (~(seq_8dot_char) && seq_dotclock_divided && ~(dot_cnt_enable) && dot_cnt == 4'd7) ) && ( (vert_cnt == crtc_vertical_total + 1'd1 && horiz_cnt >= crtc_horizontal_total + 8'd3) || (vert_cnt < crtc_vertical_display_size && (horiz_cnt <= crtc_horizontal_display_size - 8'd2 || horiz_cnt >= crtc_horizontal_total + 8'd3)) || (vert_cnt == crtc_vertical_display_size && horiz_cnt <= crtc_horizontal_display_size - 8'd2) );
i.e. the following will fix the missing pixels hardware scroll issue (at least with keen 4 and supaplex which I justed tested):
assign dot_memory_load = ( (seq_8dot_char && ~(seq_dotclock_divided) && dot_cnt_enable && dot_cnt == 4'd3) || (seq_8dot_char && seq_dotclock_divided && ~(dot_cnt_enable) && dot_cnt == 4'd6) || (~(seq_8dot_char) && ~(seq_dotclock_divided) && dot_cnt_enable && dot_cnt == 4'd4) || (~(seq_8dot_char) && seq_dotclock_divided && ~(dot_cnt_enable) && dot_cnt == 4'd7) );
Do you want to make a pull request with this fix? Otherwise i can add it myself.
Ok, did a pull request now. Hopefully it is ok, I haven't done pull requests before.
So this issue could be closed since it has been resolved here https://github.com/MiSTer-devel/ao486_MiSTer/pull/104
This is actually not fixed. Try Secret Agent on latest. I also tried on this previous version of the build: https://github.com/MiSTer-devel/ao486_MiSTer/raw/master/releases/ao486_20220301.rbf
This is RIGHT after the fix was made. The problem happens there as well. The odd thing is the update to the code does not match exactly the suggested fix above. Any reason for that?
Thanks a lot for this amazing core, I tested a lot of programs and games, and it works really well:
Some games that (I think) use the VGA horizontal hardware panning/scrolling, are very jerky.
You can check the jerky scrolling in these: -Supaplex (when going to config menu and back). -Prehistorik II (loading screen and world map). -Double Dragon 3 (menu intro).
Thanks.