It is currently Sat Apr 29, 2017 12:36 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Sep 12, 2016 3:15 am 
Offline

Joined: Mon Mar 15, 2010 4:15 pm
Posts: 40
Hi guys,

iam starting to use the PVsneslib for my smart project and work with the most examples of this toolchain.

Until now, i know how it works and how i can create and use tiles, fonts and so on.

Now, i want to combine the Mode 1 function with the textfunction.

I want create a background and a text in the front, but in my current case, the emualtor shows either the background or the text.

Could you give me a hint?
Code:
#include <snes.h>

extern char snesfont;
extern char patterns, patterns_end;
extern char palette, palette_end;
extern char map, map_end;


//---------------------------------------------------------------------------------
int main(void) {
    // Initialize SNES
   consoleInit();
   consoleInitText(0, 1, &snesfont);   
   
   bgInitTileSet(0, &patterns, &palette, 0, (&patterns_end - &patterns), (&palette_end - &palette), BG_16COLORS, 0x4000);
   bgInitMapSet(0, &map, (&map_end - &map),SC_32x32, 0x0000);
   setMode(BG_MODE2,0);  bgSetDisable(1); bgSetDisable(2);
   
   consoleSetTextCol(RGB15(31,31,31),  RGB15(31,31,31));
   consoleDrawText(10,10,"Hello World !");
   
   // Wait for nothing :P
      
   while(1) {
      WaitForVBlank();
   }
   return 0;
}


My data.asm

Quote:
.include "hdr.asm"

.section ".rodata1" superfree

snesfont:
.incbin "pvsneslibfont.pic"

.ends

.section ".rodata2" superfree
patterns:
.incbin "Back.pic"
patterns_end:

map:
.incbin "Back.map"
map_end:

palette:
.incbin "Back.pal"
palette_end

.ends


With this code, the rom shows the background. No textmessages.

Thanks in advance

red


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: UnDisbeliever and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group