Search
lxdream.org :: lxdream/src/pvr2/pvr2.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/pvr2.c
changeset 23:1ec3acd0594d
prev19:9da7a8e38f9d
next27:1ef09a52cd1e
author nkeynes
date Fri Dec 23 11:44:55 2005 +0000 (16 years ago)
permissions -rw-r--r--
last change Start of "real" time slices, general structure in place now
file annotate diff log raw
1.1 --- a/src/pvr2/pvr2.c Thu Dec 22 07:38:12 2005 +0000
1.2 +++ b/src/pvr2/pvr2.c Fri Dec 23 11:44:55 2005 +0000
1.3 @@ -10,8 +10,11 @@
1.4 char *video_base;
1.5
1.6 void pvr2_init( void );
1.7 +void pvr2_run_slice( int );
1.8 +void pvr2_next_frame( void );
1.9
1.10 -struct dreamcast_module pvr2_module = { "PVR2", pvr2_init, NULL, NULL, NULL,
1.11 +struct dreamcast_module pvr2_module = { "PVR2", pvr2_init, NULL, NULL,
1.12 + pvr2_run_slice, NULL,
1.13 NULL, NULL };
1.14
1.15 void pvr2_init( void )
1.16 @@ -20,6 +23,18 @@
1.17 video_base = mem_get_region_by_name( MEM_REGION_VIDEO );
1.18 }
1.19
1.20 +uint32_t pvr2_time_counter = 0;
1.21 +uint32_t pvr2_time_per_frame = 20000;
1.22 +
1.23 +void pvr2_run_slice( int microsecs )
1.24 +{
1.25 + pvr2_time_counter += microsecs;
1.26 + if( pvr2_time_counter >= pvr2_time_per_frame ) {
1.27 + pvr2_next_frame();
1.28 + pvr2_time_counter -= pvr2_time_per_frame;
1.29 + }
1.30 +}
1.31 +
1.32 uint32_t vid_stride, vid_lpf, vid_ppl, vid_hres, vid_vres, vid_col;
1.33 int interlaced, bChanged = 1, bEnabled = 0, vid_size = 0;
1.34 char *frame_start; /* current video start address (in real memory) */
.