mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-08-22 23:17:24 -04:00
adjust several exit states
This commit is contained in:
parent
a71850368d
commit
4211f044ed
5 changed files with 5 additions and 102 deletions
|
@ -174,7 +174,7 @@ static void error(const char *text)
|
||||||
SEND_LOG("(ERROR) %s : %s",popis,text);
|
SEND_LOG("(ERROR) %s : %s",popis,text);
|
||||||
closemode();
|
closemode();
|
||||||
display_error(popis);
|
display_error(popis);
|
||||||
exit(0);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ex_error(char znak)
|
static void ex_error(char znak)
|
||||||
|
|
|
@ -171,7 +171,7 @@ void load_items()
|
||||||
{
|
{
|
||||||
closemode();
|
closemode();
|
||||||
display_error("Selhalo otevreni souboru ITEMS.DAT. Zkotroluj zda vubec existuje.");
|
display_error("Selhalo otevreni souboru ITEMS.DAT. Zkotroluj zda vubec existuje.");
|
||||||
exit(0);
|
exit(1);
|
||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -966,7 +966,7 @@ void definuj_postavy()
|
||||||
{
|
{
|
||||||
closemode();
|
closemode();
|
||||||
display_error("Error in file POSTAVY.DAT. May be missing a parameter in some definition.");
|
display_error("Error in file POSTAVY.DAT. May be missing a parameter in some definition.");
|
||||||
exit(0);
|
exit(1);
|
||||||
}
|
}
|
||||||
c=strchr(c,'\n')+1;
|
c=strchr(c,'\n')+1;
|
||||||
prepocitat_postavu(p);
|
prepocitat_postavu(p);
|
||||||
|
|
|
@ -430,7 +430,7 @@ int load_map(const char *filename)
|
||||||
{
|
{
|
||||||
closemode();
|
closemode();
|
||||||
display_error("Bug in temp file. Please purge some status blocks in last load savegame file.");
|
display_error("Bug in temp file. Please purge some status blocks in last load savegame file.");
|
||||||
exit(0);
|
exit(1);
|
||||||
}
|
}
|
||||||
doNotLoadMapState=0;
|
doNotLoadMapState=0;
|
||||||
current_map_hash = fnv1a_hash(filename);
|
current_map_hash = fnv1a_hash(filename);
|
||||||
|
|
|
@ -1,98 +0,0 @@
|
||||||
#include "types.h"
|
|
||||||
#include <vesa.h>
|
|
||||||
#include <dpmi.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
#include "bgraph.h"
|
|
||||||
#include <i86.h>
|
|
||||||
|
|
||||||
MODEinfo vesadata;
|
|
||||||
word lastbank=0;
|
|
||||||
|
|
||||||
word *mapvesaadr(word *a);
|
|
||||||
#pragma aux mapvesaadr parm [edi] value [edi]
|
|
||||||
|
|
||||||
void showview32b(word x,word y,word xs,word ys)
|
|
||||||
{
|
|
||||||
register longint a;
|
|
||||||
|
|
||||||
if (x>640 || y>480) return;
|
|
||||||
if (xs==0) xs=640;
|
|
||||||
if (ys==0) ys=480;
|
|
||||||
if (x+xs>640) xs=640-x;
|
|
||||||
if (y+ys>480) ys=480-y;
|
|
||||||
if (xs>550 && ys>400)
|
|
||||||
{
|
|
||||||
redraw32b(screen,lbuffer,NULL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
a=(x<<1)+linelen*y;
|
|
||||||
redrawbox32b(xs,ys,(void *)((char *)screen+a),(void *)a);
|
|
||||||
}
|
|
||||||
|
|
||||||
int initmode32b()
|
|
||||||
{
|
|
||||||
getmodeinfo(&vesadata,0x110);
|
|
||||||
if (!(vesadata.modeattr & MA_SUPP)) return -1;
|
|
||||||
setvesamode(0x110,-1);
|
|
||||||
lbuffer=(word *)0xa0000;
|
|
||||||
screen=lbuffer;
|
|
||||||
linelen=640*2;
|
|
||||||
showview=showview32b;
|
|
||||||
screen=(void *)malloc(screen_buffer_size);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
word *mapvesaadr1(word *a)
|
|
||||||
{
|
|
||||||
word bank;
|
|
||||||
|
|
||||||
bank=(int32_t)a>>16;
|
|
||||||
if (bank!=lastbank)
|
|
||||||
{
|
|
||||||
lastbank=bank;
|
|
||||||
bank=bank;
|
|
||||||
{
|
|
||||||
union REGS regs;
|
|
||||||
regs.w.ax = 0x4f05;
|
|
||||||
regs.w.bx = 0;
|
|
||||||
regs.w.dx = bank;
|
|
||||||
int386 (0x10,®s,®s); // window A
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (word *)(((int32_t)a & 0xffff)+0xa0000);
|
|
||||||
}
|
|
||||||
|
|
||||||
void switchvesabank(word bank)
|
|
||||||
#pragma aux switchvesabank parm [eax]
|
|
||||||
{
|
|
||||||
union REGS regs;
|
|
||||||
regs.w.ax = 0x4f05;
|
|
||||||
regs.w.bx = 0;
|
|
||||||
regs.w.dx = bank;
|
|
||||||
int386 (0x10,®s,®s); // window A
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void vesatst()
|
|
||||||
{
|
|
||||||
int i,j;
|
|
||||||
word *a;
|
|
||||||
|
|
||||||
a=screen;
|
|
||||||
for (i=0;i<480;i++)
|
|
||||||
for(j=i;j<i+640;j++)
|
|
||||||
*(a++)=i+j;
|
|
||||||
showview(10,10,400,300);
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
initmode32b();
|
|
||||||
getchar();
|
|
||||||
vesatst();
|
|
||||||
getchar();
|
|
||||||
}
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ int main(int argc, char **argv) {
|
||||||
cfg.short_help = show_help_short;
|
cfg.short_help = show_help_short;
|
||||||
cfg.show_error = [](const char *txt) {
|
cfg.show_error = [](const char *txt) {
|
||||||
std::cerr << "ERROR: " << txt << std::endl;
|
std::cerr << "ERROR: " << txt << std::endl;
|
||||||
|
abort();
|
||||||
};
|
};
|
||||||
cfg.adventure_path = adv_config_file.empty()?NULL:adv_config_file.c_str();
|
cfg.adventure_path = adv_config_file.empty()?NULL:adv_config_file.c_str();
|
||||||
cfg.config_path = config_name.c_str();
|
cfg.config_path = config_name.c_str();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue