Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WANTED: Gravis Ultrasound (GUS) loader for SPECTRUM games

0 views
Skip to first unread message

Olof Åstrand

unread,
Dec 21, 1993, 10:27:32 AM12/21/93
to
I would really like a loader for the Gravis Ultrasound Soundcard.
I havent tried all the emulators yet but If there is anyone who nows anything
about this maybe you could help me.
-- Thanks in advance.
,,,
(o o)
+-------------------------------oOO--(_)--OOo------------------------------+
Olof Astrand f88...@nada.kth.se
+------------------------------------------+-------------------------------+

swrg...@reading.ac.uk

unread,
Dec 22, 1993, 7:48:55 AM12/22/93
to
Olof Estrand (f88...@alv.nada.kth.se) wrote:
: I would really like a loader for the Gravis Ultrasound Soundcard.

: I havent tried all the emulators yet but If there is anyone who nows anything
: about this maybe you could help me.
: -- Thanks in advance.
Hmmmm, I've been thinking about this too. Jpp claims to have tape support
in the 'pro' version (Pjpp) via soundcards. What you have to do is play
the whole tape into a .voc file and then the emulator loads from that. You
should have a Windows App with your GUS that converts .snd to .voc. I
haven't tried this yet, since I haven't got any spectrum tapes handy, but
the author said it didn't work for him, so I don't have high hopes. An
alternative would be to write a program to analyse a .snd file and convert
it to binary format. If I remeber rightly it was all to do with how long the
signal stayed at a particular level, longer than a certain time made a '1'
and shorter made a '0', or vice versa (If anyone has exact details i'd like
a copy, it's a long time since I programmed the speccy). Anyhow, these are
my humble opinions on the matter. Hope they were of some help.

Robin

+----------------------------------------------------------------------+
| Robin Glover | Did you really want to talk about |
| Department of Meteorology | the weather, or were you just trying |
| Reading University, UK | to make polite conversation? |
| swrg...@uk.ac.reading | - Groundhog Day |
+----------------------------------------------------------------------+

Tomi H Engdahl

unread,
Dec 22, 1993, 1:04:25 PM12/22/93
to
In article <21386.9312221248@suma3> swrg...@reading.ac.uk writes:

>it to binary format. If I remeber rightly it was all to do with how long the
>signal stayed at a particular level, longer than a certain time made a '1'
>and shorter made a '0', or vice versa (If anyone has exact details i'd like
>a copy, it's a long time since I programmed the speccy). Anyhow, these are
>my humble opinions on the matter. Hope they were of some help.


The following information can be found from book "An Expert Guide to the
Spectrum" written by Mike James and published by Granada. Text is also
result of my experiments.

Spectrum casette file consist of two parts: header part and the actual
file part. Both parts have same basic structure: first there is loader
tone, then a sync pulse and after it the actual data.

Loader tone signal signal is 614.9 microsecond low and 614.9 microseconds
high. The sunc pulse is 190.6 microseconds low and 210 microseconds high.
In data part one bit is 488,6 microseconds low and 488.6 microsecons high.
Zero bit is 244.3 microseconds low and 244.3 microsecond.

The data is stored so that most significant bit of byte is saved first and
least signicant bit last. The first byte of the data part of file tells
the type of file and the actual data follows after it. The last
byte in data part is cheksum which is obtained by xoring all
data bytes together.

And here is a simple Turbo Pascal program which I have used to
load files from spectrum tapes. It works nicely when Spectrum is
directly connected to SoundBlaster and I save file in spectrum
and start that loading program in PC. With casette deck test
have been less succesful. The program loads only the header
part, but can be easily extended.

Program Spectrum_to_PC;

{ Sinclair Spectrum casette loader for IBM PC compatibles
with Sound Blaster. Sound Blaster must be at default I/O address 220h.


Copyright 1992 Tomi Engdahl


Sinclair Spectrum is a registered trade mark of Sinclair Reserch Ltd.
Sound Blaster is a register trade mark of Creative Labs Inc.

}

Uses crt;

Var
timer_count:word;
tmp:byte;
old_bit:byte;

Const
Timer0=$40;
TimerCtlr=$43;
TimerClk=1193180;

Audio0=128;
hysteresis=20;

mid_value=2000; {2000}

ltone_HI=4000;


Procedure CLI;
Begin
Inline($FA); {cli, disable interrupts}
End;

Procedure STI;
Begin
Inline($FB); {cli, enable interrupts}
End;

Function Timer0Read:word;
Var
value:word;
Begin
Port[TimerCtlr]:=0; {latch timer 0}
value:=Port[Timer0];
value:=value+(Port[Timer0] shl 8);
Timer0Read:=value;
End;

Function time_difference:word;
Var value:word;
Begin
{R-}
Port[TimerCtlr]:=0; {latch timer 0}
value:=Port[Timer0];
value:=value+(Port[Timer0] shl 8);
time_difference:=timer_count-value;
timer_count:=value;
{R+}
End;

Function Read_SBADC:byte;
Begin
Inline(
$BA/$2C/$02/ {MOV DX,022C }
$EC/ {IN AL,DX }
$A8/$80/ {TEST AL,80 }
$75/$FB/ {JNZ 0107 }
$B0/$20/ {MOV AL,20 }
$EE/ {OUT DX,AL }
$BA/$2E/$02/ {MOV DX,022E }
$EC/ {IN AL,DX }
$A8/$80/ {TEST AL,80 }
$74/$FB/ {JZ 0112 }
$BA/$2A/$02/ {MOV DX,022A }
$EC/ {IN AL,DX }
$A2/tmp); {MOV a,AL }

Read_SBADC:=tmp;
End;

{Function schmitt_trigger(value:byte):byte;
Begin
If old_bit=0 Then If value>(audio0+hysteresis) Then old_bit:=1;
If old_bit=1 Then If value<(audio0-hysteresihen old_bit:=0;
schmitt_trigger:=old_bit;
End;}

Function schmitt_trigger(value:byte):byte;
Begin
If old_bit=0 Then If value>(audio0+hysteresis) Then old_bit:=1;
If old_bit=1 Then If value<(audio0-hysteresis) Then old_bit:=0;
schmitt_trigger:=old_bit;
End;

Function bit_from_tape:byte;
Var
adcvalue:byte;
count:integer;
Begin
Repeat Until schmitt_trigger(Read_SBADC)=0;
Rei_difference>mid_value Then bit_m_tape:=1
Else bit_from_tape:=0;
End;

Procedure Wait_loader_tone;
Var
diff:word;
count:integer;
Begin
diff:=0;
Repeat
Repeat Until schmitt_trigger(Read_SBADC)=0;
Repeat Until schmitt_trigger(Read_SBADC)=1;
diff:=time_difference;
If (diff>mid_value) and (diff<Ltone_hi) Then Inc(count)
Else count:=0;
Until count>=10;
End;



{******* High level packet routines ************* }

Var tavut:array[0..50000] of byte;

Procedure load_bytes(maara:word);
Var
tavu,p,a,n:byte;
laskuri:word;
Begin
ClrScr;
Repeat Until bit_from_tape=1; {wait for loader tone}
Writeln('loader tone detected');
Repeat Until bit_from_tape=0; {synclse wait}
{Writeln('sync');}
For n:=0 to 7 Do p:=bit_from_tape; {over the start byte}
laskuri:=0;
Repeat
tavu:=0;
For n:=0 to 7 Do tavu:=(tavu shl 1)+bit_from_tape;
tavut[laskuri]:=tavu;
Writeln(tavu);
Inc(laskuri);
Until laskuri>=maara;
End;

Procedure print_header;
Var a:integer;
Begin
Writeln;
Write('Program: ');
For a:=1 to 10 Do
Begin
Writhr(tavut[a]));
End;
Writeln;
Writeln('Start: ',tavut[13]+256*tavut[14]);
Writeln('Length: ',tavut[11]+256*tavut[12]);
End;

Procedure header_load;
Begin
load_bytes(17);
print_header;
End;


{ ************* Main program ************** }

dummy:word;
Begin
CLI;
old_bit:=0;
dummy:=time_difference;
Wait_loader_tone;
header_load;
STI;
Repeat Until KeyPressed;
End.

--
Tomi.E...@hut.fi Helsinki University of Technology
G=Tomi S=Engdahl O=hut ADMD=fumail C=fi Department of Computer Science
# This text is provided "as is" without any express or implied warranty #

Arnt Gulbrandsen

unread,
Dec 22, 1993, 5:17:35 PM12/22/93
to
In article <21386.9312221248@suma3>, swrg...@reading.ac.uk writes:
> Olof Estrand (f88...@alv.nada.kth.se) wrote:
> : I would really like a loader for the Gravis Ultrasound Soundcard.
> : I havent tried all the emulators yet but If there is anyone who nows anything
> : about this maybe you could help me.
> : -- Thanks in advance.
> Hmmmm, I've been thinking about this too. Jpp claims to have tape support
> in the 'pro' version (Pjpp) via soundcards.

No I don't claim that. I tried to do it, but it wouldn't work, possibly because
of bugs in VREC.EXE. Anyway, don't bother using it. It's a neat idea but didn't
work.

--Arnt

mval...@draco.lnec.pt

unread,
Dec 23, 1993, 10:48:07 AM12/23/93
to
Olof Åstrand (f88...@alv.nada.kth.se) wrote:
: I would really like a loader for the Gravis Ultrasound Soundcard.

: I havent tried all the emulators yet but If there is anyone who nows anything
: about this maybe you could help me.
: -- Thanks in advance.
: ,,,


Its easier to build the cassete-player-to-serial cable thats
described in the Spanish emulator. The Spanish emulator is
able to load games from this setup ( with stripes and all ).
You can then convert the .SP files to .SNA ( for example )

Ive been using it for about a year without problems ( not
counting the fact that speedloads dont work, but I have all
my games cracked and saved at normal speed anyhow...)


C U!

By(e)

Mario Valente


Andrew Williams

unread,
Dec 24, 1993, 10:27:34 AM12/24/93
to
agu...@ibt.unit.no (Arnt Gulbrandsen) writes:

Don't knock it- it works perfectly for me, unless the tape is in such
bad condition that the real spectrum won't load it either. Your info
about it being bugs in most sound recorders causing gaps every few k of
data was right- VREC and the Windows multimedia app failed completely,
but the OS/2 'digital audio' app in MMPM/2 gives really reliable tape
loads. It doesn't involve building or wiring anything, either.


Andrew Williams,
Physics, Uni of Western Australia.

0 new messages