Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
162 user(s) are online (154 user(s) are browsing Forums)

Members: 1
Guests: 161

nbache, more...

Support us!

Headlines

 
  Register To Post  

Assembly: Paula sound?
Home away from home
Home away from home


See User information
I have no clue what I'm doing wrong.
I'm trying to get some sound out of EUAE, I'm using the Amiga Hardware Reference Manual,
page 146, if I'm not mistaken audio has to be in chip memory? So it can't be part of program code?

So I have changed the example a tiny bit.

OldOpenLibrary EQU -$0198
WriteChars EQU -$03AE
CloseLibrary EQU 
-$019E

ALLOCMEM    EQU 
-198
FREEMEM        EQU    
-210

HARDBASE    EQU    $DFF000
AUD0LCH        EQU    
$0A0
AUD0LCL        EQU 
$0A2
AUD0LEN        EQU 
$0A4
AUD0VOL        EQU    
$0A8
AUD0PER        EQU    
$0A6
DMACON        EQU 
$096

    
SECTION MAIN,CODE

MAIN
:
        
LEA DOS(pc),A1
        move
.l  4.w,a6
        jsr     OldOpenLibrary
(a6
        
move.l  d0,DOSBASE
        beq
.s   .Out

        move
.l  #msg_start,d1
        
moveq  #9,d2
        
JSR .Write

        MOVE
.l 4.w,a6

        MOVE
.#100,D0    ; size
        
MOVE.#2,D1        ; chip mem
        
JSR ALLOCMEM(a6)
        
MOVE.l d0,SINDATA
        BEQ
.s    .NOMEM
        
        LEA
.l HARDBASE,a0

        MOVE
.L SINDATA,a1
        MOVE
.L a1,AUD0LCH(a0)

        
MOVE.#4,AUD0LEN(a0)
        
MOVE.#64,AUD0VOL(a0)
        
MOVE.#447,AUD0PER(a0)
        
MOVE.#8201,DMACON(a0)

        
MOVE.l 4.w,a6
        MOVE
.l SINDATA,a1

        MOVE
.b 0,0(a1)
        
MOVE.b 90,1(a1)
        
MOVE.b 127,2(a1)
        
MOVE.b 90,3(a1)
        
MOVE.b 0,4(a1)
        
MOVE.-90,5(a1)
        
MOVE.-127,6(a1)
        
MOVE.-90,7(a1)

        
MOVE.#100,D0
        
JSR FREEMEM(a6)

        
move.l  #msg_ok,d1
        
moveq  #7,d2
        
JSR .Write
        JMP 
.Out        
.NOMEM:
        
move.l  #msg_nomem,d1
        
moveq  #13,d2
        
JSR .Write
        JMP 
.Out        
.Write:
        
move.l DOSBASE,A6
        jsr     WriteChars
(a6)  
        
RTS
.Out:
        
move.l  DOSBASE,a1
        move
.l  4.w,a6
        jsr     CloseLibrary
(a6)
        
RTS
DOS
:
        
dc.b    "dos.library",0
DOSBASE
:
        
dc.l 0
SINDATA
:
        
DC.L    0
msg_start
:
        
dc.b   "START!!!",$A,0
msg_ok
:
        
dc.b    "OK!!!!",$A,0
msg_nomem
:
        
dc.b    "AllocMem failed, no memory!",$A,0


Edited by LiveForIt on 2013/1/10 23:13:46
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Paula sound?
Home away from home
Home away from home


See User information
Ok, I did some thing stupid here, trying to play sound before I setup the sound wave.
I will try to fix this when I get home.


Edited by LiveForIt on 2013/1/10 16:22:02
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Paula sound?
Quite a regular
Quite a regular


See User information
You're using Paula a custom hardware with its hardware registers, so yes it uses the chip memory.

I've tried in the past to write 68k code under WinUAE or EUAE, but it's not the best. Better to write machine language programming in real classic hardware.

To Be A True Adventurer, You Ought To Play Real Text Adventures
Go to top
Re: Paula sound?
Home away from home
Home away from home


See User information
Don't have any hardware whit this chips anymore, anyway I find it interesting that CUSTUM or HARDBASE is constant that is often loaded in register, so it should relatively easy to move hardware from a fixed address to a PCI card, if you have the source code.

I was thinking if I replaced

MOVE.W #8201,DMACON(a0)

Whit something like this

MOVE DO,-(SP)
MOVE #8201,D0
JSR .SET_DMACON
MOVE.L (SP)+,D0

It might be simple to emulate DMACON on AHI, whit in an application.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Paula sound?
Home away from home
Home away from home


See User information
EUAE does not make a peep, but I fixed a few mistakes, I hope some one can tell me what the problem is.

EXECBASE EQU 4

OldOpenLibrary EQU 
-$0198
WriteChars EQU -$03AE
CloseLibrary EQU 
-$019E
Delay EQU 
-198

ALLOCMEM    EQU 
-198
FREEMEM        EQU    
-210

CUSTOM        EQU    $DFF000
AUD0LCH        EQU    
$0A0
AUD0LCL        EQU 
$0A2
AUD0LEN        EQU 
$0A4
AUD0VOL        EQU    
$0A8
AUD0PER        EQU    
$0A6
DMACON        EQU 
$096

    
SECTION MAIN,CODE

MAIN
:
        
LEA DOS(pc),A1
        MOVE
.#0,D0
        
MOVE.l EXECBASE,a6
        jsr     OldOpenLibrary
(a6
        
move.l  d0,DOSBASE
        beq
.s   .Out

        move
.l  #msg_start,d1
        
moveq  #9,d2
        
JSR .Write

        
Alloc Sound wave
        MOVE
.#100,D0    ; size
        
MOVE.#2,D1        ; chip mem
        
MOVE.l EXECBASE,a6
        JSR ALLOCMEM
(a6)
        
MOVE.l d0,SINDATA
        BEQ
.s    .NOMEM
    
        
Setup sound wave
        MOVE
.L SINDATA,a1
        MOVE
.b 0,0(a1)
        
MOVE.b 90,1(a1)
        
MOVE.b 127,2(a1)
        
MOVE.b 90,3(a1)
        
MOVE.b 0,4(a1)
        
MOVE.-90,5(a1)
        
MOVE.-127,6(a1)
        
MOVE.-90,7(a1)

        ; 
trun off audiodisable DMA
        MOVE
.#0201,DMACON(a0)

        
Play sound
        LEA
.l CUSTOM,a0
        MOVE
.l SINDATA,AUD0LCH(a0)  ; sound wave to play
        MOVE
.#4,AUD0LEN(a0) ; length of sound wave
        
MOVE.#64,AUD0VOL(a0) ; sound volume
        
MOVE.#447,AUD0PER(a0) ; set audio period
        
enable (bit 15dma (bit 9), audio channel 0 (bit 0
        
MOVE.#8201,DMACON(a0)

        
Wait for sound to be played
        move
.l DOSBASE,A6
        move
.#20,D1
        
JSR Delay(A6)

        ; 
Free sound wave
        MOVE
.#100,D0
        
MOVE.l SINDATA,a1
        MOVE
.l EXECBASE,a6
        JSR FREEMEM
(a6)

        
move.l  #msg_ok,d1
        
moveq  #7,d2
        
JSR .Write
        JMP 
.Out        
.NOMEM:
        
move.l  #msg_nomem,d1
        
moveq  #13,d2
        
JSR .Write
        JMP 
.Out        
.Write:
        
move.l DOSBASE,A6
        jsr     WriteChars
(a6)  
        
RTS
.Out:
        
move.l  DOSBASE,a1
        move
.l  EXECBASE,a6
        jsr     CloseLibrary
(a6)
        
RTS
DOS
:
        
dc.b    "dos.library",0
DOSBASE
:
        
dc.l 0
SINDATA
:
        
DC.L    0
msg_start
:
        
dc.b   "START!!!",$A,0
msg_ok
:
        
dc.b    "OK!!!!",$A,0
msg_nomem
:
        
dc.b    "AllocMem failed, no memory!",$A,0

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Paula sound?
Just popping in
Just popping in


See User information

Quote:
It might be simple to emulate DMACON on AHI, whit in an application.


You mean like:

http://os4depot.net/index.php?functio ... e=audio/misc/nallepuh.lha

Go to top
Re: Paula sound?
Home away from home
Home away from home


See User information
@flow
Nellepuh does not work whit AmigaOS4.1 only 4.0, it conflicts whit something AmigaOS4.1 does, maybe CUSTUM address is not reserved address space.

Anyway old software have number of problems, wrong timing, don't use timer.device but instead uses CIAA and CIAB timers, read joystick IO from fixed hardware addresses and so on, so if you really like something to work, you need to disassemble it, fix it and recompile it, then you create a binary patch.

On Aminet there is a package for disassemble Amiga executable hunk files.

http://aminet.net/package/dev/asm/ira

you can then use 680x0 compiler like the one provided whit vbcc

http://lifeofliveforit.blogspot.no/20 ... opment-enviroment-on.html

Nellepuh is not doing the same thing, Nellepuh is catching illegal read and write operations using the MMU, and then handles emulation whit interrupt routine. Nellepuh does not correct timing or make program more system friendly.


Edited by LiveForIt on 2013/1/11 9:43:52
Edited by LiveForIt on 2013/1/11 9:49:58
Edited by LiveForIt on 2013/1/11 9:50:36
(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Paula sound?
Home away from home
Home away from home


See User information
Now back to topic way is it not playing sound?

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: Paula sound?
Just can't stay away
Just can't stay away


See User information
@LiveForIt

Quote:

MOVE.W #8201,DMACON(a0)


This value should be hexadecimal:
MOVE.W #$8201,DMACON(a0)

Go to top
Re: Paula sound?
Home away from home
Home away from home


See User information
Yes thats it, its always the simple stuff thats the most annoying.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top

  Register To Post

 




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




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project