Master Paint and Joystick

This is the best place to discuss about the various Oric operating systems like Sedoric, Randos, FT-Dos, and others, as well as serious software, utilities, word processors, disassemblers, etc... that runs on oric computers.
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Master Paint and Joystick

Post by Dbug »

The manual of Master Paint indicates that the software is usable with a Joystick, but does not indicate which type.
The software is absolutely unusable on emulator using the keyboard because of the choice of keys to move the cursor, so I wanted to try the joystick, but I was not able to.

I've not tried my own version, just the oric.org disk version from Dom, and I validated that the Joystick did work fine with Cricutron using my Osdk joystick tester: https://osdk.org/index.php?page=article ... 17#title11

Any idea?

EDIT: Same problem with Lorigraph, both in the TAP and DSK versions...
EDIT2: I tested that Stormlord worked fine with both joyinterface = pase and joyinterface = ijk
User avatar
Steve M
Squad Leader
Posts: 787
Joined: Fri Mar 24, 2006 3:33 am
Location: Cumbria, UK
Contact:

Re: Master Paint and Joystick

Post by Steve M »

I will try and have a look. I have it on disk somewhere, and I think I have a tape.
I think Loriciels used the French joystick interface - but I'm not certain.
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Master Paint and Joystick

Post by iss »

Attached are DSK and TAP version of MasterPaint with working IJK joystick! :D



Some info:
The original joystick routine is at $6FA0. In the ZIP file you can find also the source code (drv.s) which uses my ijk-driver which is already available from github. The driver patches and hooks the joystick handling. The return status need to be placed at $80.

EDIT2: final version attached.
Attachments
master-paint-final.zip
(91.9 KiB) Downloaded 147 times
Last edited by iss on Wed Nov 17, 2021 8:28 pm, edited 2 times in total.
Jonh
Pilot Officer
Posts: 71
Joined: Tue Jun 01, 2021 4:07 pm
Location: Cambridge, UK

Re: Master Paint and Joystick

Post by Jonh »

Here you go, from the vaults....

https://www.oric.org/software/master_paint-127.html

It's in Stuff at the foot of the page.
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Master Paint and Joystick

Post by iss »

Jonh wrote: Wed Nov 17, 2021 12:55 am Here you go, from the vaults....
Yep, I didn't noticed there is English manual too. I've updated the attachment in my first post. :)
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Master Paint and Joystick

Post by Dbug »

@iss: Sure, you made it work (which is cool), but my question was mostly: Why did the original manual claim there was joystick support but it did not actually work when I tried with any of the support interfaces I tried in Oricutron?
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Master Paint and Joystick

Post by iss »

Dbug wrote: Wed Nov 17, 2021 6:51 ambut my question was mostly:...
The used joystick in MP should be PASE like, but it's not compatible with the Oricutrons' implementation.
Probably there can be problem in both (MP and Oricutron). I'll check tonight more deeply.
User avatar
jbperin
Flight Lieutenant
Posts: 480
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Master Paint and Joystick

Post by jbperin »

iss wrote: Tue Nov 16, 2021 11:35 pm Some info:
The original joystick routine is at $6FA0. In the ZIP file you can find also the source code (drv.s) which uses my ijk-driver which is already available from github. The driver patches and hooks the joystick handling. The return status need to be placed at $80.
I really wonder how you hack the software that way ..
If I understand well, you managed to :
  • identify where was the joystick routine and where it was called
  • patch the binary to make it jump to your own joystick routine rather the embedded one
  • repackage the software with your routine called instead of the original one
:shock: That's just magic :shock:
Jonh
Pilot Officer
Posts: 71
Joined: Tue Jun 01, 2021 4:07 pm
Location: Cambridge, UK

Re: Master Paint and Joystick

Post by Jonh »

iss wrote: Wed Nov 17, 2021 2:46 am
Jonh wrote: Wed Nov 17, 2021 12:55 am Here you go, from the vaults....
Yep, I didn't noticed there is English manual too...
You didn't miss it, after your post I found it in my old files and uploaded it just before I posted the message :)
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Master Paint and Joystick

Post by iss »

Jonh wrote: Wed Nov 17, 2021 1:04 pm...I found it in my old files and uploaded it ...
@Jonh: Thanks!

Well, the first post is updated with the final version DSK+TAP IJK and PASE compatible versions!

Here is the problem:

Code: Select all

  6FA0  A9 40     LDA #$40                        6FA0  A9 40     LDA #$40
  6FA2  8D 0E 03  STA VIA_IER                     6FA2  8D 0E 03  STA VIA_IER
  6FA5  EA        NOP                             6FA5  EA        NOP
  6FA6  AD 01 03  LDA VIA_IORA                    6FA6  AD 01 03  LDA VIA_IORA
  6FA9  48        PHA                             6FA9  48        PHA
  6FAA  AD 03 03  LDA VIA_DDRA                    6FAA  AD 03 03  LDA VIA_DDRA
  6FAD  48        PHA                             6FAD  48        PHA

  6FAE  A9 C0     LDA #$C0                        6FAE  A9 C0     LDA #$C0
  6FB0  8D 03 03  STA VIA_DDRA                    6FB0  8D 03 03  STA VIA_DDRA
                     ==========================================
  6FB3  A9 00     LDA #$00      <------ ????      6FB3  8D 01 03  STA VIA_IORA
  6FB5  8D 01 03  STA VIA_IORA                    6FB6  AD 01 03  LDA VIA_IORA
  6FB8  AD 01 03  LDA VIA_IORA                    6FB9  29 3F     AND #$3F
                     ==========================================
  6FBB  85 80     STA $80                         6FBB  85 80     STA $80

  6FBD  68        PLA                             6FBD  68        PLA
  6FBE  8D 03 03  STA VIA_DDRA                    6FBE  8D 03 03  STA VIA_DDRA
  6FC1  68        PLA                             6FC1  68        PLA
  6FC2  8D 01 03  STA VIA_IORA                    6FC2  8D 01 03  STA VIA_IORA
  6FC5  A9 C0     LDA #$C0                        6FC5  A9 C0     LDA #$C0
  6FC7  8D 0E 03  STA VIA_IER                     6FC7  8D 0E 03  STA VIA_IER
  6FCA  4C 74 76  JMP $7674                       6FCA  4C 74 76  JMP $7674
The original interface is PASE (or compatible) and storing #$00 to VIA PORTA actually deactivates the interface.
On the right is the FIXED version with the sweet side-effect: you can use both (left and right) joysticks to draw :twisted:

@Dbug: I hope your question is now answered :wink:
jbperin wrote: Wed Nov 17, 2021 10:10 am :shock: That's just magic :shock:
@jbperin: Sometimes you need just little bit luck (... and decades strolling in 'The Matrix' ).

Anyway, it was interesting challenge and the program really deserves the invested time.
Post Reply