diff --git a/projects/openrct2.vcxproj b/projects/openrct2.vcxproj
index a367639d97..0660d091d7 100644
--- a/projects/openrct2.vcxproj
+++ b/projects/openrct2.vcxproj
@@ -21,7 +21,9 @@
+
+
@@ -33,6 +35,7 @@
+
diff --git a/projects/openrct2.vcxproj.filters b/projects/openrct2.vcxproj.filters
index 80218cc2ae..3e5e73f25b 100644
--- a/projects/openrct2.vcxproj.filters
+++ b/projects/openrct2.vcxproj.filters
@@ -48,6 +48,12 @@
Header Files
+
+ Header Files
+
+
+ Header Files
+
@@ -74,6 +80,9 @@
Source Files
+
+ Source Files
+
diff --git a/src/addresses.h b/src/addresses.h
index 6e9a01bb52..95d47e3924 100644
--- a/src/addresses.h
+++ b/src/addresses.h
@@ -69,6 +69,13 @@
#define RCT2_ADDRESS_PLACE_OBJECT_MODIFIER 0x009DEA70
#define RCT2_ADDRESS_ON_TUTORIAL 0x009DEA71
+#define RCT2_ADDRESS_SPRITE_LIST 0x010E63BC
+#define RCT2_ADDRESS_SPRITES_NEXT_INDEX 0x013573BC
+#define RCT2_ADDRESS_SPRITES_START_VEHICLE 0x013573BE
+#define RCT2_ADDRESS_SPRITES_START_PEEP 0x013573C0
+#define RCT2_ADDRESS_SPRITES_START_TEXTFX 0x013573C2
+#define RCT2_ADDRESS_SPRITES_START_LITTER 0x013573C4
+
#define RCT2_ADDRESS_WINDOW_LIST 0x01420078
#define RCT2_ADDRESS_NEW_WINDOW_PTR 0x014234B8
#define RCT2_ADDRESS_VIEWPORT_LIST 0x014234BC
diff --git a/src/game.c b/src/game.c
index 0b5a4b4a02..378ba4315e 100644
--- a/src/game.c
+++ b/src/game.c
@@ -21,6 +21,7 @@
#include "addresses.h"
#include "rct2.h"
#include "game.h"
+#include "peep.h"
#include "window.h"
void game_update()
@@ -112,7 +113,7 @@ void game_logic_update()
RCT2_CALLPROC_EBPSAFE(0x006646E1);
RCT2_CALLPROC_EBPSAFE(0x006A876D);
- RCT2_CALLPROC_EBPSAFE(0x0068F0A9); // peep_update_all()
+ peep_update_all();
// update ride
RCT2_CALLPROC_EBPSAFE(0x006D4204);
diff --git a/src/peep.c b/src/peep.c
new file mode 100644
index 0000000000..9e64685470
--- /dev/null
+++ b/src/peep.c
@@ -0,0 +1,55 @@
+/*****************************************************************************
+* Copyright (c) 2014 Ted John
+* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
+*
+* This file is part of OpenRCT2.
+*
+* OpenRCT2 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 .
+*****************************************************************************/
+
+#include "addresses.h"
+#include "peep.h"
+#include "rct2.h"
+#include "sprite.h"
+
+/**
+*
+* rct2: 0x0068F0A9
+*/
+void peep_update_all()
+{
+ int i;
+ uint16 sprite_index;
+ rct_peep* peep;
+
+ if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E)
+ return;
+
+ sprite_index = RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_START_PEEP, uint16);
+ i = 0;
+ while (sprite_index != 0xFFFF) {
+ peep = &(RCT2_ADDRESS(RCT2_ADDRESS_SPRITE_LIST, rct_sprite)[sprite_index].peep);
+ sprite_index = peep->next;
+
+ if ((i & 0x7F) != (RCT2_GLOBAL(0x013628F4, uint32) & 0x7F)) {
+ RCT2_CALLPROC_X(0x0068FC1E, 0, 0, 0, 0, peep, 0, 0);
+ } else {
+ RCT2_CALLPROC_X(0x0068F41A, 0, 0, 0, i, peep, 0, 0);
+ if (peep->var_08 == 4)
+ RCT2_CALLPROC_X(0x0068FC1E, 0, 0, 0, 0, peep, 0, 0);
+ }
+
+ i++;
+ }
+}
\ No newline at end of file
diff --git a/src/peep.h b/src/peep.h
new file mode 100644
index 0000000000..ea199cb67d
--- /dev/null
+++ b/src/peep.h
@@ -0,0 +1,89 @@
+/*****************************************************************************
+* Copyright (c) 2014 Ted John
+* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
+*
+* This file is part of OpenRCT2.
+*
+* OpenRCT2 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 .
+*****************************************************************************/
+
+#ifndef _PEEP_H_
+#define _PEEP_H_
+
+#include "rct2.h"
+
+#define PEEP_MAX_THOUGHTS 5
+
+enum PEEP_TYPE {
+ PEEP_TYPE_GUEST,
+ PEEP_TYPE_STAFF
+};
+
+enum {
+ PEEP_FLAGS_TRACKING = 8
+};
+
+enum PEEP_THOUGHT_TYPE {
+ PEEP_THOUGHT_TYPE_NONE = 255
+};
+
+typedef struct {
+ uint8 type;
+ uint8 item;
+ uint8 pad_3;
+ uint8 pad_4;
+} rct_peep_thought;
+
+typedef struct {
+ uint8 sprite_identifier; // 0x00
+ uint8 pad_01;
+ uint16 pad_02;
+ uint16 next; // 0x04
+ uint16 pad_06;
+ uint8 var_08;
+ uint8 pad_09;
+ sint16 var_0A;
+ uint16 var_0C;
+ uint8 var_0E[0x14];
+ uint16 name_string_idx; // 0x22
+ uint16 next_x; // 0x24
+ uint16 next_y; // 0x26
+ uint16 next_z; // 0x28
+ uint8 var_2A;
+ uint8 state; // 0x2B
+ uint8 pad_2C;
+ uint8 sprite_type; // 0x2D
+ uint8 type; // 0x2E
+ uint8 var_2F;
+ uint8 var_30;
+ uint8 var_31;
+ uint8 pad_32[0x08];
+ uint8 happiness; // 0x3A
+ uint8 pad_3B[0x61];
+ uint32 id; // 0x9C
+ uint8 pad_A0[0x10];
+ rct_peep_thought thoughts[PEEP_MAX_THOUGHTS]; // 0xB0
+ uint16 pad_C4;
+ uint8 var_C6;
+ uint8 pad_C7;
+ uint32 var_C8;
+ uint8 pad_CC[0x2A];
+ uint8 balloon_colour; // 0xF6
+ uint8 umbrella_colour; // 0xF7
+ uint8 hat_colour; // 0xF8
+} rct_peep;
+
+void peep_update_all();
+
+#endif
\ No newline at end of file
diff --git a/src/rct2.h b/src/rct2.h
index a00efcc484..00f5073c4c 100644
--- a/src/rct2.h
+++ b/src/rct2.h
@@ -32,4 +32,12 @@ typedef unsigned long long uint64;
void rct2_finish();
+enum {
+ SCREEN_FLAGS_PLAYING = 0,
+ SCREEN_FLAGS_TITLE_DEMO = 1,
+ SCREEN_FLAGS_SCENARIO_EDITOR = 2,
+ SCREEN_FLAGS_TRACK_DESIGNER = 4,
+ SCREEN_FLAGS_TRACK_MANAGER = 8,
+};
+
#endif
\ No newline at end of file
diff --git a/src/sprite.h b/src/sprite.h
new file mode 100644
index 0000000000..ff55d3cc87
--- /dev/null
+++ b/src/sprite.h
@@ -0,0 +1,59 @@
+/*****************************************************************************
+* Copyright (c) 2014 Ted John
+* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
+*
+* This file is part of OpenRCT2.
+*
+* OpenRCT2 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 .
+*****************************************************************************/
+
+#ifndef _SPRITE_H_
+#define _SPRITE_H_
+
+#include "rct2.h"
+
+#define SPRITE_INDEX_NULL 0xFFFF
+
+#include "peep.h"
+
+typedef struct {
+ uint8 sprite_identifier; // 0x00
+ uint8 pad_01;
+ uint16 pad_02;
+ uint16 next; // 0x04
+ uint8 pad_06[0x08];
+ sint16 var_0E;
+ sint16 var_10;
+ sint16 var_12;
+} rct_unk_sprite;
+
+typedef struct {
+ uint32 pad_00;
+ uint16 next; // 0x04
+ uint8 pad_06[0x1E];
+ sint32 var_24;
+} rct_litter;
+
+/**
+* Sprite structure.
+* size: 0x0100
+*/
+typedef union {
+ uint8 pad_00[0x100];
+ rct_unk_sprite unknown;
+ rct_peep peep;
+ rct_litter litter;
+} rct_sprite;
+
+#endif
\ No newline at end of file