FIX for 149 bug "unstable IRCC" - please merge this patch to SVN

Applications development, KoOS API questions
  • Aha, good that you sent a reminder!
    It seems quite obvious to me today that if there are two non-printable characters in a row, code is stuck in an endless loop here:

    Code: Select all

    ;-------------------------------------------
    ; Count characters until 0, 10, 13 or 3 byte
    
            push    edx
            xor     esi, esi
            dec     esi
      .next_char:
            inc     esi
            cmp     esi, [textbox_width]
            je      .cnt_done
            mov     al, byte[edx]
            cmp     al, 13
            jbe     .cnt_done
    
            inc     edx
            test    al, 10000000b
            jz      .next_char              ; 1 byte wide
    
            add     edx, 3
            and     al, 11111000b
            cmp     al, 11110000b
            je      .next_char              ; 4 bytes wide
    
            dec     edx
            and     al, 11110000b
            cmp     al, 11100000b
            je      .next_char              ; 3 bytes wide
            dec     edx                     ; 2 bytes wide
            jmp     .next_char
      .cnt_done:
            mov     eax, edx
            pop     edx
            push    eax
            mcall   4                       ; draw text
            pop     edx                     ; next start ptr
            
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • Please try like this instead:

    (inc edx moved up)

    Code: Select all

    ;-------------------------------------------
    ; Count characters until 0, 10, 13 or 3 byte
    
            push    edx
            xor     esi, esi
            dec     esi
      .next_char:
            inc     esi
            cmp     esi, [textbox_width]
            je      .cnt_done
            mov     al, byte[edx]
            
            inc     edx
                    
            cmp     al, 13
            jbe     .cnt_done
    
            test    al, 10000000b
            jz      .next_char              ; 1 byte wide
    
            add     edx, 3
            and     al, 11111000b
            cmp     al, 11110000b
            je      .next_char              ; 4 bytes wide
    
            dec     edx
            and     al, 11110000b
            cmp     al, 11100000b
            je      .next_char              ; 3 bytes wide
            dec     edx                     ; 2 bytes wide
            jmp     .next_char
      .cnt_done:
            mov     eax, edx
            pop     edx
            push    eax
            mcall   4                       ; draw text
            pop     edx                     ; next start ptr
    
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • hidnplayr wrote: Sun Feb 18, 2024 9:49 pmPlease try like this instead:
    Thank you so much for coming! :D Unfortunately, with this change - regardless of whether my "fix" patch above is applied - IRCC crashes at launch: the program's window instantly disappears after appearing. To reproduce this quickly - you may use my new Vigenere floppy from this post: http://board.kolibrios.org/viewtopic.php?p=80204#p80204 (this Vigenere patch touches only 4 files and doesn't change textbox.inc, so the experience should be the same). This floppy has the modified source code of IRCC with all the external dependencies included, so after unpacking the /sys/Ircc/ircc_r9977_vigenere.7z you can just double-click IRCC.ASM to open it in Tinypad and then Run

    P.S. sorry that it takes me so long to reply to your e-mail :oops: , really wanted to update my IRCC mod before replying
  • Actually works on my computer this time :)
    ircc.7z (29.85 KiB)
    Downloaded 289 times
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • hidnplayr wrote: Mon Feb 19, 2024 11:41 pmActually works on my computer this time :)
    Thank you, it works fine for me too now ;-) Btw it seems that only 7z archives packed with -m0=Deflate are supported in Kolibri
  • Committed in #9978
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • Who is online

    Users browsing this forum: No registered users and 1 guest