Working Hello World example
This commit is contained in:
143
CMakeLists.txt
143
CMakeLists.txt
@@ -14,83 +14,80 @@ add_compile_options(-Wall
|
||||
-Wno-maybe-uninitialized
|
||||
)
|
||||
|
||||
add_library(picovga STATIC)
|
||||
set(PICOVGA_PATH ${CMAKE_CURRENT_LIST_DIR}/src)
|
||||
|
||||
pico_generate_pio_header(picovga ${CMAKE_CURRENT_LIST_DIR}/src/vga.pio)
|
||||
# pico_generate_pio_header(picovga ${CMAKE_CURRENT_LIST_DIR}/terminal/bus6502.pio)
|
||||
macro(add_picovga project)
|
||||
pico_generate_pio_header(${project} ${PICOVGA_PATH}/vga.pio)
|
||||
|
||||
target_sources(picovga PRIVATE
|
||||
src/render/vga_atext.S
|
||||
src/render/vga_attrib8.S
|
||||
src/render/vga_color.S
|
||||
src/render/vga_ctext.S
|
||||
src/render/vga_dtext.S
|
||||
src/render/vga_fastsprite.S
|
||||
src/render/vga_ftext.S
|
||||
src/render/vga_graph1.S
|
||||
src/render/vga_graph2.S
|
||||
src/render/vga_graph4.S
|
||||
src/render/vga_graph8.S
|
||||
src/render/vga_graph8mat.S
|
||||
src/render/vga_graph8persp.S
|
||||
src/render/vga_gtext.S
|
||||
src/render/vga_level.S
|
||||
src/render/vga_levelgrad.S
|
||||
src/render/vga_mtext.S
|
||||
src/render/vga_oscil.S
|
||||
src/render/vga_oscline.S
|
||||
src/render/vga_persp.S
|
||||
src/render/vga_persp2.S
|
||||
src/render/vga_plane2.S
|
||||
src/render/vga_progress.S
|
||||
src/render/vga_sprite.S
|
||||
src/render/vga_tile.S
|
||||
src/render/vga_tile2.S
|
||||
src/render/vga_tilepersp.S
|
||||
src/render/vga_tilepersp15.S
|
||||
src/render/vga_tilepersp2.S
|
||||
src/render/vga_tilepersp3.S
|
||||
src/render/vga_tilepersp4.S
|
||||
src/vga_blitkey.S
|
||||
src/vga_render.S
|
||||
target_sources(${project} PRIVATE
|
||||
${PICOVGA_PATH}/render/vga_atext.S
|
||||
${PICOVGA_PATH}/render/vga_attrib8.S
|
||||
${PICOVGA_PATH}/render/vga_color.S
|
||||
${PICOVGA_PATH}/render/vga_ctext.S
|
||||
${PICOVGA_PATH}/render/vga_dtext.S
|
||||
${PICOVGA_PATH}/render/vga_fastsprite.S
|
||||
${PICOVGA_PATH}/render/vga_ftext.S
|
||||
${PICOVGA_PATH}/render/vga_graph1.S
|
||||
${PICOVGA_PATH}/render/vga_graph2.S
|
||||
${PICOVGA_PATH}/render/vga_graph4.S
|
||||
${PICOVGA_PATH}/render/vga_graph8.S
|
||||
${PICOVGA_PATH}/render/vga_graph8mat.S
|
||||
${PICOVGA_PATH}/render/vga_graph8persp.S
|
||||
${PICOVGA_PATH}/render/vga_gtext.S
|
||||
${PICOVGA_PATH}/render/vga_level.S
|
||||
${PICOVGA_PATH}/render/vga_levelgrad.S
|
||||
${PICOVGA_PATH}/render/vga_mtext.S
|
||||
${PICOVGA_PATH}/render/vga_oscil.S
|
||||
${PICOVGA_PATH}/render/vga_oscline.S
|
||||
${PICOVGA_PATH}/render/vga_persp.S
|
||||
${PICOVGA_PATH}/render/vga_persp2.S
|
||||
${PICOVGA_PATH}/render/vga_plane2.S
|
||||
${PICOVGA_PATH}/render/vga_progress.S
|
||||
${PICOVGA_PATH}/render/vga_sprite.S
|
||||
${PICOVGA_PATH}/render/vga_tile.S
|
||||
${PICOVGA_PATH}/render/vga_tile2.S
|
||||
${PICOVGA_PATH}/render/vga_tilepersp.S
|
||||
${PICOVGA_PATH}/render/vga_tilepersp15.S
|
||||
${PICOVGA_PATH}/render/vga_tilepersp2.S
|
||||
${PICOVGA_PATH}/render/vga_tilepersp3.S
|
||||
${PICOVGA_PATH}/render/vga_tilepersp4.S
|
||||
${PICOVGA_PATH}/vga_blitkey.S
|
||||
${PICOVGA_PATH}/vga_render.S
|
||||
|
||||
src/vga.cpp
|
||||
src/vga_layer.cpp
|
||||
src/vga_pal.cpp
|
||||
src/vga_screen.cpp
|
||||
src/vga_util.cpp
|
||||
src/vga_vmode.cpp
|
||||
src/util/canvas.cpp
|
||||
src/util/mat2d.cpp
|
||||
src/util/overclock.cpp
|
||||
src/util/print.cpp
|
||||
src/util/rand.cpp
|
||||
src/util/pwmsnd.cpp
|
||||
src/font/font_bold_8x8.cpp
|
||||
src/font/font_bold_8x14.cpp
|
||||
src/font/font_bold_8x16.cpp
|
||||
src/font/font_boldB_8x14.cpp
|
||||
src/font/font_boldB_8x16.cpp
|
||||
src/font/font_game_8x8.cpp
|
||||
src/font/font_ibm_8x8.cpp
|
||||
src/font/font_ibm_8x14.cpp
|
||||
src/font/font_ibm_8x16.cpp
|
||||
src/font/font_ibmtiny_8x8.cpp
|
||||
src/font/font_italic_8x8.cpp
|
||||
src/font/font_thin_8x8.cpp
|
||||
|
||||
terminal/bus6502.cpp
|
||||
terminal/console.cpp
|
||||
terminal/main.cpp
|
||||
terminal/usbhid.cpp
|
||||
terminal/terminal.cpp
|
||||
)
|
||||
${PICOVGA_PATH}/vga.cpp
|
||||
${PICOVGA_PATH}/vga_layer.cpp
|
||||
${PICOVGA_PATH}/vga_pal.cpp
|
||||
${PICOVGA_PATH}/vga_screen.cpp
|
||||
${PICOVGA_PATH}/vga_util.cpp
|
||||
${PICOVGA_PATH}/vga_vmode.cpp
|
||||
${PICOVGA_PATH}/util/canvas.cpp
|
||||
${PICOVGA_PATH}/util/mat2d.cpp
|
||||
${PICOVGA_PATH}/util/overclock.cpp
|
||||
${PICOVGA_PATH}/util/print.cpp
|
||||
${PICOVGA_PATH}/util/rand.cpp
|
||||
${PICOVGA_PATH}/util/pwmsnd.cpp
|
||||
${PICOVGA_PATH}/font/font_bold_8x8.cpp
|
||||
${PICOVGA_PATH}/font/font_bold_8x14.cpp
|
||||
${PICOVGA_PATH}/font/font_bold_8x16.cpp
|
||||
${PICOVGA_PATH}/font/font_boldB_8x14.cpp
|
||||
${PICOVGA_PATH}/font/font_boldB_8x16.cpp
|
||||
${PICOVGA_PATH}/font/font_game_8x8.cpp
|
||||
${PICOVGA_PATH}/font/font_ibm_8x8.cpp
|
||||
${PICOVGA_PATH}/font/font_ibm_8x14.cpp
|
||||
${PICOVGA_PATH}/font/font_ibm_8x16.cpp
|
||||
${PICOVGA_PATH}/font/font_ibmtiny_8x8.cpp
|
||||
${PICOVGA_PATH}/font/font_italic_8x8.cpp
|
||||
${PICOVGA_PATH}/font/font_thin_8x8.cpp
|
||||
)
|
||||
|
||||
target_include_directories(picovga PRIVATE terminal)
|
||||
target_link_libraries(${project} pico_stdlib hardware_pio hardware_dma pico_multicore hardware_interp hardware_pwm)
|
||||
|
||||
target_link_libraries(picovga pico_stdlib hardware_pio hardware_dma pico_multicore hardware_interp hardware_pwm tinyusb_board tinyusb_host)
|
||||
include_directories(${project} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endmacro()
|
||||
|
||||
pico_enable_stdio_usb(picovga 0)
|
||||
pico_enable_stdio_uart(picovga 0)
|
||||
add_subdirectory(examples)
|
||||
|
||||
pico_add_extra_outputs(picovga)
|
||||
#pico_enable_stdio_usb(picovga 0)
|
||||
#pico_enable_stdio_uart(picovga 0)
|
||||
|
||||
#pico_add_extra_outputs(picovga)
|
||||
|
||||
1
examples/CMakeLists.txt
Normal file
1
examples/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(vga_hello)
|
||||
@@ -9,8 +9,7 @@
|
||||
// Includes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "../../global.h" // global common definitions
|
||||
#include "../vga.pio.h" // VGA PIO compilation
|
||||
#include "../../../global.h" // global common definitions
|
||||
|
||||
// main
|
||||
#include "main.h" // main code
|
||||
|
||||
16
examples/vga_hello/CMakeLists.txt
Normal file
16
examples/vga_hello/CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
add_executable(vga_hello
|
||||
src/main.cpp
|
||||
)
|
||||
|
||||
add_picovga(vga_hello)
|
||||
|
||||
# pull in common dependencies
|
||||
#target_link_libraries(vga_hello pico_stdlib)
|
||||
|
||||
# for vga_config.h include
|
||||
target_include_directories(vga_hello PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/src
|
||||
)
|
||||
|
||||
# create map/bin/hex file etc.
|
||||
pico_add_extra_outputs(vga_hello)
|
||||
@@ -9,8 +9,7 @@
|
||||
// Includes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "../../global.h" // global common definitions
|
||||
#include "../vga.pio.h" // VGA PIO compilation
|
||||
#include "../../../global.h" // global common definitions
|
||||
|
||||
// main
|
||||
#include "main.h" // main code
|
||||
|
||||
56
global.h
56
global.h
@@ -186,15 +186,15 @@ extern const ALIGNED u8 FontThin8x8[2048];
|
||||
#include "hardware/structs/xip_ctrl.h"
|
||||
#include "hardware/structs/xosc.h"
|
||||
|
||||
#include "hardware/adc.h"
|
||||
//#include "hardware/adc.h"
|
||||
#include "hardware/address_mapped.h"
|
||||
#include "hardware/claim.h"
|
||||
#include "hardware/clocks.h"
|
||||
#include "hardware/divider.h"
|
||||
#include "hardware/dma.h"
|
||||
#include "hardware/flash.h"
|
||||
//#include "hardware/flash.h"
|
||||
#include "hardware/gpio.h"
|
||||
#include "hardware/i2c.h"
|
||||
//#include "hardware/i2c.h"
|
||||
#include "hardware/interp.h"
|
||||
#include "hardware/irq.h"
|
||||
#include "hardware/pio.h"
|
||||
@@ -203,8 +203,8 @@ extern const ALIGNED u8 FontThin8x8[2048];
|
||||
#include "hardware/pll.h"
|
||||
#include "hardware/pwm.h"
|
||||
#include "hardware/resets.h"
|
||||
#include "hardware/rtc.h"
|
||||
#include "hardware/spi.h"
|
||||
//#include "hardware/rtc.h"
|
||||
//#include "hardware/spi.h"
|
||||
#include "hardware/sync.h"
|
||||
#include "hardware/timer.h"
|
||||
#include "hardware/uart.h"
|
||||
@@ -212,11 +212,11 @@ extern const ALIGNED u8 FontThin8x8[2048];
|
||||
#include "hardware/watchdog.h"
|
||||
#include "hardware/xosc.h"
|
||||
|
||||
#include "boot/picoboot.h"
|
||||
#include "boot/uf2.h"
|
||||
//#include "boot/picoboot.h"
|
||||
//#include "boot/uf2.h"
|
||||
|
||||
#include "pico.h"
|
||||
#include "tusb_config.h"
|
||||
//#include "pico.h"
|
||||
//#include "tusb_config.h"
|
||||
|
||||
#include "pico/assert.h"
|
||||
#include "pico/binary_info.h"
|
||||
@@ -232,7 +232,7 @@ extern const ALIGNED u8 FontThin8x8[2048];
|
||||
#include "pico/int64_ops.h"
|
||||
#include "pico/lock_core.h"
|
||||
#include "pico/malloc.h"
|
||||
#include "pico/mem_ops.h"
|
||||
//#include "pico/mem_ops.h"
|
||||
#include "pico/multicore.h"
|
||||
#include "pico/mutex.h"
|
||||
#include "pico/platform.h"
|
||||
@@ -240,15 +240,15 @@ extern const ALIGNED u8 FontThin8x8[2048];
|
||||
#include "pico/runtime.h"
|
||||
#include "pico/sem.h"
|
||||
#include "pico/stdio.h"
|
||||
#include "pico/stdio_semihosting.h"
|
||||
#include "pico/stdio_uart.h"
|
||||
#include "pico/stdio_usb.h"
|
||||
//#include "pico/stdio_semihosting.h"
|
||||
//#include "pico/stdio_uart.h"
|
||||
//#include "pico/stdio_usb.h"
|
||||
#include "pico/stdlib.h"
|
||||
#include "pico/sync.h"
|
||||
#include "pico/time.h"
|
||||
#include "pico/timeout_helper.h"
|
||||
#include "pico/types.h"
|
||||
#include "pico/unique_id.h"
|
||||
//#include "pico/unique_id.h"
|
||||
#include "pico/version.h"
|
||||
|
||||
#include "pico/binary_info/code.h"
|
||||
@@ -257,7 +257,7 @@ extern const ALIGNED u8 FontThin8x8[2048];
|
||||
|
||||
#include "pico/bootrom/sf_table.h"
|
||||
|
||||
#include "pico/fix/rp2040_usb_device_enumeration.h"
|
||||
//#include "pico/fix/rp2040_usb_device_enumeration.h"
|
||||
|
||||
#include "pico/stdio/driver.h"
|
||||
|
||||
@@ -266,16 +266,16 @@ extern const ALIGNED u8 FontThin8x8[2048];
|
||||
#include "pico/util/queue.h"
|
||||
|
||||
// PicoVGA includes
|
||||
#include "_picovga/define.h" // common definitions of C and ASM
|
||||
#include "_picovga/util/canvas.h" // canvas
|
||||
#include "_picovga/util/overclock.h" // overclock
|
||||
#include "_picovga/util/print.h" // print to attribute text buffer
|
||||
#include "_picovga/util/rand.h" // random number generator
|
||||
#include "_picovga/util/mat2d.h" // 2D transformation matrix
|
||||
#include "_picovga/util/pwmsnd.h" // PWM sound output
|
||||
#include "_picovga/vga_pal.h" // VGA colors and palettes
|
||||
#include "_picovga/vga_vmode.h" // VGA videomodes
|
||||
#include "_picovga/vga_layer.h" // VGA layers
|
||||
#include "_picovga/vga_screen.h" // VGA screen layout
|
||||
#include "_picovga/vga_util.h" // VGA utilities
|
||||
#include "_picovga/vga.h" // VGA output
|
||||
#include "src/define.h" // common definitions of C and ASM
|
||||
#include "src/util/canvas.h" // canvas
|
||||
#include "src/util/overclock.h" // overclock
|
||||
#include "src/util/print.h" // print to attribute text buffer
|
||||
#include "src/util/rand.h" // random number generator
|
||||
#include "src/util/mat2d.h" // 2D transformation matrix
|
||||
#include "src/util/pwmsnd.h" // PWM sound output
|
||||
#include "src/vga_pal.h" // VGA colors and palettes
|
||||
#include "src/vga_vmode.h" // VGA videomodes
|
||||
#include "src/vga_layer.h" // VGA layers
|
||||
#include "src/vga_screen.h" // VGA screen layout
|
||||
#include "src/vga_util.h" // VGA utilities
|
||||
#include "src/vga.h" // VGA output
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// ****************************************************************************
|
||||
|
||||
#include "include.h"
|
||||
#include "vga.pio.h"
|
||||
|
||||
// scanline type
|
||||
u8 ScanlineType[MAXLINE];
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// ****************************************************************************
|
||||
|
||||
#include "include.h"
|
||||
#include "vga.pio.h"
|
||||
|
||||
// layer program descriptors
|
||||
const sLayerProg LayerProg[LAYERPROG_NUM] = {
|
||||
|
||||
Reference in New Issue
Block a user