Giter Club home page Giter Club logo

msx-vi's Introduction

MSX-vi

A vi text editor clone for the MSX 8-bit home computer.

Description

MSX-vi is a clone of the vi text editor for the MSX computer.

MSX is a 8-bit computer system created in 1983 by Microsoft and ASCII Corporation. It was very popular in Japan, some European countries, Korea and Brazil. Although it's not widely used nowadays, it still has a great number of enthusiasts creating hardware and software for the platform.

Vi is a text editor originally created for the Unix operating system. It became very popular and today there are many different clones available on multiple platforms.

Minimum requirements

  • MSX2 computer (or emulator)
  • MSX-DOS2

History

My passion for technology started when my parents gave me as a present my first computer. I was 9 years old and the computer was a MSX. At the beginning I was using it just to play games, but I started learning programming by myself (first Logo and Basic later). Nowadays I still enjoy playing with MSX and trying to learn better how it works internally.

Thanks to Javi Lavandeira's tutorials Relearning MSX on how to program with C for the MSX, I started writing my first programs and tests, and I started to have the idea on writing a vi clone. As far as I know there is nothing similar on the MSX.

I started writing code, but a text editor is way more complex than it looks. Memory management was very difficult for my limited C knowledge. At the end I abandoned the project.

Few months later I discovered the Build Your Own Text Editor tutorial. It is a step by step guide on how to write Antirez's kilo text editor. I started reading it and I decided to try again writing the vi clone for MSX.

Download

Online Emulator

Try it online:

Note: In some keyboards, the : key doesn't work in WebMSX.

Screenshots

MSX-vi welcome screen

MSX-vi editing large file

Supported commands

Exiting and saving

  • :q: Exit the editor as long there are no changes
  • :q!: Exit the editor without saving any changes
  • :w: Save changes to current file
  • :w filename: Save changes to filename
  • :wq: Save changes to current file and exit

Movement

  • ESC: Enter command mode
  • CONTROL d: Move one page down
  • CONTROL u: Move one page up
  • h: Move left
  • j: Move down
  • k: Move up
  • l: Move right
  • 0: Move to the begining of the line
  • $: Move to the end of the line
  • H: Go to top of the screen
  • M: Go to middle of the screen
  • L: Go to bottom of the screen
  • gg: Go to the beginning of the file
  • G: Go to the end of the file
  • w: Move to next word
  • b: Move to previous word
  • e: Move to the end of the word
  • :N: Go to line N

Deleting text

  • dd: Delete current line
  • d0: Delete until the beginning of the line
  • d$: Delete until the end of the line
  • dG: Delete ultil the end of the file
  • x: Delete a single character
  • X: Delete a single character to the left of cursor

Inserting text

  • r: Replace current character
  • a: Enter insert mode after the cursor
  • A: Enter insert mode after the current line
  • i: Enter insert mode at the cursor
  • I: Enter insert mode before the current line
  • o: Insert a new line after the current one
  • O: Insert a new line before the current one

Search

  • /string: Search forward for string
  • ?string: Search backards for string
  • n: Search next ocurrence (forward)
  • N: Search next ocurrence (backards)

Other commands

  • :color fg bg bd: Changes the screen colors
  • CONTROL l: Refresh screen

Compile requirements

  • SDCC 3.5.0 (it doesn't work with newer versions)
  • GNU make
  • openMSX (for testing)

msx-vi's People

Contributors

fr3nd avatar plainspooky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msx-vi's Issues

Since the screen is high resolution, the text is too small to read on MSX0.

MSX0 is the latest MSX machine that is being made popular through crowdfunding.
However, the included keyboard has a small number of keys, and there is no Ctrl key, so commands such as saving files and ending editing cannot be executed.
The msx-vi you developed is suitable for such MSX0.
We can edit with fewer keys.

However, there is one problem.
The MSX0 is so small that the text is too small to read on high-resolution screens. Can't you create a lower resolution screen version of msx-vi with larger characters?

https://japan.postsen.com/business/46628/The-legendary-8-bit-MSX-personal-computer-is-revived-with-MSX0-Stack-and-it-becomes-a-computer-for-IoT-%E2%80%93-CAMPFIRE-campfire.html

Compile errors

Hi, what sdcc version do you use to compile msx-vi? When I try it on my macbook with v3.7.0 I get lots of errors/warnings.

19:30:42 [:~/msx-vi] master ± make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../utils/Hex2bin-1.0.12
gcc -O2 -Wall -o hex2bin hex2bin.c
gcc -O2 -Wall -o mot2bin mot2bin.c
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C include
sdasz80 -o crt0msx_msxdos.s
sdasz80 -o crt0msx_msxdos_advanced.s
sdasz80 -o dos2.s
sdasz80 -o getchar.s
sdasz80 -o heap.s
sdasz80 -o iolib.s
sdasz80 -o ioport.s
sdasz80 -o keyboard.s
sdasz80 -o putchar.s
sdasz80 -o vdp.s
sdcc -mz80 -c -o conio.rel conio.c
sdcc -mz80 -c -o mem.rel mem.c
sdcc --code-loc 0x0178 --data-loc 0 --disable-warning 196 -mz80 --no-std-crt0 -Iinclude include/crt0msx_msxdos_advanced.rel include/heap.rel include/iolib.rel vi.c
vi.c:269: error 98: conflict with previous declaration of 'getchar' for attribute 'type' at /usr/local/bin/../share/sdcc/include/stdio.h:85
from type 'int function ( ) fixed'
to type 'unsigned-char function ( ) fixed'
vi.c:283: error 98: conflict with previous declaration of 'putchar' for attribute 'type' at /usr/local/bin/../share/sdcc/include/stdio.h:86
from type 'int function ( int fixed) fixed'
to type 'void function ( unsigned-char fixed) fixed'
vi.c:1318: warning 94: comparison is always false due to limited range of data type
vi.c:1320: warning 94: comparison is always false due to limited range of data type
vi.c:1327: warning 94: comparison is always false due to limited range of data type
make[1]: *** [vi.ihx] Error 1
make: *** [all] Error 2

When I fix the putchar and getchar with int instead of char I get even more errors/warnings:

19:33:44 [:~/msx-vi] master* ± make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../utils/Hex2bin-1.0.12
make[2]: Nothing to be done for 'all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C include
make[2]: Nothing to be done for 'all'.
sdcc --code-loc 0x0178 --data-loc 0 --disable-warning 196 -mz80 --no-std-crt0 -Iinclude include/crt0msx_msxdos_advanced.rel include/heap.rel include/iolib.rel vi.c
vi.c:1318: warning 94: comparison is always false due to limited range of data type
vi.c:1320: warning 94: comparison is always false due to limited range of data type
vi.c:1327: warning 94: comparison is always false due to limited range of data type
vi.c:1308: warning 94: comparison is always true resp. false due to limited range of data type
vi.c:1308: warning 94: comparison is always true resp. false due to limited range of data type
vi.c:1308: warning 94: comparison is always true resp. false due to limited range of data type
vi.c:1319: warning 126: unreachable code
vi.c:1319: warning 126: unreachable code
vi.c:1319: warning 126: unreachable code
vi.c:1319: warning 126: unreachable code
vi.c:1319: warning 126: unreachable code
vi.c:1319: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1321: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1322: warning 126: unreachable code
vi.c:1308: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
vi.c:1308: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
vi.c:1308: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
vi.c:1313: warning 126: unreachable code
vi.c:1314: warning 126: unreachable code
vi.c:1326: warning 126: unreachable code
vi.c:1327: warning 126: unreachable code
vi.c:1385: warning 158: overflow in implicit constant conversion
vi.c:1388: warning 158: overflow in implicit constant conversion
vi.c:1419: warning 158: overflow in implicit constant conversion
vi.c:1434: warning 158: overflow in implicit constant conversion
vi.c:1471: warning 158: overflow in implicit constant conversion
vi.c:1511: warning 158: overflow in implicit constant conversion
vi.c:1607: warning 94: comparison is always true resp. false due to limited range of data type
vi.c:1607: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
used unbound variable in replacement

?ASlink-Warning-Undefined Global '__sdcc_heap_init' referenced by module ''
make[1]: *** [vi.ihx] Error 1
rm vi.ihx
make: *** [all] Error 2

First time I compile something with sdcc, only used msx-c before :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.