Welcome, Guest. Please login or register.

Author Topic: Blllludy devices!  (Read 5849 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline iamaboringpersonTopic starter

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: Blllludy devices!
« Reply #14 from previous page: February 02, 2003, 08:26:36 PM »
Quote

ncafferkey wrote:
That should be #include and for compatibility with all compilers.

i suppose before i destroy my beloved A4000T, ill try that too!
 :-(
 

Offline iamaboringpersonTopic starter

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: Blllludy devices!
« Reply #15 on: February 07, 2003, 07:47:35 PM »
Quote

Steady wrote:
I had a quick play and think I've found the source of your problem. It is basically as Karlos pointed out earlier. Casting is your problem.

amiga.lib's CreateExtIO function is expecting to return an IORequest pointer. You are expecting an IOStdReq pointer.

exec.library's OpenDevice function is causing the same problem for you, but in reverse. You should cast as follows assuming your variables are still defined in the same way:

if(!(GameMP=CreatePort("RKM_game_port",0)))
   cleanexit();

if(!(GameIO=(struct IOStdReq *)CreateExtIO(GameMP,sizeof(struct IOStdReq))))
   cleanexit();

if(error=OpenDevice("gameport.device",1,(struct IORequest *)GameIO,0))
   cleanexit();


Hope that helps.

ok, thanks steady! after much #### ing around, i just ripped my code out stuck yours in, and it worked
but now i have another problem, which is the same thing i had a year ago when i was trying to use "keyboard.device"
it opens ok, but when it finaly flushes and closes the thing, the whole machine crashes, ive tried to use storms debug modes, but the machine will only crash
ill try to get the code here soon if that will help, but its basically whats found in the ARKRMs, except with the extra casting stuck in
 :-)
last time with the keyboard stuff, i just commented-out the device close bits and exited the program without any of that clean up!!  :-o
but this time i want to do things properly of course