Runge-Kutta-Simulation/AppleX/GRAPHICS/HIBASE.C
2015-02-11 19:34:08 +01:00

53 lines
1.4 KiB
C
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ------------------------------------------------------------------------
System : Manx Aztec C65 Version 3.2b
MS-DOS cross-development environment
Platform : Apple IIe 128K PRODOS 8
Program : hibase2.c
Description : G2 Library Routine
Written by : Bill Buckels
Revision Date: March 3, 1991
Licence : You may use this code for whatever you wish as long
as you agree that Bill Buckels has no warranty or
liability obligations whatsoever from said use.
------------------------------------------------------------------------ */
/* use hibase2.c instead... this routine was modified from
the original aztec C library but it is too processor intensive
for real purposes... a table works best despite the larger
data segment... see hibase2.c */
/* provides base address for page2 hires scanlines */
/* does not bother to check whether we are in range */
/* gets the address as quickly as possible */
/* stays away from processor intensive mul and div */
gethibase(currentline,currentbase)
int currentline;
int *currentbase;
{
int ybase=0x4000,z,a;
if(currentline >63)
{
if (currentline < 128)
{
ybase+=0x28;
currentline-=64;
}
else
{
ybase+=0x50;
currentline-=128;
}
}
z=(currentline>>3);
a = (z<<7)|ybase;
*currentbase = (currentline - (z<<3))<<10 | a;
}