2016-01-07 13:17:39 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
2016-01-29 23:28:05 +00:00
|
|
|
* Copyright (C) 2016 Furrtek
|
2016-01-07 13:17:39 +00:00
|
|
|
*
|
|
|
|
* This file is part of PortaPack.
|
|
|
|
*
|
|
|
|
* This program 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 2, 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; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UI_ABOUT_H__
|
|
|
|
#define __UI_ABOUT_H__
|
|
|
|
|
|
|
|
#include "ui_widget.hpp"
|
|
|
|
#include "ui_menu.hpp"
|
|
|
|
#include "ui_navigation.hpp"
|
2016-01-29 23:28:05 +00:00
|
|
|
#include "transmitter_model.hpp"
|
2016-08-17 02:17:24 +00:00
|
|
|
#include "baseband_api.hpp"
|
2016-01-07 13:17:39 +00:00
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
namespace ui {
|
|
|
|
|
|
|
|
class AboutView : public View {
|
|
|
|
public:
|
2016-02-04 09:27:53 +00:00
|
|
|
AboutView(NavigationView& nav);
|
2016-01-29 23:28:05 +00:00
|
|
|
~AboutView();
|
|
|
|
|
|
|
|
void on_show() override;
|
2016-01-07 13:17:39 +00:00
|
|
|
void focus() override;
|
|
|
|
|
|
|
|
private:
|
2016-01-29 23:28:05 +00:00
|
|
|
void ym_init();
|
|
|
|
void update();
|
|
|
|
void render_video();
|
|
|
|
void render_audio();
|
|
|
|
void draw_demoglyph(ui::Point p, char ch, ui::Color * pal);
|
2016-04-28 12:59:14 +00:00
|
|
|
uint16_t debug_cnt = 0;
|
2016-01-29 23:28:05 +00:00
|
|
|
|
|
|
|
typedef struct ymreg_t {
|
|
|
|
uint8_t value;
|
|
|
|
uint8_t cnt;
|
|
|
|
uint16_t ptr;
|
|
|
|
bool same;
|
|
|
|
} ymreg_t;
|
|
|
|
|
|
|
|
uint16_t headphone_vol = 5<<2;
|
|
|
|
|
|
|
|
ymreg_t ym_regs[14];
|
|
|
|
uint16_t ym_frames;
|
|
|
|
uint16_t ym_frame;
|
|
|
|
uint8_t drum;
|
|
|
|
uint16_t ym_osc_cnt[3];
|
|
|
|
uint32_t ym_rng = 1;
|
|
|
|
uint16_t ym_noise_cnt;
|
|
|
|
uint8_t ym_env_att, ym_env_hold, ym_env_alt, ym_env_holding, ym_env_vol;
|
|
|
|
int8_t ym_env_step;
|
|
|
|
uint16_t ym_env_cnt;
|
|
|
|
uint8_t ym_osc_out[3];
|
|
|
|
uint8_t ym_ch[3];
|
|
|
|
uint8_t ym_out;
|
|
|
|
uint16_t ym_sample_cnt = 0;
|
|
|
|
|
|
|
|
int8_t ym_buffer[1024];
|
|
|
|
|
|
|
|
uint8_t refresh_cnt;
|
|
|
|
ui::Color paletteA[16];
|
|
|
|
ui::Color paletteB[16];
|
|
|
|
ui::Color * framebuffer;
|
|
|
|
uint32_t phase = 0;
|
|
|
|
uint8_t copperbars[5] = {0};
|
|
|
|
uint8_t copperbuffer[72] = {0};
|
|
|
|
|
|
|
|
uint8_t anim_state = 0;
|
|
|
|
uint8_t credits_index = 0;
|
|
|
|
uint16_t credits_timer = 0;
|
|
|
|
|
|
|
|
int16_t ofx = -180, ofy = -24;
|
|
|
|
|
|
|
|
const uint8_t char_map[64] = { 0xFF, 27, 46, 0xFF, 0xFF, 0xFF, 28, 45,
|
|
|
|
58, 59, 0xFF, 43, 40, 57, 26, 42,
|
|
|
|
29, 30, 31, 32, 33, 34, 35, 36,
|
|
|
|
37, 38, 41, 0xFF, 0xFF, 0xFF, 0xFF, 44,
|
|
|
|
0xFF, 0, 1, 2, 3, 4, 5, 6,
|
|
|
|
7, 8, 9, 10, 11, 12, 13, 14,
|
|
|
|
15, 16, 17, 18, 19, 20, 21, 22,
|
|
|
|
23, 24, 25, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
|
|
|
|
|
|
|
const uint8_t copperluma[16] = {8,7,6,5,4,3,2,1,1,2,3,4,5,6,7,8};
|
|
|
|
const uint8_t coppercolor[5][3] = { {255,0,0},
|
|
|
|
{0,255,0},
|
|
|
|
{0,0,255},
|
|
|
|
{255,0,255},
|
|
|
|
{255,255,0} };
|
|
|
|
|
|
|
|
typedef struct credits_t {
|
|
|
|
char role[12];
|
|
|
|
char name[12];
|
|
|
|
bool change;
|
|
|
|
} credits_t;
|
|
|
|
|
|
|
|
// 0123456789A 0123456789A
|
|
|
|
const credits_t credits[8] = { {"GURUS", "J. BOONE", false},
|
|
|
|
{"GURUS", "M. OSSMANN", true},
|
|
|
|
{"BUGS", "FURRTEK", true},
|
|
|
|
{"RDS TABLE", "C. JACQUET", true},
|
|
|
|
{"XYLOS DATA", "CLX", true},
|
|
|
|
{"GREETS TO", "SIGMOUNTE", false},
|
|
|
|
{"GREETS TO", "WINDYOONA", true},
|
|
|
|
{"THIS MUSIC", "BIG ALEC", true}
|
|
|
|
};
|
2016-01-07 13:17:39 +00:00
|
|
|
|
|
|
|
Text text_title {
|
2016-01-29 23:28:05 +00:00
|
|
|
{ 100, 32, 40, 16 },
|
2016-01-07 13:17:39 +00:00
|
|
|
"About",
|
|
|
|
};
|
|
|
|
|
|
|
|
Text text_firmware {
|
2016-07-27 03:54:55 +00:00
|
|
|
{ 0, 236, 240, 16 },
|
2016-07-27 01:03:40 +00:00
|
|
|
"Git Commit Hash " GIT_REVISION,
|
2016-01-07 13:17:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Text text_cpld_hackrf {
|
2016-07-27 03:54:55 +00:00
|
|
|
{ 0, 252, 11*8, 16 },
|
2016-07-27 01:03:40 +00:00
|
|
|
"HackRF CPLD",
|
2016-01-07 13:17:39 +00:00
|
|
|
};
|
|
|
|
|
2016-07-27 01:03:40 +00:00
|
|
|
Text text_cpld_hackrf_status {
|
2016-07-27 03:54:55 +00:00
|
|
|
{ 240 - 3*8, 252, 3*8, 16 },
|
2016-07-27 01:03:40 +00:00
|
|
|
"???"
|
2016-01-07 13:17:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Button button_ok {
|
2016-01-29 23:28:05 +00:00
|
|
|
{ 72, 272, 96, 24 },
|
2016-01-07 13:17:39 +00:00
|
|
|
"OK"
|
|
|
|
};
|
2016-07-27 01:03:40 +00:00
|
|
|
|
|
|
|
MessageHandlerRegistration message_handler_update {
|
|
|
|
Message::ID::DisplayFrameSync,
|
|
|
|
[this](const Message* const) {
|
|
|
|
this->update();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
MessageHandlerRegistration message_handler_fifo_signal {
|
|
|
|
Message::ID::FIFOSignal,
|
|
|
|
[this](const Message* const p) {
|
|
|
|
const auto message = static_cast<const FIFOSignalMessage*>(p);
|
|
|
|
if (message->signaltype == 1) {
|
|
|
|
this->render_audio();
|
2016-08-17 02:17:24 +00:00
|
|
|
baseband::set_fifo_data(ym_buffer);
|
2016-07-27 01:03:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-01-07 13:17:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace ui */
|
|
|
|
|
|
|
|
#endif/*__UI_ABOUT_H__*/
|