Search found 27 matches

by Jsolo
Fri Jan 04, 2013 10:44 am
Forum: NESemdev
Topic: C++ WTF
Replies: 31
Views: 6689

Re: C++ WTF

I was under the impression that the use of global and static variables was "considered harmful" nowadays. Global variables have their place, as do macros and all other language features. There are situations where using global variables is perfectly fine. Global variables also interfere with multit...
by Jsolo
Wed Jan 02, 2013 11:15 am
Forum: NESemdev
Topic: C++ WTF
Replies: 31
Views: 6689

Re: C++ WTF

Code does not modify itself unless explicitly told to. You are probably a victim of the common buffer overflow (bufferus overflowis).
C++ provides many abstractions to prevent buffer overflows, for instance std::vector<> or std::array<>. :)
by Jsolo
Sun Dec 09, 2012 6:06 am
Forum: Homebrew Projects
Topic: Life Bar made of sprites demo
Replies: 41
Views: 10352

Re: Life Bar made of sprites demo

The part you quoted doesn't actually talk about signedness, or integer promotion, it talks about the type of the operand of the ~ operator, which has to be an integer. You're right, I should have quoted the other part I referred to, the usual arithmetic conversions (and integer promotion rules, too...
by Jsolo
Sat Dec 08, 2012 12:17 pm
Forum: Homebrew Projects
Topic: Life Bar made of sprites demo
Replies: 41
Views: 10352

Re: Life Bar made of sprites demo

Gets even worse: uint8_t blah = 0x50; uint8_t result = ~blah >> 4; You'd think it'd store 0x0A? Except it stores 0xFA. Why? Because the ~ operator causes blah to be promoted to int =/ This is confomant behavior. See 6.3.1.8 and 6.5.3.3 of ISO/IEC 9899:2011, "The operand of the unary + or - operator...
by Jsolo
Fri Dec 07, 2012 4:48 am
Forum: Homebrew Projects
Topic: Life Bar made of sprites demo
Replies: 41
Views: 10352

Re: Life Bar made of sprites demo

I tried the U method tepples mentioned, unfortunately this still does not fix the bug. Casting to long seems to be the only method that works, and I'm pretty sure CC65 is to blame for this. After all this bug does not occur when life is greater than 512 (which would cause an overflow of signed int,...
by Jsolo
Sat Dec 01, 2012 5:05 am
Forum: NESdev
Topic: Memory segments in ca65
Replies: 3
Views: 1712

Re: Memory segments in ca65

Hi :) You're confusing OAM data (e.g. sprite position) with the actual pattern data (the 8x8 graphics you see on screen). Each sprite on screen is composed out of 8x8 so called "tiles". The OAM data only defines which tile a sprite uses, not how the tile looks. The graphics data for the tiles (also ...
by Jsolo
Wed Nov 28, 2012 1:38 pm
Forum: NESemdev
Topic: NESICIDE
Replies: 128
Views: 67828

Re: NESICIDE

cpow wrote: That's really strange...what do you have set for End-of-Line style in Environment Settings->Code Editor->Whitespace. Do you have "Force consistent" set?
Yep, it is set. I never changed a thing in that menu.
by Jsolo
Wed Nov 28, 2012 1:37 pm
Forum: SNESdev
Topic: I think I found a good scanlines/dma compromise
Replies: 19
Views: 3980

Re: I think I found a good scanlines/dma compromise

Well, to me it sounded like he wanted to update half of the sprites every other frame. I might have misunderstood his original requirements though. I interpreted it as the following: - I have a 16x16 area in sprite VRAM for each object on screen - I want to animate each sprite at a rate of 30Hz - Du...
by Jsolo
Wed Nov 28, 2012 11:00 am
Forum: SNESdev
Topic: I think I found a good scanlines/dma compromise
Replies: 19
Views: 3980

Re: I think I found a good scanlines/dma compromise

tepples wrote:Unless you copy eight 16x16 cells in one block, you have to copy the top and bottom halves separately.
This is what I was referring to. He talks about uploading 8KB of sprite patterns at once. Shouldn't you organize your data in such a way that a block copy can be performed?
by Jsolo
Wed Nov 28, 2012 1:13 am
Forum: SNESdev
Topic: I think I found a good scanlines/dma compromise
Replies: 19
Views: 3980

Re: I think I found a good scanlines/dma compromise

If you're using a buffer anyway, why not lay out your sprite data in such a way that a block copy is possible?
by Jsolo
Wed Nov 28, 2012 1:08 am
Forum: NESemdev
Topic: NESICIDE
Replies: 128
Views: 67828

Re: NESICIDE

Here's another thing I've noted. The editor's line endings are inconsistent. Every time I open a file in Notepad++, for example, it places an empty line between consecutive lines of text. After inspecting it with "Show line endings" it is revealed that line endings actually are CR CR LF, which is in...
by Jsolo
Mon Nov 26, 2012 4:01 am
Forum: NESemdev
Topic: NESICIDE
Replies: 128
Views: 67828

Re: NESICIDE

It's working again, thanks a lot :)
by Jsolo
Sat Nov 24, 2012 8:32 am
Forum: NESemdev
Topic: NESICIDE
Replies: 128
Views: 67828

Re: NESICIDE

After some digging I believe it is related to one's mapper choice. I converted the NROM example to UNROM like my project is. I also deleted all the graphics and nearly all code. I then marked the code lda #0 sta $00 with the right click options "Set Visualization START/END Marker here" and compiled/...
by Jsolo
Sat Nov 24, 2012 7:39 am
Forum: NESemdev
Topic: NESICIDE
Replies: 128
Views: 67828

Re: NESICIDE

Well, I just created a new NROM asm template and...it works as expected. It doesn't work for my project created with an older version, though. I tried recreating the project just now, but to no avail. I'm trying to whip up a smaller example and report back. Edit: On an unrelated note, the NROM templ...
by Jsolo
Sat Nov 24, 2012 3:46 am
Forum: NESemdev
Topic: NESICIDE
Replies: 128
Views: 67828

Re: NESICIDE

Did you break the Execution Visualizer some updates ago? It always shows "IN PROGRESS" regardless of being in a loop or not.