Commit a95bbccf authored by Steven Fuller's avatar Steven Fuller

A few more cleanups to id_vl

parent 55edef7f
;
; ID_SD.EQU
; Id Sound Manager assembly equates
;
INCLUDE 'ID_VL.EQU' ; For screen color debugging stuff
; Modes
sdm_Off = 0
sdm_PC = 1
sdm_AdLib = 2
smm_Off = 0
smm_AdLib = 1
sds_Off = 0
sds_SoundSource = 1
sds_SoundBlaster = 2
; Stuff for the PC speaker
pcTimer = 42h
pcTAccess = 43h
pcSpeaker = 61h
pcSpkBits = 3
; Stuff for the AdLib
; Operator registers
alChar = 20h
alScale = 40h
alAttack = 60h
alSus = 80h
alWave = 0e0h
; Channel registers
alFreqL = 0a0h
alFreqH = 0b0h
alFeedCon = 0c0h
; Global registers
alEffects = 0bdh
......@@ -5,11 +5,6 @@
unsigned bufferofs;
unsigned displayofs;
unsigned screenseg=SCREENSEG; // set to 0xa000 for asm convenience
unsigned linewidth;
unsigned ylookup[MAXSCANLINES];
boolean screenfaded;
byte palette1[256][3], palette2[256][3];
......
; ID_VL.EQU
SC_INDEX = 03C4h
SC_RESET = 0
SC_CLOCK = 1
SC_MAPMASK = 2
SC_CHARMAP = 3
SC_MEMMODE = 4
CRTC_INDEX = 03D4h
CRTC_H_TOTAL = 0
CRTC_H_DISPEND = 1
CRTC_H_BLANK = 2
CRTC_H_ENDBLANK = 3
CRTC_H_RETRACE = 4
CRTC_H_ENDRETRACE = 5
CRTC_V_TOTAL = 6
CRTC_OVERFLOW = 7
CRTC_ROWSCAN = 8
CRTC_MAXSCANLINE = 9
CRTC_CURSORSTART = 10
CRTC_CURSOREND = 11
CRTC_STARTHIGH = 12
CRTC_STARTLOW = 13
CRTC_CURSORHIGH = 14
CRTC_CURSORLOW = 15
CRTC_V_RETRACE = 16
CRTC_V_ENDRETRACE = 17
CRTC_V_DISPEND = 18
CRTC_OFFSET = 19
CRTC_UNDERLINE = 20
CRTC_V_BLANK = 21
CRTC_V_ENDBLANK = 22
CRTC_MODE = 23
CRTC_LINECOMPARE = 24
GC_INDEX = 03CEh
GC_SETRESET = 0
GC_ENABLESETRESET = 1
GC_COLORCOMPARE = 2
GC_DATAROTATE = 3
GC_READMAP = 4
GC_MODE = 5
GC_MISCELLANEOUS = 6
GC_COLORDONTCARE = 7
GC_BITMASK = 8
ATR_INDEX = 03c0h
ATR_MODE = 16
ATR_OVERSCAN = 17
ATR_COLORPLANEENABLE = 18
ATR_PELPAN = 19
ATR_COLORSELECT = 20
STATUS_REGISTER_1 = 03dah
#ifndef __ID_VL_H__
#define __ID_VL_H__
#define SC_INDEX 0x3C4
#define SC_RESET 0
#define SC_CLOCK 1
#define SC_MAPMASK 2
#define SC_CHARMAP 3
#define SC_MEMMODE 4
#define CRTC_INDEX 0x3D4
#define CRTC_H_TOTAL 0
#define CRTC_H_DISPEND 1
#define CRTC_H_BLANK 2
#define CRTC_H_ENDBLANK 3
#define CRTC_H_RETRACE 4
#define CRTC_H_ENDRETRACE 5
#define CRTC_V_TOTAL 6
#define CRTC_OVERFLOW 7
#define CRTC_ROWSCAN 8
#define CRTC_MAXSCANLINE 9
#define CRTC_CURSORSTART 10
#define CRTC_CURSOREND 11
#define CRTC_STARTHIGH 12
#define CRTC_STARTLOW 13
#define CRTC_CURSORHIGH 14
#define CRTC_CURSORLOW 15
#define CRTC_V_RETRACE 16
#define CRTC_V_ENDRETRACE 17
#define CRTC_V_DISPEND 18
#define CRTC_OFFSET 19
#define CRTC_UNDERLINE 20
#define CRTC_V_BLANK 21
#define CRTC_V_ENDBLANK 22
#define CRTC_MODE 23
#define CRTC_LINECOMPARE 24
#define GC_INDEX 0x3CE
#define GC_SETRESET 0
#define GC_ENABLESETRESET 1
#define GC_COLORCOMPARE 2
#define GC_DATAROTATE 3
#define GC_READMAP 4
#define GC_MODE 5
#define GC_MISCELLANEOUS 6
#define GC_COLORDONTCARE 7
#define GC_BITMASK 8
#define ATR_INDEX 0x3c0
#define ATR_MODE 16
#define ATR_OVERSCAN 17
#define ATR_COLORPLANEENABLE 18
#define ATR_PELPAN 19
#define ATR_COLORSELECT 20
#define STATUS_REGISTER_1 0x3da
#define PEL_WRITE_ADR 0x3c8
#define PEL_READ_ADR 0x3c7
#define PEL_DATA 0x3c9
//===========================================================================
#define SCREENSEG 0xa000
#define SCREENWIDTH 80 // default screen width in bytes
#define MAXSCANLINES 200 // size of ylookup table
#define TILEWIDTH 4
......@@ -77,50 +14,16 @@ extern byte *gfxbuf;
extern unsigned bufferofs; // all drawing is reletive to this
extern unsigned displayofs; // last setscreen coordinates
extern unsigned screenseg; // set to 0xa000 for asm convenience
extern unsigned linewidth;
extern unsigned ylookup[MAXSCANLINES];
extern boolean screenfaded;
//===========================================================================
//
// VGA hardware routines
//
#define VGAWRITEMODE(x) asm{\
cli;\
mov dx,GC_INDEX;\
mov al,GC_MODE;\
out dx,al;\
inc dx;\
in al,dx;\
and al,252;\
or al,x;\
out dx,al;\
sti;}
#define VGAMAPMASK(x) asm{cli;mov dx,SC_INDEX;mov al,SC_MAPMASK;mov ah,x;out dx,ax;sti;}
#define VGAREADMAP(x) asm{cli;mov dx,GC_INDEX;mov al,GC_READMAP;mov ah,x;out dx,ax;sti;}
void VL_Startup (void);
void VL_Shutdown (void);
void VL_SetVGAPlane (void);
void VL_SetTextMode (void);
void VL_DePlaneVGA (void);
void VL_SetVGAPlaneMode (void);
void VL_ClearVideo (byte color);
void VL_SetLineWidth (unsigned width);
void VL_SetSplitScreen (int linenum);
void VL_WaitVBL (int vbls);
void VL_CrtcStart (int crtc);
void VL_SetScreen (int crtc, int pelpan);
void VL_FillPalette (int red, int green, int blue);
void VL_SetColor (int color, int red, int green, int blue);
......@@ -145,8 +48,6 @@ void VL_MemToScreen (byte *source, int width, int height, int x, int y);
void VL_DrawPropString (char *str, unsigned tile8ptr, int printx, int printy);
void VL_SizePropString (char *str, int *width, int *height, char *font);
void VL_TestPaletteSet (void);
#elif
#error "fix me: TODO"
#endif
// WL_DEBUG.C
/* wl_debug.c */
#include "WL_DEF.H"
#pragma hdrstop
#include <BIOS.H>
#include "wl_def.h"
/*
=============================================================================
......@@ -154,50 +152,23 @@ void PicturePause (void)
}
VW_ColorBorder (1);
VW_SetScreen (0,0);
//
// vga stuff...
//
ClearMemory ();
CA_SetAllPurge();
MM_GetPtr (&buffer,64000);
for (p=0;p<4;p++)
{
src = MK_FP(0xa000,displayofs);
dest = (byte *)buffer+p;
VGAREADMAP(p);
for (x=0;x<16000;x++,dest+=4)
*dest = *src++;
}
#if 0
for (p=0;p<4;p++)
{
src = MK_FP(0xa000,0);
dest = (byte *)buffer+51200+p;
VGAREADMAP(p);
for (x=0;x<3200;x++,dest+=4)
*dest = *src++;
}
#endif
asm mov ax,0x13
asm int 0x10
dest = MK_FP(0xa000,0);
_fmemcpy (dest,buffer,64000);
/* TODO: save picture to file */
VL_SetPalette (&gamepal);
IN_Shutdown ();
VW_WaitVBL(70);
bioskey(0);
VW_WaitVBL(70);
Quit (NULL);
Quit(NULL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment