Added EDINSERT, EDREMOVE, EDLEFT, EDRIGHT, EDUP, EDDOWN command line editor commands. Fixed compile issues in debug mode, updated project file to build in debug mode.

This commit is contained in:
claudiol 2018-08-29 19:02:38 -04:00
parent eb6a4dbd27
commit 04ddc26ddf
4 changed files with 187 additions and 7 deletions

View file

@ -40,7 +40,7 @@ void __ex_hline(int y)
yptr[0]=yptr[1]=yptr[2]=yptr[3]=yptr[4]=0xaaaaaaaa;
}
inline int __ex_width(char *string) { return StringWidth(string,(UNIFONT *)Font_6A); }
#define __ex_width(string) StringWidth((string),(UNIFONT *)Font_6A)
// GET HIGH REGISTERS R8 TO R14 + CPSR (8 WORDS)

View file

@ -701,8 +701,6 @@ void usb_ep0_receive(int newtransmission)
void inline usb_checkpipe()
{
if( (*EP0_CSR) & EP0_SETUP_END) {

View file

@ -7,7 +7,14 @@
TARGET = newrplfw.elf
TEMPLATE = app
CONFIG(release, debug|release) {
CONFIG = static ordered
}
CONFIG(debug, debug|release) {
CONFIG = debug static ordered
}
DEFINES += TARGET_50G NDEBUG "NEWRPL_BUILDNUM=$$system(git rev-list --count HEAD)"
@ -310,13 +317,12 @@ QMAKE_CXX = arm-none-eabi-g++
QMAKE_LINK = arm-none-eabi-gcc
#QMAKE_AR_CMD = arm-none-eabi-ar -cqs $(TARGET) $(OBJECTS)
#QMAKE_AR_CMD = arm-none-eabi-ld --verbose -T$$PWD/firmware/ld.script -nodefaultlibs -nostdlib -L$$GCC_LIBDIR $(OBJECTS) -lgcc -o $(TARGET).elf
QMAKE_CFLAGS_DEBUG =
QMAKE_CFLAGS_RELEASE =
QMAKE_CFLAGS_DEBUG = -g -mtune=arm920t -mcpu=arm920t -mlittle-endian -fomit-frame-pointer -fno-toplevel-reorder -msoft-float -Og -pipe -mthumb-interwork -nostdinc
QMAKE_CFLAGS_RELEASE = -g -mtune=arm920t -mcpu=arm920t -mlittle-endian -fomit-frame-pointer -fno-toplevel-reorder -msoft-float -O2 -pipe -mthumb-interwork -nostdinc
QMAKE_CFLAGS_SHLIB =
QMAKE_CFLAGS_MT =
QMAKE_CFLAGS_MT_DBG =
QMAKE_CFLAGS_THREAD =
QMAKE_CFLAGS = -g -mtune=arm920t -mcpu=arm920t -mlittle-endian -fomit-frame-pointer -fno-toplevel-reorder -msoft-float -O2 -pipe -mthumb-interwork -nostdinc
QMAKE_CFLAGS_APP =
QMAKE_LFLAGS_DEBUG =

View file

@ -40,7 +40,16 @@
CMD(KEYEVAL,MKTOKENINFO(7,TITYPE_NOTALLOWED,1,2)), \
CMD(KEY,MKTOKENINFO(3,TITYPE_NOTALLOWED,1,2)), \
CMD(DOFORM,MKTOKENINFO(6,TITYPE_NOTALLOWED,1,2)), \
CMD(EDINSERT,MKTOKENINFO(8,TITYPE_NOTALLOWED,2,2))
CMD(EDINSERT,MKTOKENINFO(8,TITYPE_NOTALLOWED,2,2)), \
CMD(EDREMOVE,MKTOKENINFO(6,TITYPE_NOTALLOWED,1,2)), \
CMD(EDLEFT,MKTOKENINFO(6,TITYPE_NOTALLOWED,1,2)), \
CMD(EDRIGHT,MKTOKENINFO(7,TITYPE_NOTALLOWED,1,2)), \
CMD(EDUP,MKTOKENINFO(4,TITYPE_NOTALLOWED,1,2)), \
CMD(EDDOWN,MKTOKENINFO(6,TITYPE_NOTALLOWED,1,2)), \
CMD(EDSTART,MKTOKENINFO(7,TITYPE_NOTALLOWED,1,2)), \
CMD(EDEND,MKTOKENINFO(5,TITYPE_NOTALLOWED,1,2))
// ADD MORE OPCODES HERE
@ -413,10 +422,177 @@ case EDINSERT:
}
case EDREMOVE:
{
//@SHORT_DESC=Remove characters in the editor at the cursor position
//@NEW
if(rplDepthData()<1) {
rplError(ERR_BADARGCOUNT);
return;
}
if(!ISNUMBER(*rplPeekData(1))) {
rplError(ERR_STRINGEXPECTED);
return;
}
if(!(halGetContext()&CONTEXT_INEDITOR)) return; // DO NOTHING UNLESS AN EDITOR IS OPEN
BINT64 nchars=rplReadNumberAsBINT(rplPeekData(1));
if(Exceptions) return;
uiRemoveCharacters(nchars);
rplDropData(1);
return;
}
case EDLEFT:
{
//@SHORT_DESC=Move cursor to the left in the editor
//@NEW
if(rplDepthData()<1) {
rplError(ERR_BADARGCOUNT);
return;
}
if(!ISNUMBER(*rplPeekData(1))) {
rplError(ERR_STRINGEXPECTED);
return;
}
if(!(halGetContext()&CONTEXT_INEDITOR)) return; // DO NOTHING UNLESS AN EDITOR IS OPEN
BINT64 nchars=rplReadNumberAsBINT(rplPeekData(1));
if(Exceptions) return;
uiCursorLeft(nchars);
rplDropData(1);
return;
}
case EDRIGHT:
{
//@SHORT_DESC=Move cursor to the right in the editor
//@NEW
if(rplDepthData()<1) {
rplError(ERR_BADARGCOUNT);
return;
}
if(!ISNUMBER(*rplPeekData(1))) {
rplError(ERR_STRINGEXPECTED);
return;
}
if(!(halGetContext()&CONTEXT_INEDITOR)) return; // DO NOTHING UNLESS AN EDITOR IS OPEN
BINT64 nchars=rplReadNumberAsBINT(rplPeekData(1));
if(Exceptions) return;
uiCursorRight(nchars);
rplDropData(1);
return;
}
case EDUP:
{
//@SHORT_DESC=Move cursor up in the editor
//@NEW
if(rplDepthData()<1) {
rplError(ERR_BADARGCOUNT);
return;
}
if(!ISNUMBER(*rplPeekData(1))) {
rplError(ERR_STRINGEXPECTED);
return;
}
if(!(halGetContext()&CONTEXT_INEDITOR)) return; // DO NOTHING UNLESS AN EDITOR IS OPEN
BINT64 nchars=rplReadNumberAsBINT(rplPeekData(1));
if(Exceptions) return;
uiCursorUp(nchars);
rplDropData(1);
return;
}
case EDDOWN:
{
//@SHORT_DESC=Move cursor down in the editor
//@NEW
if(rplDepthData()<1) {
rplError(ERR_BADARGCOUNT);
return;
}
if(!ISNUMBER(*rplPeekData(1))) {
rplError(ERR_STRINGEXPECTED);
return;
}
if(!(halGetContext()&CONTEXT_INEDITOR)) return; // DO NOTHING UNLESS AN EDITOR IS OPEN
BINT64 nchars=rplReadNumberAsBINT(rplPeekData(1));
if(Exceptions) return;
uiCursorDown(nchars);
rplDropData(1);
return;
}
case EDSTART:
{
//@SHORT_DESC=Move cursor to the start of current line in the editor
//@NEW
if(!(halGetContext()&CONTEXT_INEDITOR)) return; // DO NOTHING UNLESS AN EDITOR IS OPEN
uiCursorStartOfLine();
return;
}
case EDEND:
{
//@SHORT_DESC=Move cursor to the end of current line in the editor
//@NEW
if(!(halGetContext()&CONTEXT_INEDITOR)) return; // DO NOTHING UNLESS AN EDITOR IS OPEN
uiCursorEndOfLine();
return;
}