I cannot wait to play his game.
looks really nice, and moving very smooth
small update today
had a very odd glitch in the bottom left corner that lagged the game thats now fixed.
added map loading from sd card, it worked first try which I’m amazed at
still need to work on a more proper map data structure to add additional data like doors and entity placement
since scrolling is really slow in this unbuffered high resolution mode, and the hardware scrolling is currently not implemented in the lib, the game is going to be single screen rooms (think original Zelda)
filetest.zip (33.9 KB)
keeping up with small updates, and also just a way for me to talk about the game development process in general
i know anyone reading this tread will be confused, dont worry you do not have to read this hole thing.
i like to talk a bit about my map process and what tools im using
to design the layouts im using tiled a very well known tile editor and im exporting the single layer levels as csv wich gives a clean list of numbers representing my tile indexes
i than add this just in an array inside a very small c program:
#include <stdio.h>
char mapdata[] = {
//map 0
0,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,
0,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,
0,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,1,2,9,9,9,5,
0,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,4,0,2,9,9,5,
0,0,6,6,6,6,6,6,6,6,6,6,2,9,9,9,9,9,9,9,9,9,9,4,3,9,9,5,
0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,2,9,9,9,9,9,9,9,9,9,5,
0,8,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,7,9,9,9,9,9,9,9,9,9,5,
7,9,9,9,4,8,8,0,0,0,0,0,0,0,0,0,0,7,9,9,9,9,9,9,9,9,9,5,
7,9,9,9,9,9,9,4,0,0,0,0,0,0,0,0,0,7,9,9,9,9,9,9,9,9,9,5,
7,9,9,9,9,9,9,9,5,0,0,0,0,0,0,0,0,0,6,6,6,2,9,9,9,9,9,5,
7,9,9,9,9,9,9,9,4,8,8,8,8,8,8,8,8,8,8,8,8,3,9,9,9,9,9,5,
7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9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9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,9,9,9,9,9,9,1,6,6,6,6,6,6,6,6,6,6,6,6,2,9,9,9,9,5,0,
7,9,9,9,9,9,9,9,4,8,8,8,8,8,8,8,8,8,8,8,8,3,9,9,9,9,5,0,
7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,1,2,9,9,9,9,1,2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,4,0,2,9,9,9,4,3,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,9,5,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,9,5,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,1,0,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,4,8,3,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,0,
7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,1,6,6,6,6,6,6,6,6,6,6,0,0,
0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
int main(int argc, char const *argv[])
{
FILE *myfile;
myfile = fopen("MYMAP.DAT","wb");
if (!myfile)
{
printf("something went wrong creating file\n");
return 1;
}
fwrite(mapdata, sizeof(char), sizeof(mapdata), myfile);
fclose(myfile);
printf("job done!\n");
return 0;
}
as you can see i basically hard code the data in this little program just for simplicity
(i compile and run this using: gcc main.c ; ./a.out
)
this will make a file called MYMAP.DAT, the file type has no real meaning apart from letting users know its data, i assume its the convention for the pokitto
on the pokitto side im using code that @wuuff made
heres the version im using specific to my map format of 22 by 28 tiles, im calling initMap
once in main.
#define MAP_SIZE 616
uint8_t mapdata[22][28];
void loadMap(uint8_t index){
fileSeekAbsolute(index*MAP_SIZE);
for(int Y =0; Y<22; Y++){
fileReadBytes(mapdata[Y],28);
}
}
void initMap(){
getFirstDirEntry();
uint32_t myFile = fileOpen("MYMAP.DAT", FILE_MODE_READONLY);
if( !myFile ){ //is file is open
loadMap(1);
}
}
i added doorways and crappy physics, tiles that don’t intersect with physics can be a different pallet (currently using 2 pallets)
pixelcroft_maptest.zip (34.7 KB)
found a way to scroll the screen in high-resolution mode. frame-rate is slower but there is no screen tearing
Cool! Are you using screen driver registers for scrolling?
actualy no, i looked at directbitmap and saw its implementation is very slow. so im trying to talk more directly to the screen and sending it the entire screen in one go so far it seems the screen has a preference to draw vertical scanlines so im trying fix the drawing
i actualy am trying out screen scrolling and it kinda works but im getting odd behavior where the second time round it jumps around and i have no idea why, i am modulating it to 219
i also see some sort of clearing of the buffer happening on 1/4th the screen so somewhere theres a clear screen happening in the code but not sure where
if you want to try it, heres basicly what i did
void Pokitto::lcdScroll(uint8_t offset){
write_command(0x21); //Vertical DRAM Address
write_data(offset); //set drawing offset
write_command(0x31); // Vertical scroll control
write_data(0x00DB); // scroll start
write_command(0x32); // Vertical scroll control
write_data(0x0000); // scroll end line 0
write_command(0x33); // Vertical scroll control
write_data(offset); // vertical scroll position
}
though all its good for right now i think is to shake the screen
testing out my new custom mode i think we are at number 15 so i guess thats what it going to be called
technical name would be something like “16 color high resolution 220x176 slow draw + large buffer in ram”
mode15test.bin (33.1 KB)
I will try that.
Seems good so far! Quite fast too.
can anyone do music for the pokitto?
i havent touched it at all and i have no music skill or feel
so anyone want to make a track for this game?
I decided to migrate the DMA discussion so it doesn’t clutter up the thread about your game if people want to continue discussing it.
If you want to advertise for a musician to join you,
we now have a category for that .
You might get more luck there.
idk what that link is suposed to do
Fixed it.
Not sure why it wasn’t working, using a #-link normally works.
It was supposed #join-a-team-help-wanted
I tried this and it works fine! I think you can remove setting DRAM address in the code. With your function it would be easy to make a tile scroller where you can scroll repeating tiles easily.
There still might be some flicker (?) if there are objects that do not scroll, and you have to remove and redraw them in DRAM each frame.