www.retrosoftware.co.uk
http://www.retrosoftware.co.uk/forum/

Here is some old Mode 2 horizontal scrolling code
http://www.retrosoftware.co.uk/forum/viewtopic.php?f=73&t=604
Page 1 of 1

Author:  tricky [ Fri Apr 01, 2011 7:31 pm ]
Post subject:  Here is some old Mode 2 horizontal scrolling code

I don't really expect anything from this other than a few "you could have done this better" - well, I probably could have ;-(

I can't remember what dum1 was for, but I seem to remember INKEY-1 is shift.

But if anyone wants to play or get inspired, here it is:

10*K.10O.|MREN.|M*FX12,3|ML.|M
20MODE7
30fx=&FFF4
40PROCass
50FOR X%=0 TO 255:rscr?X%=?(&C000+(X%DIV 32)+(X% MOD 32)*8):NEXT
60MODE2
70?dum1=1-INKEY-1
80FOR C=1TO3
90READ A,B
100?&FE00=A:?&FE01=B
110NEXT
120?&FE40=4:?&FE40=5
130DATA 1,64,2,90,8,193
140CALL intit
150FOR X=1 TO 64:?(&3FFF+RND(&4000))=RND AND 25:NEXT
160!&4000=&3F3F3F3F
170END
180DEFPROCass:FOR pass=0 TO 3 STEP 2-INKEY-1
190P%=&1100
200[:OPT pass
210.blob:EQUS STRING$(60,CHR$(&F)+CHR$(&00)+CHR$(&3)+CHR$(&C)):.dum1 :EQUD 0:EQUD 0:EQUD 0:EQUW 0:.blobx:EQUB 1:.bloby:EQUB 1
220.rscr:EQUS STRING$(255,CHR$&12):EQUB &FF
230.Print:STA &81:LDA #0:STA &80:LDY #254
240LDA (&80),Y:INY:ASL A:ASL A:ASL A:STA &70:LDA (&80),Y:ROL A:AND #63:ORA #64:STA &71
250.lp1:LDY #79:.lp3:LDA (&80),Y:EOR (&70),Y:STA (&70),Y:DEY:BPL lp3
260INC &71:INC &71:LDA &71:BPL lp2:SBC #79:STA &71
270.lp2:CLC:LDA &80:ADC #80:STA &80:CMP #240:BNE lp1:RTS
280.intit:php:sei:LDA #int MOD 256:sta &220:lda #int DIV 256:sta &221:lda #14:ldx #4:jsr &FFF4:LDA #&11:STA &F9:JSR Print:plp:LDA #0:STA &70:rts
290
300.int:PHP:SEI:PHA:TXA:PHA:TYA:PHA
310LDA dum1:EOR #1:STA dum1:BNE endnot:jmp ending:.endnot
320LDA lo:ASL A:ASL A:ASL A:STA &70:LDA ry:ROL A:AND #63:ORA #64:STA &71
330INC lo:BNE ai2:INC hi:LDA hi:AND #7:BNE ai2:LDA #8:STA hi:.ai2
340LDA lo:AND #63:BNE a13:INC ry:.a13
350LDA #13:STA &FE00:LDA lo:STA &FE01:LDA #12:STA &FE00:LDA hi:STA &FE01
360
370LDX #31:.rs1:LDY #7:.rs
380LDA rscr,X:STA scc1
390.scc2:LDA #3:ASL scc1:BCS scc3
400LDA #0:.scc3:STA (&70),Y
410DEY:BPL scc2:INC &71:BPL rs4:LDA #&41:STA &71:JMP rs5:.rs4:INC &71:BPL rs5:LDA #&40:STA &71:.rs5
420DEX:BPL rs1:CLC:LDA rs+1:ADC #32:STA rs+1
430
440LDA #&11:JSR Print:INC &11FE:LDA &11FE:AND #63:BNE ai1:INC &11FF:.ai1:LDA #&11:JSR Print
450
460.ending:LDA #0:STA &FE21:PLA:TAY:PLA:TAX:LDA #7:STA &FE21:PLA:PLP:RTS:.lo:EQUB 0:.hi:EQUB 8:.rx EQUB 0:.ry EQUB 0:.scc1 EQUB 0
470]:NEXT:ENDPROC

Author:  DaveM [ Thu Jun 09, 2011 5:52 am ]
Post subject:  Re: Here is some old Mode 2 horizontal scrolling code

Again, thanks for sharing.

Disc image added below!

Attachments:
RB_Mode2HorizontalScrollingCode.zip [1.63 KiB]
Downloaded 16 times

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/