Some of you may know I go waaaaaay back programming stuff on the ZX81 right upto to todays monster machines (compared to the ZX81 ;) ) well after dredging up the old source code I have I found some stuff I thought I lost, this was written in C with assembly for speed and was amazing at what it did heres a small snippet:
void VGAinit ()
{
asm mov ah,0
asm mov al,0x13
asm int 0x10
Screen2=(unsigned char *)malloc(64000);
if (Screen2==NULL){
printf("Video memory error\n\n");
exit(0);
}
Buffer = Screen2;
}
void SVGAinit (unsigned char mode)
{
asm mov ah,0
asm mov al,mode
asm int 0x10
Screen2=(unsigned char *)malloc(307200);
if (Screen2==NULL){
printf("Video memory error\n\n");
exit(0);
}
Buffer = Screen2;
}
//This resets the display to text mode
void Textinit ()
{
asm mov ah,0
asm mov al,0x03
asm int 0x10
free(Screen2);
}
Basically all this does is set the graphics mode either VGA or SVGA and text mode when you want to exit back to MS-DOS, its amazing how everything has changed (not always for the best eh). These files date back to 1993. Man now I feel old ;)
More soon...
More oldies code:
void mouseon(void)
{
asm{
mov ax, 0x0001
int 0x33
}
}
void mouseoff(void)
{
asm{
mov ax, 0x0002
int 0x33
}
}
unsigned char resetmouse(void){
unsigned int mouse_type;
unsigned int driver_status;
unsigned char return_value;
asm{
mov ax, 0x0000
int 0x33
mov driver_status, ax
mov mouse_type, bx
}
if (driver_status==0xFFFF) {
switch (mouse_type) {
case 0x0000: return_value = 0; break;//1
case 0x0002: return_value = 2; break;//2
case 0x0003: return_value = 3; break;//3
case 0xFFFF: return_value = 4; break;//?
}
}else{
printf("Error:No mouse detected\n");//duff
printf("\nDRACOS requires a mouse to function correctly with the correct driver\n\n");
exit(0);
}
return return_value;
}
int mouseinfo(int rd)
{
in.r_ax = 3;
intr(0x33, &in);
switch(rd){
case 1 : return(in.r_cx);
case 2 : return(in.r_dx);
case 3 : return(in.r_bx & 1); //left button
case 4 : return(in.r_bx & 2); //right button
case 5 : return(in.r_bx & 4); //middle button
}
return(-1);
}
Basically this does all the mouse routines to get details from my mouse driver :D
DISCLAIMER:Although I have used these routines for years I cannot guarantee that they will work as intended on every operating system and computer configuration out there, the risk of their use is the users in its entirety, neither myself, Emm or Graveyard Dogs will be held responsible from their use.
Okay for all those who are using bootcamp with a mac and keep 'losing the wifi' connection its not a hardware issue its a driver issue. I would recommend looking on www.x-drivers.com for your driver model relevant to your mac and download and install it. Bootcamp's drivers arent 100% perfect and sometimes after an hour or so of continuous use drop out every five minutes after I installed the windows drivers its ok again :D
Showing posts with label MS-DOS. Show all posts
Showing posts with label MS-DOS. Show all posts
Thursday, 3 May 2012
Digging up old relics...
Labels:
assembly,
broadcom,
mac mini drivers,
MS-DOS,
wifi
Thursday, 5 April 2012
Adding polish as we go...
Today I have been looking at major sections of the game engine and completing some sections, some of these have been quite fun to complete others have been laborious and taxing. However not to be disheartened I have got loads completed on the game front and it edges closer and closer to completion and release.
Since our last entry I have added the following;
1) CLI - yeah the CLI was removed in favour of a GUI based system for people playing the game on joysticks so everything is to hand but there is now a new 'Hardcore Hacker' mode where the CLI replaces all the GUI elements on the terminal screens and is quite fun to use providing you know what your way around things like MS-DOS or Terminal. I have completed the hacker system for that section now so thats one thing off the list, the only terminal thing to check is GUI downloading of logs then that will be a go (this hasnt been completed as I am waiting to discuss with Emm what each level will be so I can make appropriate log entries for each area).
2) Shadows - now they are cast by walls, aliens, chairs, tables, doors everything and they look amazing. I do really like the new look shadow system and it complements the game perfectly.
3) Extra stuff for player - I have given him another clip as ammo was a bit scarce I will add more ammo as the time goes on along with all the items that are in the game items section ;)
Quite a lot of the stuff is behind the scenes coding stuff, these are simply things you will never ever see that keep the game running smoothly. One major test I do for any game is quite simply I start the game and go into it then leave the computer on for 24 hours. If the game is running stuff after then im happy, this may sound strange to you BUT quite a few games these days crash after a few hours so if our game runs for a whole day then its fine :). If it crashes however I will fix the crash and try again. If the game isnt to my liking I will change something and make it more efficient one such thing was the renderer, it has gone through about five to eight revisions to get to where it is now. The lighting alone has gone through five (mainly thanks to Emm changing it all the time ;) ).
Well onwards and upwards...
More soon...
Since our last entry I have added the following;
1) CLI - yeah the CLI was removed in favour of a GUI based system for people playing the game on joysticks so everything is to hand but there is now a new 'Hardcore Hacker' mode where the CLI replaces all the GUI elements on the terminal screens and is quite fun to use providing you know what your way around things like MS-DOS or Terminal. I have completed the hacker system for that section now so thats one thing off the list, the only terminal thing to check is GUI downloading of logs then that will be a go (this hasnt been completed as I am waiting to discuss with Emm what each level will be so I can make appropriate log entries for each area).
2) Shadows - now they are cast by walls, aliens, chairs, tables, doors everything and they look amazing. I do really like the new look shadow system and it complements the game perfectly.
3) Extra stuff for player - I have given him another clip as ammo was a bit scarce I will add more ammo as the time goes on along with all the items that are in the game items section ;)
Quite a lot of the stuff is behind the scenes coding stuff, these are simply things you will never ever see that keep the game running smoothly. One major test I do for any game is quite simply I start the game and go into it then leave the computer on for 24 hours. If the game is running stuff after then im happy, this may sound strange to you BUT quite a few games these days crash after a few hours so if our game runs for a whole day then its fine :). If it crashes however I will fix the crash and try again. If the game isnt to my liking I will change something and make it more efficient one such thing was the renderer, it has gone through about five to eight revisions to get to where it is now. The lighting alone has gone through five (mainly thanks to Emm changing it all the time ;) ).
Well onwards and upwards...
More soon...
Subscribe to:
Posts (Atom)