base:4_ways_scroll_part_1
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:4_ways_scroll_part_1 [2015-04-17 04:30] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== 4 ways scroll part 1 ====== | ||
+ | < | ||
+ | ; 4 Ways Scroll | ||
+ | ; by malcolm bamber | ||
+ | ; http:// | ||
+ | ; Assembler Used C64ASM.EXE | ||
+ | |||
+ | .word $0801 ; Starting address for loader | ||
+ | * = $0801 | ||
+ | .word nextLine ; Line link | ||
+ | .word $0 ; Line number | ||
+ | .byte 158 ; SYS | ||
+ | .byte ' | ||
+ | .byte 0 | ||
+ | nextLine .byte 0,0 ; end of basic | ||
+ | |||
+ | * = 14500 | ||
+ | asemcode | ||
+ | |||
+ | Ptrhiddenscreen | ||
+ | Ptrscreen = $2d ; screen address you can see two byte address | ||
+ | Ptrmap = $2f ; map address two byte address | ||
+ | Ptrmapcolour | ||
+ | Ptrcolour = $33 ; colour address | ||
+ | PtrSparecolour | ||
+ | raster = 245 | ||
+ | free = $5 ; THESE ARE FREE AT THE MONENT | ||
+ | free1 = $6 ; THESE ARE FREE AT THE MOMENT | ||
+ | scrollstop = $7 ; if set then no stop scrolling screen | ||
+ | sync = $8 | ||
+ | xscroll = $9 ; screen is all the way to the left | ||
+ | yscroll = $c ; screen is all the way to the up | ||
+ | whichscreen = $d ; which screen we are showing 1024 or 3072 | ||
+ | mapwidth = $e | ||
+ | maphight = $f | ||
+ | mapx = $12 ; this will tell how far left or right we are on map | ||
+ | mapy = $14 ; this will tell how far up or down we are on the map | ||
+ | udflag = $15 ; if udflag = 0 | ||
+ | lrflag = $16 ; what side of | ||
+ | key = $C5 ; WHAT KEY IS PRESSED | ||
+ | temp0 = $37 | ||
+ | temp1 = $38 | ||
+ | temp2 = $39 | ||
+ | temp3 = $3a | ||
+ | temp4 = $3b | ||
+ | temp5 = $3c | ||
+ | temp6 = $3d | ||
+ | temp7 = $3e | ||
+ | temp8 = $3f | ||
+ | temp9 = $40 | ||
+ | temp10 | ||
+ | temp11 | ||
+ | temp12 | ||
+ | temp13 | ||
+ | temp14 | ||
+ | temp15 | ||
+ | temp16 = $fb | ||
+ | temp17 = $fc | ||
+ | temp18 = $fd | ||
+ | temp19 = $fe | ||
+ | temp20 = $ff | ||
+ | temp21 = $20 | ||
+ | |||
+ | maxwidth = 39 ; You must take 20 from mapwidth has 20 tiles are show across | ||
+ | maxheight = 23 ; you must take 13 from maphight has 13 tiles arw show down | ||
+ | |||
+ | ;*** setup varibles | ||
+ | lda #0 ; MAKE IRQ JUMP OUT BEFORE DOING ANY SCROLL WORK | ||
+ | sta scrollstop ; | ||
+ | lda #0 ; SET SCREEN XSCROLL POSITION NEAR THE MIDDLE 7=left 0=right | ||
+ | sta xscroll ; | ||
+ | lda #0 ; SET SCREEN YSCROLL POSITION NEAR THE MIDDLE 7=up 0=down | ||
+ | sta yscroll ; | ||
+ | lda #59 ; TILES ACROSS | ||
+ | sta mapwidth ; | ||
+ | lda #36 ; ROW DOWN | ||
+ | sta maphight ; | ||
+ | lda #$0f | ||
+ | sta $d418 ; SELECT FILTER MODE AND VOLUME | ||
+ | |||
+ | lda #0 | ||
+ | sta mapx ; THIS WILL TELL HOW FAR LEFT OR RIGHT WE ARE ON MAP | ||
+ | lda #0 | ||
+ | sta mapy ; THIS WILL TELL HOW FAR UP OR DOWN WE ARE ON THE MAP | ||
+ | sta sync ; WAIT FOR RASTER TO START AT THE TOP | ||
+ | lda #0 | ||
+ | sta free | ||
+ | sta free1 | ||
+ | lda #0 | ||
+ | sta udflag ; WHICH SIDE TO DRAW NEXT TILE STRIP TOP OR BOTTOM OF SCREEN | ||
+ | sta lrflag ; WHICH SIDE TO DRAW NEXT TILE STRIP LEFT OR RIGHT OF SCREEN | ||
+ | lda #< | ||
+ | sta Ptrscreen ; | ||
+ | lda #>1024 | ||
+ | sta Ptrscreen+1 ; | ||
+ | lda #< | ||
+ | sta Ptrhiddenscreen ; | ||
+ | lda #>3072 | ||
+ | sta Ptrhiddenscreen+1 ; | ||
+ | lda #1 | ||
+ | sta whichscreen ; WHICH SCREEN WE ARE SHOWING 1024 OR 3072 | ||
+ | |||
+ | lda #1 ; TEXT COLOUR | ||
+ | jsr $ffd2 ; SET COLOUR FOR KERNAL SCREEN PRINTING | ||
+ | |||
+ | jsr setup ; SET UP MEMORY FOR GAME | ||
+ | jsr $e544 ; CLEAR SCREEN | ||
+ | ;inc $d020 | ||
+ | |||
+ | jsr setcursor | ||
+ | jsr makemapynumbers ; | ||
+ | |||
+ | ; | ||
+ | ;** MAIN LOOP ** | ||
+ | ; | ||
+ | main | ||
+ | jsr setupirq ; | ||
+ | |||
+ | |||
+ | ldy #0 ; FILL SCREEN WITH VALUE IN Y AND FILL COLOUR WITH VALUE IN X | ||
+ | ldx #0 | ||
+ | lda Ptrscreen | ||
+ | sta temp0 | ||
+ | lda Ptrscreen+1 | ||
+ | sta temp1 | ||
+ | lda Ptrcolour | ||
+ | sta temp2 | ||
+ | lda Ptrcolour+1 | ||
+ | sta temp3 | ||
+ | jsr fillscreen | ||
+ | |||
+ | |||
+ | ldy #0 ; FILL SCREEN WITH VALUE IN Y AND FILL COLOUR WITH VALUE IN X | ||
+ | ldx #0 | ||
+ | lda Ptrhiddenscreen | ||
+ | sta temp0 | ||
+ | lda Ptrhiddenscreen+1 | ||
+ | sta temp1 | ||
+ | lda PtrSparecolour | ||
+ | sta temp2 | ||
+ | lda PtrSparecolour+1 | ||
+ | sta temp3 | ||
+ | jsr fillscreen | ||
+ | |||
+ | lda Ptrscreen | ||
+ | sta temp0 | ||
+ | lda Ptrscreen+1 | ||
+ | sta temp1 | ||
+ | lda Ptrcolour | ||
+ | sta temp2 | ||
+ | lda Ptrcolour+1 | ||
+ | sta temp3 | ||
+ | jsr drawscreen ; | ||
+ | |||
+ | lda Ptrscreen ; | ||
+ | sta temp1 | ||
+ | lda Ptrscreen+1 | ||
+ | sta temp2 | ||
+ | lda Ptrcolour ; | ||
+ | sta temp3 | ||
+ | lda Ptrcolour+1 | ||
+ | sta temp4 | ||
+ | jsr fillrightside ; | ||
+ | |||
+ | clc | ||
+ | lda Ptrscreen ; | ||
+ | adc #<960 | ||
+ | sta temp1 | ||
+ | lda Ptrscreen+1 | ||
+ | adc #>960 | ||
+ | sta temp2 | ||
+ | clc | ||
+ | lda Ptrcolour ; | ||
+ | adc #<960 | ||
+ | sta temp3 | ||
+ | lda Ptrcolour+1 | ||
+ | adc #>960 | ||
+ | sta temp4 | ||
+ | jsr fillbottom | ||
+ | |||
+ | mainloop | ||
+ | lda sync ; WAIT FOR SYNC TO = ONE | ||
+ | cmp #1 | ||
+ | bne mainloop | ||
+ | lda #0 ; CLEAR OLD SYNC FLAG | ||
+ | sta sync | ||
+ | |||
+ | lda scrollstop ; | ||
+ | cmp #0 ; IS IT ZERO | ||
+ | bne mainloop | ||
+ | |||
+ | lda 197 ; get key | ||
+ | cmp #1 ; is it returnkey | ||
+ | bne _next ; no | ||
+ | jsr swapscreen | ||
+ | jsr setcursor ; | ||
+ | ldx mapx | ||
+ | ldy #0 | ||
+ | jsr printnum | ||
+ | jsr swapscreen | ||
+ | _next | ||
+ | |||
+ | joystick | ||
+ | ;lda $DC01 ; VALUE FOR JOYSTICK IN PORT ONE | ||
+ | ;cmp #$7F ; NEUTRAL | ||
+ | ;bne _checkforup | ||
+ | lda $DC00 ; VALUE FOR JOYSTICK IN PORT TWO | ||
+ | cmp #$7F | ||
+ | bne _checkforup | ||
+ | jmp mainloop | ||
+ | |||
+ | _checkforup | ||
+ | cmp #$7E ; UP | ||
+ | bne _checkfordown ; | ||
+ | lda mapy | ||
+ | cmp #0 ; MAKE SURE WE CAN STILL MOVE DOWN | ||
+ | beq _quitup | ||
+ | lda #2 ; VALUE TO USE | ||
+ | sta scrollstop ; | ||
+ | lda #3 ; YSCROLL VALUE | ||
+ | sta yscroll ; SET SCREEN STARTING POSITION | ||
+ | _quitup | ||
+ | jmp mainloop ; | ||
+ | |||
+ | _checkfordown | ||
+ | cmp #$7D ; DOWN | ||
+ | bne _checkforleft ; | ||
+ | lda mapy ; GET VALUE OF MAP POINTER | ||
+ | cmp # | ||
+ | beq _quitdown | ||
+ | lda #2 ; VALUE TO USE | ||
+ | sta scrollstop ; | ||
+ | lda #4 ; YSCROLL VALUE | ||
+ | sta yscroll ; SET SCREEN STARTING POSITION | ||
+ | _quitdown | ||
+ | jmp mainloop ; | ||
+ | |||
+ | _checkforleft | ||
+ | cmp #$7B ; LEFT | ||
+ | bne _checkforright ; | ||
+ | lda mapx ; GET VALUE OF MAP POINTER | ||
+ | cmp #0 ; MAKE SURE WE CAN STILL MOVE LEFT | ||
+ | beq _quitleft ; | ||
+ | lda #1 ; VALUE TO USE | ||
+ | sta scrollstop ; | ||
+ | lda #3 ; XSCROLL VALUE | ||
+ | sta xscroll | ||
+ | _quitleft | ||
+ | jmp mainloop ; | ||
+ | |||
+ | _checkforright | ||
+ | cmp #$77 ; RIGHT | ||
+ | bne _quitright | ||
+ | lda mapx ; GET VALUE OF MAP POINTER | ||
+ | cmp # | ||
+ | beq _quitright | ||
+ | lda #1 ; VALUE TO USE | ||
+ | sta scrollstop ; | ||
+ | lda #4 ; XSCROLL VALUE | ||
+ | sta xscroll ; SET SCREEN STARTING POSITION | ||
+ | _quitright | ||
+ | jmp mainloop ; | ||
+ | |||
+ | ; quit | ||
+ | _quitout | ||
+ | lda $D016 ; SELECT 38/40 COLUMN TEXT DISPLAY: 1 = 40 COLS | ||
+ | eor # | ||
+ | sta $D016 | ||
+ | lda $D016 ; END OF SCROLL PART OF THE SCREEN | ||
+ | and #%11111000 | ||
+ | ora #7 | ||
+ | sta $D016 ; MOVE THE SCREEN ALL THE WAY LEFT | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ;* WORK OUT Y VALUES OF MAP ADDRESS * | ||
+ | ; | ||
+ | makemapynumbers | ||
+ | lda #0 ; mapy value to use | ||
+ | sta temp8 | ||
+ | lda #0 | ||
+ | sta (temp9) ; index to pointer array | ||
+ | |||
+ | _loop | ||
+ | lda temp8 ; number to times | ||
+ | sta temp0 | ||
+ | lda #0 | ||
+ | sta temp1 | ||
+ | lda mapwidth ; | ||
+ | sta temp2 | ||
+ | lda #0 | ||
+ | sta temp3 | ||
+ | jsr mult16 ; scratch temp0 - temp7 | ||
+ | |||
+ | ldy temp9 | ||
+ | lda temp4 ; low byte value return from mult16 | ||
+ | sta mapyaddress, | ||
+ | iny | ||
+ | lda temp5 ; high byte value return from mult16 | ||
+ | sta mapyaddress, | ||
+ | inc temp9 | ||
+ | inc temp9 | ||
+ | inc temp8 | ||
+ | lda maphight | ||
+ | cmp temp8 ; is y value = to it | ||
+ | bne _loop ; no | ||
+ | rts ; yes | ||
+ | |||
+ | ; | ||
+ | ;* FILL TOP ROW ON SCREEN | ||
+ | ;* using temp1 - temp13 * | ||
+ | ;* temp 1 & 2 = screen address | ||
+ | ;* temp 3 & 4 = colour address | ||
+ | ;* temp 5 & 6 = Ptrmap address | ||
+ | ;* temp 7 & 8 = Ptrmapcolour | ||
+ | ;* temp 10 = X Position On Screen * | ||
+ | ;* temp 11 = X Position On Map * | ||
+ | ;* temp 12 = Ascii Value From Map | ||
+ | ;* temp 13 = Colour Value From Map * | ||
+ | ; | ||
+ | filltop | ||
+ | clc | ||
+ | lda mapy ; get map array index | ||
+ | asl a | ||
+ | tay | ||
+ | clc | ||
+ | lda Ptrmap ; map address | ||
+ | adc mapyaddress, | ||
+ | sta temp5 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp6 | ||
+ | clc | ||
+ | lda Ptrmapcolour ; | ||
+ | adc mapyaddress, | ||
+ | sta temp7 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp8 | ||
+ | |||
+ | lda #0 | ||
+ | sta temp10 ; SET ACROSS POSITION ON SCREEN | ||
+ | lda mapx ; HOW FAR ACROSS MAP | ||
+ | sta temp11 | ||
+ | |||
+ | _drawtile | ||
+ | ldy temp11 ; SET ACROSS ON MAP | ||
+ | lda (temp5), | ||
+ | ;lda #0 ; ***** DEBUG ONLY ***** | ||
+ | sta temp12 ; STORE IT | ||
+ | lda (temp7), | ||
+ | sta temp13 ; STORE COLOUR OF TILE | ||
+ | |||
+ | lda udflag ; ARE WE DRAWING THE TOP OF THE TILE OR BOTTOM | ||
+ | cmp #1 ; ARE WE DRAWING THE BOTTOM PART OF THE TILE | ||
+ | bne _drawfirst ; | ||
+ | |||
+ | inc temp12 ; YES THEN SET CHAR VALUE TO SECOND LINE OF TILE | ||
+ | inc temp12 | ||
+ | |||
+ | |||
+ | _drawfirst | ||
+ | ldy temp10 ; SET X POSITION ON SCREEN | ||
+ | lda temp12 ; GET TILE CHAR VALUE | ||
+ | sta (temp1), | ||
+ | lda temp13 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | inc temp10 ; MOVE TO NEXT POSITION ON SCREEN | ||
+ | |||
+ | _drawsecond | ||
+ | ldy temp10 | ||
+ | ldx temp12 ; GET TILE CHAR VALUE | ||
+ | inx | ||
+ | txa | ||
+ | sta (temp1), | ||
+ | lda temp13 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | inc temp10 | ||
+ | |||
+ | inc temp11 ; HOW FAR ACROSS MAP | ||
+ | |||
+ | lda temp10 ; CHECK HOW MANY TILE WE HAVE DRAWN | ||
+ | cmp #39 ; HAVE WE DONE A FULL ROW ACROSS | ||
+ | beq _quit | ||
+ | cmp #40 ; HAVE WE DONE A FULL ROW ACROSS | ||
+ | beq _quit | ||
+ | jmp _drawtile ; | ||
+ | _quit | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ;* FILL BOTTOM ROW ON SCREEN | ||
+ | ;* using temp1 - temp13 * | ||
+ | ;* temp 1 & 2 = screen address | ||
+ | ;* temp 3 & 4 = colour address * | ||
+ | ;* temp 5 & 6 = Ptrmap address * | ||
+ | ;* temp 7 & 8 = Ptrmapcolour * | ||
+ | ;* temp 10 = X Position On Screen * | ||
+ | ;* temp 11 = X Position On Map * | ||
+ | ;* temp 12 = Ascii Value From Map | ||
+ | ;* temp 13 = Colour Value From Map * | ||
+ | ; | ||
+ | fillbottom | ||
+ | clc | ||
+ | lda mapy ; get map array index | ||
+ | adc # | ||
+ | asl a | ||
+ | tay | ||
+ | clc | ||
+ | lda Ptrmap ; map address | ||
+ | adc mapyaddress, | ||
+ | sta temp5 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp6 | ||
+ | clc | ||
+ | lda Ptrmapcolour ; | ||
+ | adc mapyaddress, | ||
+ | sta temp7 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp8 | ||
+ | lda #0 | ||
+ | sta temp10 ; SET ACROSS POSITION ON SCREEN | ||
+ | lda mapx ; HOW FAR ACROSS MAP | ||
+ | sta temp11 | ||
+ | |||
+ | _drawtile | ||
+ | ldy temp11 ; SET ACROSS ON MAP | ||
+ | lda (temp5), | ||
+ | ;lda #0 ; ***** DEBUG ONLY ***** | ||
+ | sta temp12 ; STORE IT | ||
+ | lda (temp7), | ||
+ | sta temp13 ; STORE COLOUR OF TILE | ||
+ | |||
+ | lda udflag ; ARE WE DRAWING THE TOP OF THE TILE OR BOTTOM | ||
+ | cmp #1 ; ARE WE DRAWING THE BOTTOM PART OF THE TILE | ||
+ | bne _drawfirst | ||
+ | |||
+ | inc temp12 ; YES THEN SET CHAR VALUE TO SECOND LINE OF TILE | ||
+ | inc temp12 | ||
+ | |||
+ | _drawfirst | ||
+ | ldy temp10 | ||
+ | lda temp12 ; GET TILE CHAR VALUE | ||
+ | sta (temp1), | ||
+ | lda temp13 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | inc temp10 ; MOVE TO NEXT POSITION ON SCREEN | ||
+ | |||
+ | _drawsecond | ||
+ | ldy temp10 ; SET X POSITION ON SCREEN | ||
+ | ldx temp12 ; GET TILE CHAR VALUE | ||
+ | inx | ||
+ | txa | ||
+ | sta (temp1), | ||
+ | lda temp13 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | inc temp10 ; MOVE TO NEXT POSITION ON SCREEN | ||
+ | |||
+ | inc temp11 ; HOW FAR ACROSS MAP | ||
+ | |||
+ | lda temp10 ; CHECK HOW MANY TILE WE HAVE DRAWN | ||
+ | cmp #39 ; HAVE WE DONE A FULL ROW ACROSS | ||
+ | beq _quit | ||
+ | cmp #40 ; HAVE WE DONE A FULL ROW ACROSS | ||
+ | beq _quit | ||
+ | jmp _drawtile ; | ||
+ | _quit | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ;* FILL LEFT SIDE ON SCREEN | ||
+ | ;* using temp1 - temp14 | ||
+ | ;* temp 1 & 2 = screen address | ||
+ | ;* temp 3 & 4 = colour address | ||
+ | ;* temp 5 & 6 = Ptrmap address | ||
+ | ;* temp 7 & 8 = Ptrmap colour address | ||
+ | ;* temp 9 = Ascii Value From Map * | ||
+ | ;* temp 10 = Colour Value From Map * | ||
+ | ;* temp 11 = Were line count is stored | ||
+ | ;* temp 12 = Y Value On Map * | ||
+ | ;* temp 13 = which side of tile to draw * | ||
+ | ;* temp 14 = X Position On Map * | ||
+ | ; | ||
+ | fillleftside | ||
+ | lda mapy | ||
+ | sta temp12 ; set mapy | ||
+ | |||
+ | lda temp12 ; get mapy value | ||
+ | asl a | ||
+ | tay | ||
+ | clc | ||
+ | lda Ptrmap ; map address | ||
+ | adc mapyaddress, | ||
+ | sta temp5 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp6 | ||
+ | clc | ||
+ | lda Ptrmapcolour ; | ||
+ | adc mapyaddress, | ||
+ | sta temp7 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp8 | ||
+ | |||
+ | lda #0 ; count line drawn down | ||
+ | sta temp11 ; SET ACROSS POSITION ON SCREEN | ||
+ | lda #0 ; WE ALLWAYS START ON THE FIRST PART OF A tile | ||
+ | sta temp13 | ||
+ | |||
+ | lda mapx ; set mapx to left side of map | ||
+ | sta temp14 | ||
+ | |||
+ | _drawtile | ||
+ | ldy temp14 ; SET ACROSS ON MAP | ||
+ | lda (temp5), | ||
+ | ;lda #0 ; ***** DEBUG ONLY ***** | ||
+ | sta temp9 ; STORE IT | ||
+ | lda (temp7), | ||
+ | sta temp10 ; STORE COLOUR OF TILE | ||
+ | |||
+ | lda temp13 ; ARE WE DRAWING THE TOP OF THE TILE OR BOTTOM | ||
+ | cmp #0 ; ARE WE DRAWING THE TOP PART OF THE TILE | ||
+ | beq _topline | ||
+ | |||
+ | inc temp9 ; NO THEN SET CHAR VALUE TO SECOND LINE OF TILE | ||
+ | inc temp9 | ||
+ | |||
+ | _topline | ||
+ | lda lrflag ; YES THEN SEE WHICH SIDE OF TILE TO DRAW | ||
+ | cmp #1 ; RIGHT SIDE | ||
+ | beq _drawrightside ; | ||
+ | |||
+ | _drawleftside | ||
+ | ldy #0 ; SET X POSITION ON SCREEN | ||
+ | lda temp9 | ||
+ | sta (temp1), | ||
+ | lda temp10 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | jmp _next | ||
+ | |||
+ | _drawrightside | ||
+ | ldy #0 ; SET X POSITION ON SCREEN | ||
+ | ldx temp9 ; GET TILE CHAR VALUE | ||
+ | inx | ||
+ | txa | ||
+ | sta (temp1), | ||
+ | lda temp10 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | |||
+ | _next | ||
+ | lda temp13 ; ARE WE DRAWING THE TOP OF THE TILE OR BOTTOM | ||
+ | cmp #1 ; ARE WE DRAWING THE BOTTOM PART OF THE TILE | ||
+ | bne _continue2 | ||
+ | |||
+ | inc temp12 ; move mapy value down one line | ||
+ | lda temp12 ; get mapy value | ||
+ | asl a | ||
+ | tay | ||
+ | clc | ||
+ | lda Ptrmap ; map address | ||
+ | adc mapyaddress, | ||
+ | sta temp5 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp6 | ||
+ | clc | ||
+ | lda Ptrmapcolour ; | ||
+ | adc mapyaddress, | ||
+ | sta temp7 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp8 | ||
+ | |||
+ | _continue2 | ||
+ | sec ; BOOL UDFLAG | ||
+ | lda #1 | ||
+ | sbc temp13 | ||
+ | sta temp13 | ||
+ | |||
+ | clc | ||
+ | lda temp1 | ||
+ | adc #40 | ||
+ | sta temp1 | ||
+ | lda temp2 | ||
+ | adc #0 | ||
+ | sta temp2 | ||
+ | clc ; hidden screen colour address | ||
+ | lda temp3 | ||
+ | adc #40 | ||
+ | sta temp3 | ||
+ | lda temp4 | ||
+ | adc #0 | ||
+ | sta temp4 | ||
+ | |||
+ | inc temp11 ; NEXT LINE DOWN COUNT | ||
+ | lda temp11 ; GET TILE DOWN COUNT | ||
+ | cmp #25 ; HAVE WE DONE 12 TILES DOWN | ||
+ | beq _quit | ||
+ | jmp _drawtile ; | ||
+ | _quit | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ;* FILL RIGHT SIDE ON SCREEN | ||
+ | ;* using temp1 - temp14 | ||
+ | ;* temp 1 & 2 = screen address * | ||
+ | ;* temp 3 & 4 = colour address | ||
+ | ;* temp 5 & 6 = Ptrmap address | ||
+ | ;* temp 7 & 8 = Ptrmap colour address | ||
+ | ;* temp 9 = Ascii Value From Map * | ||
+ | ;* temp 10 = Colour Value From Map * | ||
+ | ;* temp 11 = Were line count is stored | ||
+ | ;* temp 12 = Y Value On Map * | ||
+ | ;* temp 13 = which side of tile to draw * | ||
+ | ;* temp 14 = X Position On Map * | ||
+ | ; | ||
+ | fillrightside | ||
+ | lda mapy | ||
+ | sta temp12 ; set mapy | ||
+ | lda #0 ; clear memory | ||
+ | sta temp16 | ||
+ | sta temp17 | ||
+ | |||
+ | lda temp12 ; get mapy value | ||
+ | asl a | ||
+ | tay | ||
+ | clc | ||
+ | lda Ptrmap ; map address | ||
+ | adc mapyaddress, | ||
+ | sta temp5 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp6 | ||
+ | clc | ||
+ | lda Ptrmapcolour ; | ||
+ | adc mapyaddress, | ||
+ | sta temp7 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp8 | ||
+ | |||
+ | lda #0 ; count line drawn down | ||
+ | sta temp11 ; SET ACROSS POSITION ON SCREEN | ||
+ | |||
+ | lda #0 ; WE ALLWAYS START ON THE FIRST PART OF A TILE | ||
+ | sta temp13 | ||
+ | clc ; set mapx to right side of map | ||
+ | lda mapx | ||
+ | adc # | ||
+ | sta temp14 | ||
+ | |||
+ | _drawtile | ||
+ | ldy temp14 ; SET ACROSS ON MAP | ||
+ | lda (temp5), | ||
+ | ;lda #0 ; ***** DEBUG ONLY ***** | ||
+ | sta temp9 ; STORE IT | ||
+ | lda (temp7), | ||
+ | sta temp10 ; STORE COLOUR OF TILE | ||
+ | |||
+ | lda temp13 ; ARE WE DRAWING THE TOP OF THE TILE OR BOTTOM | ||
+ | cmp #0 ; ARE WE DRAWING THE TOP PART OF THE TILE | ||
+ | beq _topline | ||
+ | |||
+ | inc temp9 ; NO THEN SET CHAR VALUE TO SECOND LINE OF TILE | ||
+ | inc temp9 | ||
+ | |||
+ | _topline | ||
+ | lda lrflag ; YES THEN SEE WHICH SIDE OF TILE TO DRAW | ||
+ | cmp #1 ; RIGHT SIDE | ||
+ | beq _drawrightside ; | ||
+ | |||
+ | _drawleftside | ||
+ | ldy #38 ; SET X POSITION ON SCREEN | ||
+ | lda temp9 ; GET TILE CHAR VALUE | ||
+ | sta (temp1), | ||
+ | lda temp10 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | jmp _next | ||
+ | |||
+ | _drawrightside | ||
+ | ldy #38 ; SET X POSITION ON SCREEN | ||
+ | ldx temp9 ; GET TILE CHAR VALUE | ||
+ | inx | ||
+ | txa | ||
+ | sta (temp1), | ||
+ | lda temp10 ; GET COLOUR VALUE | ||
+ | sta (temp3), | ||
+ | |||
+ | _next | ||
+ | lda temp13 | ||
+ | cmp #1 ; ARE WE DRAWING THE BOTTOM PART OF THE TILE | ||
+ | bne _continue2 ; | ||
+ | |||
+ | inc temp12 ; move mapy value down one line | ||
+ | lda temp12 ; get mapy value | ||
+ | asl a | ||
+ | tay | ||
+ | clc | ||
+ | lda Ptrmap | ||
+ | adc mapyaddress, | ||
+ | sta temp5 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp6 | ||
+ | clc | ||
+ | lda Ptrmapcolour ; | ||
+ | adc mapyaddress, | ||
+ | sta temp7 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp8 | ||
+ | |||
+ | _continue2 | ||
+ | sec ; BOOL UDFLAG | ||
+ | lda #1 | ||
+ | sbc temp13 | ||
+ | sta temp13 | ||
+ | |||
+ | clc ; hidden screen address | ||
+ | lda temp1 | ||
+ | adc #40 | ||
+ | sta temp1 | ||
+ | lda temp2 | ||
+ | adc #0 | ||
+ | sta temp2 | ||
+ | |||
+ | clc | ||
+ | lda temp3 | ||
+ | adc #40 | ||
+ | sta temp3 | ||
+ | lda temp4 | ||
+ | adc #0 | ||
+ | sta temp4 | ||
+ | |||
+ | inc temp11 ; next line down count | ||
+ | lda temp11 ; get tile down count | ||
+ | cmp #25 ; have we done 12 tiles down | ||
+ | beq _quit ; quit out | ||
+ | jmp _drawtile ; | ||
+ | _quit | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ;* COPY SCREEN LEFT & UP * | ||
+ | ;* temp0 to temp9 * | ||
+ | ;* x = 0 copy left , 1 copy up * | ||
+ | ;* temp 0 & 1 = screen address * | ||
+ | ;* temp 2 & 3 = hidden screen address * | ||
+ | ;* temp 4 & 5 = colour address * | ||
+ | ;* temp 6 & 7 = hidden colour address * | ||
+ | ;* temp8 = how many items across * | ||
+ | ;* temp9 = how many line * | ||
+ | ; | ||
+ | copyscreenlu | ||
+ | ;inc $d020 | ||
+ | lda Ptrscreen ; | ||
+ | sta temp0 | ||
+ | lda Ptrscreen+1 | ||
+ | sta temp1 | ||
+ | |||
+ | lda Ptrhiddenscreen ; | ||
+ | sta temp2 | ||
+ | lda Ptrhiddenscreen+1 | ||
+ | sta temp3 | ||
+ | |||
+ | lda Ptrcolour ; | ||
+ | sta temp4 | ||
+ | lda Ptrcolour+1 | ||
+ | sta temp5 | ||
+ | |||
+ | lda PtrSparecolour ; | ||
+ | sta temp6 | ||
+ | lda PtrSparecolour+1 | ||
+ | sta temp7 | ||
+ | |||
+ | lda #39 ; 40 39set how many across to maximum | ||
+ | sta temp8 | ||
+ | lda #25 ; set how many row down to maximum | ||
+ | sta temp9 | ||
+ | ; which way are we scrolling it | ||
+ | |||
+ | cpx #0 ; are we scrolling left | ||
+ | |||
+ | bne _up ; no | ||
+ | |||
+ | sec ; yes | ||
+ | lda temp8 ; how many char across to copy | ||
+ | sbc #1 ; minus offset | ||
+ | sta temp8 ; store it | ||
+ | |||
+ | clc | ||
+ | lda temp0 | ||
+ | adc #1 | ||
+ | sta temp0 | ||
+ | lda temp1 | ||
+ | adc #0 | ||
+ | sta temp1 | ||
+ | |||
+ | clc | ||
+ | lda temp4 ; position screen colour to copy from | ||
+ | adc #1 | ||
+ | sta temp4 | ||
+ | lda temp5 | ||
+ | adc #0 | ||
+ | sta temp5 | ||
+ | jmp _continue0 | ||
+ | |||
+ | _up | ||
+ | sec ; yes | ||
+ | lda temp9 ; how many char across to copy | ||
+ | sbc #1 ; minus offset | ||
+ | sta temp9 ; store it | ||
+ | |||
+ | clc | ||
+ | lda temp0 ; position screen pointer to copy from | ||
+ | adc #40 | ||
+ | sta temp0 | ||
+ | lda temp1 | ||
+ | adc #0 | ||
+ | sta temp1 | ||
+ | |||
+ | clc | ||
+ | lda temp4 ; position screen colour to copy from | ||
+ | adc #40 | ||
+ | sta temp4 | ||
+ | lda temp5 | ||
+ | adc #0 | ||
+ | sta temp5 | ||
+ | |||
+ | _continue0 | ||
+ | ldy #0 ; how many char across thew line have we copyed | ||
+ | ldx #0 ; how many lines down have we done | ||
+ | _continue | ||
+ | lda (temp0), | ||
+ | sta (temp2), | ||
+ | lda (temp4), | ||
+ | sta (temp6), | ||
+ | iny | ||
+ | cpy temp8 ; have we done 40 char across | ||
+ | bne _continue ; | ||
+ | |||
+ | inx ; yes then inc row counter | ||
+ | ldy #0 ; set y to first char on line | ||
+ | |||
+ | clc ; current screen address | ||
+ | lda temp0 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp0 | ||
+ | lda temp1 | ||
+ | adc #0 | ||
+ | sta temp1 | ||
+ | |||
+ | clc ; hidden screen address | ||
+ | lda temp2 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp2 | ||
+ | lda temp3 | ||
+ | adc #0 | ||
+ | sta temp3 | ||
+ | |||
+ | clc ; screen colour | ||
+ | lda temp4 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp4 | ||
+ | lda temp5 | ||
+ | adc #0 | ||
+ | sta temp5 | ||
+ | |||
+ | clc ; spare colour | ||
+ | lda temp6 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp6 | ||
+ | lda temp7 | ||
+ | adc #0 | ||
+ | sta temp7 | ||
+ | |||
+ | cpx temp9 ; have we done 24 rows yes | ||
+ | bne _continue ; | ||
+ | |||
+ | _quit | ||
+ | ;dec $d020 | ||
+ | rts ; yes then quit | ||
+ | |||
+ | ; | ||
+ | ;* COPY SCREEN RIGHT ONE OR DOWN ONE * | ||
+ | ;* temp0 - temp9 * | ||
+ | ;* x = 0 copy right , 1 copy down * | ||
+ | ;* temp 0 & 1 = hidden screen address * | ||
+ | ;* temp 2 & 3 = screen address * | ||
+ | ;* temp 4 & 5 = colour address * | ||
+ | ;* temp 6 & 7 = hidden colour address * | ||
+ | ;* temp8 = how many items across * | ||
+ | ;* temp9 = how many line * | ||
+ | ; | ||
+ | copyscreenrd | ||
+ | ;inc $d020 | ||
+ | |||
+ | lda Ptrhiddenscreen ; | ||
+ | sta temp0 | ||
+ | lda Ptrhiddenscreen+1 | ||
+ | sta temp1 | ||
+ | |||
+ | lda Ptrscreen | ||
+ | sta temp2 | ||
+ | lda Ptrscreen+1 | ||
+ | sta temp3 | ||
+ | |||
+ | lda Ptrcolour ; | ||
+ | sta temp4 | ||
+ | lda Ptrcolour+1 | ||
+ | sta temp5 | ||
+ | lda PtrSparecolour ; | ||
+ | sta temp6 | ||
+ | lda PtrSparecolour+1 | ||
+ | sta temp7 | ||
+ | |||
+ | lda #39 ; set how many across to maximum | ||
+ | sta temp8 | ||
+ | lda #25 ; set how many row up to maximum | ||
+ | sta temp9 | ||
+ | |||
+ | txa ; which way are we scrolling it | ||
+ | cmp #0 ; are we scrolling right | ||
+ | bne _down ; no | ||
+ | |||
+ | lda #38 ; set how many across to maximum | ||
+ | sta temp8 | ||
+ | |||
+ | clc ; yes | ||
+ | lda temp0 ; position screen pointer to copy from | ||
+ | adc #1 | ||
+ | sta temp0 | ||
+ | lda temp1 | ||
+ | adc #0 | ||
+ | sta temp1 | ||
+ | |||
+ | clc | ||
+ | lda temp6 ; position colour pointer to copy from | ||
+ | adc #1 | ||
+ | sta temp6 | ||
+ | lda temp7 | ||
+ | adc #0 | ||
+ | sta temp7 | ||
+ | |||
+ | jmp _continue0 | ||
+ | |||
+ | _down | ||
+ | lda #24 ; set how many row up to maximum | ||
+ | sta temp9 | ||
+ | |||
+ | clc ; yes | ||
+ | lda temp0 ; position screen pointer to copy from | ||
+ | adc #40 | ||
+ | sta temp0 | ||
+ | lda temp1 | ||
+ | adc #0 | ||
+ | sta temp1 | ||
+ | |||
+ | clc | ||
+ | lda temp6 ; position colour pointer to copy from | ||
+ | adc #40 | ||
+ | sta temp6 | ||
+ | lda temp7 | ||
+ | adc #0 | ||
+ | sta temp7 | ||
+ | |||
+ | _continue0 | ||
+ | ldy #0 ; how many char across thew line have we copyed | ||
+ | ldx #0 ; how many lines down have we done | ||
+ | _continue | ||
+ | lda (temp2), | ||
+ | sta (temp0), | ||
+ | lda (temp4), | ||
+ | sta (temp6), | ||
+ | iny ; next char on line | ||
+ | cpy temp8 ; are we at the left side of the screen | ||
+ | bne _continue ; | ||
+ | inx ; yes then dec row counter | ||
+ | ldy #0 ; set y to first char on line | ||
+ | |||
+ | clc ; add 40 to address to get to next line | ||
+ | lda temp0 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp0 | ||
+ | lda temp1 | ||
+ | adc #0 | ||
+ | sta temp1 | ||
+ | |||
+ | clc ; add 40 to address to get to next line | ||
+ | lda temp2 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp2 | ||
+ | lda temp3 | ||
+ | adc #0 | ||
+ | sta temp3 | ||
+ | |||
+ | clc ; add 40 to address to get to next line | ||
+ | lda temp4 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp4 | ||
+ | lda temp5 | ||
+ | adc #0 | ||
+ | sta temp5 | ||
+ | |||
+ | clc ; add 40 to address to get to next line | ||
+ | lda temp6 | ||
+ | adc #40 ; add 40 to address to get to next line | ||
+ | sta temp6 | ||
+ | lda temp7 | ||
+ | adc #0 | ||
+ | sta temp7 | ||
+ | |||
+ | cpx temp9 ; have we done 24 rows yes | ||
+ | bne _continue ; | ||
+ | ;dec $d020 | ||
+ | rts ; yes then quit | ||
+ | |||
+ | ; | ||
+ | ;* DRAW MAP ON SCREEN WITH COLOUR | ||
+ | ;* temp 0 & 1 = screen address * I DID NOT WANT TO MESS A ROUND WITH DRAWING HALF A TILE | ||
+ | ;* temp 2 & 3 = colour address * WHEN I COULD CALL A SOME CODE I HAVE ALREADY | ||
+ | ;* temp 4 & 5 = map address * WROTE TO DRAW ONE SIDE OF A TILE | ||
+ | ;* temp 6 & 7 = map colour address * | ||
+ | ;* temp 8 = tiles y screen * | ||
+ | ;* temp 9 = tiles down screen * | ||
+ | ;* temp10 = tile value | ||
+ | ;* temp11 = tile colour * | ||
+ | ;* temp12 = ymap * | ||
+ | ; | ||
+ | drawscreen | ||
+ | lda mapy ; GET CURRENT MAPY VALUE | ||
+ | asl a | ||
+ | tay | ||
+ | clc | ||
+ | lda Ptrmap ; MAP ADDRESS | ||
+ | adc mapyaddress, | ||
+ | sta temp4 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp5 | ||
+ | clc | ||
+ | lda Ptrmapcolour | ||
+ | adc mapyaddress, | ||
+ | sta temp6 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp7 | ||
+ | |||
+ | lda #0 | ||
+ | sta temp8 ; TILES DRAWN ACROSS | ||
+ | sta temp9 ; TILES DRAWN DOWN | ||
+ | sta temp10 ; TILE VALUE | ||
+ | sta temp11 ; COLOUR VALUE | ||
+ | sta temp12 ; Y FOR MAP | ||
+ | tay ; CLEAR Y | ||
+ | |||
+ | getdata | ||
+ | ldy temp12 | ||
+ | lda (temp4), | ||
+ | sta temp10 ; STORE IT | ||
+ | lda (temp6), | ||
+ | sta temp11 ; STORE IT | ||
+ | |||
+ | drawstart | ||
+ | ldy temp8 ; POSITION ON LINE | ||
+ | lda temp10 ; USE VALUE STORED TEMP | ||
+ | sta (temp0), | ||
+ | lda temp11 ; USE VALUE STORED TEMP | ||
+ | sta (temp2), | ||
+ | |||
+ | iny ; MOVE RIGHT | ||
+ | inc temp10 ; NEXT ASCII VALUE | ||
+ | |||
+ | lda temp10 ; USE VALUE STORED TEMP | ||
+ | sta (temp0), | ||
+ | lda temp11 ; USE VALUE STORED TEMP | ||
+ | sta (temp2), | ||
+ | |||
+ | tya ; SET Y TO NEXT LINE POSITION | ||
+ | clc | ||
+ | adc #39 | ||
+ | tay | ||
+ | |||
+ | inc temp10 ; NEXT ASCII VALUE | ||
+ | |||
+ | lda temp10 ; USE VALUE STORED TEMP | ||
+ | sta (temp0), | ||
+ | lda temp11 ; USE VALUE STORED TEMP | ||
+ | sta (temp2), | ||
+ | |||
+ | iny ; MOVE RIGHT | ||
+ | inc temp10 ; NEXT ASCII VALUE | ||
+ | |||
+ | lda temp10 | ||
+ | sta (temp0), | ||
+ | lda temp11 ; USE VALUE STORED TEMP | ||
+ | sta (temp2), | ||
+ | |||
+ | tya ; SET Y BACK TO LAST LINE | ||
+ | clc | ||
+ | sbc #39 | ||
+ | tay | ||
+ | |||
+ | inc temp12 | ||
+ | |||
+ | inc temp8 ; MOVE TO NEXT TILE | ||
+ | inc temp8 ; MOVE TO NEXT TILE | ||
+ | |||
+ | lda temp8 ; CHECK WHAT Y IS | ||
+ | cmp #38 ; IT Y SET TO THE LAST TILE ACROSS SCREEN | ||
+ | bne getdata ; NO | ||
+ | |||
+ | lda #0 ; YES | ||
+ | sta temp8 ; CLEAR VALUES | ||
+ | sta temp12 | ||
+ | |||
+ | inc temp9 ; SET TO NEXT LINE | ||
+ | |||
+ | lda temp9 ; GET LINES DOWN NUMNBER | ||
+ | asl a ; TIMES IT BY 2 | ||
+ | tay ; COPY IT TO Y | ||
+ | clc | ||
+ | lda Ptrmap ; MAP ADDRESS | ||
+ | adc mapyaddress, | ||
+ | sta temp4 | ||
+ | lda Ptrmap+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp5 | ||
+ | clc | ||
+ | lda Ptrmapcolour | ||
+ | adc mapyaddress, | ||
+ | sta temp6 | ||
+ | lda Ptrmapcolour+1 | ||
+ | adc mapyaddress+1, | ||
+ | sta temp7 | ||
+ | clc | ||
+ | lda temp0 ; SCREEN ADDRESS | ||
+ | adc #80 | ||
+ | sta temp0 | ||
+ | lda temp1 | ||
+ | adc #0 | ||
+ | sta temp1 | ||
+ | clc | ||
+ | lda temp2 ; COLOUR ADDRESS | ||
+ | adc #80 | ||
+ | sta temp2 | ||
+ | lda temp3 | ||
+ | adc #0 | ||
+ | sta temp3 | ||
+ | |||
+ | lda temp9 ; GET HOW MANY LINES DOWN WE HAVE DONE | ||
+ | cmp #12 ; HAVE WE DONE ALL THE LINE DOWN WE CAN | ||
+ | beq _quit ; | ||
+ | jmp getdata ; NO | ||
+ | _quit | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ;* FILL SCREEN WITH COLOUR | ||
+ | ;* temp0 - temp5 * | ||
+ | ;* x = what colour to use * | ||
+ | ;* y = what char to use * | ||
+ | ;* temp 0 & 1 = Screen Address * | ||
+ | ;* temp 2 & 3 = Colour Address * | ||
+ | ;* temp 4 = Colour To Use * | ||
+ | ;* temp 5 = Ascii To Use * | ||
+ | ; | ||
+ | fillscreen | ||
+ | |||
+ | stx temp4 ; what colour to use | ||
+ | sty temp5 ; what char to fill screen with | ||
+ | |||
+ | ldx #0 ; clear how many times to change high byte pointer | ||
+ | ldy #0 ; clear how many bytes we have written | ||
+ | |||
+ | _conloop | ||
+ | lda temp5 ; do char | ||
+ | sta (temp0), | ||
+ | |||
+ | lda temp4 ; do colour | ||
+ | sta (temp2), | ||
+ | iny ; increase byte counter | ||
+ | |||
+ | cpx #3 ; are we on the last block of byte to write | ||
+ | beq _less ; yes then only 231 bytes are needed to be written | ||
+ | |||
+ | cpy #0 ; if zero then y counter has rap around from 255 | ||
+ | ; so we have done 256 bytes | ||
+ | bne _conloop ; | ||
+ | jmp _contine | ||
+ | |||
+ | _less | ||
+ | cpy #232 ; have we done 231 bytes | ||
+ | bne _conloop | ||
+ | rts | ||
+ | |||
+ | _contine | ||
+ | inx | ||
+ | inc temp1 ; increase high byte of memeory address | ||
+ | inc temp3 ; increase high byte of memeory address | ||
+ | cpx #4 ; if x = 4 then we have done 4 blocks of bytes | ||
+ | ; 3*(0 to 255=256) and 1 (0 to 231=232) | ||
+ | bne _conloop ; | ||
+ | rts ; yes then we are done | ||
+ | |||
+ | ; | ||
+ | ;* copy colour to on screen bitmap * | ||
+ | ; | ||
+ | copycolour | ||
+ | ldy #0 | ||
+ | |||
+ | _loop | ||
+ | lda sparecolour+(13*40), | ||
+ | sta 55296+(13*40), | ||
+ | lda sparecolour+(14*40), | ||
+ | sta 55296+(14*40), | ||
+ | lda sparecolour+(15*40), | ||
+ | sta 55296+(15*40), | ||
+ | lda sparecolour+(16*40), | ||
+ | sta 55296+(16*40), | ||
+ | lda sparecolour+(17*40), | ||
+ | sta 55296+(17*40), | ||
+ | lda sparecolour+(18*40), | ||
+ | sta 55296+(18*40), | ||
+ | lda sparecolour+(19*40), | ||
+ | sta 55296+(19*40), | ||
+ | lda sparecolour+(20*40), | ||
+ | sta 55296+(20*40), | ||
+ | lda sparecolour+(21*40), | ||
+ | sta 55296+(21*40), | ||
+ | lda sparecolour+(22*40), | ||
+ | sta 55296+(22*40), | ||
+ | lda sparecolour+(23*40), | ||
+ | sta 55296+(23*40), | ||
+ | lda sparecolour+(24*40), | ||
+ | sta 55296+(24*40), | ||
+ | lda sparecolour+(0*40), | ||
+ | sta 55296+(0*40), | ||
+ | lda sparecolour+(1*40), | ||
+ | sta 55296+(1*40), | ||
+ | lda sparecolour+(2*40), | ||
+ | sta 55296+(2*40), | ||
+ | lda sparecolour+(3*40), | ||
+ | sta 55296+(3*40), | ||
+ | lda sparecolour+(4*40), | ||
+ | sta 55296+(4*40), | ||
+ | lda sparecolour+(5*40), | ||
+ | sta 55296+(5*40), | ||
+ | lda sparecolour+(6*40), | ||
+ | sta 55296+(6*40), | ||
+ | lda sparecolour+(7*40), | ||
+ | sta 55296+(7*40), | ||
+ | lda sparecolour+(8*40), | ||
+ | sta 55296+(8*40), | ||
+ | lda sparecolour+(9*40), | ||
+ | sta 55296+(9*40), | ||
+ | lda sparecolour+(10*40), | ||
+ | sta 55296+(10*40), | ||
+ | lda sparecolour+(11*40), | ||
+ | sta 55296+(11*40), | ||
+ | lda sparecolour+(12*40), | ||
+ | sta 55296+(12*40), | ||
+ | |||
+ | iny ; move to next line | ||
+ | cpy # | ||
+ | beq _quit | ||
+ | jmp _loop | ||
+ | _quit | ||
+ | rts | ||
+ | |||
+ | </ |
base/4_ways_scroll_part_1.txt · Last modified: 2015-04-17 04:30 by 127.0.0.1