Close
0%
0%

Native-C PIC32 color video on TV

Native C language environment with the color video system. including a text editor, compiler, linker, assembler. It likes RetroBSD.

Similar projects worth following
Native C compiler (smaller C) with Color text TV system. Under a tiny memory, it is difficult to link libraries, so library such print, filesystem is located on the flash memory and call via function-table.
Library for Color Video system is using the library for MachiKania. User application area is 60 KB/64KB entire memory of RAM(excluded files and stack).
Note that this system can be worked under KENKEN's application bootloader; self-programmer. You can run this application on MachiKania Game Board.

Target: PIC32MX270F256B(or PIC32MX170F256B)

User Application area
- Flash(internal storage, future upgrade area):80KB/256KB
- RAM 60KB/64kB

Native C compiler (smaller C) with Color text TV system. Under a tiny memory, libraries are hard to link, so library such print, filesystem is on the flash and call from function-table. PS/2 keyboard(US, Japanese) can be used.

Library for Color Video system is using the library for MachiKania(japanese). User application area is 60 KB/64KB entire memory of RAM(excluded files and stack).

Note that this system can be worked under KENKEN's application bootloader(japanese); self-programmer. You can run this application on MachiKania Game Board.

No process and no swapper. Only single application at same time. Because of small memory, we provide following build-in and other applications. (other application is a.out format)

  • build-in:

     cc, smlrc, ld, as, sh (tiny shell)

  • other application:

     editor, ls, cd(No ps) and other applications. 

Demo (tetris, edit→compile→run)

Source code

more detail (japanese)

What I can do with this system?

You can develop some program such TETRIS(japanese), other games within memory.(upto 60kB) Development system on board applications written in C. Library for these application is provided by OS, function-table. (not library, function call from RAM to flash). so, U can use entire memory to these applications. (But not secure ; ). Video system has two mode, Text mode and graphic mode(4bit color,256x224). Grapgics uses large area of RAM(28KB). Maybe we should use PCG for some drawing. It's much smaller than graphics mode. (required 2KB of RAM for user font definition)

text editor
text editor
shell
shell (cc; c compiler front end, a.out execution and force termination)
graphic mode
graphic mode demo (video player)

Schematic (same to MachiKania, Basic system.)

Schematic
Schematic

Get started

Download SD card files (at Files) and unzip files into your SD card. At bootloader, select smlrc.hex (if you had already boot another application, keep pressing any push button and reset the board. Then, we can see the boot menu. Then, select smlrc.hex. Once boot this system, no further more step is needed whatever you reboot this system.)

text editor (forked from machikania)

  • C-z undo
  • Shift-<Arrow keys> select region (region is limited to screen size because of poor memory...)
  • C-x cut
  • C-c copy
  • functions of F1-F4  is printed on screen.

compile sequence.

two way to compile your application.

  • using c compiler front end.

    cc <source file list> [-o <outfile> the default is a.out] [-c] [-S] [-p(do not stop video system.)]

  •  step by step compilation.

    smlrc <source> <output asm>

    as <asm list> <object>

    ld <objects> [-o <outfile the default is a.out>]

See also

MachiKania(japanese); JIT BASIC system. You can switch to MachiKania, BASIC system using bootloader.

Thanks

This system is shrinked from RetroBSD.(build-in build tool chain) FatFS for file system module. umm-malloc for memory allocation system. Other modules including source tree, plz refer souce code.

Lisence

This system using library of MachiKania; provided under LGPL, so binary of this system is provided under LGPL, but source code is provided under each license. please refer source code more detail.

sd_files_20180108.zip

SD card files. copy these file to SD card.

Zip Archive - 34.45 MB - 01/08/2018 at 10:43

Download

  • connect with ws2812; LED strips

    Gombe07/08/2018 at 01:28 0 comments

    ws2812 is an RGB LED which has individually included LED controller.

    Each LEDs can be controlled one by one using serial signal.


    I made a signal using an OC module and DMA and output an Audio port to the LED strip.

    Read more »

  • 2048, puzzle game

    Gombe01/14/2018 at 00:41 0 comments

    2048
    2048 a puzzle game

    2048(wikipedia) 

    is a kind of puzzle games, famous for smartphone applications. It is simple but difficult. forked from https://github.com/mevdschee/2048.c

    Text mode has characor color. But this text video system is not supported background color for each charactors. So I put colored space instead of white space.

  • Add Graphic mode

    Gombe01/06/2018 at 11:30 0 comments

    Graphic mode is comming soon! This mode is very important to develop graphics games. Size of GRAM is about 29KB. Screen size is 256x224. 4bit-color surported. (dynamic palette)

    Or you can use PCG (see TETRIS for example..).

    This is demo of Graphic mode.(Video player)

    This sample also incluing audio player. This `MachiKania Game Board` incluing audio output, I use OC module for PWM and DMA to generate audio signal. DMA stands for Dinamic Memory Access. 32K sampling per seconds, 8bit 1ch.

    Double buffering memory is not enough(lack of RAM), so bottom of screen is fricking ; )

View all 3 project logs

  • 1
    compiler for chipkit needed.

    this system using compiler for chipkit.

View all instructions

Enjoy this project?

Share

Discussions

panyk.team wrote 02/17/2018 at 14:08 point

Hi, I like so much your project! Yet is possible ho have it in MPLAB X project version?

Thanks for the answer!

Bye

  Are you sure? yes | no

Gombe wrote 02/20/2018 at 22:24 point

I'm afraid so.

This system is no longer supported XC32 compiler because XC32 compiler free edition has limited optimization. If you would like to compile, use a chipKIT compiler. (Download from https://github.com/jasonkajita/chipKIT-cxx/downloads)
If you would like to debug, make MPLAB X IDE prebuild project, and load elf file.

Regard.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates