3 #include "core/misc.hpp"
4 #include "core/movie.hpp"
5 #include "core/rom.hpp"
6 #include "interface/romtype.hpp"
13 struct moviefile cur_mf
;
16 movie_logic::movie_logic() throw()
23 void movie_logic::set_movie(movie
& _mov
, bool free_old
) throw()
27 if(free_old
) delete tmp
;
30 movie
& movie_logic::get_movie() throw(std::runtime_error
)
33 throw std::runtime_error("No movie");
37 void movie_logic::set_mfile(moviefile
& _mf
, bool free_old
) throw()
41 if(free_old
) delete tmp
;
44 moviefile
& movie_logic::get_mfile() throw(std::runtime_error
)
47 throw std::runtime_error("No movie");
51 void movie_logic::set_rrdata(rrdata_set
& _rrd
, bool free_old
) throw()
55 if(free_old
) delete tmp
;
58 rrdata_set
& movie_logic::get_rrdata() throw(std::runtime_error
)
61 throw std::runtime_error("No movie");
65 void movie_logic::new_frame_starting(bool dont_poll
) throw(std::bad_alloc
, std::runtime_error
)
68 controller_frame c
= update_controls(false);
69 if(!mov
->readonly_mode()) {
77 short movie_logic::input_poll(unsigned port
, unsigned dev
, unsigned id
) throw(std::bad_alloc
, std::runtime_error
)
81 if(!mov
->get_DRDY(port
, dev
, id
)) {
82 mov
->set_controls(update_controls(true));
85 int16_t in
= mov
->next_input(port
, dev
, id
);
86 //std::cerr << "BSNES asking for (" << port << "," << dev << "," << id << ") (frame "
87 // << mov->get_current_frame() << ") giving " << in << std::endl;
91 void movie_logic::release_memory()