2 #include "romimage.hpp"
6 const char* const statenames
[] = {
7 "MENU_FADEIN", "MENU", "MENU_FADEOUT", "LOAD_LEVEL", "LEVEL_FADEIN", "LEVEL_PLAY", "LEVEL_COMPLETE",
8 "LEVEL_FADEOUT", "LOAD_MENU", "LEVEL_UNAVAIL", "DEMO_UNAVAIL", "LEVEL_FADEOUT_RETRY"
11 void gstate::level_init(uint8_t _stage
)
14 p
.level_init(curlevel
);
23 uint8_t gstate::simulate_frame(noise_maker
& sfx
, int lr
, int ad
, bool jump
)
25 uint8_t dstatus
= p
.simulate_frame(curlevel
, sfx
, lr
, ad
, jump
);
26 uint16_t lt
= p
.lpos
>> 16;
27 uint8_t ht
= (p
.hpos
- 12160) / 5888;
28 if(secret
== 1 && p
.is_set(physics::flag_landed
) && ht
<= 2 && lt
>= 131 && lt
<= 170)
30 else if(secret
== 2 && p
.is_set(physics::flag_landed
) && ht
== 3 && lt
>= 58 && lt
<= 62)
34 void gstate::change_state(uint8_t newstate
)
40 std::pair
<uint8_t*, size_t> gstate::as_ram()
42 return std::make_pair(reinterpret_cast<uint8_t*>(this), sizeof(*this));