X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=624a96d683366ec3e105636e6511d821d7b2dd6a;hb=c3104b1494bd0f31ce49e3365d36e4ace02e69c7;hp=cb5102c8077c32d55f79c065f1bcb896cc386dbb;hpb=73a484ef8bbdbcb82bde5580b77001e7c54265f8;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index cb5102c8..624a96d6 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -56,7 +56,7 @@ void VGAmodeX(sword vq, global_game_variables_t *gv) int86(0x10, &in, &out); gv->old_mode = out.h.al; // enter mode - modexEnter(); + modex__320x240_256__Enter(gv); } } @@ -73,53 +73,59 @@ vgaSetMode(byte mode) /* -========================= Entry Points ==========================- */ void -modexEnter() { - word i; - dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */ - word CRTParms[] = { - 0x0d06, /* vertical total */ - 0x3e07, /* overflow (bit 8 of vertical counts) */ - 0x4109, /* cell height (2 to double-scan */ - 0xea10, /* v sync start */ - 0xac11, /* v sync end and protect cr0-cr7 */ - 0xdf12, /* vertical displayed */ +modex__320x240_256__Enter(global_game_variables_t *gv) +{ + word i; + dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */ + word CRTParms[] = { +// 0x5f00, /* horizontal total */ +// 0x3f01, /* horizontal display enable end */ + 0x0d06, /* vertical total */ + 0x3e07, /* overflow (bit 8 of vertical counts) */ + 0x4109, /* cell height (2 to double-scan */ + 0xea10, /* v sync start */ + 0xac11, /* v sync end and protect cr0-cr7 */ + 0xdf12, /* vertical displayed */ // 0x2013, /* offset/logical width */ - 0x0014, /* turn off dword mode */ - 0xe715, /* v blank start */ - 0x0616, /* v blank end */ - 0xe317 /* turn on byte mode */ - }; - int CRTParmCount = sizeof(CRTParms) / sizeof(CRTParms[0]); + 0x0014, /* turn off dword mode */ + 0xe715, /* v blank start */ + 0x0616, /* v blank end */ + 0xe317 /* turn on byte mode */ + }; - /* TODO save current video mode and palette */ - vgaSetMode(VGA_256_COLOR_MODE); + int CRTParmCount = sizeof(CRTParms) / sizeof(CRTParms[0]); + /* width and height */ + //TODO WWWW - /* disable chain4 mode */ - outpw(SC_INDEX, 0x0604); + /* TODO save current video mode and palette */ + vgaSetMode(VGA_256_COLOR_MODE); - /* synchronous reset while setting Misc Output */ - outpw(SC_INDEX, 0x0100); + /* disable chain4 mode */ + outpw(SC_INDEX, 0x0604); - /* select 25 MHz dot clock & 60 Hz scanning rate */ - outp(MISC_OUTPUT, 0xe3); + /* synchronous reset while setting Misc Output */ + outpw(SC_INDEX, 0x0100); - /* undo reset (restart sequencer) */ - outpw(SC_INDEX, 0x0300); + /* select 25 MHz dot clock & 60 Hz scanning rate */ + outp(MISC_OUTPUT, 0xe3); - /* reprogram the CRT controller */ - outp(CRTC_INDEX, 0x11); /* VSync End reg contains register write prot */ - outp(CRTC_DATA, 0x7f); /* get current write protect on varios regs */ + /* undo reset (restart sequencer) */ + outpw(SC_INDEX, 0x0300); - /* send the CRTParms */ - for(i=0; i