Tyrann listing

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
User avatar
maximus
Flying Officer
Posts: 203
Joined: Thu Feb 23, 2006 7:45 pm
Location: Nimes, France

Tyrann listing

Post by maximus »

Hi all
I'm studying this Basic listing,
The first line is Gosub 10 000

Can someone understand and explain this first instruction ?

Code: Select all

10000 REM **** ATMOS OU ORIC-1 ? **** 
10010 IFPEEK(#C001)=#CCTHEN15000   
10020 DOKE#B000,#E6CA
10030 DOKE#B002,#E804
10040 DOKE#B004,621  
10050 DOKE#B006,623
10055 DOKE#B008,#F42D
10100 RETURN  
15000 REM
15005 DOKE#B000,#E76A
15010 DOKE#B002,#E93D
15020 DOKE#B004,634
15030 DOKE#B006,638
15035 DOKE#B008,#F88F
15100 RETURN
the entire file is available for download
Attachments
FaceA-Prog1.zip
the first prog of the tape
(2.15 KiB) Downloaded 577 times
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: Tyrann listing

Post by Symoon »

The 1st instruction is a test to know if it's a ROM 1.0 or ROM 1.1 (it's the first byte that differs between the two ROMs).
#CC means ROM 1.1

You can consider that any test of a value in ROM (any address >= #C000) is to deetermine the type of ROM, as these values can't be changed by the user. Unless of course you are using the overlay RAM (which can't be done without an extension like disk drives).

EDIt: just realised you certainly needed an explanation for the whole code - sorry !
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Tyrann listing

Post by Dbug »

It's just a way to define a number of routines that will work on both the ATMOS and Oric 1.
Here are the values for the Atmos:
15005 DOKE#B000,#E76A - Set 6522 for cassette system
15010 DOKE#B002,#E93D - Reset cassette status
15020 DOKE#B004,634 - 27A - Address of first line of screen
15030 DOKE#B006,638 - 27E - Number of lines of text on screen
15035 DOKE#B008,#F88F - Reset ORIC
User avatar
maximus
Flying Officer
Posts: 203
Joined: Thu Feb 23, 2006 7:45 pm
Location: Nimes, France

Re: Tyrann listing

Post by maximus »

Thanks gods :D

if i understand, it means you must put than for any program to be sure have compatibility oric-1/atmos

so i can put it at the end of program, with the Gosub in the 1st instruction ?
User avatar
peacer
Flight Lieutenant
Posts: 451
Joined: Wed Jun 09, 2010 9:23 pm
Location: Turkey
Contact:

Re: Tyrann listing

Post by peacer »

I think its not an universal code for every program to run in both roms.

It only modifies parameters located in #B000 - #B009 adresses. Probably tyrann machine code routine reads these memory locations to run explained rom routines when needed.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Tyrann listing

Post by Dbug »

You only need to do that if you manually call the ROM.
If you just use the normal BASIC functions you should not have to do that.
Post Reply