English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 14 February 2018, 16:37   #21
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,058
More than 30 years of Amiga coding and you still learn something new!

Really, I didn't know that LoadView(NULL) doesn't work for Kickstart 1.x. I used it in all my games. Probably I never noticed the bug, because I immediately take over the system after LoadView() and set up my own copper list.
phx is offline  
AdSense AdSense  
Old 14 February 2018, 20:44   #22
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 47
Posts: 627
A clean, simple and effective solution can be:
Code:
_LVOForbid      equ     -132
_LVOWaitTOF     equ     -270
_LVOLoadView    equ     -222

  SECTION  mycode,code
  movea.l  $4.w,a6          ;execBase
  jsr      _LVOForbid(a6)   ;WaitTOF() break Disable() so..
                            ; anyway if you have a graphic card you need this
  movea.l  156(a6),a6       ;dirty gfxBase, until now works in every kickstarts
                            ; but you are free to OpenLibrary(gfx) ;)
  move.l   #first_copper,$dff080
                            ;logically depends on your config to use
                            ; a pc relative copper list or custom reg. displacement
                            ; no one touch COP1LC so first_copper is first executed
                            ; on next frame; do not strobe COPJMP1!

  jsr      _LVOWaitTOF(a6)  ;meanwhile old frame is computed and normally displayed
  jsr      _LVOWaitTOF(a6)  ;wait the eventually interlaced odd lines
  suba.l   a1,a1
  jsr      _LVOLoadView(a6) ;LoadView(NULL), system tamper custom regs 
                            ; and make glitch but you're already protected:
                            ; first_copper closed the view (sprites comprised)

  ;TAKE OVER SYSTEM (or not..)

  SECTION  mychip,data_c
first_copper:
  dc.l     $00960100   ;BPLEN=0, first absolute execution in frame
;  dc.l     $01800000   ;setup init values or custom consts
;  dc.l    $01fc0000
  dc.l     $fffffffe   ;cend
Not a single glitch, not a single "strange" behavior

[EDIT: this is only a snippet, I've not put all the parts concerning the rescue of OldView, OldCopper(s), etc,
but they must logically be here, you know how to do it ]
[EDIT2: other things that I take for granted but maybe they are not..
In this situation LoadView() CPU write much registers for "basic" view but proper ECS/AGA set/reset is your responsibility!
And the call can not be avoided, it's here to switch from eventual graphic card to native mode]

Last edited by ross; 14 February 2018 at 23:16. Reason: []
ross is offline  
Old 14 February 2018, 23:34   #23
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 635
Thanks a lot for snippet. It pushes me to think (at least!). Why we can't strobe COPJMP1? Because there is a possibility that blitter working ? Perhaps in this case blitter must be on our side and problem will gone. I mean about WaitBlit() and OwnBlitter() before LoadView(0). But I'm not sure If LoadView didn't use blitter for something.
Asman is offline  
Old 14 February 2018, 23:54   #24
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 47
Posts: 627
Quote:
Originally Posted by Asman View Post
Thanks a lot for snippet. It pushes me to think (at least!). Why we can't strobe COPJMP1? Because there is a possibility that blitter working ? Perhaps in this case blitter must be on our side and problem will gone. I mean about WaitBlit() and OwnBlitter() before LoadView(0). But I'm not sure If LoadView didn't use blitter for something.
This is a reason, copper strobe/blitter bug is nasty, I've fixed some demo that in some condition invoke it
(i usually takeover the system and leave the blitter complete his job with my own BlitterWait).
Second reason is aesthetic: old copper list continue to the end of frame, so no "cut" of image in the middle.
[I do not think LoadView uses the blitter]
ross is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copper ASM LeCaravage Coders. General 5 30 January 2018 13:35
Using the Copper guy lateur Coders. C/C++ 22 26 July 2017 20:29
Best way to mix blitting with copper and copper effects roondar Coders. Asm / Hardware 3 12 September 2016 14:12
copper ? turrican3 Coders. Asm / Hardware 10 27 January 2016 10:10
Combining copper scrolling with copper background phx Coders. Asm / Hardware 14 16 June 2013 08:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:29.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Page generated in 0.17195 seconds with 14 queries