forked from ps2dev/ps2sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*Changed the initialization function to be more like the Sony sceGsResetGraph() to make initializing and resetting this library simpler. *Modified GsSetDefaultDisplayEnv() to function similarly to the Sony sceGsSetDefDispEnv(): NTSC, PAL and 480P will have the relevant values automatically filled in. DX and DY will be automatically adjusted, based on input from the EE kernel if supported. *Moved the PSM specification for the draw and display environments to the respective set functions of both environment. *FBW will be automatcally calculated within the respective set functions of both the draw and display environments. *The functions have been categorized to reduce the amount of bloat that simpler programs will end up having. *The uncached segment is now used instead of a call to SyncDCache(), since only a few bytes will be written as GS commands. *The samples have been updated to compile with the updated libgs. Also, the warnings in SBV have been silenced.
- Loading branch information
Showing
22 changed files
with
1,428 additions
and
1,183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# (c) 2009 Lion | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
# | ||
*/ | ||
|
||
#include <errno.h> | ||
#include <stdio.h> | ||
#include <kernel.h> | ||
#include <libgs.h> | ||
|
||
#include "internal.h" | ||
|
||
static short int gs_db_draw_buffer=0; | ||
|
||
int GsDbGetDrawBuffer(void) | ||
{ | ||
return gs_db_draw_buffer; | ||
} | ||
|
||
int GsDbGetDisplayBuffer(void) | ||
{ | ||
return(gs_db_draw_buffer? 0: 1); | ||
} | ||
|
||
void GsDbSwapBuffer(void) | ||
{ | ||
gs_db_draw_buffer = gs_db_draw_buffer? 0: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.global _GetGsDxDyOffset | ||
.ent _GetGsDxDyOffset | ||
_GetGsDxDyOffset: | ||
li $v1, 0x80 | ||
syscall | ||
jr $ra | ||
nop | ||
.end _GetGsDxDyOffset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.data | ||
|
||
init_vif_regs_12: .word 0x10000404, 0x20000000, 0x00000000, 0x50000000 | ||
.word 0x60000000, 0x30000000, 0x20000000, 0x40000000 | ||
|
||
.text | ||
|
||
.globl GsResetPath | ||
.ent GsResetPath | ||
GsResetPath: | ||
li $a3, 1 | ||
la $v0, 0x10003C10 | ||
sw $a3, ($v0) | ||
la $v1, 0x10003C20 | ||
li $v0, 2 | ||
move $a0, $zero | ||
sw $v0, 0($v1) | ||
sync | ||
cfc2 $a0, $28 | ||
ori $a0, 0x200 | ||
ctc2 $a0, $28 | ||
sync.p | ||
la $a1, init_vif_regs_12 | ||
la $a2, 0x10005000 | ||
lq $a0, ($a1) | ||
la $v1, 0x10003000 | ||
sq $a0, ($a2) | ||
lq $v0, 8($a1) | ||
sq $v0, ($a2) | ||
jr $ra | ||
sw $a3, 0($v1) | ||
.end GsResetPath |
Oops, something went wrong.