![]() |
|
|||||||
| Register | >> Amiga FAQ/Wiki << | Rules & Help | Members List / Moderators List | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools |
|
|
#41 | |
|
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 39
Posts: 5,026
|
Quote:
![]()
__________________
Former member of: LSD, Scoopex, Razor 1911, Dual Crew Shining, Rednex, Fairlight.www.southwestscrap.co.uk |
|
|
|
|
|
|
#43 | |
|
Zone Friend
|
Quote:
I have question. How many cycles eat CLR.L $DFF088 on 68000 ? And the second one. How check that the answer is correct ? Regards
__________________
Asman |
|
|
|
|
|
|
#44 |
|
Oldskool Demo Coder
|
On the 68000, 8 cycles if operand is register direct or immediate, as in this case.
There's always a "break even" point between successive adds and rotate instructions. For longs, a rotate instruction should be used if the shift is greater than 1, I think. One of these nice solutions is the fastest. If there is a tie, the one with the fewest instructions will cause less competition with DMA, if the code is in chipmem (ie. works on unexpanded A500). I haven't calculated, but I suspect t0ne's will be the one. Might even be faster than the table one (don't have my timing sheet here but ... 14+4 for the table, 4+14+8... so could break even if the extra longword memory access would have to wait for two blitter cycles...) But in this case, a table would be crap. Because in order to do it correctly, it would have to be 64K longs = 256K!
__________________
Henrik. Programs Amiga demos, iPhone apps, websites, etc. A1000/512k - A500 2.0/040@28/4M/.5M slowmem/8M/SCSI/CF - A600 portable II 3.1/ACA630/WiFi/CF - 'A1700' 3.1/68060@80/64M/IDE-Fix Express/CF - etc."The difference between PC and Amiga is that 10yo PCs are worth $0. 20yo Amigas are worth a lot, and Amigas that are only 15yo cost a fortune!" If you like Portal 2, try my >> single player and cooperation maps << |
|
|
|
|
|
#45 |
|
68k wisdom
Join Date: Nov 2007
Location: Lyon (France)
Age: 40
Posts: 979
|
For those who like weird things : what happens when opcode $FF10 is executed by a 68020 or 68030 (EC or not) in user mode ?
__________________
He who insults the other in a discussion is the one who's wrong. |
|
|
|
|
|
#46 |
|
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 4,547
|
Should simply trigger a line-f exception.
|
|
|
|
|
|
#47 | |
|
Registered User
Join Date: Jun 2008
Location: Glasgow/Scotland
Posts: 209
|
Quote:
![]() |
|
|
|
|
|
|
#48 |
|
68k wisdom
Join Date: Nov 2007
Location: Lyon (France)
Age: 40
Posts: 979
|
But will not. Instead you'll get a privilege violation exception (try it if you don't believe me).
A note about poking to DFF088 : there's no reason to do that anyway, apart if you want your freshly initialized copperlist to start right in the middle of actual screen and make you see garbage during one frame ![]()
__________________
He who insults the other in a discussion is the one who's wrong. |
|
|
|
|
|
#49 | ||
|
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 38
Posts: 11,942
|
Quote:
Quote:
![]() |
||
|
|
|
|
|
#50 | ||
|
68k wisdom
Join Date: Nov 2007
Location: Lyon (France)
Age: 40
Posts: 979
|
Quote:
Quote:
And if you want 100% robust code then it's better to waitvbl() after setting up your coplist.
__________________
He who insults the other in a discussion is the one who's wrong. |
||
|
|
|
|
|
#51 | ||
|
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 38
Posts: 11,942
|
Quote:
![]() Bits 9-11 is FPU ID number = ignored when decoding the instruction type. (EDIT: not 12-10. Never used in Amiga but there it is in official Motorola manuals) Quote:
Last edited by Toni Wilen; 24 May 2009 at 19:27. |
||
|
|
|
|
|
#52 | |
|
68k wisdom
Join Date: Nov 2007
Location: Lyon (France)
Age: 40
Posts: 979
|
Quote:
COPROCESSOR ID=1 -> FPU. Perhaps YOU need to look in your CPU manual again ![]() 0 is MMU (which means F800 isn't MMU even in weird EC030, but I already told this to you someday), 2 is 040 cache control (cinvl, cinvp, cpusha, etc.), 3 is move16 block (040), 4 is power control (lpstop, 060), 5 is debug block ( wddata, wdebug), 6 and 7 are unused. If you initialize custom registers by hand, just turn the copper dma off.
__________________
He who insults the other in a discussion is the one who's wrong. |
|
|
|
|
|
|
#53 | ||
|
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 38
Posts: 11,942
|
Quote:
![]() You are partially right but 020 and 030 still considers bits 9-11 as "no care" when decoding, afaik it is meant for other external support chips just like 68851 MMU or 68881 FPU. CPU don't know (or care) if they exist or not ![]() (btw, there is no 030 MMU emulation so it isn't something important) Quote:
Just complaining because this isn't rare error at all, just check recent post in this forum ![]() |
||
|
|
|
|
|
#54 | ||
|
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 38
Posts: 11,942
|
Quote:
Quote:
![]() |
||
|
|
|
|
|
#55 |
|
Oldskool Demo Coder
|
clr.l $dff088 takes 32 cycles according to my docs. The fastest way to accomplish the exact same thing is a move.l Dn,(An) (12 cycles), or to make it a part of a movem.l, in which case it takes 8 cycles+one or two for the shared start of the movem, depending on how many registers share the movem startup cycles.
__________________
Henrik. Programs Amiga demos, iPhone apps, websites, etc. A1000/512k - A500 2.0/040@28/4M/.5M slowmem/8M/SCSI/CF - A600 portable II 3.1/ACA630/WiFi/CF - 'A1700' 3.1/68060@80/64M/IDE-Fix Express/CF - etc."The difference between PC and Amiga is that 10yo PCs are worth $0. 20yo Amigas are worth a lot, and Amigas that are only 15yo cost a fortune!" If you like Portal 2, try my >> single player and cooperation maps << |
|
|
|
|
|
#56 | |||
|
68k wisdom
Join Date: Nov 2007
Location: Lyon (France)
Age: 40
Posts: 979
|
Quote:
For me they decode the cpsave before they check about the coprocessor being present or not. 68000 and 040/060 don't do this and we'll get line-F as expected. This could be another way to detect emulators ![]() Quote:
Quote:
![]()
__________________
He who insults the other in a discussion is the one who's wrong. |
|||
|
|
|
|
|
#57 | ||
|
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 38
Posts: 11,942
|
Quote:
I still won't care ![]() Quote:
![]() |
||
|
|
|
|
|
#58 | ||
|
68k wisdom
Join Date: Nov 2007
Location: Lyon (France)
Age: 40
Posts: 979
|
Quote:
![]() Quote:
![]()
__________________
He who insults the other in a discussion is the one who's wrong. |
||
|
|
|
|
|
#59 |
|
cheeky scoundrel
Join Date: Nov 2004
Location: Spijkenisse/Netherlands
Age: 31
Posts: 2,213
|
Man, threads like this really make me wish I was born 5-10 years sooner
![]()
__________________
Error: signature could not be parsed. |
|
|
|
|
|
#60 |
|
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 10,510
|
There is still a strong homebrew scene today on consoles and phones if you wanted to "prove" yourself.
__________________
Thalion Webshrine |
|
|
|
|
|
#61 |
|
Registered User
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 114
|
I have a question about proper copperlist startup. If one:
1) stops copper dma 2) init hardware registers 3) change COP1LC to its own copperlist but do not poke $dff088 4) starts copper dma what happens whrn copper dma restarts? Isn't it possible that the old copperlist is executed because COP1LC is copied in the hidden copper instruction pointer only at the next VBLANK ? |
|
|
|
|
|
#62 |
|
Oldskool Demo Coder
|
IIRC I had a startup code like that way back. Ie. stop all dma, init stuff, set new copperptr, start dma. When DMA is started it will start fetching copper instruction as usual, and the address counter will be reset next Vsync or next time copjmp is poked.
__________________
Henrik. Programs Amiga demos, iPhone apps, websites, etc. A1000/512k - A500 2.0/040@28/4M/.5M slowmem/8M/SCSI/CF - A600 portable II 3.1/ACA630/WiFi/CF - 'A1700' 3.1/68060@80/64M/IDE-Fix Express/CF - etc."The difference between PC and Amiga is that 10yo PCs are worth $0. 20yo Amigas are worth a lot, and Amigas that are only 15yo cost a fortune!" If you like Portal 2, try my >> single player and cooperation maps << |
|
|
|
|
|
#63 |
|
is long gone
Join Date: Apr 2007
Location: London
Posts: 1,590
|
@ Photon - you do remember correctly. Just tested as follows:
Turned off DMA. Waited for vblank. Pointer to my copperlist --> cop1lch. Turned on DMA again. My copperlist executed normally with no move to copjmp1 |
|
|
|
|
|
#64 |
|
Oldskool Demo Coder
|
Well, waiting for vsync kinda spoils it tho
But just make a loop in your favorite NonSystemStartup.S and set the normal copper as usual at vblank, then change the frame loop to wait (with cpu) for scanline $50 or so, and switch copper off, set copper address to a second copperlist which changes bg-color to neon pink, and copper dma on again.If you see pink starting on rasterline $50, "dma-on" triggers copper start without copjmp, mid-frame. If not, turning copper dma off mid-frame kills the copper until copjmp trigger or autotrigger(=vblank) OR continues reading instructions on dma-on from the normal copper (test by having a bgcolor-change on rasterline $60 or so in the normal cop) Poking copjmp mid-frame should probably give the famous "force vblank hiccup" on CRTs.
__________________
Henrik. Programs Amiga demos, iPhone apps, websites, etc. A1000/512k - A500 2.0/040@28/4M/.5M slowmem/8M/SCSI/CF - A600 portable II 3.1/ACA630/WiFi/CF - 'A1700' 3.1/68060@80/64M/IDE-Fix Express/CF - etc."The difference between PC and Amiga is that 10yo PCs are worth $0. 20yo Amigas are worth a lot, and Amigas that are only 15yo cost a fortune!" If you like Portal 2, try my >> single player and cooperation maps << Last edited by Photon; 07 June 2009 at 02:20. |
|
|
|
|
|
#65 |
|
is long gone
Join Date: Apr 2007
Location: London
Posts: 1,590
|
OK, I setup two identical copperlists and did this:
Code:
.wait_line: move.l vposr(a6),d0
and.l #$1ff00,d0
cmp.l #$5000,d0
bne.s .wait_line
move.w #%0111111111111111,dmacon(a6)
move.l #my_cop_listtwo,cop1lch(a6)
move.w #%1000011111000000,dmacon(a6)
bsr .wait_vbl
move.w #%0111111111111111,dmacon(a6)
move.l #my_cop_listone,cop1lch(a6)
move.w #%1000011111000000,dmacon(a6)
btst #6,$bfe001
beq.s .exit
bra.s .wait_line
If I insert a move to copjmp1 after moving listtwo to cop1lch I see a red colour change on screen again indicating that a move to copjmp1 is needed to force the copper instructions to be read from the new list. So, *if* I understood your explanation right, and *if* I coded something that tests it right (big ifs, after all it's me we're talking about ) then dma on by itself doesn't trigger copper start - a move to copjmp or a vblank is needed for that.If I'm being a complete denzil with my 'testing' then tell me so and also please tell my why I'm being so stupid - my ego can take it and it'll help me learn! ![]() |
|
|
|
|
|
#66 |
|
Oldskool Demo Coder
|
Yeah, it's not triggered by just writing a value, like the sound registers. It's quite logical, or there wouldn't be a separate trigger register, really
![]() What I was curious for was if it would continue reading words from the original copper, even though the address had changed. It should, and it did. Also, copper is auto-triggered each vblank without any write to copjmp. No surprise there, it wouldn't work otherwise. But would a write while copper dma was off be recognized? I tested, and yes. Again, no surprise, no reason why it should not, but it's tested. Also, by adding a copjmp trigger mid-frame, it switches to cop2 as expected, WITHOUT any display hiccup. Wonder where those hiccups came from, maybe you need to trigger them at a certain scanline and copper must contain a wait that causes it to miss, ie. copper waits across vblanks somehow and no vsync comes to the CRT. Dunno. I used the same colors as you, with a wait for scanline $60+green to test if it continued reading on after dmaon. See attached source, I only added a few lines in loop: and inter:
__________________
Henrik. Programs Amiga demos, iPhone apps, websites, etc. A1000/512k - A500 2.0/040@28/4M/.5M slowmem/8M/SCSI/CF - A600 portable II 3.1/ACA630/WiFi/CF - 'A1700' 3.1/68060@80/64M/IDE-Fix Express/CF - etc."The difference between PC and Amiga is that 10yo PCs are worth $0. 20yo Amigas are worth a lot, and Amigas that are only 15yo cost a fortune!" If you like Portal 2, try my >> single player and cooperation maps << |
|
|
|
|
|
#67 |
|
is long gone
Join Date: Apr 2007
Location: London
Posts: 1,590
|
Cool. More things learned. Cheers Photon.
![]() |
|
|
|
|
|
#68 |
|
Registered User
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 114
|
Hi, if I have understood it right, your test do confirm that to have a correct statup either you poke copjmp1 or you sync the dma copper restart to the vblank.
The display hiccup are probably generated when copperlists do change display windows settings |
|
|
|
|
|
#69 |
|
Registered User
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 215
|
that sounds strange.. i'm sure I never waited for vbl or poked any trigger register in my startup code, and I never saw display corruption (when there weren't any other bugs that could cause corruption, of course ;-)
|
|
|
|
|
|
#70 | |
|
Registered User
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 114
|
Quote:
Problems occur if you need the copperlist to start executing immediatley after the end of the startup code. If you need such a behavior, then either trig COPJMP1 or wait for blank before leaving the startup code |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CU Amiga C Programming Tutorial | EternalAmiga | Coders. General | 34 | 10 April 2013 23:29 |
| Amiga programming | magnox | Coders. General | 6 | 28 April 2006 00:33 |
| Amiga Programming Books! | Physsicz | MarketPlace | 3 | 06 May 2005 12:33 |
| Take me to a random game button | Jim | HOL suggestions and feedback | 4 | 12 July 2004 23:09 |
| Amiga trivia | Galaxy | Nostalgia & memories | 1 | 01 July 2004 02:48 |