|
1 | | -/* |
2 | | - _________.__ .___ __ .__ __ _____ |
3 | | - / _____/|__| __| _/____ | | _|__| ____ | | __ / \ ____ ____ __ __ |
4 | | - \_____ \ | |/ __ |/ __ \| |/ / |/ ___\| |/ / / \ / \_/ __ \ / \| | \ |
5 | | - / \| / /_/ \ ___/| <| \ \___| < / Y \ ___/| | \ | / |
6 | | -/_______ /|__\____ |\___ >__|_ \__|\___ >__|_ \ \____|__ /\___ >___| /____/ |
7 | | - \/ \/ \/ \/ \/ \/ \/ \/ \/ |
8 | | - |
9 | | - kernel_menu264.h |
10 | | -
|
11 | | - Sidekick64 - A framework for interfacing 8-Bit Commodore computers (C64/C128,C16/Plus4,VC20) and a Raspberry Pi Zero 2 or 3A+/3B+ |
12 | | - - Sidekick Menu: ugly glue code to expose some functionality in one menu with browser |
13 | | - Copyright (c) 2019-2022 Carsten Dachsbacher <[email protected]> |
14 | | -
|
15 | | - Logo created with http://patorjk.com/software/taag/ |
16 | | - |
17 | | - This program is free software: you can redistribute it and/or modify |
18 | | - it under the terms of the GNU General Public License as published by |
19 | | - the Free Software Foundation, either version 3 of the License, or |
20 | | - (at your option) any later version. |
21 | | -
|
22 | | - This program is distributed in the hope that it will be useful, |
23 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 | | - GNU General Public License for more details. |
26 | | - |
27 | | - You should have received a copy of the GNU General Public License |
28 | | - along with this program. If not, see <http://www.gnu.org/licenses/>. |
29 | | -*/ |
30 | | -#ifndef _kernel_h |
31 | | -#define _kernel_h |
32 | | - |
33 | | -// use the OLED connected to the latch |
34 | | -#define USE_OLED |
35 | | - |
36 | | -// 0 = SSD1306 OLED 128x64 |
37 | | -// 1 = ST7789 RGB TFT 240x240 |
38 | | -extern int screenType; |
39 | | - |
40 | | -//#if defined(USE_OLED) && !defined(USE_LATCH_OUTPUT) |
41 | | -#define USE_LATCH_OUTPUT |
42 | | -//#endif |
43 | | - |
44 | | -#define USE_HDMI_VIDEO |
45 | | - |
46 | | -#include <circle/startup.h> |
47 | | -#include <circle/bcm2835.h> |
48 | | -#include <circle/memio.h> |
49 | | -#include <circle/memory.h> |
50 | | -#include <circle/koptions.h> |
51 | | -#include <circle/devicenameservice.h> |
52 | | -#include <circle/screen.h> |
53 | | -#include <circle/interrupt.h> |
54 | | -#include <circle/timer.h> |
55 | | -#include <circle/logger.h> |
56 | | -#include <circle/sched/scheduler.h> |
57 | | -#include <circle/types.h> |
58 | | -#include <circle/gpioclock.h> |
59 | | -#include <circle/gpiopin.h> |
60 | | -#include <circle/gpiopinfiq.h> |
61 | | -#include <circle/gpiomanager.h> |
62 | | -#include <circle/util.h> |
63 | | - |
64 | | -#include <SDCard/emmc.h> |
65 | | -#include <fatfs/ff.h> |
66 | | - |
67 | | -#include <stdio.h> |
68 | | - |
69 | | -#ifdef USE_VCHIQ_SOUND |
70 | | -#include <vc4/vchiq/vchiqdevice.h> |
71 | | -#include <vc4/sound/vchiqsoundbasedevice.h> |
72 | | -#endif |
73 | | - |
74 | | -#include "lowlevel_arm64.h" |
75 | | -#include "gpio_defs.h" |
76 | | -#include "latch.h" |
77 | | -#include "helpers.h" |
78 | | -#include "helpers264.h" |
79 | | -#include "crt.h" |
80 | | -#include "mygpiopinfiq.h" |
81 | | - |
82 | | -#include "oled.h" |
83 | | -#include "splash_sidekick264.h" |
84 | | -#include "tft_st7789.h" |
85 | | - |
86 | | -extern CLogger *logger; |
87 | | - |
88 | | -void startInjectCode(); |
89 | | -void injectPOKE( u32 a, u8 d ); |
90 | | - |
91 | | -class CKernelMenu |
92 | | -{ |
93 | | -public: |
94 | | - CKernelMenu( void ) |
95 | | - : m_CPUThrottle( CPUSpeedMaximum ), |
96 | | - #ifdef USE_HDMI_VIDEO |
97 | | - m_Screen( m_Options.GetWidth(), m_Options.GetHeight() ), |
98 | | - #endif |
99 | | - m_Timer( &m_Interrupt ), |
100 | | - m_Logger( m_Options.GetLogLevel(), &m_Timer ), |
101 | | -#ifdef COMPILE_MENU_WITH_SOUND |
102 | | - #ifdef USE_VCHIQ_SOUND |
103 | | - m_VCHIQ( &m_Memory, &m_Interrupt ), |
104 | | - #endif |
105 | | -#endif |
106 | | - m_InputPin( PHI2, GPIOModeInput, &m_Interrupt ), |
107 | | - m_EMMC( &m_Interrupt, &m_Timer, 0 ) |
108 | | - { |
109 | | - } |
110 | | - |
111 | | - ~CKernelMenu( void ) |
112 | | - { |
113 | | - } |
114 | | - |
115 | | - boolean Initialize( void ); |
116 | | - |
117 | | - void Run( void ); |
118 | | - |
119 | | -private: |
120 | | - static void FIQHandler( void *pParam ); |
121 | | - |
122 | | -public: |
123 | | - // do not change this order |
124 | | - CMemorySystem m_Memory; |
125 | | - CKernelOptions m_Options; |
126 | | - CDeviceNameService m_DeviceNameService; |
127 | | - CCPUThrottle m_CPUThrottle; |
128 | | -#ifdef USE_HDMI_VIDEO |
129 | | - CScreenDevice m_Screen; |
130 | | -#endif |
131 | | - CInterruptSystem m_Interrupt; |
132 | | - CTimer m_Timer; |
133 | | - CLogger m_Logger; |
134 | | - CScheduler m_Scheduler; |
135 | | -#ifdef COMPILE_MENU_WITH_SOUND |
136 | | - #ifdef USE_VCHIQ_SOUND |
137 | | - CVCHIQDevice m_VCHIQ; |
138 | | - #endif |
139 | | - CSoundBaseDevice *m_pSound; |
140 | | -#endif |
141 | | - CGPIOPinFIQ2 m_InputPin; |
142 | | - CEMMCDevice m_EMMC; |
143 | | -}; |
144 | | - |
145 | | -#endif |
| 1 | +/* |
| 2 | + _________.__ .___ __ .__ __ _____ |
| 3 | + / _____/|__| __| _/____ | | _|__| ____ | | __ / \ ____ ____ __ __ |
| 4 | + \_____ \ | |/ __ |/ __ \| |/ / |/ ___\| |/ / / \ / \_/ __ \ / \| | \ |
| 5 | + / \| / /_/ \ ___/| <| \ \___| < / Y \ ___/| | \ | / |
| 6 | +/_______ /|__\____ |\___ >__|_ \__|\___ >__|_ \ \____|__ /\___ >___| /____/ |
| 7 | + \/ \/ \/ \/ \/ \/ \/ \/ \/ |
| 8 | + |
| 9 | + kernel_menu264.h |
| 10 | +
|
| 11 | + Sidekick64 - A framework for interfacing 8-Bit Commodore computers (C64/C128,C16/Plus4,VC20) and a Raspberry Pi Zero 2 or 3A+/3B+ |
| 12 | + - Sidekick Menu: ugly glue code to expose some functionality in one menu with browser |
| 13 | + Copyright (c) 2019-2022 Carsten Dachsbacher <[email protected]> |
| 14 | +
|
| 15 | + Logo created with http://patorjk.com/software/taag/ |
| 16 | + |
| 17 | + This program is free software: you can redistribute it and/or modify |
| 18 | + it under the terms of the GNU General Public License as published by |
| 19 | + the Free Software Foundation, either version 3 of the License, or |
| 20 | + (at your option) any later version. |
| 21 | +
|
| 22 | + This program is distributed in the hope that it will be useful, |
| 23 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 24 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 25 | + GNU General Public License for more details. |
| 26 | + |
| 27 | + You should have received a copy of the GNU General Public License |
| 28 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 29 | +*/ |
| 30 | +#ifndef _kernel_h |
| 31 | +#define _kernel_h |
| 32 | + |
| 33 | +// use the OLED connected to the latch |
| 34 | +#define USE_OLED |
| 35 | + |
| 36 | +// 0 = SSD1306 OLED 128x64 |
| 37 | +// 1 = ST7789 RGB TFT 240x240 |
| 38 | +extern int screenType; |
| 39 | + |
| 40 | +//#if defined(USE_OLED) && !defined(USE_LATCH_OUTPUT) |
| 41 | +#define USE_LATCH_OUTPUT |
| 42 | +//#endif |
| 43 | + |
| 44 | +#define USE_HDMI_VIDEO |
| 45 | + |
| 46 | +#include <circle/startup.h> |
| 47 | +#include <circle/bcm2835.h> |
| 48 | +#include <circle/memio.h> |
| 49 | +#include <circle/memory.h> |
| 50 | +#include <circle/koptions.h> |
| 51 | +#include <circle/devicenameservice.h> |
| 52 | +#include <circle/screen.h> |
| 53 | +#include <circle/interrupt.h> |
| 54 | +#include <circle/timer.h> |
| 55 | +#include <circle/logger.h> |
| 56 | +#include <circle/sched/scheduler.h> |
| 57 | +#include <circle/types.h> |
| 58 | +#include <circle/gpioclock.h> |
| 59 | +#include <circle/gpiopin.h> |
| 60 | +#include <circle/gpiopinfiq.h> |
| 61 | +#include <circle/gpiomanager.h> |
| 62 | +#include <circle/util.h> |
| 63 | + |
| 64 | +#include <SDCard/emmc.h> |
| 65 | +#include <fatfs/ff.h> |
| 66 | + |
| 67 | +#include <stdio.h> |
| 68 | + |
| 69 | +#ifdef USE_VCHIQ_SOUND |
| 70 | +#include <vc4/vchiq/vchiqdevice.h> |
| 71 | +#include <vc4/sound/vchiqsoundbasedevice.h> |
| 72 | +#endif |
| 73 | +#include <circle/soundbasedevice.h> |
| 74 | +#include <circle/hdmisoundbasedevice.h> |
| 75 | + |
| 76 | +#include "lowlevel_arm64.h" |
| 77 | +#include "gpio_defs.h" |
| 78 | +#include "latch.h" |
| 79 | +#include "helpers.h" |
| 80 | +#include "helpers264.h" |
| 81 | +#include "crt.h" |
| 82 | +#include "mygpiopinfiq.h" |
| 83 | + |
| 84 | +#include "oled.h" |
| 85 | +#include "splash_sidekick264.h" |
| 86 | +#include "tft_st7789.h" |
| 87 | + |
| 88 | +extern CLogger *logger; |
| 89 | + |
| 90 | +void startInjectCode(); |
| 91 | +void injectPOKE( u32 a, u8 d ); |
| 92 | + |
| 93 | +class CKernelMenu |
| 94 | +{ |
| 95 | +public: |
| 96 | + CKernelMenu( void ) |
| 97 | + : m_CPUThrottle( CPUSpeedMaximum ), |
| 98 | + #ifdef USE_HDMI_VIDEO |
| 99 | + m_Screen( m_Options.GetWidth(), m_Options.GetHeight() ), |
| 100 | + #endif |
| 101 | + m_Timer( &m_Interrupt ), |
| 102 | + m_Logger( m_Options.GetLogLevel(), &m_Timer ), |
| 103 | +#ifdef COMPILE_MENU_WITH_SOUND |
| 104 | + #ifdef USE_VCHIQ_SOUND |
| 105 | + m_VCHIQ( &m_Memory, &m_Interrupt ), |
| 106 | + #endif |
| 107 | +#endif |
| 108 | + m_InputPin( PHI2, GPIOModeInput, &m_Interrupt ), |
| 109 | + m_EMMC( &m_Interrupt, &m_Timer, 0 ) |
| 110 | + { |
| 111 | + } |
| 112 | + |
| 113 | + ~CKernelMenu( void ) |
| 114 | + { |
| 115 | + } |
| 116 | + |
| 117 | + boolean Initialize( void ); |
| 118 | + |
| 119 | + void Run( void ); |
| 120 | + |
| 121 | +private: |
| 122 | + static void FIQHandler( void *pParam ); |
| 123 | + |
| 124 | +public: |
| 125 | + // do not change this order |
| 126 | + CMemorySystem m_Memory; |
| 127 | + CKernelOptions m_Options; |
| 128 | + CDeviceNameService m_DeviceNameService; |
| 129 | + CCPUThrottle m_CPUThrottle; |
| 130 | +#ifdef USE_HDMI_VIDEO |
| 131 | + CScreenDevice m_Screen; |
| 132 | +#endif |
| 133 | + CInterruptSystem m_Interrupt; |
| 134 | + CTimer m_Timer; |
| 135 | + CLogger m_Logger; |
| 136 | + CScheduler m_Scheduler; |
| 137 | +#ifdef COMPILE_MENU_WITH_SOUND |
| 138 | + #ifdef USE_VCHIQ_SOUND |
| 139 | + CVCHIQDevice m_VCHIQ; |
| 140 | + #endif |
| 141 | + CSoundBaseDevice *m_pSound; |
| 142 | +#endif |
| 143 | + CGPIOPinFIQ2 m_InputPin; |
| 144 | + CEMMCDevice m_EMMC; |
| 145 | +}; |
| 146 | + |
| 147 | +#endif |
0 commit comments