CRC and ProfPZU switching in scorpion

ZXNet echo conference «real.speccy»

From Vassili Klimov To All 29 July 2001


hello, All !

Yahoo!!!!!!!! Having spent several hours studying ProfPZU, I bring to your attention the general principle of management. So, let's start with a description: the 512kb PROM consists of 2 halves of 256kb each, in no way connected to each other and
switched by a toggle switch;). Accordingly, each of these parts completely
contains the system (according to my estimates, it takes up 70-80 kb).
Further, each part is divided into blocks of 64 kb. Switching within 16kb bank blocks is standard: if in 1FFD bit D1=1, then the monitor ROM is enabled (at any
bit D4 value 7FFD), otherwise if D4=1 (7FFD), then bass48, if D4=0, then
basic128. To enable trdos ROM you need to do
JP #3DXX with the bass48 on.
Now about switching blocks. First, the shadow area is cut in (D1=1,
1FFD). Let the block number (0-3) be specified in A, then for MOA we see the following:
ld hl,#0110:add a,l:ld l,a:jr nc,m1:inc h
m1 ld l,(hl):ld l,(hl):ret
in the line with m1 we see 2 key commands ld l,(hl)! The first one simply reads the value
from the table (there are 4 of them in total: #00, #04, #08, #0c), and the second one inserts the block.
Everything seems trivial, but it’s not clear why the table is needed? Moreover, in each of the
blocks the tables are different: the same values ​​0,4,8,c are used, but the order of their
arrangement is different! I also note that cell #0101 is used for
identificationcurrent block. Example: they remembered the number from #0101, turned on
some block, performed some operations, used the remembered value to restore
the previous block, etc.

Now about the popular problem of calculating the CRC of the connection sector;). When
studying the source text (ZX NEWS 54), several VERY stupid
errors were identified, due to which the CRC calculation now takes a little more time,
however, only 68 bytes are spent in memory!
I won’t comment, I’m a bummer;). I just don’t recommend using this procedure for
other purposes, it’s better to write your own or take a ready-made one from the Hrust Library.

═══════════════════ newcrc .C ══════════════════


;CRC CALCULATOR ;-)
;easy generated by J7n/4D/PeRM/RuSSIA/29.07.2001
.LOCAL
;INP: HL - BUF, BC - LEN
;OUTP: DE - CRC
CRC_CALC
PUSH IX
LD IX,#FFFF
...0
LD A,(HL)
XOR LX
LD E,A
CALL ...1
XOR HX
LD LX,A
INC E
LD A,#88
CALL NZ,...1
LD HX,A
CPI
JP PE,...0
EX (SP),IX
POP DE
RET

...1
LD A,E
RRA
RRA
RRA
RRA
LD D,A
AND #0E
XORE
AND #1F
RRA
JR C,...2
LD D,A
RRCA
RRCA
AND #C1
XOR E ;BIT 0,E=0!!!
RRCA
AND #F0
OR D
RET
...2
ADD A,A
ADD A,A
ADD A,A
ADD A,A
XOR D
AND #F0
XOR D
RET
DISPLAY $-CRC_CALC
══════════════════ ═════════════════════════

P.S. publication of this algorithm in ZX NEWS is not permitted.

I was with you .┌─┐┌─┐┬┌ .┌─┐ aka J7n/4D
│┼─┼│ ├┴┐│├┤
jtn_dog_mail.ru
└┘┘ └└─┘┴ ┴└└─┘
sp...@fbi.com

From Stanislav Udin To All 30 July 2001

Hello Vassili!

30 Jul 01 00:22, Vassili Klimov -> All:

Well, thank you very much for the new CRC calculation program, with your permission I will
implement it into the body of my commander.

VK> XOR E ;BIT 0,E=0!!!

^^^^^^^^^ What does this mean?

VK> P.S. publication of this algorithm in ZX NEWS is not allowed.

Why do you have such a negative attitude towards this publication?

VK> I was with you .┌─┐┌─┐┬┌ .┌─┐ aka J7n/4D
VK> │┼─┼│ ├┴┐│├┤
VK> jtn_sobaka_mail.ru
VK> └┘┘ └└─┘┴ ┴└└─┘

By the way, correct your signature, otherwise the bottom line moved down :)

Stanislav

From Dmitry Lomov To All 30 July 2001

Hello, Vassili!

Once, Mon Jul 30 2001 00:22, Vassili Klimov wrote to All:

VK> Now about switching blocks. First, the shadow area
VK> is cut in (D1=1, 1FFD). Let the block number (0-3) be specified in A, then for MOA we see
VK> the following:
VK> ld hl,#0110:add a,l:ld l,a:jr nc,m1:inc h
VK> m1 ld l,(hl):ld l,(hl):ret
VK> in the line with m1 we see 2 key commands ld l,(hl)! The first one simply reads
VK> the value from the table (there are 4 of them in total: #00,#04,#08,#0c), and the second
VK> inserts the block. Everything seems trivial, but it’s not clear why the
VK> table is needed? Moreover, in each of the blocks the tables are different: the same
VK> values ​​0,4,8,c are used, but the order of their arrangement is different!

Yes, they were fooling around! so that it would be more difficult to do with logic ;)


All the best.
Dmitry. [ZX] [Quake]

np: The Beatles - Helter Skelter

From Ilya Vinogradov To All 31 July 2001

VK>> NEWS.

SU> Why do you have such a negative attitude towards this publication?

I can’t answer for J7n, I speak for myself: Personally, I don’t like the
incompetent (in some matters)
edifying-revealing-condescending position of the editors-in-chief (apparently
Jedi), which is especially evident in the articles about DemoScene, the author believes normal
indicate to everyone: to whom, what, in what quantity and when should be done or not
done (in this case, demos), despite the fact that he himself is not in any way related to Demomaking (I could be wrong, but it seems so), and even if he were,
still _so_ to impose his opinion, not even an opinion, but a _system_of_values_, and a very unregulated and buggy, he would not have had the right even then. I think it’s very easy to understand the feelings of demomakers (coders/artists/musicians/designers) who read this in ZxNews...
A person intolerant to other types of thinking/value systems gives me mixed feelings, including regret (the right feeling, there’s nothing offensive in it for the object), but I wouldn’t want to be published in the newspaper of such a person ;)))
What if, after publication, he declares musicmackers enemies of the Spectrum? And will he undertake to eradicate them? Well, everything is correct: instead of writing
useful system/game software, they sit for hours in ProTracker and don’t get the hang of itblow
;)))

Although, perhaps, the presence of such a position on the part of the editors is not a reason to
ignore (read boycott) the newspaper, but in order to do so you have to
be an angel in the flesh ;)))

From Vassili Klimov To All 1 August 2001

SU> Why do you have such a negative attitude towards this publication?
Some members of 4D do not agree with a series of publications (more specifically, those
relating to demoscene).

See you soon, Stanislav. jtn{a}mail.ru
├┬
─┘│n/ЧD sp...@fbi.com