From b8889bf37ecffce7946917bb6291d983fcc2d0ce Mon Sep 17 00:00:00 2001 From: jede Date: Fri, 23 Oct 2020 23:47:30 +0200 Subject: [PATCH 01/12] Now getchar works --- libsrc/telestrat/read.s | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/libsrc/telestrat/read.s b/libsrc/telestrat/read.s index 76de9d0ac..0782c4d21 100644 --- a/libsrc/telestrat/read.s +++ b/libsrc/telestrat/read.s @@ -8,21 +8,33 @@ .include "zeropage.inc" .include "telestrat.inc" + .include "fcntl.inc" ;int read (int fd, void* buf, unsigned count); .proc _read - sta ptr1 ; count - stx ptr1+1 ; count - jsr popax ; get buf + sta ptr1 ; count + stx ptr1+1 ; count + jsr popax ; get buf sta PTR_READ_DEST stx PTR_READ_DEST+1 - sta ptr2 ; in order to calculate nb of bytes read + sta ptr2 ; in order to calculate nb of bytes read stx ptr2+1 ; - ; jsr popax ; fp pointer don't care in this version + jsr popax ; fp pointer don't care in this version + cpx #$00 + bne @is_not_stdin + cmp #STDIN_FILENO + bne @is_not_stdin + ; stdin +@L1: + BRK_TELEMON XRD0 ; waits until key is pressed + bcs @L1 + + rts +@is_not_stdin: lda ptr1 ; ldy ptr1+1 ; BRK_TELEMON XFREAD ; calls telemon30 routine From 02e52fe24df3fabc16c4eadb452a2839d0feefc1 Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 1 Mar 2021 22:33:12 +0100 Subject: [PATCH 02/12] Fix many bugs --- include/telestrat.h | 2 ++ libsrc/telestrat/cclear.s | 4 +-- libsrc/telestrat/chline.s | 40 +++++++++++++-------- libsrc/telestrat/clrscr.s | 27 ++++++++------- libsrc/telestrat/cputc.s | 67 ++++++++++++++++++++++++++++++------ libsrc/telestrat/gotox.s | 4 --- libsrc/telestrat/gotoxy.s | 17 +++------ libsrc/telestrat/textcolor.s | 3 +- 8 files changed, 109 insertions(+), 55 deletions(-) diff --git a/include/telestrat.h b/include/telestrat.h index a4648a3dc..5ad1d3bef 100644 --- a/include/telestrat.h +++ b/include/telestrat.h @@ -85,6 +85,8 @@ #define CH_LTEE '+' #define CH_RTEE '+' #define CH_CROSS '+' +#define CH_HLINE '-' +#define CH_VLINE '|' #define CH_CURS_UP 11 #define CH_CURS_DOWN 10 #define CH_CURS_LEFT 8 diff --git a/libsrc/telestrat/cclear.s b/libsrc/telestrat/cclear.s index a32919962..b9fce4708 100644 --- a/libsrc/telestrat/cclear.s +++ b/libsrc/telestrat/cclear.s @@ -6,7 +6,7 @@ ; .export _cclearxy, _cclear - .import update_adscr + .import update_adscr, display_conio .importzp tmp1 .import popax @@ -27,7 +27,7 @@ _cclear: @L1: stx tmp1 ; Save X lda #' ' ; Erase current char - BRK_TELEMON XFWR + jsr display_conio ldx tmp1 dex bne @L1 diff --git a/libsrc/telestrat/chline.s b/libsrc/telestrat/chline.s index 6ead10eee..91f3bdc9f 100644 --- a/libsrc/telestrat/chline.s +++ b/libsrc/telestrat/chline.s @@ -1,22 +1,34 @@ ; -; jede jede@oric.org 2018-04-17 -; - +; void chlinexy (unsigned char x, unsigned char y, unsigned char length); ; void chline (unsigned char length); ; - .export _chline + .export _chlinexy, _chline + + .import rvs, display_conio, update_adscr + .import popax + .include "telestrat.inc" - .include "zeropage.inc" -.proc _chline - sta tmp1 -@loop: - lda #'-' ; horizontal line screen code - BRK_TELEMON XWR0 ; macro send char to screen (channel 0 in telemon terms) - dec tmp1 - bne @loop - rts -.endproc +_chlinexy: + pha ; Save the length + jsr popax ; Get X and Y + sta SCRY ; Store Y + stx SCRX ; Store X + jsr update_adscr + pla ; Restore the length and run into _chline + +_chline: + tax ; Is the length zero? + beq @L9 ; Jump if done +@L1: + lda #'-' ; Horizontal line screen code + ora rvs + + jsr display_conio + +@L2: dex + bne @L1 +@L9: rts diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s index 39c2f7724..363aa2761 100644 --- a/libsrc/telestrat/clrscr.s +++ b/libsrc/telestrat/clrscr.s @@ -3,7 +3,7 @@ ; .export _clrscr - .import OLD_CHARCOLOR, OLD_BGCOLOR + .import OLD_CHARCOLOR, OLD_BGCOLOR, BGCOLOR, CHARCOLOR .include "telestrat.inc" @@ -23,22 +23,25 @@ ; reset prompt position - lda #<(SCREEN+40) - sta ADSCRL - lda #>(SCREEN+40) - sta ADSCRH + lda #<(SCREEN) + sta ADSCR + lda #>(SCREEN) + sta ADSCR+1 + + lda #$00 + sta SCRDY ; reset display position - ldx #$01 + ldx #$00 stx SCRY - dex stx SCRX - ; At this step X is equal to $00 - dex - ; At this step X is equal to $FF - stx OLD_BGCOLOR + stx OLD_BGCOLOR ; black + stx BGCOLOR + + ldx #$07 ; white stx OLD_CHARCOLOR - + stx CHARCOLOR + rts .endproc diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s index 38f8af84b..a1ab145c2 100644 --- a/libsrc/telestrat/cputc.s +++ b/libsrc/telestrat/cputc.s @@ -4,24 +4,50 @@ ; void cputc (char c); ; - .export _cputc, CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR + .export _cputc, _cputcxy, display_conio, CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR + + + .import update_adscr + .import popax .include "telestrat.inc" +_cputcxy: + pha ; Save C + jsr popax ; Get X and Y + sta SCRY ; Store Y + stx SCRX ; Store X + jsr update_adscr + pla + .proc _cputc + cmp #$0D + bne @not_CR + ldy #$00 + sty SCRX + rts +@not_CR: + cmp #$0A + bne @not_LF + + inc SCRY + jmp update_adscr + + +@not_LF: + ldx CHARCOLOR cpx OLD_CHARCOLOR beq do_not_change_color_foreground stx OLD_CHARCOLOR ; Store CHARCOLOR into OLD_CHARCOLOR - dec SCRX - dec SCRX pha txa ; Swap X to A because, X contains CHARCOLOR - BRK_TELEMON XFWR ; Change color on the screen (foreground) - inc SCRX + + jsr display_conio + pla do_not_change_color_foreground: @@ -31,18 +57,38 @@ do_not_change_color_foreground: stx OLD_BGCOLOR - dec SCRX ; Dec SCRX in order to place attribute before the right position - pha txa ; Swap X to A because, X contains BGCOLOR - ORA #%00010000 ; Add 16 because background color is an attribute between 16 and 23. 17 is red background for example - BRK_TELEMON XFWR ; Change color on the screen (background) + ora #%00010000 ; Add 16 because background color is an attribute between 16 and 23. 17 is red background for example + + jsr display_conio pla do_not_change_color: - BRK_TELEMON XFWR ; Macro send char to screen (channel 0) + ; it continues to display_conio + +.endproc + + + +.proc display_conio + ldy SCRX + sta (ADSCR),y + iny + cpy #SCREEN_XSIZE + bne @no_inc + ldy #$00 + sty SCRX + + jmp update_adscr + +@no_inc: + sty SCRX rts .endproc + + + .bss CHARCOLOR: .res 1 @@ -52,3 +98,4 @@ BGCOLOR: .res 1 OLD_BGCOLOR: .res 1 + diff --git a/libsrc/telestrat/gotox.s b/libsrc/telestrat/gotox.s index 7a172071c..72004bc0a 100644 --- a/libsrc/telestrat/gotox.s +++ b/libsrc/telestrat/gotox.s @@ -8,9 +8,5 @@ .proc _gotox sta SCRX - - lda #$FF - sta OLD_CHARCOLOR - sta OLD_BGCOLOR rts .endproc diff --git a/libsrc/telestrat/gotoxy.s b/libsrc/telestrat/gotoxy.s index 3387efe40..ea7ed5623 100644 --- a/libsrc/telestrat/gotoxy.s +++ b/libsrc/telestrat/gotoxy.s @@ -29,30 +29,23 @@ gotoxy: jsr popa ; Get Y .endproc .proc update_adscr -; Force to set again color if cursor moves -; $FF is used because we know that it's impossible to have this value with a color -; It prevents a bug : If bgcolor or textcolor is set to black for example with no char displays, -; next cputsxy will not set the attribute if y coordinate changes - lda #$FF - sta OLD_CHARCOLOR - sta OLD_BGCOLOR lda #SCREEN - sta ADSCRH + sta ADSCR+1 ldy SCRY beq out loop: - lda ADSCRL + lda ADSCR clc adc #SCREEN_XSIZE bcc skip - inc ADSCRH + inc ADSCR+1 skip: - sta ADSCRL + sta ADSCR dey bne loop out: diff --git a/libsrc/telestrat/textcolor.s b/libsrc/telestrat/textcolor.s index 7d16c9e19..d851aaaab 100644 --- a/libsrc/telestrat/textcolor.s +++ b/libsrc/telestrat/textcolor.s @@ -2,12 +2,13 @@ ; .export _textcolor - .import CHARCOLOR + .import CHARCOLOR, OLD_CHARCOLOR .include "telestrat.inc" .proc _textcolor ldx CHARCOLOR ; Get previous color sta CHARCOLOR + stx OLD_CHARCOLOR txa ; Return previous color rts .endproc From 256b22f1c7017f5f30c3e6046cf4e641825788ef Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 1 Mar 2021 22:36:09 +0100 Subject: [PATCH 03/12] Add bordercolor and cvline --- libsrc/telestrat/bordercolor.s | 15 ++++++++++++++ libsrc/telestrat/cvline.s | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 libsrc/telestrat/bordercolor.s create mode 100644 libsrc/telestrat/cvline.s diff --git a/libsrc/telestrat/bordercolor.s b/libsrc/telestrat/bordercolor.s new file mode 100644 index 000000000..7055e6ba9 --- /dev/null +++ b/libsrc/telestrat/bordercolor.s @@ -0,0 +1,15 @@ +; +; Ullrich von Bassewitz, 06.08.1998 +; +; unsigned char __fastcall__ bordercolor (unsigned char color); +; + + + .export _bordercolor + + .include "telestrat.inc" + +_bordercolor: + ; Nothing to do + ; Oric can't handle his border + rts \ No newline at end of file diff --git a/libsrc/telestrat/cvline.s b/libsrc/telestrat/cvline.s new file mode 100644 index 000000000..159eb9d27 --- /dev/null +++ b/libsrc/telestrat/cvline.s @@ -0,0 +1,36 @@ +; +; Ullrich von Bassewitz, 2003-04-13 +; +; void cvlinexy (unsigned char x, unsigned char y, unsigned char length); +; void cvline (unsigned char length); +; + + .export _cvlinexy, _cvline + + .import rvs, display_conio, update_adscr + + .import popax + + .include "telestrat.inc" + + +_cvlinexy: + pha ; Save the length + jsr popax ; Get X and Y + sta SCRY ; Store Y + stx SCRX ; Store X + jsr update_adscr + pla ; Restore the length and run into _cvline + +_cvline: + tax ; Is the length zero? + beq @L9 ; Jump if done +@L1: + lda #'|' + ora rvs + jsr display_conio +@L2: dex + bne @L1 +@L9: rts + + From 8ec6d28f92d50703f365fac57fa4b95d12f39c74 Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 1 Mar 2021 22:44:06 +0100 Subject: [PATCH 04/12] Revert read.s --- libsrc/telestrat/read.s | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/libsrc/telestrat/read.s b/libsrc/telestrat/read.s index 0782c4d21..76de9d0ac 100644 --- a/libsrc/telestrat/read.s +++ b/libsrc/telestrat/read.s @@ -8,33 +8,21 @@ .include "zeropage.inc" .include "telestrat.inc" - .include "fcntl.inc" ;int read (int fd, void* buf, unsigned count); .proc _read - sta ptr1 ; count - stx ptr1+1 ; count - jsr popax ; get buf + sta ptr1 ; count + stx ptr1+1 ; count + jsr popax ; get buf sta PTR_READ_DEST stx PTR_READ_DEST+1 - sta ptr2 ; in order to calculate nb of bytes read + sta ptr2 ; in order to calculate nb of bytes read stx ptr2+1 ; - jsr popax ; fp pointer don't care in this version - cpx #$00 - bne @is_not_stdin - cmp #STDIN_FILENO - bne @is_not_stdin - ; stdin -@L1: - BRK_TELEMON XRD0 ; waits until key is pressed - bcs @L1 - - rts + ; jsr popax ; fp pointer don't care in this version -@is_not_stdin: lda ptr1 ; ldy ptr1+1 ; BRK_TELEMON XFREAD ; calls telemon30 routine From abef6566e7feaac9287a75b2a3bc177dc7fa3c3f Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 1 Mar 2021 22:45:05 +0100 Subject: [PATCH 05/12] Add revers.s --- libsrc/telestrat/revers.s | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 libsrc/telestrat/revers.s diff --git a/libsrc/telestrat/revers.s b/libsrc/telestrat/revers.s new file mode 100644 index 000000000..ad3e1f909 --- /dev/null +++ b/libsrc/telestrat/revers.s @@ -0,0 +1,37 @@ +; +; Ullrich von Bassewitz, 07.08.1998 +; +; unsigned char revers (unsigned char onoff); +; + + .export _revers + .export rvs + +; ------------------------------------------------------------------------ +; + +.code +.proc _revers + + ldx #$00 ; Assume revers off + tay ; Test onoff + beq L1 ; Jump if off + ldx #$80 ; Load on value + ldy #$00 ; Assume old value is zero +L1: lda rvs ; Load old value + stx rvs ; Set new value + beq L2 ; Jump if old value zero + iny ; Make old value = 1 +L2: ldx #$00 ; Load high byte of result + tya ; Load low byte, set CC + rts + +.endproc + +; ------------------------------------------------------------------------ +; + +.bss +rvs: .res 1 + + From 185c4510005f974980a4725d03c097b0c5d244f5 Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 1 Mar 2021 23:19:30 +0100 Subject: [PATCH 06/12] Fix cputdirect --- libsrc/telestrat/cputc.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s index a1ab145c2..f7bf5e2b6 100644 --- a/libsrc/telestrat/cputc.s +++ b/libsrc/telestrat/cputc.s @@ -4,7 +4,7 @@ ; void cputc (char c); ; - .export _cputc, _cputcxy, display_conio, CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR + .export _cputc, _cputcxy, cputdirect, display_conio, CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR .import update_adscr @@ -12,6 +12,7 @@ .include "telestrat.inc" +cputdirect: _cputcxy: pha ; Save C jsr popax ; Get X and Y @@ -69,9 +70,8 @@ do_not_change_color: .endproc - - .proc display_conio + ; This routine is used to displays char on screen ldy SCRX sta (ADSCR),y iny From cdbe23c351658d2e2f874ee8dfcbb70e87ebc6f3 Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 1 Mar 2021 23:21:58 +0100 Subject: [PATCH 07/12] Fix missing new line in bordercolr --- libsrc/telestrat/bordercolor.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/telestrat/bordercolor.s b/libsrc/telestrat/bordercolor.s index 7055e6ba9..9e49b057f 100644 --- a/libsrc/telestrat/bordercolor.s +++ b/libsrc/telestrat/bordercolor.s @@ -12,4 +12,5 @@ _bordercolor: ; Nothing to do ; Oric can't handle his border - rts \ No newline at end of file + rts + From 872739b5f4d9c91137f49f6a99f27493b6b72bc1 Mon Sep 17 00:00:00 2001 From: jede Date: Wed, 3 Mar 2021 22:14:29 +0100 Subject: [PATCH 08/12] Fix comments, return line and bordercolor return --- include/telestrat.h | 6 ++++++ libsrc/telestrat/bordercolor.s | 5 +---- libsrc/telestrat/clrscr.s | 8 ++++---- libsrc/telestrat/cputc.s | 15 ++++++--------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/telestrat.h b/include/telestrat.h index 5ad1d3bef..465517f30 100644 --- a/include/telestrat.h +++ b/include/telestrat.h @@ -121,3 +121,9 @@ void shoot(); void explode(); void kbdclick1(); + +/* The following #defines will cause the matching functions calls in conio.h +** to be overlaid by macros with the same names, saving the function call +** overhead. +*/ +#define _bordercolor(color) COLOR_BLACK diff --git a/libsrc/telestrat/bordercolor.s b/libsrc/telestrat/bordercolor.s index 9e49b057f..84e167bc9 100644 --- a/libsrc/telestrat/bordercolor.s +++ b/libsrc/telestrat/bordercolor.s @@ -9,8 +9,5 @@ .include "telestrat.inc" -_bordercolor: - ; Nothing to do - ; Oric can't handle his border - rts +_bordercolor := return0 diff --git a/libsrc/telestrat/clrscr.s b/libsrc/telestrat/clrscr.s index 363aa2761..c02c26647 100644 --- a/libsrc/telestrat/clrscr.s +++ b/libsrc/telestrat/clrscr.s @@ -23,9 +23,9 @@ ; reset prompt position - lda #<(SCREEN) + lda #(SCREEN) + lda #>SCREEN sta ADSCR+1 lda #$00 @@ -36,10 +36,10 @@ stx SCRY stx SCRX - stx OLD_BGCOLOR ; black + stx OLD_BGCOLOR ; Black stx BGCOLOR - ldx #$07 ; white + ldx #$07 ; White stx OLD_CHARCOLOR stx CHARCOLOR diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s index aa756aaf5..994a2b9d4 100644 --- a/libsrc/telestrat/cputc.s +++ b/libsrc/telestrat/cputc.s @@ -4,7 +4,8 @@ ; void cputc (char c); ; - .export _cputc, _cputcxy, cputdirect, display_conio, CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR + .export _cputc, _cputcxy, cputdirect, display_conio + .export CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR .import update_adscr @@ -14,10 +15,10 @@ cputdirect: _cputcxy: - pha ; Save C - jsr popax ; Get X and Y - sta SCRY ; Store Y - stx SCRX ; Store X + pha ; Save C + jsr popax ; Get X and Y + sta SCRY ; Store Y + stx SCRX ; Store X jsr update_adscr pla @@ -34,9 +35,7 @@ _cputcxy: inc SCRY jmp update_adscr - @not_LF: - ldx CHARCOLOR cpx OLD_CHARCOLOR beq do_not_change_color_foreground @@ -87,8 +86,6 @@ do_not_change_color: rts .endproc - - .bss CHARCOLOR: .res 1 From 48badc081679a19bec9ad6edbc1b39f36fd50e79 Mon Sep 17 00:00:00 2001 From: jede Date: Sat, 6 Mar 2021 21:40:26 +0100 Subject: [PATCH 09/12] Fix import return0 --- libsrc/telestrat/bordercolor.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/telestrat/bordercolor.s b/libsrc/telestrat/bordercolor.s index 84e167bc9..c29ecc0e7 100644 --- a/libsrc/telestrat/bordercolor.s +++ b/libsrc/telestrat/bordercolor.s @@ -4,9 +4,10 @@ ; unsigned char __fastcall__ bordercolor (unsigned char color); ; - .export _bordercolor + .import return0 + .include "telestrat.inc" _bordercolor := return0 From df64fd859c7477ebd7d0ed8b377c84b0510e5e77 Mon Sep 17 00:00:00 2001 From: jede Date: Sun, 7 Mar 2021 23:00:15 +0100 Subject: [PATCH 10/12] Fix cvline bug --- libsrc/telestrat/cvline.s | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsrc/telestrat/cvline.s b/libsrc/telestrat/cvline.s index 159eb9d27..0d6086216 100644 --- a/libsrc/telestrat/cvline.s +++ b/libsrc/telestrat/cvline.s @@ -28,7 +28,11 @@ _cvline: @L1: lda #'|' ora rvs - jsr display_conio + ldy SCRX + sta (ADSCR),y + ; compute next line + inc SCRY + jsr update_adscr @L2: dex bne @L1 @L9: rts From facc1b4914425baee3019035189b29beca649cb5 Mon Sep 17 00:00:00 2001 From: jede Date: Mon, 8 Mar 2021 21:16:44 +0100 Subject: [PATCH 11/12] Fix cputdirect --- libsrc/telestrat/cputc.s | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s index 994a2b9d4..6049d1174 100644 --- a/libsrc/telestrat/cputc.s +++ b/libsrc/telestrat/cputc.s @@ -6,14 +6,13 @@ .export _cputc, _cputcxy, cputdirect, display_conio .export CHARCOLOR, OLD_CHARCOLOR, BGCOLOR, OLD_BGCOLOR - .import update_adscr .import popax .include "telestrat.inc" -cputdirect: + _cputcxy: pha ; Save C jsr popax ; Get X and Y @@ -22,7 +21,7 @@ _cputcxy: jsr update_adscr pla -.proc _cputc +_cputc: cmp #$0D bne @not_CR ldy #$00 @@ -30,12 +29,13 @@ _cputcxy: rts @not_CR: cmp #$0A - bne @not_LF + bne not_LF inc SCRY jmp update_adscr -@not_LF: +cputdirect: +not_LF: ldx CHARCOLOR cpx OLD_CHARCOLOR beq do_not_change_color_foreground @@ -67,7 +67,7 @@ do_not_change_color_foreground: do_not_change_color: ; it continues to display_conio -.endproc + .proc display_conio ; This routine is used to displays char on screen From a05dddd0d6ac759eee695d54a8ef2632e6220108 Mon Sep 17 00:00:00 2001 From: jede Date: Tue, 9 Mar 2021 22:02:26 +0100 Subject: [PATCH 12/12] Fix next column --- libsrc/telestrat/cputc.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsrc/telestrat/cputc.s b/libsrc/telestrat/cputc.s index 6049d1174..16b13f8cd 100644 --- a/libsrc/telestrat/cputc.s +++ b/libsrc/telestrat/cputc.s @@ -78,6 +78,8 @@ do_not_change_color: bne @no_inc ldy #$00 sty SCRX + + inc SCRY jmp update_adscr