mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-24 12:29:29 +00:00
second: work on lens code
this is mostly just moving things around and trying not to break it
This commit is contained in:
parent
e37536bb2d
commit
4215f84611
|
@ -3,8 +3,9 @@ include ../../../../Makefile.inc
|
||||||
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
|
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
|
||||||
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
|
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
|
||||||
PNG2GR = ../../../../utils/gr-utils/png2gr
|
PNG2GR = ../../../../utils/gr-utils/png2gr
|
||||||
|
PNG2SPRITES = ../../../../utils/gr-utils/png2sprites
|
||||||
|
|
||||||
all: lenspic.gr.zx02
|
all: lenspic.gr.zx02 lens_sprites.inc
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
|
@ -14,6 +15,13 @@ lenspic.gr.zx02: lenspic.gr
|
||||||
lenspic.gr: lenspic.png
|
lenspic.gr: lenspic.png
|
||||||
$(PNG2GR) lenspic.png lenspic.gr
|
$(PNG2GR) lenspic.png lenspic.gr
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
lens_sprites.inc: lens_sprites.png
|
||||||
|
$(PNG2SPRITES) lens_sprites.png lens_sprite 0 0 11 24 > lens_sprites.inc
|
||||||
|
$(PNG2SPRITES) lens_sprites.png lens_mask 13 0 11 24 >> lens_sprites.inc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
####
|
####
|
||||||
|
|
||||||
|
|
BIN
demos/second/part10_lens_rotozoom/graphics/lens_sprites.png
Normal file
BIN
demos/second/part10_lens_rotozoom/graphics/lens_sprites.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
|
@ -19,27 +19,109 @@ lens_start:
|
||||||
sta current_pattern_smc+1
|
sta current_pattern_smc+1
|
||||||
jsr pt3_set_pattern
|
jsr pt3_set_pattern
|
||||||
|
|
||||||
|
;================================
|
||||||
|
; Clear screen and setup graphics
|
||||||
|
;================================
|
||||||
|
|
||||||
bit SET_GR
|
bit SET_GR
|
||||||
bit HIRES
|
|
||||||
bit FULLGR
|
bit FULLGR
|
||||||
bit PAGE1
|
bit PAGE1 ; set page 1
|
||||||
|
bit LORES ; Lo-res graphics
|
||||||
|
|
||||||
;================================
|
lda #0
|
||||||
; ROTO
|
sta DISP_PAGE
|
||||||
;================================
|
lda #4
|
||||||
|
sta DRAW_PAGE
|
||||||
|
|
||||||
|
;===================================
|
||||||
|
; Clear top/bottom of page 0 and 1
|
||||||
|
;===================================
|
||||||
|
|
||||||
|
jsr clear_screens
|
||||||
|
|
||||||
|
;===================================
|
||||||
|
; init the multiply tables
|
||||||
|
;===================================
|
||||||
|
|
||||||
|
jsr init_multiply_tables
|
||||||
|
|
||||||
|
;======================
|
||||||
|
; show the title screen
|
||||||
|
;======================
|
||||||
|
|
||||||
|
; Title Screen
|
||||||
|
|
||||||
|
title_screen:
|
||||||
|
|
||||||
|
load_background:
|
||||||
|
|
||||||
|
;===========================
|
||||||
|
; Clear both bottoms
|
||||||
|
|
||||||
|
; jsr clear_bottoms
|
||||||
|
|
||||||
|
;=============================
|
||||||
|
; Load title
|
||||||
|
|
||||||
|
lda #<lens_zx02
|
||||||
|
sta zx_src_l+1
|
||||||
|
lda #>lens_zx02
|
||||||
|
sta zx_src_h+1
|
||||||
|
|
||||||
|
lda #$40
|
||||||
|
|
||||||
|
jsr zx02_full_decomp
|
||||||
|
|
||||||
|
;=================================
|
||||||
|
; copy to both pages
|
||||||
|
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
jsr page_flip
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
; wait
|
||||||
|
; TODO: draw lens
|
||||||
|
|
||||||
|
lda #15
|
||||||
|
jsr wait_seconds
|
||||||
|
|
||||||
|
|
||||||
|
;=================================
|
||||||
|
;=================================
|
||||||
|
; do rotozoom
|
||||||
|
;=================================
|
||||||
|
;=================================
|
||||||
|
|
||||||
jsr do_rotozoom
|
jsr do_rotozoom
|
||||||
|
|
||||||
|
|
||||||
lens_end:
|
lens_end:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;===============================================
|
||||||
|
; External modules
|
||||||
|
;===============================================
|
||||||
|
|
||||||
|
.include "roto.s"
|
||||||
|
.include "rotozoom.s"
|
||||||
|
|
||||||
|
.include "../gr_pageflip.s"
|
||||||
|
;.include "../gr_fast_clear.s"
|
||||||
|
.include "../gr_copy.s"
|
||||||
|
|
||||||
|
.include "../gr_offsets.s"
|
||||||
|
.include "../c00_scrn_offsets.s"
|
||||||
|
|
||||||
|
.include "../multiply_fast.s"
|
||||||
|
|
||||||
.include "../wait_keypress.s"
|
.include "../wait_keypress.s"
|
||||||
.include "../zx02_optim.s"
|
.include "../zx02_optim.s"
|
||||||
.include "../irq_wait.s"
|
.include "../irq_wait.s"
|
||||||
|
|
||||||
.include "roto.s"
|
;===============================================
|
||||||
|
; Data
|
||||||
|
;===============================================
|
||||||
|
|
||||||
|
lens_zx02:
|
||||||
|
.incbin "graphics/lenspic.gr.zx02"
|
||||||
|
|
||||||
|
|
|
@ -1,76 +1,6 @@
|
||||||
|
|
||||||
; do a (hopefully fast) roto-zoom
|
|
||||||
|
|
||||||
do_rotozoom:
|
do_rotozoom:
|
||||||
|
|
||||||
;================================
|
|
||||||
; Clear screen and setup graphics
|
|
||||||
;================================
|
|
||||||
|
|
||||||
bit PAGE1 ; set page 1
|
|
||||||
bit LORES ; Lo-res graphics
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta DISP_PAGE
|
|
||||||
lda #4
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
;===================================
|
|
||||||
; Clear top/bottom of page 0 and 1
|
|
||||||
;===================================
|
|
||||||
|
|
||||||
jsr clear_screens
|
|
||||||
|
|
||||||
;===================================
|
|
||||||
; init the multiply tables
|
|
||||||
;===================================
|
|
||||||
|
|
||||||
jsr init_multiply_tables
|
|
||||||
|
|
||||||
;======================
|
|
||||||
; show the title screen
|
|
||||||
;======================
|
|
||||||
|
|
||||||
; Title Screen
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
title_screen:
|
|
||||||
|
|
||||||
load_background:
|
|
||||||
|
|
||||||
;===========================
|
|
||||||
; Clear both bottoms
|
|
||||||
|
|
||||||
; jsr clear_bottoms
|
|
||||||
|
|
||||||
;=============================
|
|
||||||
; Load title
|
|
||||||
|
|
||||||
lda #<lens_zx02
|
|
||||||
sta zx_src_l+1
|
|
||||||
lda #>lens_zx02
|
|
||||||
sta zx_src_h+1
|
|
||||||
|
|
||||||
lda #$40
|
|
||||||
|
|
||||||
jsr zx02_full_decomp
|
|
||||||
|
|
||||||
;=================================
|
|
||||||
; copy to both pages
|
|
||||||
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
jsr page_flip
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
; wait
|
|
||||||
; TODO: draw lens
|
|
||||||
|
|
||||||
lda #15
|
|
||||||
jsr wait_seconds
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=================================
|
;=================================
|
||||||
; main loop
|
; main loop
|
||||||
|
|
||||||
|
@ -88,7 +18,9 @@ main_loop:
|
||||||
|
|
||||||
jsr page_flip
|
jsr page_flip
|
||||||
|
|
||||||
|
;============================
|
||||||
; wait for end
|
; wait for end
|
||||||
|
;============================
|
||||||
|
|
||||||
lda #47
|
lda #47
|
||||||
jsr wait_for_pattern
|
jsr wait_for_pattern
|
||||||
|
@ -97,6 +29,10 @@ main_loop:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
no_keypress:
|
no_keypress:
|
||||||
|
|
||||||
clc
|
clc
|
||||||
|
@ -170,29 +106,3 @@ scaleaddl: .byte $10
|
||||||
scaleaddh: .byte $00
|
scaleaddh: .byte $00
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;===============================================
|
|
||||||
; External modules
|
|
||||||
;===============================================
|
|
||||||
|
|
||||||
.include "rotozoom.s"
|
|
||||||
|
|
||||||
.include "../gr_pageflip.s"
|
|
||||||
;.include "../gr_fast_clear.s"
|
|
||||||
.include "../gr_copy.s"
|
|
||||||
|
|
||||||
.include "../gr_offsets.s"
|
|
||||||
.include "../c00_scrn_offsets.s"
|
|
||||||
|
|
||||||
|
|
||||||
.include "../multiply_fast.s"
|
|
||||||
|
|
||||||
;===============================================
|
|
||||||
; Data
|
|
||||||
;===============================================
|
|
||||||
|
|
||||||
lens_zx02:
|
|
||||||
.incbin "graphics/lenspic.gr.zx02"
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user