Welcome, Guest. Please login or register.


Author Topic: Raster Runner 4 player (Read 25546 times)

Offline geco

  • EP addict
  • *
  • Posts: 7082
  • Country: hu
    • Támogató Támogató
Re: Raster Runner 4 player
« Reply #45 on: 2021.September.19. 11:22:13 »
jól föst.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Raster Runner 4 player
« Reply #46 on: 2021.September.19. 13:41:56 »
Kíváncsian várom, hogy működik-e a játék az Ön gyönyörű felületével.

I am eager to know if the game works with your gorgeous interface.

Offline Judge

  • EP lover
  • *
  • Posts: 677
  • Country: hu
Re: Raster Runner 4 player
« Reply #47 on: 2021.September.19. 20:08:40 »
Kíváncsian várom, hogy működik-e a játék az Ön gyönyörű felületével.

I am eager to know if the game works with your gorgeous interface.

Én is... :lol:

Me too... :lol:
Üdv.Judge

Offline Judge

  • EP lover
  • *
  • Posts: 677
  • Country: hu
Re: Raster Runner 4 player
« Reply #48 on: 2021.September.26. 22:48:07 »
Jelentem az EP MultiJoy projekt elkészült. A szombati klubban kipróbálható lesz, ha lesz 4db joystick és négy vállalkozó szellemű játékos. :cool: :)

[ Guests cannot view attachments ]   [ Guests cannot view attachments ]   [ Guests cannot view attachments ]  

EP MultiJoy project is done.
Üdv.Judge

Offline Dr.OG

  • Global Moderator
  • EP lover
  • *
  • Posts: 742
  • Country: hu
  • dr.
Re: Raster Runner 4 player
« Reply #49 on: 2021.September.27. 06:20:28 »
Nagyon babán néz ki, gratulálok!
ÉN ekelek, TE keregsz, Ő gyeleg,
MI ákolunk, TI vornyáztok, ŐK lendeznek.

Offline szipucsu

  • Global Moderator
  • EP addict
  • *
  • Posts: 9898
  • Country: hu
    • Támogató Támogató
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: Raster Runner 4 player
« Reply #50 on: 2021.September.27. 13:43:06 »
Jelentem az EP MultiJoy projekt elkészült.
Elég jónak tűnik!
Ezt a 4 joyt basicből is lehet figyelni valahogy? Pl. a joy(0), joy(1), joy(2) mellé odakerül a joy(3) vagy joy(4) is? Vagy ha az egyik külső a belső joy kivezetése, akkor csak joy(3) kell.
100 SOUND SOURCE 2,STYLE 128,PITCH 25.2,SYNC 1
110 SOUND PITCH 25,SYNC 1
120 ! Videos

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Raster Runner 4 player
« Reply #51 on: 2021.September.28. 11:08:09 »
Sorry, only in English.


It is very easy to read the four joysticks with a machine code routine.

The ideal routine can be to put on 4 consecutive positions the values of the switches. The four joysticks can be read at the same time, returning a number with the same format as the JOY(X) command. Loading HL with the real address of the routine will make it easier, so we will call it with CALL USR(JOYS,JOYS)

Something like this:

Code: [Select]
ORG:      JR START        ;HL points to ORG
Joy1:     db 0
Joy2:     db 0
Joy3:     db 0
Joy4:     db 0
START:
          XOR A
          LD B,A
          LD C,5
          ADD HL,BC

                    ; HL now contains Joy4

          LD B,4
LOOP1:    LD (HL),A     ;Clears the 4 Joysticks status downwards
          DEC HL
          DJNZ LOOP1
          
          INC HL      ; HL now contains Joy1
        
                            
                 ; First iteration: A holds 0 , so rows 0 to 4 are processed
                 ; Second iteration A holds 5 , so rows 5 to 9 are processed


READ:     LD BC, 0500h    ; B counts the 5 switches, and C will hold temporarily Joy3 or Joy4 status
LOOP2:    PUSH AF         ; Save A as a row counter
          DI  
          OUT (B5h),A     ; Read Joystick port, row A
          IN A,(B6h)
          EI
          CPL             ; we need to invert A, because a switch pressed gives us a bit reset(=0)
          RRA             ;Button on column J is saved to Carry
          RL (HL)         ;Then Carry is stored on (HL), Joy1 and later on Joy2
          RRA             ;Column K is discarded
          RRA             ;Button on column L is saved to Carry
          RL C            ;Then Carry is stored on C, Joy3 and later on Joy4
          POP AF          ;retrieve A as row counter
          INC A           ;and increase it
          DJNZ LOOP2

          INC HL
          INC HL
          LD (HL), C      ; temporary C is saved on  Joy3 and later on Joy4
          DEC HL
          CP 5             ;If the lower rows still remain not read, then jump READ one more time
          JR Z, READ

          RET


This way you can know the status of a joystick with only executing something like JOYSTICK3=PEEK(JOYS+1+3), and then you can continue with the common parsing of the joystick buttons.

Disclaimer.... I am not a coder, the routine can be plagued of errors....

Edit: I realised that the routine was not relocatable. Fixed.

Edit: advised by ergoGnomik, I have added an INC HL at the start.

Edit: all these INC HL and DEC HL replaced by adding 5 to HL.
« Last Edit: 2021.September.30. 17:07:43 by gflorez »

Offline ergoGnomik

  • EP addict
  • *
  • Posts: 1291
  • Country: hu
  • Stray cat from Commodore alley
Re: Raster Runner 4 player
« Reply #52 on: 2021.September.28. 15:12:45 »
That's strange. Shouldn't you increment HL twice before LOOP1? As it is now, I think, it'll corrupt the relative jump address at first run. And it may cause crash at subsequent calls.

On a different note, this helps szipucsu not at all. He is an IS-BASIC only guy.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Raster Runner 4 player
« Reply #53 on: 2021.September.28. 15:22:14 »
Yes, sorry, you are right.... one more INC HL has been added.

Please correct me if you find more errors.

My plan is to write this all on a little Basic program that injects the subroutine at the start of the program, so then it will be useful to szipucsu.

Thanks.
« Last Edit: 2021.September.28. 20:42:47 by gflorez »

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14722
  • Country: hu
    • http://enterprise.iko.hu/
Re: Raster Runner 4 player
« Reply #54 on: 2021.September.28. 19:55:42 »
Jelentem az EP MultiJoy projekt elkészült.
Lehet majd rendelni is ilyet?

Offline Judge

  • EP lover
  • *
  • Posts: 677
  • Country: hu
Re: Raster Runner 4 player
« Reply #55 on: 2021.September.28. 21:01:44 »
Lehet majd rendelni is ilyet?

Először legyen egy teszt a klubban és ha müködik akkor meglátjuk.
Még nem is tudjuk, hogy működik e rendesen, de a külalakjára máris súlyos kritikát kaptam... :shock: :cry: :smt017
Szavazzátok meg, most tényleg annyira igénytelen a kinézete? És biztos, hogy egy adapternél ez a legfontosabb szempont? :roll:
Üdv.Judge

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14722
  • Country: hu
    • http://enterprise.iko.hu/
Re: Raster Runner 4 player
« Reply #56 on: 2021.September.28. 21:52:58 »
Nekem tetszik! Csak ha lehetne, én zöldben kérném :-)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Raster Runner 4 player
« Reply #57 on: 2021.September.28. 22:35:21 »
Hogyan ítélheti meg bárki is a munkádat?

Küldje el őket, hogy hozzák létre a saját adapterüket.


How can anyone judge your work?

Send them to create their own adapter.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: Raster Runner 4 player
« Reply #58 on: 2021.September.29. 01:11:06 »
Oké, ez a lista úgy tűnik, hogy működik a Joy1 és Joy2.

Kérlek Judge, ki tudod próbálni az adaptereddel?


Ok, this listing seems to work on Joy1 and Joy2.

Please Judge, can you try it with your adapter?

  100 PROGRAM "4JOYS.BAS"
  110 ALLOCATE 50
  120 CODE JOYS=HEX$("18,04,00,00,00,00,AF,47,0E,05,09,06,04,77,2B,
10,FC,23,01,00,05,F5,F3,D3,B5,DB,B6,FB,2F,1F,CB,16,1F,1F,CB,11,F1,3C,
10,ED,23,23,71,2B,FE,05,28,E2,C9")
  130 DO
  135   CALL USR(JOYS,JOYS)
  141   LET JOYSTICK1=PEEK(JOYS+1+1)
  142   LET JOYSTICK2=PEEK(JOYS+1+2)
  143   LET JOYSTICK3=PEEK(JOYS+1+3)
  144   LET JOYSTICK4=PEEK(JOYS+1+4)
  150   PRINT JOYSTICK1,JOYSTICK2,JOYSTICK3,JOYSTICK4
  160 LOOP

Offline Dr.OG

  • Global Moderator
  • EP lover
  • *
  • Posts: 742
  • Country: hu
  • dr.
Re: Raster Runner 4 player
« Reply #59 on: 2021.September.29. 07:04:31 »
Nekem semmi bajom a külalakkal, én is előrendelnék egyet. Nekem bármilyen színben megfelel, de a fekete/sötétszürke lenne a legjobb.
ÉN ekelek, TE keregsz, Ő gyeleg,
MI ákolunk, TI vornyáztok, ŐK lendeznek.