Deja Vu #01
30 июня 1997
  TR-DOS  

Coding - IM 2 mode when working in TR-DOS (version Loader'a).

<b>Coding</b> - IM 2 mode when working in TR-DOS (version Loader'a).
(C) 1997 CARDINAL


      IM 2 mode when working TR-DOS.
__________________________________________


                  *


  Today we talk about disk loader. If you do not understand my 
point, I will explain. Who saw INSULT MEGADEMO or BATTLE 
COMMAND (cracked by STALKER), they probably noticed that there 
LOADER'y music, precisely on such LOADER'ah go to our 
conversation. Combine music, begushku and others bells and 
whistles to boot is not as difficult as I think. It should be 
music and other bells and whistles to put on break and leave as 
LOADER there. What should be LOADER? He

should work with the ports of the SH is not directly
disable interruptions during the work, and
on a technical matter. Although there is a caveat
in this case. It is necessary to organize
interruption, and as I shall now explain. At the time of 
arrival of the next pulse interrupt rests on a stack return 
address, if this point was included ROM TR-DOS, then

it turns off and begins to work our
interrupt handler. When our
programm interrupt will
their job, then she returns to the main
program on RET or RETI. And that was not
calving when you return it in the ROM TR-DOS,
should instead RET or RETI should be put JP
# 3D2F. Below is an approximate version
LOADER'a.


        ORG 25000

        DI

        LD SP, 24999

        CALL 49152; initialize

        DI; music

        LD HL, # BE00; organize

        LD D, H; interrupt

        LD E, L

        LD B, L

        LD C, L

        INC E

        INC B

        LD (HL), # BF

        LD A, H

        IM 2

        LD I, A

        LDIR

        EI

        LD DE, # 0100; put in DE

                         ; Track and sector

        LD HL, # 4000; in HL address

        LD B, # 1B; length in B

        CALL LOADER; launch
JOY1 LD A, # 7F

        IN A, (254), after loading

        RRCA; waits

        JR C, JOY1; SPACE

        CALL 49152; extinguish music

        DI

        RET; Returns

LOADER LD A, (# 5CF6)

        INC E

        LD (PUT_DR +1), A

        LD A, I

        LD A, # F3

        JP PO, INT

        LD A, # FB
INT LD (PUT_INT), A
LOOP LD A, D

        AND A

        RRA

        LD C, # 7F

        CALL DOS

        LD A, # 3C

        JR NC, PUT_DR

        LD A, # 2C
PUT_DR OR 0

        LD C, # FF

        CALL DOS

        LD A, # 18

        PUSH BC

        PUSH DE

        LD BC, # 011F

        CALL DOS

        LD IX, # 3EF5

        CALL TRDOS

        LD D, A

        LD IX, # 20B1

        CALL TRDOS

        POP DE

        POP BC
LOOP1 PUSH BC

        PUSH DE

        LD A, E

        LD C, # 5F

        CALL DOS
LOOP2 PUSH HL

        LD C, # 1F

        LD A, # 80

        CALL DOS

        LD C, # 7F

        LD IX, # 3FD5

        CALL TRDOS

        JP P, REPEAT

        CALL CH_REG
PUT_IN NOP

        POP HL

        LD A, (# 5CD6)

        OR A

        JR NZ, LOOP2

        LD A, # 7F; Examine the cluster
        IN A, (254); hang in SPACE

        RRCA; load time

        CALL NC, KON; call podprog
                         ; FRAMEWORK if it was

                         ; Depression

        POP DE

        POP BC

        INC H

        BIT 4, E

        JR NZ, N_TR

        INC E

        DJNZ LOOP1

        JR OK_QUIT
N_TR LD E, # 01

        INC D

        DJNZ LOOP
OK_QUIT DEC E

        LD (# 5CF4), DE; before leaving

                         ; Keep track

                         ; And Gaza

        RET
KON DI; prohibit interrupt
                         ; Tion

        LD A, # F3; put byte # F3

        LD (PUT_INT), A; in cell PUT_INT

        XOR A; restore

        LD I, A; the former regime

        IM 1; interrupt

        LD C, # FD; purify AY CHIP

        LD H, A
QUIT1 LD B, # FF

        OUT (C), A

        LD B, # BF

        OUT (C), H

        INC A

        CP 1916

        RET Z

        JR QUIT1

        RET; curves. of podprog
                         ; FRAMEWORK
; All this wash is needed to ensure that when
; Pressing SPACE at boot time, distance, Shai download went at 
normal speed 

CH_REG XOR A; read register

        LD (# 5CD6), A; state

        LD HL, # 0007

        PUSH HL

        INC A

        PUSH AF

        LD IX, # 2099

        JR TRDOS
REPEAT POP HL

        POP DE

        POP BC

        JP LOOP
DOS LD IX, # 2A53
TRDOS PUSH IX

        JP # 3D2F


        ORG # BFBF; interrupt processing
        PUSH AF; tion

        PUSH HL

        PUSH DE

        PUSH BC

        PUSH IX

        PUSH IY

        CALL 49158; launch music

        POP IY

        POP IX

        POP BC

        POP DE

        POP HL

        POP AF

        EI

        JP # 3D2F; transition to address

                         ; # 3D2F where there is

                         ; RET


  And now a brief comment. Do not hang a lot of bells and 
whistles to interrupt, otherwise the download will be slower,

than with the deck. Last track and
sector is stored in cell # 5CF4. All addresses in the listing 
are arbitrary, and in this change them into convenient for you, 
in the case necessary. Actually LOADER can be

any, if only he did not forbid interrupts and
do not crash when an error reading.

END ...







Other articles:

Coding - Description of the AntiRST8 (for ZS256).

Coding - IM 2 mode when working in TR-DOS (version Loader'a).

Software - Overview of system programming: ZX-Turbo Assembler v3.10 demo, Flash Music Module Convertor v 1.1, Pro Tracker v2.4, Str Music Decompiles v1.1, Extremes Tracker v 1.3, Softcopy v1.3.

Software - New demoscene: Over The Top, Brain Sugery, Braind Crash, Paraxyzm, Nerve Trackmo, Insane, Trashe, Iris Uldtra demo.

Software - An overview of new gaming software: Mortal Kombat, Magic Stripes, Return to Home 4, Black Raven, Athena, Rescate Atlantida, Skull & Crossbones, Mario Islands demo.

Software - The program of the system description: Professional Xoring System v1.0.

Apperativchik - On the shell of the magazine and managing it.

Apperativchik - From the authors

Hall of Fame - "oVERFILE" threw the whole country. "On the Kemerovo Spectrum scene. A few words on pisi.

Hall of Fame - Pops, Must Die!

Over the hill - The rich also cry?

Over the hill - An interview with John Ritmanom.

drop of solder - Using the CM-6337 printer to the computer Scorpion ZS 256 Turbo +.

drop of solder - On completion computer Scorpion ZS256 (Revised Scheme AY).

attempt at writing - Short Story "The War Continues"

Advertising - Advertisements and announcements ...

Seven and 1 / 2 - From an unpublished: Verse "Scarce son went to his father ..."

Seven and 1 / 2 - Story of a Real Werewolfe or Virtual'no Amiga syndrome.

Seven and 1 / 2 - shoot yourself in the foot (lead programmer).

Topic - Musical ability ZX-Spectrum: What was, what is and what will happen.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Party zone - KidSoft'98: a report from the Voronezh Festival of Computer Art.
attempt at writing - "Segadnya I drank beer, therefore, is not so bad ...."
ZX-Party - Customers and level of work at the Party.

В этот день...   21 November