Re: Request for IBM Program to Clean /CMD Files - Response 3



David S wrote:
> (Or if this vector code appears.-? Can someone explain the vector
> table issue more?)

On most Disk-based operating systems (but oddly, not TRSDOS 1.3), the
vectors which tie into the keyboard input and display routines are
modified to point to code within the DOS. Low address loading software
(TAPE and especially programs designed for 4/16KB RAM systems), load
right on top of DOS unless they're relocated. Most people are aware of
this issue from the perspective of avoiding the DOS trample upon load,
but many don't realise you also have to be careful to reset the vectors
to the ROM defaults.

I wrote a tiny scrap of code to do this properly for both Model I and
Model III systems when I created a "merged" Haunted House for Ira's
archive. It had two fragments, the second of which was loaded by the
first when you reached a certain section of the game. In my patched
version of this, there was a secondary relocation and dispatch so it
continued along instantly (the first section was torched of course, but
it was like this in the original game which was designed for 4KB
systems). See below for the code (with opcodes).

I would caution against trying to be "too clever" with LDIR (EDB0)
pattern detectors and whatnot... 99% of the games requiring relocation
ARE single block relos + dispatches, but some might be tricky. I can
remember having to do multi-segment relos and unusual dispatches for a
game or two back then.

> The same launcher could scan the code for calls for "Model I Only"
> keyboard input routines--the common high score table lock-up issue--and
> thus flag a file with the requirement of "Cassette BASIC Only".
>
> Although from reading this thread, am I being told that this common
> lock up problem really was due to DOS clobbering some BASIC vector
> tables that were used for a common keyboard input routine? I never
> understood why some versions of games would hang on the high score
> table input. This was common with early Big Five games.

It's easily avoided... tiny bits of code to reset the vectors would
solve it. Using TRSDOS 1.3 instead of almost any other DOS (Model III)
would also avoid the problem.

=Lord Apollyon=
(Poster Emeritus)

;
; ancient tape software relocator/ROM-vector fixer-upper
; (tested on Model Is and IIIs, as well as Model III mode of
; the Model 4)
;
; contributed by Lord Apollyon
;
; the following symbols are just an example....
;
relocated_code equ 6000h

; this is a nice relo area - well past DOS

original_code equ 42e9h
code_size equ 0dffh
entry_point equ 42e9h

0000 F3 di ; disable the interrupts -
; just in case
0001 CD1A00 call getvectors
0004 110040 ld de,4000h
0007 EDB0 ldir

; we've installed ROM's RST and keyboard/screen vectors

0009 210060 ld hl,relocated_code
000C 11E942 ld de,original_code
000F 01FF0D ld bc,code_size
0012 EDB0 ldir
0014 CDC901 call 01c9h ; clear the screen
;
; important !!! don't use 01c9 to clear the screen if the vectors
; are dangling in nowhere land. CLS is implemented as a pair of
; control calls to the *DO driver. You get big boom-boom if
; *DO is whacked.
;
0017 C3E942 jp entry_point

001A getvectors:
001A 21AA36 ld hl,36aah
001D 014C00 ld bc,004ch

; Model 1 (0004h=06) while Model 3 (0004h=30h)

0020 3A0400 ld a,(0004h)
0023 FE30 cp 30h
0025 C8 ret z
;
; this is the Model I vector area and size (all 3 Model 1 ROM
; versions checked)
;
0026 21D206 ld hl,06d2h
0029 013600 ld bc,0036h
002C C9 ret

.



Relevant Pages

  • Re: Daring Dont and Decoys
    ... Any ideas on that barbaric looking game of bandy. ... more common in Berlshire than elsewhere in Britain. ... The trick was driving cattle on the fields with the stubble to have them ... AFAIK it from over here plowing and harvesting were done comunally, ...
    (soc.history.medieval)
  • Re: Your hardware
    ... I might miss that could prevent you from being playing my game? ... in *nix and then port to DOS. ... Well, actually, 286 support and emulation has about ... ANSI art groups like ACiD, iCE, or TWiST. ...
    (rec.games.roguelike.development)
  • Effects -- What Im working on now. (longish)
    ... Mobs: List of existing creatures. ... When the game loop is moving down the ... player input. ... would need so I could build a common 'effect' interface. ...
    (rec.games.roguelike.development)
  • Re: Problem with running Pandora Directive
    ... >> DOS games won't work with my motherboard in Dos in Win 98SE, ... >> back- a few months after I got my motherboard, ... I got an old DOS game working with Dosbox - The Serrated ... > The SBLive SB16 emulator driver is a Windows package not DOS. ...
    (comp.sys.ibm.pc.games.adventure)
  • Re: Low virtual memory
    ... When a game is a DOS game, it could work using compatibility mode: ... > When I run install.exe from DOS, I get a warning about low Virtual Memory. ... > Norwegian, could this file have a local name? ...
    (microsoft.public.windowsxp.games)