mirror of
https://github.com/tilleul/apple2-8bitunity-mod.git
synced 2024-06-09 03:29:31 +00:00
updated from 8bitworkshop.com
This commit is contained in:
parent
c02e7d8965
commit
98dc6f2e74
82
8bitunity-plot_scroll.asm
Normal file
82
8bitunity-plot_scroll.asm
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
hiresXZP = $ec
|
||||||
|
hiresYZP = $ed
|
||||||
|
hiresAddrZP = $fc
|
||||||
|
inputAddrZP = $fa
|
||||||
|
outputAddrZP = $ee
|
||||||
|
scr2outRowsZP = $ce
|
||||||
|
inp2scrRowsZP = $eb
|
||||||
|
bytesPerRowZP = $e3
|
||||||
|
toggleMainAuxZP = $42
|
||||||
|
|
||||||
|
|
||||||
|
blitSHR subroutine
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
loopRow:
|
||||||
|
; Copy Screen Address from Hires Tables (using Line Offset Y and Byte Offset X)
|
||||||
|
ldy hiresYZP ; Y-Offset to Hires Line
|
||||||
|
lda hiresLinesHI,y
|
||||||
|
sta loopCopy1+2 ; LDA $HIlo,Y -- SMC -- +2 cycle
|
||||||
|
sta loopCopy2+5 ; STA $HIlo,Y -- SMC -- +5 cycles
|
||||||
|
lda hiresLinesLO,y
|
||||||
|
adc hiresXZP ; X-Offset to Hires Byte
|
||||||
|
sta loopCopy1+1 ; LDA $hiLO,Y -- SMC -- +2 cycle
|
||||||
|
sta loopCopy2+8 ; STA $hiLO,Y -- SMC -- +5 cycles
|
||||||
|
|
||||||
|
; Copy bytes from SHR buffer to ouput
|
||||||
|
screen2output:
|
||||||
|
lda outputAddrZP+1
|
||||||
|
beq input2screen ; If high-byte is zero, then skip
|
||||||
|
ldy #0 ; Y loop: Copy xxx bytes per row
|
||||||
|
loopCopy1: ; Copy 1 byte
|
||||||
|
lda $2000,y ; SMC: -1 cycle /byteperrow / line
|
||||||
|
sta (outputAddrZP),y
|
||||||
|
iny
|
||||||
|
cpy bytesPerRowZP
|
||||||
|
bne loopCopy1 ; Iterate Y loop
|
||||||
|
|
||||||
|
; Copy bytes from input to SHR buffer
|
||||||
|
cpx inp2scrRowsZP ; Check number of input rows (for cropped sprites)
|
||||||
|
bcs incAddress1
|
||||||
|
input2screen:
|
||||||
|
clc
|
||||||
|
lda inputAddrZP+1
|
||||||
|
beq incAddress1 ; If high-byte is zero, then skip
|
||||||
|
ldy #0 ; Y loop: Copy xxx bytes per row
|
||||||
|
loopCopy2:
|
||||||
|
lda (inputAddrZP),y ; Copy 1 byte
|
||||||
|
sta $2000,y ; SMC: -1 cycle / byteperrow / line
|
||||||
|
iny
|
||||||
|
cpy bytesPerRowZP ; Iterate Y loop
|
||||||
|
bne loopCopy2
|
||||||
|
|
||||||
|
incAddress1:
|
||||||
|
clc ; Increment address of output block
|
||||||
|
lda outputAddrZP
|
||||||
|
adc bytesPerRowZP ; Move by xxx bytes
|
||||||
|
sta outputAddrZP
|
||||||
|
bcc nocarry1 ; Check if carry to high-byte
|
||||||
|
inc outputAddrZP+1
|
||||||
|
nocarry1:
|
||||||
|
|
||||||
|
incAddress2:
|
||||||
|
clc ; Increment address of input block
|
||||||
|
lda inputAddrZP
|
||||||
|
adc bytesPerRowZP ; Move by xxx bytes
|
||||||
|
sta inputAddrZP
|
||||||
|
bcc nocarry2 ; Check if carry to high byte
|
||||||
|
inc inputAddrZP+1
|
||||||
|
nocarry2:
|
||||||
|
|
||||||
|
nextRow:
|
||||||
|
; Move to next row
|
||||||
|
inc hiresYZP ; Increment Hires Line offset
|
||||||
|
inx
|
||||||
|
cpx scr2outRowsZP
|
||||||
|
bcc loopRow ; Iterate X loop (rows)
|
||||||
|
|
||||||
|
rts
|
108
8bitunity.asm
108
8bitunity.asm
|
@ -1,92 +1,30 @@
|
||||||
|
|
||||||
|
|
||||||
processor 6502
|
processor 6502
|
||||||
seg.u ZEROPAGE ; uninitialized zero-page variables
|
|
||||||
org $0
|
|
||||||
|
kbd = $c000
|
||||||
|
kbstrb = $c010
|
||||||
|
speaker = $c030
|
||||||
|
|
||||||
_hiresLinesHI = $00
|
graphx = $c050
|
||||||
_hiresLinesLO = $01
|
text = $c051
|
||||||
|
page1 = $c054
|
||||||
|
hires = $c057
|
||||||
hiresXZP = $ec
|
|
||||||
hiresYZP = $ed
|
|
||||||
hiresAddrZP = $fc
|
|
||||||
inputAddrZP = $fa
|
|
||||||
outputAddrZP = $ee
|
|
||||||
scr2outRowsZP = $ce
|
|
||||||
inp2scrRowsZP = $eb
|
|
||||||
bytesPerRowZP = $e3
|
|
||||||
toggleMainAuxZP = $42
|
|
||||||
|
|
||||||
seg CODE
|
|
||||||
org $803 ; starting address
|
|
||||||
|
|
||||||
Start
|
|
||||||
jmp Start ; endless loop
|
|
||||||
|
|
||||||
|
|
||||||
|
org $803
|
||||||
|
|
||||||
|
|
||||||
ldx #0
|
|
||||||
loopRow:
|
|
||||||
; Copy Screen Address from Hires Tables (using Line Offset Y and Byte Offset X)
|
|
||||||
ldy hiresYZP ; Y-Offset to Hires Line
|
|
||||||
lda _hiresLinesHI,y
|
|
||||||
sta loopCopy1+2 ; LDA $HIlo,Y -- SMC -- +2 cycle
|
|
||||||
sta loopCopy2+5 ; STA $HIlo,Y -- SMC -- +5 cycles
|
|
||||||
lda _hiresLinesLO,y
|
|
||||||
adc hiresXZP ; X-Offset to Hires Byte
|
|
||||||
sta loopCopy1+1 ; LDA $hiLO,Y -- SMC -- +2 cycle
|
|
||||||
sta loopCopy2+8 ; STA $hiLO,Y -- SMC -- +5 cycles
|
|
||||||
|
|
||||||
; Copy bytes from SHR buffer to ouput
|
|
||||||
screen2output:
|
|
||||||
lda outputAddrZP+1
|
|
||||||
beq input2screen ; If high-byte is zero, then skip
|
|
||||||
ldy #0 ; Y loop: Copy xxx bytes per row
|
|
||||||
loopCopy1: ; Copy 1 byte
|
|
||||||
lda $2000,y ; SMC: -1 cycle /byteperrow / line
|
|
||||||
sta (outputAddrZP),y
|
|
||||||
iny
|
|
||||||
cpy bytesPerRowZP
|
|
||||||
bne loopCopy1 ; Iterate Y loop
|
|
||||||
|
|
||||||
; Copy bytes from input to SHR buffer
|
|
||||||
cpx inp2scrRowsZP ; Check number of input rows (for cropped sprites)
|
|
||||||
bcs incAddress1
|
|
||||||
input2screen:
|
|
||||||
clc
|
|
||||||
lda inputAddrZP+1
|
|
||||||
beq incAddress1 ; If high-byte is zero, then skip
|
|
||||||
ldy #0 ; Y loop: Copy xxx bytes per row
|
|
||||||
loopCopy2:
|
|
||||||
lda (inputAddrZP),y ; Copy 1 byte
|
|
||||||
sta $2000,y ; SMC: -1 cycle / byteperrow / line
|
|
||||||
iny
|
|
||||||
cpy bytesPerRowZP ; Iterate Y loop
|
|
||||||
bne loopCopy2
|
|
||||||
|
|
||||||
incAddress1:
|
|
||||||
clc ; Increment address of output block
|
|
||||||
lda outputAddrZP
|
|
||||||
adc bytesPerRowZP ; Move by xxx bytes
|
|
||||||
sta outputAddrZP
|
|
||||||
bcc nocarry1 ; Check if carry to high-byte
|
|
||||||
inc outputAddrZP+1
|
|
||||||
nocarry1:
|
|
||||||
|
|
||||||
incAddress2:
|
|
||||||
clc ; Increment address of input block
|
|
||||||
lda inputAddrZP
|
|
||||||
adc bytesPerRowZP ; Move by xxx bytes
|
|
||||||
sta inputAddrZP
|
|
||||||
bcc nocarry2 ; Check if carry to high byte
|
|
||||||
inc inputAddrZP+1
|
|
||||||
nocarry2:
|
|
||||||
|
|
||||||
nextRow:
|
jsr clear_hgr1
|
||||||
; Move to next row
|
|
||||||
inc hiresYZP ; Increment Hires Line offset
|
sta graphx
|
||||||
inx
|
sta text
|
||||||
cpx scr2outRowsZP
|
|
||||||
bcc loopRow ; Iterate X loop (rows)
|
|
||||||
|
Start jmp Start
|
||||||
rts
|
|
||||||
|
|
||||||
|
include "8bitunity-plot_scroll.asm"
|
||||||
|
include "hires.asm"
|
||||||
|
|
Binary file not shown.
107
hires.asm
Normal file
107
hires.asm
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
|
||||||
|
|
||||||
|
;draw_bmp subroutine
|
||||||
|
; ldy ypos
|
||||||
|
; lda height
|
||||||
|
; sta ycounter
|
||||||
|
;.nextline lda ytableh,y
|
||||||
|
; sta draw_bmp_eor+2
|
||||||
|
; sta .draw_sta+2
|
||||||
|
; lda ytablel,y
|
||||||
|
; sta draw_bmp_eor+1
|
||||||
|
; sta .draw_sta+1
|
||||||
|
; lda width
|
||||||
|
; sta xcounter
|
||||||
|
; ldx xpos
|
||||||
|
;draw_byteaddr lda $1000
|
||||||
|
; cpx #$28
|
||||||
|
; bcs .incxl
|
||||||
|
; cpy #$bf
|
||||||
|
; bcs .incxl
|
||||||
|
;draw_bmp_eor sta $2000,x
|
||||||
|
;.draw_sta sta $2000,x
|
||||||
|
;.incxl inc draw_byteaddr+1
|
||||||
|
; bne .cont
|
||||||
|
; inc draw_byteaddr+2
|
||||||
|
;.cont inx
|
||||||
|
; dec xcounter
|
||||||
|
; bne draw_byteaddr
|
||||||
|
; iny
|
||||||
|
; dec ycounter
|
||||||
|
; bne .nextline
|
||||||
|
; stx xpos
|
||||||
|
; rts
|
||||||
|
|
||||||
|
|
||||||
|
clear_hgr1 subroutine
|
||||||
|
|
||||||
|
lda #$20
|
||||||
|
sta .base_addr+2
|
||||||
|
ldy #$1F
|
||||||
|
lda #$00
|
||||||
|
sta .base_addr+1
|
||||||
|
.loop ldx #$00
|
||||||
|
.base_addr sta $2000,x
|
||||||
|
inx
|
||||||
|
bne .base_addr
|
||||||
|
inc .base_addr+2
|
||||||
|
dey
|
||||||
|
bpl .loop
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
hiresLinesHI
|
||||||
|
hex 2024282C3034383C
|
||||||
|
hex 2024282C3034383C
|
||||||
|
hex 2125292D3135393D
|
||||||
|
hex 2125292D3135393D
|
||||||
|
hex 22262A2E32363A3E
|
||||||
|
hex 22262A2E32363A3E
|
||||||
|
hex 23272B2F33373B3F
|
||||||
|
hex 23272B2F33373B3F
|
||||||
|
hex 2024282C3034383C
|
||||||
|
hex 2024282C3034383C
|
||||||
|
hex 2125292D3135393D
|
||||||
|
hex 2125292D3135393D
|
||||||
|
hex 22262A2E32363A3E
|
||||||
|
hex 22262A2E32363A3E
|
||||||
|
hex 23272B2F33373B3F
|
||||||
|
hex 23272B2F33373B3F
|
||||||
|
hex 2024282C3034383C
|
||||||
|
hex 2024282C3034383C
|
||||||
|
hex 2125292D3135393D
|
||||||
|
hex 2125292D3135393D
|
||||||
|
hex 22262A2E32363A3E
|
||||||
|
hex 22262A2E32363A3E
|
||||||
|
hex 23272B2F33373B3F
|
||||||
|
hex 23272B2F33373B3F
|
||||||
|
|
||||||
|
hiresLinesLO
|
||||||
|
hex 0000000000000000
|
||||||
|
hex 8080808080808080
|
||||||
|
hex 0000000000000000
|
||||||
|
hex 8080808080808080
|
||||||
|
hex 0000000000000000
|
||||||
|
hex 8080808080808080
|
||||||
|
hex 0000000000000000
|
||||||
|
hex 8080808080808080
|
||||||
|
hex 2828282828282828
|
||||||
|
hex A8A8A8A8A8A8A8A8
|
||||||
|
hex 2828282828282828
|
||||||
|
hex A8A8A8A8A8A8A8A8
|
||||||
|
hex 2828282828282828
|
||||||
|
hex A8A8A8A8A8A8A8A8
|
||||||
|
hex 2828282828282828
|
||||||
|
hex A8A8A8A8A8A8A8A8
|
||||||
|
hex 5050505050505050
|
||||||
|
hex D0D0D0D0D0D0D0D0
|
||||||
|
hex 5050505050505050
|
||||||
|
hex D0D0D0D0D0D0D0D0
|
||||||
|
hex 5050505050505050
|
||||||
|
hex D0D0D0D0D0D0D0D0
|
||||||
|
hex 5050505050505050
|
||||||
|
hex D0D0D0D0D0D0D0D0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user