CD video to ZX
To learn how to write a video player with whom
pact disc, says the author of the very
player, which was shown on CAFe'2003.
Unfortunately, the player has not survived. Dan
nym issue also addressed PSB and slightly
zhko I (Alone Coder). Personally, I experiment
roval only 16 (15)-color video - there
there are some interesting challenges IAN
forging, etc.
CD video to ZX
For the sound, of course, need 2 buffer.
Naturally, the data is stored as
[Image] [audio] [image] [sound] ...
Since sidyuki data of one sector
pass very quickly, we can not wait
availability of data within the sector but only
before reading.
I have done so: dekryunchitsya procedure
pa read one sector (2k), which,
where necessary, setting up audio output (for ka
Qualitatively, the sound can be more povstavlyat
NOP'ov or INC HX. I've still got the number itself
proof cycles between the audio output is given by
as a fixed point):
LD C, E: INI
LD C, D: INI
LD C, E: INI
LD C, D: INI
...
[NOP / INC HX]
EXX
OUTI
EXX
LD C, E: INI
LD C, D: INI
LD C, E: INI
LD C, D: INI
...
[NOP / INC HX]
EXX
OUTI
EXX
etc.
So how to read the pieces are not multiples of 2k
and not coinciding with the beginning of the sector (6144 -
screen and 2048 - the sound is not very Wheels: brake
but also weighs a lot), in the end is in JP on
chalo, and is used frequently and / or procedure
completely (floating RET). I is designed to
a procedure that reads from the current
the situation in Gaza right amount of bytes
and / or sectors. It can be used as follows:
LD BC, size
LD HL, buff
CALL read
And more specifically:
LD BC, 6912
LD HL, # 4000
CALL read
LD BC, 1280
LD HL, sndbuf0
CALL read
Still, as should be expected readiness
drive and at the same time a sound is needed
procedure such as:
w_snd
CALL w_cd
RET Z
NOP; to fig NOP'ov
EXX
OUTI
EXX
...
JP w_snd
Desirable to put checks on windows
see Note the buffer (and / or add zeros after the
buffer). For sound quality it is desirable that
procedure to do more (if quantitative
in contacts between the sound output is not an integer).
Still, if you use some eq
wound (sprite) - n familiarity in width (at
This can save you a lot), it is necessary
make a table of addresses for screens and for
buffers with a sound and change the code:
POP HL; here every n bytes
, Read a new address
LD C, E: INI
LD C, D: INI
...
POP HL; here every n bytes
, Read a new address
LD C, E: INI
LD C, D: INI
...
[NOP / INC HX]
EXX
OUTI
EXX
Naturally, this approach koliches
GUT sound bytes per frame must be a multiple
n. And yet, 2048, must be divisible by n without
balance (though if a little crap, you can
zhno without it).
Ed.: Sound must be many - with reserves
som! The fact is that about once in 10 sectors
ditch waiting for a new sector drags
on an eerie life - more than 20000 taktov.Prichem
regardless of the speed (1x/8x /...)!
Reasons are not clear.
The general structure of such a procedure, read:
[Define how and where to read]
[Insert 'RET']
[JP where necessary]
/
> [Send command CD-ROM'u]
> [Expected availability]
> [Read]
You can use the read command
group of sectors (in the sense that amount of sectors
set> 1) not to send team
every sector - but not all drives
like it (my DVD on it and complains
refuses to read). But with the abolition of the current
teams are generally very difficult - if
stop reading (RESET, for example), then later
difficult to 'reach out' to drive - hard
understand how the zero team he wants.
Hedgehog (Alexander Neganov)