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 08:17
Radiant

Registered: Sep 2004
Posts: 639
Quoting WVL
I always use an illegal opcode to check when the code is being executed

A better way: You can simply set a breakpoint in the VICE monitor. It then allows you to single step through the code, which will tell you at exactly which point something goes wrong.
2009-08-05 08:55
Skate

Registered: Jul 2003
Posts: 494
Oswald already mentioned it. I believe you should check the value you've given to $d011. Accumulator value may need to be different than usual because of fld. Since you don't have time for table lookups, you may need 8 different code blocks for 8 different startup Y positions. I'd use a macro with a parameter for this. I hope you have enough free memory.
2009-08-05 08:55
WVL

Registered: Mar 2002
Posts: 902
Yes, but you cannot set breakpoints during compiling ;) (I wish I could! wouldnt it be awesome if you could set some breakpoints and conditions automagically?!)
2009-08-05 09:05
Oswald

Registered: Apr 2002
Posts: 5094
Quote: Yes, but you cannot set breakpoints during compiling ;) (I wish I could! wouldnt it be awesome if you could set some breakpoints and conditions automagically?!)

and load your labels into the monitor....
2009-08-05 09:21
doynax
Account closed

Registered: Oct 2004
Posts: 212
Quote: Yes, but you cannot set breakpoints during compiling ;) (I wish I could! wouldnt it be awesome if you could set some breakpoints and conditions automagically?!)

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 ;)
2009-08-05 09:58
JackAsser

Registered: Jun 2002
Posts: 2014
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 ;)


Nice hint! Cool! I'll do that aswell. => no more ".byte 2". Also if somebody would be so kind to patch VICE to support segmented labels or atleast support labels > $ffff and assume they're in ram1 on the C128. :D
2009-08-05 11:43
Ninja

Registered: Jan 2002
Posts: 411
Just to give you another option: CCS monitor displays a cycle counter always in the status line; very convenient for single stepping...
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 ;)
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
fuzzybad
t0m3000/hf^boom!^ibx
Rub_0201
stephan-a
Rebok/BOOM!/Tropyx
Guests online: 119
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 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (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 Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

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