Adventurer #06
28 февраля 1997

Exchange of experience - How to make a disc version? ..

<b>Exchange of experience</b> - How to make a disc version? ..
                (C) RAY

    (C) Music PHANTOM LORD / ACCEPT CORP.


      HOW TO MAKE A disk version



     You certainly know this situation: when loading a program
(No matter the game or sistemka) receive the message "Disked by 
...", a then when you try to, say, download something, you see 
the blinking Border. What words will be spoken against the very 
"disketizatora" I hope you can guess. In general, I think so: 
You can write to loader, the program disketirovana

only if done full disk version. If you just prilyapan Thesis
kovy loader, then it is better to write nothing, or note that 
is not fully de- prog disketirovana. True latest version of the 
very few people can organize, so I share with you some 
information about how to make a full disc version

program.

     So, you have a code block,
in which you want to change the up / downloading
any data from tape to disk. First, consider the load address of 
the block. Usually one less than the address set stack. (NOTE: 
Make sure that after running the program does not change its 
position in memory, in particular, throws himself whether the 
address below!) Typically, the minimum address is 24500.

If you block this address or greater -
All DC, 90%, that problems with the alteration
under the disc does not arise. If not - the situation is 
slightly more complicated and we consider later (in this 
article the disketizatsiya standard methods of TR-DOS). 


     Before you look for entry points
tape loading procedure and write, it is useful to view the 
entire memory for finding unoccupied space program.

As shown, in any prog
there is always a byte 150 .. 200 free
places (you can chunks, byte 45). And that is more than enough 
for our purposes. If not - you can use a place that is 
BASIC-loader. 

     Now start looking for an entry point.
Here, too, can be two options:
1) the program uses its own pro
   procedure for loading / writing;
2) the benefits of the procedure of
Rom.

     In the first case to look for entry points
difficult, but it will not have to then find space in the 
program, because new routines just them across the

site of the old.

     In the second case, you can try
find challenges ROM.


     I recommend to first find the entry point
in SAVE, because it is easier to define the parameters of the 
delivered units (starting address / Usually in register IX / 
length and / Reg. DE /). 

     I will cite some entry points for
tape routines in ROM, pulled
from different programs:


       mnemonic bytes to search

SAVE: CALL 1218 CD C2 04

       CALL 1222 CD C6 04

LOAD: CALL 1366 CD 56 05

       CALL 2050 CD February 2008

       CALL 1378 CD 62 05

       CALL 1889 CD 61 07

In addition, there are also exotic
ways:

       CALL # 0605

       where the SAVE or LOAD is defined

       on the cell 23688 0 - SAVE

                         1 - LOAD


     Even more interesting way:
SAVE: CALL 2416,
where

      IX - the first 17 bytes - header
then the data;

      length is given as follows:


      LD DE, length

      LD (IX +11), D

      LD (IX +12), E.


     If you have a suspicion that
programs use their own procedures for working with tape, then 
you can do following. Because Typically, these procedures

are based on PZU'shnyh, then look for
the following sequence:


      mnemonic code


      08 EX AF, AF '

      13 INC DE

      DD 2B DEC IX

      F3 DI

This piece from the procedure, located in
ROM at 1222 (# 04C6). If you have found
something like that, then this is the beginning (almost)
routines on the tape. Left
only to find out where by calling it
and define the parameters of the delivered unit.

     If none of the above are not
help - try searching for messages,
that the program issues when working with
tape. Typically, these messages are
next to the relevant procedures.


     So, all we found. Substitute address
call routines found below. However, there is one more thing:
could be three options for shipping (for
BitTorrent - the same way):

1) in the same file;
2) in the same place on disk or

   "A";
3) in different files (the most preferable
   respect).


     In the first case, the file name is fixed. In the second 
it is generally not necessary. And in third to it as a type 
(such usually occurs in adventyurnyh games).



     Consider these cases ...

1. In one file:

SAVE

       CALL SET_NAME; ready systems.

                         ; Variables

       LD C, 10, look for a file

       CALL 15635

       LD A, C

       BIT 7, C

       JR NZ, SAV_BL; it is not


       LD DE, (23878) found, rewrite

       LD BC, # nn06

       LD HL, address

       CALL 15635

       RET

SAV_BL; create a new

       LD HL, address

       LD DE, size

       LD C, 11

       CALL 15635

       RET

where the address - the address of the beginning of the 
delivered 

                block;

       size - the size in bytes;

       nn = the size in sectors.

LOAD

       CALL SET_NAME; ready systems.

                         ; Variables

       LD C, 10, look for a file

       CALL 15635

       LD A, C

       BIT 7, C

       JR Z, LD_1
; Message "file not found" or ...

       RET

LD_1; Georgia ...

       LD A, C

       LD C, 8

       CALL 15635

       XOR A

       LD (23801), A

       LD (23824), A

       LD C, 14

       CALL 15635

       RET
; Sub-install sist.peremennyh
SET_NAME

       LD HL, NAME; toss

       LD DE, 23773, file name

       LD BC, 8

       LDIR

       LD A, "C"; type MB

       LD (23781), A; any, except

                         ; "#"," D "," B "

       LD A, 9; file search

       LD (23814), A; to 9 characters

       RET

NAME DEFM "filename"

2. In the same place ("a"):

SAVE

       LD HL, address

       LD DE, (T_S)

       LD BC, # nn06

       CALL 15635

       RET
LOAD

       LD HL, address

       LD DE, (T_S)

       LD BC, # nn05

       CALL 15635

       RET
T_S DEFW # SSTT; track and sector,

                    ; To write / read

3. In different files:

Case similar to 1, only the procedure
SET_NAME must be replaced by INP_NAME.

* If you disketiruete adventyuru, then
better to find a program input procedure

line and use it to enter the name
file. How to use it - is shown below. Otherwise you have to 
write it yourself. 

NAME EQU; address to read

             ; Line
INPUT EQU; address of the procedure read

             ; Line
FROM EQU; the "address"
LEN EQU; the "length" (BYTES)

INP_NAME

       LD HL, NAME; clear the name of

       LD DE, NAME +1; file

       LD BC, 7

       LD (HL), # 20

       LDIR


       CALL INPUT; see *


       LD A, "C"; type MB

       LD (23781), A; any, except

                         ; "#"," D "," B "


       LD A, 9; file search

       LD (23814), A; to 9 characters


       LD HL, NAME

       LD B, 8
CHECK LD A, (HL)

       CP NN; terminator

       JR NZ, NEXTS; line code NN

       LD A, # 20, is replaced by

       LD (HL), A; gap
NEXTS INC HL

       DJNZ CHECK

       LD HL, NAME

       LD DE, 23773

       LD BC, 8

       LDIR

       RET



     And in conclusion, I want to share one
podprogrammkoy, which allows you to change
Drive:

call: LD D, n; n-number of the disk

       CALL CNG_D; 0-A, 1-B, 2-C

       ....

CNG_D DI

       LD A, # C9; disabled because of
       LD (# 5CC2), A; processing errors

                         ; (See ADV # 5)


       LD (IY +0), # FF; reset

       XOR A; all codes

       LD (23824), A; error


       LD A, D; set

       LD (23833), A; system ne
       LD (23798), A; belt TRDOS


       LD C, 1; choice

       CALL # 3D13; drive


       LD C, # 18; tuning

       CALL # 3D13; drive

       EI

       RET



P.S. If you do not configure the disk, then
by changing the drive could happen
that he will read only the zero track.


P.P.S. Listed in ADV # 5, and this issue
procedures are not perfect, though
fully operational. If someone knows how to do better (or better 
yet - the driver with direct programming SH and processing 
errors, for example: a standard call, and upon completion of 
work A registry error code), then we are happy to publish his 
achievements. Be bold, virtuoso keyboard! 



     On this let me finish. If
something is not clear - write.



     We continue a series of articles devoted to the disc 
loader. Word of our correspondent.



            (C) Nicolas Viper


               "The lazy person, so

               more than any of his act

               similar to the deed. "


                       Folk wisdom



     Delay velikovata, well, who now
easy? Reach for their brains out jars
Solutions with a wipe, someone dusty, and delve.


     First of all, it should be noted
that the statement that in checking the correctness of reading 
(hereinafter: CFR), DOS can not help us was wrong. Only In 
turn, we must help him. 

Take a look at Listing:



        ORG 40000

        DI; Installation:

        LD HL, # FD00;-Prés

        LD A, H; algebra

        LD DE, # FD01; Islands

        LD BC, 256; equations

        LD (HL), # FE

        LDIR

        LD I, A

        IM 2

        CALL MUSRUN;-Music

        EI

        LD DE, # 0100;-Location,

        LD HL, 16384; where and

        LD B, 27; how much we

        CALL LOADER; shipping

        JP MUSRUN; Music off + RET


*************** ***************** GEORGIA

LOADER

        LD IX, # 2F65; Promotion

        CALL DOS
L1

        PUSH DE

        PUSH BC

        LD A, D

        OR A

        RRA

        LD C, A

        LD A, # 3C

        JR NC, L2

        LD A, # 2C
L2

        LD IX, # 2F4D; Put the skull on

        CALL DOS; road

        POP BC

        POP DE


        PUSH HL

        PUSH DE

        PUSH BC


        CALL LOA_COM

        POP BC

        POP DE

        POP HL

                        ; Translation:

        INC H; - Address

        LD A, E; - sec

        INC A; then

        AND 15; pa

        LD E, A

        JR NZ, L5; - roads

        INC D
L5

        DJNZ L1; new sector


        DI; Output

        IM 1

        EI

        RET

This part has not changed since the first
Coming. But most important:

LOA_COM

        LD C, # 5F; Conversion rates

        LD A, E; sector zasyl
        INC A; ka in the register

        LD IX, # 2A53; sector VG-shki

        CALL GODOS
TRY1

        PUSH HL; on the stack

        PUSH DE
TRYMET

        XOR A; No error

        LD (ERRFLG +1), A; (yet:)

        LD B, A; B = 0

        LD C, # 1F; Team

        LD A, # 80, "read

        LD IX, # 2A53; Sector

        CALL DOS

        LD C, # 7F; Reading sector

        LD IX, # 3FE5

        CALL GODOS

        POP DE; picked up a stack

        POP HL

ERRFLG

        LD A, 0; Check

        OR A; time errors

        JR NZ, TRY1; reading. (Under
        LD D, 1; more details described

        LD IX, # 2F2F; below)

        JP GODOS

DOS

        HALT
GODOS

        PUSH IX

        JP # 3D2F
IMCOM; caught the interrupt
        LD (STACK), SP; tion

        PUSH IX

        PUSH HL; Here, too, in

        PUSH DE; nutshell

        PUSH AF; not describe:)

        PUSH BC; Look for more details
        CALL MUSIC; surface below.

        LD HL, (STACK)

        LD E, (HL)

        INC HL


        LD D, (HL)

        LD A, D

        CP # 40

        JR NC, RETOS

        CP # 3F

        JR NZ, PA_CNT

        POP BC

        PUSH BC

        LD A, B

        LD (ERRFLG +1), A
PA_CNT

        LD HL, 0 - # 2F3A

        OR A

        ADC HL, DE

        JR Z, RTBR

        LD A, # C3
POPALL

        LD (CHANGE), A

        POP BC

        POP AF

        POP DE

        POP HL

        POP IX

        EI

CHANGE

        JP # 3D2F
RETOS

        LD A, # C9

        JR POPALL

RTBR

        LD SP, (STACK)

        POP AF

        EI

        JP TRYMET

STACK DW 0


        ORG # C000

        INSERT "MUSIC"


        ORG # FEFE

        JP IMCOM

MUSRUN EQU # C000
MUSIC EQU # C006

At # 2F2F in TR-DOS:

# 2F2F IN A, (# 1F)

        AND # 7F

        RET Z

        DEC D

        PUSH HL

        PUSH DE

        JR NZ, # 2EXX; No matter where

        HALT;) We catch!

Kratenko:

About IMCOM: the problem of this procedure -
check when it was interrupted.

     The options are:
- In RAM. Then it all on the drum - m
  paradise music and vertaemsya.
- The ROM (assuming that it is DOS! On-the idea

  we do not find ourselves in SOS). Then, too, wa
  variants:

  - Grab addresses with a # 2F3A - this value
  This means that we caught the HALT (see above)

  which, in turn, suggests that


  occurred while reading one of the "mill
  dard "error - loss of data, not
  match the checksums, etc.

  - ... From the address # 3FXX (XX - any value
  tion) - again, in theory, there we can
  We show the procedure to intercept only reading
  of the sector. This means that, alas,

  we are uncertain situation - should be

  complete the procedure, but due to delays

  to play tunes, etc. we

  lost time and have read Brokers
  torit.


     When an error occurs, we put
at (ERRFLG + 1) is not zero - it says that we need to reread 
the sector (See label ERRFLG).



     Everything else is not so difficult and it was
painted before. E-mail if that is not
so, the editors or mylte me:


         nicky@univ.uniyar.ac.ru


     Although, judging by previous publications, you, dear 
readers, is still not paid for this procedure is no

Spotlight - glitches in it was full, and
nobody wrote: "... because of this
Your #@$'$- of prog myself floppy spoiled, beloved! "


        (C) Kotov AV (CAV Inc.)







Other articles:

System - Overview of system innovations: FREE FORMAT v8.3, ALASM v2.8, OMEGA COMMANDER v1.5, PERFECT COMMANDER v1.52, F-COMMANDER v4.02, CHEMNEBASE v0.6, SPRITELAND v1.9, MAXSOFT SCREEN PACKERv1.0, ANIMICROPROTECTOR v1.0), MICRO EDITOR, DISK LEVEL, MAY BE MY BANK v5.1, AFRODITA v3.0, FLOOPY FORMAT UTILITY v1.0, DIGITAL STUDIO PLAYER v1.0, PRO TRACKER PLAYERv1.10, UNRECOGNIZED FORMATING OBJECT v1.1, ZX-WINWORD v1.0

Review - An overview of new gaming software: KOMANDO-2, PEDRO NA OSTROVE PIRATOV, DIRT TRACK RACER, DOUBLE DRAGON-2, THE CYCLES, STUNT MAN SEYMOUR, CHOY LEE FUT KUNG FU WARRIOR, ARKARUM, KING VALLEY, MURK 3320, THE MYSTER of ARKHAM MAVOR, SKAZ ANCIENT RUSSIA: VITYAZ SVYATOGOR and the Sorcerer Karachun, MAGICIAN LAND, RALLY CROSS, MOVING TARGET, KLADEMINER, LOST CAVES and the TOMB of DOOM, WIZARD WILLY.

Interface - Cheat for the game Heavy Metal Mover. Opinion about the assembly (which is better?). Questions about adventyurnym games: Last Raider, The Knight and the Sorcerer Svyatogor Karachun, Medieval History.

user interface - parse mail. Letters from readers: Kolotushkin Sergei, Dmitrii Shadrin, Bernik Eugene.

user interface - fraud on the Spectrum - a fake game from Overfile.

Interface - News: KAV developing arcade adventyuru "hedgehog mutants", Nicodim working on the game "Legend of Kyrandia", Microfucker. Top Ten games and five electronic journals from the city of Yaroslavl.

Presentation - Presentation of new programs: Road Fighter demo, Font Editor. Novel entry to the game Return Home 4. New game from K. KAV 'a - "Return to Home 5.

Promotion - Description adventyurnyh and strategic games: Appolo and Stranger, Lord of Chaos, War Game 1, the land of myths, Sorcerer Lord.

Ottyag - Terminology of the user or the modern spoken language. Marazminki: 10 reasons why the dinosaurs became extinct. 10 contenders for the Ninja Turtles. 10 things you could do V. Van Gogh. 10 things you can cry, stealing back to my Granddaddy. 10 things that would gluppo say what who came to buy your house. 10 things you can give a deaf-rodst ots. That you should not say or do, if you nazh- ralsya. Chinese poslivitsy. The Gospel of Mitkov. Tests: "Are you cool demomayker?" "Do you have friends?" "Russian Folk Chernushka" (scanned images of SERGA)

Exchange of experience - How to make a disc version? ..

Exchange of experience - What do we choose: the advantages and disadvantages of PC and Amiga.

Exchange of experience - about the virus in the game Last Battle. How to write a virus.

Exchange of experience - Methods for protecting software code.

Anniversary - the journal of the 1 year (6 issues - the anniversary issue).

Anniversary - Our Anniversary - 15 years and 57 years SPECCY Sinclair!

Novella - Novella "black beret" the game "Sabouter".

Contest - Competition GFX - the first work ...

Advertising - Advertising and announcements.


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

Similar articles:
Introduction - The joyful news.
Nemo open letters № 5.8
Miscellaneous - So I stand! Reflections on the fate of the Spectrum.

В этот день...   3 May