[Scummvm-cvs-logs] SF.net SVN: scummvm:[38961] scummvm/trunk/engines/sci/engine
jvprat at users.sourceforge.net
jvprat at users.sourceforge.net
Sat Feb 28 12:13:00 CET 2009
Revision: 38961
http://scummvm.svn.sourceforge.net/scummvm/?rev=38961&view=rev
Author: jvprat
Date: 2009-02-28 11:12:59 +0000 (Sat, 28 Feb 2009)
Log Message:
-----------
SCI: Renamed some kernel types and general cleanup
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/engine/gc.cpp
scummvm/trunk/engines/sci/engine/heapmgr.h
scummvm/trunk/engines/sci/engine/kernel.cpp
scummvm/trunk/engines/sci/engine/kernel.h
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/engine/klists.cpp
scummvm/trunk/engines/sci/engine/kmovement.cpp
scummvm/trunk/engines/sci/engine/kpathing.cpp
scummvm/trunk/engines/sci/engine/kscripts.cpp
scummvm/trunk/engines/sci/engine/kstring.cpp
scummvm/trunk/engines/sci/engine/message.cpp
scummvm/trunk/engines/sci/engine/message.h
scummvm/trunk/engines/sci/engine/savegame.cfsml
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/engine/script.h
scummvm/trunk/engines/sci/engine/scriptconsole.cpp
scummvm/trunk/engines/sci/engine/scriptdebug.cpp
scummvm/trunk/engines/sci/engine/seg_manager.cpp
scummvm/trunk/engines/sci/engine/seg_manager.h
scummvm/trunk/engines/sci/engine/state.h
scummvm/trunk/engines/sci/engine/vm.cpp
scummvm/trunk/engines/sci/engine/vm.h
scummvm/trunk/engines/sci/engine/vm_types.h
Removed Paths:
-------------
scummvm/trunk/engines/sci/engine/heap.cpp
scummvm/trunk/engines/sci/engine/heap.h
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -37,7 +37,7 @@
namespace Sci {
// Structures and data from vm.c:
-extern calls_struct_t *send_calls;
+extern CallsStruct *send_calls;
extern int send_calls_allocated;
extern int bp_flag;
@@ -314,7 +314,7 @@
else
s->classtable_size = vocab996->size >> 2;
- s->classtable = (class_t*)sci_calloc(sizeof(class_t), s->classtable_size);
+ s->classtable = (Class*)sci_calloc(sizeof(Class), s->classtable_size);
for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
resource_t *heap = scir_find_resource(s->resmgr, sci_heap, scriptnr, 0);
@@ -335,9 +335,9 @@
return 1;
}
- s->classtable = (class_t*)sci_realloc(s->classtable, sizeof(class_t) * (classnr + 1));
+ s->classtable = (Class*)sci_realloc(s->classtable, sizeof(Class) * (classnr + 1));
// Clear after resize
- memset(&(s->classtable[s->classtable_size]), 0, sizeof(class_t) * (1 + classnr - s->classtable_size));
+ memset(&(s->classtable[s->classtable_size]), 0, sizeof(Class) * (1 + classnr - s->classtable_size));
s->classtable_size = classnr + 1; // Adjust maximum number of entries
}
@@ -369,7 +369,7 @@
else
s->classtable_size = vocab996->size >> 2;
- s->classtable = (class_t*)sci_calloc(sizeof(class_t), s->classtable_size);
+ s->classtable = (Class*)sci_calloc(sizeof(Class), s->classtable_size);
for (scriptnr = 0; scriptnr < 1000; scriptnr++) {
int objtype = 0;
@@ -409,9 +409,9 @@
return 1;
}
- s->classtable = (class_t*)sci_realloc(s->classtable, sizeof(class_t) * (classnr + 1));
+ s->classtable = (Class*)sci_realloc(s->classtable, sizeof(Class) * (classnr + 1));
// Clear after resize
- memset(&(s->classtable[s->classtable_size]), 0, sizeof(class_t) * (1 + classnr - s->classtable_size));
+ memset(&(s->classtable[s->classtable_size]), 0, sizeof(Class) * (1 + classnr - s->classtable_size));
s->classtable_size = classnr + 1; // Adjust maximum number of entries
}
@@ -559,7 +559,7 @@
}
void script_free_breakpoints(EngineState *s) {
- breakpoint_t *bp, *bp_next;
+ Breakpoint *bp, *bp_next;
// Free breakpoint list
bp = s->bp_list;
@@ -602,7 +602,7 @@
if (!send_calls_allocated) {
send_calls_allocated = 16;
- send_calls = (calls_struct_t*)sci_calloc(sizeof(calls_struct_t), send_calls_allocated);
+ send_calls = (CallsStruct*)sci_calloc(sizeof(CallsStruct), send_calls_allocated);
}
if (s->gfx_state && _reset_graphics_input(s))
Modified: scummvm/trunk/engines/sci/engine/gc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/gc.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/gc.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -153,7 +153,7 @@
// Init: Value Stack
// We do this one by hand since the stack doesn't know the current execution stack
{
- exec_stack_t *xs = s->execution_stack + s->execution_stack_pos;
+ ExecStack *xs = s->execution_stack + s->execution_stack_pos;
reg_t *pos;
for (pos = s->stack_base; pos < xs->sp; pos++)
@@ -165,7 +165,7 @@
// Init: Execution Stack
for (i = 0; i <= s->execution_stack_pos; i++) {
- exec_stack_t *es = s->execution_stack + i;
+ ExecStack *es = s->execution_stack + i;
if (es->type != EXEC_STACK_TYPE_KERNEL) {
worklist_push(&worklist, nonnormal_map, es->objp);
@@ -182,7 +182,7 @@
for (i = 1; i < sm->heap_size; i++)
if (interfaces[i]
&& interfaces[i]->getType() == MEM_OBJ_SCRIPT) {
- script_t *script = &(interfaces[i]->getMobj()->data.script);
+ Script *script = &(interfaces[i]->getMobj()->data.script);
if (script->lockers) { // Explicitly loaded?
int obj_nr;
@@ -192,7 +192,7 @@
// All objects (may be classes, may be indirectly reachable)
for (obj_nr = 0; obj_nr < script->objects_nr; obj_nr++) {
- object_t *obj = script->objects + obj_nr;
+ Object *obj = script->objects + obj_nr;
worklist_push(&worklist, nonnormal_map, obj->pos);
}
}
Deleted: scummvm/trunk/engines/sci/engine/heap.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/heap.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/heap.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -1,286 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "sci/engine/state.h"
-#include "sci/scicore/sciconsole.h"
-#include "sci/engine/heap.h"
-
-namespace Sci {
-
-#define assert_in_range(pos) assert(pos >= 1000 && pos <= 0xffff)
-
-static void set_size(heap_t *h, int block_pos, int size) {
- assert_in_range(block_pos);
- assert(size <= 0xffff - 1000);
- putInt16(h->start + block_pos, size);
-}
-
-static void set_next(heap_t *h, int block_pos, int next) {
- assert_in_range(block_pos);
- assert_in_range(next);
- putInt16(h->start + block_pos + 2, next);
-}
-
-
-static unsigned int get_size(heap_t *h, int block_pos) {
- assert_in_range(block_pos);
- return (uint16)getInt16(h->start + block_pos);
-}
-
-static unsigned int get_next(heap_t *h, int block_pos) {
- assert_in_range(block_pos);
- return (uint16)getInt16(h->start + block_pos + 2);
-}
-
-// Allocates a new heap
-heap_t *heap_new() {
- heap_t *h;
-
- if ((h = (heap_t*)sci_malloc(sizeof(heap_t))) == 0)
- return 0;
-
- if ((h->start = (byte *)sci_calloc(SCI_HEAP_SIZE, 1)) == 0) {
- free(h);
- return 0;
- }
-
- h->base = h->start + 1000;
- h->first_free = 1000;
- h->old_ff = -1;
- set_size(h, 1000, 0xffff - 1000);
- set_next(h, 1000, 0xffff);
-
- return h;
-}
-
-// Deletes a heap
-void heap_del(heap_t *h) {
- free(h->start);
- free(h);
-}
-
-int heap_meminfo(heap_t *h) {
- heap_ptr current = h->first_free;
- int total = 0;
-
- while (current != 0xffff) {
- total += get_size(h, current);
- current = get_next(h, current);
- }
-
- return total;
-}
-
-
-int heap_largest(heap_t *h) {
- int current = h->first_free;
- int best_pos = -1, best_size = 0;
-
- while (current != 0xffff) {
- int size = get_size(h, current);
- int next = get_next(h, current);
-
- if (size > best_size) {
- best_pos = current;
- best_size = size;
- }
-
- current = next;
- }
-
- return best_size;
-}
-
-heap_ptr heap_allocate(heap_t *h, int size) {
- unsigned int previous = h->first_free;
- unsigned int current = previous;
-
- if (!size) {
- fprintf(stderr, "Warning: heap_alloc'd zero bytes!\n");
- size += 2;
- }
-
- size += 2 + (size & 1);
-
- while (current < 0xffff) {
- int block_size = get_size(h, current);
- int next = get_next(h, current);
-
- // Is this block large enough?
- if (block_size >= size) {
- // Swallow the block whole
- if (block_size <= size + 4) {
- size = block_size;
- set_next(h, previous, next);
- } else {
- // Split the block
- int rest = current + size;
-
- set_next(h, previous, rest);
- set_size(h, rest, block_size - size);
- set_next(h, rest, next);
- next = rest;
- }
- set_size(h, current, size);
- if (current == h->first_free) h->first_free = next;
- return current;
- }
- previous = current;
- current = next;
- }
-
- // No large enough block was found.
- return 0;
-}
-
-void heap_free(heap_t *h, unsigned int m) {
- unsigned int previous, next;
- assert_in_range(m);
- previous = next = h->first_free;
-
- // Find the previous and next blocks
- while (next < m) {
- previous = next;
- assert(previous < 0xffff);
- next = get_next(h, previous);
- if (next <= previous) {
- sciprintf("Heap corrupt. Aborting heap_free()...\n");
- return;
- }
- }
-
- if (h->first_free > m)
- h->first_free = m; // Guarantee that first_free is correct
-
- if (previous == next) {
- if (m < previous) {
- h->first_free = m;
- if (m + get_size(h, m) == previous) {
- set_size(h, m, get_size(h, m) + get_size(h, previous));
- set_next(h, m, get_next(h, previous));
- } else
- set_next(h, m, previous);
- } else {
- if (previous + get_size(h, previous) == m) {
- set_size(h, previous, get_size(h, previous) + get_size(h, m));
- set_next(h, previous, 0xffff);
- } else {
- set_next(h, previous, m);
- set_next(h, m, next);
- }
- }
- } else {
- set_next(h, previous, m);
- set_next(h, m, next);
-
- // Try to merge with previous
- if (previous + get_size(h, previous) == m) {
- set_size(h, previous, get_size(h, previous) + get_size(h, m));
- set_next(h, previous, next);
- m = previous;
- }
-
- // Try to merge with next
- if (m + get_size(h, m) == next) {
- set_size(h, m, get_size(h, m) + get_size(h, next));
- set_next(h, m, get_next(h, next));
- }
- }
-}
-
-void save_ff(heap_t *h) {
- h->old_ff = h->first_free;
-}
-
-void restore_ff(heap_t *h) {
- h->first_free = h->old_ff;
- set_size(h, h->first_free, 0xffff - h->first_free);
- set_next(h, h->first_free, 0xffff);
-}
-
-void heap_dump_free(heap_t *h) {
- int freedomseeker;
-
- printf("\tfirst_free= %#x (oldff= %#x)\n\tFree Blocks:\n", h->first_free, h->old_ff);
-
- freedomseeker = h->first_free;
- while (freedomseeker != 0xffff) {
- printf("\t %#04x: size: %#04x\n", freedomseeker, get_size(h, freedomseeker));
- freedomseeker = get_next(h, freedomseeker);
- }
-}
-
-void heap_dump_all(heap_t *h) {
- int seeker = 1000;
- int free_seeker = h->first_free;
-
- while (seeker < 0xffff) {
- int is_free = (seeker == free_seeker);
- int size = get_size(h, seeker);
-
- if (is_free)
- free_seeker = get_next(h, free_seeker);
-
- printf("%04x\t%d\t%s\n", seeker, size, is_free ? "FREE" : "");
- seeker += size;
- }
-}
-
-#if 0
-int main(int argc, char **argv) {
- heap_t *h = heap_new();
- int a, b, c, d, e;
-
- printf("Running heap tests:\nHeap initialization:\n");
- heap_dump_free(h);
-
- printf("[a] Allocating 0x1: position is %#x\n", a = heap_allocate(h, 1));
- heap_dump_free(h);
-
- printf("[b] Allocating 0x10: position is %#x\n", b = heap_allocate(h, 0x10));
- printf("[c] Allocating 0x10: position is %#x\n", c = heap_allocate(h, 0x10));
- printf("[d] Allocating 0x10: position is %#x\n", d = heap_allocate(h, 0x10));
- printf("[e] Allocating 0x1000: position is %#x\n", e = heap_allocate(h, 0x1000));
- heap_dump_free(h);
-
- printf("Freeing [b]:\n");
- heap_free(h, b);
- heap_dump_free(h);
-
- printf("Freeing [d]:\n");
- heap_free(h, d);
- heap_dump_free(h);
-
- printf("Freeing [c]:\n");
- heap_free(h, c);
- heap_dump_free(h);
-
- heap_del(h);
-
- return 0;
-}
-#endif
-
-} // End of namespace Sci
Deleted: scummvm/trunk/engines/sci/engine/heap.h
===================================================================
--- scummvm/trunk/engines/sci/engine/heap.h 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/heap.h 2009-02-28 11:12:59 UTC (rev 38961)
@@ -1,115 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef SCI_ENGINE_HEAP_H
-#define SCI_ENGINE_HEAP_H
-
-#include "sci/tools.h"
-
-namespace Sci {
-
-#define SCI_HEAP_SIZE 0x10000
-
-typedef uint16 heap_ptr;
-
-struct heap_t {
- byte *start;
- byte *base;
- unsigned int first_free;
- int old_ff;
-};
-
-heap_t *heap_new();
-/* Allocates a new heap.
-** Parameters: (void)
-** Returns : (heap_t *) A new 0xffff-sized heap
-*/
-
-void heap_del(heap_t *h);
-/* Frees an allocated heap
-** Parameters: (heap_t *) h: The heap to unallocate
-** Returns : (void)
-*/
-
-int heap_meminfo(heap_t *h);
-/* Returns the total number of free bytes on the heap
-** Parameters: (heap_t *) h: The heap to check
-** Returns : (int) The total free space in bytes
-*/
-
-int heap_largest(heap_t *h);
-/* Returns the block size of the largest free block on the heap
-** Parameters: (heap_t *) h: The heap to check
-** Returns : (int) The size of the largest free block
-*/
-
-heap_ptr heap_allocate(heap_t *h, int size);
-/* Allocates memory on a heap.
-** Parameters: (heap_t *) h: The heap to work with
-** (int) size: The block size to allocate
-** Returns : (heap_ptr): The heap pointer to the new block, or 0 on failure
-*/
-
-void heap_free(heap_t *h, unsigned int m);
-/* Frees allocated heap memory.
-** Parameters: (heap_t *) h: The heap to work with
-** (int) m: The handle at which memory is to be unallocated
-** Returns : (void)
-** This function automatically prevents fragmentation from happening.
-*/
-
-void save_ff(heap_t *h);
-/* Stores the current first free position
-** Parameters: (heap_t *) h: The heap which is to be manipulated
-** Returns : (void)
-** This function can be used to save the heap state for later restoration (see
-** the next function)
-*/
-
-void restore_ff(heap_t *h);
-/* Restores the first free heap state
-** Parameters: (heap_t *) h: The heap to restore
-** Returns : (void)
-** Restoring the first free state will reset the heap to the position stored
-** when save_ff() was called, if and only if none of the blocks allocated before
-** save_ff() was called was ever freed ("ever" includes "before save_ff() was
-** called").
-*/
-
-void heap_dump_free(heap_t *h);
-/* Dumps debugging information about the stack
-** Parameters: (heap_t *) h: The heap to check
-** Returns : (void)
-*/
-
-void heap_dump_all(heap_t *h);
-/* Dumps all allocated/unallocated zones on the heap
-** Parameters: (heap_t *) h: The heap to check
-** Returns : (void)
-*/
-
-} // End of namespace Sci
-
-#endif // SCI_ENGINE_HEAP_H
Modified: scummvm/trunk/engines/sci/engine/heapmgr.h
===================================================================
--- scummvm/trunk/engines/sci/engine/heapmgr.h 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/heapmgr.h 2009-02-28 11:12:59 UTC (rev 38961)
@@ -40,37 +40,37 @@
#define ENTRY_IS_VALID(t, i) ((i == 0 || i > 0) && (i) < (t)->max_entry && (t)->table[(i)].next_free == (i))
#define DECLARE_HEAPENTRY(ENTRY) \
-typedef struct { \
+struct ENTRY##Entry { \
int next_free; /* Only used for free entries */ \
- ENTRY##_t entry; \
-} ENTRY##_entry_t; \
+ ENTRY entry; \
+}; \
\
-typedef struct { \
+struct ENTRY##Table { \
int entries_nr; /* Number of entries allocated */ \
int first_free; /* Beginning of a singly linked list for entries */ \
int entries_used; /* Statistical information */ \
int max_entry; /* Highest entry used */ \
- ENTRY##_entry_t *table; \
-} ENTRY##_table_t; \
+ ENTRY##Entry *table; \
+}; \
\
-void init_##ENTRY##_table(ENTRY##_table_t *table); \
-int alloc_##ENTRY##_entry(ENTRY##_table_t *table); \
-void free_##ENTRY##_entry(ENTRY##_table_t *table, int index);
+void init_##ENTRY##_table(ENTRY##Table *table); \
+int alloc_##ENTRY##_entry(ENTRY##Table *table); \
+void free_##ENTRY##_entry(ENTRY##Table *table, int index);
#define DEFINE_HEAPENTRY_WITH_CLEANUP(ENTRY, INITIAL, INCREMENT, CLEANUP_FN) \
-void init_##ENTRY##_table(ENTRY##_table_t *table) { \
+void init_##ENTRY##_table(ENTRY##Table *table) { \
table->entries_nr = INITIAL; \
table->max_entry = 0; \
table->entries_used = 0; \
table->first_free = HEAPENTRY_INVALID; \
- table->table = (ENTRY##_entry_t *)sci_malloc(sizeof(ENTRY##_entry_t) * INITIAL);\
- memset(table->table, 0, sizeof(ENTRY##_entry_t) * INITIAL); \
+ table->table = (ENTRY##Entry *)sci_malloc(sizeof(ENTRY##Entry) * INITIAL);\
+ memset(table->table, 0, sizeof(ENTRY##Entry) * INITIAL); \
} \
\
-void free_##ENTRY##_entry(ENTRY##_table_t *table, int index) { \
- ENTRY##_entry_t *e = table->table + index; \
+void free_##ENTRY##_entry(ENTRY##Table *table, int index) { \
+ ENTRY##Entry *e = table->table + index; \
\
if (index < 0 || index >= table->max_entry) { \
fprintf(stderr, "heapmgr: Attempt to release" \
@@ -84,7 +84,7 @@
table->entries_used--; \
} \
\
-int alloc_##ENTRY##_entry(ENTRY##_table_t *table) { \
+int alloc_##ENTRY##_entry(ENTRY##Table *table) { \
table->entries_used++; \
if (table->first_free != HEAPENTRY_INVALID) { \
int oldff = table->first_free; \
@@ -96,11 +96,11 @@
if (table->max_entry == table->entries_nr) { \
table->entries_nr += INCREMENT; \
\
- table->table = (ENTRY##_entry_t*)sci_realloc(table->table,\
- sizeof(ENTRY##_entry_t) * table->entries_nr); \
- memset(&table->table[table->entries_nr-INCREMENT], 0, INCREMENT*sizeof(ENTRY##_entry_t)); \
+ table->table = (ENTRY##Entry *)sci_realloc(table->table,\
+ sizeof(ENTRY##Entry) * table->entries_nr);\
+ memset(&table->table[table->entries_nr-INCREMENT], 0, INCREMENT * sizeof(ENTRY##Entry));\
} \
- table->table[table->max_entry].next_free = table->max_entry; /* Tag as 'valid' */ \
+ table->table[table->max_entry].next_free = table->max_entry; /* Tag as 'valid' */\
return table->max_entry++; \
} \
}
Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -191,7 +191,7 @@
#define DEFUN(nm, cname, sig) {KF_NEW, nm, {cname, sig, NULL}}
#define NOFUN(nm) {KF_NONE, nm, {NULL, NULL, NULL}}
-sci_kernel_function_t kfunct_mappers[] = {
+SciKernelFunction kfunct_mappers[] = {
/*00*/ DEFUN("Load", kLoad, "iii*"),
/*01*/ DEFUN("UnLoad", kUnLoad, "i.*"),
/*02*/ DEFUN("ScriptID", kScriptID, "Ioi*"),
@@ -379,8 +379,8 @@
// Returns a pointer to the memory indicated by the specified handle
byte *kmem(EngineState *s, reg_t handle) {
- mem_obj_t *mobj = GET_SEGMENT(*s->seg_manager, handle.segment, MEM_OBJ_HUNK);
- hunk_table_t *ht = &(mobj->data.hunks);
+ MemObject *mobj = GET_SEGMENT(*s->seg_manager, handle.segment, MEM_OBJ_HUNK);
+ HunkTable *ht = &(mobj->data.hunks);
if (!mobj || !ENTRY_IS_VALID(ht, handle.offset)) {
SCIkwarn(SCIkERROR, "Error: kmem() with invalid handle\n");
@@ -808,7 +808,7 @@
}
int determine_reg_type(EngineState *s, reg_t reg, int allow_invalid) {
- mem_obj_t *mobj;
+ MemObject *mobj;
if (!reg.segment) {
if (!reg.offset)
Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/kernel.h 2009-02-28 11:12:59 UTC (rev 38961)
@@ -35,8 +35,8 @@
namespace Sci {
-struct node_t; // from vm.h
-struct list_t; // from vm.h
+struct Node; // from vm.h
+struct List; // from vm.h
extern int _kdebug_cheap_event_hack;
extern int _kdebug_cheap_soundcue_hack;
@@ -86,10 +86,10 @@
*/
-reg_t read_selector(EngineState *s, reg_t object, selector_t selector_id, const char *fname, int line);
-void write_selector(EngineState *s, reg_t object, selector_t selector_id, reg_t value, const char *fname, int line);
+reg_t read_selector(EngineState *s, reg_t object, Selector selector_id, const char *fname, int line);
+void write_selector(EngineState *s, reg_t object, Selector selector_id, reg_t value, const char *fname, int line);
int invoke_selector(EngineState *s, reg_t object, int selector_id, int noinvalid, int kfunct,
- stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...);
+ StackPtr k_argp, int k_argc, const char *fname, int line, int argc, ...);
/******************** Text functionality ********************/
@@ -132,7 +132,7 @@
/* Checks whether a heap address contains an object
** Parameters: (EngineState *) s: The current state
** (reg_t) obj: The address to check
-** Returns : (int) 1 if it is an object, 0 otherwise
+** Returns : (bool) true if it is an object, false otherwise
*/
/******************** Kernel function parameter macros ********************/
@@ -243,23 +243,23 @@
#define LOOKUP_NODE(addr) lookup_node(s, (addr), __FILE__, __LINE__)
#define LOOKUP_LIST(addr) lookup_list(s, addr, __FILE__, __LINE__)
-node_t *lookup_node(EngineState *s, reg_t addr, const char *file, int line);
+Node *lookup_node(EngineState *s, reg_t addr, const char *file, int line);
/* Resolves an address into a list node
** Parameters: (EngineState *) s: The state to operate on
** (reg_t) addr: The address to resolve
** (const char *) file: The file the function was called from
** (int) line: The line number the function was called from
-** Returns : (node_t *) The list node referenced, or NULL on error
+** Returns : (Node *) The list node referenced, or NULL on error
*/
-list_t *lookup_list(EngineState *s, reg_t addr, const char *file, int line);
+List *lookup_list(EngineState *s, reg_t addr, const char *file, int line);
/* Resolves a list pointer to a list
** Parameters: (EngineState *) s: The state to operate on
** (reg_t) addr: The address to resolve
** (const char *) file: The file the function was called from
** (int) line: The line number the function was called from
-** Returns : (list_t *) The list referenced, or NULL on error
+** Returns : (List *) The list referenced, or NULL on error
*/
@@ -320,13 +320,13 @@
#define KF_NONE -1 /* No mapping, but name is known */
#define KF_TERMINATOR -42 /* terminates kfunct_mappers */
-struct sci_kernel_function_t {
+struct SciKernelFunction {
int type; /* KF_* */
const char *name;
kfunct_sig_pair_t sig_pair;
};
-extern sci_kernel_function_t kfunct_mappers[];
+extern SciKernelFunction kfunct_mappers[];
} // End of namespace Sci
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -445,7 +445,7 @@
sciprintf("_k_redraw_box(): Unimplemented!\n");
#if 0
int i;
- view_object_t *list = s->dyn_views;
+ ViewObject *list = s->dyn_views;
sciprintf("Reanimating views\n", s->dyn_views_nr);
@@ -777,7 +777,7 @@
reg_t kCanBeHere(EngineState *s, int funct_nr, int argc, reg_t * argv) {
reg_t obj = argv[0];
reg_t cliplist_ref = KP_ALT(1, NULL_REG);
- list_t *cliplist = NULL;
+ List *cliplist = NULL;
gfxw_port_t *port = s->picture_port;
uint16 signal;
int retval;
@@ -838,7 +838,7 @@
cliplist = LOOKUP_LIST(cliplist_ref);
if (cliplist) {
- node_t *node = LOOKUP_NODE(cliplist->first);
+ Node *node = LOOKUP_NODE(cliplist->first);
retval = 0; // Assume that we Can'tBeHere...
@@ -984,7 +984,7 @@
return make_reg(0, gfxop_scan_bitmask(s->gfx_state, gfx_rect(xstart, ystart + 10, xlen, ylen), map));
}
-void _k_view_list_free_backgrounds(EngineState *s, view_object_t *list, int list_nr);
+void _k_view_list_free_backgrounds(EngineState *s, ViewObject *list, int list_nr);
int sci01_priority_table_flags = 0;
@@ -1149,7 +1149,7 @@
void _k_base_setter(EngineState *s, reg_t object) {
abs_rect_t absrect = set_base(s, object);
- if (lookup_selector(s, object, s->selector_map.brLeft, NULL, NULL) != SELECTOR_VARIABLE)
+ if (lookup_selector(s, object, s->selector_map.brLeft, NULL, NULL) != kSelectorVariable)
return; // non-fatal
if (s->version <= SCI_VERSION_LTU_BASE_OB1)
@@ -1248,7 +1248,7 @@
static void _k_set_now_seen(EngineState *s, reg_t object) {
abs_rect_t absrect = get_nsrect(s, object, 0);
- if (lookup_selector(s, object, s->selector_map.nsTop, NULL, NULL) != SELECTOR_VARIABLE) {
+ if (lookup_selector(s, object, s->selector_map.nsTop, NULL, NULL) != kSelectorVariable) {
return;
} // This isn't fatal
@@ -1703,7 +1703,7 @@
* if ((widget->signal & (_K_VIEW_SIG_FLAG_FREESCI_PRIVATE | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)) == _K_VIEW_SIG_FLAG_FREESCI_PRIVATE) {
*/
if ((widget->signal & (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_NO_UPDATE)) == 0) {
- int has_nsrect = lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL) == SELECTOR_VARIABLE;
+ int has_nsrect = lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL) == kSelectorVariable;
if (has_nsrect) {
int temp;
@@ -1761,7 +1761,7 @@
static int _k_animate_ran = 0;
-int _k_view_list_dispose_loop(EngineState *s, list_t *list, gfxw_dyn_view_t *widget, int funct_nr, int argc, reg_t *argv) {
+int _k_view_list_dispose_loop(EngineState *s, List *list, gfxw_dyn_view_t *widget, int funct_nr, int argc, reg_t *argv) {
// disposes all list members flagged for disposal; funct_nr is the invoking kfunction
// returns non-zero IFF views were dropped
int signal;
@@ -1899,14 +1899,14 @@
PUT_SEL32V(obj, cel, cel);
}
- if (lookup_selector(s, obj, s->selector_map.underBits, &(under_bitsp), NULL) != SELECTOR_VARIABLE) {
+ if (lookup_selector(s, obj, s->selector_map.underBits, &(under_bitsp), NULL) != kSelectorVariable) {
under_bitsp = NULL;
under_bits = NULL_REG;
SCIkdebug(SCIkGRAPHICS, "Object at "PREG" has no underBits\n", PRINT_REG(obj));
} else
under_bits = *((reg_t *)under_bitsp);
- if (lookup_selector(s, obj, s->selector_map.signal, &(signalp), NULL) != SELECTOR_VARIABLE) {
+ if (lookup_selector(s, obj, s->selector_map.signal, &(signalp), NULL) != kSelectorVariable) {
signalp = NULL;
signal = 0;
SCIkdebug(SCIkGRAPHICS, "Object at "PREG" has no signal selector\n", PRINT_REG(obj));
@@ -1929,12 +1929,12 @@
}
}
-static void _k_make_view_list(EngineState *s, gfxw_list_t **widget_list, list_t *list, int options, int funct_nr, int argc, reg_t *argv) {
+static void _k_make_view_list(EngineState *s, gfxw_list_t **widget_list, List *list, int options, int funct_nr, int argc, reg_t *argv) {
/* Creates a view_list from a node list in heap space. Returns the list, stores the
** number of list entries in *list_nr. Calls doit for each entry if cycle is set.
** argc, argv, funct_nr should be the same as in the calling kernel function.
*/
- node_t *node;
+ Node *node;
int sequence_nr = 0;
gfxw_dyn_view_t *widget;
@@ -1995,7 +1995,7 @@
while (view) {
reg_t obj = make_reg(view->ID, view->subID);
int priority, _priority;
- int has_nsrect = (view->ID <= 0) ? 0 : lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL) == SELECTOR_VARIABLE;
+ int has_nsrect = (view->ID <= 0) ? 0 : lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL) == kSelectorVariable;
int oldsignal = view->signal;
_k_set_now_seen(s, obj);
@@ -2276,7 +2276,7 @@
ADD_TO_CURRENT_PICTURE_PORT(gfxw_picviewize_dynview((gfxw_dyn_view_t *) widget));
}
} else {
- list_t *list;
+ List *list;
if (!list_ref.segment) {
warning("Attempt to AddToPic single non-list: "PREG"", PRINT_REG(list_ref));
@@ -2923,7 +2923,7 @@
// Animations are supposed to take a maximum of s->animation_delay milliseconds.
reg_t cast_list_ref = KP_ALT(0, NULL_REG);
int cycle = (KP_ALT(1, NULL_REG)).offset;
- list_t *cast_list = NULL;
+ List *cast_list = NULL;
int open_animation = 0;
process_sound_events(s); // Take care of incoming events (kAnimate is called semi-regularly)
Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/klists.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -33,9 +33,9 @@
# define LOOKUP_NODE(addr) inline_lookup_node(s, (addr), __FILE__, __LINE__)
#endif
-inline node_t *inline_lookup_node(EngineState *s, reg_t addr, const char *file, int line) {
- mem_obj_t *mobj;
- node_table_t *nt;
+inline Node *inline_lookup_node(EngineState *s, reg_t addr, const char *file, int line) {
+ MemObject *mobj;
+ NodeTable *nt;
if (!addr.offset && !addr.segment)
return NULL; // Non-error null
@@ -58,15 +58,15 @@
return &(nt->table[addr.offset].entry);
}
-node_t *lookup_node(EngineState *s, reg_t addr, const char *file, int line) {
+Node *lookup_node(EngineState *s, reg_t addr, const char *file, int line) {
return inline_lookup_node(s, addr, file, line);
}
#define LOOKUP_NULL_LIST(addr) _lookup_list(s, addr, __FILE__, __LINE__, 1)
-inline list_t *_lookup_list(EngineState *s, reg_t addr, const char *file, int line, int may_be_null) {
- mem_obj_t *mobj;
- list_table_t *lt;
+inline List *_lookup_list(EngineState *s, reg_t addr, const char *file, int line, int may_be_null) {
+ MemObject *mobj;
+ ListTable *lt;
if (may_be_null && !addr.segment && !addr.offset)
return NULL;
@@ -90,7 +90,7 @@
return &(lt->table[addr.offset].entry);
}
-list_t *lookup_list(EngineState *s, reg_t addr, const char *file, int line) {
+List *lookup_list(EngineState *s, reg_t addr, const char *file, int line) {
return _lookup_list(s, addr, file, line, 0);
}
@@ -106,7 +106,7 @@
reg_t prev = addr;
do {
- node_t *node = LOOKUP_NODE(addr);
+ Node *node = LOOKUP_NODE(addr);
if (!node)
return 0;
@@ -123,7 +123,7 @@
}
int sane_listp(EngineState *s, reg_t addr) {
- list_t *l = LOOKUP_LIST(addr);
+ List *l = LOOKUP_LIST(addr);
int empties = 0;
if (IS_NULL_REG(l->first))
@@ -136,7 +136,7 @@
return 0;
if (!empties) {
- node_t *node_a, *node_z;
+ Node *node_a, *node_z;
node_a = LOOKUP_NODE(l->first);
node_z = LOOKUP_NODE(l->last);
@@ -159,8 +159,8 @@
reg_t kNewList(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t listbase;
- list_t *l;
- l = s->seg_manager->alloc_list(&listbase);
+ List *l;
+ l = s->seg_manager->alloc_List(&listbase);
l->first = l->last = NULL_REG;
SCIkdebug(SCIkNODES, "New listbase at "PREG"\n", PRINT_REG(listbase));
@@ -168,7 +168,7 @@
}
reg_t kDisposeList(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- list_t *l = LOOKUP_LIST(argv[0]);
+ List *l = LOOKUP_LIST(argv[0]);
if (!l) {
SCIkwarn(SCIkERROR, "Attempt to dispose non-list at "PREG"!\n", PRINT_REG(argv[0]));
@@ -182,8 +182,8 @@
reg_t n_addr = l->first;
while (!IS_NULL_REG(n_addr)) { // Free all nodes
- node_t *n = LOOKUP_NODE(n_addr);
- s->seg_manager->free_node(n_addr);
+ Node *n = LOOKUP_NODE(n_addr);
+ s->seg_manager->free_Node(n_addr);
n_addr = n->succ;
}
}
@@ -195,7 +195,7 @@
inline reg_t _k_new_node(EngineState *s, reg_t value, reg_t key) {
reg_t nodebase;
- node_t *n = s->seg_manager->alloc_node(&nodebase);
+ Node *n = s->seg_manager->alloc_Node(&nodebase);
if (!n) {
KERNEL_OOPS("Out of memory while creating a node");
@@ -218,7 +218,7 @@
}
reg_t kFirstNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- list_t *l = LOOKUP_NULL_LIST(argv[0]);
+ List *l = LOOKUP_NULL_LIST(argv[0]);
if (l && !sane_listp(s, argv[0]))
SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
@@ -230,7 +230,7 @@
}
reg_t kLastNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- list_t *l = LOOKUP_LIST(argv[0]);
+ List *l = LOOKUP_LIST(argv[0]);
if (l && !sane_listp(s, argv[0]))
SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
@@ -242,7 +242,7 @@
}
reg_t kEmptyList(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- list_t *l = LOOKUP_LIST(argv[0]);
+ List *l = LOOKUP_LIST(argv[0]);
if (!l || !sane_listp(s, argv[0]))
SCIkwarn(SCIkERROR, "List at "PREG" is invalid or not sane anymore!\n", PRINT_REG(argv[0]));
@@ -251,8 +251,8 @@
}
inline void _k_add_to_front(EngineState *s, reg_t listbase, reg_t nodebase) {
- list_t *l = LOOKUP_LIST(listbase);
- node_t *new_n = LOOKUP_NODE(nodebase);
+ List *l = LOOKUP_LIST(listbase);
+ Node *new_n = LOOKUP_NODE(nodebase);
SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
@@ -267,15 +267,15 @@
if (IS_NULL_REG(l->first))
l->last = nodebase;
else {
- node_t *old_n = LOOKUP_NODE(l->first);
+ Node *old_n = LOOKUP_NODE(l->first);
old_n->pred = nodebase;
}
l->first = nodebase;
}
inline void _k_add_to_end(EngineState *s, reg_t listbase, reg_t nodebase) {
- list_t *l = LOOKUP_LIST(listbase);
- node_t *new_n = LOOKUP_NODE(nodebase);
+ List *l = LOOKUP_LIST(listbase);
+ Node *new_n = LOOKUP_NODE(nodebase);
SCIkdebug(SCIkNODES, "Adding node "PREG" to end of list "PREG"\n", PRINT_REG(nodebase), PRINT_REG(listbase));
@@ -290,14 +290,14 @@
if (IS_NULL_REG(l->last))
l->first = nodebase;
else {
- node_t *old_n = LOOKUP_NODE(l->last);
+ Node *old_n = LOOKUP_NODE(l->last);
old_n->succ = nodebase;
}
l->last = nodebase;
}
reg_t kNextNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- node_t *n = LOOKUP_NODE(argv[0]);
+ Node *n = LOOKUP_NODE(argv[0]);
if (!sane_nodep(s, argv[0])) {
SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
script_error_flag = script_debug_flag = 0;
@@ -308,7 +308,7 @@
}
reg_t kPrevNode(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- node_t *n = LOOKUP_NODE(argv[0]);
+ Node *n = LOOKUP_NODE(argv[0]);
if (!sane_nodep(s, argv[0]))
SCIkwarn(SCIkERROR, "List node at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
@@ -316,7 +316,7 @@
}
reg_t kNodeValue(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- node_t *n = LOOKUP_NODE(argv[0]);
+ Node *n = LOOKUP_NODE(argv[0]);
if (!sane_nodep(s, argv[0])) {
SCIkwarn(SCIkERROR, "List node at "PREG" is not sane!\n", PRINT_REG(argv[0]));
script_debug_flag = script_error_flag = 0;
@@ -332,9 +332,9 @@
}
reg_t kAddAfter(EngineState *s, int funct_nr, int argc, reg_t *argv) {
- list_t *l = LOOKUP_LIST(argv[0]);
- node_t *firstnode = IS_NULL_REG(argv[1]) ? NULL : LOOKUP_NODE(argv[1]);
- node_t *newnode = LOOKUP_NODE(argv[2]);
+ List *l = LOOKUP_LIST(argv[0]);
+ Node *firstnode = IS_NULL_REG(argv[1]) ? NULL : LOOKUP_NODE(argv[1]);
+ Node *newnode = LOOKUP_NODE(argv[2]);
if (!l || !sane_listp(s, argv[0]))
SCIkwarn(SCIkERROR, "List at "PREG" is not sane anymore!\n", PRINT_REG(argv[0]));
@@ -390,7 +390,7 @@
SCIkdebug(SCIkNODES, "First node at "PREG"\n", PRINT_REG(node_pos));
while (!IS_NULL_REG(node_pos)) {
- node_t *n = LOOKUP_NODE(node_pos);
+ Node *n = LOOKUP_NODE(node_pos);
if (REG_EQ(n->key, key)) {
SCIkdebug(SCIkNODES, " Found key at "PREG"\n", PRINT_REG(node_pos));
return node_pos;
@@ -406,8 +406,8 @@
reg_t kDeleteKey(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t node_pos = kFindKey(s, funct_nr, 2, argv);
- node_t *n;
- list_t *l = LOOKUP_LIST(argv[0]);
+ Node *n;
+ List *l = LOOKUP_LIST(argv[0]);
if (IS_NULL_REG(node_pos))
return NULL_REG; // Signal falure
@@ -423,7 +423,7 @@
if (!IS_NULL_REG(n->succ))
LOOKUP_NODE(n->succ)->pred = n->pred;
- //s->seg_manager->free_node(node_pos);
+ //s->seg_manager->free_Node(node_pos);
return make_reg(0, 1); // Signal success
}
@@ -459,14 +459,14 @@
reg_t input_data = GET_SEL32(source, elements);
reg_t output_data = GET_SEL32(dest, elements);
- list_t *list;
- node_t *node;
+ List *list;
+ Node *node;
if (!input_size)
return s->r_acc;
if (IS_NULL_REG(output_data)) {
- list = s->seg_manager->alloc_list(&output_data);
+ list = s->seg_manager->alloc_List(&output_data);
list->first = list->last = NULL_REG;
PUT_SEL32(dest, elements, output_data);
}
Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -255,7 +255,7 @@
reg_t motion_class;
if (!parse_reg_t(s, "?Motion", &motion_class)) {
- object_t *obj = obj_get(s, motion_class);
+ Object *obj = obj_get(s, motion_class);
reg_t fptr;
byte *buf;
@@ -265,7 +265,7 @@
return;
}
- if (lookup_selector(s, motion_class, s->selector_map.doit, NULL, &fptr) != SELECTOR_METHOD) {
+ if (lookup_selector(s, motion_class, s->selector_map.doit, NULL, &fptr) != kSelectorMethod) {
warning("bresenham_autodetect failed");
handle_movecnt = INCREMENT_MOVECNT; // Most games do this, so best guess
return;
Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -351,8 +351,8 @@
}
static void draw_input(EngineState *s, reg_t poly_list, Common::Point start, Common::Point end, int opt) {
- list_t *list;
- node_t *node;
+ List *list;
+ Node *node;
draw_point(s, start, 1);
draw_point(s, end, 0);
@@ -396,8 +396,8 @@
}
static void print_input(EngineState *s, reg_t poly_list, Common::Point start, Common::Point end, int opt) {
- list_t *list;
- node_t *node;
+ List *list;
+ Node *node;
sciprintf("Start point: (%i, %i)\n", start.x, start.y);
sciprintf("End point: (%i, %i)\n", end.x, end.y);
@@ -1224,8 +1224,8 @@
// Convert all polygons
if (poly_list.segment) {
- list_t *list = LOOKUP_LIST(poly_list);
- node_t *node = LOOKUP_NODE(list->first);
+ List *list = LOOKUP_LIST(poly_list);
+ Node *node = LOOKUP_NODE(list->first);
while (node) {
polygon = convert_polygon(s, node->value);
Modified: scummvm/trunk/engines/sci/engine/kscripts.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kscripts.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/kscripts.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -30,16 +30,16 @@
namespace Sci {
-reg_t read_selector(EngineState *s, reg_t object, selector_t selector_id, const char *file, int line) {
+reg_t read_selector(EngineState *s, reg_t object, Selector selector_id, const char *file, int line) {
reg_t *address;
- if (lookup_selector(s, object, selector_id, &address, NULL) != SELECTOR_VARIABLE)
+ if (lookup_selector(s, object, selector_id, &address, NULL) != kSelectorVariable)
return NULL_REG;
else
return *address;
}
-void write_selector(EngineState *s, reg_t object, selector_t selector_id, reg_t value, const char *fname, int line) {
+void write_selector(EngineState *s, reg_t object, Selector selector_id, reg_t value, const char *fname, int line) {
reg_t *address;
if ((selector_id < 0) || (selector_id > (int)s->_selectorNames.size())) {
@@ -48,7 +48,7 @@
return;
}
- if (lookup_selector(s, object, selector_id, &address, NULL) != SELECTOR_VARIABLE)
+ if (lookup_selector(s, object, selector_id, &address, NULL) != kSelectorVariable)
warning("Selector '%s' of object at "PREG" could not be"
" written to (%s L%d)", s->_selectorNames[selector_id].c_str(), PRINT_REG(object), fname, line);
else
@@ -56,29 +56,30 @@
}
int invoke_selector(EngineState *s, reg_t object, int selector_id, int noinvalid, int kfunct,
- stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...) {
+ StackPtr k_argp, int k_argc, const char *fname, int line, int argc, ...) {
va_list argp;
int i;
int framesize = 2 + 1 * argc;
reg_t address;
int slc_type;
- stack_ptr_t stackframe = k_argp + k_argc;
+ StackPtr stackframe = k_argp + k_argc;
- exec_stack_t *xstack; // Execution stack
+ // Execution stack
+ ExecStack *xstack;
stackframe[0] = make_reg(0, selector_id); // The selector we want to call
stackframe[1] = make_reg(0, argc); // Argument count
slc_type = lookup_selector(s, object, selector_id, NULL, &address);
- if (slc_type == SELECTOR_NONE) {
+ if (slc_type == kSelectorNone) {
SCIkwarn(SCIkERROR, "Selector '%s' of object at "PREG" could not be invoked (%s L%d)\n",
s->_selectorNames[selector_id].c_str(), PRINT_REG(object), fname, line);
if (noinvalid == 0)
KERNEL_OOPS("Not recoverable: VM was halted\n");
return 1;
}
- if (slc_type == SELECTOR_VARIABLE) // Swallow silently
+ if (slc_type == kSelectorVariable) // Swallow silently
return 0;
va_start(argp, argc);
@@ -155,9 +156,9 @@
reg_t kClone(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t parent_addr = argv[0];
- object_t *parent_obj = obj_get(s, parent_addr);
+ Object *parent_obj = obj_get(s, parent_addr);
reg_t clone_addr;
- clone_t *clone_obj; // same as object_t*
+ Clone *clone_obj; // same as Object*
int varblock_size;
if (!parent_obj) {
@@ -167,14 +168,14 @@
SCIkdebug(SCIkMEM, "Attempting to clone from "PREG"\n", PRINT_REG(parent_addr));
- clone_obj = s->seg_manager->alloc_clone(&clone_addr);
+ clone_obj = s->seg_manager->alloc_Clone(&clone_addr);
if (!clone_obj) {
SCIkwarn(SCIkERROR, "Cloning "PREG" failed-- internal error!\n", PRINT_REG(parent_addr));
return NULL_REG;
}
- memcpy(clone_obj, parent_obj, sizeof(clone_t));
+ memcpy(clone_obj, parent_obj, sizeof(Clone));
clone_obj->flags = 0;
varblock_size = parent_obj->variables_nr * sizeof(reg_t);
clone_obj->variables = (reg_t*)sci_malloc(varblock_size);
@@ -195,7 +196,7 @@
reg_t kDisposeClone(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t victim_addr = argv[0];
- clone_t *victim_obj = obj_get(s, victim_addr);
+ Clone *victim_obj = obj_get(s, victim_addr);
uint16 underBits;
if (!victim_obj) {
@@ -235,8 +236,8 @@
int script = KP_UINT(argv[0]);
int index = KP_UINT(KP_ALT(1, NULL_REG));
- seg_id_t scriptid = script_get_segment(s, script, SCRIPT_GET_LOAD);
- script_t *scr;
+ SegmentId scriptid = script_get_segment(s, script, SCRIPT_GET_LOAD);
+ Script *scr;
if (argv[0].segment)
return argv[0];
@@ -279,7 +280,7 @@
}
int is_heap_object(EngineState *s, reg_t pos) {
- object_t *obj = obj_get(s, pos);
+ Object *obj = obj_get(s, pos);
return (obj != NULL && (!(obj->flags & OBJECT_FLAG_FREED)) && (!s->seg_manager->scriptIsMarkedAsDeleted(pos.segment)));
}
@@ -294,7 +295,7 @@
reg_t obj = argv[0];
int selector = KP_UINT(argv[1]);
- return make_reg(0, is_heap_object(s, obj) && lookup_selector(s, obj, selector, NULL, NULL) != SELECTOR_NONE);
+ return make_reg(0, is_heap_object(s, obj) && lookup_selector(s, obj, selector, NULL, NULL) != kSelectorNone);
}
} // End of namespace Sci
Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -78,7 +78,7 @@
/**********/
#ifdef SCI_SIMPLE_SAID_CODE
-int vocab_match_simple(EngineState *s, heap_ptr addr) {
+int vocab_match_simple(EngineState *s, HeapPtr addr) {
int nextitem;
int listpos = 0;
@@ -182,8 +182,8 @@
reg_t kSetSynonyms(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t object = argv[0];
- list_t *list;
- node_t *node;
+ List *list;
+ Node *node;
int script;
int synpos = 0;
@@ -733,7 +733,7 @@
#define DUMMY_MESSAGE "No MESSAGE support in FreeSCI yet"
-static message_state_t state;
+static MessageState state;
reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv) {
if (!state.initialized)
@@ -742,7 +742,7 @@
switch (UKPV(0)) {
case 0 : {
char *buffer = argc == 7 ? kernel_dereference_char_pointer(s, argv[6], 0) : NULL;
- message_tuple_t tuple;
+ MessageTuple tuple;
int module = UKPV(1);
tuple.noun = UKPV(2);
@@ -772,7 +772,7 @@
}
}
case 2 : {
- message_tuple_t tuple;
+ MessageTuple tuple;
int module = UKPV(1);
tuple.noun = UKPV(2);
tuple.verb = UKPV(3);
Modified: scummvm/trunk/engines/sci/engine/message.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/message.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/message.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -30,7 +30,7 @@
#if 0
// Unreferenced - removed
-static int get_talker_trivial(index_record_cursor_t *cursor) {
+static int get_talker_trivial(IndexRecordCursor *cursor) {
return -1;
}
#endif
@@ -39,7 +39,7 @@
#if 0
// Unreferenced - removed
-static void index_record_parse_2101(index_record_cursor_t *cursor, message_tuple_t *t) {
+static void index_record_parse_2101(IndexRecordCursor *cursor, MessageTuple *t) {
int noun = *(cursor->index_record + 0);
int verb = *(cursor->index_record + 1);
@@ -51,7 +51,7 @@
#if 0
// Unreferenced - removed
-static void index_record_get_text_2101(index_record_cursor_t *cursor, char *buffer, int buffer_size) {
+static void index_record_get_text_2101(IndexRecordCursor *cursor, char *buffer, int buffer_size) {
int offset = getUInt16(cursor->index_record + 2);
char *stringptr = (char *)cursor->resource_beginning + offset;
@@ -68,7 +68,7 @@
// Version 3.411 and later code ahead
-static void index_record_parse_3411(index_record_cursor_t *cursor, message_tuple_t *t) {
+static void index_record_parse_3411(IndexRecordCursor *cursor, MessageTuple *t) {
int noun = *(cursor->index_record + 0);
int verb = *(cursor->index_record + 1);
int cond = *(cursor->index_record + 2);
@@ -80,11 +80,11 @@
t->seq = seq;
}
-static int index_record_get_talker_3411(index_record_cursor_t *cursor) {
+static int index_record_get_talker_3411(IndexRecordCursor *cursor) {
return *(cursor->index_record + 4);
}
-static void index_record_get_text_3411(index_record_cursor_t *cursor, char *buffer, int buffer_size) {
+static void index_record_get_text_3411(IndexRecordCursor *cursor, char *buffer, int buffer_size) {
int offset = getUInt16(cursor->index_record + 5);
char *stringptr = (char *)cursor->resource_beginning + offset;
@@ -97,17 +97,17 @@
// Generic code from here on
-static int four_tuple_match(message_tuple_t *t1, message_tuple_t *t2) {
+static int four_tuple_match(MessageTuple *t1, MessageTuple *t2) {
return t1->noun == t2->noun && t1->verb == t2->verb && t1->cond == t2->cond && t1->seq == t2->seq;
}
-static void index_record_cursor_initialize(message_state_t *state, index_record_cursor_t *cursor) {
+static void index_record_cursor_initialize(MessageState *state, IndexRecordCursor *cursor) {
cursor->resource_beginning = state->current_res->data;
cursor->index_record = state->index_records;
cursor->index = 1;
}
-static int index_record_next(message_state_t *state, index_record_cursor_t *cursor) {
+static int index_record_next(MessageState *state, IndexRecordCursor *cursor) {
if (cursor->index == state->record_count)
return 0;
cursor->index_record += state->handler->index_record_size;
@@ -115,8 +115,8 @@
return 1;
}
-static int index_record_find(message_state_t *state, message_tuple_t *t, index_record_cursor_t *cursor) {
- message_tuple_t looking_at;
+static int index_record_find(MessageState *state, MessageTuple *t, IndexRecordCursor *cursor) {
+ MessageTuple looking_at;
int found = 0;
index_record_cursor_initialize(state, cursor);
@@ -132,31 +132,31 @@
return found;
}
-int message_get_specific(message_state_t *state, message_tuple_t *t) {
+int message_get_specific(MessageState *state, MessageTuple *t) {
return index_record_find(state, t, &state->engine_cursor);
}
-int message_get_next(message_state_t *state) {
+int message_get_next(MessageState *state) {
return index_record_next(state, &state->engine_cursor);
}
-int message_get_talker(message_state_t *state) {
+int message_get_talker(MessageState *state) {
return state->handler->get_talker(&state->engine_cursor);
}
-int message_get_text(message_state_t *state, char *buffer, int length) {
+int message_get_text(MessageState *state, char *buffer, int length) {
state->handler->get_text(&state->engine_cursor, buffer, length);
return strlen(buffer);
}
-int message_get_length(message_state_t *state) {
+int message_get_length(MessageState *state) {
char buffer[500];
state->handler->get_text(&state->engine_cursor, buffer, sizeof(buffer));
return strlen(buffer);
}
-int message_state_load_res(message_state_t *state, int module) {
+int message_state_load_res(MessageState *state, int module) {
if (state->module == module)
return 1;
@@ -175,7 +175,7 @@
return 1;
}
-static message_handler_t fixed_handler = {
+static MessageHandler fixed_handler = {
3411,
index_record_parse_3411,
index_record_get_talker_3411,
@@ -185,7 +185,7 @@
11
};
-void message_state_initialize(ResourceManager *resmgr, message_state_t *state) {
+void message_state_initialize(ResourceManager *resmgr, MessageState *state) {
//resource_t *tester = scir_find_resource(resmgr, sci_message, 0, 0);
//int version;
Modified: scummvm/trunk/engines/sci/engine/message.h
===================================================================
--- scummvm/trunk/engines/sci/engine/message.h 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/message.h 2009-02-28 11:12:59 UTC (rev 38961)
@@ -30,26 +30,26 @@
namespace Sci {
-struct message_tuple_t {
+struct MessageTuple {
int noun;
int verb;
int cond;
int seq;
};
-struct index_record_cursor_t {
+struct IndexRecordCursor {
byte *index_record;
int index;
byte *resource_beginning;
};
typedef int index_record_size_t();
-typedef void parse_index_record_t(index_record_cursor_t *index_record, message_tuple_t *t);
-typedef int get_talker_t(index_record_cursor_t *cursor);
-typedef void get_text_t(index_record_cursor_t *cursor, char *buffer, int buffer_size);
+typedef void parse_index_record_t(IndexRecordCursor *index_record, MessageTuple *t);
+typedef int get_talker_t(IndexRecordCursor *cursor);
+typedef void get_text_t(IndexRecordCursor *cursor, char *buffer, int buffer_size);
typedef int index_record_count_t(byte *header);
-struct message_handler_t {
+struct MessageHandler {
int version_id;
parse_index_record_t *parse;
get_talker_t *get_talker;
@@ -60,24 +60,24 @@
int index_record_size;
};
-struct message_state_t {
+struct MessageState {
int initialized;
- message_handler_t *handler;
+ MessageHandler *handler;
ResourceManager *resmgr;
resource_t *current_res;
int module;
int record_count;
byte *index_records;
- index_record_cursor_t engine_cursor;
+ IndexRecordCursor engine_cursor;
};
-int message_get_specific(message_state_t *state, message_tuple_t *t);
-int message_get_next(message_state_t *state);
-int message_get_talker(message_state_t *state);
-int message_get_length(message_state_t *state);
-int message_get_text(message_state_t *state, char *buffer, int length);
-int message_state_load_res(message_state_t *state, int module);
-void message_state_initialize(ResourceManager *resmgr, message_state_t *state);
+int message_get_specific(MessageState *state, MessageTuple *t);
+int message_get_next(MessageState *state);
+int message_get_talker(MessageState *state);
+int message_get_length(MessageState *state);
+int message_get_text(MessageState *state, char *buffer, int length);
+int message_state_load_res(MessageState *state, int module);
+void message_state_initialize(ResourceManager *resmgr, MessageState *state);
} // End of namespace Sci
Modified: scummvm/trunk/engines/sci/engine/savegame.cfsml
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cfsml 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/savegame.cfsml 2009-02-28 11:12:59 UTC (rev 38961)
@@ -37,7 +37,6 @@
#include "sci/gfx/menubar.h"
#include "sci/sfx/sfx_engine.h"
#include "sci/engine/state.h"
-#include "sci/engine/heap.h"
#include "sci/engine/intmap.h"
#ifdef _WIN32
@@ -196,8 +195,8 @@
void write_menubar_tp(Common::WriteStream *fh, const menubar_t * const *foo);
int read_menubar_tp(Common::SeekableReadStream *fh, menubar_t **foo, const char *lastval, int *line, int *hiteof);
-void write_mem_obj_tp(Common::WriteStream *fh, const mem_obj_t * const *foo);
-int read_mem_obj_tp(Common::SeekableReadStream *fh, mem_obj_t **foo, const char *lastval, int *line, int *hiteof);
+void write_MemObjPtr(Common::WriteStream *fh, const MemObject * const *foo);
+int read_MemObjPtr(Common::SeekableReadStream *fh, MemObject **foo, const char *lastval, int *line, int *hiteof);
void write_songlib_t(Common::WriteStream *fh, songlib_t const *foo);
int read_songlib_t(Common::SeekableReadStream *fh, songlib_t *foo, const char *lastval, int *line, int *hiteof);
@@ -213,7 +212,7 @@
void write_SegManagerPtr(Common::WriteStream *fh, const SegManager * const *foo);
int read_SegManagerPtr(Common::SeekableReadStream *fh, SegManager **foo, const char *lastval, int *line, int *hiteof);
-typedef mem_obj_t *mem_obj_ptr;
+typedef MemObject *mem_obj_ptr;
// Unused types
/*
@@ -231,11 +230,11 @@
TYPE bool "bool" LIKE int;
TYPE byte "byte" LIKE int;
TYPE Common::String ""Common::String" USING write_CommonString read_CommonString;
-TYPE seg_id_t "seg_id_t" LIKE int;
+TYPE SegmentId "SegmentId" LIKE int;
TYPE sci_version_t "sci_version_t" USING write_sci_version read_sci_version;
TYPE menubar_tp "menubar_t *" USING write_menubar_tp read_menubar_tp;
-TYPE mem_obj_t "mem_obj_t" USING write_mem_obj_t read_mem_obj_t;
-TYPE mem_obj_ptr "mem_obj_t *" USING write_mem_obj_tp read_mem_obj_tp;
+TYPE MemObject "MemObject" USING write_MemObject read_MemObject;
+TYPE mem_obj_ptr "MemObject *" USING write_MemObjPtr read_MemObjPtr;
TYPE reg_t "reg_t" USING write_reg_t read_reg_t;
TYPE size_t "size_t" LIKE int;
TYPE IntMapperPtr "IntMapper *" USING write_IntMapperPtr read_IntMapperPtr;
@@ -298,12 +297,12 @@
int exports_wide;
int gc_mark_bits;
size_t mem_allocated;
- seg_id_t clones_seg_id;
- seg_id_t lists_seg_id;
- seg_id_t nodes_seg_id;
+ SegmentId Clones_seg_id;
+ SegmentId Lists_seg_id;
+ SegmentId Nodes_seg_id;
}
-RECORD class_t "class_t" {
+RECORD Class "Class" {
int script;
reg_t reg;
}
@@ -331,17 +330,17 @@
int status_bar_background;
SegManagerPtr seg_manager;
int classtable_size;
- class_t classtable[DYNAMIC classtable_size];
+ Class classtable[DYNAMIC classtable_size];
sfx_state_t sound;
}
-RECORD local_variables_t "local_variables_t" {
+RECORD LocalVariables "LocalVariables" {
int script_id;
int nr;
reg_t locals[DYNAMIC nr];
}
-RECORD object_t "object_t" {
+RECORD Object "Object" {
int flags;
reg_t pos;
int variables_nr;
@@ -350,7 +349,7 @@
reg_t variables[DYNAMIC variables_nr];
}
-RECORD clone_t "clone_t" {
+RECORD Clone "Clone" {
int flags;
reg_t pos;
int variables_nr;
@@ -359,58 +358,58 @@
reg_t variables[DYNAMIC variables_nr];
}
-RECORD list_t "list_t" {
+RECORD List "List" {
reg_t first;
reg_t last;
}
-RECORD node_t "node_t" {
+RECORD Node "Node" {
reg_t pred;
reg_t succ;
reg_t key;
reg_t value;
}
-RECORD clone_entry_t "clone_entry_t" {
+RECORD CloneEntry "CloneEntry" {
int next_free;
- clone_t entry;
+ Clone entry;
}
-RECORD clone_table_t "clone_table_t" {
+RECORD CloneTable "CloneTable" {
int entries_nr;
int first_free;
int entries_used;
int max_entry;
- clone_entry_t table[DYNAMIC entries_nr];
+ CloneEntry table[DYNAMIC entries_nr];
}
-RECORD list_entry_t "list_entry_t" {
+RECORD ListEntry "ListEntry" {
int next_free;
- list_t entry;
+ List entry;
}
-RECORD list_table_t "list_table_t" {
+RECORD ListTable "ListTable" {
int entries_nr;
int first_free;
int entries_used;
int max_entry;
- list_entry_t table[DYNAMIC entries_nr];
+ ListEntry table[DYNAMIC entries_nr];
}
-RECORD node_entry_t "node_entry_t" {
+RECORD NodeEntry "NodeEntry" {
int next_free;
- node_t entry;
+ Node entry;
}
-RECORD node_table_t "node_table_t" {
+RECORD NodeTable "NodeTable" {
int entries_nr;
int first_free;
int entries_used;
int max_entry;
- node_entry_t table[DYNAMIC entries_nr];
+ NodeEntry table[DYNAMIC entries_nr];
}
-RECORD script_t "script_t" {
+RECORD Script "Script" {
int nr;
size_t buf_size;
@@ -423,7 +422,7 @@
int lockers;
int objects_allocated;
int objects_nr;
- object_t objects[DYNAMIC objects_allocated];
+ Object objects[DYNAMIC objects_allocated];
int locals_offset;
int locals_segment;
@@ -441,7 +440,7 @@
SystemString strings[STATIC SYS_STRINGS_MAX];
}
-RECORD dynmem_t "dynmem_t" {
+RECORD DynMem "DynMem" {
int size;
string description;
byte buf[DYNAMIC size];
@@ -613,18 +612,18 @@
return -1;
}
-void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t const *foo) {
+void write_MemObject(Common::WriteStream *fh, MemObject const *foo) {
WSprintf(fh, "%s\n", mem_obj_string_names[foo->type].name);
%CFSMLWRITE int &foo->segmgr_id INTO fh;
switch (foo->type) {
case MEM_OBJ_SCRIPT:
- %CFSMLWRITE script_t &foo->data.script INTO fh;
+ %CFSMLWRITE Script &foo->data.script INTO fh;
break;
case MEM_OBJ_CLONES:
- %CFSMLWRITE clone_table_t &foo->data.clones INTO fh;
+ %CFSMLWRITE CloneTable &foo->data.clones INTO fh;
break;
case MEM_OBJ_LOCALS:
- %CFSMLWRITE local_variables_t &foo->data.locals INTO fh;
+ %CFSMLWRITE LocalVariables &foo->data.locals INTO fh;
break;
case MEM_OBJ_SYS_STRINGS:
%CFSMLWRITE SystemStrings &foo->data.sys_strings INTO fh;
@@ -635,55 +634,55 @@
case MEM_OBJ_HUNK:
break;
case MEM_OBJ_LISTS:
- %CFSMLWRITE list_table_t &foo->data.lists INTO fh;
+ %CFSMLWRITE ListTable &foo->data.lists INTO fh;
break;
case MEM_OBJ_NODES:
- %CFSMLWRITE node_table_t &foo->data.nodes INTO fh;
+ %CFSMLWRITE NodeTable &foo->data.nodes INTO fh;
break;
case MEM_OBJ_DYNMEM:
- %CFSMLWRITE dynmem_t &foo->data.dynmem INTO fh;
+ %CFSMLWRITE DynMem &foo->data.dynmem INTO fh;
break;
default:
break;
}
}
-int read_mem_obj_t(Common::SeekableReadStream *fh, mem_obj_t *foo, const char *lastval, int *line, int *hiteof) {
+int read_MemObject(Common::SeekableReadStream *fh, MemObject *foo, const char *lastval, int *line, int *hiteof) {
foo->type = (memObjType)mem_obj_string_to_enum(lastval);
if (foo->type < 0) {
- sciprintf("Unknown mem_obj_t type %s on line %d\n", lastval, *line);
+ sciprintf("Unknown MemObject type %s on line %d\n", lastval, *line);
return 1;
}
%CFSMLREAD int &foo->segmgr_id FROM fh ERRVAR *hiteof LINECOUNTER *line;
switch (foo->type) {
case MEM_OBJ_SCRIPT:
- %CFSMLREAD script_t &foo->data.script FROM fh ERRVAR *hiteof LINECOUNTER *line;
+ %CFSMLREAD Script &foo->data.script FROM fh ERRVAR *hiteof LINECOUNTER *line;
break;
case MEM_OBJ_CLONES:
- %CFSMLREAD clone_table_t &foo->data.clones FROM fh ERRVAR *hiteof LINECOUNTER *line;
+ %CFSMLREAD CloneTable &foo->data.clones FROM fh ERRVAR *hiteof LINECOUNTER *line;
break;
case MEM_OBJ_LOCALS:
- %CFSMLREAD local_variables_t &foo->data.locals FROM fh ERRVAR *hiteof LINECOUNTER *line;
+ %CFSMLREAD LocalVariables &foo->data.locals FROM fh ERRVAR *hiteof LINECOUNTER *line;
break;
case MEM_OBJ_SYS_STRINGS:
%CFSMLREAD SystemStrings &foo->data.sys_strings FROM fh ERRVAR *hiteof LINECOUNTER *line;
break;
case MEM_OBJ_LISTS:
- %CFSMLREAD list_table_t &foo->data.lists FROM fh ERRVAR *hiteof LINECOUNTER *line;
+ %CFSMLREAD ListTable &foo->data.lists FROM fh ERRVAR *hiteof LINECOUNTER *line;
break;
case MEM_OBJ_NODES:
- %CFSMLREAD node_table_t &foo->data.nodes FROM fh ERRVAR *hiteof LINECOUNTER *line;
+ %CFSMLREAD NodeTable &foo->data.nodes FROM fh ERRVAR *hiteof LINECOUNTER *line;
break;
case MEM_OBJ_STACK:
%CFSMLREAD int &foo->data.stack.nr FROM fh ERRVAR *hiteof LINECOUNTER *line;
foo->data.stack.entries = (reg_t *)sci_calloc(foo->data.stack.nr, sizeof(reg_t));
break;
case MEM_OBJ_HUNK:
- init_hunk_table(&foo->data.hunks);
+ init_Hunk_table(&foo->data.hunks);
break;
case MEM_OBJ_DYNMEM:
- %CFSMLREAD dynmem_t &foo->data.dynmem FROM fh ERRVAR *hiteof LINECOUNTER *line;
+ %CFSMLREAD DynMem &foo->data.dynmem FROM fh ERRVAR *hiteof LINECOUNTER *line;
break;
default:
break;
@@ -692,20 +691,20 @@
return *hiteof;
}
-void write_mem_obj_tp(Common::WriteStream *fh, const mem_obj_t * const *foo) {
+void write_MemObjPtr(Common::WriteStream *fh, const MemObject * const *foo) {
if (*foo) {
- %CFSMLWRITE mem_obj_t (*foo) INTO fh;
+ %CFSMLWRITE MemObject (*foo) INTO fh;
} else { // Nothing to write
WSprintf(fh, "\\null\\");
}
}
-int read_mem_obj_tp(Common::SeekableReadStream *fh, mem_obj_t **foo, const char *lastval, int *line, int *hiteof) {
+int read_MemObjPtr(Common::SeekableReadStream *fh, MemObject **foo, const char *lastval, int *line, int *hiteof) {
if (lastval[0] == '\\') {
*foo = NULL; // No menu bar
} else {
- *foo = (mem_obj_t *)sci_malloc(sizeof(mem_obj_t));
- %CFSMLREAD mem_obj_t (*foo) FROM fh ERRVAR *hiteof FIRSTTOKEN lastval LINECOUNTER *line;
+ *foo = (MemObject *)sci_malloc(sizeof(MemObject));
+ %CFSMLREAD MemObject (*foo) FROM fh ERRVAR *hiteof FIRSTTOKEN lastval LINECOUNTER *line;
return *hiteof;
}
return 0;
@@ -793,7 +792,7 @@
return 0;
}
-static seg_id_t find_unique_seg_by_type(SegManager *self, int type) {
+static SegmentId find_unique_seg_by_type(SegManager *self, int type) {
int i;
for (i = 0; i < self->heap_size; i++)
@@ -822,7 +821,7 @@
}
static void reconstruct_stack(EngineState *retval) {
- seg_id_t stack_seg = find_unique_seg_by_type(retval->seg_manager, MEM_OBJ_STACK);
+ SegmentId stack_seg = find_unique_seg_by_type(retval->seg_manager, MEM_OBJ_STACK);
dstack_t *stack = &(retval->seg_manager->heap[stack_seg]->data.stack);
retval->stack_segment = stack_seg;
@@ -830,10 +829,10 @@
retval->stack_top = retval->stack_base + VM_STACK_SIZE;
}
-static int clone_entry_used(clone_table_t *table, int n) {
+static int clone_entry_used(CloneTable *table, int n) {
int backup;
int seeker = table->first_free;
- clone_entry_t *entries = table->table;
+ CloneEntry *entries = table->table;
if (seeker == HEAPENTRY_INVALID) return 1;
@@ -846,9 +845,9 @@
return 1;
}
-static void load_script(EngineState *s, seg_id_t seg) {
+static void load_script(EngineState *s, SegmentId seg) {
resource_t *script, *heap = NULL;
- script_t *scr = &(s->seg_manager->heap[seg]->data.script);
+ Script *scr = &(s->seg_manager->heap[seg]->data.script);
scr->buf = (byte *)malloc(scr->buf_size);
@@ -869,14 +868,14 @@
static void reconstruct_scripts(EngineState *s, SegManager *self) {
int i;
- mem_obj_t *mobj;
+ MemObject *mobj;
for (i = 0; i < self->heap_size; i++) {
if (self->heap[i]) {
mobj = self->heap[i];
switch (mobj->type) {
case MEM_OBJ_SCRIPT: {
int j;
- script_t *scr = &mobj->data.script;
+ Script *scr = &mobj->data.script;
load_script(s, i);
scr->locals_block = scr->locals_segment == 0 ? NULL : &s->seg_manager->heap[scr->locals_segment]->data.locals;
@@ -908,7 +907,7 @@
switch (mobj->type) {
case MEM_OBJ_SCRIPT: {
int j;
- script_t *scr = &mobj->data.script;
+ Script *scr = &mobj->data.script;
for (j = 0; j < scr->objects_nr; j++) {
byte *data = scr->buf + scr->objects[j].pos.offset;
@@ -921,7 +920,7 @@
scr->objects[j].base_vars = prop_area;
} else {
int funct_area = getUInt16( data + SCRIPT_FUNCTAREAPTR_OFFSET );
- object_t *base_obj;
+ Object *base_obj;
base_obj = obj_get(s, scr->objects[j].variables[SCRIPT_SPECIES_SELECTOR]);
@@ -948,7 +947,7 @@
void reconstruct_clones(EngineState *s, SegManager *self) {
int i;
- mem_obj_t *mobj;
+ MemObject *mobj;
for (i = 0; i < self->heap_size; i++) {
if (self->heap[i]) {
@@ -956,7 +955,7 @@
switch (mobj->type) {
case MEM_OBJ_CLONES: {
int j;
- clone_entry_t *seeker = mobj->data.clones.table;
+ CloneEntry *seeker = mobj->data.clones.table;
sciprintf("Free list: ");
for (j = mobj->data.clones.first_free; j != HEAPENTRY_INVALID; j = mobj->data.clones.table[j].next_free) {
@@ -972,7 +971,7 @@
sciprintf("\n");
for (j = 0; j < mobj->data.clones.max_entry; j++) {
- object_t *base_obj;
+ Object *base_obj;
if (!clone_entry_used(&mobj->data.clones, j)) {
seeker++;
@@ -1119,7 +1118,7 @@
retval->save_dir_copy = make_reg(s->sys_strings_segment, SYS_STRING_SAVEDIR);
retval->save_dir_edit_offset = 0;
retval->sys_strings_segment = find_unique_seg_by_type(retval->seg_manager, MEM_OBJ_SYS_STRINGS);
- retval->sys_strings = &(((mem_obj_t *)(GET_SEGMENT(*retval->seg_manager, retval->sys_strings_segment, MEM_OBJ_SYS_STRINGS)))->data.sys_strings);
+ retval->sys_strings = &(((MemObject *)(GET_SEGMENT(*retval->seg_manager, retval->sys_strings_segment, MEM_OBJ_SYS_STRINGS)))->data.sys_strings);
// Restore system strings
SystemString *str;
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2009-02-28 11:09:38 UTC (rev 38960)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2009-02-28 11:12:59 UTC (rev 38961)
@@ -37,7 +37,6 @@
#include "sci/gfx/menubar.h"
#include "sci/sfx/sfx_engine.h"
#include "sci/engine/state.h"
-#include "sci/engine/heap.h"
#include "sci/engine/intmap.h"
#ifdef _WIN32
@@ -196,8 +195,8 @@
void write_menubar_tp(Common::WriteStream *fh, const menubar_t * const *foo);
int read_menubar_tp(Common::SeekableReadStream *fh, menubar_t **foo, const char *lastval, int *line, int *hiteof);
-void write_mem_obj_tp(Common::WriteStream *fh, const mem_obj_t * const *foo);
-int read_mem_obj_tp(Common::SeekableReadStream *fh, mem_obj_t **foo, const char *lastval, int *line, int *hiteof);
+void write_MemObjPtr(Common::WriteStream *fh, const MemObject * const *foo);
+int read_MemObjPtr(Common::SeekableReadStream *fh, MemObject **foo, const char *lastval, int *line, int *hiteof);
void write_songlib_t(Common::WriteStream *fh, songlib_t const *foo);
int read_songlib_t(Common::SeekableReadStream *fh, songlib_t *foo, const char *lastval, int *line, int *hiteof);
@@ -213,7 +212,7 @@
void write_SegManagerPtr(Common::WriteStream *fh, const SegManager * const *foo);
int read_SegManagerPtr(Common::SeekableReadStream *fh, SegManager **foo, const char *lastval, int *line, int *hiteof);
-typedef mem_obj_t *mem_obj_ptr;
+typedef MemObject *mem_obj_ptr;
// Unused types
/*
@@ -454,14 +453,6 @@
static int _cfsml_read_sfx_state_t(Common::SeekableReadStream *fh, sfx_state_t* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_clone_entry_t(Common::WriteStream *fh, clone_entry_t const * save_struc);
-static int _cfsml_read_clone_entry_t(Common::SeekableReadStream *fh, clone_entry_t* save_struc, const char *lastval, int *line, int *hiteof);
-
-#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_object_t(Common::WriteStream *fh, object_t const * save_struc);
-static int _cfsml_read_object_t(Common::SeekableReadStream *fh, object_t* save_struc, const char *lastval, int *line, int *hiteof);
-
-#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_string(Common::WriteStream *fh, const char * const * save_struc);
static int _cfsml_read_string(Common::SeekableReadStream *fh, char ** save_struc, const char *lastval, int *line, int *hiteof);
@@ -470,14 +461,22 @@
static int _cfsml_read_menubar_t(Common::SeekableReadStream *fh, menubar_t* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
+static void _cfsml_write_CloneTable(Common::WriteStream *fh, CloneTable const * save_struc);
+static int _cfsml_read_CloneTable(Common::SeekableReadStream *fh, CloneTable* save_struc, const char *lastval, int *line, int *hiteof);
+
+#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_size_t(Common::WriteStream *fh, size_t const * save_struc);
static int _cfsml_read_size_t(Common::SeekableReadStream *fh, size_t* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_list_entry_t(Common::WriteStream *fh, list_entry_t const * save_struc);
-static int _cfsml_read_list_entry_t(Common::SeekableReadStream *fh, list_entry_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_SegmentId(Common::WriteStream *fh, SegmentId const * save_struc);
+static int _cfsml_read_SegmentId(Common::SeekableReadStream *fh, SegmentId* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
+static void _cfsml_write_Node(Common::WriteStream *fh, Node const * save_struc);
+static int _cfsml_read_Node(Common::SeekableReadStream *fh, Node* save_struc, const char *lastval, int *line, int *hiteof);
+
+#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_SegManager(Common::WriteStream *fh, SegManager const * save_struc);
static int _cfsml_read_SegManager(Common::SeekableReadStream *fh, SegManager* save_struc, const char *lastval, int *line, int *hiteof);
@@ -490,28 +489,12 @@
static int _cfsml_read_menu_item_t(Common::SeekableReadStream *fh, menu_item_t* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_node_entry_t(Common::WriteStream *fh, node_entry_t const * save_struc);
-static int _cfsml_read_node_entry_t(Common::SeekableReadStream *fh, node_entry_t* save_struc, const char *lastval, int *line, int *hiteof);
-
-#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_seg_id_t(Common::WriteStream *fh, seg_id_t const * save_struc);
-static int _cfsml_read_seg_id_t(Common::SeekableReadStream *fh, seg_id_t* save_struc, const char *lastval, int *line, int *hiteof);
-
-#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_dynmem_t(Common::WriteStream *fh, dynmem_t const * save_struc);
-static int _cfsml_read_dynmem_t(Common::SeekableReadStream *fh, dynmem_t* save_struc, const char *lastval, int *line, int *hiteof);
-
-#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_local_variables_t(Common::WriteStream *fh, local_variables_t const * save_struc);
-static int _cfsml_read_local_variables_t(Common::SeekableReadStream *fh, local_variables_t* save_struc, const char *lastval, int *line, int *hiteof);
-
-#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_bool(Common::WriteStream *fh, bool const * save_struc);
static int _cfsml_read_bool(Common::SeekableReadStream *fh, bool* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_node_table_t(Common::WriteStream *fh, node_table_t const * save_struc);
-static int _cfsml_read_node_table_t(Common::SeekableReadStream *fh, node_table_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_NodeTable(Common::WriteStream *fh, NodeTable const * save_struc);
+static int _cfsml_read_NodeTable(Common::SeekableReadStream *fh, NodeTable* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_SystemString(Common::WriteStream *fh, SystemString const * save_struc);
@@ -522,24 +505,28 @@
static int _cfsml_read_byte(Common::SeekableReadStream *fh, byte* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_node_t(Common::WriteStream *fh, node_t const * save_struc);
-static int _cfsml_read_node_t(Common::SeekableReadStream *fh, node_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_ListTable(Common::WriteStream *fh, ListTable const * save_struc);
+static int _cfsml_read_ListTable(Common::SeekableReadStream *fh, ListTable* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
+static void _cfsml_write_Class(Common::WriteStream *fh, Class const * save_struc);
+static int _cfsml_read_Class(Common::SeekableReadStream *fh, Class* save_struc, const char *lastval, int *line, int *hiteof);
+
+#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_SystemStrings(Common::WriteStream *fh, SystemStrings const * save_struc);
static int _cfsml_read_SystemStrings(Common::SeekableReadStream *fh, SystemStrings* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_list_table_t(Common::WriteStream *fh, list_table_t const * save_struc);
-static int _cfsml_read_list_table_t(Common::SeekableReadStream *fh, list_table_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_song_handle_t(Common::WriteStream *fh, song_handle_t const * save_struc);
+static int _cfsml_read_song_handle_t(Common::SeekableReadStream *fh, song_handle_t* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_class_t(Common::WriteStream *fh, class_t const * save_struc);
-static int _cfsml_read_class_t(Common::SeekableReadStream *fh, class_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_List(Common::WriteStream *fh, List const * save_struc);
+static int _cfsml_read_List(Common::SeekableReadStream *fh, List* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_song_handle_t(Common::WriteStream *fh, song_handle_t const * save_struc);
-static int _cfsml_read_song_handle_t(Common::SeekableReadStream *fh, song_handle_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_NodeEntry(Common::WriteStream *fh, NodeEntry const * save_struc);
+static int _cfsml_read_NodeEntry(Common::SeekableReadStream *fh, NodeEntry* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_int(Common::WriteStream *fh, int const * save_struc);
@@ -550,10 +537,18 @@
static int _cfsml_read_EngineState(Common::SeekableReadStream *fh, EngineState* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
+static void _cfsml_write_CloneEntry(Common::WriteStream *fh, CloneEntry const * save_struc);
+static int _cfsml_read_CloneEntry(Common::SeekableReadStream *fh, CloneEntry* save_struc, const char *lastval, int *line, int *hiteof);
+
+#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_SavegameMetadata(Common::WriteStream *fh, SavegameMetadata const * save_struc);
static int _cfsml_read_SavegameMetadata(Common::SeekableReadStream *fh, SavegameMetadata* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
+static void _cfsml_write_LocalVariables(Common::WriteStream *fh, LocalVariables const * save_struc);
+static int _cfsml_read_LocalVariables(Common::SeekableReadStream *fh, LocalVariables* save_struc, const char *lastval, int *line, int *hiteof);
+
+#line 383 "engines/sci/engine/savegame.cfsml"
static void _cfsml_write_IntMapper(Common::WriteStream *fh, IntMapper const * save_struc);
static int _cfsml_read_IntMapper(Common::SeekableReadStream *fh, IntMapper* save_struc, const char *lastval, int *line, int *hiteof);
@@ -562,21 +557,25 @@
static int _cfsml_read_menu_t(Common::SeekableReadStream *fh, menu_t* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_clone_table_t(Common::WriteStream *fh, clone_table_t const * save_struc);
-static int _cfsml_read_clone_table_t(Common::SeekableReadStream *fh, clone_table_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_Object(Common::WriteStream *fh, Object const * save_struc);
+static int _cfsml_read_Object(Common::SeekableReadStream *fh, Object* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_list_t(Common::WriteStream *fh, list_t const * save_struc);
-static int _cfsml_read_list_t(Common::SeekableReadStream *fh, list_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_ListEntry(Common::WriteStream *fh, ListEntry const * save_struc);
+static int _cfsml_read_ListEntry(Common::SeekableReadStream *fh, ListEntry* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_clone_t(Common::WriteStream *fh, clone_t const * save_struc);
-static int _cfsml_read_clone_t(Common::SeekableReadStream *fh, clone_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_Clone(Common::WriteStream *fh, Clone const * save_struc);
+static int _cfsml_read_Clone(Common::SeekableReadStream *fh, Clone* save_struc, const char *lastval, int *line, int *hiteof);
#line 383 "engines/sci/engine/savegame.cfsml"
-static void _cfsml_write_script_t(Common::WriteStream *fh, script_t const * save_struc);
-static int _cfsml_read_script_t(Common::SeekableReadStream *fh, script_t* save_struc, const char *lastval, int *line, int *hiteof);
+static void _cfsml_write_DynMem(Common::WriteStream *fh, DynMem const * save_struc);
+static int _cfsml_read_DynMem(Common::SeekableReadStream *fh, DynMem* save_struc, const char *lastval, int *line, int *hiteof);
+#line 383 "engines/sci/engine/savegame.cfsml"
+static void _cfsml_write_Script(Common::WriteStream *fh, Script const * save_struc);
+static int _cfsml_read_Script(Common::SeekableReadStream *fh, Script* save_struc, const char *lastval, int *line, int *hiteof);
+
#line 396 "engines/sci/engine/savegame.cfsml"
static void
_cfsml_write_sfx_state_t(Common::WriteStream *fh, sfx_state_t const * save_struc)
@@ -644,109 +643,62 @@
#line 396 "engines/sci/engine/savegame.cfsml"
static void
-_cfsml_write_clone_entry_t(Common::WriteStream *fh, clone_entry_t const * save_struc)
+_cfsml_write_string(Common::WriteStream *fh, const char * const * save_struc)
{
-#line 413 "engines/sci/engine/savegame.cfsml"
- WSprintf(fh, "{\n");
- WSprintf(fh, "next_free = ");
- _cfsml_write_int(fh, (int const *) &(save_struc->next_free));
- WSprintf(fh, "\n");
- WSprintf(fh, "entry = ");
- _cfsml_write_clone_t(fh, (clone_t const *) &(save_struc->entry));
- WSprintf(fh, "\n");
- WSprintf(fh, "}");
+#line 403 "engines/sci/engine/savegame.cfsml"
+ if (!(*save_struc))
+ WSprintf(fh, "\\null\\");
+ else {
+ char *token = _cfsml_mangle_string((const char *) *save_struc);
+ WSprintf(fh, "\"%s\"", token);
+ free(token);
+ }
}
#line 487 "engines/sci/engine/savegame.cfsml"
static int
-_cfsml_read_clone_entry_t(Common::SeekableReadStream *fh, clone_entry_t* save_struc, const char *lastval, int *line, int *hiteof)
+_cfsml_read_string(Common::SeekableReadStream *fh, char ** save_struc, const char *lastval, int *line, int *hiteof)
{
-#line 542 "engines/sci/engine/savegame.cfsml"
- char *token;
- int assignment, closed;
+#line 520 "engines/sci/engine/savegame.cfsml"
- if (strcmp(lastval, "{")) {
- _cfsml_error("Reading record clone_entry_t; expected opening braces in line %d, got \"%s\"\n", *line, lastval);
- return CFSML_FAILURE;
- };
- closed = 0;
- do {
- const char *value;
- token = _cfsml_get_identifier(fh, line, hiteof, &assignment);
+ if (strcmp(lastval, "\\null\\")) { // null pointer?
+ unsigned int length = strlen(lastval);
+ if (*lastval == '"') { // Quoted string?
+ while (lastval[length] != '"')
+ --length;
- if (!token) {
- _cfsml_error("Expected token at line %d\n", *line);
- return CFSML_FAILURE;
- }
- if (!assignment) {
- if (!strcmp(token, "}"))
- closed = 1;
- else {
- _cfsml_error("Expected assignment or closing braces in line %d\n", *line);
+ if (!length) { // No matching double-quotes?
+ _cfsml_error("Unbalanced quotes at line %d\n", *line);
return CFSML_FAILURE;
}
- } else {
- value = "";
- while (!value || !strcmp(value, ""))
- value = _cfsml_get_value(fh, line, hiteof);
- if (!value) {
- _cfsml_error("Expected token at line %d\n", *line);
- return CFSML_FAILURE;
- }
- if (!strcmp(token, "next_free")) {
-#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_int(fh, (int*) &(save_struc->next_free), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_int() for next_free at line %d\n", *line);
- return CFSML_FAILURE;
- }
- } else
- if (!strcmp(token, "entry")) {
-#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_clone_t(fh, (clone_t*) &(save_struc->entry), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_clone_t() for entry at line %d\n", *line);
- return CFSML_FAILURE;
- }
- } else
-#line 700 "engines/sci/engine/savegame.cfsml"
- {
- _cfsml_error("clone_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line);
- return CFSML_FAILURE;
- }
+
+ lastval++; // ...and skip the opening quotes locally
+ length--;
}
- } while (!closed); // Until closing braces are hit
- return CFSML_SUCCESS;
+ *save_struc = _cfsml_unmangle_string(lastval, length);
+ _cfsml_register_pointer(*save_struc);
+ return CFSML_SUCCESS;
+ } else {
+ *save_struc = NULL;
+ return CFSML_SUCCESS;
+ }
}
#line 396 "engines/sci/engine/savegame.cfsml"
static void
-_cfsml_write_object_t(Common::WriteStream *fh, object_t const * save_struc)
+_cfsml_write_menubar_t(Common::WriteStream *fh, menubar_t const * save_struc)
{
#line 413 "engines/sci/engine/savegame.cfsml"
WSprintf(fh, "{\n");
- WSprintf(fh, "flags = ");
- _cfsml_write_int(fh, (int const *) &(save_struc->flags));
- WSprintf(fh, "\n");
- WSprintf(fh, "pos = ");
- write_reg_t(fh, (reg_t const *) &(save_struc->pos));
- WSprintf(fh, "\n");
- WSprintf(fh, "variables_nr = ");
- _cfsml_write_int(fh, (int const *) &(save_struc->variables_nr));
- WSprintf(fh, "\n");
- WSprintf(fh, "variable_names_nr = ");
- _cfsml_write_int(fh, (int const *) &(save_struc->variable_names_nr));
- WSprintf(fh, "\n");
- WSprintf(fh, "methods_nr = ");
- _cfsml_write_int(fh, (int const *) &(save_struc->methods_nr));
- WSprintf(fh, "\n");
- WSprintf(fh, "variables = ");
+ WSprintf(fh, "menus = ");
int min, max;
- min = max = save_struc->variables_nr;
- if (!save_struc->variables)
+ min = max = save_struc->menus_nr;
+ if (!save_struc->menus)
min = max = 0; /* Don't write if it points to NULL */
#line 440 "engines/sci/engine/savegame.cfsml"
WSprintf(fh, "[%d][\n", max);
for (int i = 0; i < min; i++) {
- write_reg_t(fh, &(save_struc->variables[i]));
+ _cfsml_write_menu_t(fh, &(save_struc->menus[i]));
WSprintf(fh, "\n");
}
WSprintf(fh, "]");
@@ -756,14 +708,14 @@
#line 487 "engines/sci/engine/savegame.cfsml"
static int
-_cfsml_read_object_t(Common::SeekableReadStream *fh, object_t* save_struc, const char *lastval, int *line, int *hiteof)
+_cfsml_read_menubar_t(Common::SeekableReadStream *fh, menubar_t* save_struc, const char *lastval, int *line, int *hiteof)
{
#line 542 "engines/sci/engine/savegame.cfsml"
char *token;
int assignment, closed;
if (strcmp(lastval, "{")) {
- _cfsml_error("Reading record object_t; expected opening braces in line %d, got \"%s\"\n", *line, lastval);
+ _cfsml_error("Reading record menubar_t; expected opening braces in line %d, got \"%s\"\n", *line, lastval);
return CFSML_FAILURE;
};
closed = 0;
@@ -790,42 +742,7 @@
_cfsml_error("Expected token at line %d\n", *line);
return CFSML_FAILURE;
}
- if (!strcmp(token, "flags")) {
-#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_int(fh, (int*) &(save_struc->flags), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_int() for flags at line %d\n", *line);
- return CFSML_FAILURE;
- }
- } else
- if (!strcmp(token, "pos")) {
-#line 691 "engines/sci/engine/savegame.cfsml"
- if (read_reg_t(fh, (reg_t*) &(save_struc->pos), value, line, hiteof)) {
- _cfsml_error("Token expected by read_reg_t() for pos at line %d\n", *line);
- return CFSML_FAILURE;
- }
- } else
- if (!strcmp(token, "variables_nr")) {
-#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_int(fh, (int*) &(save_struc->variables_nr), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_int() for variables_nr at line %d\n", *line);
- return CFSML_FAILURE;
- }
- } else
- if (!strcmp(token, "variable_names_nr")) {
-#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_int(fh, (int*) &(save_struc->variable_names_nr), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_int() for variable_names_nr at line %d\n", *line);
- return CFSML_FAILURE;
- }
- } else
- if (!strcmp(token, "methods_nr")) {
-#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_int(fh, (int*) &(save_struc->methods_nr), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_int() for methods_nr at line %d\n", *line);
- return CFSML_FAILURE;
- }
- } else
- if (!strcmp(token, "variables")) {
+ if (!strcmp(token, "menus")) {
#line 605 "engines/sci/engine/savegame.cfsml"
if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) {
_cfsml_error("Opening brackets expected at line %d\n", *line);
@@ -841,13 +758,13 @@
}
if (max) {
- save_struc->variables = (reg_t *)sci_malloc(max * sizeof(reg_t));
+ save_struc->menus = (menu_t *)sci_malloc(max * sizeof(menu_t));
#ifdef SATISFY_PURIFY
- memset(save_struc->variables, 0, max * sizeof(reg_t));
+ memset(save_struc->menus, 0, max * sizeof(menu_t));
#endif
- _cfsml_register_pointer(save_struc->variables);
+ _cfsml_register_pointer(save_struc->menus);
} else
- save_struc->variables = NULL;
+ save_struc->menus = NULL;
#line 640 "engines/sci/engine/savegame.cfsml"
done = i = 0;
do {
@@ -861,18 +778,18 @@
_cfsml_error("More elements than space available (%d) in '%s' at line %d\n", max, token, *line);
return CFSML_FAILURE;
}
- if (read_reg_t(fh, &(save_struc->variables[i++]), value, line, hiteof)) {
- _cfsml_error("Token expected by read_reg_t() for variables[i++] at line %d\n", *line);
+ if (_cfsml_read_menu_t(fh, &(save_struc->menus[i++]), value, line, hiteof)) {
+ _cfsml_error("Token expected by _cfsml_read_menu_t() for menus[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
} else
done = 1;
} while (!done);
- save_struc->variables_nr = max ; // Set array size accordingly
+ save_struc->menus_nr = max ; // Set array size accordingly
} else
#line 700 "engines/sci/engine/savegame.cfsml"
{
- _cfsml_error("object_t: Assignment to invalid identifier '%s' in line %d\n", token, *line);
+ _cfsml_error("menubar_t: Assignment to invalid identifier '%s' in line %d\n", token, *line);
return CFSML_FAILURE;
}
}
@@ -882,62 +799,31 @@
#line 396 "engines/sci/engine/savegame.cfsml"
static void
-_cfsml_write_string(Common::WriteStream *fh, const char * const * save_struc)
+_cfsml_write_CloneTable(Common::WriteStream *fh, CloneTable const * save_struc)
{
-#line 403 "engines/sci/engine/savegame.cfsml"
- if (!(*save_struc))
- WSprintf(fh, "\\null\\");
- else {
- char *token = _cfsml_mangle_string((const char *) *save_struc);
- WSprintf(fh, "\"%s\"", token);
- free(token);
- }
-}
-
-#line 487 "engines/sci/engine/savegame.cfsml"
-static int
-_cfsml_read_string(Common::SeekableReadStream *fh, char ** save_struc, const char *lastval, int *line, int *hiteof)
-{
-#line 520 "engines/sci/engine/savegame.cfsml"
-
- if (strcmp(lastval, "\\null\\")) { // null pointer?
- unsigned int length = strlen(lastval);
- if (*lastval == '"') { // Quoted string?
- while (lastval[length] != '"')
- --length;
-
- if (!length) { // No matching double-quotes?
- _cfsml_error("Unbalanced quotes at line %d\n", *line);
- return CFSML_FAILURE;
- }
-
- lastval++; // ...and skip the opening quotes locally
- length--;
- }
- *save_struc = _cfsml_unmangle_string(lastval, length);
- _cfsml_register_pointer(*save_struc);
- return CFSML_SUCCESS;
- } else {
- *save_struc = NULL;
- return CFSML_SUCCESS;
- }
-}
-
-#line 396 "engines/sci/engine/savegame.cfsml"
-static void
-_cfsml_write_menubar_t(Common::WriteStream *fh, menubar_t const * save_struc)
-{
#line 413 "engines/sci/engine/savegame.cfsml"
WSprintf(fh, "{\n");
- WSprintf(fh, "menus = ");
+ WSprintf(fh, "entries_nr = ");
+ _cfsml_write_int(fh, (int const *) &(save_struc->entries_nr));
+ WSprintf(fh, "\n");
+ WSprintf(fh, "first_free = ");
+ _cfsml_write_int(fh, (int const *) &(save_struc->first_free));
+ WSprintf(fh, "\n");
+ WSprintf(fh, "entries_used = ");
+ _cfsml_write_int(fh, (int const *) &(save_struc->entries_used));
+ WSprintf(fh, "\n");
+ WSprintf(fh, "max_entry = ");
+ _cfsml_write_int(fh, (int const *) &(save_struc->max_entry));
+ WSprintf(fh, "\n");
+ WSprintf(fh, "table = ");
int min, max;
- min = max = save_struc->menus_nr;
- if (!save_struc->menus)
+ min = max = save_struc->entries_nr;
+ if (!save_struc->table)
min = max = 0; /* Don't write if it points to NULL */
#line 440 "engines/sci/engine/savegame.cfsml"
WSprintf(fh, "[%d][\n", max);
for (int i = 0; i < min; i++) {
- _cfsml_write_menu_t(fh, &(save_struc->menus[i]));
+ _cfsml_write_CloneEntry(fh, &(save_struc->table[i]));
WSprintf(fh, "\n");
}
WSprintf(fh, "]");
@@ -947,14 +833,14 @@
#line 487 "engines/sci/engine/savegame.cfsml"
static int
-_cfsml_read_menubar_t(Common::SeekableReadStream *fh, menubar_t* save_struc, const char *lastval, int *line, int *hiteof)
+_cfsml_read_CloneTable(Common::SeekableReadStream *fh, CloneTable* save_struc, const char *lastval, int *line, int *hiteof)
{
#line 542 "engines/sci/engine/savegame.cfsml"
char *token;
int assignment, closed;
if (strcmp(lastval, "{")) {
- _cfsml_error("Reading record menubar_t; expected opening braces in line %d, got \"%s\"\n", *line, lastval);
+ _cfsml_error("Reading record CloneTable; expected opening braces in line %d, got \"%s\"\n", *line, lastval);
return CFSML_FAILURE;
};
closed = 0;
@@ -981,7 +867,35 @@
_cfsml_error("Expected token at line %d\n", *line);
return CFSML_FAILURE;
}
- if (!strcmp(token, "menus")) {
+ if (!strcmp(token, "entries_nr")) {
+#line 691 "engines/sci/engine/savegame.cfsml"
+ if (_cfsml_read_int(fh, (int*) &(save_struc->entries_nr), value, line, hiteof)) {
+ _cfsml_error("Token expected by _cfsml_read_int() for entries_nr at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ } else
+ if (!strcmp(token, "first_free")) {
+#line 691 "engines/sci/engine/savegame.cfsml"
+ if (_cfsml_read_int(fh, (int*) &(save_struc->first_free), value, line, hiteof)) {
+ _cfsml_error("Token expected by _cfsml_read_int() for first_free at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ } else
+ if (!strcmp(token, "entries_used")) {
+#line 691 "engines/sci/engine/savegame.cfsml"
+ if (_cfsml_read_int(fh, (int*) &(save_struc->entries_used), value, line, hiteof)) {
+ _cfsml_error("Token expected by _cfsml_read_int() for entries_used at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ } else
+ if (!strcmp(token, "max_entry")) {
+#line 691 "engines/sci/engine/savegame.cfsml"
+ if (_cfsml_read_int(fh, (int*) &(save_struc->max_entry), value, line, hiteof)) {
+ _cfsml_error("Token expected by _cfsml_read_int() for max_entry at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ } else
+ if (!strcmp(token, "table")) {
#line 605 "engines/sci/engine/savegame.cfsml"
if ((value[0] != '[') || (value[strlen(value) - 1] != '[')) {
_cfsml_error("Opening brackets expected at line %d\n", *line);
@@ -997,13 +911,13 @@
}
if (max) {
- save_struc->menus = (menu_t *)sci_malloc(max * sizeof(menu_t));
+ save_struc->table = (CloneEntry *)sci_malloc(max * sizeof(CloneEntry));
#ifdef SATISFY_PURIFY
- memset(save_struc->menus, 0, max * sizeof(menu_t));
+ memset(save_struc->table, 0, max * sizeof(CloneEntry));
#endif
- _cfsml_register_pointer(save_struc->menus);
+ _cfsml_register_pointer(save_struc->table);
} else
- save_struc->menus = NULL;
+ save_struc->table = NULL;
#line 640 "engines/sci/engine/savegame.cfsml"
done = i = 0;
do {
@@ -1017,18 +931,18 @@
_cfsml_error("More elements than space available (%d) in '%s' at line %d\n", max, token, *line);
return CFSML_FAILURE;
}
- if (_cfsml_read_menu_t(fh, &(save_struc->menus[i++]), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_menu_t() for menus[i++] at line %d\n", *line);
+ if (_cfsml_read_CloneEntry(fh, &(save_struc->table[i++]), value, line, hiteof)) {
+ _cfsml_error("Token expected by _cfsml_read_CloneEntry() for table[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
} else
done = 1;
} while (!done);
- save_struc->menus_nr = max ; // Set array size accordingly
+ save_struc->entries_nr = max ; // Set array size accordingly
} else
#line 700 "engines/sci/engine/savegame.cfsml"
{
- _cfsml_error("menubar_t: Assignment to invalid identifier '%s' in line %d\n", token, *line);
+ _cfsml_error("CloneTable: Assignment to invalid identifier '%s' in line %d\n", token, *line);
return CFSML_FAILURE;
}
}
@@ -1064,29 +978,61 @@
#line 396 "engines/sci/engine/savegame.cfsml"
static void
-_cfsml_write_list_entry_t(Common::WriteStream *fh, list_entry_t const * save_struc)
+_cfsml_write_SegmentId(Common::WriteStream *fh, SegmentId const * save_struc)
{
+ WSprintf(fh, "%li", (long)*save_struc);
+}
+
+#line 487 "engines/sci/engine/savegame.cfsml"
+static int
+_cfsml_read_SegmentId(Common::SeekableReadStream *fh, SegmentId* save_struc, const char *lastval, int *line, int *hiteof)
+{
+#line 507 "engines/sci/engine/savegame.cfsml"
+ char *token;
+
+ *save_struc = strtol(lastval, &token, 0);
+ if ((*save_struc == 0) && (token == lastval)) {
+ _cfsml_error("strtol failed at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ if (*token != 0) {
+ _cfsml_error("Non-integer encountered while parsing int value at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ return CFSML_SUCCESS;
+}
+
+#line 396 "engines/sci/engine/savegame.cfsml"
+static void
+_cfsml_write_Node(Common::WriteStream *fh, Node const * save_struc)
+{
#line 413 "engines/sci/engine/savegame.cfsml"
WSprintf(fh, "{\n");
- WSprintf(fh, "next_free = ");
- _cfsml_write_int(fh, (int const *) &(save_struc->next_free));
+ WSprintf(fh, "pred = ");
+ write_reg_t(fh, (reg_t const *) &(save_struc->pred));
WSprintf(fh, "\n");
- WSprintf(fh, "entry = ");
- _cfsml_write_list_t(fh, (list_t const *) &(save_struc->entry));
+ WSprintf(fh, "succ = ");
+ write_reg_t(fh, (reg_t const *) &(save_struc->succ));
WSprintf(fh, "\n");
+ WSprintf(fh, "key = ");
+ write_reg_t(fh, (reg_t const *) &(save_struc->key));
+ WSprintf(fh, "\n");
+ WSprintf(fh, "value = ");
+ write_reg_t(fh, (reg_t const *) &(save_struc->value));
+ WSprintf(fh, "\n");
WSprintf(fh, "}");
}
#line 487 "engines/sci/engine/savegame.cfsml"
static int
-_cfsml_read_list_entry_t(Common::SeekableReadStream *fh, list_entry_t* save_struc, const char *lastval, int *line, int *hiteof)
+_cfsml_read_Node(Common::SeekableReadStream *fh, Node* save_struc, const char *lastval, int *line, int *hiteof)
{
#line 542 "engines/sci/engine/savegame.cfsml"
char *token;
int assignment, closed;
if (strcmp(lastval, "{")) {
- _cfsml_error("Reading record list_entry_t; expected opening braces in line %d, got \"%s\"\n", *line, lastval);
+ _cfsml_error("Reading record Node; expected opening braces in line %d, got \"%s\"\n", *line, lastval);
return CFSML_FAILURE;
};
closed = 0;
@@ -1113,23 +1059,37 @@
_cfsml_error("Expected token at line %d\n", *line);
return CFSML_FAILURE;
}
- if (!strcmp(token, "next_free")) {
+ if (!strcmp(token, "pred")) {
#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_int(fh, (int*) &(save_struc->next_free), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_int() for next_free at line %d\n", *line);
+ if (read_reg_t(fh, (reg_t*) &(save_struc->pred), value, line, hiteof)) {
+ _cfsml_error("Token expected by read_reg_t() for pred at line %d\n", *line);
return CFSML_FAILURE;
}
} else
- if (!strcmp(token, "entry")) {
+ if (!strcmp(token, "succ")) {
#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_list_t(fh, (list_t*) &(save_struc->entry), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_list_t() for entry at line %d\n", *line);
+ if (read_reg_t(fh, (reg_t*) &(save_struc->succ), value, line, hiteof)) {
+ _cfsml_error("Token expected by read_reg_t() for succ at line %d\n", *line);
return CFSML_FAILURE;
}
} else
+ if (!strcmp(token, "key")) {
+#line 691 "engines/sci/engine/savegame.cfsml"
+ if (read_reg_t(fh, (reg_t*) &(save_struc->key), value, line, hiteof)) {
+ _cfsml_error("Token expected by read_reg_t() for key at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ } else
+ if (!strcmp(token, "value")) {
+#line 691 "engines/sci/engine/savegame.cfsml"
+ if (read_reg_t(fh, (reg_t*) &(save_struc->value), value, line, hiteof)) {
+ _cfsml_error("Token expected by read_reg_t() for value at line %d\n", *line);
+ return CFSML_FAILURE;
+ }
+ } else
#line 700 "engines/sci/engine/savegame.cfsml"
{
- _cfsml_error("list_entry_t: Assignment to invalid identifier '%s' in line %d\n", token, *line);
+ _cfsml_error("Node: Assignment to invalid identifier '%s' in line %d\n", token, *line);
return CFSML_FAILURE;
}
}
@@ -1154,7 +1114,7 @@
#line 440 "engines/sci/engine/savegame.cfsml"
WSprintf(fh, "[%d][\n", max);
for (int i = 0; i < min; i++) {
- write_mem_obj_tp(fh, &(save_struc->heap[i]));
+ write_MemObjPtr(fh, &(save_struc->heap[i]));
WSprintf(fh, "\n");
}
WSprintf(fh, "]");
@@ -1174,14 +1134,14 @@
WSprintf(fh, "mem_allocated = ");
_cfsml_write_size_t(fh, (size_t const *) &(save_struc->mem_allocated));
WSprintf(fh, "\n");
- WSprintf(fh, "clones_seg_id = ");
- _cfsml_write_seg_id_t(fh, (seg_id_t const *) &(save_struc->clones_seg_id));
+ WSprintf(fh, "Clones_seg_id = ");
+ _cfsml_write_SegmentId(fh, (SegmentId const *) &(save_struc->Clones_seg_id));
WSprintf(fh, "\n");
- WSprintf(fh, "lists_seg_id = ");
- _cfsml_write_seg_id_t(fh, (seg_id_t const *) &(save_struc->lists_seg_id));
+ WSprintf(fh, "Lists_seg_id = ");
+ _cfsml_write_SegmentId(fh, (SegmentId const *) &(save_struc->Lists_seg_id));
WSprintf(fh, "\n");
- WSprintf(fh, "nodes_seg_id = ");
- _cfsml_write_seg_id_t(fh, (seg_id_t const *) &(save_struc->nodes_seg_id));
+ WSprintf(fh, "Nodes_seg_id = ");
+ _cfsml_write_SegmentId(fh, (SegmentId const *) &(save_struc->Nodes_seg_id));
WSprintf(fh, "\n");
WSprintf(fh, "}");
}
@@ -1265,8 +1225,8 @@
_cfsml_error("More elements than space available (%d) in '%s' at line %d\n", max, token, *line);
return CFSML_FAILURE;
}
- if (read_mem_obj_tp(fh, &(save_struc->heap[i++]), value, line, hiteof)) {
- _cfsml_error("Token expected by read_mem_obj_tp() for heap[i++] at line %d\n", *line);
+ if (read_MemObjPtr(fh, &(save_struc->heap[i++]), value, line, hiteof)) {
+ _cfsml_error("Token expected by read_MemObjPtr() for heap[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
} else
@@ -1309,24 +1269,24 @@
return CFSML_FAILURE;
}
} else
- if (!strcmp(token, "clones_seg_id")) {
+ if (!strcmp(token, "Clones_seg_id")) {
#line 691 "engines/sci/engine/savegame.cfsml"
- if (_cfsml_read_seg_id_t(fh, (seg_id_t*) &(save_struc->clones_seg_id), value, line, hiteof)) {
- _cfsml_error("Token expected by _cfsml_read_seg_id_t() for clones_seg_id at line %d\n", *line);
+ if (_cfsml_read_SegmentId(fh, (SegmentId*) &(save_struc->Clones_seg_id), value, line, hiteof)) {
+ _cfsml_error("Token expected by _cfsml_read_SegmentId() for Clones_seg_id at line %d\n", *line);
return CFSML_FAILURE;
}
} else
- if (!strcmp(token, "lists_seg_id")) {
+ if (!strcmp(token, "Lists_seg_id")) {
#line 691 "engines/sci/engine/savegame.cfsml"
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list