Change HTML4 entities to HTML5
< to < > to > & to &
This commit is contained in:
parent
56a4baa60e
commit
b8e7ce7165
105 changed files with 1117 additions and 1117 deletions
90
44-02.html
90
44-02.html
|
|
@ -44,10 +44,10 @@ top portion of the screen while displaying non-page flipped
|
|||
information in the split screen at the bottom of the screen.
|
||||
Compiled with Borland C++ in C compilation mode. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
#include <math.h>
|
||||
|
||||
#define SCREEN-SEG 0xA000
|
||||
#define SCREEN-PIXWIDTH 640 /* in pixels */
|
||||
|
|
@ -141,7 +141,7 @@ image BouncerRotation4 = {3, 20, -BouncerRotation4};
|
|||
/* Initial settings for bouncing object. Only 2 rotations are needed
|
||||
because the object moves 4 pixels horizontally at a time */
|
||||
bouncer Bouncer = {156,60,20,20,4,4,156,156,60,60,BOUNCER-COLOR,
|
||||
&BouncerRotation0,NULL,NULL,NULL,&BouncerRotation4,NULL,NULL,NULL};
|
||||
&BouncerRotation0,NULL,NULL,NULL,&BouncerRotation4,NULL,NULL,NULL};
|
||||
unsigned int PageStartOffsets[2] =
|
||||
{PAGE0-START-OFFSET,PAGE1-START-OFFSET};
|
||||
unsigned int BounceCount;
|
||||
|
|
@ -151,7 +151,7 @@ void main() {
|
|||
union REGS regset;
|
||||
|
||||
regset.x.ax = 0x0012; /* set display to 640x480 16-color mode */
|
||||
int86(0x10, &regset, &regset);
|
||||
int86(0x10, &regset, &regset);
|
||||
SetBIOS8x8Font(); /* set the pointer to the BIOS 8x8 font */
|
||||
EnableSplitScreen(); /* turn on the split screen */
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ void main() {
|
|||
ShowPage(PageStartOffsets[DisplayedPage = 0]);
|
||||
|
||||
/* Clear both pages to background and draw bumpers in each page */
|
||||
for (i=0; i<2; i++) {
|
||||
for (i=0; i<2; i++) {
|
||||
DrawRect(0,0,SCREEN-PIXWIDTH-1,NONSPLIT-LINES-1,BACK-COLOR,
|
||||
PageStartOffsets[i],SCREEN-SEG);
|
||||
DrawBumperList(Bumpers,NUM-BUMPERS,PageStartOffsets[i]);
|
||||
|
|
@ -170,7 +170,7 @@ void main() {
|
|||
ShowBounceCount(); /* put up the initial zero count */
|
||||
|
||||
/* Draw the bouncing object at its initial location */
|
||||
DrawImage(Bouncer.LeftX,Bouncer.TopY,&Bouncer.Rotation0,
|
||||
DrawImage(Bouncer.LeftX,Bouncer.TopY,&Bouncer.Rotation0,
|
||||
Bouncer.Color,PageStartOffsets[DisplayedPage],SCREEN-SEG);
|
||||
|
||||
/* Move the object, draw it in the nondisplayed page, and flip the
|
||||
|
|
@ -185,9 +185,9 @@ void main() {
|
|||
Bouncer.CurrentY[NonDisplayedPage]+Bouncer.Height-1,
|
||||
BACK-COLOR,PageStartOffsets[NonDisplayedPage],SCREEN-SEG);
|
||||
/* Move the bouncer */
|
||||
MoveBouncer(&Bouncer, Bumpers, NUM-BUMPERS);
|
||||
MoveBouncer(&Bouncer, Bumpers, NUM-BUMPERS);
|
||||
/* Draw at the new location in the nondisplayed page */
|
||||
DrawImage(Bouncer.LeftX,Bouncer.TopY,&Bouncer.Rotation0,
|
||||
DrawImage(Bouncer.LeftX,Bouncer.TopY,&Bouncer.Rotation0,
|
||||
Bouncer.Color,PageStartOffsets[NonDisplayedPage],
|
||||
SCREEN-SEG);
|
||||
/* Remember where the bouncer is in the nondisplayed page */
|
||||
|
|
@ -220,7 +220,7 @@ void main() {
|
|||
|
||||
/* Restore text mode and done */
|
||||
regset.x.ax = 0x0003;
|
||||
int86(0x10, &regset, &regset);
|
||||
int86(0x10, &regset, &regset);
|
||||
}
|
||||
|
||||
/* Draws the specified list of bumpers into the specified page */
|
||||
|
|
@ -229,9 +229,9 @@ void DrawBumperList(bumper * Bumpers, int NumBumpers,
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<NumBumpers; i++,Bumpers++) {
|
||||
DrawRect(Bumpers->LeftX,Bumpers->TopY,Bumpers->RightX,
|
||||
Bumpers->BottomY,Bumpers->Color,PageStartOffset,
|
||||
for (i=0; i<NumBumpers; i++,Bumpers++) {
|
||||
DrawRect(Bumpers->LeftX,Bumpers->TopY,Bumpers->RightX,
|
||||
Bumpers->BottomY,Bumpers->Color,PageStartOffset,
|
||||
SCREEN-SEG);
|
||||
}
|
||||
}
|
||||
|
|
@ -271,13 +271,13 @@ void DrawSplitScreen() {
|
|||
Overflow register, and bit 9 is in the Maximum Scan Line reg) */
|
||||
void EnableSplitScreen() {
|
||||
outp(CRTC-INDEX, LINE-COMPARE);
|
||||
outp(CRTC-DATA, (SPLIT-START-LINE - 1) & 0xFF);
|
||||
outp(CRTC-DATA, (SPLIT-START-LINE - 1) & 0xFF);
|
||||
outp(CRTC-INDEX, OVERFLOW);
|
||||
outp(CRTC-DATA, (((((SPLIT-START-LINE - 1) & 0x100) >> 8) << 4) |
|
||||
(inp(CRTC-DATA) & ~0x10)));
|
||||
outp(CRTC-DATA, (((((SPLIT-START-LINE - 1) & 0x100) >> 8) << 4) |
|
||||
(inp(CRTC-DATA) & ~0x10)));
|
||||
outp(CRTC-INDEX, MAX-SCAN);
|
||||
outp(CRTC-DATA, (((((SPLIT-START-LINE - 1) & 0x200) >> 9) << 6) |
|
||||
(inp(CRTC-DATA) & ~0x40)));
|
||||
outp(CRTC-DATA, (((((SPLIT-START-LINE - 1) & 0x200) >> 9) << 6) |
|
||||
(inp(CRTC-DATA) & ~0x40)));
|
||||
}
|
||||
|
||||
/* Moves the bouncer, bouncing if bumpers are hit */
|
||||
|
|
@ -285,37 +285,37 @@ void MoveBouncer(bouncer *Bouncer, bumper *BumperPtr, int NumBumpers) {
|
|||
int NewLeftX, NewTopY, NewRightX, NewBottomY, i;
|
||||
|
||||
/* Move to new location, bouncing if necessary */
|
||||
NewLeftX = Bouncer->LeftX + Bouncer->DirX; /* new coords */
|
||||
NewTopY = Bouncer->TopY + Bouncer->DirY;
|
||||
NewRightX = NewLeftX + Bouncer->Width - 1;
|
||||
NewBottomY = NewTopY + Bouncer->Height - 1;
|
||||
NewLeftX = Bouncer->LeftX + Bouncer->DirX; /* new coords */
|
||||
NewTopY = Bouncer->TopY + Bouncer->DirY;
|
||||
NewRightX = NewLeftX + Bouncer->Width - 1;
|
||||
NewBottomY = NewTopY + Bouncer->Height - 1;
|
||||
/* Compare the new location to all bumpers, checking for bounce */
|
||||
for (i=0; i<NumBumpers; i++,BumperPtr++) {
|
||||
for (i=0; i<NumBumpers; i++,BumperPtr++) {
|
||||
/* If moving puts the bouncer inside this bumper, bounce */
|
||||
if ( (NewLeftX <= BumperPtr->RightX) &&
|
||||
(NewRightX >= BumperPtr->LeftX) &&
|
||||
(NewTopY <= BumperPtr->BottomY) &&
|
||||
(NewBottomY >= BumperPtr->TopY) ) {
|
||||
if ( (NewLeftX <= BumperPtr->RightX) &&
|
||||
(NewRightX >= BumperPtr->LeftX) &&
|
||||
(NewTopY <= BumperPtr->BottomY) &&
|
||||
(NewBottomY >= BumperPtr->TopY) ) {
|
||||
/* The bouncer has tried to move into this bumper; figure
|
||||
out which edge(s) it crossed, and bounce accordingly */
|
||||
if (((Bouncer->LeftX > BumperPtr->RightX) &&
|
||||
(NewLeftX <= BumperPtr->RightX)) ||
|
||||
(((Bouncer->LeftX + Bouncer->Width - 1) <
|
||||
BumperPtr->LeftX) &&
|
||||
(NewRightX >= BumperPtr->LeftX))) {
|
||||
Bouncer->DirX = -Bouncer->DirX; /* bounce horizontally */
|
||||
NewLeftX = Bouncer->LeftX + Bouncer->DirX;
|
||||
if (((Bouncer->LeftX > BumperPtr->RightX) &&
|
||||
(NewLeftX <= BumperPtr->RightX)) ||
|
||||
(((Bouncer->LeftX + Bouncer->Width - 1) <
|
||||
BumperPtr->LeftX) &&
|
||||
(NewRightX >= BumperPtr->LeftX))) {
|
||||
Bouncer->DirX = -Bouncer->DirX; /* bounce horizontally */
|
||||
NewLeftX = Bouncer->LeftX + Bouncer->DirX;
|
||||
}
|
||||
if (((Bouncer->TopY > BumperPtr->BottomY) &&
|
||||
(NewTopY <= BumperPtr->BottomY)) ||
|
||||
(((Bouncer->TopY + Bouncer->Height - 1) <
|
||||
BumperPtr->TopY) &&
|
||||
(NewBottomY >= BumperPtr->TopY))) {
|
||||
Bouncer->DirY = -Bouncer->DirY; /* bounce vertically */
|
||||
NewTopY = Bouncer->TopY + Bouncer->DirY;
|
||||
if (((Bouncer->TopY > BumperPtr->BottomY) &&
|
||||
(NewTopY <= BumperPtr->BottomY)) ||
|
||||
(((Bouncer->TopY + Bouncer->Height - 1) <
|
||||
BumperPtr->TopY) &&
|
||||
(NewBottomY >= BumperPtr->TopY))) {
|
||||
Bouncer->DirY = -Bouncer->DirY; /* bounce vertically */
|
||||
NewTopY = Bouncer->TopY + Bouncer->DirY;
|
||||
}
|
||||
/* Update the bounce count display; turn over at 10000 */
|
||||
if (++BounceCount >= 10000) {
|
||||
if (++BounceCount >= 10000) {
|
||||
TextUp(“0 ”,344,64,SPLIT-START-OFFSET,SCREEN-SEG);
|
||||
BounceCount = 0;
|
||||
} else {
|
||||
|
|
@ -323,8 +323,8 @@ void MoveBouncer(bouncer *Bouncer, bumper *BumperPtr, int NumBumpers) {
|
|||
}
|
||||
}
|
||||
}
|
||||
Bouncer->LeftX = NewLeftX; /* set the final new coordinates */
|
||||
Bouncer->TopY = NewTopY;
|
||||
Bouncer->LeftX = NewLeftX; /* set the final new coordinates */
|
||||
Bouncer->TopY = NewTopY;
|
||||
}
|
||||
</PRE>
|
||||
<!-- END CODE //-->
|
||||
|
|
|
|||
Loading…
Reference in a new issue