Page 1 of 1

Tyrann listing

Posted: Sun Jan 26, 2014 11:11 am
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

Re: Tyrann listing

Posted: Sun Jan 26, 2014 11:34 am
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 !

Re: Tyrann listing

Posted: Sun Jan 26, 2014 1:13 pm
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

Re: Tyrann listing

Posted: Sun Jan 26, 2014 3:46 pm
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 ?

Re: Tyrann listing

Posted: Sun Jan 26, 2014 4:20 pm
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.

Re: Tyrann listing

Posted: Sun Jan 26, 2014 4:26 pm
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.