SCROLL and MCODER II

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
bola_dor
Posts: 398
Joined: Wed Oct 02, 2019 5:32 am

SCROLL and MCODER II

Post by bola_dor »

I am working on a game with a vertical classic SCROLL. and adapting it to be compiled with MCODER II.
even when MCII documentation states that SCROLL is treted as in BASIC every time a SCROLL is found it stops with an inverted [?] and waits for a key ading a wite line.. ressult is disastrous to the game...
I think I missed something in the documentation or I´ll need to use some MC SCROLL routine that I don´t have or call the ROM SCROLL routine wich I don´t know either....
Ernesto
ZX80 USA, ZX81UK, ZX Spectrum, ZX Spectrum+, ZX Spectrum 128+ UK, ZX Spectrum +2/A, Sinclair QL, CZ1000, CZ1500, CZ2000, CZ1000Plus, CZ1500Plus, CZ Spectrum, CZ Spectrum Plus, TK83, TK85, TK90X, TK95. TS2068. And more to come :D
bola_dor
Posts: 398
Joined: Wed Oct 02, 2019 5:32 am

Re: SCROLL and MCODER II

Post by bola_dor »

bola_dor wrote: Mon Sep 21, 2020 3:36 am I am working on a game with a vertical classic SCROLL. and adapting it to be compiled with MCODER II.
even when MCII documentation states that SCROLL is treted as in BASIC every time a SCROLL is found it stops with an inverted [?] and waits for a key ading a wite line.. ressult is disastrous to the game...
I think I missed something in the documentation or I´ll need to use some MC SCROLL routine that I don´t have or call the ROM SCROLL routine wich I don´t know either....
this is embarrassing but I'll answer myself.
perhaps this will be usefull for another one..

SCROLL is kind of "automatic" under MCODER II when PRINT reaches the bottom edge. So, you don,t need a SCROLL statement, it will up scroll without asking for n times, by default n=0, so it will ask!.. but you can poke 16417 with the amount of lines you want... in my case I just replaced any scroll line with POKE 16417,1 as the game is printing al line 21.
Ernesto
ZX80 USA, ZX81UK, ZX Spectrum, ZX Spectrum+, ZX Spectrum 128+ UK, ZX Spectrum +2/A, Sinclair QL, CZ1000, CZ1500, CZ2000, CZ1000Plus, CZ1500Plus, CZ Spectrum, CZ Spectrum Plus, TK83, TK85, TK90X, TK95. TS2068. And more to come :D
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: SCROLL and MCODER II

Post by XavSnap »

1 REM [HEX:\
2A,0C,40,EB,2A,0C,40,01,\
21,00,09,01,F7,02,ED,B0,\
01,1F,00,ED,42,EB,23,36,\
00,0B,ED,B0,C9 ]

2 CLS
4 POKE 16418,0
5 FOR A=0 TO 24
6 PRINT AT 23,A;"*HELLO*"
7 RAND USR 16514
8 NEXT A
9 GOTO 5
10 SAVE"SCROLL"
20 RUN
;------- TASM ASM mnemonics. -------
; Compile this file using:
; Set TASMOPTS = -b
; tasm -80 ThisCode.tas MyBinary.BIN
;-----------------------------------
; Zx81 Program name: VB81 XuR

#include ZX81.sym

#define ORG .org ; TASM cross-assembler definitions
#define equ .equ
;-----------------------------------

;------- Rom and Ram Symbols -------
RAM_D_FILE equ $400C ; D_file address.

ORG $4082 ; [@16514/@h4082]

LD HL,(RAM_D_FILE)
EX DE,HL
LD HL,(RAM_D_FILE)
LD BC,33
ADD HL,BC
LD BC,33*23
LDIR
LD BC,31
SBC HL,BC
EX DE,HL
INC HL
LD (HL),0
DEC BC
LDIR
RET
.end

Fast ASM scroll screen demo:
Fast_Scroll.zip
(51.98 KiB) Downloaded 241 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
bola_dor
Posts: 398
Joined: Wed Oct 02, 2019 5:32 am

Re: SCROLL and MCODER II

Post by bola_dor »

XavSnap wrote: Mon Sep 21, 2020 9:39 am
1 REM [HEX:\
2A,0C,40,EB,2A,0C,40,01,\
21,00,09,01,F7,02,ED,B0,\
01,1F,00,ED,42,EB,23,36,\
00,0B,ED,B0,C9 ]

2 CLS
4 POKE 16418,0
5 FOR A=0 TO 24
6 PRINT AT 23,A;"*HELLO*"
7 RAND USR 16514
8 NEXT A
9 GOTO 5
10 SAVE"SCROLL"
20 RUN
;------- TASM ASM mnemonics. -------
; Compile this file using:
; Set TASMOPTS = -b
; tasm -80 ThisCode.tas MyBinary.BIN
;-----------------------------------
; Zx81 Program name: VB81 XuR

#include ZX81.sym

#define ORG .org ; TASM cross-assembler definitions
#define equ .equ
;-----------------------------------

;------- Rom and Ram Symbols -------
RAM_D_FILE equ $400C ; D_file address.

ORG $4082 ; [@16514/@h4082]

LD HL,(RAM_D_FILE)
EX DE,HL
LD HL,(RAM_D_FILE)
LD BC,33
ADD HL,BC
LD BC,33*23
LDIR
LD BC,31
SBC HL,BC
EX DE,HL
INC HL
LD (HL),0
DEC BC
LDIR
RET
.end

Fast ASM scroll screen demo:
Fast_Scroll.zip
Hi Xav.. !!
I'll have to test if its actually faster than MCODER II scroll and I I can fit it in the 0 REM without breaking it.. unless you do tell me that I can relocate this freely (I am not in position of doing it myself :?
Thank you!!
Ernesto
ZX80 USA, ZX81UK, ZX Spectrum, ZX Spectrum+, ZX Spectrum 128+ UK, ZX Spectrum +2/A, Sinclair QL, CZ1000, CZ1500, CZ2000, CZ1000Plus, CZ1500Plus, CZ Spectrum, CZ Spectrum Plus, TK83, TK85, TK90X, TK95. TS2068. And more to come :D
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: SCROLL and MCODER II

Post by XavSnap »

Hi,
Try to type this Basic code to load the ASM program:
ADD= ASM Scroll start code.
(memory offset 32300, but you can store it in the PRbuff @ 16445 if the printer is not use!...only 29bytes)
But, i don't know if the MCoder2 use this memory segment.
10 LET ADD=32300
20 LET C$="2A0C40EB2A0C400121000901F702EDB0011F00ED42EB2336000BEDB0C9"
30 FAST
100 FOR X=1 TO LEN C$-1 STEP 2
110 POKE ADD,CODE C$(X)*16+CODE C$(X+1)-476
120 LET ADD=ADD+1
130 NEXT X
140 SLOW
Notes:
This code can't be use on a ZX81 1kb.
The POKE 16418,x will be lost using a CLS command and the PRINT AT command will generate an error on the lower (upper) lines #23 and #24.
Can be relocated in rom or ram.
POKE 16418,0 can't display the INPUT command…
Can't be used with the Memotech IF Centronics card… don't ask me why...
Last edited by XavSnap on Wed Sep 23, 2020 7:51 am, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
bola_dor
Posts: 398
Joined: Wed Oct 02, 2019 5:32 am

Re: SCROLL and MCODER II

Post by bola_dor »

Thanks Xav!
I'll try this later..
I remember 16418 from 35 years ago...
This may be usefull speedwise if I want to use those two bottom lines..
Ernesto
ZX80 USA, ZX81UK, ZX Spectrum, ZX Spectrum+, ZX Spectrum 128+ UK, ZX Spectrum +2/A, Sinclair QL, CZ1000, CZ1500, CZ2000, CZ1000Plus, CZ1500Plus, CZ Spectrum, CZ Spectrum Plus, TK83, TK85, TK90X, TK95. TS2068. And more to come :D
Post Reply