From 449fa24aa40eb3a80a91c4006e0ab48908785cce Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 5 Feb 2010 19:32:08 +0000 Subject: [PATCH] Added discSkipToFrame function to SINGE. Added MadDog 1 to seektest. git-svn-id: https://www.daphne-emu.com:9443/daphnesvn/branches/v_1_0@3165 c98d566b-fa28-4d4c-8a7b-932307ef5c1a --- daphne-changelog.txt | 2 ++ src/game/seektest.cpp | 12 +++++++++++ src/game/singe/singeproxy.cpp | 37 ++++++++++++++++++++++++++++++++++ src/game/singe/singeproxy.h | 1 + src/unit_tests/video_stubs.cpp | 2 +- 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/daphne-changelog.txt b/daphne-changelog.txt index 3d55b3d..b53e5be 100644 --- a/daphne-changelog.txt +++ b/daphne-changelog.txt @@ -3,6 +3,8 @@ Daphne Changelog Next - Added Time Traveler to seektest. +- Added Mad Dog 1 to seektest. +- Added SINGE function "discSkipToFrame". v1.0.7 - Updated source code so it builds on the latest g++ diff --git a/src/game/seektest.cpp b/src/game/seektest.cpp index 406cab0..29f0172 100644 --- a/src/game/seektest.cpp +++ b/src/game/seektest.cpp @@ -442,6 +442,14 @@ void seektest::set_preset(int val) m_late2 = 53646; strcpy(m_name, "Time Traveler"); break; + case 22: // Mad Dog 1 + m_disc_fps = 29.97; + m_early1 = 137; + m_early2 = 138; + m_late1 = 38970; + m_late2 = 38971; + strcpy(m_name, "Mad Dog 1"); + break; default: printline("SEEKTEST ERROR : unknown preset"); break; @@ -539,6 +547,10 @@ bool seektest::handle_cmdline_arg(const char *arg) { set_preset(21); } + else if (strcasecmp(arg, "-maddog")==0) + { + set_preset(22); + } // no match else diff --git a/src/game/singe/singeproxy.cpp b/src/game/singe/singeproxy.cpp index 8ff685e..c32511d 100644 --- a/src/game/singe/singeproxy.cpp +++ b/src/game/singe/singeproxy.cpp @@ -491,6 +491,7 @@ void sep_startup(const char *script) lua_register(g_se_lua_context, "discSkipBackward", sep_skip_backward); lua_register(g_se_lua_context, "discSkipBlanking", sep_skip_blanking); lua_register(g_se_lua_context, "discSkipForward", sep_skip_forward); + lua_register(g_se_lua_context, "discSkipToFrame", sep_skip_to_frame); lua_register(g_se_lua_context, "discStepBackward", sep_step_backward); lua_register(g_se_lua_context, "discStepForward", sep_step_forward); lua_register(g_se_lua_context, "discStop", sep_stop); @@ -1040,6 +1041,42 @@ static int sep_skip_forward(lua_State *L) return 0; } +/* +static int sep_search(lua_State *L) +{ + char s[6] = { 0 }; + int n = lua_gettop(L); + + if (n == 1) + if (lua_isnumber(L, 1)) + { + g_pSingeIn->framenum_to_frame(lua_tonumber(L, 1), s); + g_pSingeIn->pre_search(s, true); + } + + return 0; +} +*/ + +static int sep_skip_to_frame(lua_State *L) +{ + int n = lua_gettop(L); + + if (n == 1) + { + if (lua_isnumber(L, 1)) + { + // TODO : implement this for real on the daphne side of things instead of having to do a search/play hack + char s[6] = { 0 }; + g_pSingeIn->framenum_to_frame(lua_tonumber(L, 1), s); + g_pSingeIn->pre_search(s, true); + g_pSingeIn->pre_play(); + } + } + + return 0; +} + static int sep_sound_load(lua_State *L) { int n = lua_gettop(L); diff --git a/src/game/singe/singeproxy.h b/src/game/singe/singeproxy.h index e226cff..9761b64 100644 --- a/src/game/singe/singeproxy.h +++ b/src/game/singe/singeproxy.h @@ -99,6 +99,7 @@ static int sep_sprite_height(lua_State *L); static int sep_sprite_load(lua_State *L); static int sep_sprite_width(lua_State *L); static int sep_skip_forward(lua_State *L); +static int sep_skip_to_frame(lua_State *L); static int sep_step_backward(lua_State *L); static int sep_step_forward(lua_State *L); static int sep_stop(lua_State *L); diff --git a/src/unit_tests/video_stubs.cpp b/src/unit_tests/video_stubs.cpp index 0f825bb..be8f29d 100644 --- a/src/unit_tests/video_stubs.cpp +++ b/src/unit_tests/video_stubs.cpp @@ -21,7 +21,7 @@ void vid_blank() { } -void draw_string(char *t, int col, int row, SDL_Surface *overlay) +void draw_string(const char *t, int col, int row, SDL_Surface *overlay) { SDL_FillRect(overlay, NULL, 0xFFFFFFFF); }