Skip to content

Commit

Permalink
[#53] PropWare-ify VGA code
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZemon committed Apr 9, 2016
1 parent 3ac2b9f commit e60288b
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 355 deletions.
32 changes: 18 additions & 14 deletions Examples/PropWare_VGAText/VGAText_Demo.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
#include <PropWare/hmi/output/video/vgatext.h>
#include <PropWare/hmi/output/printer.h>

int main() {
PropWare::VGAText Text;
int i;
PropWare::VGAText vgaText;
PropWare::Printer vgaPrinter(vgaText);
vgaText.start(8);

Text.start(8);
Text.str("\r VGA Text Demo...\r\r\x0C\x05 OBJ and VAR require only 5.0KB \x0C\x01");
for (i = 0; i < 14; i++) {
Text.out(' ');
}
for (i = 0x0E; i <= 0xFF; i++) {
Text.out(i);
}
Text.str("\x0C\x06 Uses internal ROM font \x0C\x02");
for (;;) {
Text.str("\x0A\x0C\x0B\x0E");
Text.hex(i++, 8);
vgaPrinter << "\r VGA Text Demo...\r\r\x0C\x05 OBJ and VAR require only 5.0KB \x0C\x01";

for (char i = 0; i < 14; i++)
vgaPrinter << ' ';

for (char i = 0x0E; i <= 0xFF; i++)
vgaPrinter << i;

vgaPrinter << "\x0C\x06 Uses internal ROM font \x0C\x02";

uint16_t i = 0xFF;
while (1) {
vgaPrinter << "\x0A\x0C\x0B\x0E";
vgaPrinter.printf("0x04X ", i++);
}
}
1 change: 0 additions & 1 deletion PropWare/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ set(PROPWARE_SOURCES
${CMAKE_CURRENT_LIST_DIR}/hmi/output/synchronousprinter.cpp
${CMAKE_CURRENT_LIST_DIR}/hmi/output/synchronousprinter.h
${CMAKE_CURRENT_LIST_DIR}/hmi/output/ws2812.h
${CMAKE_CURRENT_LIST_DIR}/hmi/output/video/vgatext.cpp
${CMAKE_CURRENT_LIST_DIR}/hmi/output/video/vgatext.h
${CMAKE_CURRENT_LIST_DIR}/hmi/output/video/vga.h
${CMAKE_CURRENT_LIST_DIR}/hmi/output/video/vga_driver.S
Expand Down
31 changes: 25 additions & 6 deletions PropWare/hmi/output/video/vga.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
/**
* ***************************************
* * VGA Driver v1.1 *
* * Author: Chip Gracey *
* * Copyright (c) 2006 Parallax, Inc. *
* * See end of file for terms of use. *
* ***************************************
* @file vga.h
* @author Chip Gracey
*
* @copyright
* The MIT License (MIT)<br>
* <br>Copyright (c) 2006 Parallax, Inc.<br>
* <br>Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:<br>
* <br>The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.<br>
* <br>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* v1.0 - 01 May 2006 - original version
* v1.1 - 15 May 2006 - pixel tile size can now be 16 x 32 to enable more efficient
* character displays utilizing the internal font - see 'vga_mode'
Expand All @@ -21,6 +37,9 @@ extern int _VGADriverStartCog (void *arg);

namespace PropWare {

/**
* VGA Driver v1.1
*/
class VGA {
public:
/*
Expand Down
231 changes: 0 additions & 231 deletions PropWare/hmi/output/video/vgatext.cpp

This file was deleted.

Loading

0 comments on commit e60288b

Please sign in to comment.