Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 11, 2012 11:27:21 GMT -5
UPDATE: Read moons post below this for important information on how to use the values returned by the multi-tap assembly routine. Thanks moon! UPDATE2: Example of regmove use removed at moons request. Instead of continuing to dirty up the "How are your bex projects going" topic I thought I'd continue essexboyracers question here. He cited this thread for assembly code for multi-tap: devster.proboards.com/index.cgi?board=basiegaxorz&action=print&thread=691moon mentioned the use of the REGMOVE command to extract the returned value from these assembly functions. So, it sounds like regmove.l d0, r is the way to go. I assume r.0 through r.7 would produce the bits giving the values for the multi-tap joysticks? To the total n00b it sounds like: 1. Run jlf65's assembly routine for multi-tap 2. Immediatly afterwards do the regmove.l d0, r3. Use r.0 - r.7 to determine joystick input for all 4 joysticks somehow..
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 11, 2012 11:58:45 GMT -5
Immediatly afterwards do the regmove.l d0, rYou need to use the & suffix when moving a 32-bit value to a long variable ( r& instead of just r ). Use r.0 - r.7 to determine joystick input for all 4 joysticks somehow.. The r&.0 - r&.7 range holds the values of joystick 1, r&.8 - r&.15 joystick 2, r&.16 - r&.23 joystick 3, and r&.24 - r&.31 joystick 4. @theloon - And, I've told you this before .. please don't re-post examples that were only meant to show that something does work, but shouldn't actually be used
|
|
|
Post by essexboyracer on Jun 11, 2012 15:12:06 GMT -5
I think I was screwing up the data when moving it from d0. Will try some of your suggestions.
Many thanks
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 11, 2012 16:18:32 GMT -5
When we're all sure the multi-tap + regmove works someone should post an example. The documentation isn't clear what the three forms of regmove are.
If you're concerned about the example I post moon please give us a better one. Or, at least help explain what the regmove.x does. I'll add it to the BEX command reference.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 11, 2012 16:35:39 GMT -5
The documentation isn't clear what the three forms of regmove are. You mean the fact that you can use byte ( 8-bit ) / word ( 16-bit ) / long ( 32-bit )? It's the same situation as the READ / READINT / READLONG commands. Or, at least help explain what the regmove.x does. Not sure what you don't understand about the REGMOVE description in the BEX manual. It simply copies the value of a register to a BEX variable or vice versa ... there's not much to it.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 12, 2012 17:09:03 GMT -5
Thanks for the explanation. No, the BEX docs don't explain: Command_REGMOVE.B: (.B =BYTE) Command_REGMOVE.W: (.W = WORD) Command_REGMOVE.L: (.L = LONG) Those concatenations aren't obvious to BASIC users. The syntax also clashes with Devsters "argunumerics" format too. I'll make sure to update the severely work-in-progress reference! The documentation isn't clear what the three forms of regmove are. You mean the fact that you can use byte ( 8-bit ) / word ( 16-bit ) / long ( 32-bit )? It's the same situation as the READ / READINT / READLONG commands. Or, at least help explain what the regmove.x does. Not sure what you don't understand about the REGMOVE description in the BEX manual. It simply copies the value of a register to a BEX variable or vice versa ... there's not much to it.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 12, 2012 17:55:46 GMT -5
Those concatenations aren't obvious to BASIC users. You're probably right People that have experience with 68K assembly will recognize the "pattern" instantly .. and it is mentioned in the DATAFILE command description, but it should be more obvious indeed. The syntax also clashes with Devsters "argunumerics" format too. Not really .. arguneric use "variable.bit" whereas in this case it is "command.type". Different context.
|
|
|
Post by essexboyracer on Jan 5, 2013 16:16:36 GMT -5
To the total n00b it sounds like: 1. Run jlf65's assembly routine for multi-tap 2. Immediatly afterwards do the regmove.l d0, r3. Use r.0 - r.7 to determine joystick input for all 4 joysticks somehow.. Well in the end I changed jlf65's code a bit, as it never detected the multi-tap for me, also I stripped out the 6 button code, but that could probably go straight back in. So I ended up with the following file named joy8.s which I have in the same folder as my game code get_team: move.l d3,-(sp) move.b #0x60,0xA10009 move.b #0x60,0xA10003 nop nop nop nop move.b #0x20,0xA10003 nop nop nop nop bsr.b get_byte lsl.w #8,d0 bsr.b get_byte move.w d0,d3 bsr.b get_byte lsl.w #8,d0 bsr.b get_byte lsl.l #8,d0 bsr.b get_byte lsl.l #8,d0 bsr.b get_byte lsl.l #8,d0 bsr.b get_byte move.l (sp)+,d3 move.b #0x60,0xA10009 move.b #0x60,0xA10003 rts
get_byte: bsr.b get_nibble lsl.b #4,d0
get_nibble: move.w #99,d2 btst #5,0xA10003 bne.b tl2 move.b #0x20,0xA10003 tl1: move.b 0xA10003,d1 btst #4,d1 dbne d2,tl1 andi.b #0x0F,d1 or.b d1,d0 rts tl2: move.b #0x00,0xA10003 tl3: move.b 0xA10003,d1 btst #4,d1 dbeq d2,tl3 andi.b #0x0F,d1 or.b d1,d0 rts
no_mtap: move.l (sp)+,d3 moveq #99,d0 move.b #0x40,0xA10009 move.b #0x40,0xA10003 rts
Then in my game I have incasm joy8.s which loads the library Then when I want the joystick info, I use call get_team regmove.l d0,a&
The button info is now stored in a&.1 to a&.31 in the following format 0=b, 1=c, 2=a, 3=start, 4=up, 5=downm 6=left, 7=right for pad *3* and then 8-15 holds pad 2 e.t.c... I've tested this on real hardware, and using fusion emulator (team pad in port a). On the real hardware, I seem to need to call get_team extra times to clear a buffer? anyway, I just call get_team twice before moving the register contents to a variable, and that seems ok. I'm still playing with it though, I only got it working in my game today (and it's only briefly tested) It still (to my knowledge) doesn't work if a multitap is not present. Thanks to all who have contributed in helping me get this far! I can at least now make ropey 4 player games to play with my mates
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 7, 2013 16:27:34 GMT -5
It'd be awesome to see the source to your 4 player game or even a little example. This could be THE de-facto BEX 4 player library.
|
|
|
Post by essexboyracer on Jan 8, 2013 5:50:38 GMT -5
I will post an example once I have it working 100%. I tested my game over the weekend with 3 mates, and we experienced some control issues with my initial implementation, expecially when all players were trying to move simultaneously. I'm hoping that it's just a bug in my bex code which I can figure out.
I'm going to play around with it this weekend, and knock up a simple test program to see what's going on!
|
|
|
Post by tiberiyltim on Jan 13, 2020 5:16:42 GMT -5
is there still no correct Multi-Tap code for BEX?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 13, 2020 14:31:48 GMT -5
Not publicly available, no.
|
|