Webzz Posted August 27, 2006 Share Posted August 27, 2006 I need some help with the RMT player. I want to use it in my ML program, but not sure how to go about it. I am not using graphics so have DMA turned off. I figure it would be best to use it in the VBI but am confused as to what program I need to put there and point to. I also want to call different songs or clips, depending on the event. Thanks. Quote Link to comment Share on other sites More sharing options...
raster/c.p.u. Posted August 28, 2006 Share Posted August 28, 2006 (edited) It's easy. ldx #<MODUL ;low byte of RMT module to X reg ldy #>MODUL ;hi byte of RMT module to Y reg lda #0 ;starting song line 0-255 to A reg jsr RASTERMUSICTRACKER;Init ; ldy #<vbi ldx #>vbi lda #$07 jsr $e45c ;Start VBI routine ... ; And VBI routine: vbi jsr RASTERMUSICTRACKER+3;1 play ; jmp $e462 ;end vbi That's all. If you want use RMT also for SFX effects, please, see the /asm_src/sfx/sfx.a65 example. There is all you need to do. Edited August 28, 2006 by raster/c.p.u. Quote Link to comment Share on other sites More sharing options...
Gury Posted August 28, 2006 Share Posted August 28, 2006 It's great to have such a player integrated in your own code. When I have more time I will check if it is possible to use it in ACTION! language, as it allows you to implement anything you like, even in assembler inline code. I know RMT player uses zero page addresses so it could be a problem if ACTION! uses them either. Quote Link to comment Share on other sites More sharing options...
Webzz Posted August 28, 2006 Author Share Posted August 28, 2006 Thanks Raster, looks too easy!! Is there a way to play SAP files on the 8 bit. I only see PC players, and it would be cool to use some of the old musix. Quote Link to comment Share on other sites More sharing options...
raster/c.p.u. Posted August 29, 2006 Share Posted August 29, 2006 It's great to have such a player integrated in your own code. When I have more time I will check if it is possible to use it in ACTION! language, as it allows you to implement anything you like, even in assembler inline code. I know RMT player uses zero page addresses so it could be a problem if ACTION! uses them either. Yes, RMT uses more zero page addresses, but it isn't a big problem - at the beginning of player routine you can store registers in this area to some temporary memory area and at the end of player routine restore it. (if no better way will be found ) Quote Link to comment Share on other sites More sharing options...
Gury Posted August 29, 2006 Share Posted August 29, 2006 Thanks for this info. I will definitely talk about it with you sometime But I will have to consider the cycle usage, too. Even if a program uses character sets for graphics and software sprite engine (with P/M underlying), cycles taken for RMT player will probably slow down the gameplay. First good place would be title screen, for main gameplay I will have to think a lot about resource usage. Battleship approaching... Careful!!! Destroyed... Quote Link to comment Share on other sites More sharing options...
Allas Posted August 29, 2006 Share Posted August 29, 2006 Let me understand this technical stuff. Why RMT player in a VBI spends time for main process? I thinked VBI cycles time is always considered as free aditional time, using or not. Maybe, when a VBI routine exceeds the 20000 cycles of deferred VBI, then spends main time? If this is true, in this way... DLIs could spend main time too? So many questions... Quote Link to comment Share on other sites More sharing options...
pseudografx Posted August 29, 2006 Share Posted August 29, 2006 Let me understand this technical stuff. Why RMT player in a VBI spends time for main process? I thinked VBI cycles time is always considered as free aditional time, using or not. Maybe, when a VBI routine exceeds the 20000 cycles of deferred VBI, then spends main time? If this is true, in this way... DLIs could spend main time too? So many questions... Neither DLI nor VBI routines use any kind of "free" time, in fact they steal CPU time so the more things you do in VBI or DLI, the less computational power you have left. Correct me if I'm wrong. Quote Link to comment Share on other sites More sharing options...
Allas Posted August 29, 2006 Share Posted August 29, 2006 (edited) I thinked CPU halts between the beam get the current next line position, and in VBI the CPU halts until the beam get the first screen position. But... I think i was wrong... Then, DLIs and specially VBI are using as clock process, but every code in a interrupt routine spend CPU process. How about sprites, Ive heard activate sprites spends main time too?? Edited August 29, 2006 by Allas Quote Link to comment Share on other sites More sharing options...
JamesD Posted August 29, 2006 Share Posted August 29, 2006 DRAM refreshes, screen refreshes, sprites, you name it all take time away from the CPU on most old systems. However, the sprite hardware saves a lot more clock cycles than what it would take to duplicate in software. If you have a 130XE, you can run code out of the bank switched RAM to avoid the slowdown since it's on a separate buss. Sadly, I don't think Atari put page 0 and 1 (stack) on a different buss than the graphics hardware so you still suffer some slowdown. Quote Link to comment Share on other sites More sharing options...
Gury Posted August 30, 2006 Share Posted August 30, 2006 Hi Allas, I see you are working on a game project. Could you tell me what it is all about? Any progress? We hope you will finish it to show us your masterpiece Quote Link to comment Share on other sites More sharing options...
analmux Posted August 30, 2006 Share Posted August 30, 2006 If you have a 130XE, you can run code out of the bank switched RAM to avoid the slowdown since it's on a separate buss. Sadly, I don't think Atari put page 0 and 1 (stack) on a different buss than the graphics hardware so you still suffer some slowdown. huh ?? As far as I know there is only one bus in any type of atari 8bit, so all memory has same bus. Normal memory, stack, zero page, extended (130XE) memory. The only difference in an 130XE is that you can allow Antic and CPU to access the extra RAM independently, but not really simultaneously. Quote Link to comment Share on other sites More sharing options...
JamesD Posted August 30, 2006 Share Posted August 30, 2006 If you have a 130XE, you can run code out of the bank switched RAM to avoid the slowdown since it's on a separate buss. Sadly, I don't think Atari put page 0 and 1 (stack) on a different buss than the graphics hardware so you still suffer some slowdown. huh ?? As far as I know there is only one bus in any type of atari 8bit, so all memory has same bus. Normal memory, stack, zero page, extended (130XE) memory. The only difference in an 130XE is that you can allow Antic and CPU to access the extra RAM independently, but not really simultaneously. Ya know, that was obviously wrong after I did some looking but I was sure I read it in a review of the machine and that's where I got the idea. I probably just misunderstood. Quote Link to comment Share on other sites More sharing options...
Allas Posted August 30, 2006 Share Posted August 30, 2006 (edited) Hi Allas, I see you are working on a game project. Could you tell me what it is all about? Any progress? We hope you will finish it to show us your masterpiece Thanks, surely when it is the right moment, I'll share my work, but don't expect so much from me. Edited August 30, 2006 by Allas Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.