[Scummvm-git-logs] scummvm master -> 58a1275b18e8faea122e794f7b1f2262fab8ee93

dreammaster noreply at scummvm.org
Sun Jul 5 12:07:43 UTC 2026


This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
48dabd5ca5 MADS: Janitorial
d4120c3771 MADS: Janitorial
d0aced752f MADS: DRAGONSPHERE: Add speech code to object_examine
fb88bddaab MADS: Janitorial
86e7241d5d MADS: Jantitorial
58a1275b18 MADS: FOREST: Implement missing bg sounds & move your butt messages


Commit: 48dabd5ca541f9a84ecea9e27e85fc5ec0901827
    https://github.com/scummvm/scummvm/commit/48dabd5ca541f9a84ecea9e27e85fc5ec0901827
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-05T22:07:14+10:00

Commit Message:
MADS: Janitorial

Changed paths:
    engines/mads/madsv2/core/pfab.cpp
    engines/mads/madsv2/core/player.cpp
    engines/mads/madsv2/core/popup.cpp
    engines/mads/madsv2/core/quote.cpp
    engines/mads/madsv2/core/rail.cpp
    engines/mads/madsv2/core/room.cpp
    engines/mads/madsv2/core/speech.cpp
    engines/mads/madsv2/core/sprite.cpp
    engines/mads/madsv2/core/text.cpp
    engines/mads/madsv2/core/window.cpp


diff --git a/engines/mads/madsv2/core/pfab.cpp b/engines/mads/madsv2/core/pfab.cpp
index fb6d8d11d02..6ff0872b41c 100644
--- a/engines/mads/madsv2/core/pfab.cpp
+++ b/engines/mads/madsv2/core/pfab.cpp
@@ -62,10 +62,6 @@ namespace MADSV2 {
  * Back-references are negative offsets into that buffer.
  */
 
-#include "pfab.h"
-#include <stddef.h>
-#include <string.h>
-
  /* -------------------------------------------------------------------------
   * Compile-time constants (must match compressor and decompressor)
   * ---------------------------------------------------------------------- */
diff --git a/engines/mads/madsv2/core/player.cpp b/engines/mads/madsv2/core/player.cpp
index f1670e6c703..0cac9e3c945 100644
--- a/engines/mads/madsv2/core/player.cpp
+++ b/engines/mads/madsv2/core/player.cpp
@@ -509,7 +509,7 @@ void player_set_image() {
 
 	depth = 1;
 	effective_y = player.y;
-	// effective_y = MIN (effective_y, display_y - 1);
+
 	for (count = 1; count < 15; count++) {
 		if (effective_y <= room->depth_table[depth]) {
 			depth = (byte)(count + 1);
@@ -922,9 +922,6 @@ void player_start_walking(int walk_x, int walk_y, int walk_facing) {
 	int from_x, from_y;
 	int unto_x, unto_y;
 	int temp_stack_pointer;
-#ifdef show_rails
-	Buffer scr_live = { video_y, video_x, mcga_video };
-#endif
 
 	player_clear_stop_walkers();
 	player_set_base_frame_rate();
@@ -939,21 +936,6 @@ void player_start_walking(int walk_x, int walk_y, int walk_facing) {
 
 	rail_check_path(allow_one_illegal);
 
-#ifdef show_rails
-	from_x = player.x;
-	from_y = player.y;
-	temp_stack_pointer = rail_solution_stack_pointer;
-	while (temp_stack_pointer) {
-		temp_stack_pointer--;
-		unto_x = room->rail[rail_solution_stack[temp_stack_pointer]].x;
-		unto_y = room->rail[rail_solution_stack[temp_stack_pointer]].y;
-		buffer_line(scr_live, from_x, from_y, unto_x, unto_y, 3);
-		from_x = unto_x;
-		from_y = unto_y;
-		if (kernel.frame_by_frame) keys_get();
-	}
-#endif
-
 	from_x = player.x;
 	from_y = player.y;
 	player.next_special_code = 0;
diff --git a/engines/mads/madsv2/core/popup.cpp b/engines/mads/madsv2/core/popup.cpp
index fa7bea68d3f..8385bd2d2cd 100644
--- a/engines/mads/madsv2/core/popup.cpp
+++ b/engines/mads/madsv2/core/popup.cpp
@@ -202,7 +202,7 @@ void popup_next_line() {
 	}
 
 	box->text_x = 0;
-	// box->dont_add_space = false;
+
 	if (box->text_y >= POPUP_MAX_LINES) {
 		error_report(ERROR_POPUP_TOO_MANY_LINES, ERROR, MODULE_POPUP, box->text_y, POPUP_MAX_LINES);
 	}
@@ -319,7 +319,7 @@ void popup_write_string(const char *string) {
 		box->dont_add_space = stop_on_hyphen;
 
 		len = strlen(word2Str);
-		width = font_string_width(box_param.font, word2Str, POPUP_SPACING);	 // - POPUP_SPACING
+		width = font_string_width(box_param.font, word2Str, POPUP_SPACING);
 
 		if (((box->text_x + len) > box->text_width) || ((box->cursor_x + width) > box->text_xs)) {
 			popup_next_line();
@@ -1925,7 +1925,7 @@ static int popup_button_draw(PopupItem *item) {
 
 	selected = (popup->active_item == item) && (item->status & ITEM_STATUS_ACTIVE) != 0;
 
-	if (selected /* && (POPUP_DIALOG_BUTTON_COLOR_1 == POPUP_DIALOG_BUTTON_COLOR_2) */) {
+	if (selected) {
 		buffer_rect_fill(scr_main, item->x, item->y, item->xs, 1, POPUP_DIALOG_TEXT_COLOR);
 		buffer_rect_fill(scr_main, item->x, item->y, 1, item->ys, POPUP_DIALOG_TEXT_COLOR);
 		buffer_rect_fill(scr_main, item->x, item->y + item->ys, item->xs + 1, 1, POPUP_DIALOG_TEXT_COLOR);
@@ -1938,7 +1938,6 @@ static int popup_button_draw(PopupItem *item) {
 		popup_mouse_refresh_2(refresh);
 	}
 
-	// color = selected ? POPUP_ASK_COLOR : POPUP_TEXT_COLOR;
 	if (popup->active_item->type == ITEM_BUTTON) {
 		big_button = (item == popup->active_item);
 	} else {
@@ -1986,9 +1985,6 @@ static int popup_button_draw(PopupItem *item) {
 }
 
 
-
-
-
 static int popup_button_mouse(PopupItem *item) {
 	int in_item;
 	int count;
@@ -2671,18 +2667,7 @@ static int popup_savelist_draw(PopupItem *item) {
 
 	// Basic box
 	popup_double_box_2(item->x, item->y, item->xs, item->ys, color, color2);
-	// buffer_rect_fill (scr_main, item->x, item->y,
-	// item->xs, 1,
-	// color);
-	// buffer_rect_fill (scr_main, item->x, item->y,
-	// 1, item->ys,
-	// color);
-	// buffer_rect_fill (scr_main, item->x + item->xs - 1, item->y,
-	// 1, item->ys,
-	// color);
-	// buffer_rect_fill (scr_main, item->x, item->y + item->ys - 1,
-	// item->xs, 1,
-	// color);
+
 	// Number list
 	buffer_rect_fill(scr_main, list->extra_x + list->extra_xs - 2, list->extra_y,
 		1, list->extra_ys, color);
diff --git a/engines/mads/madsv2/core/quote.cpp b/engines/mads/madsv2/core/quote.cpp
index f56614c2f7f..781ca344106 100644
--- a/engines/mads/madsv2/core/quote.cpp
+++ b/engines/mads/madsv2/core/quote.cpp
@@ -158,9 +158,9 @@ void quote_split_string(const char *source, char *target1, char *target2) {
 		*(target1++) = *(mark++);
 	}
 
-	while (*mark == ' ') mark++;
+	while (*mark == ' ')
+		mark++;
 
-	// (target1++) = '"';
 	*(target1++) = 0;
 
 	do {
diff --git a/engines/mads/madsv2/core/rail.cpp b/engines/mads/madsv2/core/rail.cpp
index 40268d68709..f18c313f539 100644
--- a/engines/mads/madsv2/core/rail.cpp
+++ b/engines/mads/madsv2/core/rail.cpp
@@ -165,11 +165,9 @@ void rail_connect_all_nodes() {
  *
  * The function is recursive and modifies the globals directly.
  */
-static void recursive_check_path(int node_id,
-	uint16 weight,
-	uint16 allow_mode,
-	int working_sp) {
-	// visited[node_id] = true
+static void recursive_check_path(int node_id, uint16 weight,
+		uint16 allow_mode, int working_sp) {
+
 	rail_visited[node_id] = 1;
 
 	// push(node_id) onto working stack
diff --git a/engines/mads/madsv2/core/room.cpp b/engines/mads/madsv2/core/room.cpp
index d365a3dfe52..396d04a57d0 100644
--- a/engines/mads/madsv2/core/room.cpp
+++ b/engines/mads/madsv2/core/room.cpp
@@ -502,11 +502,9 @@ void room_himem_preload(int roomNum, int level) {
 	himem_preload_series(kernel_full_name(roomNum, 0, -1, NULL, KERNEL_DAT), level);
 	himem_preload_series(kernel_full_name(roomNum, 0, -1, NULL, KERNEL_HH), level);
 
-	// himem_preload_series (kernel_full_name (room, 0, -1, NULL, KERNEL_TT),  level);
 	himem_preload_series(kernel_full_name(roomNum, 0, -1, NULL, KERNEL_MM), level);
 	himem_preload_series(kernel_full_name(roomNum, 0, -1, NULL, KERNEL_WW), level);
 
-	// himem_preload_series (kernel_full_name (room, 0, 0, NULL, KERNEL_TT),  level);
 	himem_preload_series(kernel_full_name(roomNum, 0, 0, NULL, KERNEL_MM), level);
 	himem_preload_series(kernel_full_name(roomNum, 0, 0, NULL, KERNEL_WW), level);
 }
@@ -544,7 +542,6 @@ int room_picture_load(int roomId, Buffer *picture, int load_flags) {
 		goto done;
 	}
 
-	// memcpy (&room->cycle_list, &art.cycle_list, sizeof(CycleList));
 	if (!(load_flags & ROOM_LOAD_TRANSLATE)) {
 		color_handle = pal_allocate(&art.color_list, NULL, (load_flags & PAL_MAP_MASK));
 		if (color_handle < 0) {
@@ -560,10 +557,6 @@ int room_picture_load(int roomId, Buffer *picture, int load_flags) {
 
 	if (!(load_flags & ROOM_LOAD_TRANSLATE)) {
 		color_buffer_list_to_main(&art.color_list, picture);
-	} else {
-#ifdef sixteen_color
-		color_buffer_list_to_x16(&art.color_list, picture);
-#endif
 	}
 
 	error_flag = false;
diff --git a/engines/mads/madsv2/core/speech.cpp b/engines/mads/madsv2/core/speech.cpp
index cde0cfb631a..7987d446ef4 100644
--- a/engines/mads/madsv2/core/speech.cpp
+++ b/engines/mads/madsv2/core/speech.cpp
@@ -134,7 +134,7 @@ void speech_all_off() {
 }
 
 void speech_sample_rate(int rate) {
-	// TODO: implement speech_sample_rate
+	// No implementation in ScummVM
 }
 
 void speech_go() {
@@ -170,7 +170,6 @@ void global_speech_go(int id) {
 	if (speech_system_active && speech_on) {
 		if (global_speech_ready == id) {
 			speech_all_off();
-			//speech_sample_rate(speech_main_buffer.sample_rate);
 			speech_go();
 		} else {
 			global_speech(id);
diff --git a/engines/mads/madsv2/core/sprite.cpp b/engines/mads/madsv2/core/sprite.cpp
index 67b89251564..997047354d8 100644
--- a/engines/mads/madsv2/core/sprite.cpp
+++ b/engines/mads/madsv2/core/sprite.cpp
@@ -367,7 +367,6 @@ SeriesPtr sprite_series_load(const char *filename, int load_flags) {
 	SpritePageInfoPtr  page_info;
 	SpritePageTablePtr page_table;
 	ColorListPtr color_list = NULL;
-	/* ColorList color_list; */
 	Load load_handle;
 
 	mem_last_alloc_loader = MODULE_SPRITE_LOADER;
diff --git a/engines/mads/madsv2/core/text.cpp b/engines/mads/madsv2/core/text.cpp
index 721293a4be3..4fe651b0595 100644
--- a/engines/mads/madsv2/core/text.cpp
+++ b/engines/mads/madsv2/core/text.cpp
@@ -461,7 +461,7 @@ int text_show(long id) {
 			} else if (*scan == TEXT_CLOSE_COMMAND) {
 				if (brackets_on) {
 					*cmd = 0;
-					// mads_strupr(command_buf);
+
 					if (text_compare(command_buf, text_command_center, &more)) {
 						center = true;
 					} else if (text_compare(command_buf, text_command_title, &more)) {
diff --git a/engines/mads/madsv2/core/window.cpp b/engines/mads/madsv2/core/window.cpp
index 279fb920bbf..4a7f8492f4d 100644
--- a/engines/mads/madsv2/core/window.cpp
+++ b/engines/mads/madsv2/core/window.cpp
@@ -449,12 +449,11 @@ void window_title(WindowPtr window, const char *title, int title_color, int back
 	begin_x = center_x - ((strlen(title) + 2) / 2);
 
 	Common::strcpy_s(temp, " ");
-	// temp[0] = (byte)((title_color == background_color) ? right_join : ' ');
+
 	begin_x = screen_put(temp, title_color, title_color, begin_x, window->ul_y);
 
 	begin_x = screen_put(title, title_color, title_color, begin_x, window->ul_y);
 
-	// temp[0] = (byte)((title_color == background_color) ? left_join : ' ');
 	begin_x = screen_put(temp, title_color, title_color, begin_x, window->ul_y);
 
 	mouse_show();


Commit: d4120c37715f07aaa27a286f485f8b94b6099ecd
    https://github.com/scummvm/scummvm/commit/d4120c37715f07aaa27a286f485f8b94b6099ecd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-05T22:07:14+10:00

Commit Message:
MADS: Janitorial

Changed paths:
    engines/mads/madsv2/core/pal.cpp
    engines/mads/madsv2/core/pal.h
    engines/mads/madsv2/core/pfab.cpp
    engines/mads/madsv2/core/player.cpp
    engines/mads/madsv2/core/popup.cpp
    engines/mads/madsv2/core/rail.cpp
    engines/mads/madsv2/core/room.cpp
    engines/mads/madsv2/core/room.h
    engines/mads/madsv2/core/speech.cpp
    engines/mads/madsv2/core/sprite.cpp
    engines/mads/madsv2/core/text.cpp
    engines/mads/madsv2/core/tile.cpp
    engines/mads/madsv2/core/vocab.cpp
    engines/mads/madsv2/core/vocab.h


diff --git a/engines/mads/madsv2/core/pal.cpp b/engines/mads/madsv2/core/pal.cpp
index 53d2ffb5596..f48e7bd3b44 100644
--- a/engines/mads/madsv2/core/pal.cpp
+++ b/engines/mads/madsv2/core/pal.cpp
@@ -33,7 +33,6 @@
 namespace MADS {
 namespace MADSV2 {
 
-
 extern int kidney;
 
 Palette master_palette;             /* Main global palette for program   */
@@ -262,7 +261,6 @@ done:
 	return (return_code);
 }
 
-
 static int pal_free_colors(int *first_free) {
 	int free_colors, count;
 
@@ -514,15 +512,9 @@ int pal_allocate(ColorListPtr new_list, ShadowListPtr shadow_list, int pal_flags
 	pal_exec(pal_manager_update, 2);
 
 done:
-#ifdef palette_dumps
-	pal_dump();
-#endif
 	return return_code;
 }
 
-/**
- * Returns number of available flags - checksum use
- */
 int pal_get_flags() {
 	int a, out;
 
@@ -533,9 +525,6 @@ int pal_get_flags() {
 	return(out);
 }
 
-/*
- * Returns number of colors available in palette
- */
 int pal_get_colors() {
 	int a, out;
 
@@ -569,8 +558,6 @@ void pal_interface(Palette &fixpal) {
 	fixpal[6].g = 21;
 }
 
-
-
 void pal_white(Palette &fixpal) {
 	int count;
 	byte num[4] = { 0, 21, 42, 63 };
@@ -582,7 +569,6 @@ void pal_white(Palette &fixpal) {
 	}
 }
 
-
 void pal_grey(Palette &fixpal, int base_color, int num_colors,
 	int low_grey, int high_grey) {
 	int count;
@@ -607,7 +593,6 @@ void pal_grey(Palette &fixpal, int base_color, int num_colors,
 	}
 }
 
-
 int pal_get_color(RGBcolor color, int color_handle, int override_reserved, int *color_number) {
 	int count;
 	int result;
diff --git a/engines/mads/madsv2/core/pal.h b/engines/mads/madsv2/core/pal.h
index 22d3538e0bb..120841f2b66 100644
--- a/engines/mads/madsv2/core/pal.h
+++ b/engines/mads/madsv2/core/pal.h
@@ -154,7 +154,15 @@ extern void pal_shadow_sort(ShadowListPtr shadow, ColorListPtr list);
  */
 extern void pal_init_shadow(ShadowListPtr shadow, ColorListPtr new_list);
 extern void pal_activate_shadow(ShadowListPtr shadow);
+
+/**
+ * Returns number of available flags - checksum use
+ */
 extern int pal_get_flags();
+
+/**
+ * Returns number of colors available in palette
+ */
 extern int pal_get_colors();
 extern void pal_interface(Palette &fixpal);
 extern void pal_white(Palette &fixpal);
diff --git a/engines/mads/madsv2/core/pfab.cpp b/engines/mads/madsv2/core/pfab.cpp
index 6ff0872b41c..5fcd1a3de83 100644
--- a/engines/mads/madsv2/core/pfab.cpp
+++ b/engines/mads/madsv2/core/pfab.cpp
@@ -726,7 +726,6 @@ static unsigned long fab_explode(ExpIO *io) {
 	return io->out_count;
 }
 
-
 /* =========================================================================
  *  pFABexp0  --  file-to-file decompressor  (PFABEXP0.ASM)
  *
@@ -759,7 +758,6 @@ word pFABexp0(ReadFn read_buff, WriteFn write_buff, char *work_buff) {
 	return 0;  // CMP_NO_ERROR
 }
 
-
 /* =========================================================================
  *  pFABexp1  --  file-to-memory decompressor  (PFABEXP1.ASM)
  *
@@ -792,7 +790,6 @@ word pFABexp1(ReadFn read_buff, char *write_buf, char *work_buff) {
 	return 0;
 }
 
-
 word pFABexp2(byte *read_buf, byte *write_buf, char *work_buff) {
 	if (!work_buff)
 		return 4u;  // original returned 4
diff --git a/engines/mads/madsv2/core/player.cpp b/engines/mads/madsv2/core/player.cpp
index 0cac9e3c945..8c4a7e7d6d8 100644
--- a/engines/mads/madsv2/core/player.cpp
+++ b/engines/mads/madsv2/core/player.cpp
@@ -169,7 +169,7 @@ static int player_scaling_factor(int y) {
 
 	scale = MIN(100, scale);
 
-	return (scale);
+	return scale;
 }
 
 /**
@@ -177,7 +177,8 @@ static int player_scaling_factor(int y) {
  */
 static void player_set_base_frame_rate() {
 	player.frame_delay = series_list[player.series_base + player.series]->walker->frame_rate;
-	if (!player.frame_delay) player.frame_delay = 6;
+	if (!player.frame_delay)
+		player.frame_delay = 6;
 }
 
 void player_new_stop_walker() {
diff --git a/engines/mads/madsv2/core/popup.cpp b/engines/mads/madsv2/core/popup.cpp
index 8385bd2d2cd..c1e1b210522 100644
--- a/engines/mads/madsv2/core/popup.cpp
+++ b/engines/mads/madsv2/core/popup.cpp
@@ -187,8 +187,6 @@ void popup_add_icon(SeriesPtr series, int id, int center) {
 	}
 }
 
-
-
 void popup_next_line() {
 	int y_sum;
 
@@ -208,14 +206,12 @@ void popup_next_line() {
 	}
 }
 
-
 void popup_set_ask() {
 	box->ask_x = box->text_x + 1;
 	box->ask_y = box->text_y;
 	popup_next_line();
 }
 
-
 void popup_add_string(const char *string) {
 	int len, width;
 
@@ -228,8 +224,6 @@ void popup_add_string(const char *string) {
 	Common::strcat_s(box->text[box->text_y], 65536, string);
 }
 
-
-
 void popup_write_string(const char *string) {
 	char wordStr[80];
 	char word2Str[80];
@@ -331,7 +325,6 @@ void popup_write_string(const char *string) {
 	}
 }
 
-
 void popup_bar() {
 	if ((box->cursor_x > 0) || (box->text_x > 0)) {
 		popup_next_line();
@@ -340,22 +333,18 @@ void popup_bar() {
 	popup_next_line();
 }
 
-
 void popup_underline() {
 	box->tab[box->text_y] |= POPUP_UNDERLINE;
 }
 
-
 void popup_downpixel() {
 	box->tab[box->text_y] |= POPUP_DOWNPIXEL;
 }
 
-
 void popup_tab(int tab_level) {
 	box->tab[box->text_y] |= tab_level;
 }
 
-
 void popup_center_string(const char *string, int underline) {
 	int width;
 
@@ -377,7 +366,6 @@ void popup_center_string(const char *string, int underline) {
 	popup_next_line();
 }
 
-
 static void pop_draw(int sprite, int x, int y, int depth_code) {
 	matte_map_work_screen();
 
@@ -397,7 +385,6 @@ static void pop_draw(int sprite, int x, int y, int depth_code) {
 	}
 }
 
-
 int popup_draw(int save_screen, int depth_code) {
 	int error_flag = true;
 	int count;
@@ -763,7 +750,6 @@ done:
 	return error_flag;
 }
 
-
 void popup_destroy() {
 	int x, y;
 	int xs, ys;
@@ -862,7 +848,6 @@ void popup_destroy() {
 	box->active = false;
 }
 
-
 int popup_and_wait(int save_screen) {
 	bool error_flag = true;
 	bool waiting;
@@ -903,7 +888,6 @@ done:
 	return error_flag;
 }
 
-
 int popup_and_dont_wait(int save_screen) {
 	int error_flag = true;
 
@@ -922,8 +906,6 @@ done:
 	return error_flag;
 }
 
-
-
 void popup_update_ask(char *string, int maxlen) {
 	int x1, y1, x2, x3, xs, ys, xs2;
 
@@ -962,7 +944,6 @@ void popup_update_ask(char *string, int maxlen) {
 	mouse_show();
 }
 
-
 int popup_ask_string(char *target, int maxlen, int save_screen) {
 	int error_flag = true;
 	int never_ever;
@@ -1075,8 +1056,6 @@ done:
 	return error_flag;
 }
 
-
-
 int popup_ask_number(long *value, int maxlen, int save_screen) {
 	int error_flag = true;
 	char temp_buf[80];
@@ -1100,8 +1079,6 @@ done:
 	return error_flag;
 }
 
-
-
 int popup_estimate_pieces(int maxlen) {
 	int font_len;
 	int pieces;
@@ -1113,7 +1090,6 @@ int popup_estimate_pieces(int maxlen) {
 	return (estimate);
 }
 
-
 int popup_get_string(char *target, const char *top, const char *left, int maxlen) {
 	int result = -1;
 
@@ -1129,7 +1105,6 @@ int popup_get_string(char *target, const char *top, const char *left, int maxlen
 	return (result);
 }
 
-
 int popup_get_long(long *value, const char *top, const char *left, int maxlen) {
 	int error_flag = true;
 
@@ -1145,7 +1120,6 @@ int popup_get_long(long *value, const char *top, const char *left, int maxlen) {
 	return error_flag;
 }
 
-
 int popup_get_number(int16 *value, const char *top, const char *left, int maxlen) {
 	int result;
 	long temp;
@@ -1159,7 +1133,6 @@ int popup_get_number(int16 *value, const char *top, const char *left, int maxlen
 	return (result);
 }
 
-
 int popup_alert(int width, const char *message_line, ...) {
 	int mykey = -1;
 	int error_flag = true;
@@ -1315,7 +1288,6 @@ done:
 	return error_flag;
 }
 
-
 /**
  * Causes the specified popup structure to become active (the active
  * popup structure is considered the target of all popup requests
@@ -1365,7 +1337,6 @@ static void popup_item_init(PopupItem *item) {
 	}
 }
 
-
 Popup *popup_dialog_create(void *memory, long heap_size, int max_items) {
 	int   count;
 	byte  *block = NULL;
@@ -1442,7 +1413,6 @@ done:
 	return (result);
 }
 
-
 Popup *popup_dialog_destroy() {
 	popup->status &= ~(POPUP_STATUS_VALID);
 
@@ -1453,7 +1423,6 @@ Popup *popup_dialog_destroy() {
 	return (NULL);
 }
 
-
 static int extract_keystroke(char *string) {
 	int keystroke = 0;
 	char *mark;
@@ -1467,12 +1436,10 @@ static int extract_keystroke(char *string) {
 	return keystroke;
 }
 
-
 static void *popup_heap(long mem_to_get) {
 	return (heap_get(&popup->heap, mem_to_get));
 }
 
-
 static char *string_to_heap(char *string) {
 	char *mem_we_got;
 
@@ -1483,7 +1450,6 @@ static char *string_to_heap(char *string) {
 	return (mem_we_got);
 }
 
-
 static void set_prompt(PopupItem *item, const char *string) {
 	char temp_buf[80];
 
@@ -1493,7 +1459,6 @@ static void set_prompt(PopupItem *item, const char *string) {
 	item->prompt = string_to_heap(temp_buf);
 }
 
-
 static PopupItem *item_allocate(int can_be_default) {
 	PopupItem *item;
 
@@ -1510,8 +1475,6 @@ static PopupItem *item_allocate(int can_be_default) {
 	return (item);
 }
 
-
-
 static PopupList *list_allocate() {
 	PopupList *list;
 
@@ -1519,7 +1482,6 @@ static PopupList *list_allocate() {
 	return (list);
 }
 
-
 static PopupBuffer *buffer_allocate(int size) {
 	PopupBuffer *buffer;
 
@@ -1532,13 +1494,10 @@ static PopupBuffer *buffer_allocate(int size) {
 	return (buffer);
 }
 
-
-
 static int popup_font_size(const char *string) {
 	return (font_string_width(box_param.font, string, box_param.font_spacing));
 }
 
-
 static void popup_y_placement(PopupItem *item, int y) {
 	int16 bottom;
 
@@ -1552,8 +1511,6 @@ static void popup_y_placement(PopupItem *item, int y) {
 	}
 }
 
-
-
 static void popup_x_width_check(PopupItem *item) {
 	int16 new_width;
 
@@ -1569,12 +1526,10 @@ static void popup_x_width_check(PopupItem *item) {
 	popup->width = MAX(popup->width, new_width);
 }
 
-
 void popup_width_force(int width) {
 	popup->width = MAX<int16>(popup->width, width);
 }
 
-
 static void popup_coord_adjust(PopupItem *item) {
 	if (item->x & POPUP_CENTER) {
 		item->x = popup->x + (popup->xs >> 1) - (item->xs >> 1);
@@ -1596,7 +1551,6 @@ static void popup_coord_adjust(PopupItem *item) {
 	item->font_y = item->y + item->font_y;
 }
 
-
 static int popup_mouse_refresh() {
 	mouse_freeze();
 	mouse_set_work_buffer(scr_main.data, video_x);
@@ -1605,13 +1559,11 @@ static int popup_mouse_refresh() {
 	return (mouse_refresh_view_port());
 }
 
-
 static void popup_mouse_refresh_2(int refresh) {
 	if (refresh) mouse_refresh_done();
 	mouse_thaw();
 }
 
-
 static void popup_to_screen() {
 	int refresh;
 
@@ -1622,7 +1574,6 @@ static void popup_to_screen() {
 	popup_mouse_refresh_2(refresh);
 }
 
-
 static void popup_item_to_screen(PopupItem *item) {
 	int refresh;
 
@@ -1633,7 +1584,6 @@ static void popup_item_to_screen(PopupItem *item) {
 	popup_mouse_refresh_2(refresh);
 }
 
-
 static void popup_screen_clear() {
 	buffer_rect_fill_pattern(scr_main,
 		box->window_x, box->window_y, box->window_xs, box->window_ys,
@@ -1641,7 +1591,6 @@ static void popup_screen_clear() {
 		POPUP_FILL_COLOR, POPUP_FILL_COLOR_2, 0, 0);
 }
 
-
 static void popup_item_clear(PopupItem *item) {
 	if (mouse_y > 150 && item->y > 150) {
 		buffer_rect_fill(scr_main, item->x, item->y, item->xs, 1, 0);
@@ -1658,14 +1607,12 @@ static void popup_item_clear(PopupItem *item) {
 
 }
 
-
 static void popup_redraw_item(PopupItem *item) {
 	popup_item_clear(item);
 	popup_exec_function(item, VECTOR_DRAW);
 	popup_item_to_screen(item);
 }
 
-
 static void popup_update_item(PopupItem *item) {
 	if (item) {
 		if (item->vector[VECTOR_UPDATE] != NULL) {
@@ -1676,7 +1623,6 @@ static void popup_update_item(PopupItem *item) {
 	}
 }
 
-
 static void popup_full_draw() {
 	int count;
 	int bar_y;
@@ -1707,7 +1653,6 @@ static void popup_full_draw() {
 	popup_to_screen();
 }
 
-
 static void popup_activate_item(PopupItem *item) {
 	PopupItem *old_active;
 
@@ -1719,8 +1664,6 @@ static void popup_activate_item(PopupItem *item) {
 	popup_update_item(popup->enter_item);
 }
 
-
-
 static PopupItem *popup_next_item(PopupItem *item, int activate, int any_non_button) {
 	int count;
 	int found = -1;
@@ -1764,7 +1707,6 @@ done:
 	return (result);
 }
 
-
 static PopupItem *popup_last_item(PopupItem *item, int activate, int any_non_button) {
 	int found = -1;
 	int count;
@@ -1807,8 +1749,6 @@ done:
 	return (result);
 }
 
-
-
 static int popup_in_item(PopupItem *item) {
 	int in_item;
 	int x, y;
@@ -1825,7 +1765,6 @@ static int popup_in_item(PopupItem *item) {
 	return (in_item);
 }
 
-
 static void popup_find_item() {
 	int count;
 
@@ -1842,9 +1781,7 @@ static void popup_find_item() {
 	}
 }
 
-
-static void popup_double_box(int x, int y, int xs, int ys,
-	byte color, byte color2) {
+static void popup_double_box(int x, int y, int xs, int ys, byte color, byte color2) {
 	if (popup->status & POPUP_STATUS_BUTTON) {
 		buffer_rect_fill(scr_main, x, y, xs, 1, color);
 		buffer_rect_fill(scr_main, x, y, 1, ys, color);
@@ -1868,9 +1805,7 @@ static void popup_double_box(int x, int y, int xs, int ys,
 	}
 }
 
-
-static void popup_double_box_2(int x, int y, int xs, int ys,
-	byte color, byte color2) {
+static void popup_double_box_2(int x, int y, int xs, int ys, byte color, byte color2) {
 	int count;
 
 	for (count = 0; count < 2; count++) {
@@ -1887,10 +1822,6 @@ static void popup_double_box_2(int x, int y, int xs, int ys,
 	}
 }
 
-
-
-
-
 /*******************************************************/
 /*             Item service routines                   */
 /*******************************************************/
@@ -1908,12 +1839,10 @@ static int popup_button_x_size(PopupItem *item) {
 	return (size);
 }
 
-
 static int popup_button_y_size(PopupItem *item) {
 	return (box_param.font->max_y_size + 4 + 2);
 }
 
-
 static int popup_button_draw(PopupItem *item) {
 	byte color;
 	byte color2;
@@ -1984,7 +1913,6 @@ static int popup_button_draw(PopupItem *item) {
 	return 0;
 }
 
-
 static int popup_button_mouse(PopupItem *item) {
 	int in_item;
 	int count;
@@ -2047,7 +1975,6 @@ done:
 	return 0;
 }
 
-
 static int popup_button_key(PopupItem *item) {
 	int count;
 
@@ -2064,7 +1991,6 @@ static int popup_button_key(PopupItem *item) {
 	return 0;
 }
 
-
 static void popup_button_create(PopupItem *item) {
 	item->vector[VECTOR_X_SIZE] = popup_button_x_size;
 	item->vector[VECTOR_Y_SIZE] = popup_button_y_size;
@@ -2073,10 +1999,6 @@ static void popup_button_create(PopupItem *item) {
 	item->vector[VECTOR_KEY] = popup_button_key;
 }
 
-
-
-
-
 /****************/
 /* Menu Buttons */
 /****************/
@@ -2102,12 +2024,10 @@ static int popup_menu_x_size(PopupItem *item) {
 	return (size);
 }
 
-
 static int popup_menu_y_size(PopupItem *item) {
 	return(box_param.menu->index[0].ys);
 }
 
-
 static int popup_menu_draw(PopupItem *item) {
 	int count;
 	int selected;
@@ -2183,10 +2103,6 @@ static int popup_menu_draw(PopupItem *item) {
 	return 0;
 }
 
-
-
-
-
 static int popup_menu_mouse(PopupItem *item) {
 	int force_redraw = false;
 	int in_item;
@@ -2235,12 +2151,10 @@ done:
 	return 0;
 }
 
-
 static int popup_menu_key(PopupItem *item) {
 	return 0;
 }
 
-
 static void popup_menu_create(PopupItem *item) {
 	item->vector[VECTOR_X_SIZE] = popup_menu_x_size;
 	item->vector[VECTOR_Y_SIZE] = popup_menu_y_size;
@@ -2249,23 +2163,18 @@ static void popup_menu_create(PopupItem *item) {
 	item->vector[VECTOR_KEY] = popup_menu_key;
 }
 
-
-
 /*****************/
 /* Text Messages */
 /*****************/
 
-
 static int popup_message_x_size(PopupItem *item) {
 	return popup_font_size(item->prompt);
 }
 
-
 static int popup_message_y_size(PopupItem *) {
 	return box_param.font->max_y_size;
 }
 
-
 static int popup_message_draw(PopupItem *item) {
 	font_set_colors(-1, POPUP_DIALOG_TEXT_COLOR,
 		POPUP_DIALOG_TEXT_COLOR,
@@ -2275,14 +2184,12 @@ static int popup_message_draw(PopupItem *item) {
 	return 0;
 }
 
-
 static void popup_message_create(PopupItem *item) {
 	item->vector[VECTOR_X_SIZE] = popup_message_x_size;
 	item->vector[VECTOR_Y_SIZE] = popup_message_y_size;
 	item->vector[VECTOR_DRAW] = popup_message_draw;
 }
 
-
 /******************/
 /* static Sprites */
 /******************/
@@ -2291,12 +2198,10 @@ static int popup_sprite_x_size(PopupItem *item) {
 	return (item->series->index[item->sprite - 1].xs);
 }
 
-
 static int popup_sprite_y_size(PopupItem *item) {
 	return (item->series->index[item->sprite - 1].ys);
 }
 
-
 static int popup_sprite_draw(PopupItem *item) {
 	sprite_draw(item->series, item->sprite, &scr_main,
 		item->x, item->y);
@@ -2309,7 +2214,6 @@ static void popup_sprite_create(PopupItem *item) {
 	item->vector[VECTOR_DRAW] = popup_sprite_draw;
 }
 
-
 /**********************/
 /* Complex Save Lists */
 /**********************/
@@ -2341,7 +2245,6 @@ static int popup_savelist_x_size(PopupItem *item) {
 	return (size);
 }
 
-
 static int popup_savelist_y_size(PopupItem *item) {
 	int size;
 	int row_size;
@@ -2362,7 +2265,6 @@ static int popup_savelist_y_size(PopupItem *item) {
 	return (size);
 }
 
-
 static int popup_savelist_adjust(PopupItem *item) {
 	PopupList *list;
 
@@ -2386,7 +2288,6 @@ static int popup_savelist_adjust(PopupItem *item) {
 	return 0;
 }
 
-
 static char *popup_savelist_string(PopupItem *item, int element) {
 	char *text_locator;
 	PopupList *list;
@@ -2398,8 +2299,6 @@ static char *popup_savelist_string(PopupItem *item, int element) {
 	return (text_locator);
 }
 
-
-
 static int popup_savelist_vertical(PopupItem *item, int relative) {
 	int y;
 	PopupList *list;
@@ -2411,7 +2310,6 @@ static int popup_savelist_vertical(PopupItem *item, int relative) {
 	return (y);
 }
 
-
 static void popup_savelist_number_draw(PopupItem *item, int relative, int number) {
 	char temp_buf[10];
 	int x, y;
@@ -2431,7 +2329,6 @@ static void popup_savelist_number_draw(PopupItem *item, int relative, int number
 		temp_buf, x, y, box_param.font_spacing);
 }
 
-
 static void popup_savelist_element_draw(PopupItem *item, int element) {
 	int relative;
 	int color;
@@ -2485,7 +2382,6 @@ done:
 	;
 }
 
-
 static void popup_savelist_full_draw(PopupItem *item) {
 	int count;
 	int element;
@@ -2498,7 +2394,6 @@ static void popup_savelist_full_draw(PopupItem *item) {
 	}
 }
 
-
 static void popup_savelist_scroll_draw(PopupItem *item) {
 	int count;
 	int x, y;
@@ -2564,7 +2459,6 @@ static void popup_savelist_scroll_draw(PopupItem *item) {
 	}
 }
 
-
 static void popup_savelist_scroll_clear(PopupItem *item) {
 	PopupList *list;
 
@@ -2577,7 +2471,6 @@ static void popup_savelist_scroll_clear(PopupItem *item) {
 		POPUP_FILL_COLOR, POPUP_FILL_COLOR_2, 0, 0);
 }
 
-
 static void popup_savelist_item_clear(PopupItem *item, int relative) {
 	int x, y;
 	PopupList *list;
@@ -2601,9 +2494,6 @@ static void popup_savelist_item_clear(PopupItem *item, int relative) {
 
 }
 
-
-
-
 static void popup_savelist_scroll_to_screen(PopupItem *item) {
 	int refresh;
 	PopupList *list;
@@ -2617,8 +2507,6 @@ static void popup_savelist_scroll_to_screen(PopupItem *item) {
 	popup_mouse_refresh_2(refresh);
 }
 
-
-
 static void popup_savelist_item_to_screen(PopupItem *item, int relative) {
 	int x, y;
 	int refresh;
@@ -2634,14 +2522,12 @@ static void popup_savelist_item_to_screen(PopupItem *item, int relative) {
 	popup_mouse_refresh_2(refresh);
 }
 
-
 static void popup_savelist_scroll_refresh(PopupItem *item) {
 	popup_savelist_scroll_clear(item);
 	popup_savelist_scroll_draw(item);
 	popup_savelist_scroll_to_screen(item);
 }
 
-
 static void popup_savelist_item_refresh(PopupItem *item, int element) {
 	int relative;
 
@@ -2654,7 +2540,6 @@ static void popup_savelist_item_refresh(PopupItem *item, int element) {
 	popup_savelist_item_to_screen(item, relative);
 }
 
-
 static int popup_savelist_draw(PopupItem *item) {
 	byte color;
 	byte color2;
@@ -2681,7 +2566,6 @@ static int popup_savelist_draw(PopupItem *item) {
 	return 0;
 }
 
-
 static void popup_adjust_elements(PopupList *list) {
 	list->base_element = MAX(0, list->base_element);
 	list->base_element = MIN(list->base_element, list->elements - 1);
@@ -2690,9 +2574,6 @@ static void popup_adjust_elements(PopupList *list) {
 	list->picked_element = MIN(list->picked_element, list->elements - 1);
 }
 
-
-
-
 static int popup_savelist_mouse(PopupItem *item) {
 	bool in_scroll_bar;
 	bool in_up_arrow;
@@ -2842,7 +2723,6 @@ static int popup_savelist_mouse(PopupItem *item) {
 	return 0;
 }
 
-
 static void popup_savelist_select(PopupItem *item, int element) {
 	PopupList *list;
 
@@ -2857,8 +2737,6 @@ static void popup_savelist_select(PopupItem *item, int element) {
 	popup_adjust_elements(list);
 }
 
-
-
 static void popup_savelist_select_free(PopupItem *item) {
 	int count;
 	int found = -1;
@@ -2877,8 +2755,6 @@ static void popup_savelist_select_free(PopupItem *item) {
 	}
 }
 
-
-
 static int popup_savelist_key(PopupItem *item) {
 	int base_element;
 	int picked_element;
@@ -2987,14 +2863,10 @@ done:
 	return 0;
 }
 
-
 static int popup_savelist_update(PopupItem *item) {
 	return 0;
 }
 
-
-
-
 static void popup_savelist_create(PopupItem *item) {
 	item->vector[VECTOR_X_SIZE] = popup_savelist_x_size;
 	item->vector[VECTOR_Y_SIZE] = popup_savelist_y_size;
@@ -3005,9 +2877,6 @@ static void popup_savelist_create(PopupItem *item) {
 	item->vector[VECTOR_UPDATE] = popup_savelist_update;
 }
 
-
-
-
 static void item_constructor(PopupItem *item, int type) {
 	item->type = (byte)type;
 
@@ -3030,8 +2899,6 @@ static void item_constructor(PopupItem *item, int type) {
 	}
 }
 
-
-
 PopupItem *popup_button(const char *prompt, int x) {
 	int first_button;
 	int16 new_width;
@@ -3072,7 +2939,6 @@ PopupItem *popup_button(const char *prompt, int x) {
 	return (item);
 }
 
-
 PopupItem *popup_cancel_button(const char *prompt) {
 	PopupItem *item;
 
@@ -3087,7 +2953,6 @@ PopupItem *popup_cancel_button(const char *prompt) {
 	return item;
 }
 
-
 void popup_menu_option(PopupItem *item, char *option) {
 	PopupList *list;
 	char *text_locator;
@@ -3101,7 +2966,6 @@ void popup_menu_option(PopupItem *item, char *option) {
 	}
 }
 
-
 PopupItem *popup_menu(const char *prompt,
 	int x, int y, int pixel_width,
 	int off_center_x,
@@ -3154,8 +3018,6 @@ PopupItem *popup_menu(const char *prompt,
 	return (item);
 }
 
-
-
 PopupItem *popup_message(const char *prompt, int x, int y) {
 	PopupItem *item;
 
@@ -3178,19 +3040,14 @@ PopupItem *popup_message(const char *prompt, int x, int y) {
 	return item;
 }
 
-
-
 void popup_blank(int num_lines) {
 	popup->y_position += num_lines;
 }
 
-
 void popup_blank_line() {
 	popup_blank(box_param.font->max_y_size + popup->y_spacing);
 }
 
-
-
 PopupItem *popup_sprite(SeriesPtr series, int sprite, int x, int y) {
 	PopupItem *item;
 
@@ -3214,10 +3071,6 @@ PopupItem *popup_sprite(SeriesPtr series, int sprite, int x, int y) {
 	return (item);
 }
 
-
-
-
-
 PopupItem *popup_savelist(char *data, char *empty_string,
 		int elements, int element_offset, int element_max_length,
 		int pixel_width, int rows, int accept_input, int default_element) {
@@ -3292,10 +3145,6 @@ PopupItem *popup_savelist(char *data, char *empty_string,
 	return (item);
 }
 
-
-
-
-
 PopupItem *popup_execute() {
 	int base_x_size;
 	int horiz_pieces;
diff --git a/engines/mads/madsv2/core/rail.cpp b/engines/mads/madsv2/core/rail.cpp
index f18c313f539..6b971714011 100644
--- a/engines/mads/madsv2/core/rail.cpp
+++ b/engines/mads/madsv2/core/rail.cpp
@@ -154,7 +154,6 @@ void rail_connect_all_nodes() {
 	}
 }
 
-
 /**
  * Used for recursively determing walk path between room rail nodes
  * @param node_id		Node currently being evaluated
diff --git a/engines/mads/madsv2/core/room.cpp b/engines/mads/madsv2/core/room.cpp
index 396d04a57d0..63a25173088 100644
--- a/engines/mads/madsv2/core/room.cpp
+++ b/engines/mads/madsv2/core/room.cpp
@@ -353,10 +353,6 @@ done:
 	return error_flag;
 }
 
-int room_compile_hotspots(int id, int compression) {
-	error("TODO: room_compile_hotspots");
-}
-
 HotPtr room_load_hotspots(int id, int *num_spots) {
 	HotPtr spots;
 	HotPtr result = NULL;
diff --git a/engines/mads/madsv2/core/room.h b/engines/mads/madsv2/core/room.h
index 7d64450e5fc..c926a7e1637 100644
--- a/engines/mads/madsv2/core/room.h
+++ b/engines/mads/madsv2/core/room.h
@@ -261,7 +261,6 @@ extern int room_load_variant(int id, int variant, const char *base_path, RoomPtr
 	TileResource *depth_resource, int depth_ems_handle);
 extern void room_dump_attribute(Buffer *depth, Buffer *walk, Buffer *special,
 	TileMapHeader *depth_map);
-extern int room_compile_hotspots(int id, int compression);
 extern HotPtr room_load_hotspots(int id, int *num_spots);
 
 /**
diff --git a/engines/mads/madsv2/core/speech.cpp b/engines/mads/madsv2/core/speech.cpp
index 7987d446ef4..13751331a6b 100644
--- a/engines/mads/madsv2/core/speech.cpp
+++ b/engines/mads/madsv2/core/speech.cpp
@@ -54,7 +54,6 @@ void SpeechDir::load(Common::SeekableReadStream *src) {
 	src->readMultipleLE(field0, compression, field4, field6, field8, size, offset);
 }
 
-
 void speech_init() {
 	speech_system_active = true;
 }
diff --git a/engines/mads/madsv2/core/sprite.cpp b/engines/mads/madsv2/core/sprite.cpp
index 997047354d8..bba7692bdc3 100644
--- a/engines/mads/madsv2/core/sprite.cpp
+++ b/engines/mads/madsv2/core/sprite.cpp
@@ -1163,7 +1163,6 @@ done:
 	return (error_flag);
 }
 
-
 void dont_frag_the_palette() {
 	/* this will tell sprite_free to not execute pal_deallocate. This will */
 	/* make it so the colors are not freed and you won't get the */
diff --git a/engines/mads/madsv2/core/text.cpp b/engines/mads/madsv2/core/text.cpp
index 4fe651b0595..1e660c43024 100644
--- a/engines/mads/madsv2/core/text.cpp
+++ b/engines/mads/madsv2/core/text.cpp
@@ -187,7 +187,6 @@ static void text_copy_string(char **mark, char *string) {
 		(*mark)++;
 }
 
-
 static void text_copy_vocab(char **mark, int vocab_id, char *alternative) {
 	char *my_string;
 
@@ -330,8 +329,6 @@ done:
 	;
 }
 
-
-
 static void text_choice(char **source, char **dest) {
 	int index;
 	int index_value;
@@ -366,8 +363,6 @@ static void text_choice(char **source, char **dest) {
 	text_copy_string(dest, temp_buf);
 }
 
-
-
 static void text_icon(char *my_text, SeriesPtr *icon, int *id) {
 	char name[80];
 	char *mark;
diff --git a/engines/mads/madsv2/core/tile.cpp b/engines/mads/madsv2/core/tile.cpp
index ff7e3f4d90a..8ab6a2f7ac6 100644
--- a/engines/mads/madsv2/core/tile.cpp
+++ b/engines/mads/madsv2/core/tile.cpp
@@ -512,7 +512,6 @@ done:
 	return error_flag;
 }
 
-
 int tile_buffer(Buffer *target, TileResource *tile_resource,
 		TileMapHeader *map, int tile_x, int tile_y) {
 	int default_value;
@@ -567,7 +566,6 @@ int tile_buffer(Buffer *target, TileResource *tile_resource,
 	return false;
 }
 
-
 void tile_map_free(TileMapHeader *map) {
 	if (map != NULL) {
 		if (map->resource != NULL) {
@@ -581,10 +579,7 @@ void tile_map_free(TileMapHeader *map) {
 	}
 }
 
-
-void tile_pan(TileMapHeader *tile_map,
-	int           x,
-	int           y) {
+void tile_pan(TileMapHeader *tile_map, int x, int y) {
 	int tile_x, offset_x;
 	int tile_y, offset_y;
 
@@ -621,12 +616,7 @@ done:
 	;
 }
 
-
-int tile_fake_map(int tile_type,
-	TileMapHeader *tile_map,
-	Buffer *buffer,
-	int           x,
-	int           y) {
+int tile_fake_map(int tile_type, TileMapHeader *tile_map, Buffer *buffer, int x, int y) {
 	int error_flag = true;
 
 	tile_map->tile_type = tile_type;
diff --git a/engines/mads/madsv2/core/vocab.cpp b/engines/mads/madsv2/core/vocab.cpp
index 604eb55984b..0adf45bd3e0 100644
--- a/engines/mads/madsv2/core/vocab.cpp
+++ b/engines/mads/madsv2/core/vocab.cpp
@@ -266,10 +266,6 @@ char *vocab_get_word(char *word_buf, int word_code) {
 	return result;
 }
 
-int vocab_write_file(const char *last_word) {
-	error("TODO: vocab_write_file");
-}
-
 void vocab_report_error(int number) {
 	char temp_buf_1[80], temp_buf_2[80];
 	int dos_flag;
@@ -351,7 +347,6 @@ void vocab_report_error(int number) {
 	}
 }
 
-
 char *vocab_select_word(char *out, const char *prompt, const char *default_word) {
 	dialog_declare(dialog);
 	char *result;
@@ -414,7 +409,6 @@ char *vocab_select_word(char *out, const char *prompt, const char *default_word)
 	return (result);
 }
 
-
 void vocab_sort() {
 	char temp_buf[VC_MAXWORDLEN + 2];
 	int any_changes;
@@ -452,141 +446,6 @@ static bool check_for_caps(const char *string) {
 	return any_caps;
 }
 
-
-void vocab_maint_exec() {
-	DialogPtr dialog;
-	char temp_buf[80];
-	char word_buf[VC_MAXWORDLEN + 2];
-	int editing_vocab;
-	int vocab_howmany;
-	int vocab_address;
-	int vocab_rows;
-	int vocab_code;
-	int vocab_count;
-	int write_error;
-	ItemPtr word_item, add_item, del_item, line_item, sort_item, exit_item, result_item;
-
-	Common::sprintf_s(temp_buf, "MADS Vocabulary Maintenance Utility Version %s", vocab_version);
-
-	word_buf[0] = 0;
-
-	write_error = false;
-
-	editing_vocab = true;
-
-	while (editing_vocab && (!write_error)) {
-
-		vocab_howmany = (vocab_words - vocab_first_soft) + 1;
-		vocab_address = (vocab_first_soft - 1) * (VC_MAXWORDLEN + 1);
-
-		vocab_rows = screen_max_y - 18;
-
-		dialog = dialog_create(NULL, DD_CENTER, 3, DD_AUTO, DD_DEFAULT,
-			DD_DEFAULT, DD_DEFAULT);
-
-		dialog_center_message(dialog, temp_buf);
-		dialog_add_blank(dialog);
-
-		word_item = dialog_add_listbased(dialog, DD_IX_LEFT, DD_IY_AUTOFILL,
-			"~Word: ", word_buf, VC_MAXWORDLEN,
-			"~Vocabulary List:", vocab + vocab_address,
-			vocab_howmany, VC_MAXWORDLEN + 1, VC_MAXWORDLEN,
-			vocab_rows, 64 / VC_MAXWORDLEN);
-
-		add_item = dialog_left_button(dialog, " ~Add ");
-		del_item = dialog_left_button(dialog, "~Delete");
-		sort_item = dialog_left_button(dialog, "~Sort");
-
-		if (screen_max_y == 50) {
-			line_item = dialog_left_button(dialog, "25 ~Lines");
-		} else {
-			line_item = dialog_left_button(dialog, "50 ~Lines");
-		}
-
-		exit_item = dialog_add_button(dialog, DD_IX_RIGHT, DD_IY_BUTTON, " Exit ");
-		dialog->cancel_item = exit_item;
-
-		result_item = dialog_execute(dialog, word_item, add_item, NULL);
-
-		if (result_item == exit_item) {
-
-			editing_vocab = false;
-
-		} else if (result_item == sort_item) {
-
-			vocab_sort();
-			write_error = vocab_write_file(NULL);
-			if (write_error) {
-				vocab_report_error(write_error);
-			}
-
-		} else if (result_item == line_item) {
-
-			mouse_hide();
-
-			if (screen_max_y == 25) {
-				screen_set_size(50);
-			} else {
-				screen_set_size(25);
-			}
-
-			screen_clear(background);
-
-			mouse_show();
-
-		} else {
-
-			Common::strcpy_s(word_buf, dialog_read_list(dialog, word_item));
-			// _fstrlwr (word_buf);
-			fileio_purge_trailing_spaces(word_buf);
-
-			vocab_code = vocab_get_code(word_buf);
-
-			if (result_item != del_item) {
-				if (vocab_code > 0) {
-					vocab_report_error(VC_ERR_WORDALREADYEXISTS);
-				} else {
-					if (vocab_words >= VC_MAXWORDS) {
-						vocab_report_error(VC_ERR_TOOMANYWORDS);
-					} else {
-						if (strlen(word_buf) > 0) {
-							if (check_for_caps(word_buf) && (!(env_privileges & MADS_PRIV_SYSTEM))) {
-								dialog_alert_ok("Cannot add capitalized words",
-									"at this privilege level.",
-									word_buf, NULL);
-							} else {
-								vocab_address = vocab_words * (VC_MAXWORDLEN + 1);
-								Common::strcpy_s(vocab + vocab_address, 65536, word_buf);
-								vocab_words++;
-								write_error = vocab_write_file(NULL);
-								if (write_error) {
-									vocab_report_error(write_error);
-								}
-							}
-						}
-					}
-				}
-			} else {
-				if (vocab_code == 0) {
-					vocab_report_error(VC_ERR_NOSUCHWORD);
-				} else {
-					vocab_address = (vocab_code - 1) * (VC_MAXWORDLEN + 1);
-					vocab_count = (vocab_words - vocab_code) * (VC_MAXWORDLEN + 1);
-					if (vocab_count > 0) {
-						memcpy(vocab + vocab_address, vocab + vocab_address + VC_MAXWORDLEN + 1, vocab_count);
-					}
-					vocab_words--;
-					write_error = vocab_write_file(NULL);
-					if (write_error) {
-						vocab_report_error(write_error);
-					}
-				}
-			}
-		}
-		dialog_destroy_persist(dialog);
-	}
-}
-
 void vocab_unload_active() {
 	vocab_size = 0;
 	if (vocab_text != NULL) {
diff --git a/engines/mads/madsv2/core/vocab.h b/engines/mads/madsv2/core/vocab.h
index 350e5358c19..99ac5250f13 100644
--- a/engines/mads/madsv2/core/vocab.h
+++ b/engines/mads/madsv2/core/vocab.h
@@ -71,23 +71,9 @@ extern int vocab_load(int allocation_flag);
 extern int vocab_get_code(char *inp);
 extern char *vocab_get_word(char *out, int inp);
 
-/**
- * Writes the main vocabulary file to disk.
- *
- * "last_word" is a pointer to a bonus word to be added to the
- * end of the list as it is written out; if last_word is NULL,
- * then no bonus word is written.
- */
-extern int vocab_write_file(const char *last_word);
-
-extern int vocab_add_word(const char *inp);
 extern void vocab_report_error(int number);
 extern char *vocab_select_word(char *out, const char *prompt, const char *default_word);
-extern void vocab_maint();
-extern int vocab_build();
 extern void vocab_unload_active();
-extern void vocab_init_active();
-extern int vocab_active_id(word id);
 extern int vocab_make_active(int id);
 extern int vocab_load_active();
 extern char *vocab_string(int vocab_id);


Commit: d0aced752fd46ea11bb26cdca40dce35ac5d2d38
    https://github.com/scummvm/scummvm/commit/d0aced752fd46ea11bb26cdca40dce35ac5d2d38
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-05T22:07:15+10:00

Commit Message:
MADS: DRAGONSPHERE: Add speech code to object_examine

As far as I know, the CD version doesn't use it for standard
calls, but it's possible it may be in use from some of the
room scripts that call it.

Changed paths:
    engines/mads/madsv2/core/object.cpp


diff --git a/engines/mads/madsv2/core/object.cpp b/engines/mads/madsv2/core/object.cpp
index 8fa83d16d1e..0f1ccf4abcf 100644
--- a/engines/mads/madsv2/core/object.cpp
+++ b/engines/mads/madsv2/core/object.cpp
@@ -39,6 +39,7 @@
 #include "mads/madsv2/core/pal.h"
 #include "mads/madsv2/core/popup.h"
 #include "mads/madsv2/core/room.h"
+#include "mads/madsv2/core/speech.h"
 #include "mads/madsv2/core/sprite.h"
 #include "mads/madsv2/core/text.h"
 #include "mads/madsv2/core/tile.h"
@@ -335,27 +336,22 @@ int object_examine(int number, long message, int speech) {
 
 	if (message) {
 		text_saves_screen = false;
-		// text_default_y    = y_base;
-		// for (count = 0; count < (popup_num_colors - 1); count++) {
-		// popup_colors[count] -= object_extra_colors;
-		// }
 		memcpy(&cycling_palette[248].r, &master_palette[248].r, 8 * sizeof(RGBcolor));
 
-		// pl    if (speech) {
-		// if (speech_system_active && speech_on) {
-		// speech_play (object_speech_resource, speech);
-		// }
-		// }
+		if (speech) {
+			if (speech_system_active && speech_on) {
+				speech_play (object_speech_resource, speech);
+			}
+		}
+
 		text_show(message);
 
-		// pl    if (speech && speech_system_active && speech_on) {
-		// speech_all_off();
-		// }
-			// for (count = 0; count < (popup_num_colors - 1); count++) {
-			// popup_colors[count] += object_extra_colors;
-			// }
+		if (speech && speech_system_active && speech_on) {
+			speech_all_off();
+		}
+
 		text_saves_screen = true;
-		// text_default_y    = POPUP_CENTER;
+
 	} else {
 		keys_get();
 	}


Commit: fb88bddaabdc7ea509b3dcd9f25d2a46f750d01b
    https://github.com/scummvm/scummvm/commit/fb88bddaabdc7ea509b3dcd9f25d2a46f750d01b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-05T22:07:15+10:00

Commit Message:
MADS: Janitorial

Changed paths:
  R engines/mads/madsv2/core/lbm.cpp
  R engines/mads/madsv2/core/lbm.h
  R engines/mads/madsv2/core/lock.h
    engines/mads/madsv2/core/anim.cpp
    engines/mads/madsv2/core/game.cpp
    engines/mads/madsv2/core/himem.cpp
    engines/mads/madsv2/core/implode.cpp
    engines/mads/madsv2/core/inter.cpp
    engines/mads/madsv2/core/kernel.cpp
    engines/mads/madsv2/core/loader.cpp
    engines/mads/madsv2/core/magic.cpp
    engines/mads/madsv2/core/matte.cpp
    engines/mads/madsv2/core/mem.cpp
    engines/mads/madsv2/core/mem.h
    engines/mads/madsv2/core/mouse.cpp
    engines/mads/madsv2/core/mouse.h
    engines/mads/madsv2/core/object.cpp
    engines/mads/madsv2/core/pack.cpp
    engines/mads/madsv2/core/popup.cpp
    engines/mads/madsv2/core/sprite.cpp
    engines/mads/madsv2/core/vocab.cpp
    engines/mads/module.mk


diff --git a/engines/mads/madsv2/core/anim.cpp b/engines/mads/madsv2/core/anim.cpp
index f66a9c6adf5..93f4605eb60 100644
--- a/engines/mads/madsv2/core/anim.cpp
+++ b/engines/mads/madsv2/core/anim.cpp
@@ -28,7 +28,6 @@
 #include "mads/madsv2/core/room.h"
 #include "mads/madsv2/core/color.h"
 #include "mads/madsv2/core/fileio.h"
-#include "mads/madsv2/core/lbm.h"
 #include "mads/madsv2/core/buffer.h"
 #include "mads/madsv2/core/matte.h"
 #include "mads/madsv2/core/inter.h"
diff --git a/engines/mads/madsv2/core/game.cpp b/engines/mads/madsv2/core/game.cpp
index adaf0ede427..6585cfbca1a 100644
--- a/engines/mads/madsv2/core/game.cpp
+++ b/engines/mads/madsv2/core/game.cpp
@@ -51,7 +51,6 @@
 #include "mads/madsv2/core/popup.h"
 #include "mads/madsv2/core/object.h"
 #include "mads/madsv2/core/himem.h"
-#include "mads/madsv2/core/lock.h"
 #include "mads/madsv2/core/magic.h"
 #include "mads/madsv2/core/btype.h"
 #include "mads/madsv2/core/pack.h"
diff --git a/engines/mads/madsv2/core/himem.cpp b/engines/mads/madsv2/core/himem.cpp
index 196fcaef359..5f707edfaa3 100644
--- a/engines/mads/madsv2/core/himem.cpp
+++ b/engines/mads/madsv2/core/himem.cpp
@@ -84,7 +84,7 @@ int himem_get_directory_entry(int id) {
 	error_flag = false;
 
 done:
-	return (error_flag);
+	return error_flag;
 }
 
 int himem_put_directory_entry(int id) {
diff --git a/engines/mads/madsv2/core/implode.cpp b/engines/mads/madsv2/core/implode.cpp
index e1077a6b041..8dbb9926361 100644
--- a/engines/mads/madsv2/core/implode.cpp
+++ b/engines/mads/madsv2/core/implode.cpp
@@ -21,6 +21,7 @@
 
 #include "common/textconsole.h"
 #include "mads/madsv2/core/implode.h"
+#include "mads/madsv2/core/general.h"
 
 namespace MADS {
 namespace MADSV2 {
@@ -41,13 +42,6 @@ namespace MADSV2 {
  *     Qlen/Qoff calculations, GetHuff bit pump).
  */
 
-#include <string.h>
-#include <stdint.h>
-#include "implode.h"    /* extern declarations + CMP_* defines */
-
-typedef unsigned char  byte;
-typedef unsigned short word;
-
 /* =========================================================================
  *  EXPLODE
  *
diff --git a/engines/mads/madsv2/core/inter.cpp b/engines/mads/madsv2/core/inter.cpp
index 1e97e06e534..8e2be74a84a 100644
--- a/engines/mads/madsv2/core/inter.cpp
+++ b/engines/mads/madsv2/core/inter.cpp
@@ -27,7 +27,6 @@
 #include "mads/madsv2/core/mouse.h"
 #include "mads/madsv2/core/font.h"
 #include "mads/madsv2/core/pal.h"
-#include "mads/madsv2/core/lbm.h"
 #include "mads/madsv2/core/keys.h"
 #include "mads/madsv2/core/mcga.h"
 #include "mads/madsv2/core/vocab.h"
diff --git a/engines/mads/madsv2/core/kernel.cpp b/engines/mads/madsv2/core/kernel.cpp
index cd9f35034b4..8cd7972ce66 100644
--- a/engines/mads/madsv2/core/kernel.cpp
+++ b/engines/mads/madsv2/core/kernel.cpp
@@ -44,7 +44,6 @@
 #include "mads/madsv2/core/pack.h"
 #include "mads/madsv2/core/room.h"
 #include "mads/madsv2/core/xms.h"
-#include "mads/madsv2/core/lock.h"
 #include "mads/madsv2/core/tile.h"
 #include "mads/madsv2/core/popup.h"
 #include "mads/madsv2/core/pal.h"
@@ -293,9 +292,7 @@ int kernel_game_startup(int game_video_mode, int load_flag,
 	int pages;
 	int reserve[EMS_PAGING_CLASSES];
 	byte *interrupt_stack;
-#ifdef demo
-	char temp_buf[20];
-#endif
+
 #ifndef disable_error_check
 	int error_code = 0;
 #endif
@@ -305,25 +302,6 @@ int kernel_game_startup(int game_video_mode, int load_flag,
 
 	speech_init();
 
-	// ScummVM doesn't need EMS/XMS
-#if 0
-	int ems_error = true;
-
-	if (ems_exists) {
-		work_screen_ems_handle = ems_get_page_handle(4);
-		if (work_screen_ems_handle >= 0) {
-			ems_error = false;
-		}
-	}
-
-	if (ems_error) {
-		if (ems_exists) {
-			error_report(ERROR_NO_MORE_EMS, SEVERE, MODULE_KERNEL, ems_pages, work_screen_ems_handle);
-		} else {
-			error_report(ERROR_KERNEL_NO_EMS, SEVERE, MODULE_KERNEL, ems_exists, work_screen_ems_handle);
-		}
-	}
-#endif
 	if (ems_exists) {
 		if (load_flag & KERNEL_STARTUP_POPUP) {
 			object_ems_handle = ems_get_page_handle(4);
@@ -365,10 +343,6 @@ int kernel_game_startup(int game_video_mode, int load_flag,
 		}
 	}
 
-	// Some preliminary copy protection stuff
-	// lock_preliminary_check();
-	// Initialize sound driver jump table
-	// pl sound_driver_null();
 	timer_set_sound_flag(0);
 
 	// Video initialization
@@ -433,26 +407,6 @@ int kernel_game_startup(int game_video_mode, int load_flag,
 		keys_install();
 	}
 
-	// Log in demo copy
-#ifdef demo
-	if (game_video_mode != text_mode) demo_log_in(release_version, release_date);
-#endif
-
-	// Mention EMS paging situation
-#ifdef demo
-	if (ems_paging_active) {
-		ltoa(((long)ems_pages * EMS_PAGE_SIZE) >> 10, temp_buf, 10);
-		echo(temp_buf, false);
-		echo("K of EMS memory available.", true);
-	} else {
-		echo("EMS memory not available.", true);
-	}
-
-	if (xms_exists) {
-		echo("XMS memory system detected.", true);
-	}
-#endif
-
 	// Load the objects list
 	if (load_flag & KERNEL_STARTUP_OBJECTS) {
 		if (object_load()) {
@@ -2911,6 +2865,55 @@ done:
 	return error_flag;
 }
 
+void kernel_random_frame(int handle, int16 *frame, int mode) {
+	int16 newFrame = -1;
+
+	if (kernel_anim[handle].frame == *frame)
+		return;
+
+	int16 currentFrame = (int16)kernel_anim[handle].frame;
+	*frame = currentFrame;
+
+	if (currentFrame >= 1 && currentFrame <= 8) {
+		if (mode == 0)
+			newFrame = 0;
+		else if (mode == 1)
+			newFrame = 7;
+		else
+			newFrame = (int16)imath_random(1, 6);
+	}
+
+	if (newFrame >= 0) {
+		kernel_reset_animation(handle, newFrame);
+		*frame = newFrame;
+	}
+}
+
+void kernel_translate_anim(int handle, int delta_x, int delta_y, int delta_scale) {
+	Animation &k_anim = kernel_anim[handle];
+	Anim *anim = k_anim.anim;
+
+	for (int count = 0; count < anim->num_frames; ++count) {
+		Image &image = anim->image[count];
+		image.x += delta_x;
+		image.y += delta_y;
+		image.scale += delta_scale;
+	}
+}
+
+void kernel_position_anim(int handle, int x, int y, int scale, int depth) {
+	Animation &k_anim = kernel_anim[handle];
+	Anim *anim = k_anim.anim;
+
+	for (int count = 0; count < anim->num_frames; ++count) {
+		Image &image = anim->image[count];
+		image.x = x;
+		image.y = y;
+		image.scale = scale;
+		image.depth = depth;
+	}
+}
+
 void init_kernel() {
 	memset(room_state, 0, sizeof(room_state));
 	video_mode = 0;
@@ -2971,54 +2974,5 @@ void init_kernel() {
 	memset(kernel_interface_loaded, 0, sizeof(kernel_interface_loaded));
 }
 
-void kernel_random_frame(int handle, int16 *frame, int mode) {
-	int16 newFrame = -1;
-
-	if (kernel_anim[handle].frame == *frame)
-		return;
-
-	int16 currentFrame = (int16)kernel_anim[handle].frame;
-	*frame = currentFrame;
-
-	if (currentFrame >= 1 && currentFrame <= 8) {
-		if (mode == 0)
-			newFrame = 0;
-		else if (mode == 1)
-			newFrame = 7;
-		else
-			newFrame = (int16)imath_random(1, 6);
-	}
-
-	if (newFrame >= 0) {
-		kernel_reset_animation(handle, newFrame);
-		*frame = newFrame;
-	}
-}
-
-void kernel_translate_anim(int handle, int delta_x, int delta_y, int delta_scale) {
-	Animation &k_anim = kernel_anim[handle];
-	Anim *anim = k_anim.anim;
-
-	for (int count = 0; count < anim->num_frames; ++count) {
-		Image &image = anim->image[count];
-		image.x += delta_x;
-		image.y += delta_y;
-		image.scale += delta_scale;
-	}
-}
-
-void kernel_position_anim(int handle, int x, int y, int scale, int depth) {
-	Animation &k_anim = kernel_anim[handle];
-	Anim *anim = k_anim.anim;
-
-	for (int count = 0; count < anim->num_frames; ++count) {
-		Image &image = anim->image[count];
-		image.x = x;
-		image.y = y;
-		image.scale = scale;
-		image.depth = depth;
-	}
-}
-
 } // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/madsv2/core/lbm.cpp b/engines/mads/madsv2/core/lbm.cpp
deleted file mode 100644
index c849b074979..00000000000
--- a/engines/mads/madsv2/core/lbm.cpp
+++ /dev/null
@@ -1,30 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "mads/madsv2/core/lbm.h"
-
-namespace MADS {
-namespace MADSV2 {
-
-
-
-} // namespace MADSV2
-} // namespace MADS
diff --git a/engines/mads/madsv2/core/lbm.h b/engines/mads/madsv2/core/lbm.h
deleted file mode 100644
index 44dd6ea63fd..00000000000
--- a/engines/mads/madsv2/core/lbm.h
+++ /dev/null
@@ -1,41 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MADS_CORE_LBM_H
-#define MADS_CORE_LBM_H
-
-#include "mads/madsv2/core/general.h"
-#include "mads/madsv2/core/color.h"
-
-namespace MADS {
-namespace MADSV2 {
-
-extern void lbm_read_page(const char *filename, byte *image, Palette *pal);
-
-extern Buffer lbm_read_buffer(const char *filename, Palette *pal, CycleListPtr cycle);
-
-extern int lbm_read_buffer_main(const char *name, Buffer *target, int reserved_flag,
-	CycleListPtr cycle_list);
-
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/madsv2/core/loader.cpp b/engines/mads/madsv2/core/loader.cpp
index 2ab8e6622e1..aabb0d2634c 100644
--- a/engines/mads/madsv2/core/loader.cpp
+++ b/engines/mads/madsv2/core/loader.cpp
@@ -60,7 +60,6 @@ uint32 LoaderReadStream::read(void *dataPtr, uint32 dataSize) {
 	return dataSize;
 }
 
-
 int loader_open(LoadHandle handle, const char *filename, const char *options, int flags) {
 	int error_flag = true;
 	int found_himem = -1;
@@ -123,15 +122,7 @@ int loader_open(LoadHandle handle, const char *filename, const char *options, in
 				handle->decompress_size += handle->pack.strategy[count].size;
 			}
 		} else {
-#ifdef TODO
-			handle->pack.num_records = 0;
-			handle->pack.strategy[0].type = (byte)flags;
-			Common::strcpy_s(handle->pack.id_string, PACK_ID_STRING);
-			if (!fileio_fwrite_f(&handle->pack, sizeof(PackList), 1, handle->handle)) goto done;
-			handle->decompress_size = 0;
-#else
-			error("TODO: open for writing");
-#endif
+			error("Open for writing not supported in ScummVM");
 		}
 
 #ifndef disable_statistics
@@ -165,15 +156,9 @@ int loader_close(LoadHandle handle) {
 			handle->ems_page_marker = -1;
 			handle->ems_page_offset = EMS_PAGE_SIZE;
 			handle->xms_offset = 0;
-			// if (ems_paging_active) ems_unmap_all();
 		} else {
 			if (!handle->reading) {
-#ifdef TODO
-				handle->handle->seek(0);
-				error_flag = !fileio_fwrite_f(&handle->pack, sizeof(PackList), 1, handle->handle);
-#else
-				error("TODO: loader_close for writing");
-#endif
+				error("loader_close for writing not supported in ScummVM");
 			}
 
 			delete handle->handle;
@@ -220,7 +205,6 @@ long loader_read(void *target, long record_size, long record_count, LoadHandle h
 	} else if (handle->mode == LOADER_XMS) {
 		result = 0;
 
-		// printf ("Reading (%d) at %ld for size %ld\n", handle->xms_handle, handle->xms_offset, total_size);
 		if (xms_copy(total_size,
 			handle->xms_handle, (XMS)handle->xms_offset,
 			MEM_CONV, target)) goto done;
@@ -325,7 +309,7 @@ long loader_write(void *target, long record_size, long record_count, LoadHandle
 
 	handle->decompress_size += total_size;
 
-	return (result / record_size);
+	return result / record_size;
 }
 
 long loader_write_2(Common::WriteStream *source_handle, long total_size, LoadHandle handle) {
diff --git a/engines/mads/madsv2/core/lock.h b/engines/mads/madsv2/core/lock.h
deleted file mode 100644
index 389babf9e1b..00000000000
--- a/engines/mads/madsv2/core/lock.h
+++ /dev/null
@@ -1,57 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef MADS_CORE_LOCK_H
-#define MADS_CORE_LOCK_H
-
-#include "mads/madsv2/core/general.h"
-
-namespace MADS {
-namespace MADSV2 {
-
-extern char *lock_program_name;
-extern char *lock_search_mark;
-extern int  lock_search_length;
-extern word *lock_hash_value;
-
-extern word lock_get_disk_hash();
-
-extern long lock_search_hash_offset();
-
-extern void lock_write_new_hash();
-
-extern int lock_get_copy_code();
-
-extern void lock_short_protection_check();
-
-extern int lock_verification();
-extern void lock_sabotage();
-
-extern void lock_long_protection_check();
-
-extern void lock_secret_protection_check();
-
-extern void lock_preliminary_check();
-
-} // namespace MADSV2
-} // namespace MADS
-
-#endif
diff --git a/engines/mads/madsv2/core/magic.cpp b/engines/mads/madsv2/core/magic.cpp
index 56ae1c3692d..64d988fe86c 100644
--- a/engines/mads/madsv2/core/magic.cpp
+++ b/engines/mads/madsv2/core/magic.cpp
@@ -162,7 +162,6 @@ void magic_map_to_grey_ramp(Palette *pal,
 		}
 	}
 
-	// pal_pointer = (byte *) &(((RGBcolor *) pal)[base_grey]);
 	pal_pointer = ((byte *) pal + (base_grey * 3));
 	for (greys = 0; greys < num_greys; greys++) {
 		for (color = 0; color < 3; color++) {
@@ -181,7 +180,6 @@ void magic_map_to_grey_ramp(Palette *pal,
 	}
 }
 
-
 void magic_grey_ramp_palette(Palette pal, int num_greys) {
 	int base_grey;
 	int base_color, num_colors;
@@ -199,7 +197,6 @@ void magic_grey_ramp_palette(Palette pal, int num_greys) {
 	}
 }
 
-
 void magic_fade_to_grey(Palette pal, byte *map_pointer,
 	int base_color, int num_colors,
 	int base_grey, int num_greys,
@@ -218,9 +215,7 @@ void magic_fade_to_grey(Palette pal, byte *map_pointer,
 	byte *pal_index;
 	char *signs;
 	MagicGrey *magic_map;
-	// Palette temp_pal;
-	// char signs[256][3];
-	// MagicGrey magic_map[256];
+
 	memory_needed = (sizeof(Palette) << 1) + (sizeof(MagicGrey) << 8);
 
 	if (timer_low_semaphore) {
@@ -258,8 +253,6 @@ void magic_fade_to_grey(Palette pal, byte *map_pointer,
 			dif = (intensity - pal_color(pal, count, color));
 			*(pal_index + (color << 8) + count) = (byte)abs(dif);
 			*(signs + (color << 8) + count) = (char)sgn(dif);
-			// pal_color(temp_pal,count,color) = (byte)abs(dif);
-			// signs[count][color] = (char)sgn(dif);
 		}
 	}
 
@@ -270,11 +263,10 @@ void magic_fade_to_grey(Palette pal, byte *map_pointer,
 			index = count - base_color;
 			for (color = 0; color < 3; color++) {
 				magic_map[index].accum[color] += *(pal_index + (color << 8) + count);
-				// magic_map[index].accum[color] += pal_color(temp_pal, count, color);
+
 				while (magic_map[index].accum[color] >= (word)steps) {
 					magic_map[index].accum[color] -= steps;
 					pal_color(pal, count, color) += *(signs + (color << 8) + count);
-					// pal_color(pal,count,color) += signs[count][color];
 				}
 			}
 		}
@@ -318,9 +310,7 @@ void magic_fade_from_grey(RGBcolor *pal, Palette target,
 	byte *pal_index;
 	char *signs;
 	MagicGrey *magic_map;
-	// Palette temp_pal;
-	// char signs[256][3];
-	// MagicGrey magic_map[256];
+
 	memory_needed = (sizeof(Palette) << 1) + (sizeof(MagicGrey) << 8);
 
 	if (timer_low_semaphore) {
@@ -359,9 +349,7 @@ void magic_fade_from_grey(RGBcolor *pal, Palette target,
 			}
 			dif = (pal_color(target, count, color) - intensity);
 			*(pal_index + (count * 3) + color) = (byte)abs(dif);
-			// pal_color(pal_index,count,color) = (byte)abs(dif);
 			*(signs + (color << 8) + count) = (char)sgn(dif);
-			// signs[count][color] = (char)sgn(dif);
 			magic_map[index].accum[color] = 0;
 		}
 	}
@@ -373,12 +361,10 @@ void magic_fade_from_grey(RGBcolor *pal, Palette target,
 			index = count - base_color;
 			for (color = 0; color < 3; color++) {
 				magic_map[index].accum[color] += *(pal_index + (count * 3) + color);
-				// magic_map[index].accum[color] += pal_color(pal_index ,count, color);
+
 				while (magic_map[index].accum[color] >= (word)steps) {
 					magic_map[index].accum[color] -= steps;
 					*((byte *)pal + (count * 3) + color) += *(signs + (color << 8) + count);
-					// (((byte *)&pal[count])+color) += *(signs + (color << 8) + count);
-					// (((byte *)&pal[count])+color) += signs[count][color];
 				}
 			}
 		}
@@ -397,7 +383,6 @@ done:
 	}
 }
 
-
 void magic_screen_change_corner(Buffer *new_screen, Palette pal,
 	int corner_id,
 	int buffer_base_x, int buffer_base_y,
@@ -500,12 +485,6 @@ void magic_screen_change_corner(Buffer *new_screen, Palette pal,
 						*vx + buffer_base_x, y1 + buffer_base_y,
 						*vx + screen_base_x, y1 + screen_base_y,
 						1, size_y);
-#ifdef sixteen_colors
-					if (video_mode == ega_mode) {
-						video_flush_ega(y1 + screen_base_y,
-							y1 + screen_base_y + size_y - 1);
-					}
-#endif
 				}
 			} else {
 				buffer_rect_fill(scr_live,
@@ -543,11 +522,9 @@ void magic_screen_change_corner(Buffer *new_screen, Palette pal,
 			x, y);
 	}
 
-
 	mouse_show();
 }
 
-
 void magic_screen_change_edge(Buffer *new_screen, Palette pal,
 	int edge_id,
 	int buffer_base_x, int buffer_base_y,
@@ -615,11 +592,6 @@ void magic_screen_change_edge(Buffer *new_screen, Palette pal,
 						at_x + buffer_base_x, y1 + buffer_base_y,
 						at_x + screen_base_x, y1 + screen_base_y,
 						1, size_y);
-#ifdef sixteen_colors
-					if (video_mode == ega_mode) {
-						video_flush_ega(y1 + screen_base_y, y1 + screen_base_y + size_y - 1);
-					}
-#endif
 				}
 			} else {
 				buffer_rect_fill(scr_live,
@@ -650,7 +622,6 @@ void magic_screen_change_edge(Buffer *new_screen, Palette pal,
 	mouse_show();
 }
 
-
 void magic_screen_change_circle(Buffer *new_screen, Palette pal,
 	int inward_flag,
 	int buffer_base_x, int buffer_base_y,
@@ -774,12 +745,6 @@ void magic_screen_change_circle(Buffer *new_screen, Palette pal,
 											x1 + buffer_base_x, this_y + buffer_base_y,
 											x1 + screen_base_x, this_y + screen_base_y,
 											xs, 1);
-#ifdef sixteen_colors
-										if (video_mode == ega_mode) {
-											video_flush_ega(this_y + screen_base_y,
-												this_y + screen_base_y);
-										}
-#endif
 									}
 								} else {
 									buffer_rect_fill(scr_live,
@@ -864,7 +829,6 @@ void magic_shrink_buffer(Buffer *from, Buffer *unto) {
 	} while (y_count != 0);
 }
 
-
 int  magic_shrinking_buffer(Buffer *source, Buffer *rear,
 	int grow_flag,
 	int buffer_base_x, int buffer_base_y,
@@ -933,12 +897,6 @@ int  magic_shrinking_buffer(Buffer *source, Buffer *rear,
 				at_x + screen_base_x, at_y + screen_base_y,
 				size_x, size_y);
 
-#ifdef sixteen_colors
-			if (video_mode == ega_mode) {
-				video_flush_ega(at_y + screen_base_y, at_y + screen_base_y + size_y - 1);
-			}
-#endif
-
 			do {
 				now_timing = timer_read_600();
 			} while (now_timing < (base_timing + tick_delay));
@@ -946,7 +904,6 @@ int  magic_shrinking_buffer(Buffer *source, Buffer *rear,
 
 		}
 	} else {
-
 		last_size_y = y;
 		last_size_x = x;
 		last_at_y = 0;
@@ -996,11 +953,6 @@ int  magic_shrinking_buffer(Buffer *source, Buffer *rear,
 					last_to_x - (dif_x - 1), last_at_y,
 					dif_x, last_size_y);
 
-#ifdef sixteen_colors
-				if (video_mode == ega_mode) {
-					video_flush_ega(last_at_y, last_to_y);
-				}
-#endif
 			} else {
 				buffer_rect_fill(scr_live, last_at_x, last_at_y,
 					dif_x, last_size_y, 0);
@@ -1029,19 +981,19 @@ int  magic_shrinking_buffer(Buffer *source, Buffer *rear,
 	error_flag = false;
 
 done:
-	if (bonus.data != NULL) buffer_free(&bonus);
-	if (shrink.data != NULL) buffer_free(&shrink);
-	if (extra.data != NULL) buffer_free(&extra);
+	if (bonus.data != NULL)
+		buffer_free(&bonus);
+	if (shrink.data != NULL)
+		buffer_free(&shrink);
+	if (extra.data != NULL)
+		buffer_free(&extra);
 
 	mouse_show();
 
-	return (error_flag);
+	return error_flag;
 }
 
-
-void magic_swap_me_in_the_dark_baby(byte *swap,
-	RGBcolor *pal,
-	int start) {
+void magic_swap_me_in_the_dark_baby(byte *swap, RGBcolor *pal, int start) {
 	int static_start;
 	int count;
 	byte *static_list;
@@ -1067,13 +1019,10 @@ void magic_swap_me_in_the_dark_baby(byte *swap,
 	}
 }
 
-
-void magic_swap_foreground(byte *background_table,
-	Palette background_palette) {
+void magic_swap_foreground(byte *background_table, Palette background_palette) {
 	int     count;
 	byte *old_palette;
 	byte    swap_table[256];
-	// Palette old_palette;
 	long    memory_needed;
 	byte *work_memory = NULL;
 	Heap    magic_heap;
@@ -1114,14 +1063,12 @@ void magic_swap_foreground(byte *background_table,
 
 done:
 	if (!timer_low_semaphore) {
-		if (work_memory != NULL) mem_free(work_memory);
+		if (work_memory != NULL)
+			mem_free(work_memory);
 	}
 }
 
-int magic_closest_color(RGBcolor *match_color,
-	byte *list,
-	int list_wrap,
-	int list_length) {
+int magic_closest_color(RGBcolor *match_color, byte *list, int list_wrap, int list_length) {
 	int best_color = 0;
 	int this_color = 0;
 	int best_diff = 0x7fff;
@@ -1140,6 +1087,7 @@ int magic_closest_color(RGBcolor *match_color,
 			best_diff = diff;
 		}
 	}
+
 	return best_color;
 }
 
diff --git a/engines/mads/madsv2/core/matte.cpp b/engines/mads/madsv2/core/matte.cpp
index 7b73645a837..bdf7445d861 100644
--- a/engines/mads/madsv2/core/matte.cpp
+++ b/engines/mads/madsv2/core/matte.cpp
@@ -36,24 +36,18 @@
 #include "mads/madsv2/core/timer.h"
 #include "mads/madsv2/core/sound.h"
 #include "mads/madsv2/engine.h"
-
-#define word_align_mattes
-#ifndef disable_error_check
-#include "mads/madsv2/core/error.h"
-#endif
-
 #include "mads/madsv2/core/video.h"
 #include "mads/madsv2/core/anim.h"
 #include "mads/madsv2/core/matte.h"
-
-#ifdef show_mattes
-#include "mads/madsv2/core/screen.h"
-#include "mads/madsv2/core/keys.h"
+#ifndef disable_error_check
+#include "mads/madsv2/core/error.h"
 #endif
 
 namespace MADS {
 namespace MADSV2 {
 
+#define word_align_mattes
+
 /* Global data structures */
 
 SeriesPtr series_list[SERIES_LIST_SIZE + SERIES_BONUS_SIZE];
@@ -595,7 +589,6 @@ static void matte_special_effect(int special_effect, int full_screen) {
 			work_screen->x, work_screen->y);
 
 		matte_quick_from_black(&special_pal[0].r, 1);
-		//magic_fade_from_grey(special_pal, master_palette, 0, 256, 0, 1, 1, 16);
 		break;
 
 	case MATTE_FX_CORNER_LOWER_LEFT:
@@ -674,10 +667,6 @@ void matte_frame(int special_effect, int full_screen) {
 	Image *image2;
 	Message *message;
 	SpritePtr  sprite;
-#ifdef show_mattes
-	char temp_buf[80];
-	int count;
-#endif
 
 	// Make sure work buffer is mapped into the page frame
 	matte_map_work_screen();
@@ -730,12 +719,10 @@ void matte_frame(int special_effect, int full_screen) {
 	for (id = image_marker; id < FIRST_MESSAGE_MATTE; id++) {
 		matte->valid = false;
 		matte++;
-		// matte_list[id].valid = false;
 	}
 
 	message = message_list;
 	for (id = 0; id < MESSAGE_LIST_SIZE; id++) {
-		// index = id + FIRST_MESSAGE_MATTE;
 		if ((message->status < 0) && message->active) {
 			matte->changed = true;
 			make_message_matte(id, matte);
@@ -757,13 +744,11 @@ void matte_frame(int special_effect, int full_screen) {
 			if (matte->valid) {
 
 				if ((matte->xs > 0) && (matte->ys > 0)) {
-
 					buffer_rect_copy_2(scr_orig, scr_work,
 						matte->x + picture_map.pan_offset_x,
 						matte->y + picture_map.pan_offset_y,
 						matte->x, matte->y,
 						matte->xs, matte->ys);
-
 				}
 			}
 
@@ -935,28 +920,19 @@ void matte_frame(int special_effect, int full_screen) {
 				matte = matte_list;
 
 				for (id = 0; id < MATTE_LIST_SIZE; id++) {
-
 					// Get next matte
-#ifdef show_mattes
-					sprintf(temp_buf, "(%d, %d) => (%d, %d)   valid: %d   changed: %d      ",
-						matte->x, matte->y, matte->xs, matte->ys, matte->valid, matte->changed);
-					screen_show(temp_buf, 0, id);
-#endif
 
 					// Ignore empty mattes, or images which did not change
 					if (matte->valid && matte->changed && (matte->xs > 0) && (matte->ys > 0)) {
-
 						video_update(&scr_work,
 							matte->x, matte->y,
 							matte->x + viewing_at_x,
 							matte->y + viewing_at_y,
 							matte->xs, matte->ys);
-
 					}
 
 					matte++;
 				}
-
 			} else {
 				video_update(&scr_work,
 					0, 0,
@@ -965,22 +941,12 @@ void matte_frame(int special_effect, int full_screen) {
 					video_x, display_y);
 			}
 
-#ifdef sixteen_colors
-			if (video_mode == ega_mode) {
-				beware_the_mouse = mouse_refresh_view_port();  // Prepare cursor overlay
-				video_flush_ega(viewing_at_y, scr_work.y);  // Update the EGA screen
-			}
-#endif
 		} else {
 			matte_special_effect(special_effect, full_screen);
 			sound_queue_flush();
 		}
 	}
 
-#ifdef show_mattes
-	keys_get();
-#endif
-
 	if (beware_the_mouse) {
 		mouse_refresh_done();  // Remove cursor image from work buffer
 	}
@@ -1014,7 +980,6 @@ void matte_frame(int special_effect, int full_screen) {
 	}
 }
 
-
 int matte_allocate_inter_image() {
 	int result;
 
@@ -1027,10 +992,9 @@ int matte_allocate_inter_image() {
 		result = image_inter_marker++;
 	}
 
-	return (result);
+	return result;
 }
 
-
 void matte_refresh_inter() {
 	int id;
 
@@ -1039,7 +1003,6 @@ void matte_refresh_inter() {
 	image_inter_list[id].segment_id = (byte)-1;
 }
 
-
 static void make_inter_matte(ImageInterPtr image, MattePtr matte) {
 	SpritePtr sprite;
 	int xs, ys;
@@ -1079,8 +1042,6 @@ static void make_inter_matte(ImageInterPtr image, MattePtr matte) {
 	bound_matte(matte, xs, ys, scr_inter.x, scr_inter.y);
 }
 
-
-
 void matte_inter_frame(int update_live, int clear_chaff) {
 	int id;
 	int x, y;
@@ -1095,16 +1056,11 @@ void matte_inter_frame(int update_live, int clear_chaff) {
 	MattePtr i_am_the_dog_master = NULL;
 	ImageInter *image;
 	ImageInter *image2;
-#ifdef show_mattes
-	char temp_buf[80];
-	int count;
-#endif
 
 	// Make sure work buffer is mapped into the page frame
 	matte_map_work_screen();
 
-	// Before performing erasures, make a matte for each potential erasure
-	// image.
+	// Before performing erasures, make a matte for each potential erasure image.
 	image = image_inter_list;
 	matte = matte_inter_list;
 	for (id = 0; id < (int)image_inter_marker; id++) {
@@ -1151,6 +1107,7 @@ void matte_inter_frame(int update_live, int clear_chaff) {
 				}
 			}
 		}
+
 		matte++;
 		image++;
 	}
@@ -1202,12 +1159,12 @@ void matte_inter_frame(int update_live, int clear_chaff) {
 				}
 			}
 		}
+
 		image++;
 		matte++;
 	}
 
 	if (update_live) {
-
 		// Finally, run through our combined matte list, and update any
 		// areas of the screen flagged as "changed" by copying from the
 		// work screen to the live video screen.
@@ -1222,13 +1179,7 @@ void matte_inter_frame(int update_live, int clear_chaff) {
 
 		matte = matte_inter_list;
 		for (id = 0; id < (int)image_inter_marker; id++) {
-
 			// Get next matte
-#ifdef show_mattes
-			sprintf(temp_buf, "(%d, %d) => (%d, %d)   valid: %d   changed: %d      ",
-				matte->x, matte->y, matte->xs, matte->ys, matte->valid, matte->changed);
-			screen_show(temp_buf, 0, id);
-#endif
 
 			// Ignore empty mattes, or images which did not change
 			if (matte->valid && matte->changed && (matte->xs > 0) && (matte->ys > 0)) {
@@ -1243,17 +1194,6 @@ void matte_inter_frame(int update_live, int clear_chaff) {
 			matte++;
 		}
 
-#ifdef sixteen_colors
-		if (video_mode == ega_mode) {
-			beware_the_mouse = mouse_refresh_view_port();  // Prepare cursor overlay
-			video_flush_ega(inter_viewing_at_y, scr_inter.y);  // Update the EGA screen
-		}
-#endif
-
-#ifdef show_mattes
-		keys_get();
-#endif
-
 		if (beware_the_mouse) {
 			mouse_refresh_done();  // Remove cursor image from work buffer
 		}
@@ -1286,6 +1226,7 @@ void matte_inter_frame(int update_live, int clear_chaff) {
 		}
 		image++;
 	}
+
 	image_inter_marker = new_marker;
 }
 
diff --git a/engines/mads/madsv2/core/mem.cpp b/engines/mads/madsv2/core/mem.cpp
index bedc8c03cac..6fd93ce7036 100644
--- a/engines/mads/madsv2/core/mem.cpp
+++ b/engines/mads/madsv2/core/mem.cpp
@@ -63,13 +63,6 @@ void *mem_get(long size) {
 	return (mem_get_name(size, "$sys$"));
 }
 
-void mem_get_block_name(byte *block, char *block_name) {
-	// TODO: See if the block_name is needed. If so, we'll need to simulate the
-	// original by allocating extra space to store it
-	error("TODO: mem_get_block_name");
-}
-
-
 bool mem_free(void *memory_block) {
 	free(memory_block);
 	return false;
diff --git a/engines/mads/madsv2/core/mem.h b/engines/mads/madsv2/core/mem.h
index 9148098bca1..d55fedee152 100644
--- a/engines/mads/madsv2/core/mem.h
+++ b/engines/mads/madsv2/core/mem.h
@@ -85,17 +85,10 @@ inline int mem_adjust(T *&target, long size) {
 extern void mem_save_free();
 extern void mem_restore_free();
 
-/**
- * Returns the string label of the memory block
- */
-extern void mem_get_block_name(byte *block, char *block_name);
-
 extern long mem_get_avail();
 extern long mem_conv_get_avail();
 extern void mem_set_video_mode(int mode);
 
-extern long mem_program_block();
-
 } // namespace MADSV2
 } // namespace MADS
 
diff --git a/engines/mads/madsv2/core/mouse.cpp b/engines/mads/madsv2/core/mouse.cpp
index 83d11e75f15..a4ec96ffe8d 100644
--- a/engines/mads/madsv2/core/mouse.cpp
+++ b/engines/mads/madsv2/core/mouse.cpp
@@ -242,10 +242,6 @@ void mouse_disable_scale() {
 void mouse_hard_cursor_mode(int mode, Palette *mypal) {
 }
 
-const byte *mouse_get_stack() {
-	error("TODO: mouse_get_stack");
-}
-
 void mouse_hard_cursor_mode(int mode, Palette mypal) {
 }
 
diff --git a/engines/mads/madsv2/core/mouse.h b/engines/mads/madsv2/core/mouse.h
index 7faf48725d7..6661e7ca5bd 100644
--- a/engines/mads/madsv2/core/mouse.h
+++ b/engines/mads/madsv2/core/mouse.h
@@ -82,7 +82,6 @@ extern int mouse_refresh_view_port();
 extern void mouse_refresh_done();
 extern void mouse_disable_scale();
 extern void mouse_hard_cursor_mode(int mode, Palette *mypal);
-extern const byte *mouse_get_stack();
 
 /**
  * Returns true if the mouse is in the specified box
diff --git a/engines/mads/madsv2/core/object.cpp b/engines/mads/madsv2/core/object.cpp
index 0f1ccf4abcf..370cd4ecb1f 100644
--- a/engines/mads/madsv2/core/object.cpp
+++ b/engines/mads/madsv2/core/object.cpp
@@ -208,12 +208,10 @@ int object_examine(int number, long message, int speech) {
 	int num_colors;
 	int cycling_save;
 	int y_base;
-	//int x_size;// , y_size;
 	int count;
 	int refresh_flag;
 	int object_preserve_handle;
 	byte map[256];
-	//SeriesPtr object_series = NULL;
 	RGBcolor top_eight[8];
 
 	// Wait cursor
@@ -304,38 +302,20 @@ int object_examine(int number, long message, int speech) {
 
 	video_update(&scr_main, 0, 0, 0, 0, video_x, video_y);
 
-	if (refresh_flag) mouse_refresh_done();
+	if (refresh_flag)
+		mouse_refresh_done();
 	mouse_thaw();
 
 	mcga_setpal(&master_palette);
-
-	// Load the object series
-	// object_series = sprite_series_load (sprite_name, PAL_MAP_BACKGROUND);
 	matte_map_work_screen();
 
-	// Now set the palette to include the colors for this series.
-	// mcga_setpal (&master_palette);
 	y_base = OBJECT_VIEW_OFFSET;
 
-	// Draw the object sprite on the screen
-	// if (object_series != NULL) {
-	// x_size = object_series->index[0].xs;
-	// y_size = object_series->index[0].ys;
-	// x_base = (video_x >> 1) - (x_size >> 1);
-	// sprite_draw  (object_series, 1, &scr_main, x_base, y_base);
-	//
-	// mouse_hide();
-	//
-	// video_update (&scr_main, x_base, y_base, x_base, y_base, x_size, y_size);
-	//
-	// mouse_show();
-	//
-	// y_base += y_size;
-	// }
 	y_base += OBJECT_VIEW_OFFSET;
 
 	if (message) {
 		text_saves_screen = false;
+
 		memcpy(&cycling_palette[248].r, &master_palette[248].r, 8 * sizeof(RGBcolor));
 
 		if (speech) {
@@ -422,30 +402,26 @@ int object_examine(int number, long message, int speech) {
 		restored_screen = true;
 	}
 
-	// done:
-	  // Turn color cycling back on.
+	// Turn color cycling back on.
 	memcpy(&cycling_palette[248].r, top_eight, 8 * sizeof(RGBcolor));
 	mcga_setpal_range(&cycling_palette, 248, 8);
 
 	cycling_active = cycling_save;
 
-	// Don't forget to reload the attribute screen which we wrote all
-	// over.
+	// Don't forget to reload the attribute screen which we wrote all over.
 	sprite_force_memory = NULL;
 
-
 	if (room_load_variant(room_id, room_variant, NULL, room,
 		&scr_depth, &scr_walk, &scr_special,
 		&depth_map, &depth_resource, -1)) {
 		error_report(ERROR_VARIANT_LOAD_FAILURE, WARNING, MODULE_OBJECT, room_load_error, (room_id * 10) + room_variant);
 	}
-	tile_pan(&depth_map, picture_view_x, picture_view_y);
 
+	tile_pan(&depth_map, picture_view_x, picture_view_y);
 	kernel_force_refresh();
-
 	inter_spin_object(inven[active_inven]);
 
-	return (restored_screen);
+	return restored_screen;
 }
 
 void init_object() {
diff --git a/engines/mads/madsv2/core/pack.cpp b/engines/mads/madsv2/core/pack.cpp
index 4a7614e8f72..1c5306c5d23 100644
--- a/engines/mads/madsv2/core/pack.cpp
+++ b/engines/mads/madsv2/core/pack.cpp
@@ -126,7 +126,6 @@ bool PackList::load(Common::SeekableReadStream *src) {
 	return true;
 }
 
-
 word pack_read_memory(char *buffer, word *mysize) {
 	word cx = *mysize;
 	uint32 remaining = pack_read_size;
@@ -231,7 +230,6 @@ done:
 	return write_this_time;
 }
 
-
 word pack_raw_copy() {
 	word result = CMP_NO_ERROR;
 	word read_this_time;
@@ -247,10 +245,9 @@ word pack_raw_copy() {
 		}
 	}
 
-	return (result);
+	return result;
 }
 
-
 word pack_a_packet(int packing_flag, int explode_mode) {
 	word result;
 	word pack_window_size;
@@ -258,9 +255,7 @@ word pack_a_packet(int packing_flag, int explode_mode) {
 	switch (packing_flag) {
 	case PACK_IMPLODE:
 		pack_window_size = PACK_WINDOW_SIZE;
-		// while ((pack_read_size < (long)pack_window_size) && ((long)pack_window_size > PACK_MIN_WINDOW_SIZE)) {
-		// pack_window_size = pack_window_size >> 1;
-		// }
+
 		if (pack_strategy == PACK_PFAB) {
 			result = (*pack_pFABcomp_routine)(pack_read_routine, pack_write_routine, (char *)pack_buffer,
 				&pack_mode, &pack_window_size);
@@ -297,7 +292,7 @@ word pack_a_packet(int packing_flag, int explode_mode) {
 		break;
 	}
 
-	return (result);
+	return result;
 }
 
 static void pack_activate() {
@@ -452,7 +447,6 @@ done:
 	return *return_value;
 }
 
-
 int pack_check() {
 	dialog_declare_ok(dialog);
 	ItemPtr none_item, zip_item = nullptr, pfab_item = nullptr, default_item;
@@ -506,7 +500,7 @@ int pack_check() {
 
 done:
 	if (dialog != NULL) dialog_destroy(dialog);
-	return (result);
+	return result;
 }
 
 void pack_enable_zip() {
@@ -590,7 +584,6 @@ packed:
 	return (long)dx;
 }
 
-
 word pack_write_ems(char *buffer, word *mysize) {
 	word write_this_time;
 	word write_left;
diff --git a/engines/mads/madsv2/core/popup.cpp b/engines/mads/madsv2/core/popup.cpp
index c1e1b210522..40a51ad583a 100644
--- a/engines/mads/madsv2/core/popup.cpp
+++ b/engines/mads/madsv2/core/popup.cpp
@@ -1102,7 +1102,7 @@ int popup_get_string(char *target, const char *top, const char *left, int maxlen
 		result = popup_ask_string(target, maxlen, true);
 	}
 
-	return (result);
+	return result;
 }
 
 int popup_get_long(long *value, const char *top, const char *left, int maxlen) {
@@ -1130,7 +1130,7 @@ int popup_get_number(int16 *value, const char *top, const char *left, int maxlen
 	if (!result) {
 		*value = (int)temp;
 	}
-	return (result);
+	return result;
 }
 
 int popup_alert(int width, const char *message_line, ...) {
@@ -1410,7 +1410,7 @@ done:
 	if ((block != NULL) && (result != (Popup *)block)) {
 		mem_free(block);
 	}
-	return (result);
+	return result;
 }
 
 Popup *popup_dialog_destroy() {
@@ -1704,7 +1704,7 @@ static PopupItem *popup_next_item(PopupItem *item, int activate, int any_non_but
 	}
 
 done:
-	return (result);
+	return result;
 }
 
 static PopupItem *popup_last_item(PopupItem *item, int activate, int any_non_button) {
@@ -1746,7 +1746,7 @@ static PopupItem *popup_last_item(PopupItem *item, int activate, int any_non_but
 	}
 
 done:
-	return (result);
+	return result;
 }
 
 static int popup_in_item(PopupItem *item) {
diff --git a/engines/mads/madsv2/core/sprite.cpp b/engines/mads/madsv2/core/sprite.cpp
index bba7692bdc3..6af5823f411 100644
--- a/engines/mads/madsv2/core/sprite.cpp
+++ b/engines/mads/madsv2/core/sprite.cpp
@@ -638,7 +638,7 @@ done:
 	if (sprite != NULL) mem_free(sprite);
 	if ((target != NULL) && (target != (SeriesPtr)sprite_force_memory) && (result == NULL)) mem_free(target);
 
-	return (result);
+	return result;
 }
 
 void sprite_get_scaled_matte(SeriesPtr series, int id, int target_x, int target_y,
@@ -1160,7 +1160,7 @@ ok:
 
 done:
 	if (decompress_buffer != NULL) mem_free(decompress_buffer);
-	return (error_flag);
+	return error_flag;
 }
 
 void dont_frag_the_palette() {
diff --git a/engines/mads/madsv2/core/vocab.cpp b/engines/mads/madsv2/core/vocab.cpp
index 0adf45bd3e0..2eea47c4f63 100644
--- a/engines/mads/madsv2/core/vocab.cpp
+++ b/engines/mads/madsv2/core/vocab.cpp
@@ -60,7 +60,7 @@ int vocab_destroy() {
 		result = false;
 	}
 
-	return (result);
+	return result;
 }
 
 static int vocab_count(Common::SeekableReadStream *handle) {
@@ -209,7 +209,7 @@ int vocab_load(int allocation_flag) {
 
 	if ((result < 0) && (vocab != NULL)) mem_free(vocab);
 
-	return (result);
+	return result;
 }
 
 int vocab_get_code(char *my_word) {
@@ -237,7 +237,7 @@ int vocab_get_code(char *my_word) {
 			}
 		}
 	}
-	return (result);
+	return result;
 }
 
 char *vocab_get_word(char *word_buf, int word_code) {
@@ -406,7 +406,7 @@ char *vocab_select_word(char *out, const char *prompt, const char *default_word)
 		result = NULL;
 	}
 
-	return (result);
+	return result;
 }
 
 void vocab_sort() {
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index a727553beca..bd39ff446f6 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -88,7 +88,6 @@ MODULE_OBJS += \
 	madsv2/core/inter.o \
 	madsv2/core/kernel.o \
 	madsv2/core/keys.o \
-	madsv2/core/lbm.o \
 	madsv2/core/lib.o \
 	madsv2/core/loader.o \
 	madsv2/core/magic.o \


Commit: 86e7241d5d33e05687b645b55a1e0ccd1e0b04bb
    https://github.com/scummvm/scummvm/commit/86e7241d5d33e05687b645b55a1e0ccd1e0b04bb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-05T22:07:15+10:00

Commit Message:
MADS: Jantitorial

Changed paths:
    engines/mads/madsv2/core/game.cpp
    engines/mads/madsv2/core/himem.cpp
    engines/mads/madsv2/core/hspot.cpp
    engines/mads/madsv2/core/hspot.h
    engines/mads/madsv2/core/implode.cpp
    engines/mads/madsv2/core/mcga.cpp
    engines/mads/madsv2/core/mcga.h


diff --git a/engines/mads/madsv2/core/game.cpp b/engines/mads/madsv2/core/game.cpp
index 6585cfbca1a..a15e83abef2 100644
--- a/engines/mads/madsv2/core/game.cpp
+++ b/engines/mads/madsv2/core/game.cpp
@@ -217,7 +217,6 @@ void game_cold_data_init() {
 	magic_high_fade_bound = 251;
 }
 
-
 static int scan_past(const char **myscan, char scan) {
 	int found = false;
 
@@ -235,7 +234,7 @@ static int scan_past(const char **myscan, char scan) {
 
 void flag_parse(const char **myscan) {
 	long mem_max;
-	// long mem_avail;
+
 	if (kernel.cheating == (byte)kernel_cheating_forbidden) {
 		if (scumm_stricmp(*myscan, kernel_cheating_password) == 0) {
 			kernel.cheating = (byte)kernel_cheating_allowed;
@@ -253,19 +252,11 @@ void flag_parse(const char **myscan) {
 		}
 		break;
 
-		// case 'A':
-		// if (scan_past(myscan, ':')) {
-		// abort_value = atoi(*myscan);
-		// scan_past(myscan, 0);
-		// }
-		// break;
 	case 'C':
 		if (scan_past(myscan, ':')) {
 			kernel.sound_card = **myscan;
 			if (scan_past(myscan, ',')) {
-				// pl sound_board_address = xtoi(*myscan);
 				if (scan_past(myscan, ',')) {
-					// pl sound_board_type  = xtoi(*myscan);
 					scan_past(myscan, 0);
 				}
 			}
@@ -314,33 +305,16 @@ void flag_parse(const char **myscan) {
 
 	case 'K':
 		inter_report_hotspots = true;
-		// config_file.interface_hotspots = INTERFACE_BRAINDEAD;
-		// inter_report_hotspots = !inter_report_hotspots;
-		break;
-
-	case 'L':
-#ifdef debug_enable_logfiles
-		logfile_enabled = true;
-#endif
 		break;
 
 	case 'M':
 		if (scan_past(myscan, ':')) {
 			mem_max = atol(*myscan);
 			mem_get_name(mem_max, "$HIDE$");
-			// mem_avail = mem_get_avail() - mem_program_block();
-			// if (mem_avail > mem_max) {
-			// mem_get_name(mem_avail - mem_max, "$HIDE$");
-			// }
 			scan_past(myscan, 0);
 		}
 		break;
 
-	case 'O':
-		// config_file.inventory_mode = INVENTORY_SQUAT;
-		// inter_spinning_objects = false;
-		break;
-
 	case 'P':
 		env_search_mode = ENV_SEARCH_CONCAT_FILES;
 		break;
@@ -383,10 +357,6 @@ void flag_parse(const char **myscan) {
 		report_version = true;
 		break;
 
-	case 'Y':
-		// lock_hash_value = 0;
-		break;
-
 	case 'Z':
 		if (kernel.cheating) {
 			debugger = true;
@@ -442,16 +412,12 @@ void show_version() {
 	echo(global_release_copyright, false);
 	echo(" by Sanctuary Woods Multimedia Corp.", true);
 	echo(" ", true);
-	// echo ("  FOR INTERNAL USE ONLY", true);
-	// echo (" ", true);
 }
 
-
 void show_logo() {
 	show_version();
 }
 
-
 void problem() {
 	debug("\nA slight problem . . .\n\n");
 }
@@ -466,16 +432,12 @@ static void game_fix_save_name() {
 	Common::strcat_s(save_game_buf, ".SAV");
 }
 
-
 void game_save_name(int id) {
 	Common::strcpy_s(save_game_buf, save_game_key);
 	env_catint(save_game_buf, id, 3);
 	game_fix_save_name();
 }
 
-
-
-
 static void game_player_status() {
 	char work_buf[80];
 	char temp_buf_3[80];
@@ -489,8 +451,6 @@ static void game_player_status() {
 	popup_alert(20, "PLAYER GRAPHICS STATUS", "  ", temp_buf_3, NULL);
 }
 
-
-
 int game_parse_keystroke(int mykey) {
 	int count;
 	int16 temp;
@@ -523,10 +483,6 @@ int game_parse_keystroke(int mykey) {
 			}
 			break;
 
-		case ctrl_e_key:
-			mcga_shakes = 350;
-			break;
-
 		case ctrl_f_key:
 			kernel.frame_by_frame = (byte)!(int)kernel.frame_by_frame;
 			kernel.paused = false;
@@ -1112,8 +1068,6 @@ int game_parse_keystroke(int mykey) {
 	return (unpause >= 2);
 }
 
-
-
 void game_pause_mode() {
 	int mykey = -1;
 	long clock_save;
@@ -1142,8 +1096,6 @@ void game_pause_mode() {
 	kernel.paused = false;
 }
 
-
-
 void game_error_service() {
 	if (inter_spinning_objects || inter_animation_running) {
 		if (mem_last_alloc_failed) {
@@ -1210,9 +1162,7 @@ void game_control() {
 			game.going = false;
 			force_chain = true;
 			game_restore_flag = false;
-			// new_room    = 804;
-			// global_init_code();
-			// global[copy_protect_failed] = true;
+
 			error_report(ERROR_COPY_PROTECTION, SEVERE, MODULE_LOCK, 0, 0);
 		} else if (result == COPY_ESCAPE) {
 			game.going = false;
@@ -1274,7 +1224,6 @@ void game_control() {
 		Forest::int_sprite[Forest::fx_int_journal] = -1;
 
 	while (game.going) {
-
 		// Start up next section
 		kernel_mode = KERNEL_SECTION_PRELOAD;
 
@@ -1312,10 +1261,6 @@ void game_control() {
 			// vocab_emergency = false;
 			game_wait_cursor();
 
-#ifdef demo
-			demo_verify();
-#endif
-
 			kernel.quotes = NULL;
 
 			// vocab_init_active();
@@ -1394,10 +1339,8 @@ void game_control() {
 			for (count = 0; count < master_shadow->num_shadow_colors; count++) {
 				color = PAL_FORCE_SHADOW + count;
 				color_status[color] = 0;
-				// error_watch_point ("color_status", count, 0);
 			}
 
-
 			game.going = (byte)!kernel_room_startup(new_room, kernel_initial_variant, kernel.interface, false);
 
 			camera_init_default();
@@ -1430,13 +1373,10 @@ void game_control() {
 
 			// Use a graphics fade in for room transition
 			if (kernel_screen_fade == SCREEN_FADE_SMOOTH) {
-				// kernel.fx = MATTE_FX_CIRCLE_OUT_SLOW;
 				kernel.fx = MATTE_FX_FADE_THRU_BLACK;
 			} else if (kernel_screen_fade == SCREEN_FADE_FAST) {
-				// kernel.fx = MATTE_FX_CIRCLE_OUT_SLOW;
 				kernel.fx = MATTE_FX_FAST_THRU_BLACK;
 			} else {
-				// kernel.fx = MATTE_FX_CIRCLE_OUT_SLOW;
 				kernel.fx = MATTE_FX_FAST_AND_FANCY;
 			}
 
@@ -1504,7 +1444,7 @@ void game_control() {
 
 			ems_paging_mode(EMS_PAGING_SYSTEM);
 
-			if ((quote_emergency /* || vocab_emergency */) && !game_any_emergency) {
+			if (quote_emergency && !game_any_emergency) {
 				room_id = previous_room;
 				game_any_emergency = true;
 			} else {
@@ -1582,7 +1522,6 @@ void game_control() {
 
 		game_wait_cursor();
 
-		// pl kernel_unload_sound_driver();
 		// Shut down current section
 		kernel_section_shutdown();
 
@@ -1623,7 +1562,6 @@ static void game_system_maintenance() {
 
 	if (section_id != 9 && room_id != 199) {
 		if (((mouse_status & 3) == 3) && player.commands_allowed) {
-			// kernel.force_restart = true;
 			kernel.activate_menu = GAME_MAIN_MENU;
 			inter_init_sentence();
 			inter_sentence_ready = false;
@@ -1665,19 +1603,10 @@ static void game_daemon_code() {
  * player.need_to_walk to false.
  */
 static void game_handle_preparse() {
-	// if (global[4] >= 0 || global[5]) player.command_ready = true;
-	// if (global[4] >= 0 || global[5]) player.command_error = false;
-	// if (global[4] >= 0 ) player.command_ready = true;
-	// if (global[4] >= 0 ) player.command_error = false;
 	if ((inter_input_mode == INTER_BUILDING_SENTENCES) ||
-		(inter_input_mode == INTER_LIMITED_SENTENCES)) {
+			(inter_input_mode == INTER_LIMITED_SENTENCES)) {
 		kernel.trigger_setup_mode = KERNEL_TRIGGER_PREPARSE;
 
-		// if (global[4] >= 0) {
-		  // player_verb = -1;
-		  // player_main_noun = -1;
-		  // player_second_noun = -1;
-		// }
 		global_pre_parser_code();
 		game_exec_function(section_pre_parser_code_pointer);
 		game_exec_function(room_pre_parser_code_pointer);
@@ -1688,8 +1617,6 @@ static void game_handle_preparse() {
 	}
 }
 
-
-
 /**
  * Handles incoming player commands -- they are filtered down through
  * various levels of parser code and error code.
@@ -2152,26 +2079,6 @@ static void game_main_loop() {
 		temp_message = kernel_message_add(temp_buf, 5, 5, 515, 1, 0, 0);
 	}
 
-	// if (kernel.memory_tracking) {
-	  // Common::strcpy_s (temp_buf_2, "(Mem: ");
-	  // ltoa (mem_get_avail(), &temp_buf_2[6], 10);
-	  // Common::strcat_s (temp_buf_2, ") ");
-	  // temp_message_2 = kernel_message_add (temp_buf_2, 315, 5, 515, 1, 0, KERNEL_MESSAGE_RIGHT);
-	// }
-	// if (kernel.player_tracking) {
-	  // Common::strcpy_s (temp_buf_3, "(Plyr: ");
-	  // mads_itoa (player.x, &temp_buf_3[strlen(temp_buf_3)], 10);
-	  // Common::strcat_s (temp_buf_3, ",");
-	  // mads_itoa (player.y, &temp_buf_3[strlen(temp_buf_3)], 10);
-	  // Common::strcat_s (temp_buf_3, ")");
-	  // yy = 5;
-	  // if (kernel.mouse_cursor_point) yy += 15;
-	  // temp_message_3 = kernel_message_add (temp_buf_3, 5, yy, 515, 1, 0, 0);
-	  // Common::strcpy_s (temp_buf_4, "Scale %");
-	  // mads_itoa (player.scale, &temp_buf_4[strlen(temp_buf_4)], 10);
-	  // yy += 15;
-	  // temp_message_4 = kernel_message_add (temp_buf_4, 5, yy, 515, 1, 0, 0);
-	// }
 	// Update any messages
 	if (!kernel.trigger) {
 		if (kernel.force_restart || (new_room != room_id)) kernel_message_purge();
@@ -2214,11 +2121,10 @@ static void game_main_loop() {
 		kernel_message_delete(temp_message_4);
 	}
 
-	if (kernel.cause_pause || kernel.frame_by_frame) game_pause_mode();
+	if (kernel.cause_pause || kernel.frame_by_frame)
+		game_pause_mode();
 
 skip_frame:
-
-	// if (mcga_shakes) mcga_shake();
 	if (kernel.fx) {
 		cycling_active = true;
 	}
diff --git a/engines/mads/madsv2/core/himem.cpp b/engines/mads/madsv2/core/himem.cpp
index 5f707edfaa3..0f9d326c172 100644
--- a/engines/mads/madsv2/core/himem.cpp
+++ b/engines/mads/madsv2/core/himem.cpp
@@ -150,8 +150,10 @@ int himem_resident(const char *filename) {
 	}
 
 done:
-	if (id >= 0) himem_get_directory_entry(id);
-	if (himem_xms_directory != NULL) mem_free(himem_xms_directory);
+	if (id >= 0)
+		himem_get_directory_entry(id);
+	if (himem_xms_directory != NULL)
+		mem_free(himem_xms_directory);
 	return id;
 }
 
diff --git a/engines/mads/madsv2/core/hspot.cpp b/engines/mads/madsv2/core/hspot.cpp
index dd77e10cbd7..d0570e8936a 100644
--- a/engines/mads/madsv2/core/hspot.cpp
+++ b/engines/mads/madsv2/core/hspot.cpp
@@ -97,7 +97,6 @@ void hspot_pack() {
 	numspots = unto;
 }
 
-
 int hspot_remove(int class_, int num) {
 	int a, cleared;
 
@@ -147,7 +146,6 @@ void hspot_wipe() {
 	hotkeys[max_hot_spots] = -1;
 }
 
-
 int hspot_key(int key) {
 	int result = -1;
 	int count;
@@ -161,7 +159,6 @@ int hspot_key(int key) {
 	return result;
 }
 
-
 int hspot_begin(int x, int y, int class_, int num, int hotkey) {
 	cursor_set_follow(true);
 	cursor_set_pos(x, y);
@@ -172,7 +169,6 @@ int hspot_begin(int x, int y, int class_, int num, int hotkey) {
 	return (x);
 }
 
-
 int hspot_end() {
 	int x, y;
 
@@ -185,11 +181,6 @@ int hspot_end() {
 	return (x);
 }
 
-
-void hspot_dummy() {
-
-}
-
 int hspot_which(int coord_x, int coord_y, int video_mode) {
 	int a;
 
diff --git a/engines/mads/madsv2/core/hspot.h b/engines/mads/madsv2/core/hspot.h
index ed754ea261e..ff053f266fd 100644
--- a/engines/mads/madsv2/core/hspot.h
+++ b/engines/mads/madsv2/core/hspot.h
@@ -79,7 +79,6 @@ extern void hspot_wipe();
 extern int hspot_key(int key);
 extern int hspot_begin(int x, int y, int class_, int num, int hotkey);
 extern int hspot_end();
-extern void hspot_dummy();
 
 /**
  * Given X,Y returns the hotspot the coordinates fall into.
diff --git a/engines/mads/madsv2/core/implode.cpp b/engines/mads/madsv2/core/implode.cpp
index 8dbb9926361..e5522ef6d4f 100644
--- a/engines/mads/madsv2/core/implode.cpp
+++ b/engines/mads/madsv2/core/implode.cpp
@@ -469,14 +469,6 @@ static word imp_rb_refill(ImpState *s) {
 
 /**
  * Read one byte from the input.  Returns -1 (as int) on EOF.
- * Assembly pattern (inside Fabrice loop):
- * dec RBcnt; jnz Gin; call implode_RBin; or ax,ax; jz Zin; jmp @B
- * Gin: mov bx,RBptr; inc RBptr; mov al,[bx]
- * RBcnt starts at 1 after init; first dec makes it 0, triggering refill.
- * After refill: RBcnt = bytes_read + 1.
- *
- * @param s		State
- * @return	Next byte
  */
 static int imp_get_byte(ImpState *s) {
 	for (;;) {
@@ -493,10 +485,7 @@ static int imp_get_byte(ImpState *s) {
 
 /**
  * Flush the write (output) buffer.
- * Resets wb_ptr and wb_cnt.  Assembly version:
- * WBcnt = WBlen, compute bytes = WBptr - &WBuff, reset WBptr = &WBuff
- *
- * @param s		State
+ * Resets wb_ptr and wb_cnt.
  */
 static void imp_wb_flush(ImpState *s) {
 	word bytes = (word)(s->wb_ptr - s->wb);
@@ -554,11 +543,6 @@ static void imp_packet(ImpState *s) {
 
 /**
  * Emit one Huffman control bit.
- * Assembly:
- * or al,al; jz @F
- * mov ax,Huffbit; or Huffman,ax    (set bit if val != 0)
- * @@: shl Huffbit,1; jnz @F; call Packet   (flush when bit overflows 16-bit)
- *
  * @param s		State
  * @param val	Value
  */
@@ -574,7 +558,6 @@ static void imp_huff1(ImpState *s, int val) {
 
 /**
  * Append one raw data byte to the current packet buffer.
- * Assembly: mov di,Huffptr; inc Huffptr; mov [di],al
  *
  * @param s		State
  * @param val	Value
@@ -587,11 +570,6 @@ static void imp_push1(ImpState *s, byte val) {
 
 /**
  * Hash key computation.
- * Assembly (in Link and Match):
- * mov si, word ptr Lempel[di]   ; 16-bit word at lempel[di]
- * and si, HASH-1                ; mask to [0..IMP_HASH-1]
- * add si, LEMPEL+1              ; shift into key-table region
- * shl si, 1                     ; convert to byte offset
  * Result is a BYTE OFFSET into hash[] pointing at the key root slot.
  * In C we use a WORD index = si>>1 into the hash[] word array.
  *
@@ -606,14 +584,6 @@ static inline int imp_hash_key_idx(ImpState *s, int pos) {
 
 /**
  * Insert lempel[di] at the root of its hash chain.
- * Assembly (byte-offset based):
- * si = key byte offset  (= hash_key_idx * 2)
- * di2 = di * 2
- * bx = Hash[si>>1]       ; old root byte-offset
- * Hash[di2>>1] = bx      ; di's next = old root
- * Hash[si>>1]  = di2     ; new root  = di
- * UnDo[bx>>1]  = di2     ; old root back-ptr = di
- * UnDo[di2>>1] = si      ; di back-ptr = key slot
  * All values stored are BYTE OFFSETS (position << 1), with NIL = 0x4000.
  * We store them directly as word values in hash[]/undo[] word arrays,
  * using word-index = byte-offset >> 1 to access them.
@@ -636,12 +606,6 @@ static void imp_link(ImpState *s, int di) {
 
 /**
  * Remove lempel[si] from its hash chain.
- * Assembly:
- * si2 = si << 1
- * bx = UnDo[si2>>1]          ; the slot that currently holds si2
- * if bx != NIL:
- * Hash[bx>>1] = NIL        ; remove si2 from that slot
- * UnDo[si2>>1] = NIL
  *
  * @param s		State
  * @param si	Index
@@ -659,22 +623,6 @@ static void imp_unlink(ImpState *s, int si) {
  * Find the longest matching string and insert lempel[di] into
  * the hash table.  Sets s->qlen and s->qoff.
  * Entry: di = current encode position (ring index, not DS offset).
- * The assembly proc adds offset(Lempel) to get DS-relative pointers for
- * string comparison.  In C we just index s->lempel[] directly.
- * The Ziv[] shadow array (s->lempel[IMP_LEMPEL .. IMP_LEMPEL+IMP_ZIV])
- * mirrors s->lempel[0..IMP_ZIV-1], so repe cmpsb can cross the ring
- * boundary without explicit wraparound -- comparisons starting near the
- * end of lempel[] continue into the shadow without going out of bounds.
- * AX encodes "remaining CX after repe cmpsb":
- * AX = ZIV-1 initially   (no match found yet)
- * AX = 0                 (ZIV-1 chars matched after hash char = ZIV total)
- * AX = 0xFFFF (-1 uint16) set by can1 for a full match (je from repe cmpsb)
- * Qlen = (uint16)(ZIV - AX) - 1  (wraps correctly for AX=0xFFFF -> Qlen=ZIV)
- * Qoff = -(( (di - best_pos/2) & (IMP_LEMPEL-1) ))
- * where best_pos is the BYTE OFFSET of the best candidate.
- * Match also links lempel[di] into the hash table (same as Link but
- * inlined at the end of can2, so it does NOT call imp_link separately
- * before the first Match call -- Fabrice calls Match before the main loop).
  *
  * @param s		State
  * @param di	Value
@@ -792,12 +740,6 @@ static void imp_fabrice(ImpState *s) {
 	// Also mirror the first ZIV-1 of them into the Ziv shadow at
 	// lempel[IMP_LEMPEL .. IMP_LEMPEL + ZIV - 2].
 	//
-	// Assembly:
-	//   di = offset Ziv - ZIV  (= Lempel + LEMPEL - ZIV in DS-relative)
-	//   cx = ZIV
-	// Loop1: dec RBcnt; jnz @F; call implode_RBin; jz GotZIV; jmp Loop1
-	// @@:    mov si,RBptr; inc RBptr; movsb; loop Loop1
-	//
 	// In flat C: write to lempel[IMP_LEMPEL - ZIV + i], and also to
 	// lempel[IMP_LEMPEL + i] for i < ZIV-1 (the Ziv shadow).
 	di = IMP_LEMPEL - IMP_ZIV;  // ring index: encode ptr starts here
@@ -827,12 +769,6 @@ static void imp_fabrice(ImpState *s) {
 		int save_si = si;
 
 		// Decide encoding type.
-		//
-		// Assembly:
-		//   cmp ax, 2; jb DoLit   => Qlen < 2: literal
-		//   ja DoMov               => Qlen > 2: copy
-		//   ; Qlen == 2:
-		//   cmp Qoff, -100h; jg DoMov   => Qoff > -256: copy; else literal
 		int qlen = (int)(int16_t)s->qlen;  // treat as signed for comparison
 		int qoff = (int)s->qoff;
 
@@ -852,13 +788,7 @@ static void imp_fabrice(ImpState *s) {
 				// Code: <00XY>, offset_byte.
 				// XY encodes Qlen-2 as 2 bits: bit1=(enc>>1)&1, bit0=enc&1.
 				// Offset byte = -(Qoff) = positive offset magnitude.
-				//
-				// Assembly:
-				//   Huff1(0); Huff1(0)
-				//   mov ax,Qlen; dec ax; dec ax; push ax
-				//   and al,2; Huff1(al)   (= bit1 of enc)
-				//   pop ax; and al,1; Huff1(al)  (= bit0 of enc)
-				//   mov ax,Qoff; call push1  (low byte = -offset)
+
 				imp_huff1(s, 0);
 				int enc = qlen - 2;  // 0..3
 				imp_huff1(s, (enc >> 1) & 1);  // bit1
@@ -882,16 +812,7 @@ static void imp_fabrice(ImpState *s) {
 				// But "Far5" label handles Qlen>5 OR Qoff<=-255.
 				// For Qlen==2 and Qoff<=-256 we already went to DoLit.
 				// So here Qlen >= 2 and (Qlen > 5 OR Qoff <= -256 OR Qlen==2 case not reached).
-				//
-				// Assembly Far5:
-				//   Huff1(1)
-				//   mov ax,Qoff; push1(al)         [low byte of offset]
-				//   mov al,ah; shl al,3             [high byte, shifted up 3]
-				//   mov bx,Qlen; cmp bx,9; ja Far9
-				//   dec bx; dec bx; or al,bl; push1(al)  [length in low 3 bits]
-				// Far9: (LongCopy, Qlen > 9)
-				//   push1(al)          [high byte with length=0]
-				//   mov ax,bx; dec ax; push1(al)   [Qlen-1 as aux byte]
+
 				imp_huff1(s, 1);
 				imp_push1(s, (byte)(qoff & 0xFF));  // offset low byte
 				byte hi = (byte)(((qoff >> 8) & 0xFF) << 3);  // hi byte, length field = 0
@@ -907,10 +828,6 @@ static void imp_fabrice(ImpState *s) {
 		}
 
 		// Cont: bookkeeping after emitting the code.
-		//
-		// Assembly:
-		//   sub Delta, Qlen; jge Zok
-		// @@: inc ParaZ; add Delta,10h; cmp Delta,0; jl @B
 		s->delta -= (int16_t)s->qlen;
 		while (s->delta < 0) {
 			s->paraz++;
@@ -936,14 +853,6 @@ static void imp_fabrice(ImpState *s) {
 		// Restore DI and SI, then advance through the input by Qlen characters,
 		// maintaining the hash dictionary.
 		//
-		// Assembly (Loop2):
-		//   call Link     ; add lempel[di] to dict  (skipped on first iteration
-		//   call UnLink   ;   via the "jmp short @F" before Loop2)
-		//   ; read next character into lempel[si]
-		//   if si < ZIV-1: also write lempel[LEMPEL+si] (Ziv shadow)
-		//   inc si; inc di; and si,LEMPEL-1; and di,LEMPEL-1
-		//   dec Qlen; jnz Loop2
-		//
 		// Note: on the FIRST iteration we skip Link (jump to UnLink directly)
 		// because the current di was already linked by Match().
 		di = save_di;
diff --git a/engines/mads/madsv2/core/mcga.cpp b/engines/mads/madsv2/core/mcga.cpp
index ff8dda2ea97..5090d193f8d 100644
--- a/engines/mads/madsv2/core/mcga.cpp
+++ b/engines/mads/madsv2/core/mcga.cpp
@@ -31,7 +31,6 @@ namespace MADSV2 {
 
 #define mcga_retrace_magic      14      /* Dave McKibbin's magic heuristic # */
 
-word mcga_shakes = false;
 int  mcga_retrace_computed = false;
 word mcga_retrace_ticks = 0;
 int  mcga_retrace_max_colors = 256;
@@ -149,10 +148,6 @@ void mcga_compute_retrace_parameters() {
 	mcga_retrace_computed = true;
 }
 
-void mcga_shake() {
-	warning("TODO: mcga_shake");
-}
-
 void mcga_reset() {
 	Palette temp_palette;
 	pal_interface(temp_palette);
diff --git a/engines/mads/madsv2/core/mcga.h b/engines/mads/madsv2/core/mcga.h
index fe54ebf7ba1..9a4e1620864 100644
--- a/engines/mads/madsv2/core/mcga.h
+++ b/engines/mads/madsv2/core/mcga.h
@@ -35,7 +35,6 @@ extern int  mcga_retrace_max_bytes;
 
 extern word mcga_palette_update;
 extern int  mcga_palette_fast;
-extern word mcga_shakes;
 
 /**
  * Given X and Y, sets pixel to color C
@@ -73,8 +72,6 @@ extern void mcga_setpal_range(Palette *pal, int first_color, int num_colors);
 
 extern void mcga_compute_retrace_parameters();
 
-extern void mcga_shake();
-
 extern void mcga_reset();
 
 } // namespace MADSV2


Commit: 58a1275b18e8faea122e794f7b1f2262fab8ee93
    https://github.com/scummvm/scummvm/commit/58a1275b18e8faea122e794f7b1f2262fab8ee93
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-05T22:07:16+10:00

Commit Message:
MADS: FOREST: Implement missing bg sounds & move your butt messages

Changed paths:
    engines/mads/madsv2/core/config.h
    engines/mads/madsv2/core/game.cpp
    engines/mads/madsv2/core/kernel.cpp
    engines/mads/madsv2/core/kernel.h
    engines/mads/madsv2/engine.h
    engines/mads/madsv2/forest/digi.cpp
    engines/mads/madsv2/forest/digi.h
    engines/mads/madsv2/forest/extra.cpp
    engines/mads/madsv2/forest/extra.h
    engines/mads/madsv2/forest/forest.cpp
    engines/mads/madsv2/forest/forest.h
    engines/mads/madsv2/forest/global.cpp
    engines/mads/madsv2/forest/global.h
    engines/mads/madsv2/forest/rooms/room101.cpp
    engines/mads/madsv2/forest/rooms/room103.cpp
    engines/mads/madsv2/forest/rooms/room104.cpp
    engines/mads/madsv2/forest/rooms/room106.cpp
    engines/mads/madsv2/forest/rooms/room107.cpp
    engines/mads/madsv2/forest/rooms/room199.cpp
    engines/mads/madsv2/forest/rooms/room201.cpp
    engines/mads/madsv2/forest/rooms/room203.cpp
    engines/mads/madsv2/forest/rooms/room204.cpp
    engines/mads/madsv2/forest/rooms/room205.cpp
    engines/mads/madsv2/forest/rooms/room210.cpp
    engines/mads/madsv2/forest/rooms/room211.cpp
    engines/mads/madsv2/forest/rooms/room220.cpp
    engines/mads/madsv2/forest/rooms/room221.cpp
    engines/mads/madsv2/forest/rooms/room301.cpp
    engines/mads/madsv2/forest/rooms/room302.cpp
    engines/mads/madsv2/forest/rooms/room303.cpp
    engines/mads/madsv2/forest/rooms/room304.cpp
    engines/mads/madsv2/forest/rooms/room305.cpp
    engines/mads/madsv2/forest/rooms/room306.cpp
    engines/mads/madsv2/forest/rooms/room307.cpp
    engines/mads/madsv2/forest/rooms/room308.cpp
    engines/mads/madsv2/forest/rooms/room321.cpp
    engines/mads/madsv2/forest/rooms/room322.cpp
    engines/mads/madsv2/forest/rooms/room401.cpp
    engines/mads/madsv2/forest/rooms/room402.cpp
    engines/mads/madsv2/forest/rooms/room403.cpp
    engines/mads/madsv2/forest/rooms/room404.cpp
    engines/mads/madsv2/forest/rooms/room405.cpp
    engines/mads/madsv2/forest/rooms/room420.cpp
    engines/mads/madsv2/forest/rooms/room501.cpp
    engines/mads/madsv2/forest/rooms/room503.cpp
    engines/mads/madsv2/forest/rooms/room509.cpp
    engines/mads/madsv2/forest/rooms/room510.cpp
    engines/mads/madsv2/forest/rooms/room520.cpp
    engines/mads/madsv2/forest/rooms/room901.cpp
    engines/mads/madsv2/forest/rooms/room903.cpp
    engines/mads/madsv2/forest/rooms/room904.cpp


diff --git a/engines/mads/madsv2/core/config.h b/engines/mads/madsv2/core/config.h
index 0492814a5c2..983e0766f37 100644
--- a/engines/mads/madsv2/core/config.h
+++ b/engines/mads/madsv2/core/config.h
@@ -96,10 +96,10 @@ struct ConfigFile {
 	int show_speech_boxes;        /* Show text during speech       */
 
 	int sound_card_irq;
+	int misc2;
 	int misc3;
 	int misc4;
 	int misc5;
-	int forest1;
 
 	bool original_save_load;
 };
diff --git a/engines/mads/madsv2/core/game.cpp b/engines/mads/madsv2/core/game.cpp
index a15e83abef2..e6c7fc38a46 100644
--- a/engines/mads/madsv2/core/game.cpp
+++ b/engines/mads/madsv2/core/game.cpp
@@ -1701,73 +1701,13 @@ done:
 	}
 }
 
-void do_looping_sounds() {
-	switch (room_id) {
-	case 304:
-		// do water trickle
-		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-		kernel_timing_trigger(1, 107);  // PLAY_MORE_TRICKLE
-		break;
-
-	case 305:
-		// do bird crowd
-		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-		kernel_timing_trigger(1, 109);  // DO_CROWD
-		break;
-
-	case 306:
-		// if global[phineas_status] <= PHIN_IS_IN_CONTROL_AGAIN) {
-		if (global[66] <= 2) {
-			// bird crowd talking
-			kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-			kernel_timing_trigger(1, 117);  // DO_CROWD
-		} else {
-			// water flowing
-			kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-			kernel_timing_trigger(1, 118);  // DO_WATER
-		}
-		break;
-
-	case 401:
-		// do dragon noise
-		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-		kernel_timing_trigger(1, 106);  // DRAGON_NOISE
-		break;
-
-	case 403:
-		// do water noise
-		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-		kernel_timing_trigger(1, 105);  // WATER
-		break;
-
-	case 404:
-		// do dragon noise
-		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-		kernel_timing_trigger(1, 110);  // DRAGON_NOISE
-		break;
-
-	case 405:
-		// do dragon noise
-		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-		kernel_timing_trigger(1, 106);  // DRAGON_NOISE
-		break;
-
-	case 210:
-		// rush MORE_RUSH_RUSH
-		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
-		kernel_timing_trigger(1, 109);  // MORE_RUSH_RUSH
-		break;
-
-	}
-}
-
 /**
  * This is the main inner graphics control loop for the game,
  * and is executed once for each framing round.
  */
 static void game_main_loop() {
+	bool preparse_flag = false;
 	int id;
-	int preparse_flag = false;
 	int temp_message = 0;
 	int temp_message_2 = 0;
 	int temp_message_3 = 0;
@@ -1775,166 +1715,8 @@ static void game_main_loop() {
 	long one_clock, two_clock;
 	static char temp_buf[20];
 
-#if 0
-	static char temp_buf_2[20];
-	static char temp_buf_3[20];
-	static char temp_buf_4[20];
-	int yy;
-	long dif;
-
-	if (global[10]) {  // please play the damn targets
-
-		// this is for the background sound efx
-		dif = kernel.clock - noise_clock;
-		if ((dif >= 0) && (dif <= 4)) {
-			noise_timer += dif;
-		} else {
-			noise_timer += 1;
-		}
-		noise_clock = kernel.clock;
-
-		if (noise_length == -1) {
-			if (room_id == 220 || room_id == 221 || room_id == 307 || room_id == 322 || room_id == 420 ||
-				room_id == 308 || room_id == 204 || room_id == 211) {
-				// night time
-				noise_length = imath_random(50, 80);
-
-			} else {
-				// day time
-				noise_length = imath_random(150, 220);
-			}
-		}
-
-		if (noise_timer >= (noise_length + global[13])) {
-			if (room_id == 220 || room_id == 221 || room_id == 307 || room_id == 322 || room_id == 420 ||
-				room_id == 308 || room_id == 204 || room_id == 211) {
-				// night time
-				// digi_initial_volume (75);
-				digi_trigger_effect = false;
-				digi_play_build(220, '_', 5, 2);  // EFFECT
-				// digi_trigger_ambiance = false;
-			} else {
-				// day time
-				yy = imath_random(1, 6);
-				while (last_bird_sound == (byte)yy) yy = imath_random(1, 6);
-
-				last_bird_sound = (byte)yy;
-
-				// digi_initial_volume (imath_random (25, 100));
-				digi_trigger_effect = false;
-
-				switch (yy) {
-				case 1: digi_play_build(321, '_', 500, 2); break;  // EFFECT
-				case 2: digi_play_build(321, '_', 501, 2); break;  // EFFECT
-				case 3: digi_play_build(321, '_', 502, 2); break;  // EFFECT
-				case 4: digi_play_build(321, '_', 503, 2); break;  // EFFECT
-				case 5: digi_play_build(321, '_', 504, 2); break;  // EFFECT
-				case 6: digi_play_build(321, '_', 505, 2); break;  // EFFECT
-
-				}
-			}
-			// digi_trigger_ambiance = false;
-			noise_length = -1;
-			noise_timer = 0;
-		}
-	}
-
-	if (player.walker_visible && player.commands_allowed && section_id != 9 && lets_get_a_move_on_anim &&
-		!player.walking && !player.need_to_walk && move_your_butt_anim_handle == -1) {
-		move_your_butt_enabled = 1;
-	} else {
-		move_your_butt_enabled = 0;
-		move_your_butt_timer = 0;
-	}
-
-	if (move_your_butt_enabled) {
-
-		// this is for the background sound efx
-		dif = kernel.clock - move_your_butt_clock;
-		if ((dif >= 0) && (dif <= 4)) {
-			move_your_butt_timer += dif;
-		} else {
-			move_your_butt_timer += 1;
-		}
-		move_your_butt_clock = kernel.clock;
-
-		if (move_your_butt_timer >= MOVE_YOUR_BUTT_TIMEOUT) {
-			player.commands_allowed = false;
-			player.walker_visible = false;
-			player.clock = kernel.clock;
-			move_your_butt_anim_handle = kernel_run_animation("*b_2t", 0);
-			extra_change_animation(move_your_butt_anim_handle, player.x, player.y, player.scale, player.depth);
-			kernel_synch(KERNEL_ANIM, move_your_butt_anim_handle, KERNEL_NOW, 0);
-
-			switch (player.facing) {
-			case 8:
-				kernel_reset_animation(move_your_butt_anim_handle, 21);
-				break;
-
-			case 9:
-				kernel_reset_animation(move_your_butt_anim_handle, 22);
-				break;
-
-			case 6:
-				kernel_reset_animation(move_your_butt_anim_handle, 23);
-				break;
-
-			case 7:
-				kernel_reset_animation(move_your_butt_anim_handle, 26);
-				break;
-
-			case 4:
-				kernel_reset_animation(move_your_butt_anim_handle, 27);
-				break;
-
-			default:
-				kernel_reset_animation(move_your_butt_anim_handle, 24);
-				break;
-			}
-
-			do_looping_sounds();
-		}
-	}
-
-	if (move_your_butt_anim_handle != -1) {
-		if (kernel_anim[move_your_butt_anim_handle].frame != move_your_butt_anim_frame) {
-			move_your_butt_anim_frame = kernel_anim[move_your_butt_anim_handle].frame;
-
-			switch (move_your_butt_anim_frame) {
-
-			case 24:  // ab in a 2
-			case 28:  // ab in a 2
-				// AB we need to keep moving, michelle needs those herbs
-				digi_trigger_dialog = false;
-				digi_play_build_ii('b', 4, 1);
-				// digi_send_dialog_trigger = false;
-				kernel_reset_animation(move_your_butt_anim_handle, 0);
-				move_your_butt_anim_frame = 0;
-				break;
-
-			case 20:  // end of talking
-				// end AB we need to keep moving, michelle needs those herbs
-				dont_frag_the_palette();
-				kernel_abort_animation(move_your_butt_anim_handle);
-				move_your_butt_anim_handle = -1;
-
-				move_your_butt_timer = 0;
-				player.walker_visible = true;
-				player.commands_allowed = true;
-				kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
-				player_demand_facing(FACING_SOUTH);
-
-				if (config_file.misc2) {
-					do_looping_sounds();
-				}
-				break;
-			}
-		}
-	}
-
-
-	// Clear any remaining player command message from screen
-#endif
+	// Dispatch to the engine to allow it to do game specific per-loop actions
+	g_engine->global_game_main_loop();
 
 	if (inter_sentence_ready || !player.commands_allowed) {
 		inter_init_sentence();
diff --git a/engines/mads/madsv2/core/kernel.cpp b/engines/mads/madsv2/core/kernel.cpp
index 8cd7972ce66..42ba19a023f 100644
--- a/engines/mads/madsv2/core/kernel.cpp
+++ b/engines/mads/madsv2/core/kernel.cpp
@@ -2901,19 +2901,6 @@ void kernel_translate_anim(int handle, int delta_x, int delta_y, int delta_scale
 	}
 }
 
-void kernel_position_anim(int handle, int x, int y, int scale, int depth) {
-	Animation &k_anim = kernel_anim[handle];
-	Anim *anim = k_anim.anim;
-
-	for (int count = 0; count < anim->num_frames; ++count) {
-		Image &image = anim->image[count];
-		image.x = x;
-		image.y = y;
-		image.scale = scale;
-		image.depth = depth;
-	}
-}
-
 void init_kernel() {
 	memset(room_state, 0, sizeof(room_state));
 	video_mode = 0;
diff --git a/engines/mads/madsv2/core/kernel.h b/engines/mads/madsv2/core/kernel.h
index 8bc8ddf6a7f..b9caf46d1fc 100644
--- a/engines/mads/madsv2/core/kernel.h
+++ b/engines/mads/madsv2/core/kernel.h
@@ -628,7 +628,6 @@ extern void init_kernel();
 
 extern void kernel_random_frame(int handle, int16 *frame, int mode);
 extern void kernel_translate_anim(int handle, int delta_x, int delta_y, int delta_scale);
-extern void kernel_position_anim(int handle, int x, int y, int scale, int depth);
 
 } // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/madsv2/engine.h b/engines/mads/madsv2/engine.h
index c3e9cdd6b95..a82bc3e35eb 100644
--- a/engines/mads/madsv2/engine.h
+++ b/engines/mads/madsv2/engine.h
@@ -113,6 +113,7 @@ public:
 	virtual void global_error_code() = 0;
 	virtual void global_room_init() = 0;
 	virtual void global_sound_driver() = 0;
+	virtual void global_game_main_loop() {}
 	virtual void global_verb_filter() {}
 	virtual void player_keep_walking();
 
diff --git a/engines/mads/madsv2/forest/digi.cpp b/engines/mads/madsv2/forest/digi.cpp
index 7c170aa26a9..d0d07859e6f 100644
--- a/engines/mads/madsv2/forest/digi.cpp
+++ b/engines/mads/madsv2/forest/digi.cpp
@@ -31,7 +31,8 @@ namespace MADSV2 {
 namespace Forest {
 
 int digi_val2;
-int digi_timing_index;
+int digi_trigger_effect;
+bool digi_trigger_dialog = false;
 bool digi_flag1, digi_flag2;
 
 DigiPlayer::DigiPlayer(Audio::Mixer *mixer) : _mixer(mixer) {
@@ -40,7 +41,7 @@ DigiPlayer::DigiPlayer(Audio::Mixer *mixer) : _mixer(mixer) {
 	_channels[2]._triggerId = 9;
 
 	digi_val2 = 0;
-	digi_timing_index = 0;
+	digi_trigger_effect = 0;
 	digi_flag1 = digi_flag2 = false;
 }
 
diff --git a/engines/mads/madsv2/forest/digi.h b/engines/mads/madsv2/forest/digi.h
index 214b8285d32..2975587b802 100644
--- a/engines/mads/madsv2/forest/digi.h
+++ b/engines/mads/madsv2/forest/digi.h
@@ -77,7 +77,8 @@ public:
 };
 
 extern int digi_val2;
-extern int digi_timing_index;
+extern int digi_trigger_effect;
+extern bool digi_trigger_dialog;
 extern bool digi_flag1, digi_flag2;
 
 extern void digi_play(const char *name, int slot);
diff --git a/engines/mads/madsv2/forest/extra.cpp b/engines/mads/madsv2/forest/extra.cpp
index 5baccd2f024..a42f071635a 100644
--- a/engines/mads/madsv2/forest/extra.cpp
+++ b/engines/mads/madsv2/forest/extra.cpp
@@ -92,14 +92,6 @@ void delete_sprite_in_interface(int series) {
 	}
 }
 
-void extra_change_animation(int handle, int x, int y, byte scale, byte depth) {
-	error("TODO: extra_change_animation");
-}
-
-void extra_shift_animation(int handle, int x, int y, byte scale) {
-	error("TODO: extra_shift_animation");
-}
-
 void load_interface() {
 	int_sprite[fx_int_journal] = kernel_load_series("*journal", false);
 	int_sprite[fx_int_backpack] = kernel_load_series("*backpack", false);
@@ -176,7 +168,6 @@ void inter_update_series(int series_id) {
 	}
 }
 
-
 void open_interface(InterfaceButton button) {
 	mouse_hide();
 
@@ -302,6 +293,19 @@ void close_interface(InterfaceButton button) {
 	mouse_show();
 }
 
+void extra_change_animation(int handle, int x, int y, int scale, int depth) {
+	Animation &k_anim = kernel_anim[handle];
+	Anim *anim = k_anim.anim;
+
+	for (int count = 0; count < anim->num_frames; ++count) {
+		Image &image = anim->image[count];
+		image.x = x;
+		image.y = y;
+		image.scale = scale;
+		image.depth = depth;
+	}
+}
+
 } // namespace Forest
 } // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/madsv2/forest/extra.h b/engines/mads/madsv2/forest/extra.h
index fdfbd58e8ff..93e80cd5259 100644
--- a/engines/mads/madsv2/forest/extra.h
+++ b/engines/mads/madsv2/forest/extra.h
@@ -79,12 +79,10 @@ extern void do_interface();
 
 extern void stamp_sprite_to_interface(int x, int y, int sprite, int series);
 extern void delete_sprite_in_interface(int series);
-extern void extra_change_animation(int handle, int x, int y, byte scale, byte depth);
-extern void extra_shift_animation(int handle, int x, int y, byte scale);
-extern void extra_blank_knothole();
 extern void inter_update_series(int series_id);
 extern void open_interface(InterfaceButton button);
 extern void close_interface(InterfaceButton button);
+extern void extra_change_animation(int handle, int x, int y, int scale, int depth);
 
 } // namespace Forest
 } // namespace MADSV2
diff --git a/engines/mads/madsv2/forest/forest.cpp b/engines/mads/madsv2/forest/forest.cpp
index 3b46ba63ad7..e3d65074147 100644
--- a/engines/mads/madsv2/forest/forest.cpp
+++ b/engines/mads/madsv2/forest/forest.cpp
@@ -64,6 +64,7 @@ ForestEngine::ForestEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
 	g_engine = this;
 	init_extra();
 	init_inventory();
+	init_global();
 }
 
 ForestEngine::~ForestEngine() {
@@ -114,7 +115,7 @@ void ForestEngine::global_init_code() {
 	flags[34] = flags[35] = flags[36] = 4;
 
 	global[g009] = -1;
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	global[g022] = 0;
 
 	// Randomly select the destinations for the passageways in the underground quick transport area
@@ -138,7 +139,7 @@ void ForestEngine::global_init_code() {
 	global[g017] = -1;
 	global[intro] = 0;
 	global[outro] = 0;
-	global[g066] = 0;
+	global[phineas_status] = 0;
 	global[walker_converse_now] = 0;
 
 	player.facing = FACING_NORTH;
@@ -196,6 +197,10 @@ void ForestEngine::global_sound_driver() {
 	env_catint(kernel.sound_driver, new_section, 1);
 }
 
+void ForestEngine::global_game_main_loop() {
+	Forest::global_game_main_loop();
+}
+
 } // namespace Forest
 } // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/madsv2/forest/forest.h b/engines/mads/madsv2/forest/forest.h
index 2b873338557..ed3a22b9f3a 100644
--- a/engines/mads/madsv2/forest/forest.h
+++ b/engines/mads/madsv2/forest/forest.h
@@ -53,6 +53,7 @@ public:
 	void global_parser_code() override;
 	void global_error_code() override;
 	void global_room_init() override;
+	void global_game_main_loop() override;
 	void global_sound_driver() override;
 };
 
diff --git a/engines/mads/madsv2/forest/global.cpp b/engines/mads/madsv2/forest/global.cpp
index c3e40a34e89..afedc1eb1c1 100644
--- a/engines/mads/madsv2/forest/global.cpp
+++ b/engines/mads/madsv2/forest/global.cpp
@@ -20,28 +20,41 @@
  */
 
 #include "common/textconsole.h"
-#include "mads/madsv2/forest/digi.h"
-#include "mads/madsv2/core/object.h"
-#include "mads/madsv2/core/player.h"
-#include "mads/madsv2/core/text.h"
+#include "mads/madsv2/core/config.h"
 #include "mads/madsv2/core/error.h"
 #include "mads/madsv2/core/game.h"
 #include "mads/madsv2/core/imath.h"
 #include "mads/madsv2/core/kernel.h"
-#include "mads/madsv2/forest/midi.h"
+#include "mads/madsv2/core/object.h"
 #include "mads/madsv2/core/pal.h"
+#include "mads/madsv2/core/player.h"
+#include "mads/madsv2/core/text.h"
+#include "mads/madsv2/forest/digi.h"
+#include "mads/madsv2/forest/midi.h"
 #include "mads/madsv2/forest/mads/words.h"
-#include "mads/madsv2/forest/global.h"
 #include "mads/madsv2/forest/extra.h"
+#include "mads/madsv2/forest/global.h"
 
 namespace MADS {
 namespace MADSV2 {
 namespace Forest {
 
+#define MOVE_YOUR_BUTT_TIMEOUT 3600
+
 int16 flags[40];
-bool room_203_flag;
 bool inv_enable_command;
 
+long noise_clock;
+long noise_timer;
+int noise_length = -1;
+int last_bird_sound = -1;
+bool lets_get_a_move_on_anim = true;
+int move_your_butt_anim_handle = -1;
+bool move_your_butt_enabled = true;
+long move_your_butt_timer;
+long move_your_butt_clock;
+int move_your_butt_anim_frame = -1;
+
 namespace Rooms {
 
 // Section preloads
@@ -94,6 +107,19 @@ extern void room_904_synchronize(Common::Serializer &s);
 
 } // namespace Rooms
 
+void global_init() {
+	noise_clock = 0;
+	noise_timer = 0;
+	noise_length = -1;
+	last_bird_sound = -1;
+	lets_get_a_move_on_anim = true;
+	move_your_butt_anim_handle = -1;
+	move_your_butt_enabled = true;
+	move_your_butt_timer = 0;
+	move_your_butt_clock = 0;
+	move_your_butt_anim_frame = -1;
+}
+
 void global_section_constructor() {
 	section_preload_code_pointer = NULL;
 	section_room_constructor = NULL;
@@ -198,7 +224,6 @@ void global_section_interface() {
 	pal_change_color(254, 56, 47, 32);
 }
 
-
 static void global_anim1_1(int arg_0, int arg_2, int16 *arg_4) {
 	if (kernel_anim[arg_0].frame == *arg_4)
 		return;
@@ -907,7 +932,7 @@ void global_room_init() {
 	global[g151] = -1;
 	global[g152] = -1;
 	global[g153] = -1;
-	room_203_flag = true;
+	lets_get_a_move_on_anim = true;
 	global[g131] = 0;
 	global[g130] = 0;
 	global[g135] = 0;
@@ -1112,6 +1137,220 @@ void global_anim3(int handle, int16 *frame) {
 	}
 }
 
+static void do_looping_sounds() {
+	switch (room_id) {
+	case 304:
+		// do water trickle
+		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+		kernel_timing_trigger(1, 107);  // PLAY_MORE_TRICKLE
+		break;
+
+	case 305:
+		// do bird crowd
+		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+		kernel_timing_trigger(1, 109);  // DO_CROWD
+		break;
+
+	case 306:
+		if (global[phineas_status] <= PHIN_IS_IN_CONTROL_AGAIN) {
+			// bird crowd talking
+			kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+			kernel_timing_trigger(1, 117);  // DO_CROWD
+		} else {
+			// water flowing
+			kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+			kernel_timing_trigger(1, 118);  // DO_WATER
+		}
+		break;
+
+	case 401:
+		// do dragon noise
+		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+		kernel_timing_trigger(1, 106);  // DRAGON_NOISE
+		break;
+
+	case 403:
+		// do water noise
+		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+		kernel_timing_trigger(1, 105);  // WATER
+		break;
+
+	case 404:
+		// do dragon noise
+		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+		kernel_timing_trigger(1, 110);  // DRAGON_NOISE
+		break;
+
+	case 405:
+		// do dragon noise
+		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+		kernel_timing_trigger(1, 106);  // DRAGON_NOISE
+		break;
+
+	case 210:
+		// rush MORE_RUSH_RUSH
+		kernel.trigger_setup_mode = KERNEL_TRIGGER_DAEMON;
+		kernel_timing_trigger(1, 109);  // MORE_RUSH_RUSH
+		break;
+
+	}
+}
+
+void global_game_main_loop() {
+	static char temp_buf_2[20];
+	static char temp_buf_3[20];
+	static char temp_buf_4[20];
+	int yy;
+	long dif;
+
+	// Please play the damn targets
+	if (global[play_background_sounds]) {
+		// This is for the background sound efx
+		dif = kernel.clock - noise_clock;
+		if ((dif >= 0) && (dif <= 4)) {
+			noise_timer += dif;
+		} else {
+			noise_timer += 1;
+		}
+
+		noise_clock = kernel.clock;
+
+		if (noise_length == -1) {
+			if (room_id == 220 || room_id == 221 || room_id == 307 || room_id == 322 || room_id == 420 ||
+				room_id == 308 || room_id == 204 || room_id == 211) {
+				// Night time
+				noise_length = imath_random(50, 80);
+
+			} else {
+				// Day time
+				noise_length = imath_random(150, 220);
+			}
+		}
+
+		if (noise_timer >= (noise_length + global[perform_displacements])) {
+			if (room_id == 220 || room_id == 221 || room_id == 307 || room_id == 322 || room_id == 420 ||
+				room_id == 308 || room_id == 204 || room_id == 211) {
+				// Night time
+				digi_trigger_effect = false;
+				digi_play_build(220, '_', 5, 2);
+			} else {
+				// Day time
+
+				// Pick a new bird sound. Don't repeat identical sounds
+				do {
+					yy = imath_random(1, 6);
+				} while (yy == last_bird_sound);
+				last_bird_sound = (byte)yy;
+
+				digi_trigger_effect = false;
+
+				switch (yy) {
+				case 1: digi_play_build(321, '_', 500, 2); break;
+				case 2: digi_play_build(321, '_', 501, 2); break;
+				case 3: digi_play_build(321, '_', 502, 2); break;
+				case 4: digi_play_build(321, '_', 503, 2); break;
+				case 5: digi_play_build(321, '_', 504, 2); break;
+				case 6: digi_play_build(321, '_', 505, 2); break;
+				}
+			}
+
+			noise_length = -1;
+			noise_timer = 0;
+		}
+	}
+
+	if (player.walker_visible && player.commands_allowed && section_id != 9 && lets_get_a_move_on_anim &&
+		!player.walking && !player.need_to_walk && move_your_butt_anim_handle == -1) {
+		move_your_butt_enabled = true;
+	} else {
+		move_your_butt_enabled = false;
+		move_your_butt_timer = 0;
+	}
+
+	if (move_your_butt_enabled) {
+		// This is for the background sound efx
+		dif = kernel.clock - move_your_butt_clock;
+		if ((dif >= 0) && (dif <= 4)) {
+			move_your_butt_timer += dif;
+		} else {
+			move_your_butt_timer += 1;
+		}
+		move_your_butt_clock = kernel.clock;
+
+		if (move_your_butt_timer >= MOVE_YOUR_BUTT_TIMEOUT) {
+			player.commands_allowed = false;
+			player.walker_visible = false;
+			player.clock = kernel.clock;
+			move_your_butt_anim_handle = kernel_run_animation("*b_2t", 0);
+			extra_change_animation(move_your_butt_anim_handle, player.x, player.y, player.scale, player.depth);
+			kernel_synch(KERNEL_ANIM, move_your_butt_anim_handle, KERNEL_NOW, 0);
+
+			switch (player.facing) {
+			case 8:
+				kernel_reset_animation(move_your_butt_anim_handle, 21);
+				break;
+
+			case 9:
+				kernel_reset_animation(move_your_butt_anim_handle, 22);
+				break;
+
+			case 6:
+				kernel_reset_animation(move_your_butt_anim_handle, 23);
+				break;
+
+			case 7:
+				kernel_reset_animation(move_your_butt_anim_handle, 26);
+				break;
+
+			case 4:
+				kernel_reset_animation(move_your_butt_anim_handle, 27);
+				break;
+
+			default:
+				kernel_reset_animation(move_your_butt_anim_handle, 24);
+				break;
+			}
+
+			do_looping_sounds();
+		}
+	}
+
+	if (move_your_butt_anim_handle != -1) {
+		if (kernel_anim[move_your_butt_anim_handle].frame != move_your_butt_anim_frame) {
+			move_your_butt_anim_frame = kernel_anim[move_your_butt_anim_handle].frame;
+
+			switch (move_your_butt_anim_frame) {
+			case 24:  // ab in a 2
+			case 28:  // ab in a 2
+				// AB we need to keep moving, michelle needs those herbs
+				digi_trigger_dialog = false;
+				digi_play_build_ii('b', 4, 1);
+				kernel_reset_animation(move_your_butt_anim_handle, 0);
+				move_your_butt_anim_frame = 0;
+				break;
+
+			case 20:
+				// end of talking
+				// end AB we need to keep moving, michelle needs those herbs
+				dont_frag_the_palette();
+				kernel_abort_animation(move_your_butt_anim_handle);
+				move_your_butt_anim_handle = -1;
+
+				move_your_butt_timer = 0;
+				player.walker_visible = true;
+				player.commands_allowed = true;
+				kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
+				player_demand_facing(FACING_SOUTH);
+
+				if (config_file.misc2) {
+					do_looping_sounds();
+				}
+				break;
+			}
+		}
+	}
+}
+
 } // namespace Forest
 } // namespace MADSV2
 } // namespace MADS
diff --git a/engines/mads/madsv2/forest/global.h b/engines/mads/madsv2/forest/global.h
index 2196fe32be9..41f5d58e866 100644
--- a/engines/mads/madsv2/forest/global.h
+++ b/engines/mads/madsv2/forest/global.h
@@ -24,6 +24,7 @@
 
 #include "common/serializer.h"
 #include "mads/madsv2/core/vocabh.h"
+#include "mads/madsv2/forest/extra.h"
 
 namespace MADS {
 namespace MADSV2 {
@@ -40,7 +41,7 @@ enum {
 	g007                      =   7,
 	g008                      =   8,
 	g009                      =   9,
-	player_score              =  10,  /* player's score of the game   */
+	play_background_sounds    =  10,  /* Play environmental sounds */
 	player_score_flags        =  11,  /* 16 flags for checking if player increased score */
 	dont_load_walker          =  12,  /* if T, will not load walker in section code */
 	perform_displacements     =  13,  /* if T, will do displacements */
@@ -96,7 +97,7 @@ enum {
 	tunnel_exit_3_opened      =  63,
 	g064                      =  64,
 	g065                      =  65,
-	g066                      =  66,
+	phineas_status            =  66,
 	g067                      =  67,
 	g068                      =  68,
 	g069                      =  69,
@@ -243,6 +244,9 @@ enum {
 	g210                      = 210
 };
 
+// phineas_status
+#define PHIN_IS_IN_CONTROL_AGAIN 2
+
 struct AnimationInfo {
 	int16 _active;
 	int16 _frame;
@@ -255,9 +259,10 @@ struct AnimationInfo {
 };
 
 extern int16 flags[40];
-extern bool room_203_flag;
+extern bool lets_get_a_move_on_anim;
 extern bool inv_enable_command;
 
+extern void global_init();
 extern void global_section_constructor();
 extern void sync_room(Common::Serializer &s);
 extern void global_section_walker();
@@ -270,6 +275,7 @@ extern void global_anim2(int arg_0, int arg_2, int arg_4, int16 *arg_6);
 extern void global_anim3(int handle, int16 *frame);
 extern void global_midi_play(int num);
 extern void global_daemon_code();
+extern void global_game_main_loop();
 
 } // namespace Forest
 } // namespace MADSV2
diff --git a/engines/mads/madsv2/forest/rooms/room101.cpp b/engines/mads/madsv2/forest/rooms/room101.cpp
index 29fc9b29601..4fd9448d4fb 100644
--- a/engines/mads/madsv2/forest/rooms/room101.cpp
+++ b/engines/mads/madsv2/forest/rooms/room101.cpp
@@ -78,7 +78,7 @@ static Scratch scratch;
 static void room_101_init1() {
 	global[g009] = -1;
 	viewing_at_y = 22;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	player.walker_visible = false;
 	player.commands_allowed = false;
 	mouse_hide();
@@ -97,7 +97,7 @@ static void room_101_init1() {
 
 static void room_101_init2() {
 	player.commands_allowed = false;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 
 	ss[3] = kernel_load_series(kernel_name('p', 7), 0);
 	seq[3] = kernel_seq_stamp(ss[3], 0, -1);
@@ -109,9 +109,9 @@ static void room_101_init2() {
 	global[g141] = 0;
 
 	scratch._russell = kernel_run_animation_disp('r', 3, 0);
-	kernel_position_anim(scratch._russell, 123, 134, 69, 7);
+	extra_change_animation(scratch._russell, 123, 134, 69, 7);
 	scratch._edgar = kernel_run_animation_disp('e', 1, 0);
-	kernel_position_anim(scratch._edgar, 194, 145, 75, 4);
+	extra_change_animation(scratch._edgar, 194, 145, 75, 4);
 
 	global[g009] = -1;
 	global_midi_play(8);
@@ -130,16 +130,16 @@ static void room_101_init2() {
 
 static void room_101_init3() {
 	player.commands_allowed = false;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = 0;
 	midi_stop();
 	global[g131] = 0;
 	global[g141] = 0;
 
 	scratch._russell = kernel_run_animation_disp('r', 3, 0);
-	kernel_position_anim(scratch._russell, 123, 134, 69, 7);
+	extra_change_animation(scratch._russell, 123, 134, 69, 7);
 	scratch._edgar = kernel_run_animation_disp('e', 1, 0);
-	kernel_position_anim(scratch._edgar, 194, 145, 75, 4);
+	extra_change_animation(scratch._edgar, 194, 145, 75, 4);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 96;
@@ -749,7 +749,7 @@ static void room_101_daemon() {
 			global[g154] = 2;
 			player.commands_allowed = false;
 			scratch._a8 = kernel_run_animation_talk('b', 7, 0);
-			kernel_position_anim(scratch._a8, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._a8, player.x, player.y, player.scale, player.depth);
 			scratch._b2 = -1;
 			kernel_synch(KERNEL_ANIM, scratch._a8, KERNEL_PLAYER, 0);
 			digi_play_build_ii('b', 2, 1);
@@ -760,7 +760,7 @@ static void room_101_daemon() {
 			player.commands_allowed = false;
 			player.walker_visible = false;
 			scratch._a8 = kernel_run_animation_talk('b', 6, 0);
-			kernel_position_anim(scratch._a8, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._a8, player.x, player.y, player.scale, player.depth);
 			scratch._b2 = -1;
 			kernel_synch(KERNEL_ANIM, scratch._a8, KERNEL_PLAYER, 0);
 			digi_play_build_ii('b', 1, 1);
@@ -773,7 +773,7 @@ static void room_101_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			global[g154] = 2;
 			scratch._a8 = kernel_run_animation_talk('b', 4, 0);
-			kernel_position_anim(scratch._a8, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._a8, player.x, player.y, player.scale, player.depth);
 			scratch._b2 = -1;
 			kernel_synch(KERNEL_ANIM, scratch._a8, KERNEL_PLAYER, 0);
 			digi_play_build_ii('b', 2, 1);
diff --git a/engines/mads/madsv2/forest/rooms/room103.cpp b/engines/mads/madsv2/forest/rooms/room103.cpp
index e575244fa77..05a0496db69 100644
--- a/engines/mads/madsv2/forest/rooms/room103.cpp
+++ b/engines/mads/madsv2/forest/rooms/room103.cpp
@@ -71,7 +71,7 @@ static void room_103_init() {
 		aainfo[count]._val4 = 0;
 	}
 
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	global[g009] = -1;
 	viewing_at_y = 22;
 	player.walker_visible = false;
@@ -299,7 +299,7 @@ static void room_103_anim3() {
 			break;
 		case 85:
 			scratch._90 = -1;
-			global[player_score] = 0;
+			global[play_background_sounds] = 0;
 			midi_stop();
 			aainfo[2]._val3 = 13;
 			aainfo[2]._frame = 92;
diff --git a/engines/mads/madsv2/forest/rooms/room104.cpp b/engines/mads/madsv2/forest/rooms/room104.cpp
index 503a33ee87f..dc3b93f8125 100644
--- a/engines/mads/madsv2/forest/rooms/room104.cpp
+++ b/engines/mads/madsv2/forest/rooms/room104.cpp
@@ -86,7 +86,7 @@ static void room_104_anim8();
 
 static void room_104_init() {
 	scratch._a0 = -1;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 
 	for (int count = 0; count < 10; count++) {
 		aainfo[count]._active = 0;
@@ -149,7 +149,7 @@ static void room_104_init() {
 }
 
 static void room_104_init1() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = -1;
 	global_midi_play(8);
 	viewing_at_y = 22;
@@ -167,7 +167,7 @@ static void room_104_init1() {
 }
 
 static void room_104_init2() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = 0;
 	midi_stop();
 	viewing_at_y = 22;
@@ -191,9 +191,9 @@ static void room_104_init3() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 4, 0);
-	kernel_position_anim(scratch._9c, 265, 111, 87, 14);
+	extra_change_animation(scratch._9c, 265, 111, 87, 14);
 	scratch._9a = kernel_run_animation_disp('e', 4, 0);
-	kernel_position_anim(scratch._9a, 248, 137, 94, 3);
+	extra_change_animation(scratch._9a, 248, 137, 94, 3);
 
 	aa[4] = kernel_run_animation(kernel_name('C', 1), 0);
 	aainfo[4]._active = -1;
diff --git a/engines/mads/madsv2/forest/rooms/room106.cpp b/engines/mads/madsv2/forest/rooms/room106.cpp
index 4976ebfec8b..15aac4abe91 100644
--- a/engines/mads/madsv2/forest/rooms/room106.cpp
+++ b/engines/mads/madsv2/forest/rooms/room106.cpp
@@ -138,7 +138,7 @@ static void room_106_init() {
 }
 
 static void room_106_init1() {
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	global[g009] = -1;
 	viewing_at_y = 22;
 	player.walker_visible = false;
@@ -155,14 +155,14 @@ static void room_106_init1() {
 
 static void room_106_init2() {
 	midi_stop();
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	global[g131] = 0;
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 1, 0);
-	kernel_position_anim(scratch._9c, 242, 84, 52, 11);
+	extra_change_animation(scratch._9c, 242, 84, 52, 11);
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
-	kernel_position_anim(scratch._9a, 277, 92, 55, 9);
+	extra_change_animation(scratch._9a, 277, 92, 55, 9);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 259;
@@ -254,7 +254,7 @@ static void room_106_anim1() {
 
 	if (kernel.trigger != 7 && kernel.trigger != 28)
 		return;
-	if (config_file.forest1 != 0)
+	if (config_file.misc2 != 0)
 		kernel_timing_trigger(1, 109);
 	if (scratch._ae == 114) { scratch._ae = -1; return; }
 	if (scratch._ae > 114)  return;
@@ -543,7 +543,7 @@ static void room_106_daemon() {
 			kernel_reset_animation(scratch._9a, 0);
 			global[g133] = 1;
 			scratch._a8 = kernel_run_animation_talk('e', 4, 0);
-			kernel_position_anim(scratch._a8, 277, 92, 55, 9);
+			extra_change_animation(scratch._a8, 277, 92, 55, 9);
 			global[g156] = 2;
 			kernel_synch(KERNEL_ANIM, scratch._a8, KERNEL_ANIM, scratch._9a);
 			digi_play_build(106, 'E', 3, 1);
@@ -725,7 +725,7 @@ static void room_106_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._a6 = kernel_run_animation_talk('b', 3, 0);
-		kernel_position_anim(scratch._a6, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._a6, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._a6, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._ae = 99;
@@ -745,7 +745,7 @@ static void room_106_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._a6 = kernel_run_animation_talk('b', 9, 0);
-		kernel_position_anim(scratch._a6, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._a6, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._a6, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._ae = 89;
diff --git a/engines/mads/madsv2/forest/rooms/room107.cpp b/engines/mads/madsv2/forest/rooms/room107.cpp
index 486c13c7499..e4306b19d7a 100644
--- a/engines/mads/madsv2/forest/rooms/room107.cpp
+++ b/engines/mads/madsv2/forest/rooms/room107.cpp
@@ -75,7 +75,7 @@ static void room_107_init() {
 	kernel_seq_scale(seq[2], 100);
 
 	viewing_at_y = 22;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = 0;
 	player.walker_visible = false;
 	player.commands_allowed = false;
diff --git a/engines/mads/madsv2/forest/rooms/room199.cpp b/engines/mads/madsv2/forest/rooms/room199.cpp
index 73bcd334282..73647d70b1c 100644
--- a/engines/mads/madsv2/forest/rooms/room199.cpp
+++ b/engines/mads/madsv2/forest/rooms/room199.cpp
@@ -103,7 +103,7 @@ static void room_199_init1() {
 }
 
 static void room_199_init() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = -1;
 	global_midi_play(7);
 
diff --git a/engines/mads/madsv2/forest/rooms/room201.cpp b/engines/mads/madsv2/forest/rooms/room201.cpp
index 6c0234fb890..d17ac286299 100644
--- a/engines/mads/madsv2/forest/rooms/room201.cpp
+++ b/engines/mads/madsv2/forest/rooms/room201.cpp
@@ -72,7 +72,7 @@ static Scratch scratch;
 
 
 static void room_201_init1() {
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	global[g009] = -1;
 	global_midi_play(11);
 	global[g131] = 0;
@@ -99,9 +99,9 @@ static void room_201_init1() {
 	}
 
 	scratch._9c = kernel_run_animation_disp('r', 1, 0);
-	kernel_position_anim(scratch._9c, 208, 116, 77, 7);
+	extra_change_animation(scratch._9c, 208, 116, 77, 7);
 	scratch._9a = kernel_run_animation_disp('e', 1, 0);
-	kernel_position_anim(scratch._9a, 186, 115, 76, 7);
+	extra_change_animation(scratch._9a, 186, 115, 76, 7);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 155;
@@ -389,7 +389,7 @@ static void room_201_daemon() {
 			kernel_reset_animation(scratch._9a, 0);
 			global[g133] = 1;
 			scratch._a2 = kernel_run_animation_talk('e', 2, 0);
-			kernel_position_anim(scratch._a2, 186, 115, 76, 7);
+			extra_change_animation(scratch._a2, 186, 115, 76, 7);
 			global[g156] = 2;
 			kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_ANIM, scratch._9a);
 			digi_play_build(201, 'E', 2, 1);
@@ -399,7 +399,7 @@ static void room_201_daemon() {
 			kernel_reset_animation(scratch._9a, 0);
 			global[g133] = 1;
 			scratch._a2 = kernel_run_animation_talk('e', 1, 0);
-			kernel_position_anim(scratch._a2, 186, 115, 76, 7);
+			extra_change_animation(scratch._a2, 186, 115, 76, 7);
 			global[g156] = 2;
 			kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_ANIM, scratch._9a);
 			digi_play_build(201, 'E', 3, 1);
@@ -425,7 +425,7 @@ static void room_201_daemon() {
 				aainfo[1]._active = -1;
 				global[g133] = 1;
 				scratch._a2 = kernel_run_animation_talk('e', 1, 0);
-				kernel_position_anim(scratch._a2, 186, 115, 76, 7);
+				extra_change_animation(scratch._a2, 186, 115, 76, 7);
 				kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_ANIM, scratch._9a);
 				kernel_synch(KERNEL_ANIM, scratch._a0, KERNEL_PLAYER, 0);
 				digi_play_build(201, 'e', 1, 1);
@@ -588,7 +588,7 @@ static void room_201_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._a0 = kernel_run_animation_talk(98, 3, 0);
-		kernel_position_anim(scratch._a0, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._a0, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._a0, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._a4 = 40;
@@ -601,7 +601,7 @@ static void room_201_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._a0 = kernel_run_animation_talk(98, 4, 0);
-		kernel_position_anim(scratch._a0, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._a0, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._a0, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._a4 = 41;
diff --git a/engines/mads/madsv2/forest/rooms/room203.cpp b/engines/mads/madsv2/forest/rooms/room203.cpp
index f0f5e1ad622..2b4ae704a01 100644
--- a/engines/mads/madsv2/forest/rooms/room203.cpp
+++ b/engines/mads/madsv2/forest/rooms/room203.cpp
@@ -84,20 +84,20 @@ static void room_203_init1() {
 		object_set_quality(5, 0, -1);
 		object_set_quality(8, 0, -1);
 		scratch._a0 = kernel_run_animation_disp('r', 1, 0);
-		kernel_position_anim(scratch._a0, 132, 133, 88, 6);
+		extra_change_animation(scratch._a0, 132, 133, 88, 6);
 		scratch._9e = kernel_run_animation_disp('e', 3, 0);
-		kernel_position_anim(scratch._9e, 105, 137, 90, 5);
+		extra_change_animation(scratch._9e, 105, 137, 90, 5);
 		player.x = 91;
 		player.y = 124;
 		player.facing = 3;
 	} else {
 		object_set_quality(5, 0, 0);
 		object_set_quality(8, 0, 0);
-		room_203_flag = 0;
+		lets_get_a_move_on_anim = false;
 		scratch._a0 = kernel_run_animation_disp('r', 9, 0);
-		kernel_position_anim(scratch._a0, 110, 153, 98, 2);
+		extra_change_animation(scratch._a0, 110, 153, 98, 2);
 		scratch._9e = kernel_run_animation_disp('e', 9, 0);
-		kernel_position_anim(scratch._9e, 86, 148, 96, 3);
+		extra_change_animation(scratch._9e, 86, 148, 96, 3);
 		player.x = 70;
 		player.y = 130;
 		player.facing = 9;
@@ -187,7 +187,7 @@ static void room_203_init() {
 		global[g046] = 0;
 
 	scratch._a6 = 5;
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	global[g009] = -1;
 	kernel_flip_hotspot(words_abi_bubble, false);
 	kernel_flip_hotspot(words_all_bubble, false);
@@ -1351,9 +1351,9 @@ static void room_203_daemon() {
 			dont_frag_the_palette();
 			kernel_abort_animation(local->_a0);
 			local->_a0 = kernel_run_animation_disp('r', 1, 0);
-			kernel_position_anim(local->_a0, 132, 133, 88, 6);
+			extra_change_animation(local->_a0, 132, 133, 88, 6);
 			local->_9e = kernel_run_animation_disp('e', 3, 0);
-			kernel_position_anim(local->_9e, 105, 137, 90, 5);
+			extra_change_animation(local->_9e, 105, 137, 90, 5);
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			clear_selected_item();
@@ -1381,7 +1381,7 @@ static void room_203_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = true;
 			player.walker_visible = true;
-			room_203_flag = true;
+			lets_get_a_move_on_anim = true;
 			break;
 
 		case 15:
@@ -1770,7 +1770,7 @@ static void room_203_parser() {
 			global[g154] = 2;
 			player.walker_visible = false;
 			scratch._a2 = kernel_run_animation_talk('b', 7, 0);
-			kernel_position_anim(scratch._a2, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._a2, player.x, player.y, player.scale, player.depth);
 			scratch._b4 = -1;
 			kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_PLAYER, 0);
 			digi_play_build_ii('b', 1, 1);
diff --git a/engines/mads/madsv2/forest/rooms/room204.cpp b/engines/mads/madsv2/forest/rooms/room204.cpp
index bc0a92e2a9a..e05b2353831 100644
--- a/engines/mads/madsv2/forest/rooms/room204.cpp
+++ b/engines/mads/madsv2/forest/rooms/room204.cpp
@@ -73,9 +73,9 @@ static void room_204_init1() {
 	global[g131] = 0;
 	global[g141] = 0;
 	local->_9c = kernel_run_animation_disp('r', 2, 0);
-	kernel_position_anim(local->_9c, 171, 116, 73, 8);
+	extra_change_animation(local->_9c, 171, 116, 73, 8);
 	local->_9a = kernel_run_animation_disp('e', 3, 0);
-	kernel_position_anim(local->_9a, 148, 120, 76, 7);
+	extra_change_animation(local->_9a, 148, 120, 76, 7);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 194;
@@ -128,7 +128,7 @@ static void room_204_init1() {
 }
 
 static void room_204_init() {
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	midi_stop();
 	local->_a8 = 0;
 	local->_a6 = -1;
@@ -487,9 +487,9 @@ trigger_100:
 		aainfo[1]._active = -1;
 		global[g155] = 2;
 		local->_a0 = kernel_run_animation_talk('r', 2, 0);
-		kernel_position_anim(local->_a0, 171, 116, 73, 8);
+		extra_change_animation(local->_a0, 171, 116, 73, 8);
 		local->_a2 = kernel_run_animation_talk('e', 3, 0);
-		kernel_position_anim(local->_a2, 148, 120, 76, 7);
+		extra_change_animation(local->_a2, 148, 120, 76, 7);
 		kernel_synch(3, local->_a2, 3, local->_9a);
 		kernel_synch(3, local->_a0, 3, local->_9c);
 		kernel_synch(3, local->_9e, 2, 0);
@@ -522,7 +522,7 @@ trigger_103:
 	global[g133] = 0;
 	kernel_flip_hotspot(words_vine_weed, true);
 	inter_move_object(vine_weed, PLAYER);
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	player.commands_allowed = true;
 
 bottom:
@@ -580,7 +580,7 @@ static void room_204_parser() {
 		player.commands_allowed = 0;
 		player.walker_visible = 0;
 		local->_9e = kernel_run_animation_talk('b', 9, 0);
-		kernel_position_anim(local->_9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(local->_9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(3, local->_9e, 2, 0);
 		digi_play_build_ii('b', 1, 1);
 		local->_a4 = 400;
diff --git a/engines/mads/madsv2/forest/rooms/room205.cpp b/engines/mads/madsv2/forest/rooms/room205.cpp
index 375df58abb8..d25a08b63c3 100644
--- a/engines/mads/madsv2/forest/rooms/room205.cpp
+++ b/engines/mads/madsv2/forest/rooms/room205.cpp
@@ -71,9 +71,9 @@ static void room_205_init1() {
 	global[g131] = 0;
 	global[g141] = 0;
 	scratch._9c = kernel_run_animation_disp('r', 9, 0);
-	kernel_position_anim(scratch._9c, 76, 130, 62, 5);
+	extra_change_animation(scratch._9c, 76, 130, 62, 5);
 	scratch._9a = kernel_run_animation_disp('e', 9, 0);
-	kernel_position_anim(scratch._9a, 120, 138, 74, 4);
+	extra_change_animation(scratch._9a, 120, 138, 74, 4);
 
 	if (previous_room == KERNEL_RESTORING_GAME) {
 		global[g131] = -1;
@@ -90,7 +90,7 @@ static void room_205_init1() {
 	player.facing = 3;
 
 	if (previous_room == 101) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		global[g009] = 0;
 		digi_stop(3);
 		midi_stop();
@@ -348,9 +348,9 @@ static void room_205_daemon() {
 			global[g133] = 1;
 			global[g156] = 0;
 			scratch._a2 = kernel_run_animation_talk('e', 9, 0);
-			kernel_position_anim(scratch._a2, 120, 138, 74, 4);
+			extra_change_animation(scratch._a2, 120, 138, 74, 4);
 			scratch._9e = kernel_run_animation_talk('b', 2, 0);
-			kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 			kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_ANIM, scratch._9a);
 			kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 			digi_play_build(205, 'b', 1, 1);
diff --git a/engines/mads/madsv2/forest/rooms/room210.cpp b/engines/mads/madsv2/forest/rooms/room210.cpp
index 81982f3bb47..ea553a6a0d2 100644
--- a/engines/mads/madsv2/forest/rooms/room210.cpp
+++ b/engines/mads/madsv2/forest/rooms/room210.cpp
@@ -76,10 +76,10 @@ static void room_210_init1() {
 	global[g141] = 0;
 
 	scratch._a4 = kernel_run_animation_disp('r', 9, 0);
-	kernel_position_anim(scratch._a4, 147, 155, 80, 1);
+	extra_change_animation(scratch._a4, 147, 155, 80, 1);
 
 	scratch._a2 = kernel_run_animation_disp('e', 7, 0);
-	kernel_position_anim(scratch._a2, 95, 155, 80, 1);
+	extra_change_animation(scratch._a2, 95, 155, 80, 1);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 120;
@@ -154,7 +154,7 @@ static void room_210_init1() {
 static void room_210_init() {
 	midi_stop();
 	scratch._a8 = -1;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	// TODO: identify word_7130E — used as an index to select which 16-bit half of
 	// global.walker_timing to zero: global[walker_timing + word_7130E] = 0
 	global[walker_timing] = 0;
@@ -385,13 +385,13 @@ static void room_210_daemon() {
 		case 3:
 			aainfo[8]._frame = 12;
 			kernel_reset_animation(aa[8], 12);
-			if (config_file.forest1 != 0) kernel_timing_trigger(1, 109);
+			if (config_file.misc2 != 0) kernel_timing_trigger(1, 109);
 			break;
 		case 4:
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0) kernel_timing_trigger(1, 109);
+			if (config_file.misc2 != 0) kernel_timing_trigger(1, 109);
 			break;
 		}
 		scratch._a6 = 0;
diff --git a/engines/mads/madsv2/forest/rooms/room211.cpp b/engines/mads/madsv2/forest/rooms/room211.cpp
index 886e2eb4148..715cac7c261 100644
--- a/engines/mads/madsv2/forest/rooms/room211.cpp
+++ b/engines/mads/madsv2/forest/rooms/room211.cpp
@@ -53,7 +53,7 @@ static Scratch scratch;
 
 static void room_211_init() {
 	midi_stop();
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	viewing_at_y = 22;
 	global[g009] = 0;
 	player.walker_visible = false;
diff --git a/engines/mads/madsv2/forest/rooms/room220.cpp b/engines/mads/madsv2/forest/rooms/room220.cpp
index 28db41b86c6..abc0e777bcb 100644
--- a/engines/mads/madsv2/forest/rooms/room220.cpp
+++ b/engines/mads/madsv2/forest/rooms/room220.cpp
@@ -61,7 +61,7 @@ static Scratch scratch;
 
 
 static void room_220_init() {
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	global[g009] = -1;
 	global_midi_play(10);
 	viewing_at_y = 22;
diff --git a/engines/mads/madsv2/forest/rooms/room221.cpp b/engines/mads/madsv2/forest/rooms/room221.cpp
index dbf3848404b..002d70d89c5 100644
--- a/engines/mads/madsv2/forest/rooms/room221.cpp
+++ b/engines/mads/madsv2/forest/rooms/room221.cpp
@@ -72,7 +72,7 @@ static void room_221_init1();
 static void room_221_init() {
 	scratch._a0 = 0;
 	midi_stop();
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		if (previous_room != 199) {
@@ -102,9 +102,9 @@ static void room_221_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 6, 0);
-	kernel_position_anim(scratch._9c, 122, 137, 100, 3);
+	extra_change_animation(scratch._9c, 122, 137, 100, 3);
 	scratch._9a = kernel_run_animation_disp('e', 4, 0);
-	kernel_position_anim(scratch._9a, 183, 135, 100, 3);
+	extra_change_animation(scratch._9a, 183, 135, 100, 3);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 150;
diff --git a/engines/mads/madsv2/forest/rooms/room301.cpp b/engines/mads/madsv2/forest/rooms/room301.cpp
index 6347b63a8f2..4b327cd5140 100644
--- a/engines/mads/madsv2/forest/rooms/room301.cpp
+++ b/engines/mads/madsv2/forest/rooms/room301.cpp
@@ -72,9 +72,9 @@ static void room_301_init1() {
 	global[g131] = 0;
 	global[g141] = 0;
 	scratch._9c = kernel_run_animation_disp('r', 2, 0);
-	kernel_position_anim(scratch._9c, 130, 134, 72, 6);
+	extra_change_animation(scratch._9c, 130, 134, 72, 6);
 	scratch._9a = kernel_run_animation_disp('e', 1, 0);
-	kernel_position_anim(scratch._9a, 100, 127, 63, 6);
+	extra_change_animation(scratch._9a, 100, 127, 63, 6);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 164;
@@ -136,9 +136,9 @@ static void room_301_init2() {
 	global[g131] = 0;
 	global[g141] = 0;
 	scratch._9c = kernel_run_animation_disp('r', 2, 0);
-	kernel_position_anim(scratch._9c, 130, 134, 72, 6);
+	extra_change_animation(scratch._9c, 130, 134, 72, 6);
 	scratch._9a = kernel_run_animation_disp('e', 1, 0);
-	kernel_position_anim(scratch._9a, 100, 127, 63, 6);
+	extra_change_animation(scratch._9a, 100, 127, 63, 6);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 164;
@@ -335,7 +335,7 @@ static void room_301_anim2() {
 		global[g156] = 1;
 		scratch._a6 = kernel_run_animation_write(0);
 		kernel_reset_animation(scratch._a6, 41);
-		kernel_position_anim(scratch._a6, 24, 152, 97, 3);
+		extra_change_animation(scratch._a6, 24, 152, 97, 3);
 		global[walker_converse_now] = 1;
 		global[g007] = 3;
 		kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_NOW, 0);
@@ -628,11 +628,11 @@ static void room_301_daemon() {
 			global[g155] = 2;
 			global[g143] = 1;
 			scratch._a0 = kernel_run_animation_talk('r', 1, 0);
-			kernel_position_anim(scratch._a0, 110, 152, 97, 3);
+			extra_change_animation(scratch._a0, 110, 152, 97, 3);
 			scratch._9e = kernel_run_animation_talk('b', 3, 0);
-			kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 			scratch._a2 = kernel_run_animation_talk('e', 2, 0);
-			kernel_position_anim(scratch._a2, 24, 152, 97, 3);
+			extra_change_animation(scratch._a2, 24, 152, 97, 3);
 			kernel_synch(KERNEL_ANIM, scratch._a0, KERNEL_ANIM, scratch._9c);
 			kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 			kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_ANIM, scratch._9a);
@@ -668,7 +668,7 @@ static void room_301_daemon() {
 		kernel_reset_animation(scratch._9a, 1);
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		player.commands_allowed = true;
 		break;
 
@@ -684,7 +684,7 @@ static void room_301_daemon() {
 			global[g133] = 0;
 			kernel_flip_hotspot(words_forked_stick, false);
 			inter_move_object(forked_stick, PLAYER);
-			global[player_score] = -1;
+			global[play_background_sounds] = -1;
 			player.commands_allowed = true;
 		} else if (scratch._a8 == 2) {
 			kernel_abort_animation(aa[5]);
@@ -702,7 +702,7 @@ static void room_301_daemon() {
 			global[g133] = 0;
 			kernel_flip_hotspot(words_web, false);
 			inter_move_object(web, PLAYER);
-			global[player_score] = -1;
+			global[play_background_sounds] = -1;
 			player.commands_allowed = true;
 		}
 		break;
@@ -812,7 +812,7 @@ static void room_301_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 2, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 2, 1);
 		scratch._a4 = 400;
@@ -826,7 +826,7 @@ static void room_301_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 4, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 2, 1);
 		scratch._a4 = 300;
diff --git a/engines/mads/madsv2/forest/rooms/room302.cpp b/engines/mads/madsv2/forest/rooms/room302.cpp
index 545fa045b25..50f71138c21 100644
--- a/engines/mads/madsv2/forest/rooms/room302.cpp
+++ b/engines/mads/madsv2/forest/rooms/room302.cpp
@@ -79,10 +79,10 @@ static void room_302_init1() {
 	global[g141] = 0;
 
 	scratch._9a = kernel_run_animation_disp('e', 1, 0);
-	kernel_position_anim(scratch._9a, 104, 109, 68, 9);
+	extra_change_animation(scratch._9a, 104, 109, 68, 9);
 
 	scratch._9c = kernel_run_animation_disp('r', 3, 0);
-	kernel_position_anim(scratch._9c, 137, 117, 73, 8);
+	extra_change_animation(scratch._9c, 137, 117, 73, 8);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 178;
@@ -163,7 +163,7 @@ static void room_302_init() {
 		midi_stop();
 
 	global[perform_displacements] = 240;
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 
 	if (object_is_here(rubber_band)) {
 		ss[0] = kernel_load_series(kernel_name('P', 3), 0);
@@ -586,7 +586,7 @@ static void room_302_daemon() {
 				global[g133] = 1;
 			}
 		} else if (scratch._8c == 7) {
-			global[player_score] = 0;
+			global[play_background_sounds] = 0;
 			aa[7] = kernel_run_animation(kernel_name('Z', 2), 106);
 			aainfo[7]._active = -1;
 			aainfo[7]._frame = 0;
@@ -634,7 +634,7 @@ static void room_302_daemon() {
 				kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 				player.walker_visible = true;
 				player.commands_allowed = false;
-				global[player_score] = 0;
+				global[play_background_sounds] = 0;
 				aa[6] = kernel_run_animation(kernel_name('R', 1), 105);
 				aainfo[6]._active = -1;
 				aainfo[6]._frame = 0;
@@ -673,7 +673,7 @@ static void room_302_daemon() {
 		kernel_abort_animation(scratch._a6);
 		global[g156] = 0;
 		scratch._a2 = kernel_run_animation_talk('e', 2, 0);
-		kernel_position_anim(scratch._a2, 104, 109, 68, 9);
+		extra_change_animation(scratch._a2, 104, 109, 68, 9);
 		kernel_synch(KERNEL_ANIM, scratch._a2, KERNEL_NOW, 0);
 		global[g154] = 2;
 		scratch._a4 = 2;
@@ -699,12 +699,12 @@ static void room_302_daemon() {
 			global[g133] = 1;
 			global[g143] = 0;
 			scratch._9e = kernel_run_animation_talk('b', 7, 0);
-			kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 			kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 			scratch._ac = -1;
 			scratch._a6 = kernel_run_animation_write(0);
 			kernel_reset_animation(scratch._a6, 41);
-			kernel_position_anim(scratch._a6, 104, 109, 68, 9);
+			extra_change_animation(scratch._a6, 104, 109, 68, 9);
 			global[walker_converse_now] = 1;
 			global[g007] = 1;
 			kernel_synch(KERNEL_ANIM, scratch._a6, KERNEL_ANIM, scratch._9a);
@@ -738,7 +738,7 @@ static void room_302_daemon() {
 		kernel_reset_animation(scratch._9a, 1);
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		player.commands_allowed = true;
 		break;
 
@@ -754,7 +754,7 @@ static void room_302_daemon() {
 			global[g133] = 0;
 			kernel_flip_hotspot(words_rubber_band, false);
 			inter_move_object(rubber_band, PLAYER);
-			global[player_score] = -1;
+			global[play_background_sounds] = -1;
 			player.commands_allowed = true;
 		}
 		break;
@@ -869,7 +869,7 @@ static void room_302_parser() {
 	}
 
 	if (player_parse(words_look_at, words_thistle, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -880,7 +880,7 @@ static void room_302_parser() {
 	}
 
 	if (player_parse(words_look_at, words_comfrey, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -892,11 +892,11 @@ static void room_302_parser() {
 
 	if (player_parse(words_pick_up, words_rubber_band, 0)) {
 		global[g154] = 2;
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 6, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 2, 1);
 		scratch._a4 = 400;
@@ -907,11 +907,11 @@ static void room_302_parser() {
 
 	if (player_parse(words_click_on, words_grass, 0)) {
 		global[g154] = 2;
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 4, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._a4 = 200;
@@ -921,7 +921,7 @@ static void room_302_parser() {
 	}
 
 	if (player_parse(words_click_on, words_bush, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		player.commands_allowed = false;
 		global[g135] = -1;
 		scratch._8c = 8;
diff --git a/engines/mads/madsv2/forest/rooms/room303.cpp b/engines/mads/madsv2/forest/rooms/room303.cpp
index dd116012d41..7f563baf75a 100644
--- a/engines/mads/madsv2/forest/rooms/room303.cpp
+++ b/engines/mads/madsv2/forest/rooms/room303.cpp
@@ -405,7 +405,7 @@ static void room_303_anim8() {
 }
 
 static void room_303_init() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	scratch._a4 = 0;
 	scratch._a6 = -1;
 	scratch._aa = -1;
@@ -462,10 +462,10 @@ static void room_303_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 6, 0);
-	kernel_position_anim(scratch._9c, 83, 131, 92, 6);
+	extra_change_animation(scratch._9c, 83, 131, 92, 6);
 
 	scratch._9a = kernel_run_animation_disp('e', 6, 0);
-	kernel_position_anim(scratch._9a, 109, 139, 94, 5);
+	extra_change_animation(scratch._9a, 109, 139, 94, 5);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 138;
@@ -518,10 +518,10 @@ static void room_303_init2() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 6, 0);
-	kernel_position_anim(scratch._9c, 83, 131, 92, 6);
+	extra_change_animation(scratch._9c, 83, 131, 92, 6);
 
 	scratch._9a = kernel_run_animation_disp('e', 6, 0);
-	kernel_position_anim(scratch._9a, 109, 139, 94, 5);
+	extra_change_animation(scratch._9a, 109, 139, 94, 5);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 138;
@@ -666,7 +666,7 @@ static void room_303_daemon() {
 		global[g143] = 0;
 		scratch._aa = kernel_run_animation_write(0);
 		kernel_reset_animation(scratch._aa, 1);
-		kernel_position_anim(scratch._aa, 109, 139, 94, 5);
+		extra_change_animation(scratch._aa, 109, 139, 94, 5);
 		global[walker_converse_now] = 1;
 		global[g007] = 6;
 		kernel_synch(KERNEL_ANIM, scratch._aa, KERNEL_NOW, 0);
@@ -840,7 +840,7 @@ static void room_303_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._9e = kernel_run_animation_talk('b', 7, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build(303, 'b', 1, 1);
 		scratch._a8 = 123;
@@ -855,7 +855,7 @@ static void room_303_parser() {
 	}
 
 	if (player_parse(words_look_at, words_chicory, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -866,7 +866,7 @@ static void room_303_parser() {
 	}
 
 	if (player_parse(words_look_at, words_foxglove, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -878,11 +878,11 @@ static void room_303_parser() {
 
 	if (player_parse(words_pick_up, words_reeds, 0)) {
 		global[g154] = 2;
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 1, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._a8 = 400;
@@ -893,11 +893,11 @@ static void room_303_parser() {
 
 	if (player_parse(words_pick_up, words_pebbles, 0)) {
 		global[g154] = 2;
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 3, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._a8 = 300;
diff --git a/engines/mads/madsv2/forest/rooms/room304.cpp b/engines/mads/madsv2/forest/rooms/room304.cpp
index fe3d9986664..7cdb5ba6c85 100644
--- a/engines/mads/madsv2/forest/rooms/room304.cpp
+++ b/engines/mads/madsv2/forest/rooms/room304.cpp
@@ -64,10 +64,10 @@ static void room_304_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 3, 0);
-	kernel_position_anim(scratch._9c, 60, 136, 93, 3);
+	extra_change_animation(scratch._9c, 60, 136, 93, 3);
 
 	scratch._9a = kernel_run_animation_disp('e', 9, 0);
-	kernel_position_anim(scratch._9a, 87, 150, 98, 3);
+	extra_change_animation(scratch._9a, 87, 150, 98, 3);
 
 	if (global[g064]) {
 		kernel_flip_hotspot(words_paint_can, false);
@@ -133,7 +133,7 @@ static void room_304_init() {
 
 static void room_304_finish() {
 	player.commands_allowed = true;
-	if (config_file.forest1)
+	if (config_file.misc2)
 		kernel_timing_trigger(1, 107);
 }
 
@@ -383,7 +383,7 @@ static void room_304_daemon() {
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 107);
 			break;
 		default:
diff --git a/engines/mads/madsv2/forest/rooms/room305.cpp b/engines/mads/madsv2/forest/rooms/room305.cpp
index 6e45115f160..8012937cc06 100644
--- a/engines/mads/madsv2/forest/rooms/room305.cpp
+++ b/engines/mads/madsv2/forest/rooms/room305.cpp
@@ -74,10 +74,10 @@ static void room_305_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 1, 0);
-	kernel_position_anim(scratch._9c, 210, 124, 100, 13);
+	extra_change_animation(scratch._9c, 210, 124, 100, 13);
 
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
-	kernel_position_anim(scratch._9a, 118, 142, 100, 6);
+	extra_change_animation(scratch._9a, 118, 142, 100, 6);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 183;
@@ -93,7 +93,7 @@ static void room_305_init1() {
 	}
 
 	if (previous_room == 306) {
-		if (global[g066] == 3) {
+		if (global[phineas_status] == 3) {
 			aa[0] = kernel_run_animation(kernel_name('y', 3), 100);
 			aainfo[0]._active = -1;
 			scratch._92 = 76;
@@ -121,10 +121,10 @@ static void room_305_init2() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 1, 0);
-	kernel_position_anim(scratch._9c, 210, 124, 100, 13);
+	extra_change_animation(scratch._9c, 210, 124, 100, 13);
 
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
-	kernel_position_anim(scratch._9a, 118, 142, 100, 6);
+	extra_change_animation(scratch._9a, 118, 142, 100, 6);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 183;
@@ -170,7 +170,7 @@ static void room_305_init2() {
 	}
 
 	if (previous_room == 306) {
-		if (global[g066] == 3) {
+		if (global[phineas_status] == 3) {
 			aa[0] = kernel_run_animation(kernel_name('y', 3), 100);
 			aainfo[0]._active = -1;
 			scratch._92 = 76;
@@ -227,7 +227,7 @@ static void room_305_init() {
 			flags[19]++;
 	}
 
-	if (global[g066] < 2)
+	if (global[phineas_status] < 2)
 		kernel_timing_trigger(1, 109);
 
 	switch (flags[19] - 1) {
@@ -241,7 +241,7 @@ static void room_305_init() {
 	}
 
 	global[g009] = -1;
-	if (global[g066] == 1)
+	if (global[phineas_status] == 1)
 		global_midi_play(8);
 }
 
@@ -739,7 +739,7 @@ static void room_305_anim10() {
 			kernel_abort_animation(aa[9]);
 			aainfo[9]._active = 0;
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0)
+			if (config_file.misc2 != 0)
 				kernel_timing_trigger(1, 109);
 			global[g131] = -1;
 			kernel_reset_animation(scratch._9a, 1);
@@ -772,7 +772,7 @@ static void room_305_daemon() {
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0)
+			if (config_file.misc2 != 0)
 				kernel_timing_trigger(1, 109);
 		} else {
 			if (scratch._a4 == 300) {
@@ -868,14 +868,14 @@ static void room_305_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 
 	case 100:
 		kernel_abort_animation(aa[0]);
 		aainfo[0]._active = 0;
-		if (global[g066] == 1) {
+		if (global[phineas_status] == 1) {
 			aa[5] = kernel_run_animation(kernel_name('b', 1), 0);
 			aainfo[5]._active = -1;
 			kernel_timing_trigger(1, 109);
@@ -891,7 +891,7 @@ static void room_305_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0)
+			if (config_file.misc2 != 0)
 				kernel_timing_trigger(1, 109);
 		}
 		break;
@@ -904,7 +904,7 @@ static void room_305_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 	}
@@ -930,10 +930,10 @@ static void room_305_daemon() {
 				inter_move_object(sticks, PLAYER);
 
 			global[g069] = -1;
-			global[player_score] = -1;
+			global[play_background_sounds] = -1;
 			player.commands_allowed = true;
 
-			if (config_file.forest1 != 0)
+			if (config_file.misc2 != 0)
 				kernel_timing_trigger(1, 109);
 		}
 		break;
@@ -949,7 +949,7 @@ static void room_305_daemon() {
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		scratch._a6 = kernel_run_animation_write(0);
 		kernel_reset_animation(scratch._a6, 41);
-		kernel_position_anim(scratch._a6, 118, 142, 100, 6);
+		extra_change_animation(scratch._a6, 118, 142, 100, 6);
 		global[walker_converse_now] = 1;
 		global[g007] = 2;
 		kernel_synch(KERNEL_ANIM, scratch._a6, KERNEL_NOW, 0);
@@ -971,7 +971,7 @@ static void room_305_daemon() {
 
 	case 107:
 		kernel_abort_animation(aa[7]);
-		global[g066] = 2;
+		global[phineas_status] = 2;
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 1);
@@ -983,7 +983,7 @@ static void room_305_daemon() {
 		global[g143] = 0;
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 
@@ -993,14 +993,14 @@ static void room_305_daemon() {
 		kernel_reset_animation(scratch._9a, 1);
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 109);
 		break;
 
 	case 109:
-		if (global[g066] < 2) {
+		if (global[phineas_status] < 2) {
 			digi_initial_volume(15);
 			digi_play_build(305, '_', 1, 3);
 			digi_val2 = -1;
@@ -1059,7 +1059,7 @@ static void room_305_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._9e = kernel_run_animation_talk('b', 9, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		scratch._a8 = -1;
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
@@ -1081,7 +1081,7 @@ static void room_305_parser() {
 	}
 
 	if (player_parse(words_look_at, words_mint, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -1091,7 +1091,7 @@ static void room_305_parser() {
 	}
 
 	if (player_parse(words_look_at, words_snapdragon, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -1101,13 +1101,13 @@ static void room_305_parser() {
 	}
 
 	if (player_parse(words_pick_up, words_sticks, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		global[g154] = 2;
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 1, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._a4 = 300;
diff --git a/engines/mads/madsv2/forest/rooms/room306.cpp b/engines/mads/madsv2/forest/rooms/room306.cpp
index 6a0f6322983..23e585f7b0a 100644
--- a/engines/mads/madsv2/forest/rooms/room306.cpp
+++ b/engines/mads/madsv2/forest/rooms/room306.cpp
@@ -77,10 +77,10 @@ static void room_306_init1() {
 	if (previous_room == KERNEL_RESTORING_GAME) {
 		scratch.xaa = -1;
 		scratch.x9c = kernel_run_animation_disp('r', 6, 0);
-		kernel_position_anim(scratch.x9c, 63, 134, 91, 3);
+		extra_change_animation(scratch.x9c, 63, 134, 91, 3);
 		global[g143] = 1;
 		scratch.x9a = kernel_run_animation_disp('e', 2, 0);
-		kernel_position_anim(scratch.x9a, 88, 122, 86, 5);
+		extra_change_animation(scratch.x9a, 88, 122, 86, 5);
 		global[g133] = 1;
 		global[g131] = -1;
 		global[g141] = -1;
@@ -105,9 +105,9 @@ static void room_306_init1() {
 		global[g131] = 0;
 		global[g141] = 0;
 		scratch.x9c = kernel_run_animation_disp('r', 6, 0);
-		kernel_position_anim(scratch.x9c, 63, 134, 91, 3);
+		extra_change_animation(scratch.x9c, 63, 134, 91, 3);
 		scratch.x9a = kernel_run_animation_disp('e', 2, 0);
-		kernel_position_anim(scratch.x9a, 88, 122, 86, 5);
+		extra_change_animation(scratch.x9a, 88, 122, 86, 5);
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch.x9a, 2);
@@ -119,7 +119,7 @@ static void room_306_init1() {
 		player.walker_visible = true;
 	}
 
-	if (global[g066] == 3)
+	if (global[phineas_status] == 3)
 		return;
 
 	aa[4] = kernel_run_animation(kernel_name('t', 5), 0);
@@ -127,11 +127,11 @@ static void room_306_init1() {
 	aainfo[4]._val3 = 3;
 	aa[2] = kernel_run_animation(kernel_name('s', 1), 0);
 	aainfo[2]._active = -1;
-	aainfo[2]._val3 = (global[g066] == 0) ? 4 : 3;
+	aainfo[2]._val3 = (global[phineas_status] == 0) ? 4 : 3;
 	aa[5] = kernel_run_animation(kernel_name('t', 7), 0);
 	aainfo[5]._active = -1;
 	aainfo[5]._val3 = 1;
-	if (global[g066] == 0) {
+	if (global[phineas_status] == 0) {
 		aa[7] = kernel_run_animation(kernel_name('t', 2), 0);
 		aainfo[7]._active = -1;
 		aainfo[7]._val3 = 4;
@@ -146,10 +146,10 @@ static void room_306_init2() {
 	if (previous_room == KERNEL_RESTORING_GAME) {
 		scratch.xaa = -1;
 		scratch.x9c = kernel_run_animation_disp('r', 6, 0);
-		kernel_position_anim(scratch.x9c, 63, 134, 91, 3);
+		extra_change_animation(scratch.x9c, 63, 134, 91, 3);
 		global[g143] = 1;
 		scratch.x9a = kernel_run_animation_disp('e', 2, 0);
-		kernel_position_anim(scratch.x9a, 88, 122, 86, 5);
+		extra_change_animation(scratch.x9a, 88, 122, 86, 5);
 		global[g133] = 1;
 		global[g131] = -1;
 		global[g141] = -1;
@@ -174,9 +174,9 @@ static void room_306_init2() {
 		global[g131] = 0;
 		global[g141] = 0;
 		scratch.x9c = kernel_run_animation_disp('r', 6, 0);
-		kernel_position_anim(scratch.x9c, 63, 134, 91, 3);
+		extra_change_animation(scratch.x9c, 63, 134, 91, 3);
 		scratch.x9a = kernel_run_animation_disp('e', 2, 0);
-		kernel_position_anim(scratch.x9a, 88, 122, 86, 5);
+		extra_change_animation(scratch.x9a, 88, 122, 86, 5);
 		player.x = 116;
 		player.y = 130;
 		player.facing = 4;
@@ -191,7 +191,7 @@ static void room_306_init2() {
 		player.walker_visible = true;
 	}
 
-	if (global[g066] == 3)
+	if (global[phineas_status] == 3)
 		return;
 
 	aa[8] = kernel_run_animation(kernel_name('y', 1), 0);
@@ -208,7 +208,7 @@ static void room_306_init2() {
 	aainfo[4]._val3 = 3;
 	aa[2] = kernel_run_animation(kernel_name('s', 1), 0);
 	aainfo[2]._active = -1;
-	aainfo[2]._val3 = (global[g066] == 0) ? 4 : 3;
+	aainfo[2]._val3 = (global[phineas_status] == 0) ? 4 : 3;
 	aa[5] = kernel_run_animation(kernel_name('t', 7), 0);
 	aainfo[5]._active = -1;
 	aainfo[5]._val3 = 1;
@@ -219,9 +219,9 @@ static void room_306_init3() {
 	global[g131] = 0;
 	global[g141] = 0;
 	scratch.x9c = kernel_run_animation_disp('r', 6, 0);
-	kernel_position_anim(scratch.x9c, 63, 134, 91, 3);
+	extra_change_animation(scratch.x9c, 63, 134, 91, 3);
 	scratch.x9a = kernel_run_animation_disp('e', 2, 0);
-	kernel_position_anim(scratch.x9a, 88, 122, 86, 5);
+	extra_change_animation(scratch.x9a, 88, 122, 86, 5);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 116;
@@ -275,7 +275,7 @@ static void room_306_init() {
 	scratch.xae = -1;
 	scratch.xa4 = 0;
 
-	if (global[g066] >= 2)
+	if (global[phineas_status] >= 2)
 		kernel_flip_hotspot(words_brown, false);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
@@ -312,20 +312,20 @@ static void room_306_init() {
 		break;
 	}
 
-	switch (global[g066]) {
+	switch (global[phineas_status]) {
 	case 0:
 	case 1:
 		scratch.xa0 = 30;
 		kernel_timing_trigger(1, 117);
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		break;
 	case 2:
 		kernel_timing_trigger(10, 110);
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		break;
 	case 3:
 		kernel_timing_trigger(1, 118);
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		break;
 	default:
 		break;
@@ -350,7 +350,7 @@ static void room_306_anim7() {
 	if (cur != aainfo[6]._frame) {
 		aainfo[6]._frame = cur;
 		if (cur == 12) {
-			if (global[g066] == 3) {
+			if (global[phineas_status] == 3) {
 				digi_play_build_ii('b', 4, 1);
 				scratch.x9e = 90;
 				aainfo[6]._val3 = 12;
@@ -365,7 +365,7 @@ static void room_306_anim7() {
 			aainfo[6]._active = 0;
 			scratch.xaa = 666;
 			scratch.x9c = kernel_run_animation_disp('r', 6, 0);
-			kernel_position_anim(scratch.x9c, 63, 134, 91, 3);
+			extra_change_animation(scratch.x9c, 63, 134, 91, 3);
 			global[g141] = -1;
 			kernel_reset_animation(scratch.x9c, 2);
 			kernel_synch(KERNEL_ANIM, scratch.x9c, KERNEL_NOW, 0);
@@ -373,21 +373,21 @@ static void room_306_anim7() {
 			if (!player.been_here_before) {
 				scratch.xac = kernel_run_animation_write(0);
 				kernel_reset_animation(scratch.xac, 4);
-				kernel_position_anim(scratch.xac, 88, 122, 86, 5);
+				extra_change_animation(scratch.xac, 88, 122, 86, 5);
 				global[walker_converse_now] = 1;
 				global[g007] = 2;
 				kernel_synch(KERNEL_ANIM, scratch.xac, KERNEL_NOW, 0);
 			} else {
 				scratch.xaa = -1;
 				scratch.x9a = kernel_run_animation_disp('e', 2, 0);
-				kernel_position_anim(scratch.x9a, 88, 122, 86, 5);
+				extra_change_animation(scratch.x9a, 88, 122, 86, 5);
 				global[g131] = -1;
 				kernel_reset_animation(scratch.x9a, 2);
 				kernel_synch(KERNEL_ANIM, scratch.x9a, KERNEL_NOW, 0);
 				global[g133] = 0;
 				player.commands_allowed = true;
 			}
-			if (global[g066] != 3) {
+			if (global[phineas_status] != 3) {
 				scratch.xa0 = 30;
 				kernel_timing_trigger(1, 117);
 			} else {
@@ -404,7 +404,7 @@ static void room_306_anim7() {
 				case 6:  result = imath_random(13, 18); break;
 				case 7:
 					result = 6;
-					if (global[g066] == 3)
+					if (global[phineas_status] == 3)
 						aainfo[6]._val3 = 12;
 					break;
 				case 8:
@@ -591,8 +591,8 @@ static void room_306_anim4() {
 		dont_frag_the_palette();
 		kernel_abort_animation(aa[3]);
 		aainfo[3]._active = 0;
-		global[g066] = 3;
-		global[player_score] = -1;
+		global[phineas_status] = 3;
+		global[play_background_sounds] = -1;
 		kernel_timing_trigger(1, 118);
 		aainfo[6]._val3 = 7;
 	} else if (cur == 1 || cur == 5) {
@@ -663,7 +663,7 @@ static void room_306_anim10() {
 	if (cur == 28) {
 		kernel_abort_animation(aa[9]);
 		aainfo[9]._active = 0;
-		global[g066] = 1;
+		global[phineas_status] = 1;
 		aainfo[6]._val3 = 13;
 	} else if (cur == 15) {
 		digi_initial_volume(scratch.xa0);
@@ -686,8 +686,8 @@ static void room_306_daemon() {
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0) {
-				if (global[g066] == 3) {
+			if (config_file.misc2 != 0) {
+				if (global[phineas_status] == 3) {
 					kernel_timing_trigger(1, 118);
 				} else {
 					scratch.xa0 = 30;
@@ -698,7 +698,7 @@ static void room_306_daemon() {
 			switch (scratch.x9e) {
 			case 100:
 				kernel_timing_trigger(20, 113);
-				global[player_score] = -1;
+				global[play_background_sounds] = -1;
 				break;
 
 			case 2000:
@@ -709,8 +709,8 @@ static void room_306_daemon() {
 				kernel_synch(KERNEL_ANIM, scratch.x9a, KERNEL_NOW, 0);
 				global[g133] = 0;
 				player.commands_allowed = true;
-				if (config_file.forest1 != 0) {
-					if (global[g066] == 3) {
+				if (config_file.misc2 != 0) {
+					if (global[phineas_status] == 3) {
 						kernel_timing_trigger(1, 118);
 					} else {
 						scratch.xa0 = 30;
@@ -733,8 +733,8 @@ static void room_306_daemon() {
 				scratch.xa2 = 0;
 				scratch.x9e = -1;
 				player.commands_allowed = true;
-				if (config_file.forest1 != 0) {
-					if (global[g066] == 3) {
+				if (config_file.misc2 != 0) {
+					if (global[phineas_status] == 3) {
 						kernel_timing_trigger(1, 118);
 					} else {
 						scratch.xa0 = 30;
@@ -753,13 +753,13 @@ static void room_306_daemon() {
 		kernel_reset_animation(scratch.x9a, 0);
 		global[g133] = 1;
 		scratch.xa6 = kernel_run_animation_talk('e', 3, 0);
-		kernel_position_anim(scratch.xa6, 88, 122, 86, 5);
+		extra_change_animation(scratch.xa6, 88, 122, 86, 5);
 		global[g156] = 2;
 		kernel_synch(KERNEL_ANIM, scratch.xa6, KERNEL_ANIM, scratch.x9a);
 		digi_play_build(306, 'e', 1, 1);
 		scratch.x9e = 2000;
 		scratch.xa2 = -1;
-		if (global[g066] == 3) {
+		if (global[phineas_status] == 3) {
 			kernel_timing_trigger(1, 118);
 		} else {
 			kernel_timing_trigger(1, 117);
@@ -777,7 +777,7 @@ static void room_306_daemon() {
 		kernel_abort_animation(scratch.xac);
 		scratch.xac = -1;
 		scratch.x9a = kernel_run_animation_disp('e', 2, 0);
-		kernel_position_anim(scratch.x9a, 88, 122, 86, 5);
+		extra_change_animation(scratch.x9a, 88, 122, 86, 5);
 		global[g131] = -1;
 		kernel_reset_animation(scratch.x9a, 2);
 		kernel_synch(KERNEL_ANIM, scratch.x9a, KERNEL_NOW, 0);
@@ -791,8 +791,8 @@ static void room_306_daemon() {
 	case 100:
 		kernel_abort_animation(aa[0]);
 		aainfo[0]._active = 0;
-		if (config_file.forest1 != 0) {
-			if (global[g066] == 3) {
+		if (config_file.misc2 != 0) {
+			if (global[phineas_status] == 3) {
 				kernel_timing_trigger(1, 118);
 			} else {
 				scratch.xa0 = 30;
@@ -819,8 +819,8 @@ static void room_306_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch.x9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0) {
-			if (global[g066] == 3) {
+		if (config_file.misc2 != 0) {
+			if (global[phineas_status] == 3) {
 				kernel_timing_trigger(1, 118);
 			} else {
 				scratch.xa0 = 30;
@@ -904,14 +904,14 @@ static void room_306_daemon() {
 		break;
 
 	case 117:
-		if (global[g066] <= 1 && scratch.xa4 == 0) {
+		if (global[phineas_status] <= 1 && scratch.xa4 == 0) {
 			digi_initial_volume(scratch.xa0);
 			digi_play_build(305, '_', 1, 3);
 		}
 		break;
 
 	case 118:
-		if (global[g066] == 3) {
+		if (global[phineas_status] == 3) {
 			digi_initial_volume(15);
 			digi_play_build(306, '_', 2, 3);
 			digi_val2 = -1;
@@ -968,13 +968,13 @@ static void room_306_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch.xa8 = kernel_run_animation_talk('b', 9, 0);
-		kernel_position_anim(scratch.xa8, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch.xa8, player.x, player.y, player.scale, player.depth);
 		global[g154] = 2;
 		kernel_synch(KERNEL_ANIM, scratch.xa8, KERNEL_PLAYER, 0);
 		digi_play_build(306, 'b', 1, 1);
 		scratch.x9e = 2500;
 		scratch.xa2 = -1;
-		if (config_file.forest1 == 0) {
+		if (config_file.misc2 == 0) {
 			kernel.trigger_setup_mode = 1;
 			kernel_timing_trigger(1, 117);
 		}
diff --git a/engines/mads/madsv2/forest/rooms/room307.cpp b/engines/mads/madsv2/forest/rooms/room307.cpp
index a20898ba4f5..55808c6bc0c 100644
--- a/engines/mads/madsv2/forest/rooms/room307.cpp
+++ b/engines/mads/madsv2/forest/rooms/room307.cpp
@@ -89,10 +89,10 @@ static void room_307_init2() {
 	if (player.been_here_before != 0 && previous_room != 308) {
 		scratch._9c = kernel_run_animation_disp('r', 9, 0);
 		kernel_reset_animation(scratch._9c, 2);
-		kernel_position_anim(scratch._9c, 18, 130, 95, 3);
+		extra_change_animation(scratch._9c, 18, 130, 95, 3);
 		scratch._9a = kernel_run_animation_disp('e', 6, 0);
 		kernel_reset_animation(scratch._9a, 2);
-		kernel_position_anim(scratch._9a, 71, 81, 87, 7);
+		extra_change_animation(scratch._9a, 71, 81, 87, 7);
 		global[g131] = 0;
 		global[g141] = 0;
 		global[g133] = 1;
@@ -320,7 +320,7 @@ static void room_307_anim5() {
 		scratch._aa++;
 		global[g156] = 2;
 		digi_play_build(307, 'E', 2, 1);
-		if (config_file.forest1 == 0)
+		if (config_file.misc2 == 0)
 			digi_play_build(307, '_', 1, 2);
 		break;
 	case 20:
@@ -370,13 +370,13 @@ static void room_307_anim5() {
 		global[g017] = -1;
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		scratch._9c = kernel_run_animation_disp('r', 9, 0);
-		kernel_position_anim(scratch._9c, 18, 130, 95, 3);
+		extra_change_animation(scratch._9c, 18, 130, 95, 3);
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9c, 2);
 		global[g143] = 0;
 		scratch._ae = kernel_run_animation_write(0);
 		kernel_reset_animation(scratch._ae, 1);
-		kernel_position_anim(scratch._ae, 71, 81, 87, 7);
+		extra_change_animation(scratch._ae, 71, 81, 87, 7);
 		global[walker_converse_now] = 1;
 		global[g007] = 6;
 		kernel_synch(KERNEL_ANIM, scratch._ae, KERNEL_NOW, 0);
@@ -600,7 +600,7 @@ static void room_307_daemon() {
 			scratch._aa = -1;
 			scratch._a0 = 0;
 			scratch._9e = kernel_run_animation_point(1, 'h');
-			kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 			kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_NOW, 0);
 		} else if (scratch._aa == 40) {
 			aainfo[6]._val3 = 0;
@@ -613,7 +613,7 @@ static void room_307_daemon() {
 			scratch._aa = -1;
 			scratch._a0 = 0;
 			scratch._9e = kernel_run_animation_point(3, 'i');
-			kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 			kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_NOW, 0);
 		}
 		break;
@@ -677,7 +677,7 @@ static void room_307_daemon() {
 		kernel_abort_animation(scratch._ae);
 		scratch._ae = -1;
 		scratch._9a = kernel_run_animation_disp('e', 6, 0);
-		kernel_position_anim(scratch._9a, 71, 81, 87, 7);
+		extra_change_animation(scratch._9a, 71, 81, 87, 7);
 		global[g131] = -1;
 		kernel_reset_animation(scratch._9a, 2);
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
@@ -699,9 +699,9 @@ static void room_307_daemon() {
 			global[g154] = 0;
 			global[g156] = 0;
 			scratch._a6 = kernel_run_animation_talk('r', 9, 0);
-			kernel_position_anim(scratch._a6, 18, 130, 95, 3);
+			extra_change_animation(scratch._a6, 18, 130, 95, 3);
 			scratch._a8 = kernel_run_animation_talk('e', 6, 0);
-			kernel_position_anim(scratch._a8, 71, 81, 87, 7);
+			extra_change_animation(scratch._a8, 71, 81, 87, 7);
 
 			// WORKAROUND: In the original when first entering room _9a & _9c == -1, which caused a
 			// wobbly in kernel_synch. Hence the conditional check to set master_type to PLAYER
@@ -757,7 +757,7 @@ static void room_307_daemon() {
 	case 109:
 		player.walker_visible = false;
 		scratch._a4 = kernel_run_animation_talk('b', 9, 0);
-		kernel_position_anim(scratch._a4, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._a4, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._a4, KERNEL_PLAYER, 0);
 		break;
 
@@ -803,11 +803,11 @@ static void room_307_daemon() {
 		aainfo[2]._active = 0;
 		scratch._9c = kernel_run_animation_disp('r', 9, 0);
 		kernel_reset_animation(scratch._9c, 2);
-		kernel_position_anim(scratch._9c, 18, 130, 95, 3);
+		extra_change_animation(scratch._9c, 18, 130, 95, 3);
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		scratch._9a = kernel_run_animation_disp('e', 6, 0);
 		kernel_reset_animation(scratch._9a, 2);
-		kernel_position_anim(scratch._9a, 71, 81, 87, 7);
+		extra_change_animation(scratch._9a, 71, 81, 87, 7);
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g131] = -1;
 		global[g141] = -1;
@@ -888,7 +888,7 @@ static void room_307_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._a4 = kernel_run_animation_talk('b', 2, 0);
-		kernel_position_anim(scratch._a4, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._a4, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._a4, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._aa = 41;
@@ -901,7 +901,7 @@ static void room_307_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._a4 = kernel_run_animation_talk('b', 1, 0);
-		kernel_position_anim(scratch._a4, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._a4, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._a4, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._aa = 4;
diff --git a/engines/mads/madsv2/forest/rooms/room308.cpp b/engines/mads/madsv2/forest/rooms/room308.cpp
index 7161c78c886..a2c2edcc6ca 100644
--- a/engines/mads/madsv2/forest/rooms/room308.cpp
+++ b/engines/mads/madsv2/forest/rooms/room308.cpp
@@ -76,7 +76,7 @@ static void room_308_anim1() {
 
 	switch (cur) {
 	case 40:
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		break;
 	case 56:
 	case 84:
@@ -160,7 +160,7 @@ static void room_308_anim4() {
 
 	bool in_e72 = (cur == 1 || cur == 5) ||
 	              (cur >= 10 && cur <= 58 && cur % 4 == 2);
-	if (in_e72 && (config_file.forest1 == 0 || (cur != 10 && cur != 14))) {
+	if (in_e72 && (config_file.misc2 == 0 || (cur != 10 && cur != 14))) {
 		digi_initial_volume(60);
 		digi_play_build(308, '_', 1, 2);
 	}
@@ -231,7 +231,7 @@ static void room_308_anim8() {
 		aainfo[9]._val3 = 0;
 		kernel_synch(KERNEL_ANIM, aa[9], KERNEL_NOW, 0);
 
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		return;
 	}
 	if (cur > 57)
@@ -853,7 +853,7 @@ static void room_308_anim22() {
 		inter_move_object(forked_stick, NOWHERE);
 		inter_move_object(lily_pad, PLAYER);
 		inter_move_object(stick, PLAYER);
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		new_room = 401;
 	}
 }
@@ -878,7 +878,7 @@ static void room_308_anim23() {
 		object_set_quality(forked_stick, -1, -1);
 		inter_move_object(lily_pad, PLAYER);
 		inter_move_object(stick, PLAYER);
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		if (global[g064] != 0)
 			new_room = 322;
 		else
@@ -1148,7 +1148,7 @@ static void room_308_daemon() {
 			aainfo[3]._active = -1;
 			kernel_synch(KERNEL_ANIM, aa[3], KERNEL_NOW, 0);
 		} else {
-			global[player_score] = -1;
+			global[play_background_sounds] = -1;
 			aa[4] = kernel_run_animation(kernel_name('t', 6), 104);
 			aainfo[4]._active = -1;
 			kernel_synch(KERNEL_ANIM, aa[4], KERNEL_NOW, 0);
@@ -1171,7 +1171,7 @@ static void room_308_daemon() {
 		object_set_quality(forked_stick, -1, -1);
 		inter_move_object(lily_pad, PLAYER);
 		inter_move_object(stick, PLAYER);
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		if (global[g064] != 0)
 			new_room = 322;
 		else
@@ -1212,7 +1212,7 @@ static void room_308_daemon() {
 	case 112:
 		inter_move_object(lily_pad, PLAYER);
 		inter_move_object(stick, PLAYER);
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		new_room = 401;
 		break;
 
diff --git a/engines/mads/madsv2/forest/rooms/room321.cpp b/engines/mads/madsv2/forest/rooms/room321.cpp
index 1e64d9af78b..d3ccfca0d0d 100644
--- a/engines/mads/madsv2/forest/rooms/room321.cpp
+++ b/engines/mads/madsv2/forest/rooms/room321.cpp
@@ -78,9 +78,9 @@ static void room_321_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 6, 0);
-	kernel_position_anim(scratch._9c, 83, 131, 92, 6);
+	extra_change_animation(scratch._9c, 83, 131, 92, 6);
 	scratch._9a = kernel_run_animation_disp('e', 6, 0);
-	kernel_position_anim(scratch._9a, 109, 139, 94, 5);
+	extra_change_animation(scratch._9a, 109, 139, 94, 5);
 
 	aa[4] = kernel_run_animation(kernel_name('L', 5), 104);
 	aainfo[4]._active = -1;
@@ -711,7 +711,7 @@ static void room_321_daemon() {
 			room_321_anim2();
 			kernel_flip_hotspot(words_reeds, false);
 			inter_move_object(6, PLAYER);
-			global[player_score] = -1;
+			global[play_background_sounds] = -1;
 			player.commands_allowed = true;
 		} else if (scratch._a6 == 2) {
 			dont_frag_the_palette();
@@ -728,7 +728,7 @@ static void room_321_daemon() {
 			if (!player_has(pebbles))
 				inter_move_object(pebbles, PLAYER);
 			global[g068] = -1;
-			global[player_score] = -1;
+			global[play_background_sounds] = -1;
 			player.commands_allowed = true;
 		}
 		break;
@@ -779,7 +779,7 @@ static void room_321_parser() {
 	}
 
 	if (player_parse(words_look_at, words_chicory, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -789,7 +789,7 @@ static void room_321_parser() {
 	}
 
 	if (player_parse(words_look_at, words_foxglove, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -800,11 +800,11 @@ static void room_321_parser() {
 
 	if (player_parse(words_pick_up, words_reeds, 0)) {
 		global[g154] = 2;
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 1, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._a8 = 400;
@@ -814,11 +814,11 @@ static void room_321_parser() {
 
 	if (player_parse(words_pick_up, words_pebbles, 0)) {
 		global[g154] = 2;
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 3, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 3, 1);
 		scratch._a8 = 300;
diff --git a/engines/mads/madsv2/forest/rooms/room322.cpp b/engines/mads/madsv2/forest/rooms/room322.cpp
index 6d4210482a5..208b429f836 100644
--- a/engines/mads/madsv2/forest/rooms/room322.cpp
+++ b/engines/mads/madsv2/forest/rooms/room322.cpp
@@ -82,9 +82,9 @@ static void room_322_init1() {
 
 	if (previous_room != 308 && previous_room != 301) {
 		scratch._a6 = kernel_run_animation_disp('r', 9, 0);
-		kernel_position_anim(scratch._a6, 18, 130, 95, 3);
+		extra_change_animation(scratch._a6, 18, 130, 95, 3);
 		scratch._a4 = kernel_run_animation_disp('e', 6, 0);
-		kernel_position_anim(scratch._a4, 71, 81, 87, 7);
+		extra_change_animation(scratch._a4, 71, 81, 87, 7);
 	} else {
 		scratch._a4 = -1;
 	}
@@ -441,7 +441,7 @@ static void room_322_daemon() {
 			scratch._b4 = -1;
 			scratch._aa = 0;
 			scratch._a8 = kernel_run_animation_point(1, 104);
-			kernel_position_anim(scratch._a8, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._a8, player.x, player.y, player.scale, player.depth);
 			kernel_synch(KERNEL_ANIM, scratch._a8, KERNEL_NOW, 0);
 		} else if (scratch._b4 == 41) {
 			dont_frag_the_palette();
@@ -449,7 +449,7 @@ static void room_322_daemon() {
 			scratch._b4 = -1;
 			scratch._aa = 0;
 			scratch._a8 = kernel_run_animation_point(3, 105);
-			kernel_position_anim(scratch._a8, player.x, player.y, player.scale, player.depth);
+			extra_change_animation(scratch._a8, player.x, player.y, player.scale, player.depth);
 			kernel_synch(KERNEL_ANIM, scratch._a8, KERNEL_NOW, 0);
 		}
 		break;
@@ -622,13 +622,13 @@ static void room_322_daemon() {
 			scratch._a6 = kernel_run_animation_disp('r', 9, 0);
 			global[g141] = -1;
 			global[g143] = 0;
-			kernel_position_anim(scratch._a6, 18, 130, 95, 3);
+			extra_change_animation(scratch._a6, 18, 130, 95, 3);
 			kernel_reset_animation(scratch._a6, 1);
 			kernel_synch(KERNEL_ANIM, scratch._a6, KERNEL_NOW, 0);
 			scratch._a4 = kernel_run_animation_disp('e', 6, 0);
 			global[g131] = -1;
 			global[g133] = 0;
-			kernel_position_anim(scratch._a4, 71, 81, 87, 7);
+			extra_change_animation(scratch._a4, 71, 81, 87, 7);
 		}
 		kernel_reset_animation(scratch._a4, 1);
 		kernel_synch(KERNEL_ANIM, scratch._a4, KERNEL_NOW, 0);
@@ -736,7 +736,7 @@ static void room_322_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._ae = kernel_run_animation_talk('b', 2, 0);
-		kernel_position_anim(scratch._ae, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._ae, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._ae, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._b4 = 41;
@@ -750,7 +750,7 @@ static void room_322_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._ae = kernel_run_animation_talk('b', 1, 0);
-		kernel_position_anim(scratch._ae, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._ae, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._ae, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._b4 = 4;
diff --git a/engines/mads/madsv2/forest/rooms/room401.cpp b/engines/mads/madsv2/forest/rooms/room401.cpp
index ad1665eee7b..268248177e1 100644
--- a/engines/mads/madsv2/forest/rooms/room401.cpp
+++ b/engines/mads/madsv2/forest/rooms/room401.cpp
@@ -106,7 +106,7 @@ static void room_401_anim_state(int16 state) {
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		player.commands_allowed = true;
 		player.walker_visible = true;
-		if (config_file.forest1) {
+		if (config_file.misc2) {
 			digi_stop(1);
 			kernel_timing_trigger(1, 106);
 		}
@@ -207,7 +207,7 @@ static void room_401_anim2() {
 					result = 22;
 				} else if (frame < 25) {
 					if (frame == 15) {
-						if (!global[g066])
+						if (!global[phineas_status])
 							digi_play_build(401, 'r', 1, 1);
 						else
 							digi_play_build(401, 'r', 2, 1);
@@ -229,7 +229,7 @@ static void room_401_anim2() {
 					} else if (frame == 32) {
 						result = 29;
 					} else if (frame == 35) {
-						if (config_file.forest1)
+						if (config_file.misc2)
 							kernel_timing_trigger(1, 106);
 					}
 				}
@@ -369,9 +369,9 @@ static void room_401_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 3, 0);
-	kernel_position_anim(scratch._9c, 228, 132, 82, 4);
+	extra_change_animation(scratch._9c, 228, 132, 82, 4);
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
-	kernel_position_anim(scratch._9a, 252, 115, 76, 7);
+	extra_change_animation(scratch._9a, 252, 115, 76, 7);
 
 	if (previous_room != KERNEL_RESTORING_GAME && previous_room != 199) {
 		player_demand_facing(7);
@@ -436,11 +436,11 @@ static void room_401_init() {
 	scratch._a2 = -1;
 	midi_stop();
 
-	if (!flags[31] || !global[g066])
+	if (!flags[31] || !global[phineas_status])
 		kernel_flip_hotspot(words_room_404, false);
 
 	kernel_timing_trigger(1, 106);
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	scratch._98 = 0;
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
@@ -471,7 +471,7 @@ static void room_401_daemon() {
 		global[walker_converse_state] = 0;
 		close_interface(CANDLE_FLY);
 		player.commands_allowed = true;
-		if (config_file.forest1)
+		if (config_file.misc2)
 			kernel_timing_trigger(1, 106);
 		break;
 
diff --git a/engines/mads/madsv2/forest/rooms/room402.cpp b/engines/mads/madsv2/forest/rooms/room402.cpp
index cab7793e198..e0dc25d0ea5 100644
--- a/engines/mads/madsv2/forest/rooms/room402.cpp
+++ b/engines/mads/madsv2/forest/rooms/room402.cpp
@@ -90,9 +90,9 @@ static void room_402_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 1, 0);
-	kernel_position_anim(scratch._9c, 71, 128, 63, 5);
+	extra_change_animation(scratch._9c, 71, 128, 63, 5);
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
-	kernel_position_anim(scratch._9a, 112, 131, 65, 5);
+	extra_change_animation(scratch._9a, 112, 131, 65, 5);
 
 	if (previous_room != KERNEL_RESTORING_GAME && previous_room != 199) {
 		player_demand_facing(3);
@@ -128,7 +128,7 @@ static void room_402_init1() {
 		aainfo[1]._frame = 0;
 		scratch._98 = 20;
 		room_402_init2();
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		return;
 	case 1:
 		aa[1] = kernel_run_animation(kernel_name('L', 2), 103);
@@ -167,14 +167,14 @@ static void room_402_init1() {
 		return;
 	}
 
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global_midi_play(15);
 }
 
 static void room_402_init() {
 	scratch._90 = 0;
 	scratch._a0 = 0;
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 
 	if (previous_room == 403) {
 		global[g009] = 0;
@@ -371,8 +371,8 @@ static void room_402_anim_state() {
 		global[g083] = 3;
 		kernel_flip_hotspot(words_room_403, true);
 		kernel_flip_hotspot(words_room_401, true);
-		kernel_position_anim(scratch._9c, 71, 128, 63, 5);
-		kernel_position_anim(scratch._9a, 112, 131, 65, 5);
+		extra_change_animation(scratch._9c, 71, 128, 63, 5);
+		extra_change_animation(scratch._9a, 112, 131, 65, 5);
 		global[g131] = -1;
 		global[g141] = -1;
 		kernel_reset_animation(scratch._9a, 1);
@@ -388,7 +388,7 @@ static void room_402_anim_state() {
 		player.commands_allowed = true;
 		global[walker_converse_state] = 0;
 		close_interface(CANDLE_FLY);
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		break;
 	case 20:
 		aa[1] = kernel_run_animation(kernel_name('L', 1), 103);
@@ -613,7 +613,7 @@ static void room_402_anim2() {
 		int16 frame = aainfo[1]._frame;
 		if (frame == 57) {
 			global_midi_play(10);
-			global[player_score] = 0;
+			global[play_background_sounds] = 0;
 		} else if (frame < 57) {
 			if (frame == 37) {
 				if (flags[27] != 1)
diff --git a/engines/mads/madsv2/forest/rooms/room403.cpp b/engines/mads/madsv2/forest/rooms/room403.cpp
index 7eb0d09517d..bb564049f58 100644
--- a/engines/mads/madsv2/forest/rooms/room403.cpp
+++ b/engines/mads/madsv2/forest/rooms/room403.cpp
@@ -79,9 +79,9 @@ static void room_403_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 1, 0);
-	kernel_position_anim(scratch._9c, 159, 99, 81, 12);
+	extra_change_animation(scratch._9c, 159, 99, 81, 12);
 	scratch._9a = kernel_run_animation_disp('e', 3, 0);
-	kernel_position_anim(scratch._9a, 129, 98, 81, 12);
+	extra_change_animation(scratch._9a, 129, 98, 81, 12);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 104;
@@ -139,7 +139,7 @@ static void room_403_init() {
 	scratch._a2 = -1;
 	midi_stop();
 	global[g009] = 0;
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	kernel_timing_trigger(1, 105);
 
 	if (object_is_here(13)) {
@@ -460,7 +460,7 @@ static void room_403_daemon() {
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0)
+			if (config_file.misc2 != 0)
 				kernel_timing_trigger(1, 105);
 		} else if (scratch._a4 == 300) {
 			kernel_abort_animation(scratch._9e);
@@ -564,7 +564,7 @@ static void room_403_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -582,7 +582,7 @@ static void room_403_daemon() {
 		global[g143] = 0;
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -593,7 +593,7 @@ static void room_403_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -604,7 +604,7 @@ static void room_403_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1 != 0)
+		if (config_file.misc2 != 0)
 			kernel_timing_trigger(1, 105);
 		break;
 
@@ -622,7 +622,7 @@ static void room_403_daemon() {
 			inter_move_object(sturdy_stick, PLAYER);
 			clear_selected_item();
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0)
+			if (config_file.misc2 != 0)
 				kernel_timing_trigger(1, 105);
 		} else if (scratch._a2 == 2) {
 			kernel_abort_animation(aa[5]);
@@ -637,7 +637,7 @@ static void room_403_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			kernel_flip_hotspot(words_eyebright, false);
 			player.commands_allowed = true;
-			if (config_file.forest1 != 0)
+			if (config_file.misc2 != 0)
 				kernel_timing_trigger(1, 105);
 		}
 		break;
@@ -653,7 +653,7 @@ static void room_403_daemon() {
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		scratch._a8 = kernel_run_animation_write(0);
 		kernel_reset_animation(scratch._a8, 3);
-		kernel_position_anim(scratch._a8, 129, 98, 81, 12);
+		extra_change_animation(scratch._a8, 129, 98, 81, 12);
 		global[walker_converse_now] = 1;
 		global[g007] = 3;
 		kernel_synch(KERNEL_ANIM, scratch._a8, KERNEL_NOW, 0);
@@ -760,7 +760,7 @@ static void room_403_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._9e = kernel_run_animation_talk('b', 2, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._a4 = 400;
@@ -776,7 +776,7 @@ static void room_403_parser() {
 		player.walker_visible = false;
 		player.commands_allowed = false;
 		scratch._9e = kernel_run_animation_talk('b', 4, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build_ii('b', 1, 1);
 		scratch._a4 = 300;
diff --git a/engines/mads/madsv2/forest/rooms/room404.cpp b/engines/mads/madsv2/forest/rooms/room404.cpp
index 7971dc6e66f..fad9e0bddff 100644
--- a/engines/mads/madsv2/forest/rooms/room404.cpp
+++ b/engines/mads/madsv2/forest/rooms/room404.cpp
@@ -80,14 +80,14 @@ static void room_404_init1() {
 	if (global[g084] == 16) {
 		object_set_quality(sturdy_stick, 0, 0);
 		scratch._9c = kernel_run_animation_disp('r', 6, 0);
-		kernel_position_anim(scratch._9c, 123, 145, 92, 1);
+		extra_change_animation(scratch._9c, 123, 145, 92, 1);
 		scratch._9a = kernel_run_animation_disp('e', 6, 0);
-		kernel_position_anim(scratch._9a, 180, 139, 88, 5);
+		extra_change_animation(scratch._9a, 180, 139, 88, 5);
 	} else {
 		scratch._9c = kernel_run_animation_disp('r', 9, 0);
-		kernel_position_anim(scratch._9c, 91, 153, 98, 2);
+		extra_change_animation(scratch._9c, 91, 153, 98, 2);
 		scratch._9a = kernel_run_animation_disp('e', 9, 0);
-		kernel_position_anim(scratch._9a, 64, 103, 62, 11);
+		extra_change_animation(scratch._9a, 64, 103, 62, 11);
 	}
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
@@ -187,7 +187,7 @@ static void room_404_init() {
 		kernel_seq_scale(seq[1], 77);
 	}
 
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		if (previous_room != 199) {
@@ -514,7 +514,7 @@ static void room_404_daemon() {
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 110);
 		} else if (scratch._a6 == 400) {
 			kernel_abort_animation(scratch._9e);
@@ -523,7 +523,7 @@ static void room_404_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.walker_visible = true;
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
@@ -608,7 +608,7 @@ static void room_404_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1)
+		if (config_file.misc2)
 			kernel_timing_trigger(1, 110);
 		break;
 
@@ -635,7 +635,7 @@ static void room_404_daemon() {
 				global[g143] = 0;
 				kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 				player.commands_allowed = true;
-				if (config_file.forest1)
+				if (config_file.misc2)
 					kernel_timing_trigger(1, 110);
 			}
 		} else if (previous_room == 405) {
@@ -650,7 +650,7 @@ static void room_404_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
@@ -662,7 +662,7 @@ static void room_404_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1)
+		if (config_file.misc2)
 			kernel_timing_trigger(1, 110);
 		break;
 
@@ -673,7 +673,7 @@ static void room_404_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1)
+		if (config_file.misc2)
 			kernel_timing_trigger(1, 110);
 		break;
 
@@ -686,9 +686,9 @@ static void room_404_daemon() {
 			global[g084] = 16;
 			object_set_quality(sturdy_stick, 0, 0);
 			scratch._9c = kernel_run_animation_disp('r', 6, 0);
-			kernel_position_anim(scratch._9c, 123, 145, 92, 1);
+			extra_change_animation(scratch._9c, 123, 145, 92, 1);
 			scratch._9a = kernel_run_animation_disp('e', 6, 0);
-			kernel_position_anim(scratch._9a, 180, 139, 88, 5);
+			extra_change_animation(scratch._9a, 180, 139, 88, 5);
 			kernel_reset_animation(scratch._9c, 1);
 			kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 			global[g143] = 0;
@@ -731,7 +731,7 @@ static void room_404_daemon() {
 				close_interface(CANDLE_FLY);
 			}
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
@@ -756,7 +756,7 @@ static void room_404_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			scratch._a0 = kernel_run_animation_write(0);
 			kernel_reset_animation(scratch._a0, 1);
-			kernel_position_anim(scratch._a0, 64, 103, 62, 11);
+			extra_change_animation(scratch._a0, 64, 103, 62, 11);
 			global[walker_converse_now] = 1;
 			global[g007] = 9;
 			kernel_synch(KERNEL_ANIM, scratch._a0, KERNEL_NOW, 0);
@@ -773,7 +773,7 @@ static void room_404_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 110);
 		}
 		break;
@@ -909,7 +909,7 @@ static void room_404_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 7, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build(404, 'b', 4, 1);
 		scratch._a6 = 400;
@@ -925,7 +925,7 @@ static void room_404_parser() {
 		player.commands_allowed = false;
 		player.walker_visible = false;
 		scratch._9e = kernel_run_animation_talk('b', 9, 0);
-		kernel_position_anim(scratch._9e, player.x, player.y, player.scale, player.depth);
+		extra_change_animation(scratch._9e, player.x, player.y, player.scale, player.depth);
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_PLAYER, 0);
 		digi_play_build(404, 'b', 4, 1);
 		scratch._a6 = 400;
diff --git a/engines/mads/madsv2/forest/rooms/room405.cpp b/engines/mads/madsv2/forest/rooms/room405.cpp
index eb752b0a11a..d9497761e33 100644
--- a/engines/mads/madsv2/forest/rooms/room405.cpp
+++ b/engines/mads/madsv2/forest/rooms/room405.cpp
@@ -73,9 +73,9 @@ static void room_405_init1() {
 	global[g141] = 0;
 
 	scratch._9c = kernel_run_animation_disp('r', 7, 0);
-	kernel_position_anim(scratch._9c, 308, 152, 69, 1);
+	extra_change_animation(scratch._9c, 308, 152, 69, 1);
 	scratch._9a = kernel_run_animation_disp('e', 7, 0);
-	kernel_position_anim(scratch._9a, 284, 154, 69, 1);
+	extra_change_animation(scratch._9a, 284, 154, 69, 1);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 246;
@@ -123,7 +123,7 @@ static void room_405_init1() {
 }
 
 static void room_405_init() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = -1;
 
 	aa[7] = kernel_run_animation(kernel_name('N', 1), 105);
@@ -280,7 +280,7 @@ static void room_405_daemon() {
 			global[walker_converse_state] = 0;
 			close_interface(CANDLE_FLY);
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 106);
 		}
 		break;
@@ -340,7 +340,7 @@ static void room_405_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1)
+		if (config_file.misc2)
 			kernel_timing_trigger(1, 106);
 		break;
 
@@ -365,7 +365,7 @@ static void room_405_daemon() {
 			global[g143] = 0;
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 106);
 		}
 		break;
@@ -377,7 +377,7 @@ static void room_405_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9c, KERNEL_NOW, 0);
 		global[g143] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1)
+		if (config_file.misc2)
 			kernel_timing_trigger(1, 106);
 		break;
 
@@ -388,7 +388,7 @@ static void room_405_daemon() {
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
 		player.commands_allowed = true;
-		if (config_file.forest1)
+		if (config_file.misc2)
 			kernel_timing_trigger(1, 106);
 		break;
 
@@ -406,7 +406,7 @@ static void room_405_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			global[g082] = 1;
 			player.commands_allowed = true;
-			if (config_file.forest1)
+			if (config_file.misc2)
 				kernel_timing_trigger(1, 106);
 		}
 		break;
@@ -422,7 +422,7 @@ static void room_405_daemon() {
 		kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 		scratch._9e = kernel_run_animation_write(0);
 		kernel_reset_animation(scratch._9e, 41);
-		kernel_position_anim(scratch._9e, 284, 154, 69, 1);
+		extra_change_animation(scratch._9e, 284, 154, 69, 1);
 		global[walker_converse_now] = 1;
 		global[g007] = 7;
 		kernel_synch(KERNEL_ANIM, scratch._9e, KERNEL_NOW, 0);
diff --git a/engines/mads/madsv2/forest/rooms/room420.cpp b/engines/mads/madsv2/forest/rooms/room420.cpp
index d095de2b409..301d5b0c97e 100644
--- a/engines/mads/madsv2/forest/rooms/room420.cpp
+++ b/engines/mads/madsv2/forest/rooms/room420.cpp
@@ -77,7 +77,7 @@ static void room_420_anim2() {
 			if (cur == 24) {
 				scratch._8e = 24;
 				aainfo[1]._val3 = 11;
-				if (global[g066] == 2 || global[g066] == 3)
+				if (global[phineas_status] == 2 || global[phineas_status] == 3)
 					digi_play_build(420, 'e', 1, 1);
 				else
 					digi_play_build(420, 'e', 1, 2);
@@ -193,7 +193,7 @@ static void room_420_anim4() {
 static void room_420_init() {
     flags[31] = 1;
     midi_stop();
-    global[player_score] = -1;
+    global[play_background_sounds] = -1;
     global[g009] = 0;
     player.walker_visible = false;
     player.commands_allowed = false;
diff --git a/engines/mads/madsv2/forest/rooms/room501.cpp b/engines/mads/madsv2/forest/rooms/room501.cpp
index 17cf2c119b6..bc2de8d7e7d 100644
--- a/engines/mads/madsv2/forest/rooms/room501.cpp
+++ b/engines/mads/madsv2/forest/rooms/room501.cpp
@@ -80,7 +80,7 @@ static void room_501_anim5();
 static void room_501_init() {
 	midi_stop();
 	global[g009] = 0;
-	global[player_score] = -1;
+	global[play_background_sounds] = -1;
 	scratch._a6 = -1;
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
@@ -109,9 +109,9 @@ static void room_501_init1() {
 	global[g131] = 0;
 	global[g141] = 0;
 	scratch._9c = kernel_run_animation_disp('r', 4, 0);
-	kernel_position_anim(scratch._9c, 132, 127, 49, 7);
+	extra_change_animation(scratch._9c, 132, 127, 49, 7);
 	scratch._9a = kernel_run_animation_disp('e', 2, 0);
-	kernel_position_anim(scratch._9a, 112, 127, 49, 7);
+	extra_change_animation(scratch._9a, 112, 127, 49, 7);
 
 	if (previous_room != KERNEL_RESTORING_GAME) {
 		player.x = 79;
@@ -491,7 +491,7 @@ static void room_501_daemon() {
 		kernel_reset_animation(scratch._9a, 1);
 		kernel_synch(KERNEL_ANIM, scratch._9a, KERNEL_NOW, 0);
 		global[g133] = 0;
-		global[player_score] = -1;
+		global[play_background_sounds] = -1;
 		player.commands_allowed = true;
 		break;
 
@@ -511,7 +511,7 @@ static void room_501_daemon() {
 			kernel_synch(KERNEL_PLAYER, 0, KERNEL_NOW, 0);
 			scratch._a0 = kernel_run_animation_write(0);
 			kernel_reset_animation(scratch._a0, 4);
-			kernel_position_anim(scratch._a0, 112, 127, 49, 7);
+			extra_change_animation(scratch._a0, 112, 127, 49, 7);
 			global[walker_converse_now] = 1;
 			global[g007] = 2;
 			kernel_synch(KERNEL_ANIM, scratch._a0, KERNEL_NOW, 0);
@@ -560,7 +560,7 @@ static void room_501_parser() {
 	}
 
 	if (player_parse(words_look_at, words_snapdragon, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -570,7 +570,7 @@ static void room_501_parser() {
 	}
 
 	if (player_parse(words_look_at, words_snapdragon2, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
@@ -580,7 +580,7 @@ static void room_501_parser() {
 	}
 
 	if (player_parse(words_look_at, words_primrose, 0)) {
-		global[player_score] = 0;
+		global[play_background_sounds] = 0;
 		digi_stop(3);
 		player.commands_allowed = false;
 		global[g135] = -1;
diff --git a/engines/mads/madsv2/forest/rooms/room503.cpp b/engines/mads/madsv2/forest/rooms/room503.cpp
index bb216b7372c..7a4539108e1 100644
--- a/engines/mads/madsv2/forest/rooms/room503.cpp
+++ b/engines/mads/madsv2/forest/rooms/room503.cpp
@@ -136,7 +136,7 @@ static void room_503_init() {
 }
 
 static void room_503_init1() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	player.walker_visible = false;
 	player.commands_allowed = false;
 
@@ -189,7 +189,7 @@ static void room_503_init1() {
 
 static void room_503_init2() {
 	viewing_at_y = 22;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	player.walker_visible = false;
 	player.commands_allowed = false;
 	mouse_hide();
@@ -199,7 +199,7 @@ static void room_503_init2() {
 }
 
 static void room_503_init3() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	player.walker_visible = false;
 	player.commands_allowed = false;
 
diff --git a/engines/mads/madsv2/forest/rooms/room509.cpp b/engines/mads/madsv2/forest/rooms/room509.cpp
index 85280863fd8..ecb3c4d6cbf 100644
--- a/engines/mads/madsv2/forest/rooms/room509.cpp
+++ b/engines/mads/madsv2/forest/rooms/room509.cpp
@@ -61,12 +61,12 @@ static void room_509_anim5();
 static void room_509_init() {
 	global[g101] = -1;
 	mouse_hide();
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = -1;
 	global_midi_play(15);
 	global[g009] = -1;
 	viewing_at_y = 22;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	player.walker_visible = false;
 	player.commands_allowed = false;
 
diff --git a/engines/mads/madsv2/forest/rooms/room510.cpp b/engines/mads/madsv2/forest/rooms/room510.cpp
index 65d841d1015..dc8847d657f 100644
--- a/engines/mads/madsv2/forest/rooms/room510.cpp
+++ b/engines/mads/madsv2/forest/rooms/room510.cpp
@@ -175,7 +175,7 @@ static void room_510_anim2() {
 			digi_play_build(510, 'e', 1, 1);
 			scratch._8e = 63;
 		} else if (aa_frame == 131) {
-			if (config_file.forest1)
+			if (config_file.misc2)
 				digi_stop(1);
 			scratch._90 = 133;
 			digi_play_build(510, '_', 3, 2);
@@ -238,7 +238,7 @@ static void room_510_anim3() {
 }
 
 static void room_510_init() {
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = 0;
 	scratch._96 = 0;
 	scratch._98 = 670;
diff --git a/engines/mads/madsv2/forest/rooms/room520.cpp b/engines/mads/madsv2/forest/rooms/room520.cpp
index 3de6217df73..d033a33d31f 100644
--- a/engines/mads/madsv2/forest/rooms/room520.cpp
+++ b/engines/mads/madsv2/forest/rooms/room520.cpp
@@ -71,7 +71,7 @@ static void room_520_init() {
 	kernel_seq_scale(seq[2], 50);
 
 	viewing_at_y = 22;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	global[g009] = 0;
 	player.walker_visible = false;
 	player.commands_allowed = false;
diff --git a/engines/mads/madsv2/forest/rooms/room901.cpp b/engines/mads/madsv2/forest/rooms/room901.cpp
index 26e17a86a74..62c5b82791f 100644
--- a/engines/mads/madsv2/forest/rooms/room901.cpp
+++ b/engines/mads/madsv2/forest/rooms/room901.cpp
@@ -38,7 +38,7 @@ namespace Rooms {
 
 static void room_901_init() {
 	global[g009] = 0;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 	player.walker_visible = false;
 	viewing_at_y = 22;
 	mouse_hide();
diff --git a/engines/mads/madsv2/forest/rooms/room903.cpp b/engines/mads/madsv2/forest/rooms/room903.cpp
index 7e5927d6e5f..d950b3f2f73 100644
--- a/engines/mads/madsv2/forest/rooms/room903.cpp
+++ b/engines/mads/madsv2/forest/rooms/room903.cpp
@@ -42,7 +42,7 @@ namespace Rooms {
 static void room_903_init() {
 	mouse_hide();
 	global[g009] = false;
-	global[player_score] = false;
+	global[play_background_sounds] = false;
 	viewing_at_y = 22;
 	kernel_timing_trigger(20, TRIGGER1);
 	kernel_run_animation("*rm903i", TRIGGER0);
diff --git a/engines/mads/madsv2/forest/rooms/room904.cpp b/engines/mads/madsv2/forest/rooms/room904.cpp
index 367967f68c0..429500aec8c 100644
--- a/engines/mads/madsv2/forest/rooms/room904.cpp
+++ b/engines/mads/madsv2/forest/rooms/room904.cpp
@@ -93,7 +93,7 @@ static void room_904_init() {
 	global[g009] = -1;
 	viewing_at_y = 22;
 	aainfo[1]._val3 = 0;
-	global[player_score] = 0;
+	global[play_background_sounds] = 0;
 
 	ss[6] = kernel_load_series("*main0", 0);
 	ss[8] = kernel_load_series("*main1", 0);
@@ -263,7 +263,7 @@ static void room_904_daemon() {
 		case 1:
 			// Credits
 			midi_stop();
-			global[player_score] = 0;
+			global[play_background_sounds] = 0;
 			global[g016] = -1;
 			global[g102] = -1;
 			new_room = 510;
@@ -291,7 +291,7 @@ static void room_904_daemon() {
 		case 4:
 			// Play Intro
 			room_904_setup_objects();
-			global[player_score] = 0;
+			global[play_background_sounds] = 0;
 			midi_stop();
 			flags[0] = -4;
 			global[g016] = -1;




More information about the Scummvm-git-logs mailing list