[Scummvm-cvs-logs] CVS: scummvm/simon simon.h,1.6,1.7 simon.cpp,1.9,1.10
Ludvig Strigeus
strigeus at users.sourceforge.net
Sun Apr 14 04:01:01 CEST 2002
Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv4988
Modified Files:
simon.h simon.cpp
Log Message:
fixed alignment bugs and intro freeze in simon2
Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** simon.h 13 Apr 2002 21:06:48 -0000 1.6
--- simon.h 14 Apr 2002 11:00:33 -0000 1.7
***************
*** 902,906 ****
void delete_vga_timer(VgaTimerEntry *vte);
void vc_resume_thread(byte *code_ptr, uint16 cur_file, uint16 cur_sprite);
! int vc_read_var_or_word(void *ptr);
uint vc_read_next_word();
uint vc_read_next_byte();
--- 902,906 ----
void delete_vga_timer(VgaTimerEntry *vte);
void vc_resume_thread(byte *code_ptr, uint16 cur_file, uint16 cur_sprite);
! int vc_read_var_or_word();
uint vc_read_next_word();
uint vc_read_next_byte();
Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** simon.cpp 13 Apr 2002 21:06:48 -0000 1.9
--- simon.cpp 14 Apr 2002 11:00:33 -0000 1.10
***************
*** 2155,2158 ****
--- 2155,2160 ----
readSfxFile(filename);
+ alignTableMem();
+
_tablesheap_ptr_new = _tablesheap_ptr;
_tablesheap_curpos_new = _tablesheap_curpos;
***************
*** 2435,2439 ****
} else if (_last_hitarea->item_ptr != NULL) {
_hitarea_object_item = _last_hitarea->item_ptr;
! _variableArray[0x78/2] = (_last_hitarea->flags&1) ? (_last_hitarea->flags>>8) : 0xFFFF;
break;
}
--- 2437,2441 ----
} else if (_last_hitarea->item_ptr != NULL) {
_hitarea_object_item = _last_hitarea->item_ptr;
! _variableArray[60] = (_last_hitarea->flags&1) ? (_last_hitarea->flags>>8) : 0xFFFF;
break;
}
***************
*** 2821,2825 ****
if (_bit_array[4]&0x8000) {
Subroutine *sub;
! _variableArray[0xA8/2] = a;
sub = getSubroutineByID(5003);
if (sub != NULL)
--- 2823,2827 ----
if (_bit_array[4]&0x8000) {
Subroutine *sub;
! _variableArray[84] = a;
sub = getSubroutineByID(5003);
if (sub != NULL)
***************
*** 3250,3254 ****
if (ha->flags&1)
id = ha->flags>>8;
! _variableArray[0x78/2] = id;
new_current_hitarea(ha);
if (_verb_hitarea != 0)
--- 3252,3256 ----
if (ha->flags&1)
id = ha->flags>>8;
! _variableArray[60] = id;
new_current_hitarea(ha);
if (_verb_hitarea != 0)
***************
*** 3887,3892 ****
#ifdef DUMP_CONTINOUS_VGASCRIPT
if ((void*)_vc_ptr != (void*)&vc_get_out_of_code) {
! fprintf(_dump_file,"%.5X: %5d %4d ", _vc_ptr -_cur_vga_file_1, _vga_cur_sprite_id, _vga_cur_file_id);
! dump_video_script(_vc_ptr, true);
}
#endif
--- 3889,3897 ----
#ifdef DUMP_CONTINOUS_VGASCRIPT
if ((void*)_vc_ptr != (void*)&vc_get_out_of_code) {
! // if (_vga_cur_sprite_id==62 && _vga_cur_file_id==68 ||
! // _vga_cur_sprite_id==1 && _vga_cur_file_id==2) {
! fprintf(_dump_file,"%.5d %.5X: %5d %4d ", _vga_tick_counter, _vc_ptr -_cur_vga_file_1, _vga_cur_sprite_id, _vga_cur_file_id);
! dump_video_script(_vc_ptr, true);
! // }
}
#endif
***************
*** 3909,3914 ****
}
! int SimonState::vc_read_var_or_word(void *ptr) {
! int16 var = READ_BE_UINT16_UNALIGNED(ptr);
if (var < 0)
var = vc_read_var(-var);
--- 3914,3919 ----
}
! int SimonState::vc_read_var_or_word() {
! int16 var = vc_read_next_word();
if (var < 0)
var = vc_read_var(-var);
***************
*** 3977,3981 ****
byte *b,*bb, *vc_ptr_org;
! num = vc_read_var_or_word(_vc_ptr);
old_file_1 = _cur_vga_file_1;
--- 3982,3986 ----
byte *b,*bb, *vc_ptr_org;
! num = vc_read_var_or_word();
old_file_1 = _cur_vga_file_1;
***************
*** 4016,4020 ****
_cur_vga_file_2 = old_file_2;
! _vc_ptr = vc_ptr_org + 2;
}
--- 4021,4025 ----
_cur_vga_file_2 = old_file_2;
! _vc_ptr = vc_ptr_org;
}
***************
*** 4725,4730 ****
if (!(_game & GAME_SIMON2)) {
! num = vc_read_var_or_word(_vc_ptr);
! _vc_ptr += 2;
} else {
num = vc_read_next_byte() * _vga_base_delay;
--- 4730,4734 ----
if (!(_game & GAME_SIMON2)) {
! num = vc_read_var_or_word();
} else {
num = vc_read_next_byte() * _vga_base_delay;
***************
*** 4898,4903 ****
void SimonState::vc_24_set_image_xy() {
VgaSprite *vsp = find_cur_sprite();
! vsp->image = vc_read_var_or_word(_vc_ptr);
! _vc_ptr += 2;
if (vsp->id==0) {
--- 4902,4906 ----
void SimonState::vc_24_set_image_xy() {
VgaSprite *vsp = find_cur_sprite();
! vsp->image = vc_read_var_or_word();
if (vsp->id==0) {
***************
*** 5305,5310 ****
/* No-Op in simon1 */
if (_game & GAME_SIMON2) {
! uint num = vc_read_var_or_word(_vc_ptr) * _vga_base_delay;
! _vc_ptr += 2;
add_vga_timer(num + gss->VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id);
_vc_ptr = (byte*)&vc_get_out_of_code;
--- 5308,5317 ----
/* No-Op in simon1 */
if (_game & GAME_SIMON2) {
! uint num = vc_read_var_or_word() * _vga_base_delay;
!
! #ifdef DUMP_CONTINOUS_VGASCRIPT
! fprintf(_dump_file,"; sleep_ex = %d\n", num + gss->VGA_DELAY_BASE);
! #endif
!
add_vga_timer(num + gss->VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id);
_vc_ptr = (byte*)&vc_get_out_of_code;
***************
*** 5418,5423 ****
VgaSprite *vsp = find_cur_sprite();
! vsp->image = vc_read_var_or_word(_vc_ptr);
! _vc_ptr += 2;
vsp->x += vc_read_next_word();
--- 5425,5429 ----
VgaSprite *vsp = find_cur_sprite();
! vsp->image = vc_read_var_or_word();
vsp->x += vc_read_next_word();
***************
*** 6925,6932 ****
len_div_3 = (strlen(string_ptr) + 3) / 3;
! if (_variableArray[0x11a/2] == 0)
! _variableArray[0x11a/2] = 9;
- _variableArray[0xAA/2] = _variableArray[0x11A/2] * len_div_3;
num_of_rows = strlen(string_ptr) / letters_per_row;
--- 6931,6944 ----
len_div_3 = (strlen(string_ptr) + 3) / 3;
! if (!(_game & GAME_SIMON2)) {
! if (_variableArray[141] == 0)
! _variableArray[141] = 9;
! _variableArray[85] = _variableArray[141] * len_div_3;
! } else {
! if (_variableArray[86] == 0) len_div_3 >>= 1;
! if (_variableArray[86] == 2) len_div_3 <<= 1;
! _variableArray[85] = len_div_3 * 5;
! }
num_of_rows = strlen(string_ptr) / letters_per_row;
***************
*** 8067,8070 ****
--- 8079,8085 ----
}
+ #define SIMON2
+ #define SIMON2WIN
+
static const char * const opcode_name_table[256] = {
/* 0 */
***************
*** 8458,8463 ****
}
-
-
const char * const video_opcode_name_table[] = {
/* 0 */
--- 8473,8476 ----
***************
*** 8541,8545 ****
/* 56 */
#ifdef SIMON2
! "d|SLEEP_EX",
#else
"|DUMMY_7",
--- 8554,8558 ----
/* 56 */
#ifdef SIMON2
! "i|SLEEP_EX",
#else
"|DUMMY_7",
More information about the Scummvm-git-logs
mailing list