struct { UWORD potgo; // 0 0xdff016 UWORD joy0dat; // 2 UBYTE pra; // 4 0xbfe001 UBYTE pad; // 5 ULONG sigbit; // 6 struct Task *task; // 10 APTR potgoResource; // 14 } mousedata;
@sq7bti, post #1
@asman, post #2
Co chcesz osiągnąć ?
@@ -266,7 +276,13 @@ int AllocResources() InputBase = (struct InputBase *)InputIO->io_Device; if (mousedata.potgoResource = OpenResource("potgo.resource")) { - return 1; + potbits = AllocPotBits(OUTLX | DATLX); + if(potbits == OUTLX | DATLX) + { + return 1; + } + else + PutStr("Error: Could not allocate potgo output MMB"); } else PutStr("Error: Could not open potgo.resource\n"); @@ -290,6 +306,7 @@ int AllocResources() void FreeResources() { + FreePotBits(OUTLX | DATLX); if (InputIO) { CloseDevice((struct IORequest *)InputIO);
potgo.resource failed to load
$ make /opt/m68k-amigaos/bin/m68k-amigaos-gcc -c -o mousedriver.o mousedriver.c -O2 -noixemul vasmm68k_mot -quiet -Fhunk -phxass -I /opt/gnu-6.5.0b/m68k-amigaos/ndk-include/ -o vbrserver.o vbrserver.s /opt/m68k-amigaos/bin/m68k-amigaos-gcc -O2 -noixemul -o Blabber.driver mousedriver.o vbrserver.o /opt/m68k-amigaos/m68k-amigaos/lib/libamiga.a(allocpotbits.o)(.text+0x4): undefined reference to `PotgoBase' /opt/m68k-amigaos/m68k-amigaos/lib/libamiga.a(freepotbits.o)(.text+0x4): undefined reference to `PotgoBase' collect2: ld returned 1 exit status make: *** [Makefile:20: Blabber.driver] Error 1
mousedriver.c:297:18: warning: implicit declaration of function 'AllocPotBits' [-Wimplicit-function-declaration] potbits = AllocPotBits(OUTLX | DATLX);
@forge, post #4
FUNCTION This function can query or modify the state of the current task's received signal mask. Setting the state of signals is considered dangerous. Reading the state of signals is safe.
@sq7bti, post #3
Co do zachowania zawartości rejestrów przy wywołaniu procedur systemowych, gdzie znajdę taki kompletny opis procedur z Kickstartu (exec?) do każdej z procedur (np. _LVOWritePotGo, albo _LVOSignal), takie jak informacje co w którym rejestrze mam umieścić jako argument, które będą modyfikowane, i w których mam wynik i w jakim formacie? Czy są one takie same jak dla C opisane w elowar?
@sq7bti, post #1
@docent, post #7
Delay: ; cocolino 36, ; ez-mouse 25 MOVEQ #18,D1 ; Needs testing on a slower Amiga! .wait1 MOVE.B vhposr+1(A0),D0 ; Bits 7-0 H8-H1 (horizontal position) .wait2 CMP.B vhposr+1(A0),D0 BEQ.B .wait2 DBF D1, .wait1
@docent, post #7
@asman, post #8
@docent, post #18
SYNOPSIS oldSignals = SetSignal(newSignals, signalMask) D0 D0 D1 EXAMPLES Get the current state of all signals: SetSignal(0L,0L);
; ; Check if the main task already processed previous code ; if not wait for another round ; MOVE.L A1,-(SP) ; preserve A1 on stack MOVE.L 4.W,A6 MOVE.L #$0,D0 ; newSignals MOVE.L #$0,D1 ; signalsMask MOVE.L 10(A1),A1 ; Task JSR _LVOSetSignal(A6) MOVE.L (SP)+,A1 ; restore A1 from stack CMP.L 6(A1),D0 ; check if the signal is still there BEQ.s abort
@docent, post #18
Wszystko zalezy od tego, jak bardzo musi byc stabilna czestosc odswiezania odczytu stanu myszk
@docent, post #7
Dzieje sie tak dlatego, ze struktura jest wspoldzielona miedzy przerwaniem a programem.
; ; Check if the main task already processed previous code ; if not wait for another round ; MOVE.L A1,A5 ; preserve A1 in A5 MOVE.L 4.W,A6 MOVE.L #$0,D0 ; newSignals MOVE.L #$0,D1 ; signalsMask MOVE.L 10(A1),A1 ; Task JSR _LVOSetSignal(A6) MOVE.L A5,A1 ; restore A1 from A5 CMP.L 6(A1),D1 ; check if the signal is still there BEQ.s abort
@sq7bti, post #21
@sq7bti, post #19
@sq7bti, post #21
Mam nadal pewną wątpliwość czy nie lepiej byłoby po prostu wstrzymać generowanie przerwania, do czasu gdy kod .c obsłuży odebrany kod. Tylko jak sprawdzić czy sygnał jest wyzerowany z wnętrza kodu przerwania .s?
Wprowadziłem warunkowe wyjście na samym początku przerwania, ale nie widzę żeby się wykonywał kiedy przewijam okno IBrowse (wtedy miałem "bang!" - czyli nadpisywanie zawartości mousedata.joy0data przez przerwanie). Czyżby kod był na tyle szybki że zdążył się wykonać podczas jednej ramki?
@docent, post #25
0 - 0x0303
1 - 0x0C0C
2 - 0x3030
3 - 0xC0C0
@sq7bti, post #27
FC1E48 lea $1A(A1),A0 Get the set of received signals. FC1E4C move.w #$4000,DFF09A Disable() FC1E54 addq.b #1,$0126(A6) FC1E58 move.l (A0),-(SP) Store the signals. FC1E5A or.l D0,(A0) Or the new signals into the old ones. ; The code from here down is common to SetExcept, SetSignal, and ; Signal. It checks if the task whose signals are being modified ; should be awakened. FC1E5C move.l $1E(A1),D1 Check the exception signals, FC1E60 and.l D0,D1 and see if any of them have become set. FC1E62 bne.s FC1EAE If so, go process them. FC1E64 cmp.b #4,$0F(A1) See if the task is in the TS_WAIT state. FC1E6A bne.s FC1EBE If not, we're done. FC1E6C and.l $16(A1),D0 See if a signal being waited for has been FC1E70 beq.s FC1EBE set. If not, we are done. ..... ; Exit here if the current task was allowed to keep running (i.e. ; the other task did not preempt it). FC1EBE subq.b #1,$0126(A6) Enable() FC1EC2 bge.s FC1ECC FC1EC4 move.w #$C000,DFF09A FC1ECC move.l (SP)+,D0 Return old signals. FC1ECE rts
@docent, post #28
Takie proste fifo to dobry pomysl.
@sq7bti, post #29