
je n'ai pas trop regardé ça, j'ai préféré faire du smc, c'est plus marrant

Martial Demolins :
tiens, truc marrant, j'ai pas retouché au TSR depuis deux/trois semaines, il est donc toujours en nostub, j'ai juste rajouté les optimisations proposéées par Pollux (merci bien au passage, -30 octets au moins!!!)
mais quand j'installe le TSR, puis seulement après Pre0S, il déconne complètement, et s'installe plusieurs fois de suite quand on l'éxécute plusieurs fois de suite, au lieu de s'installer/désinstaller/s'installer/désinstaller...
J'ai pas pu regarder au débuggueur (j'ai constaté ça on-calc), et donc je ne sais pas trop à quoi c'est dû. Surement au fait que PreOS fait pas mal joujou avec les vecteurs en s'installant, mais je ne pensais pas qu'il touchait à ça.
Quelqu'un sait d'où ça vient? je n'ai plus rien pour compiler/débugguer et regarder ce qui se passe...![]()
;============================================================= ; Interrupt ;============================================================= Interrupt: plop2: move.l 2(a7),$123456;on met l'adresse de retour dans OldJump [à modifier à l'initialisation] plop: move.l #$123456,2(a7);On met FastKbd dans l'adresse de retour [à modifier à l'initialisation] dc.w $4EF9 OldInterrupt: dc.l 0;On exécute le trap #4 [à modifier à l'initialisation] ;============================================================= ; Accelerate the keyboard ;============================================================= FastKbd: ;destroys d0-d2/a0-a1 plop4: move.l #40*65536+20,$1234; [à modifier à l'initialisation] movem.l a0-a1/d0-d2,-(a7) pea.l Str(pc) plop5: jsr $123456;ST_helpMsg [à modifier à l'initialisation] addq.l #4,sp movem.l (a7)+,a0-a1/d0-d2 ;clear *str and the second word dc.w $4EF9 OldJump: dc.l 0; [à modifier à l'exécution] even Str: dc.b "Keyboard accelerated!",0 even EndInterrupt:
Interrupt: movem.l d0-d3/a0-a4,-(sp) lea.l OldInterrupt(pc),a0 lea.l $600001,a3 lea.l $90,a4 moveq #2,d3 move.l (a4),-(sp) ;save current vector bclr.b d3,(a3) move.l (a0),(a4) ;write old vector bset.b d3,(a3) movem.l d0-d2/a0-a1,-(sp) trap #4 ;call old vector movem.l (sp)+,d0-d2/a0-a1 bclr.b d3,(a3) move.l (sp)+,(a4) ;write current vector bset.b d3,(a3) bsr FastKbd ;accelerate the keyboard movem.l (sp)+,d0-d3/a0-a4 rte ;============================================================= ; Accelerate the keyboard ;============================================================= FastKbd: ;destroys d0-d2/a0-a1, but set a2 at ($c8)! movea.l $c8,a2 pea.l 20*65536+40 ;2 delays in 2 words movea.l OSInitBetweenKeyDelay*4(a2),a0 jsr (a0) addq.l #2,sp ;clear 1 word movea.l OSInitKeyInitDelay*4(a2),a0 jsr (a0) pea.l Str(pc) movea.l ST_helpMsg*4(a2),a0 jsr (a0) addq.l #6,sp ;clear *str and the second word rts even OldInterrupt: dc.l 0 Str: dc.b "Keyboard accelerated!",0 EndInterrupt:
Flanker :
Pollux > tiens, le code qui reste en ram, une fois un peu optimisé
;============================================================= ; Interrupt ;============================================================= Interrupt: bsr.s ExecuteOldInt ;============================================================= ; Accelerate the keyboard ;============================================================= FastKbd: ;does not destroy anything, but pops a word from the stack plop4: move.l #40*65536+20,$1234; [à modifier à l'initialisation] movem.l a0-a1/d0-d2,-(a7) bsr.s plop5 dc.b "Keyboard accelerated!",0 even plop5: jsr $123456;ST_helpMsg [à modifier à l'initialisation] addq.l #4,sp movem.l (a7)+,a0-a1/d0-d2 ;clear *str and the second word addq.l #2,sp rts ExecuteOldInt: move.w 4(a7),-(a7) dc.w $4EF9 OldInterrupt: dc.l 0;On exécute le trap #4 [à modifier à l'initialisation] EndInterrupt:
utsrlib::kernel_uninstall equ utsrlib@0004 ;****************************************************************************************************************************** ; void utsrlib::kernel_uninstall(void); ;****************************************************************************************************************************** ; ; warns all utsrs from a kernel uninstallation ; removes all utsrs from the utsr list ; keep in mind that even in case of errors, all utsrs will be removed ;******************************************************************************************************************************