aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2023-06-20 03:17:34 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2023-06-20 03:17:34 +0200
commiteaea5649a0803cc4bfeb6d21ee9f4098d4b493fc (patch)
tree786f6edfae0c6affe0d7c7b222cd12f52578ca01 /examples
parent7eed71a90bed67e4a987a9db55e15e9403523dca (diff)
downloadpsn00bsdk-eaea5649a0803cc4bfeb6d21ee9f4098d4b493fc.tar.gz
Fix IRQ bugs, PutDispEnv() PAL screen centering
Diffstat (limited to 'examples')
-rw-r--r--examples/demos/n00bdemo/disp.c28
-rw-r--r--examples/graphics/hdtv/main.c11
2 files changed, 19 insertions, 20 deletions
diff --git a/examples/demos/n00bdemo/disp.c b/examples/demos/n00bdemo/disp.c
index d8d2bbf..a43a1d6 100644
--- a/examples/demos/n00bdemo/disp.c
+++ b/examples/demos/n00bdemo/disp.c
@@ -18,9 +18,9 @@ MATRIX mtx;
void initDisplay() {
-
+
ResetGraph( 0 );
-
+
if( GetVideoMode() == MODE_NTSC ) {
SetDefDispEnv( &disp, 0, 0, 640, 480 );
SetDefDrawEnv( &draw, 0, 0, 640, 480 );
@@ -30,44 +30,44 @@ void initDisplay() {
SetDefDispEnv( &disp, 0, 0, 640, 512 );
SetDefDrawEnv( &draw, 0, 0, 640, 512 );
scSetClipRect( 0, 0, 640, 512 );
- disp.screen.y = 20;
- disp.screen.h = 256;
+ //disp.screen.y = 20;
+ //disp.screen.h = 256;
printf("PAL System.\n");
}
-
+
disp.isinter = 1;
draw.isbg = 1;
-
+
PutDispEnv( &disp );
PutDrawEnv( &draw );
-
+
ClearOTagR( ot[0], OT_LEN );
ClearOTagR( ot[1], OT_LEN );
nextpri = pribuff[0];
-
+
InitGeom();
gte_SetGeomScreen( 320 );
-
+
if( GetVideoMode() == MODE_NTSC ) {
gte_SetGeomOffset( 320, 240 );
} else {
gte_SetGeomOffset( 320, 256 );
}
-
+
}
void display() {
DrawSync(0);
VSync(0);
-
+
PutDrawEnv( &draw );
DrawOTag( ot[db]+OT_LEN-1 );
-
+
db ^= 1;
ClearOTagR( ot[db], OT_LEN );
nextpri = pribuff[db];
-
+
SetDispMask( 1 );
-
+
} \ No newline at end of file
diff --git a/examples/graphics/hdtv/main.c b/examples/graphics/hdtv/main.c
index 827b096..4d15742 100644
--- a/examples/graphics/hdtv/main.c
+++ b/examples/graphics/hdtv/main.c
@@ -651,13 +651,12 @@ void init() {
SetDefDispEnv( &db[0].disp, 0, 0, 640, SCREEN_YRES );
SetDefDrawEnv( &db[0].draw, 0, 0, SCREEN_XRES, SCREEN_YRES );
- db[0].disp.isinter = 1; // enable interlace, mandatory for hi-res modes
+ // Enable interlace (mandatory for hi-res modes)
+ db[0].disp.isinter = 1;
- db[0].disp.screen.x = -37; // shift left to center the widened picture
-
- db[0].disp.screen.w = 704; // increase the picture width to 704 pixels
- // (this does not strech the picture, it just
- // tells the GPU to output more pixels)
+ // Increase the picture width to 704 pixels
+ // (without stretching it, just tell the GPU to output more pixels)
+ db[0].disp.screen.w = (704 * 256) / 640;
// Enable draw area clear and dither processing
setRGB0( &db[0].draw, 63, 0, 127 );