23 March 2016, 16:31 | #1 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Restore system sprite
After ending my program that takes of the System and bangs the hardware directly (yes, sorry), the system sprite pointer is invisible.
Hm, how could that happen? Yes, I am using hardware sprites - do I have to restore anything? Here's my current attempt to restore anything at the end of the program: Code:
move.l graphicsBase,a6 sub.l a1,a1 jsr _LVOLoadView(a6) move.l oldView,a1 jsr _LVOLoadView(a6) move.l 38(a6),$dff080 jsr _LVOWaitTOF(a6) jsr _LVOWaitTOF(a6) |
23 March 2016, 16:54 | #2 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
And you call this when you back to OS ? What about restore values for dmacon and intena ?
If you want I can post my EnableOs asm routine here. Just give me a sign. |
23 March 2016, 17:19 | #3 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Oh... yes, these registers have been modified, indeed. Thanks for the hint.
I was just using my 20 year old code without thinking. |
23 March 2016, 21:49 | #4 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
@Lazycow
Is it possible that you can release some old sources ? That would be so nice to look into such staff and perhaps optimize a bit or/and add some tweaks. |
24 March 2016, 11:25 | #5 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Ok, the sprite is visible again. Haha!
But another thing: I remember that sometimes when you start from floppy, the disk drive didn't stop running. What's the usual way to avoid this? @Asman: Releasing 20 year old sources ... uh, that would be embarrassing! |
24 March 2016, 12:12 | #6 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
|
Quote:
1. Wait long enough before disabling multitasking, to give trackdisk.device a chance to turn off the motor. 2. Turn it off yourself after taking over the system. Code:
lea CIAB+CIAPRB,a3 ; Motor off for all drives. or.b #$f8,(a3) nop and.b #$87,(a3) nop or.b #$78,(a3) ; deselect all nop |
|
24 March 2016, 13:22 | #7 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
@phx
Is second way works fine on faster machines too ? @Lazycow I usually wait 2 seconds (but I do not use cpu depend loop like I saw in some games) somewhere on begin of game (before system overtaken of course). About releasing 20 year old sources: Why not. A journey of a thousand miles begins with a single step |
24 March 2016, 13:56 | #8 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
just unpowering the motor, how crude... I try that one
@Asman: I might release the updated sources. The copper-modifications are somewhat freaky... |
24 March 2016, 14:08 | #9 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
|
|
24 March 2016, 17:46 | #10 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Kind of awkward, but there's another thing... I start the program on the workbench with double-click. Then it runs until it detects the mouse button.
But when the program terminates, workbench thinks I have dragged the icon and workbench moves it. Kind of annoying... After each start, I have to reposition the icon... I tried to add delays (dos.library/Delay) before killing the system and after killing the system, but somehow this does not help. Any hints? |
24 March 2016, 19:03 | #11 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
@phx - Thanks for info. It seems that nop is quite useful instruction.
@Lazycow - Everything depend. Did you use some kind WB startup code ? Or you just takeover the system on beginning ? Perhaps your system overtaken routine missing something. If your project is not top secret then post asm routine here. Otherwise you can PM me and I will look into code, but of course I'm not guarantee that I will solve your all problems, because there are still many amiga coding things to learn |
24 March 2016, 19:21 | #12 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Maybe this is kind of an emulation problem, because the (emulated) harddisk is too fast... If I start it with doubleclick from floppy, there's no problem.
It should be released... soon... (hopefully) Double-click problem or not. ... I just have to fix the crude lazycow-startup-code again, because it fails when there's no shell-window when starting from floppy-startup-sequence directly. But I have found some example startup-code. Let's see... |
24 March 2016, 22:25 | #13 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Ok, I solved the double-click problem. The demo now only ends if the mouse button has been pressend and then released rather than pressed only.
|
25 March 2016, 18:33 | #14 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Apologies to Lazycow for going back to the drive off code, but I tried using this in my own code:
Code:
or.b #%10000000,$BFD100 ;as interrupts are off, we manually and.b #%10000111,$BFD100 ;switch off disk drive motor |
25 March 2016, 20:24 | #15 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
|
It would be strange when your code switches a drive's motor on, but it may happen that you cannot switch it off, because the state of the DSKSEL0..3 bits (bits 3..6) is unknown before you clear them.
The motor bit (7) is only processed by a drive on a falling edge of its DSKSELx bit. |
29 March 2016, 10:56 | #16 | |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
|
|
30 March 2016, 21:34 | #17 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
Ok, I have fixed some OCS problems, but there's still a (minor) glitch on startup... some pixels in the topleft corner (visible for ca. 1s)
Here's the (modified) startup code from Stingray... Code:
move.l graphicsBase,a6 move.l gb_actiView(a6),Display_oldView(a5) ; save old view move.l $26(a6),Display_oldCop1(a5) move.l $32(a6),Display_oldCop2(a5) sub.l a1,a1 ; flush view jsr _LVOLoadView(a6) jsr _LVOWaitTOF(a6) jsr _LVOWaitTOF(a6) lea $dff000,a6 move.w $10(a6),Display_oldATKCON(a5) move.w $1C(a6),Display_oldINTENA(a5) move.w $02(a6),Display_oldDMACON(a5) move.w #$7FFF,d0 ;bsr Display_WaitRaster move.w d0,$9A(a6) ; Disable Interrupts move.w d0,$96(a6) ; Clear all DMA channels move.w d0,$9C(a6) ; Clear all INT requests move.w #$1fff,$9a(a6) move.w #$1fff,$9c(a6) move.w #$8200+32+64+128+256,$96(a6) ; my DMA Any ideas how to fix this? Is this the mouse pointer or what? |
30 March 2016, 21:44 | #18 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
If you have set up the sprites correctly (pointing to a null sprite - unless you are actually using them) then it shouldn't be the mouse pointer.
Personally, I always have my sprites setup at the start of the copperlist. It could be that you are pointing 2 bytes earlier than your screen display actually is located, and picking up variables or other data accidentally. |
30 March 2016, 22:01 | #19 |
Registered User
Join Date: Oct 2014
Location: Germany
Posts: 195
|
@Lonewolf10: Oops, you're right... after LoadView() the screen is ok, the garbage shows up later... I'll investigate...
|
02 April 2016, 02:24 | #20 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
|
It's heart-warming to see this, more support than my web host is giving my company
Any sprite DMA pointers should be changed only when bitplanes have been off until end of line, such as after $12c for a normal display window or at vblank/"EOF". Then there's no need for null sprites. I've stopped caring about the floppy drive light It's not that big a deal. Look at the screen instead cos something awesome just loaded!! And even 25 year old sources can show something never seen before to those who pay attention Last edited by Photon; 03 April 2016 at 19:07. Reason: Error corrected. :) |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VideoBackup - restore in Winuae ? | wlcina | support.Hardware | 38 | 11 February 2016 20:56 |
Backup and restore to new CF hard drive | melbourneben! | support.Other | 8 | 31 August 2013 18:39 |
Diavolo backup: anyone able to restore this? | andreas | support.Apps | 4 | 13 October 2008 12:32 |
Request: System close/restore | Ray Norrish | Coders. General | 2 | 26 May 2006 13:05 |
Backup/Restore Hard Drive | rlake | support.Apps | 10 | 20 May 2002 23:20 |
|
|