Reply 180 of 343, by vasyl
I've found what was causing crash in one of WHATVGA modes with the latest version of my patch. The bug is not in the patch, it was just hidden before. In vga_draw function VGA_Draw_VGA_Line (EGA_Line as well) is overoptimized. There are some conditions when the returned address may be outside of allocated video memory. What's worse, the returned address may be inside the allocation but the line does not fit and there is no way scalers can wrap around properly. The reason it was triggered after my latest changes was that before there was enough memory allocated after needed video memory. So, the logic was still wrong but the crash was hidden. Not that there are many cases when the crash can happen but this needs to be fixed. The next version of the patch will have the fix.
EDIT: Fixing this issue has interesting side effect of fixing New Age Warrior. That game has been in the list of broken games for some time. It does not fix it in S3 mode but now I strongly suspect that the game does not run on real S3 either.