mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-08-13 19:29:05 +00:00
mode7: some more demo work
This commit is contained in:
parent
f33c20fd8f
commit
0233210271
@ -6,7 +6,7 @@ SDL_LIBS= `sdl-config --libs`
|
|||||||
SDL_INCLUDE= `sdl-config --cflags`
|
SDL_INCLUDE= `sdl-config --cflags`
|
||||||
|
|
||||||
all: fade fixed_point rainbow sparkle starfield starfield_fixed kaleido \
|
all: fade fixed_point rainbow sparkle starfield starfield_fixed kaleido \
|
||||||
tfv mode7_demo text tfv_multiply
|
tfv mode7_demo text tfv_multiply rasterbars
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -150,6 +150,12 @@ kaleido.o: kaleido.c
|
|||||||
$(CC) $(CFLAGS) -c kaleido.c
|
$(CC) $(CFLAGS) -c kaleido.c
|
||||||
|
|
||||||
|
|
||||||
|
rasterbars: rasterbars.o gr-sim.o
|
||||||
|
$(CC) $(LFLAGS) $(SDL_LIBS) -o rasterbars rasterbars.o gr-sim.o
|
||||||
|
|
||||||
|
rasterbars.o: rasterbars.c
|
||||||
|
$(CC) $(CFLAGS) -c rasterbars.c
|
||||||
|
|
||||||
sparkle: sparkle.o gr-sim.o
|
sparkle: sparkle.o gr-sim.o
|
||||||
$(CC) $(LFLAGS) $(SDL_LIBS) -o sparkle sparkle.o gr-sim.o
|
$(CC) $(LFLAGS) $(SDL_LIBS) -o sparkle sparkle.o gr-sim.o
|
||||||
|
|
||||||
@ -175,6 +181,7 @@ gr-sim.o: gr-sim.c gr-sim.h apple2_font.h
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~ *.o gr-sim rainbow sparkle starfield starfield_fixed kaleido \
|
rm -f *~ *.o gr-sim rainbow sparkle starfield starfield_fixed kaleido \
|
||||||
tfv text mode7_demo fade fixed_point tfv_multiply
|
tfv text mode7_demo fade fixed_point tfv_multiply \
|
||||||
|
rasterbars
|
||||||
|
|
||||||
|
|
||||||
|
45
gr-sim/rasterbars.c
Normal file
45
gr-sim/rasterbars.c
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "gr-sim.h"
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
|
int ch,i=0;
|
||||||
|
|
||||||
|
int y=0;
|
||||||
|
|
||||||
|
grsim_init();
|
||||||
|
|
||||||
|
gr();
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
gr();
|
||||||
|
|
||||||
|
i++;
|
||||||
|
y=8.0*sin(i*2.0*3.14/16.0);
|
||||||
|
|
||||||
|
printf("%d %d\n",i,y);
|
||||||
|
|
||||||
|
color_equals(1); // red
|
||||||
|
hlin(0,0,40,y+18);
|
||||||
|
color_equals(11); // pink
|
||||||
|
hlin(0,0,40,6);
|
||||||
|
color_equals(9); // orange
|
||||||
|
hlin(0,0,40,7);
|
||||||
|
color_equals(13); // yellow
|
||||||
|
hlin(0,0,40,8);
|
||||||
|
|
||||||
|
|
||||||
|
grsim_update();
|
||||||
|
ch=grsim_input();
|
||||||
|
if (ch=='q') exit(0);
|
||||||
|
usleep(50000);
|
||||||
|
|
||||||
|
if (i>15) i=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -27,7 +27,7 @@ mode7_demo.o: mode7_demo.s mode7_demo_backgrounds.inc \
|
|||||||
../asm_routines/gr_fade.s \
|
../asm_routines/gr_fade.s \
|
||||||
../asm_routines/gr_copy.s \
|
../asm_routines/gr_copy.s \
|
||||||
../asm_routines/gr_scroll.s \
|
../asm_routines/gr_scroll.s \
|
||||||
mode7.s
|
mode7.s starfield_demo.s
|
||||||
ca65 -o mode7_demo.o mode7_demo.s -l mode7_demo.lst
|
ca65 -o mode7_demo.o mode7_demo.s -l mode7_demo.lst
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,6 +92,7 @@ island_demo:
|
|||||||
star_demo:
|
star_demo:
|
||||||
; initialize
|
; initialize
|
||||||
|
|
||||||
|
jsr starfield_demo
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -175,6 +176,7 @@ title_routine:
|
|||||||
.include "../asm_routines/gr_copy.s"
|
.include "../asm_routines/gr_copy.s"
|
||||||
.include "../asm_routines/gr_scroll.s"
|
.include "../asm_routines/gr_scroll.s"
|
||||||
.include "../asm_routines/gr_offsets.s"
|
.include "../asm_routines/gr_offsets.s"
|
||||||
|
.include "../asm_routines/gr_plot.s"
|
||||||
|
|
||||||
.include "mode7.s"
|
.include "mode7.s"
|
||||||
|
|
||||||
@ -182,10 +184,10 @@ title_routine:
|
|||||||
|
|
||||||
|
|
||||||
;===============================================
|
;===============================================
|
||||||
; Variables
|
; More routines
|
||||||
;===============================================
|
;===============================================
|
||||||
|
|
||||||
.include "deater.scrolltext"
|
.include "deater.scrolltext"
|
||||||
.include "a2.scrolltext"
|
.include "a2.scrolltext"
|
||||||
|
.include "starfield_demo.s"
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
.include "zp.inc"
|
|
||||||
|
|
||||||
;===========
|
;===========
|
||||||
; CONSTANTS
|
; CONSTANTS
|
||||||
;===========
|
;===========
|
||||||
@ -10,6 +8,7 @@ NUMSTARS EQU 16
|
|||||||
;=====================
|
;=====================
|
||||||
; Starfield
|
; Starfield
|
||||||
;=====================
|
;=====================
|
||||||
|
starfield_demo:
|
||||||
|
|
||||||
;================================
|
;================================
|
||||||
; Clear screen and setup graphics
|
; Clear screen and setup graphics
|
||||||
@ -18,10 +17,6 @@ NUMSTARS EQU 16
|
|||||||
jsr clear_screens ; clear top/bottom of page 0/1
|
jsr clear_screens ; clear top/bottom of page 0/1
|
||||||
jsr set_gr_page0
|
jsr set_gr_page0
|
||||||
|
|
||||||
; Initialize the 2kB of multiply lookup tables
|
|
||||||
jsr init_multiply_tables
|
|
||||||
|
|
||||||
|
|
||||||
;===============
|
;===============
|
||||||
; Init Variables
|
; Init Variables
|
||||||
;===============
|
;===============
|
||||||
@ -282,22 +277,6 @@ random_star:
|
|||||||
|
|
||||||
rts ; 6
|
rts ; 6
|
||||||
|
|
||||||
;===============================================
|
|
||||||
; External modules
|
|
||||||
;===============================================
|
|
||||||
|
|
||||||
.include "../asm_routines/pageflip.s"
|
|
||||||
.include "../asm_routines/gr_setpage.s"
|
|
||||||
.include "../asm_routines/keypress.s"
|
|
||||||
.include "../asm_routines/gr_putsprite.s"
|
|
||||||
.include "../asm_routines/gr_offsets.s"
|
|
||||||
.include "../asm_routines/gr_fast_clear.s"
|
|
||||||
.include "../asm_routines/gr_plot.s"
|
|
||||||
.include "../asm_routines/multiply_fast.s"
|
|
||||||
|
|
||||||
|
|
||||||
.include "sprites.inc"
|
|
||||||
|
|
||||||
;======================
|
;======================
|
||||||
; some "random" numbers
|
; some "random" numbers
|
||||||
;======================
|
;======================
|
||||||
|
@ -98,6 +98,7 @@ COLOR_MASK EQU $8B
|
|||||||
KEY_COUNT EQU $8C
|
KEY_COUNT EQU $8C
|
||||||
KEY_OFFSET EQU $8D
|
KEY_OFFSET EQU $8D
|
||||||
DRAW_BLUE_SKY EQU $8E
|
DRAW_BLUE_SKY EQU $8E
|
||||||
|
RANDOM_POINTER EQU $8F
|
||||||
|
|
||||||
SHIPY EQU $E4
|
SHIPY EQU $E4
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user