Nº174 (10/2004)







  Download :
En couverture (version destinée aux supports électroniques) et ci-contre (version papier) le nouveau logo officiel du CEO. Merci à tous ceux qui ont participé à son élaboration et/ou qui nous ont envoyé leur classement préférentiel et leurs commentaires. Un nouveau site du CEO est en cours de mise au point sous la direction de Jérôme. Autre nouveauté (dans le mag lui-même) : Toutes les adresses (membres du bureau et contribu-teurs) sont maintenant centralisées à la rubrique “Bonnes adressesâ€�. Sauf courrier personnalisé, adressez maintenant vos e-mails à . A bientôt. André.

Découvrez un Player de Son SID sur Oric !
Evénement : Jim Cuomo !
Evénement : Buggy Boy !
Loritel : Un Mini-Test !
Software : Gestion de la Souris !
Fabriquez vos Cartouches Super-Oric !

sommaire

Mini-Test : Loritel    Page 
Réponses (44) : Sujets n°120 - 124    Page 
Nostalgie : Le Catalogue de Loriciels (2)    Page 
Divertissements Mathématiques et Logiques    Page 
Banc d’ Essai : LCP 2004 - Buggy Boy Demo    Page 
Web : Les Journées du Patrimoine    Page 
Tapes Transfers and Errors Correction (3/3)    Page 
Revue de Presse : Matranet, la Version Française    Page 
Musique : Player de Son SID sur Oric    Page 
Mise au Point Software pour Cartouche Super-Oric (2)    Page 
Compte-Rendu : Jim Cuomo 20 ans après    Page 
Les Calembours de Schizo Dino    Page 
Software : Gestion de la Souris    Page 
Atelier : Cartes Contrôleur Microdisc    Page 
Petites Annonces / Bonnes Adresses    Page 
Courrier Oricien    Page 
Adresses CEO / Sommaire / Editorial    Page 


Réponses n°44

Compiled by André Chéramy



Il est des questions qui reviennent périodiquement et pour lesquelles un petit nombre de personnes ont la gentillesse de donner des réponses à titre individuel. Il serait bien dommage de ne pas en faire profiter l'ensemble de la communauté Oricienne. Cette rubrique est donc ouverte à tous, aussi bien pour obtenir des renseignements, que pour en donner.



Subject n°120 - Basic programming

Question from Norik : I made a simple skeleton for writing something like a game, and it works. In the example below, some things appeared on the screen at the same time, like walking monster, flying bird, etc.. And if at the same time is pressed a key ‘Z' then program understand, that it command to move left (just simple example) So, all this things appears to be simultaneously, like in separate threads.

10 REPEAT

20 CH1$=""

30 CH2$=""

40 REPEAT

46 REPEAT

47 CH1$=KEY$

50 REM Here will be our code like birds, monsters...

60 REM Flying bird

65 GOSUB 1000

70 REM Raining

75 GOSUB 2000

80 REM Walking monster

85 GOSUB 3000

149 REM End of our code like birds, monsters, etc.

150 UNTIL CH1$<>""

160 IF CH1$="" THEN CH2$=KEY$

170 REM Here will be key handling

180 IF CH2$="Z" THEN GOSUB 5000

200 UNTIL CH2$="Q"

210 STOP

1000 PRINT «flying bird»

1010 RETURN

2000 PRINT «rain»

2001 RETURN

3000 PRINT «walking monster»

3010 RETURN

5000 PRINT «left pressed»

5001 RETURN

The question is: How I can add simultaneous playing music, like in separate thread... So, monsters walking, birds flying, raining, when user press ‘Z' our hero goes left, AND we can listen sounds of music at the same time!

Answer from Peter ‘TheSpider' Paterson : Unable to answer your question about «simultaneous playing music», but can answer this.... In the first lines, ch1$ and ch2$ would be treated the same, ie ch$. Oric Basic only recognises the first two characters of the name of a variable.

Answer from André Majorel : [ch1$="" & ch2$=""] Does this work? I thought only the first two character were significant. [Simultaneously playing music] For best results, MUSIC and SOUND are often handled by an interrupt routine (or even, in arcade machine, by a second CPU). Otherwise, why not just add to the inner loop a GOSUB to a subroutine that issues the adequate calls to MUSIC, SOUND and PLAY?

Again from Norik [Does this work?] Yes, it works! Really!

Answer from André: Looked at the code: It works because the uses don't overlap. But for the BASIC interpreter, it's the same variable.

Answer from Jérôme Debrune : In fact, André is right, it does not work, really :) In Basic, only first two characters are significant. Try this:

10 CH1$="CH1"

20 CH2$="CH2"

30 PRINT CH1$

... You'll see that when you ask for ch1$, it prints ch2.

Answer from Steve Marshall : [Simultaneously playing music] What I'd do would be to use Sonix, the excellent music editor from Twilighte. You make the music using that program and then load the files up and set it off with a poke. Your game should play OK with the music running. If you want to use BASIC it is far more difficult as you need to have a MUSIC command when you want a key press function and you can't do both at once. I think the only way to load the sequence in memory (POKEing DATA) and then CALL it to play the music, which should allow you to go and look at keypresses. I think the music in the Atmos demo is in memory like that (?)

Again from Norik: Thanks, I'll try sonix. It produces basic files with data strings? Anyway I'll try and hope it will help.

Answer from Steve: No it produces MC files. It needs a disk system as far as I know but I don't see why the files couldn't be used on a tape file once programmed.

Answer from Pe@ceR : You can use sound data and play it thru all the repeat-until loop... Modifying your code:

1 DIM NOTE(20),DURATION(20)

2 FOR U =1 TO 20: READ NOTE(U),DURATION(U)

3 NEXT

4 DATA 300,10,400,20,100,10,200,20,400,30...

Code your music data here, for SOUND command's frequency parameter and duration of each note)

5 NN=1:DD=DURATION(1):SOUND 1,NOTE(1),15

[10 REPEAT

…/…

3010 RETURN]

5000 PRINT «left pressed»

5001 RETURN

9999 REM Playing routine

10000 DR=DR+1

10020 IF DR=DURATION(NN) THEN NN=NN+1:DR=0:SOUND 1,NOTE(NN),15

10030 RETURN

I did not check the program. You can adjust playing length of each note by modifying the data. This will allow you to play sound continuously while all other things are happening... (alternative to Jon's machine coding program of course , just by Basic commands).



Subject n°121 - Microdisc PSU

Question from Lionel Rey : My Microdisc power supply has burnt and it seems you [Steve Marshall] are THE person who might help me. It's a first generation Microdisc with heat dissipator at the back, and the power supply has three connectors, two for up to two Microdiscs and a jack for the Atmos.

Answer from Steve Marshall : Isn't there anyone out there with a Microdisc? Surely someone knows something about these things? Can't a modern PC PSU be adapted to work the Microdisc for instance?

Answer from Fabrice Francès : I still use the same original PSU with my Microdisc... The problem for its replacement is that it doesn't deliver +5V like modern PSU. Instead, it delivers something around 9 or 10V: This gets regulated by the internal 5V regulator of the Atmos, and also by the +5V regulator of the Microdisc. Some people don't plug the jack into the Atmos, and thus the Atmos receives its +5V through the flat cable of the disc controller. Because of this, the Microdisc has a +5V regulator with enough power for the Atmos plus the disc controller, plus the floppy drives. Hence the big (yet hot) heat dissipator at the back (from memory, its a LM323 regulator, so it can deliver 3A). Several people use a modern switching PSU nowadays. In this configuration, you have a +5V regulated supply: no need to go through the internal regulator of the Atmos, or through the Microdisc one. Instead, you have to bypass the Microdisc regulator, and the Atmos is powered through the Microdisc flat cable. Some people says that such flat cables are not thick enough to power the Atmos and some extensions: I'm no expert... Ok, this was about the +5V supply. Now, for the +12V part (needed for the Microdisc and the floppy drives)... From memory, there's a 7812 regulator inside the Microdisc, I have to check. This would mean that the original PSU delivers something around +15V. Once again, with a modern PSU offering regulated +12V, you don't have to go through the regulator, so you can use a PC PSU and completely remove the whole back of the Microdisc and have the PC PSU directly connected to the power connector of the disc controller board, and to the floppy drives. PS: I do use a PC PSU on my Telestrat, because the original Stratos regulators were removed and thus the Telestrat needs regulated +5 and +12V. Be sure to identify the +5 and +12V wires on both the PSU plug you are going to cut, and on the disc controller board power connector. I recently used a PC PSU that had inversed yellow and red colours, and burnt several chips of the Telestrat by sending +12V instead of +5V :-(



Subject n°122 - CLS routine in the ROM

Question from Olivier Jean : I don't understand the source of CLS (clear screen). This address is 0xCCCE. I don't understand how clear the screen! If someone could explain to me...

Answer from Fabrice Francès : At $CCCE, you have a LDA #$0C. $0C is the «Form Feed» ASCII code, it is the usual ASCII code for clearing the screen (try a PRINT CHR$(12), or even a simple CTRL-L keystroke). After this instruction, you have a sequence of BIT instructions that are only here in order to hide other LDA #xx instructions in their operand address (this is a rather common trick used by 6502 programmers), then you have the «print char» routine itself. In fact, it doesn't do a lot, because the print char routine relies on the «VDU» routine, vectorised in $0238: JMP $F77C.

This VDU routine is responsible for displaying a char to the screen: It first determines if the char to display is a printable ASCII char, or a control char (0 to 31). Since you are interested by a control char, it calls the routine in F602: This one uses a table of relative branches in order to select the correct routine for each of the 32 control characters. So, the actual routine for CTRL-L is in $F695. This one gets the number of lines to clear (from $027E), the address of the first line to clear (from $027A-$027B), and it loops on routine $F71A in order to clear all these lines one by one. Hope this helps...



Subject n°123 - Log file with Euphoric

Question from Olivier Jean : I would modify Euphoric to write into a file much information. For example, if 6502 write/reads an address between 0x300 and 0x3FF, Euphoric writes into the file the following lines:

Access 0x300 when Program Counter from 6502 is equal 0x5544

Access 0x303 when Program Counter from 6502 is equal 0x65FF...

Is it possible?

Answer from Fabrice Francès : Don't you want to use the integrated debugger? (Press F11). It has a nice view of all the VIA contents, with changes to the internal state appearing in red...

Again from Olivier: I want to get a trace log file... I'm going to do statistics about access into 0x0300-0x03FF.

Answer from Fabrice: Are you running Euphoric under Linux? Then you just need to add calls to fprintf in the via.S file.



Subject n°124 - Screenshot on Euphoric

Question from Peter ‘TheSpider' Paterson : Having a problem getting my Euphoric (v1) to produce a screenshot. Running Win98. I vaguely remember that you had to use [SHIFT] or [CTRL] or something. Tried those but could not get it to work. Any ideas?

Answer from Fabrice Francès : You just have to press F12 to get a screenshot...






BROWSE

NUMEROS
 [176] - [175] - [174] [173] - [171] - [170] - [169] - [168] - [167] - [166] - [165] 

YEAR
2013 - 2012 - 2011 - 2010 - 2009 - 2008 - 2007 - 2006 - 2005 - 2004 - 2003 - 2002 - 2001 - 2000 - 1999 - 1998 - 1997 - 1996 - 1995 - 1994 - 1993 - 1992 - 1991 - 1990



Hosted By oric.org server www.oric.org V 2.6 CNIL ID : 872370 Write to Webmaster © 2000-2024 Built in 0.02 Seconds