![]() |
![]() |
#1 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 763
|
narrator.device via assembly
I'm poking around with the narrator.device from workbench 1.3 and am looking to communicate with it via assembly. I've already got some code which opens and closes the device, although it was actually written for the audio.device I can see the request block is being populated with the default values.
What I can't seem to work out is how to write to the device. I have to send it a CMD_WRITE but the examples and structures are all in C, which while I understand (to a low degree) have no idea how to translate that into workable assembly. I kinda understand the request block but can see where I put my pointer to the text and length parameter. Is there a working example in asm somewhere? Any help would be super awesome! http://wiki.amigaos.net/wiki/Narrato...arrator_Device |
![]() |
![]() |
#2 |
Amiga Tomcat
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,501
|
the book "Amiga Machine Language" by "Abacus" includes a section on the Narrator.device.
Have a look on Bombjack for the book. |
![]() |
![]() |
#3 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 763
|
oh my word! I downloaded almost every book from that page to look for narrator examples! except that one! Thanks sooo much pal
![]() |
![]() |
![]() |
#4 |
Amiga Tomcat
Join Date: Sep 2007
Location: Boston Lincs
Posts: 1,501
|
Lol - Same here. It's a good resource.
|
![]() |
![]() |
#5 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 722
|
Starting from this: http://amigadev.elowar.com/read/ADCD.../node01A9.html
I wrote this: Code:
incdir '/usr/local/amiga/m68k-amigaos/asm/Include/' include exec/exec_lib.i include devices/narrator.i XDEF _SysBase move.l $4.w,d0 move.l d0,_SysBase move.l d0,a6 moveq.l #0,d0 move.l d0,-(sp) move.l d0,-(sp) jsr _CreatePort addq #8,sp move.l d0,VoicePort beq noVoicePort move.l #NDI_SIZE,d1 move.l d1,-(sp) move.l d0,-(sp) jsr _CreateExtIO addq.l #8,sp move.l d0,VoiceIO beq noVoiceIO move.l d0,a0 move.l d0,a5 ; save a copy of VoiceIO to a5 (to survive OS calls) lea.l chans,a1 move.l a1,NDI_CHMASKS(a0) move.w #4,NDI_NUMMASKS(a0) move.w #CMD_WRITE,IO_COMMAND(a0) move.b #NDB_NEWIORB,NDI_FLAGS(a0) lea.l narDev,a0 ;device name moveq.l #0,d0 ;unit number move.l d0,d1 ;flags move.l a5,a1 ;iORequest jsr _LVOOpenDevice(a6) tst.b d0 bne noOpenDevice lea.l PhonStr,a0 move.l a0,IO_DATA(a5) move.l #(narDev-PhonStr),IO_LENGTH(a5) move.b #NDB_NEWIORB,NDI_FLAGS(a5) move.l a5,a1 jsr _LVODoIO(a6) move.l a5,a1 jsr _LVOCloseDevice(a6) noOpenDevice: move.l a5,a0 move.l a0,-(sp) jsr _DeleteExtIO addq #4,sp noVoiceIO: move.l VoicePort,a0 move.l a0,-(sp) jsr _DeletePort addq #4,sp noVoicePort: moveq #0,d0 rts section data PhonStr: dc.b 'KAA1RDIYOWMAYAA5PAXTHIY. AY /HAED NEH1VER /HER4D AXV IHT BIXFOH5R.' narDev: dc.b 'narrator.device',0 even chans: dc.b 3,5,10,12 section bss _SysBase: ds.l 1 VoicePort: ds.l 1 VoiceIO: ds.l 1 vasmm68k_mot -Fhunk -o foo.o foo.asm vlink -bamigahunk -o foo foo.o /home/alex/Documents/FS-UAE/Hard\ Drives/AmigaHD/SC/lib/amiga.lib Change paths accordingly. |
![]() |
![]() |
#6 |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 763
|
Nice one, cheers alkis. Will give this a blast. Once it's working, next step it to resource the device!
|
![]() |
![]() |
#7 |
Registered User
Join Date: Mar 2009
Location: moon
Posts: 373
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
K13 asm example of gameport.device and keyboard.device | redblade | Coders. General | 29 | 20 January 2011 18:32 |
uaehf.device and HDToolbox: Error 224 reading device description | Ebster | support.WinUAE | 3 | 16 September 2008 09:24 |
Narrator.device | thinlega | request.Apps | 2 | 31 May 2004 06:37 |
narrator.device? | th4t1guy | support.WinUAE | 4 | 23 April 2004 15:27 |
assembly TV | L8-X | Amiga scene | 2 | 04 August 2002 02:36 |
|
|