Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Anti badline trick/strech charline 7
2009-08-04 18:11
Testa
Account closed

Registered: Oct 2004
Posts: 197
Anti badline trick/strech charline 7

hi,

i have a question about the anti badline trick,
in this case streched graphics, open sideborders and 7 sprites each line..

i have used this trick a vieuw times and i never had any problems..

what i did was;

$d011 = $3b

lda #$3c
stx $d016 ;open sideborder atrasterline $8a,charline 7
sta $d011 ;anti badline trick,
sty $d016

no problem

this time i also have some other stuff going on.

i use dma delay at line $30/$31
i use a fld, open borders and sprite fpp rastercode

so the dma delay swings the anti badline graphics from left to right and the fld rastercode moves the graphics up and down..

the problem i have is this..

after the fld/sprite fpp rastercode i want to do the
anti badline trick.

lets say $d011 = $1b and we are at line $8a

lda #$3c
stx $d016 ; open sideborders at line $8a, charline 7
sta $d011 ; anti badline trick
sty $d016 ;

at this point $d012 is $8d instead of $8b and there was a badline.

why was there a badline instead of the anti badline trick
and why is $d012 increased with 2 lines?

thanks
Testa
 
... 17 posts hidden. Click here to view all posts....
 
2009-08-05 12:02
Radiant

Registered: Sep 2004
Posts: 639
Quote: Just to give you another option: CCS monitor displays a cycle counter always in the status line; very convenient for single stepping...

How does that differ from the VICE monitor? :-P
2009-08-05 12:11
WVL

Registered: Mar 2002
Posts: 902
Quote: I'm not quite certain whether you're serious or not, but personally I've set up a little script which massages the label file to transform names with a particular prefix (e.g. br_*) into a breakpoint command. And in recent versions of VICE you can use the -moncommand switch to automatically read in the generated label script.

A better idea might be to patch up your assembler of choice to add new pseudo-ops for various useful monitor functions, or just a simpler mechanism to pass on strings as-is. But I haven't gotten around to it yet ;)


Please elaborate :D

It would be really nice to automagically be able to create labels and breakpoints for vicemon :)

(Also.. It wouldnt amaze me if Kickass already does this... <sigh>)
2009-08-05 12:32
doynax
Account closed

Registered: Oct 2004
Posts: 212
Quote: Please elaborate :D

It would be really nice to automagically be able to create labels and breakpoints for vicemon :)

(Also.. It wouldnt amaze me if Kickass already does this... <sigh>)


Oh, it's fairly straightforward really.
I've got a script (technically a C program but whatever) which reads the label file generated by ACME and spits out corresponding VICE monitor commands (e.g. "al $ffff .label"). In addition a break command is also issued for any label name which begins with 'br_'.

That's it. All that remains is to hook it up in your makefile/build script and add a '-moncommand' switch with the generated file's name when starting up VICE (presumably in the form of another build/run script hooked up to a hotkey in your editor or something.)

Well, I guess there's one or two other hacks involved as well. ACME makes no difference between constants and address labels, so the tool can be provided with a set of filters for labels to exclude from the dump so as not to clutter up the zeropage too much. I've also tweaked ACME to spit out local labels.

I'm not saying it's a clean system but it gets the job done. Especially if you prefer straight debugging to actually thinking about what might be wrong with your code ;)
2009-08-05 13:45
Testa
Account closed

Registered: Oct 2004
Posts: 197
wauw thanks for al the help,

Graham: i have tried some extra nops and i get the same result..

WVL: i use 7 sprites. not the 0 sprite becoz vic uses the whole bus to fetch it, just at the cycles needed for the anti badline trick.

i also tried the jam trick. witch is very cool. don't laugh but i never just the vice monitor...
when i add the jam byte $02 to my turbo assembler source,
i indeed go directly to the monitor. but where can i read the rasterline and cycle info.. this sounds really handy!

thanks!
2009-08-05 17:43
Monte Carlos

Registered: Jun 2004
Posts: 359
@testa: Poking the nibbles of $d012 into $d020 and $d021 shows you the current rasterline as colors.
@oswald: After the fld it should be possible to continue with increasing $d011, although with a little bit modified timing. Because a hardreset of vertical scroll position (bits 0-3 of $d011) is circumvented, one routine should be enough.
2009-08-05 18:23
Testa
Account closed

Registered: Oct 2004
Posts: 197
Monte carlos: i understand. but what is the advange compared to lda $d012 sta $4000.

Skate: i have put the sinus amplitude from the fld off. so the fld stands still so $d011 is always $1b at line $8a..
i also didn't completly understand what you mean with different codeblocks

instead of different codeblocks i do in the anti badline rastercode each line..

and #%00000111
adc #1
ora #$38
sta $d011

so when the fld is moving and finescroll changes i only have to change the first $d011 write of the anti badline trick.. i hope this is what you mean...

but thanks anyway...
2009-08-06 08:50
Skate

Registered: Jul 2003
Posts: 494
What I meant was, if you don't have enough cycles per line for additional and, ora etc. stuff, alternatively you can generate 8 different subroutines out of a single macro.

!macro myMacro .yPosition {
lda #((0 + .yPosition) & 7) | $38
stx $d016
sta $d011
sty $d016
...
...
lda #((1 + .yPosition) & 7) | $38
stx $d016
sta $d011
sty $d016
...
...
lda #((2 + .yPosition) & 7) | $38
stx $d016
sta $d011
sty $d016
...
...
}

forYPosition0
+myMacro 0
rts

forYPosition1
+myMacro 1
rts

...
...

forYPosition7
+myMacro 7
rts

Something like this. Then you can call the suitable subroutine depending on the lowest 3 bits of $d011 at the start up raster position.

If you have enough free cycles, you don't need this of course.
2009-08-06 09:12
WVL

Registered: Mar 2002
Posts: 902
Quote: wauw thanks for al the help,

Graham: i have tried some extra nops and i get the same result..

WVL: i use 7 sprites. not the 0 sprite becoz vic uses the whole bus to fetch it, just at the cycles needed for the anti badline trick.

i also tried the jam trick. witch is very cool. don't laugh but i never just the vice monitor...
when i add the jam byte $02 to my turbo assembler source,
i indeed go directly to the monitor. but where can i read the rasterline and cycle info.. this sounds really handy!

thanks!


When you jump to monitor, it says something like

** monitor 050 034

which means rasterline 50, cycle 34 on that line.

You can also check with the 'r' command :

** Monitor 260 048
(C:$0901) r
ADDR AC XR YR SP 00 01 NV-BDIZC LIN CYC
.;0901 00 00 00 f7 2f 37 00100000 260 048
2009-08-06 09:39
Testa
Account closed

Registered: Oct 2004
Posts: 197
thanks WVL... this is very handy.. shame on me becoz i didn't know this....

2009-08-06 10:27
Ninja

Registered: Jan 2002
Posts: 411
radiantx: Uhrm, well, the difference is probably that I immediately understood which value means what in CCS while I never noticed the "monitor <x> <y>" thing in VICE up to now :D
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
WVL/Xenon
deetsay
icon/The Silents, Sp..
MWR/Visdom
csabanw
Peacemaker/CENSOR/Hi..
Mike
MCM/ONSLAUGHT
Guests online: 97
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.