Blitter + GFA question

GFA BASIC-related articles in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5038
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Blitter + GFA question

Postby simonsunnyboy » Sat Aug 12, 2006 2:01 pm

I'm currently toying around with some Blitter stuff + a mod replayer in background. HOG mode (as used to date) leaves no CPU time so I need BLIT mode. However this is awful slow with the required busy waiting.

Now I've seen the following in Tobe's Roger source:

Code: Select all

    LONG{&HFF8A24}=ADD(source%,6)
    LONG{&HFF8A32}=ADD(ecr2%,166)
    LONG{&HFF8A36}=&H140064
    BYTE{&HFF8A3C}=128
    ~5
    ~5
    ~5
    ~5
    ~5


The BYTE line activates the Blitter in BLIT mode (according to Paranoid's STE docu) but what do those ~5 statements do? I can't remember seeing anything like this. Can anyone explain? Tobe perhaps? :)

Thank you!

PS: The amount of blitting in my case is HUGE! Copying 26K of data per frame....
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2376
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Sat Aug 12, 2006 8:26 pm

Pretty sure I stumbled apon one of his listings somewhere and it also had these '~5' lines. In the listing I seen, it was a marker or place holder if you will. He would seek them out in ram (search for them) and replace it with assembler to create an interrupt or VBL routine. My guess is the same sort of thing is going on in this listing too.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5038
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Postby simonsunnyboy » Sat Aug 12, 2006 8:44 pm

That implies that it will not work from the interpreter :/
I was thinkin' of a way to use the speical loop Paranoid mentions in the FAQ. However I see no way to exactly mimic its behaviour with GFA. Seems I'll need to inline these three lines....
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2376
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Postby lp » Sat Aug 12, 2006 9:18 pm

This search and replace method was discussed in another thread, but I can't seem to find it with the forum search tool. hmm

Your conclusion is correct. Only works compiled.

User avatar
tobe
Atari God
Atari God
Posts: 1459
Joined: Sat Jan 24, 2004 10:06 am
Location: Lyon, France
Contact:

Postby tobe » Sun Aug 20, 2006 9:58 pm

Sorry to be late :)

Yes, there's some code at the beginning to replace those ~5 with some assembly code. It doesn't work in the interpreter because it rely on compiled code.

I think it's possible to code the 'hot restart' in pure GFA, but using the blitter in this mode without compiling the code might be useless because the interpreter is so slooooooow :)
step 1: introduce bug, step 2: fix bug, step 3: goto step 1.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5038
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Postby simonsunnyboy » Mon Aug 21, 2006 7:27 am

Well it will be compiled in the end - but I use the interpreter heavily during development. That's one of the features why I love and use GFA - that I can directly test and debug without any weird debuggers or running a compiler first. Just press Shift+F10 and off you go :)

Anyway, I have removed that need for BLIT mode in my current project.
I tried to add the restart loop with an INLINE but that didn't work properly (yet).
If there is a way, tell me please.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
tobe
Atari God
Atari God
Posts: 1459
Joined: Sat Jan 24, 2004 10:06 am
Location: Lyon, France
Contact:

Postby tobe » Mon Aug 21, 2006 7:56 am

Hi Simonsunnyboy,

The only other way I know is to simulate the shared mode by splitting blitter ops in smaller blocks (vertically, so you only need to refill the width/height/control registers to restart the blitter, the source and destination adresses are incremented by the hardware). This way you don't need to use the 'hot restart' trick and you can choice how long the blitter will hog the bus.

Tame it ! ;)
step 1: introduce bug, step 2: fix bug, step 3: goto step 1.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5038
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Postby simonsunnyboy » Mon Aug 21, 2006 12:14 pm

Yeah, that sounds interesting so if I understand you right, I shall split a copy of 160 lines into say 20 distinct blits of less lines and each blit using HOG mode again?
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
tobe
Atari God
Atari God
Posts: 1459
Joined: Sat Jan 24, 2004 10:06 am
Location: Lyon, France
Contact:

Postby tobe » Mon Aug 21, 2006 3:29 pm

Yep, that's it.
step 1: introduce bug, step 2: fix bug, step 3: goto step 1.


Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 1 guest