English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 12 November 2017, 14:26   #1
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,628
card.resource wtf

I've been looking at the code of card.resource after reading this thread. I checked v37.11 in A600 Kickstart 37.350 and v40.4 in A600 Kickstart 40.63. [There's also a loadable (with LoadModule) card.resource v43.1 linked in this post. Is that official? Where did it come from?]

Are there any known bugs/problems with PCMCIA cards (i.e. card.resource) in Kickstart 3.1? Because there definitely seems to be a bug in versions 40.4 and 43.1.

The initialisation routine is supposed to open timer.device. v37.11 code does that, but in v40.4:
Code:
	LEA	(ReplyPort-LibBase,A5),A0
	MOVEA.L	A0,A3
	MOVEQ	#IOTV_SIZE,D0
	JSR	(_LVOCreateIORequest,A6)
	MOVE.L	D0,(_SomeIORequest-LibBase,A5)
	MOVEA.L	D0,A1	;IORequest
	SUBA.L	A0,A0	;Device name pointer 0!!! Should point to "timer.device"
	MOVEQ	#UNIT_VBLANK,D0	;Unit
	MOVEQ	#0,D1	;Flags
	JSR	(_LVOOpenDevice,A6)

	LEA	(TaskStruct-LibBase,A5),A1
	MOVE.L	A1,(MP_SIGTASK,A3)
Then later on the task code issues TR_ADDREQUEST:
Code:
TaskCode
	MOVEA.L	(4,SP),A5
	MOVEA.L	(_SysBase-LibBase,A5),A6
	MOVEQ	#31,D0
	JSR	(_LVOAllocSignal,A6)
	BRA.B	lbC000678

lbC000644
	BSR.W	lbC000586
	SUBQ.B	#1,(IDNestCnt,A6)
	BGE.B	lbC000656

	MOVE.W	#$C000,(_custom+intena).L
lbC000656
	BSET	#1,(lbB001022-LibBase,A5)
	BNE.B	lbC000678

	MOVEA.L	(_SomeIORequest-LibBase,A5),A1
	MOVE.W	#TR_ADDREQUEST,(IO_COMMAND,A1)
	CLR.L	(IOTV_TIME,A1)
	MOVE.L	#100000,(IOTV_TIME+TV_MICRO,A1)	;1/10 second
	JSR	(_LVOSendIO,A6)

lbC000678
	MOVE.L	#$80000000,D0
	JSR	(_LVOWait,A6)
	LEA	(ReplyPort-LibBase,A5),A0
	JSR	(_LVOGetMsg,A6)
	TST.L	D0
	BEQ.B	lbC000656

	BCLR	#1,(lbB001022-LibBase,A5)
	LEA	(SomeList-LibBase,A5),A0
How can that not crash?
mark_k is offline  
AdSense AdSense  
Old 14 November 2017, 11:50   #2
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,004
Quote:
Originally Posted by mark_k View Post
The initialisation routine is supposed to open timer.device. v37.11 code does that, but in v40.4:
Code:
    LEA    (ReplyPort-LibBase,A5),A0
    MOVEA.L    A0,A3
    MOVEQ    #IOTV_SIZE,D0
    JSR    (_LVOCreateIORequest,A6)
    MOVE.L    D0,(_SomeIORequest-LibBase,A5)
    MOVEA.L    D0,A1    ;IORequest
    SUBA.L    A0,A0    ;Device name pointer 0!!! Should point to "timer.device"
    MOVEQ    #UNIT_VBLANK,D0    ;Unit
    MOVEQ    #0,D1    ;Flags
    JSR    (_LVOOpenDevice,A6)
That's a shortcut used in the ROM to eliminate the many references to "timer.device" and "input.device" strings (probably to save space?).
OpenDevice() with name=0 means "timer.device" and name=1 means "input.device".
phx is offline  
Old 14 November 2017, 15:19   #3
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,628
Thanks, I didn't know that! Do you know whether that behaviour was documented anywhere?
mark_k is offline  
Old 14 November 2017, 18:46   #4
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,004
I don't remember having seen it documented anyhere. I discovered that by looking into the exec/OpenDevice function.

In any case it is not in the official Autodocs.
phx is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
WTF Google? Fingerlickin_B Amiga scene 33 26 June 2015 13:43
The Siamese System, WTF? Bloodwych Retrogaming General Discussion 14 22 August 2014 09:04
WTF ? Elbox ??? majsta Amiga scene 24 02 July 2013 16:42
AmigaKit WTF?... quarkx Amiga scene 13 21 October 2012 22:34
Ball Raider 2 - wtf... andreas support.Games 8 12 March 2004 21:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:59.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.10599 seconds with 14 queries