Posted Tue Apr 19, 2011 7:42 PM
Posted Tue Apr 19, 2011 8:20 PM
Edited by bogax, Tue Apr 19, 2011 8:34 PM.
Posted Tue Apr 19, 2011 8:31 PM
bogax, on Tue Apr 19, 2011 8:20 PM, said:
Posted Wed Apr 20, 2011 12:20 AM
lda ufoPosition
bpl .clearOverflowFlag+1
.clearOverflowFlag:
nop $B8 ; illegal NOP
sta RESP0
Which can also be written this way, this makes more sense to a person reading your code!!
lda ufoPosition
bne .clearOverflowFlag
.byte $04 ; illegal NOP, skip 1 byte
.clearOverflowFlag:
clv
sta RESP0
lda ufoPosition
bne .clearOverflowFlag
.byte $24 ; BIT opcode, skip 1 byte, take 3 cycles
.clearOverflowFlag:
clv
sta RESP0
Or can be written as this (more convoluted):
lda ufoPosition
bpl .clearOverflowFlag+1
.clearOverflowFlag:
bit $B8 ; used here to skip a byte, but is also affecting some flags...
sta RESP0
; nops, and illegal nops preserve all flags...
WasteTime SUBROUTINE
.byte $04 ;+0 36 cycles
.byte $04 ;+1 35
.byte $04 ;+2 33
.byte $04 ;+3 32
.byte $04 ;+4 30
.byte $04 ;+5 29
.byte $04 ;+6 27
.byte $04 ;+7 26
.byte $04 ;+8 24
.byte $04 ;+9 23
.byte $04 ;+10 21
.byte $04 ;+11 20
.byte $04 ;+12 18
nop ;+13 17
.byte $04 ;+14 15
;--------------------------
.byte $04 ;+15 34
rts
.byte $04 ;+17 31
nop
.byte $04 ;+19 28
nop
.byte $04 ;+21 25
nop
.byte $04 ;+23 22
nop
.byte $04 ;+25 19
nop
nop ;+27 16
nop ;+28 14
rts ;+29 12
sta WSYNC
;--------------------------------
lda #RED+4 ;2 @2
sta COLUP0 ;3 @5
lda (ufoGfx),Y ;5 @10
sta GRP0 ;3 @13
jsr WasteTime+19 ;28 @41
sta RESP1 ;3 @44
;code continues...
Edited by Omegamatrix, Wed Apr 20, 2011 12:25 AM.
Posted Thu Apr 21, 2011 1:08 AM
Omegamatrix, on Wed Apr 20, 2011 12:20 AM, said:
Posted Fri Apr 22, 2011 5:35 PM
Thomas Jentzsch, on Thu Apr 21, 2011 1:08 AM, said:
Omegamatrix, on Wed Apr 20, 2011 12:20 AM, said:
; nops, and illegal nops preserve all flags...
WasteTime SUBROUTINE
.byte $80 ;+0 36 cycles
.byte $80 ;+1 35
.byte $80 ;+2 34
.byte $80 ;+3 33
.byte $80 ;+4 32
.byte $80 ;+5 31
.byte $80 ;+6 30
.byte $80 ;+7 29
.byte $80 ;+8 28
.byte $80 ;+9 27
.byte $80 ;+10 26
.byte $80 ;+11 25
.byte $80 ;+12 24
.byte $80 ;+13 23
.byte $80 ;+14 22
.byte $80 ;+15 21
.byte $80 ;+16 20
.byte $80 ;+17 19
.byte $80 ;+18 18
.byte $80 ;+19 17
.byte $80 ;+20 16
.byte $04 ;+21 15
nop ;+22 14
rts ;+23 12
0 members, 0 guests, 0 anonymous users