Dbug wrote: ↑Wed Jun 29, 2022 2:38 pm
Have you found out how it gets back to BASIC?
Well, see for example here (page 187):
Code: Select all
Affiche le message "DISP_TYPE_MISMATCH"
Puis réinitialise la pile, affiche "_ERROR" et retourne au "Ready"
D16F- A9 A3 LDA #A3 pour le message "DISP_TYPE_MISMATCH_ERROR" (bogue: LDX)
D171- 20 D8 D5 JSR D5D8 XROM exécute à partir de la RAM une routine ROM
D174- 85 C4 7E C4 adresse ROM 1.0 adresse ROM 1.1 (affiche le message)
So, apparently it jumps to C47E, which is indeed the standard Oric Atmos ROM routine to print error messages (apart from skipping the first LDX) and return to BASIC (and indeed seems to clear stack and everything):
Code: Select all
PRINTERROR
$C47C A2 4D LDX #$4D PRINT ERROR MESSAGES
$C47E 20 2F C8 JSR $C82F Reset output to screen.
$C481 46 2E LSR $2E Reset CTRL O.
$C483 20 F0 CB JSR $CBF0 Move to start of next line.
$C486 20 D7 CC JSR $CCD7 Print "?" on screen.
$C489 BD A8 C2 LDA $C2A8,X Print error message on screen
$C48C 48 PHA until last char which has bit
$C48D 29 7F AND #$7F 7 set. X holds initial offset
$C48F 20 D9 CC JSR $CCD9 into error table at start of
$C492 E8 INX routine.
$C493 68 PLA
$C494 10 F3 BPL $C489
$C496 20 26 C7 JSR $C726 Reset 6502 stack etc.
$C499 A9 A6 LDA #$A6 Print "ERROR" after the
$C49B A0 C3 LDY #$C3 message.
$C49D 20 B0 CC JSR $CCB0
$C4A0 A4 A9 LDY $A9 If high byte of line number
$C4A2 C8 INY is #FF then the computer is in
$C4A3 F0 03 BEQ $C4A8 immediate mode (not program).
$C4A5 20 BA E0 JSR $E0BA Print "IN (line number>"
BACKTOBASIC
$C4A8 4E 52 02 LSR $0252 RESTART BASIC
$C4AB 46 2E LSR $2E Clear pending ELSE, CTRL O
$C4AD 4E F2 02 LSR $02F2 and LIST/EDIT flags.
$C4B0 A9 B2 LDA #$B2
$C4B2 A0 C3 LDY #$C3
$C4B4 20 1A 00 JSR $001A Print "Ready"
See only in the SEDORIC code that it does not use just one single routine or ROM entry point, references to "retourne au Ready" are all over the place, using also different ROM entry points.
For example, here entry point in ROM at C4A0, so few lines further, probably becasue SEDORIC already printed its own error message (p 187):
Code: Select all
Retourne au Ready après affichage d'un message d'erreur
D154- 20 D8 D5 JSR D5D8 XROM exécute à partir de la RAM une routine ROM
D157- AD C4 A0 C4 adresse ROM 1.0 adresse ROM 1.1
D15B- 60 RTS
So have to try, that one on p 187 seems to be the most promising entry point for patching, but there it is already to late to have SEDORIC print its own error message. Think then I have to find wherever it actually prints those error messages and patch already there.
Edit: Apparently, it prints those messages here:
Code: Select all
D391- 20 2A D6 JSR D62A XAFCAR affiche le caractère ASCII contenu dans A
So maybe could patch there to save the error message to a string instead of printing it, and then patch the jump to BASIC one.
(BTW: Following the French of 'SEDORIC 3.0 à NU' is more manageable than I thought)