A gift (Hardware MSX Fora)MSX Resource Center PassionMSX MSX2 contest           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 116 gasten en 1 MSX vriend online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Hardware - A gift

Ga naar pagina ( Vorige pagina 1 | 2 | 3 Volgende pagina )
Schrijver

A gift

flyguille
msx master
Berichten: 1183
Geplaatst: 03 November 2005, 01:08   
and it is in the msx standard?

I asks because now i thinks there is the answer to connect a mouse!
Sonic_aka_T

msx guru
Berichten: 2261
Geplaatst: 03 November 2005, 11:48   
(O_o( "Are you saying what I think you're saying?"
flyguille
msx master
Berichten: 1183
Geplaatst: 03 November 2005, 17:34   
)-_O) "what you mean, Sonic?"
wolf_

msx legend
Berichten: 4653
Geplaatst: 03 November 2005, 18:39   
(^_^( "now now, let's behave here!"
)o_O) "It's a bloody shame that we, ubersmileys, are abused like this!"
flyguille
msx master
Berichten: 1183
Geplaatst: 03 November 2005, 19:08   
Quote:

(^_^( "now now, let's behave here!"
)o_O) "It's a bloody shame that we, ubersmileys, are abused like this!"





tfh
msx addict
Berichten: 492
Geplaatst: 03 November 2005, 21:23   
Yes.. The joystickport can send data.
I remember The Pretender Of FONY made a small program to send text through the joystick port. We made it work between two MSX's and an MSX with an Atari (800XL??). Worked quite nicely, but VERY slow!
flyguille
msx master
Berichten: 1183
Geplaatst: 03 November 2005, 22:25   
so, again , how to control the STB lines in assembler?
AuroraMSX

msx master
Berichten: 1228
Geplaatst: 03 November 2005, 23:07   
This is my mouse routine for hitech C. Hitech C passes parameters as offsets to IX. 1st parameter in (IX+6), 2nd in (IX+8) etc etc.

wacht1  EQU   7               ; Wait count
wacht2  EQU   40              ; more wait

        global csv,cret
        global _gtmous

        psect text

; void gtmous(char port, int *dx, int *dy)
_gtmous:
        call    csv
        push    ix
        push    iy

        ld      a,(ix+6)
        cp      1
        jr      nz,port2
port1:
        ld      de,0BF10h
        jr      go
port2:
        cp      2
        jr      nz,noport
        ld      de,0FF20h
        jr      go
noport:
        pop     iy
        pop     ix
        jp      cret

go:
        di
        ld      b,wacht2
        call    gtofs2          ; Read bit 7-4 of X-offset
        rlca
        rlca
        rlca
        rlca
        ld      c,a
        call    gtofst          ; Read bit 3-0 of X-offset
        or      c
        ld      l,a             ; Keep X-offset in L

        call    gtofst          ; Read bit 7-4 of Y-offset
        rlca
        rlca
        rlca
        rlca
        ld      c,a
        call    gtofst          ; Read bit 3-0 of Y-offset
        or      c
        ld      c,a             ; save Y-offset in C
        ld      b,l             ; save X-offset in B

        pop     iy
        pop     ix
        ld      l,(ix+8)
        ld      h,(ix+9)
        ld      a,b
        call    save
        ld      (hl),a
        ld      l,(ix+10)
        ld      h,(ix+11)
        ld      a,c
        call save
        ei
        jp      cret

save:
        ld      (hl),a        ; Store Y-offset
        and     080h
        rlca
        ld      a,0             ; don't clear flags
        sbc     a,0             ; subtract Carry flag
        inc     hl
        ld      (hl),a
        ret

gtofst: ld      b,wacht1
gtofs2: ld      a,15          ; Write E to PSG reg. 15
        out     (0A0h),a
        ld      a,d
        out     (0A1h),a
        xor     e             ; Get next nibble
        ld      d,a           ;
wacht:  djnz    wacht         ; Wait a bit - slow mousey
        ld      a,14          ; Read PSG reg. 14
        out     (0A0h),a
        in      a,(0A2h)
        and     0Fh            ;only bits 3-0 are valid
        ret



Sorry for the dutch labels. Actually the routine isn't even mine. I just dunno anymore where I copied it from.
Ehm, the info you're looking for is in there, somewhere. Forgive me for being lazy
HansO
msx addict
Berichten: 375
Geplaatst: 03 November 2005, 23:10   
The circuit diagrams are now inserted into one pdf.

http://www.hansotten.com - MSX Whats New
flyguille
msx master
Berichten: 1183
Geplaatst: 04 November 2005, 00:56   
interesting mouse rountine.... if i got time , i will do the encapsulation for include it as a driver.
arnold_m
msx lover
Berichten: 81
Geplaatst: 04 November 2005, 08:50   
AuroraMSX wrote
Quote:

This is my mouse routine for hitech C. Hitech C passes parameters as offsets to IX. 1st parameter in (IX+6), 2nd in (IX+8) etc etc.

wacht1  EQU   7               ; Wait count
wacht2  EQU   40              ; more wait

        global csv,cret
        global _gtmous

        psect text

; void gtmous(char port, int *dx, int *dy)
_gtmous:
        call    csv
        push    ix
        push    iy


No need to push ix and iy here, you do not change these registers. Register iy is saved by csv anyway.
Register ix must indeed be preserved, but functions provided with or compiled by HiTech-C will take care of that, so ix is only a concern when you write wrapper functions for other routines.
Quote:

[...]
 save:
        ld      (hl),a        ; Store Y-offset
        and     080h
        rlca
        ld      a,0             ; don't clear flags
        sbc     a,0             ; subtract Carry flag


;       and   080h ; not needed
        rlca
        sbc    a,a    ; faster way to sign-extend

Quote:

        inc     hl
        ld      (hl),a
        ret
[...]



Beware of interrupts, the standard interrupt routine checks the firebuttons, and screws up the synchronisation in the process. Come to think of it, it mayu make sense to put the mouse routine in custom interrupt routine.
AuroraMSX

msx master
Berichten: 1228
Geplaatst: 04 November 2005, 09:39   
Quote:

AuroraMSX wrote
Quote:

This is my mouse routine for hitech C. [...]



Beware of interrupts, the standard interrupt routine checks the firebuttons, and screws up the synchronisation in the process.



That's why I do that DI near the start of the routine and EI at the end
Thanx for the comments; I'll incorporate them into my code!

flyguille
msx master
Berichten: 1183
Geplaatst: 04 November 2005, 15:12   
ok, how this routine reads the buttons of the mouse?
AuroraMSX

msx master
Berichten: 1228
Geplaatst: 05 November 2005, 12:48   
Quote:

ok, how this routine reads the buttons of the mouse?


It doesn't

There's no difference between mouse buttons and joystick buttons; any routine for reading joystick buttons works for mouse buttons, too
flyguille
msx master
Berichten: 1183
Geplaatst: 05 November 2005, 18:14   
aha
 
Ga naar pagina ( Vorige pagina 1 | 2 | 3 Volgende pagina )
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.