Free Hero Mesh

Check-in [59319cbd25]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview
Comment:Correct some errors in exec.c introduced in the previous commit
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59319cbd25aa072a0b01df20684b55e61bacc07e
User & Date: user on 2018-07-02 21:27:07
Other Links: manifest | tags
Context
2018-07-08
00:13
Add some more stuff with graphics and some other stuff that was previously forgotten check-in: c5926b50b9 user: user tags: trunk
2018-07-02
21:27
Correct some errors in exec.c introduced in the previous commit check-in: 59319cbd25 user: user tags: trunk
21:24
Implement creating new objects and linking objects into the playfield (program execution is only started a bit and is not even nearly close to being written enough yet) check-in: d872cd754a user: user tags: trunk
Changes

Modified exec.c from [40d4351374] to [61678b6bb7].

1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
#if 0
gcc ${CFLAGS:--s -O2} -c exec.c `sdl-config --cflags`
exit
#endif

#include "SDL.h"
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sqlite3.h"
#include "smallxrm.h"
#include "heromesh.h"


Uint32 generation_number;
Object**objects;
Uint32 nobjects;
Value globals[0x800];
Uint32 firstobj=VOIDLINK;
Uint32 lastobj=VOIDLINK;













>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#if 0
gcc ${CFLAGS:--s -O2} -c exec.c `sdl-config --cflags`
exit
#endif

#include "SDL.h"
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sqlite3.h"
#include "smallxrm.h"
#include "heromesh.h"
#include "instruc.h"

Uint32 generation_number;
Object**objects;
Uint32 nobjects;
Value globals[0x800];
Uint32 firstobj=VOIDLINK;
Uint32 lastobj=VOIDLINK;
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
    case OP_RET: return;
    default: Throw("Internal error: Unrecognized opcode");
  }
}

static Value send_message(Uint32 from,Uint32 to,Uint16 msg,Value arg1,Value arg2,Value arg3) {
  MessageVars saved=msgvars;
  Uint16 c=classes[objects[to]->class];
  Uint16 p=get_message_ptr(c,msg);
  Uint16*code;
  if(p==0xFFFF) {
    p=get_message_ptr(0,msg);
    if(!p) return NVALUE(0);
    code=classes[0]->codes;
  } else {
    code=classes[c]->codes;
  }
  
  msgvars={msg,from,arg1,arg2,arg3};
  execute_program(code,p,to);
  msgvars=saved;
  
}

void annihilate(void) {
  Uint32 i;







|










|







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
    case OP_RET: return;
    default: Throw("Internal error: Unrecognized opcode");
  }
}

static Value send_message(Uint32 from,Uint32 to,Uint16 msg,Value arg1,Value arg2,Value arg3) {
  MessageVars saved=msgvars;
  Uint16 c=objects[to]->class;
  Uint16 p=get_message_ptr(c,msg);
  Uint16*code;
  if(p==0xFFFF) {
    p=get_message_ptr(0,msg);
    if(!p) return NVALUE(0);
    code=classes[0]->codes;
  } else {
    code=classes[c]->codes;
  }
  
  msgvars=(MessageVars){msg,from,arg1,arg2,arg3};
  execute_program(code,p,to);
  msgvars=saved;
  
}

void annihilate(void) {
  Uint32 i;