Compare commits

...

2 Commits

Author SHA1 Message Date
340f813bfa scene: new button layout 2025-06-29 21:07:38 -05:00
e023fa1848 xm: add CloudsAhead6 2025-06-29 21:07:30 -05:00
5 changed files with 70 additions and 28 deletions

View File

@ -5,6 +5,7 @@
#include "xm.h"
#include "xm/milkypack01.xm.h"
#include "xm/CottageFantasy2.xm.h"
#include "xm/CloudsAhead6.xm.h"
namespace playlist {
@ -14,12 +15,16 @@ namespace playlist {
const static playlist_item playlist[] = {
{
"leon du star",
(int)&_binary_xm_milkypack01_xm_start,
"Shiroiii",
(int)&_binary_xm_CottageFantasy2_xm_start,
},
{
"Shiroiii",
(int)&_binary_xm_CottageFantasy2_xm_start,
(int)&_binary_xm_CloudsAhead6_xm_start,
},
{
"leon du star",
(int)&_binary_xm_milkypack01_xm_start,
},
};
@ -31,7 +36,7 @@ namespace playlist {
if (state.playlist_ix >= playlist_length)
state.playlist_ix = 0;
printf("deferred_load\n");
printf("next deferred_load playlist_ix %d\n", state.playlist_ix);
interpreter::deferred_load(playlist[state.playlist_ix].start);
}
@ -41,6 +46,7 @@ namespace playlist {
if (state.playlist_ix < 0)
state.playlist_ix = playlist_length - 1;
printf("prev deferred_load playlist_ix %d\n", state.playlist_ix);
interpreter::deferred_load(playlist[state.playlist_ix].start);
}
}

View File

@ -24,43 +24,63 @@ void prev_click()
void next_click()
{
printf("next\n");
playlist::prev();
playlist::next();
}
widget::button prev_button(50, 50, "prev", prev_click);
widget::button play_button(50, 50, "play");
widget::button pause_button(50, 50, "pause");
widget::button stop_button(50, 50, "stop");
widget::button next_button(50, 50, "next", next_click);
#define __length(c) ((sizeof (c)) / (sizeof (c[0])))
widget::widget * left1_children[] = {
&prev_button,
widget::button play_button(75, 60, "play");
widget::button pause_button(75, 33, "pause");
widget::button prev_button(79, 30, "prev", prev_click);
widget::button next_button(79, 30, "next", next_click);
widget::button rrr_button(39, 15, "rrr");
widget::button rr_button(39, 15, "rr");
widget::button ff_button(39, 15, "ff");
widget::button fff_button(39, 15, "fff");
widget::widget * play_pause_children[] = {
&play_button,
&pause_button,
&stop_button,
};
int play_pause_length = __length(play_pause_children);
widget::widget * prev_next_children[] = {
&prev_button,
&next_button,
};
int left1_length = (sizeof (left1_children)) / (sizeof (left1_children[0]));
int prev_next_length = __length(prev_next_children);
widget::button up_button(50, 50, "up");
widget::button down_button(50, 50, "down");
widget::widget * left2_children[] = {
&up_button,
&down_button,
widget::widget * ff_rr_children[] = {
&rrr_button,
&rr_button,
&ff_button,
&fff_button,
};
int left2_length = (sizeof (left2_children)) / (sizeof (left2_children[0]));
int ff_rr_length = __length(ff_rr_children);
widget::left_aligned left_container1(0, 0, 5, left1_children, left1_length);
widget::left_aligned left_container2(0, 0, 5, left2_children, left2_length);
widget::top_aligned play_pause(0, 0, 1, play_pause_children, play_pause_length);
widget::left_aligned prev_next(0, 15, 1, prev_next_children, prev_next_length);
widget::left_aligned ff_rr(0, 70, 1, ff_rr_children, ff_rr_length);
widget::widget * prev_next_ff_rr_children[] = {
&prev_next,
&ff_rr,
};
int prev_next_ff_rr_length = __length(prev_next_ff_rr_children);
widget::container prev_next_ff_rr(0, 0, 159, 85, prev_next_ff_rr_children, prev_next_ff_rr_length);
widget::widget * top_children[] = {
&left_container1,
&left_container2,
&play_pause,
&prev_next_ff_rr,
};
int top_length = (sizeof (top_children)) / (sizeof (top_children[0]));
int top_length = __length(top_children);
widget::top_aligned top = widget::top_aligned(100, 100, 5, top_children, top_length);
widget::left_aligned top(100, 100, 20, top_children, top_length);
namespace scene::tracker {

BIN
xm/CloudsAhead6.xm Normal file

Binary file not shown.

15
xm/CloudsAhead6.xm.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
extern uint32_t _binary_xm_CloudsAhead6_xm_start __asm("_binary_xm_CloudsAhead6_xm_start");
extern uint32_t _binary_xm_CloudsAhead6_xm_end __asm("_binary_xm_CloudsAhead6_xm_end");
extern uint32_t _binary_xm_CloudsAhead6_xm_size __asm("_binary_xm_CloudsAhead6_xm_size");
#ifdef __cplusplus
}
#endif

View File

@ -1,6 +1,7 @@
XM_OBJ = \
xm/milkypack01.xm.o \
xm/CottageFantasy2.xm.o
xm/CottageFantasy2.xm.o \
xm/CloudsAhead6.xm.o
TEXTURE_OBJ = \
font/tandy1k.data.o \