Why the screen does not open?
I have this code:
Code:
move.l CUSTOM,a2 |
move.l #copperlist,COP1LCH(a2)
|
And also, as well as what Ross said, is your copper list in chipmem?
Also at start of code it should be move.l #custom, a2 Also your copper list sets bitplane 1 as $7c080 and bitplane 2 as $7dfc0, yet there is nothing in your code to suggest you are clearing or setting any data at those addresses. |
Quote:
Quote:
Quote:
CUSTOM. Quote:
|
Well, there are quite a few mistakes in fact...
move.w DMACONR(a2),d1 .... or.w #SETCLR,d1 move.w d1,DMACON(a2) and there are system calls in between that don't preserve the value of D1 I just looked quickly, probably there is more :) |
Okay, maybe, but that code is at the exit, when the program closes the graphics library. It does not explain why the screen is not opening, as d1 is not used anywhere else. But thanks for pointing out, d1 and d2 should be stored in a variable.
Edit: Aaaaand if i try to store them in a variable, then the exe is corrupted again and refuses to run with error 121. What is this? |
One possibility is the DMACON value.
You set it to Code:
move.w #SETCLR|COPEN|BPLEN,DMACON(a2) Edit: I know this sounds like an odd thing, but DMAEN does not do what you might think if you read the HRM description. The HRM description suggests it activates all the DMA channels in bits 0-8. Instead, it merely makes it so that you can enable the DMA in those bits. |
jsr OldOpenLibrary(a6)
move.l d0,a3 ; graphics.library handle stored in a3. move.l 38(a6),d2 ; Old Copper settings in d2. 38(a6) read from execbase... Rewrite it from scratch with more attention. In assembler you cannot afford errors of any kind ;) |
Quote:
Its "working" completely by accident, not by design. Your first line is moving the contents of $dff000 into a2, when the value $dff000 should be in a2. If that line is incorrect, the next line is also wrong as it's not going to be pulling from the correct register. So here is my advice. Cut first two lines. Where you move #$7fff,dmacon(a2), put that before your move of the copper list, dont forget # Ross told you. The two top lines you cut from the top, put them both before the #$7fff,dmacon(a2), not forgetting the # in front of custom. Make sure custom = $dff000 Make sure setclr= $8000 That big setup for DMA before you wait for left mouse button, trim all that out and put in the value $87d0 See how you get on |
Quote:
TCH: What assembler are you using? I got used to seeing that blinking red box (GURU) quite quickly. |
Quote:
|
Quote:
Also, this line: move.w DMACONR(a5),DMABackupcauses the program to refuse to run with error 121. Why? It does not help, if i put the value into d1first. Quote:
Quote:
Code:
move.l #CUSTOM,a2 Quote:
Quote:
leawas the correct solution, if i used the hashmark, then error 121 was all i got. Finally, a black screen. I now will test, if the bitplanes are in the right place. Edit: If i try to save the original copper and DMA into variables instead of d1 and d2, then the program crashes... Edit: Galahad, you were right about the $87d0, thanks. |
The following code is the 'correct' version of what you tried to do.
I would never write it like this, too many important parts are missing For the old farts, don't look at me badly, I just got the code and "fixed" it :p Code:
_LVODisable equ -120 |
Quote:
Quote:
About error 121: this means your assembled program is not a proper executable. What VASM/VLINK flags are you using and what version of Kickstart/Workbench are you running your code on? |
Quote:
vasm require -kick1hunksto be KS1.x compatible, probably by default it generates reloc tables for KS2.0+ only. I edited the code to be fully pc relative, so problem solved at the root. |
Quote:
LVOprefix? Quote:
Quote:
Quote:
-Fhunkexe -nosymKickStart 1.3, there is no WorkBench. Quote:
-kick1hunks, so roondar must be right about the alignment. If i use -kick1hunks, then it will not be usable under KS 2.0? (Although the targetted game itself has glitches over 1.3, so it is not recommended to run it on KS 2.0+ anyway.) Edit: @ross: You open graphics.library, but do not call anything from it, you've removed the WaitTOFcalls; if it is not needed, why open it? |
Quote:
But as I told you in a previous message, and it seems to me that you did not get the point from your reply, it is that when you call the system functions you cannot save variables into d0/d1/a0/a1 because they are scratch registers. Unlike you, I don't have any calls in this piece of code so I took the first free register available :) Quote:
Quote:
KS2.0 are fully compatiple with old generated hunk. Quote:
About WaitTOF: not the right way to use it, so useless in your case. |
Quote:
Quote:
|
Sorry, in the meantime, i've noticed the
move.l 38(a5),$80(a2) Quote:
|
Quote:
Quote:
So you have plenty of registers (or stack) to save (temp)variables. |
All times are GMT +2. The time now is 22:25. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.