Is this correct? I added an extra 2x2 char to the example. Circled in green. Changed the other highlighted areas reflect that. I'm not 100% sure what you are asking.... Are you asking if your dma calls are right if you added one 2x2? If so, yes. If not, idfk :) I would use my gfx editor to find an ...
Is this correct? I added an extra 2x2 char to the example. Circled in green. Changed the other highlighted areas reflect that. D4Yp3Nx.png SU5dkHW.png When all 4 of a 2x2 are placed logically together, the SNES can easily display them. Can you elaborate? by 4 do you mean the 4 individual cells that ...
Not your fault. That was a detail I missed. When a row has no garbage, you carry on counting with the next row. In my example, the first DMA call encounters a garbage cell after 0xf chars. I like that. That is a better way to explain things. A DMA group counts chars left to right until you run into...
Since you don't want the bottom half of the 9th 2x2 char to be loaded next to the last 1x1 char (if you did, the bottom half would be garbage), you need a second DMA group to place these last two chars on the fourth row, where the belongs (chars 0x30-0x31). Hence, the last two header values of 0x30...
How come offset group 1 is 22? Shouldn't it be 18? Also how come there isn't a group 2? I'm just trying to understand when a sprite uses just one group or when it needs to use two groups.
Ok. Let's talk about this image. https://i.imgur.com/roFYAy1.png Here is what VRAM looks like in game. https://i.imgur.com/BLJEH2v.png These are my markups following the same formatting as before. https://i.imgur.com/v5BrMyn.png We have 2 dma groups. Why? Well, look at the first row. Even though it...
I thought each sprite was made up of individual 8x8 tiles no matter the size of the entire sprite? I attached a screen of rainbowsprinkelz's editor. Could you briefly explain each of the values? I think I understand what a 2x2 char and a 1x1 char is but i need clarification on what it is. Also i'm n...
Sorry if you misunderstood, or if I misunderstood but that function you wrote just gets the size of the header? I thought it would have something to do with the x/y coordinates of each tile in a sprite. I was just thinking how to program a function that finds those coordinates and combines those til...
I attached my code of what I have working so far. just 16x16 sprites. Keep in mind. I know my code is horrible... many things wrong with it but it works.
I also notice there is some clipping of the DK Map sprite in rainbowsprinkelz's editor and in my extractor. Like rainbowsprinklez, I don't see the clipping. The different background colors can play tricks on how you perceive things. The anti-aliasing on those scaled-up screenshots could be a factor...
Thanks Mattrizzle. To the point as always! It turns out the Palette I used for the DK Map sprites was wrong. I was using rainbowsprinkelz editor. But the palette in your screenshots seems correct. I also notice there is some clipping of the DK Map sprite in rainbowsprinkelz's editor and in my extrac...
The heart in the ingame screenshot appears to be mirrored horizontally? Why is this? Going left typically flips the sprite. Do you notice how pretty much all the sprites face right? The game programmatically flips these thereby not needing x flips of any sprites explicitly defined. ahh that makes p...
Also, I was thinking that Cyclone and Rainbow Sprinkles like DKC1 the best. :parry: Don't assume, because you make an ASS out of U and ME :D Try again. Also, DKC isn't even my favorite video game :huh: Also also, you misspelled my name :P (the z is important) I agree. And Donkey Kong Country 2 is m...
Problem Solved! I'm surprised no one thought about it earlier... Here is the working code. All it does is extracts the letter A to a png file. #include "C:\Users\Chris\source\repos\PNG\lodepng.h" #include "C:\Users\Chris\source\repos\PNG\lodepng.cpp" #include <fstream> #include <...
This is as close as I got so far. It kinda works but its rotated and mirrored and is missing the last row of pixels.. Not sure why. test.png /* LodePNG Examples Copyright (c) 2005-2012 Lode Vandevenne This software is provided 'as-is', without any express or implied warranty. In no e...
OK. SO I gave up on writing to the bmp format... I am now trying to get the same code working with a png. I am having difficulties in getting it to work. I went back a version and I know there's lots of errors in the code but I understood it better.
Thanks for looking at my code. Did you get it to work without the pixel error? Again this happens with other sprites as well. I mean when there is a HEX value of 1a in the tile row code. When this happens it messes up the tiles after it too. To prevent it messing up other tiles I have to change the ...
So I almost got it working perfectly but there is one error in it. Whenever it encounters a value of 0x1A in the tile code it does not write the bitmap perfectly. Any Ideas? Thanks. The below code will extract the kong letters int main() { CString File_Path; char sztmp[1024]; cin.clear(); cout << &q...
Here is the code I have so far. How do I use all the thousands of colours the SNES can display? Do I use an array, create the different colours at run time? I'm not sure. int main() { // Link sprite. int Bitplane0_ROW[] = { 0b01100110 , 0b11111111, 0b01011010, 0b01111110, 0b00000000, 0b10000001, 0b1...
In the second version we have a struct containing a red, a green and a blue component. After that we define an array containing four groups of colours. That code block can be scrolled, there is an example of how to access and assign them. The idea behind using tables is that you don't need to check...
I figured out what I'm doing wrong. I just don't know how to access the separate values in the Struct that's why. Edit . I am getting a strange glitch in my code. I have unsigned char red[] = { 255, 53, 59, 154, 0, 255 }; unsigned char green[] = { 255, 189, 85, 194, 255, 0}; unsigned char blue[] = {...
As for the index values, you currently have four tables each containing three values. That's one table for each colour containing an R, G and B value. A more typical way would be to have three tables containing the R, the G and the B values. So that would be three tables containing four values. The...
A 4-bit version is a very similar process. To construct the 4-bit index value you'd need to extract the four different bits and shift them into place as necessary. There isn't really anything new to cover at this stage, so maybe just try and think over how your 2-bit version works at each point and...
You did manage it with shifts which is one of the ways to do it. The other way would have been something like this: b = (!!(Bitplane0_ROW[p] & (1 << N)) << 1) | !!(Bitplane1_ROW[p] & (1 << N)); This way uses logical NOT twice. That has the effect of forcing the extracted set bits to 1 so yo...
EDIT Is this even close? b = (Bitplane0_ROW[p] << 1) | (Bitplane1_ROW[p] << 0); Yes, that's exactly what we want. The only issue is that shifting left by zero won't do anything, so you can safely remove that shift. That didn't work when I tried that. however this worked, I was able to get the index...
This works int bit1 = 1; int bit2 = 1; int combined = bit1 | (bit2 << 1); std::cout << combined << "\n"; // prints 3 but... how do I combine these two → ((Bitplane0_ROW[p] & (1 << N)) && (Bitplane1_ROW[p] & (1 << N)) == 0)
I came across this link. https://stackoverflow.com/questions/33128934/combining-three-bits-to-get-a-single-integer-value with this example. #include <stdio.h> #include <stdlib.h> int main(void){ int LeastSignificantBit=1; int MiddleBit=0; int MostSignificantBit=1; int Number=0; Number=(MostSignifica...
Got some better code now. thanks for the tips. You seem to have an extra if hiding in there! :bashmaster: This version is a tiny bit farther from what we want compared to the previous version though. You know that (Bitplane0_ROW[p] & (1 << N)) and (Bitplane0_ROW[p] & (1 << N)) get us the tw...
You didn’t paste the entire doc. Also I’m not sure what you changed I was looking for suggestions such as wording and if it’s easy to understand etc or if I am missing any thing
Got some better code now. thanks for the tips. 2Bpp int main() { int Bitplane0_ROW[] = { 0b01100110 , 0b11111111, 0b01011010, 0b01111110, 0b00000000, 0b10000001, 0b11111111, 0b01111110 }; // Array to to store numbers Last Row is first. int Bitplane1_ROW[] = { 0b01111110, 0b11111111, 0b11111111, 0b11...
Quick programming question. How do you check if a bit not set? I'm sure its something obvious. sorry. This checks if a bit is set → if (Bitplane0_ROW[p] & (1 << N)){ // do something.} but i'm not sure how to check is a bit not set like this → if (! Bitplane0_ROW[p] & (1 << N)){// do somethin...