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 > Stupid Routines ....
2006-11-27 22:55
General Zoff
Account closed

Registered: Dec 2004
Posts: 7
Stupid Routines ....

Found this one on one of my old work disks ...
Let's collect the most stupid routines you have written on your old C64 ... ;-)

.C:6000 78 SEI
.C:6001 A2 00 LDX #$00
.C:6003 BD 11 60 LDA $6011,X
.C:6006 9D 00 00 STA $0000,X
.C:6009 E8 INX
.C:600a E0 40 CPX #$40
.C:600c D0 F5 BNE $6003
.C:600e 4C 00 00 JMP $0000
.C:6011 2F 34 A9 RLA $A934
.C:6014 A9 EA LDA #$EA
.C:6016 8D 34 A9 STA $A934
.C:6019 F0 24 BEQ $603F
.C:601b A2 00 LDX #$00
.C:601d A9 EA LDA #$EA
.C:601f 9D 40 00 STA $0040,X
.C:6022 E8 INX
.C:6023 D0 F8 BNE $601D
.C:6025 EE 10 00 INC $0010
.C:6028 AD 10 00 LDA $0010
.C:602b C9 00 CMP #$00
.C:602d F0 0B BEQ $603A
.C:602f C9 FF CMP #$FF
.C:6031 D0 E8 BNE $601B
.C:6033 A9 00 LDA #$00
.C:6035 8D 0F 00 STA $000F
.C:6038 F0 E1 BEQ $601B
.C:603a A9 D0 LDA #$D0
.C:603c 8D 08 00 STA $0008
.C:603f A9 37 LDA #$37
.C:6041 85 01 STA $01
.C:6043 EE 20 D0 INC $D020
.C:6046 A9 34 LDA #$34
.C:6048 85 01 STA $01
.C:604a EA NOP
.C:604b EA NOP
.C:604c EA NOP
.C:604d EA NOP
.C:604e EA NOP
.C:604f EA NOP
.C:6050 EA NOP




 
... 42 posts hidden. Click here to view all posts....
 
2007-04-16 11:24
Style

Registered: Jun 2004
Posts: 498
Quote: Here's something probably useless, but was useful for me. Creating short term delays :)

* = $1000
SEI
DELAY LDX #$00
LOOP2 LDY #$00
LOOP1 INY
BNE LOOP1
INX
BNE LOOP2
RTS

To make things interestingly wild, or silly. Before LDX #$00 add the following:

JSR DELAY
INC $D020

JSR DELAY
INC $D020

JSR DELAY
INC $D020

JSR DELAY
INC $D020

JSR DELAY
INC $D020

JSR DELAY
INC $D020
RTS


Ive never found any use for delays of such magnitude!

What do you use them for?

Im sure you must be better off RTIing and triggering a new IRQ further down the screen?
2007-04-16 11:32
Mace

Registered: May 2002
Posts: 1799
Style, they're just stupid, hence the name of this thread ;)
2007-04-16 11:37
Style

Registered: Jun 2004
Posts: 498
he said it was useful to him! :)
2007-04-16 13:58
Mace

Registered: May 2002
Posts: 1799
Style, it's Richard.... nuff said? ;-)
Hence the name of this thread.
2007-04-16 15:45
Conrad

Registered: Nov 2006
Posts: 849
Here's a very badly coded raster-splitter routine I found in an old demo:

*=$0801
!byte $0c,$08,$00,$00,$9e,$34,$30,$39,$36

*=$1000
sei
lda #$1b
sta $d011
lda #$3b
cmp $d012
bne *-3
jsr rastersplitter
jmp *-10

rastersplitter
ldy #$00
badline ldx #$08
newline lda tbl_raster1,y
sta $d020
sta $d020
iny
dex
beq badline
lda tbl_raster2,y
sta $d021
lda tbl_raster3,y
sta $d021
lda tbl_raster4,y
sta $d021
lda $0000,y
sta $dddd
lda $0000,y
sta $dddd
cpy #$80
bcc newline
rts

*=$1100
tbl_raster1
!byte $06,$00,$06,$06,$0e,$06,$0e,$0e,$03,$0e,$03,$03,$01,$03,$01,$01
!byte $03,$01,$03,$03,$0e,$03,$0e,$0e,$06,$0e,$06,$06,$00,$06,$00,$00
!byte $06,$00,$06,$06,$0e,$06,$0e,$0e,$03,$0e,$03,$03,$01,$03,$01,$01
!byte $03,$01,$03,$03,$0e,$03,$0e,$0e,$06,$0e,$06,$06,$00,$06,$00,$00
!byte $06,$00,$06,$06,$0e,$06,$0e,$0e,$03,$0e,$03,$03,$01,$03,$01,$01
!byte $03,$01,$03,$03,$0e,$03,$0e,$0e,$06,$0e,$06,$06,$00,$06,$00,$00
!byte $06,$00,$06,$06,$0e,$06,$0e,$0e,$03,$0e,$03,$03,$01,$03,$01,$01
!byte $03,$01,$03,$03,$0e,$03,$0e,$0e,$06,$0e,$06,$06,$00,$06,$00,$00

*=$1200
tbl_raster2
!byte $00
!byte $09,$00,$09,$09,$02,$09,$02,$02,$0a,$02,$0a,$0a,$0f,$0a,$0f,$0f
!byte $07,$0f,$07,$07,$01,$07,$01,$01,$0d,$01,$0d,$0d,$03,$0e,$06,$00
!byte $09,$00,$09,$09,$02,$09,$02,$02,$0a,$02,$0a,$0a,$0f,$0a,$0f,$0f
!byte $07,$0f,$07,$07,$01,$07,$01,$01,$0d,$01,$0d,$0d,$03,$0e,$06,$00
!byte $09,$00,$09,$09,$02,$09,$02,$02,$0a,$02,$0a,$0a,$0f,$0a,$0f,$0f
!byte $07,$0f,$07,$07,$01,$07,$01,$01,$0d,$01,$0d,$0d,$03,$0e,$06,$00
!byte $09,$00,$09,$09,$02,$09,$02,$02,$0a,$02,$0a,$0a,$0f,$0a,$0f,$0f
!byte $07,$0f,$07,$07,$01,$07,$01,$01,$0d,$01,$0d,$0d,$03,$0e,$06,$00

*=$1300
tbl_raster3
!byte $00
!byte $05,$00,$05,$05,$0d,$05,$0d,$0d,$01,$0d,$01,$01,$07,$0f,$0a,$08
!byte $02,$09,$02,$08,$0a,$0f,$07,$01,$01,$01,$0d,$05,$0b,$00,$0b,$00
!byte $05,$00,$05,$05,$0d,$05,$0d,$0d,$01,$0d,$01,$01,$07,$0f,$0a,$08
!byte $02,$09,$02,$08,$0a,$0f,$07,$01,$01,$01,$0d,$05,$0b,$00,$0b,$00
!byte $05,$00,$05,$05,$0d,$05,$0d,$0d,$01,$0d,$01,$01,$07,$0f,$0a,$08
!byte $02,$09,$02,$08,$0a,$0f,$07,$01,$01,$01,$0d,$05,$0b,$00,$0b,$00
!byte $05,$00,$05,$05,$0d,$05,$0d,$0d,$01,$0d,$01,$01,$07,$0f,$0a,$08
!byte $02,$09,$02,$08,$0a,$0f,$07,$01,$01,$01,$0d,$05,$0b,$00,$0b,$00

*=$1400
tbl_raster4
!byte $00
!byte $0b,$00,$0b,$0b,$0c,$0b,$0c,$0c,$0f,$0c,$0f,$0f,$07,$0f,$07,$07
!byte $0f,$07,$0f,$0f,$0c,$0f,$0c,$0c,$0b,$0c,$0b,$0b,$00,$0b,$00,$00
!byte $0b,$00,$0b,$0b,$0c,$0b,$0c,$0c,$0f,$0c,$0f,$0f,$07,$0f,$07,$07
!byte $0f,$07,$0f,$0f,$0c,$0f,$0c,$0c,$0b,$0c,$0b,$0b,$00,$0b,$00,$00
!byte $0b,$00,$0b,$0b,$0c,$0b,$0c,$0c,$0f,$0c,$0f,$0f,$07,$0f,$07,$07
!byte $0f,$07,$0f,$0f,$0c,$0f,$0c,$0c,$0b,$0c,$0b,$0b,$00,$0b,$00,$00
!byte $0b,$00,$0b,$0b,$0c,$0b,$0c,$0c,$0f,$0c,$0f,$0f,$07,$0f,$07,$07
!byte $0f,$07,$0f,$0f,$0c,$0f,$0c,$0c,$0b,$0c,$0b,$0b,$00,$0b,$00,$00


Because of the bad lines, every 8th line is corrupted, and the splits are out of line at the top most of the screen.


BTW, the LDA$0000,y STA$dddd can be used for extra splits. But who cares? It's a crap routine :-)
2007-04-19 22:05
fenek
Account closed

Registered: Apr 2002
Posts: 3
As far as I remember this one:
- make a standard char matrix 16x16 in hires on screen
- cover it with sprites in hires (irq-multiplexer)
- draw a vector-cube as fast as you can
- inside IRQ, check a VIC-collision sprite/background register
after each 8 rasterlines lines in char<>sprites area
- one sprite which is 24x21 pixel big cover 3x3 chars
so the bits of collision register gives you info which fonts/cahrs are used by your vector and these chars should be clear :)))

It's stupid beacuse it slooow ....

.ohhh sprites should be filled by byte $ff
2007-04-20 05:17
Radiant

Registered: Sep 2004
Posts: 639
Quote:
so the bits of collision register gives you info which fonts/cahrs are used by your vector and these chars should be clear :)))

Haha. :-) Cool idea at least!
2007-04-20 08:37
Cruzer

Registered: Dec 2001
Posts: 1048
Nice idea, but performance wise I'm sure it will be more effecient to precalculate and pack the info on which areas of the object to clear/fill/skip.
2007-04-20 09:51
Oswald

Registered: Apr 2002
Posts: 5094
cruzer, animations are always more efficient. However real men used to code realtime stuff:)
Previous - 1 | 2 | 3 | 4 | 5 | 6 - 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
A3/AFL
zscs
WVL/Xenon
kbs/Pht/Lxt
Didi/Laxity
instant
cobbpg
Guests online: 131
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 Layers  (9.6)
2 No Listen  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (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 Triad  (9.3)
5 Censor Design  (9.3)
Top Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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