diff options
| author | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-09-27 22:27:17 +0200 |
|---|---|---|
| committer | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-09-27 22:27:17 +0200 |
| commit | 49ea4e7561980d79ec3bed869982852b45b597e8 (patch) | |
| tree | 187f00972a4280dd4ae01512714e6b35b21bec92 /examples | |
| parent | 0e3278a087daa25cba541d7c1dae19dfd4e2d422 (diff) | |
| download | psn00bsdk-49ea4e7561980d79ec3bed869982852b45b597e8.tar.gz | |
Updated changelog and files missing from last commit
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/demos/n00bdemo/data.h | 4 | ||||
| -rw-r--r-- | examples/demos/n00bdemo/data.s.template | 6 | ||||
| -rw-r--r-- | examples/demos/n00bdemo/main.c | 6 |
3 files changed, 10 insertions, 6 deletions
diff --git a/examples/demos/n00bdemo/data.h b/examples/demos/n00bdemo/data.h index 3be0e3d..9e64ea1 100644 --- a/examples/demos/n00bdemo/data.h +++ b/examples/demos/n00bdemo/data.h @@ -1,7 +1,9 @@ #ifndef _DATA_H #define _DATA_H -extern unsigned char lz_resources[]; +extern unsigned char _lz_resources[]; + +#define lz_resources ((const LZP_HEAD*) _lz_resources) /*extern unsigned char smd_mtekdisk[]; extern unsigned char smd_mtektext[]; diff --git a/examples/demos/n00bdemo/data.s.template b/examples/demos/n00bdemo/data.s.template index a7237cd..9fbef2e 100644 --- a/examples/demos/n00bdemo/data.s.template +++ b/examples/demos/n00bdemo/data.s.template @@ -1,8 +1,8 @@ .section .data -.global lz_resources -.type lz_resources, @object -lz_resources: +.global _lz_resources +.type _lz_resources, @object +_lz_resources: .incbin "${PROJECT_BINARY_DIR}/data.lzp" #.global smd_mtekdisk diff --git a/examples/demos/n00bdemo/main.c b/examples/demos/n00bdemo/main.c index fcd38b8..ba21d88 100644 --- a/examples/demos/n00bdemo/main.c +++ b/examples/demos/n00bdemo/main.c @@ -85,11 +85,12 @@ void loadTextures() { Unpack textures from an embedded LZP archive and upload them to VRAM. */ int i; - int *tex_buff,*ttim,j; + int *ttim,j; + QLP_HEAD *tex_buff; TIM_IMAGE tim; i = lzpSearchFile( "textures", lz_resources ); - tex_buff = (int*)malloc( lzpFileSize( lz_resources, i ) ); + tex_buff = (QLP_HEAD*)malloc( lzpFileSize( lz_resources, i ) ); lzpUnpackFile( tex_buff, lz_resources, i ); @@ -148,6 +149,7 @@ void loadTextures() { font_tpage = getTPage( 0, 1, tim.prect->x, tim.prect->y )|0x200; font_clut = getClut( tim.crect->x, tim.crect->y ); + free( tex_buff ); } void unpackModels() { |
