

Folco (./89) :
Potential bug in sld.asm, ExtractFileFromPack : unexpected behavior if HLock destroys (sp).w
move.w (sp),-(sp) // ROM_THROW HLock // addq.l #2,sp would solve that

Folco (./92) :
Of course, but I have reported that because it's part of sld.asm, which is shared with PreOS. ^^

PpHd (./64) :
Bug found: performing twice 'echo Hello > toto | ls' produce a 'Protected Memory' error.

Folco (./98) :
Did you fix the problem with the 'install tib' command ?
Folco (./98) :
- Nevertheless, I get a 'command' error when detecting the device

Folco (./98) :
- I can browse folders, but I don't see vars.

Folco (./98) :
- Always nothing displayed, I get first one 'format' error, then Ti-Connect throws its error, then I get a 'reset' error. I will retry using link debug info.
Folco (./100) :
When using 'install tib', must I use a fsigned ROM and fflash ? I think no ? The provided TIB should be right to be transfered ?
Lionel Debroux (./102) :
I've just noticed that ExtGraph's demo33, which tests DrawClipLine and the equivalent ExtGraph routine, when run under PedroM, corrupts the screen and the heap (and everything in-between), before crashing, which triggers a full reset (<= corrupted heap).
The lines in the top-left quarter of the screen are fine, the crashes happens when drawing the vertical line (or perhaps, the first line of the top-right quarter of the screen).

#define NO_EXIT_SUPPORT
#define OPTIMIZE_ROM_CALLS
#define NO_CALC_DETECT
#define NO_AMS_CHECK
#define MIN_AMS 100
#include <tigcclib.h>
#include "../../lib/extgraph.h" // NOTE: this path is just for this demo !!
// if the extgraph library is correctly
// installed you should use:
//
// #include <extgraph.h>
#define INITIAL_TIMER_VALUE (100000*20UL)
/*===========================================================================*/
/* main routine: where all the fun starts ... */
/*===========================================================================*/
void _main(void) {
short i,j;
unsigned long measure_val;
char tmpstr[50] = "Measuring, please wait ...";
static const short modes[4] = {COLOR_LIGHTGRAY,COLOR_DARKGRAY,COLOR_BLACK,COLOR_WHITE};
unsigned short clippedcoord[4];
LCD_BUFFER screen;
LCD_save(screen);
OSFreeTimer(USER_TIMER);
OSRegisterTimer(USER_TIMER,INITIAL_TIMER_VALUE);
if (!GrayOn()) goto end;
//---------------------------------------------------------------------
// built-in OS line drawing routine ...
//---------------------------------------------------------------------
GrayClearScreen_R();
OSTimerRestart(USER_TIMER);
for (j=0;j<4;j++) {
short used_color = modes[j];
for (i=-40; i<280;i++) GrayDrawClipLine(120,64,i,-40,used_color); // Crashes here.
for (i=-40; i<168;i++) GrayDrawClipLine(120,64,280,i,used_color);
for (i=280;i>=-40; i--) GrayDrawClipLine(120,64,i,168,used_color);
for (i=168;i>=-40; i--) GrayDrawClipLine(120,64,-40,i,used_color);
}
measure_val = OSTimerCurVal(USER_TIMER);
sprintf(tmpstr,"OS routine took %lu ticks",INITIAL_TIMER_VALUE-measure_val);
GrayDrawRect(0,0,239,7,COLOR_WHITE,RECT_FILLED);
GrayDrawStrExt(0,0,tmpstr,A_NORMAL | A_CENTERED | A_SHADOWED,F_4x6);
if (ngetchx() == KEY_ESC) goto end;
//---------------------------------------------------------------------
// new line drawing routine ...
//---------------------------------------------------------------------
GrayClearScreen_R();
OSTimerRestart(USER_TIMER);
for (j=0;j<4;j++) {
short used_color = modes[j];
for (i=-40; i<280;i++) GrayClipDrawLine_R(120,64,i,-40,clippedcoord,used_color,GrayGetPlane(LIGHT_PLANE),GrayGetPlane(DARK_PLANE),GrayFastDrawLine2B_R);
for (i=-40; i<280;i++) GrayClipDrawLine_R(120,64,280,i,clippedcoord,used_color,GrayGetPlane(LIGHT_PLANE),GrayGetPlane(DARK_PLANE),GrayFastDrawLine2B_R);
for (i=280;i>=-40; i--) GrayClipDrawLine_R(120,64,i,168,clippedcoord,used_color,GrayGetPlane(LIGHT_PLANE),GrayGetPlane(DARK_PLANE),GrayFastDrawLine2B_R);
for (i=168;i>=-40; i--) GrayClipDrawLine_R(120,64,-40,i,clippedcoord,used_color,GrayGetPlane(LIGHT_PLANE),GrayGetPlane(DARK_PLANE),GrayFastDrawLine2B_R);
}
measure_val = OSTimerCurVal(USER_TIMER);
sprintf(tmpstr,"Own routine took %lu ticks",INITIAL_TIMER_VALUE-measure_val);
GrayDrawRect(0,0,239,7,COLOR_WHITE,RECT_FILLED);
GrayDrawStrExt(0,0,tmpstr,A_NORMAL | A_CENTERED | A_SHADOWED,F_4x6);
if (ngetchx() == KEY_ESC) goto end;
GrayOff();
ClrScr();
//---------------------------------------------------------------------
// built-in OS line drawing routine ...
//---------------------------------------------------------------------
OSTimerRestart(USER_TIMER);
for (j=0;j<4;j++) {
WIN_RECT rect = {120, 64, 0, -40};
for (i=-40; i<280;i++) {rect.x1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }
for (i=-40; i<168;i++) {rect.y1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }
for (i=280;i>=-40; i--) {rect.x1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }
for (i=168;i>=-40; i--) {rect.y1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }
}
measure_val = OSTimerCurVal(USER_TIMER);
sprintf(tmpstr,"OS routine took %lu ticks",INITIAL_TIMER_VALUE-measure_val);
GrayDrawRect2B(0,0,239,7,COLOR_WHITE,RECT_FILLED,LCD_MEM,LCD_MEM);
GrayDrawStrExt2B(0,0,tmpstr,A_NORMAL | A_CENTERED,F_4x6,LCD_MEM,LCD_MEM);
if (ngetchx() == KEY_ESC) goto end;
//---------------------------------------------------------------------
// new line drawing routine ...
//---------------------------------------------------------------------
ClrScr();
OSTimerRestart(USER_TIMER);
for (j=0;j<4;j++) {
for (i=-40; i<280;i++) ClipDrawLine_R(120,64,i,-40,clippedcoord,A_XOR,LCD_MEM,FastDrawLine_R);
for (i=-40; i<280;i++) ClipDrawLine_R(120,64,280,i,clippedcoord,A_XOR,LCD_MEM,FastDrawLine_R);
for (i=280;i>=-40; i--) ClipDrawLine_R(120,64,i,168,clippedcoord,A_XOR,LCD_MEM,FastDrawLine_R);
for (i=168;i>=-40; i--) ClipDrawLine_R(120,64,-40,i,clippedcoord,A_XOR,LCD_MEM,FastDrawLine_R);
}
measure_val = OSTimerCurVal(USER_TIMER);
sprintf(tmpstr,"Own routine took %lu ticks",INITIAL_TIMER_VALUE-measure_val);
GrayDrawRect2B(0,0,239,7,COLOR_WHITE,RECT_FILLED,LCD_MEM,LCD_MEM);
GrayDrawStrExt2B(0,0,tmpstr,A_NORMAL | A_CENTERED,F_4x6,LCD_MEM,LCD_MEM);
ngetchx();
end:
OSFreeTimer(USER_TIMER);
GrayOff();
LCD_restore(screen);
GKeyFlush();
ST_helpMsg(EXTGRAPH_VERSION_PWDSTR);
}
for (i=-40; i<280;i++) GrayDrawClipLine(120,64,i,-40,used_color);
for (i=-40; i<168;i++) {if (i >= 13) GrayDrawClipLine(120,64,280,i,used_color);}
for (i=280;i>=-40; i--) GrayDrawClipLine(120,64,i,168,used_color);
for (i=168;i>=-40; i--) GrayDrawClipLine(120,64,-40,i,used_color);
for (i=-40; i<280;i++) {rect.x1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }
for (i=-40; i<168;i++) if (i >= 13) {rect.y1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }
for (i=280;i>=-40; i--) {rect.x1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }
for (i=168;i>=-40; i--) {rect.y1 = i; DrawClipLine(&rect,&(SCR_RECT){{0, 0, 239, 127}},A_XOR); }

--- a/src/c/clipline.c
+++ b/src/c/clipline.c
@@ -55,7 +55,7 @@ typedef union {
swap(y1,y2); \
dx = -dx; \
} \
- if ((x1 > Clip.Right) || (x2 < Clip.Left) || (y1 > Clip.Down) || (y2 < Clip.Up)) \
+ if ((x1 > Clip.Right) || (x2 < Clip.Left) || (y1 > Clip.Down && y2 > Clip.Down ) || (y2 < Clip.Up && y1 < Clip.Up)) \
return; \
dy = y2 - y1; \
if (dx == 0) \
@@ -111,42 +111,41 @@ typedef union {
} \
} \
else { \
- dy = - dy; \
if (x1 < Clip.Left) \
{ \
- if ((y1 > Clip.Down) && ((t = x1 + dx *(y1-Clip.Down)/dy) >= Clip.Left)) \
+ if ((y1 > Clip.Down) && ((t = x1 + dx *(Clip.Down-y1)/dy) >= Clip.Left)) \
{ \
x1 = t; \
y1 = Clip.Down; \
if (x1 > Clip.Right) return; \
} \
else { \
- y1 += dy * (Clip.Left-x1) / dx; \
+ y1 = y1 + dy * (Clip.Left-x1) / dx; \
x1 = Clip.Left; \
if (y1 < Clip.Up) return; \
} \
} \
else if (y1 > Clip.Down) \
{ \
- x1 += dx * (y1-Clip.Down) / dy; \
+ x1 = x1 + dx * (Clip.Down-y1) / dy; \
y1 = Clip.Down; \
if (x1 > Clip.Right) return; \
} \
if (x2 > Clip.Right) \
{ \
- if ((y2 < Clip.Up) && ((t = x2 - dx*(Clip.Up-y2)/dy) <= Clip.Right)) \
+ if ((y2 < Clip.Up) && ((t = x2 + dx*(Clip.Up-y2)/dy) <= Clip.Right)) \
{ \
x2 = t; \
y2 = Clip.Up; \
} \
else { \
- y2 -= dy * (x2-Clip.Right) / dx; \
+ y2 = y2 + dy * (Clip.Right-x2) / dx; \
x2 = Clip.Right; \
} \
} \
else if (y2 < Clip.Up) \
{ \
- x2 -= dx * (Clip.Up-y2) / dy; \
+ x2 = x2 + dx * (Clip.Up-y2) / dy; \
y2 = Clip.Up; \
} \
} \
@@ -165,5 +164,7 @@ void DrawClipLine (const WIN_RECT *Line, const SCR_RECT *clip, short Attr)
Clip.Right = clip->xy.x1;
Clip.Down = clip->xy.y1;
ClipLine(x1, y1, x2, y2);
+ //if (x1 < 0 || x2 >239 || y1 < 0 || y1 > 127 || y2 < 0 || y2 > 127)
+ // asm ("toto: bra toto\n");
DrawLine(x1,y1,x2,y2,Attr);
}
Lionel Debroux (./107) :
NOTE: you could make the ClipLine macro of src/c/clipline.c several bytes smaller (and several clocks faster), by using inline assembly for the "swap" macro: #define ASM_EXCHANGE(val1,val2) asm volatile ("exg %0,%1" : "=da" (val1),"=da" (val2) : "0" (val1),"1" (val2) : "cc")
Lionel Debroux (./107) :
In the src folder, `make CAS=1` works, but `make` doesn't, due to an undefined reference on the following line:
xdef Zs_function_call
Moving this line down by one line, under the
ifd USE_MAIN_PROGRAM conditional section, should fix the problem.
I dont like mixing specific asm code with C (moreover, the clipline macro is quite generic) but thanks for the advice.
(Moreover what really costs is the multiplication and the division).
PpHd (./64) :Fixed
Bug found: performing twice 'echo Hello > toto | ls' produce a 'Protected Memory' error.
Folco (./113) :
When I use this command, I get a "?". Ok, I send the tib with TiLP, then the "?" is replaced by a bold "o" and a death's head.[ON] reset the calc.

Folco (./115) :
Ah ?!?I though that sending a TIB after having typed the command would upgrade the calc. But using that, TiLP doesn't start to send. Could someone test, or explain me what I don't know how to use this command ?
Folco (./117) :
I'm still getting troubles with TiLP when sending a file to the PC (timeout). It could depend on file size, I will try to do a test case.
Folco (./117) :
In the shell, the cursor seems to be always 5 pixels above the top of the line, so it's in the middle of the line with system\font set at "1" or "2"


