The unified diff between revisions [afdbb938..] and [76aea49e..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'src/lsi/vm.c'

#
# old_revision [afdbb9388305ae66464ad4acb0437922656e3059]
# new_revision [76aea49e8393c839b573eaac31eb8e2fb218d2d6]
#
# patch "src/lsi/vm.c"
#  from [bbb6e957a3bbc5fa4906c581c044dea5085cd39e]
#    to [2f4df836fac21746563e434768e4f832c1ea3e15]
#
============================================================
--- src/lsi/vm.c	bbb6e957a3bbc5fa4906c581c044dea5085cd39e
+++ src/lsi/vm.c	2f4df836fac21746563e434768e4f832c1ea3e15
@@ -67,79 +67,15 @@ struct hashentry *arrayhash[HASHSIZE];
 
 #define GLOB_MAXNAMELEN	1024
 
-int vm_intfn_nop(void);
-int vm_intfn_global_store(void);
-int vm_intfn_global_load(void);
-int vm_intfn_global_array_store(void);
-int vm_intfn_global_array_load(void);
-int vm_intfn_printint(void);
-int vm_intfn_printreal(void);
-int vm_intfn_printstr(void);
-int vm_intfn_dmxsetchannel(void);
-int vm_intfn_dmxoutput(void);
-int vm_intfn_gettime(void);
-int vm_intfn_waittime(void);
-int vm_intfn_wait(void);
-int vm_intfn_wakeup(void);
-int vm_intfn_spawn(void);
-int vm_intfn_midi_read(void);
-int vm_intfn_beatdetect_read(void);
-int vm_intfn_beatdetect_phase(void);
-int vm_intfn_beatdetect_confidence(void);
-int vm_intfn_realtoint(void);
-int vm_intfn_inttoreal(void);
-int vm_intfn_map3d_setcal(void);
-int vm_intfn_map3d_calibrate(void);
-int vm_intfn_map3d_transform(void);
-int vm_intfn_map3d_setparams(void);
-int vm_intfn_map3d_load(void);
-int vm_intfn_map3d_save(void);
-int vm_intfn_sin(void);
-int vm_intfn_cos(void);
-int vm_intfn_random(void);
-int vm_intfn_mouse_read(void);
 void vm_destroy(struct vm_thread *);
 void vm_unqueue(struct vm_thread *);
 void vm_queue(struct vm_thread *, int);
 
-typedef int (*vm_intfn)(void);
+#include "abi.h"
 
-vm_intfn vm_intfn_table[] = {
-	vm_intfn_nop,
-	vm_intfn_global_store,
-	vm_intfn_global_load,
-	vm_intfn_global_array_store,
-	vm_intfn_global_array_load,
-	vm_intfn_printint,
-	vm_intfn_printreal,
-	vm_intfn_printstr,
-	vm_intfn_dmxsetchannel,
-	vm_intfn_dmxoutput,
-	vm_intfn_gettime,
-	vm_intfn_waittime,
-	vm_intfn_wait,
-	vm_intfn_wakeup,
-	vm_intfn_spawn,
-	vm_intfn_midi_read,
-	vm_intfn_beatdetect_read,
-	vm_intfn_beatdetect_phase,
-	vm_intfn_beatdetect_confidence,
-	vm_intfn_realtoint,
-	vm_intfn_inttoreal,
-	vm_intfn_map3d_setcal,
-	vm_intfn_map3d_calibrate,
-	vm_intfn_map3d_transform,
-	vm_intfn_map3d_setparams,
-	vm_intfn_map3d_load,
-	vm_intfn_map3d_save,
-	vm_intfn_sin,
-	vm_intfn_cos,
-	vm_intfn_random,
-	vm_intfn_mouse_read,
-};
+extern vm_intfn vm_intfn_table[];
+extern const int vm_intfn_size;
 
-const int vm_intfn_size = sizeof(vm_intfn_table) / sizeof(vm_intfn);
-
 void stack_push(struct vm_thread *thread, stkentry e);
 void stack_pop(struct vm_thread *thread, int count);
 stkentry stack_get(struct vm_thread *thread, int count);
@@ -148,7 +84,7 @@ void stack_pokereal(struct vm_thread *th
 void stack_poke(struct vm_thread *thread, int count, stkentry value);
 void stack_pokereal(struct vm_thread *thread, int count, float value);
 
-int vm_intfn_nop(void)
+int vm_intfn___nop(void)
 {
 	/* Do nothing */
 	return 1;
@@ -159,7 +95,7 @@ int vm_intfn_nop(void)
  * The compiler does not allocate space for a return value.
  * They also change the stack pointer.
  */
-int vm_intfn_global_store(void)
+int vm_intfn___global_store(void)
 {
 	int len, next, value;
 	struct hashentry *hashptr;
@@ -194,7 +130,7 @@ gstoreout:
 	return 1;
 }
 
-int vm_intfn_global_load(void)
+int vm_intfn___global_load(void)
 {
 	int len, next, value;
 	struct hashentry *hashptr;
@@ -227,7 +163,7 @@ gloadout:
 	return 1;
 }
 
-int vm_intfn_global_array_store(void)
+int vm_intfn___global_array_store(void)
 {
 	int len, next, value, index;
 	struct hashentry *hashptr;
@@ -274,7 +210,7 @@ gstorearrayout:
 	return 1;
 }
 
-int vm_intfn_global_array_load(void)
+int vm_intfn___global_array_load(void)
 {
 	int len, next, value, index;
 	struct hashentry *hashptr;
@@ -673,6 +609,11 @@ void vm_init_functions(void)
 	assert(vm_codearea[2] == VERSION1);
 	assert(vm_codearea[3] == VERSION2);
 
+	assert(GETINT(vm_codearea, 8) == vm_abiversion1);
+	assert(GETINT(vm_codearea, 12) == vm_abiversion2);
+	assert(GETINT(vm_codearea, 16) == vm_abiversion3);
+	assert(GETINT(vm_codearea, 20) == vm_abiversion4);
+	assert(GETINT(vm_codearea, 24) == vm_abiversion5);
 
 	/* Now, get the function table pointer */
 	t = GETINT(vm_codearea, 4);