Search found 7997 matches

by rainwarrior
Tue Mar 02, 2021 12:52 pm
Forum: Newbie Help Center
Topic: How do ca65 structs/unions work?
Replies: 7
Views: 151

Re: How do ca65 structs/unions work?

stan423321 wrote:
Mon Mar 01, 2021 2:24 pm
I understand that 6502 is not particularly happy to process arrays of structs...
It does relatively well with a struct of arrays, though, e.g.

Code: Select all

struct {
    char a[25];
    char b[25];
} soa;
by rainwarrior
Mon Mar 01, 2021 10:43 am
Forum: 2020 NESdev Competition
Topic: Spacegulls
Replies: 11
Views: 1135

Re: Spacegulls

Very nice! The first time I got to this room, one of the enemies and the key were missing: Spacegulls-1.0_001.png These did appear after I died and came back a second time. I've attached a Mesen video of this occurring (as well as a longer video of my whole playthrough). I think the only nit I'd wan...
by rainwarrior
Sun Feb 21, 2021 10:55 am
Forum: NESemdev
Topic: VRC7 discoveries
Replies: 13
Views: 1226

Re: VRC7 discoveries

The 4 extra cycles that were added to the application manual probably were added to be safe. I dunno if it's common to do this in applications of the YM2413, but at least on the Famicom the VRC7 runs on its own clock that's less precise (3 sig figs?) than the Famicom's clock. Even though it's nomin...
by rainwarrior
Sat Feb 20, 2021 4:54 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 190
Views: 87168

Re: VBCC Optimizing C-compiler now supports NES

To clarify: // 0xFF is being implicitly converted here, even though the stored result is identical. a[i] = 0xFF; // a[i] = -1 (signed char), not 0xFF a[i] = 255; // this has the same meaning // 0xFF is not a signed char // So it has to become a wider type (16-bit signed int) for comparison against t...
by rainwarrior
Thu Feb 18, 2021 11:05 am
Forum: Other Retro Dev
Topic: Video Game Consoles with games stored in single-sided cards
Replies: 16
Views: 2993

Re: Video Game Consoles with games stored in single-sided cards

Yeah, that would connect the two address busses directly to each other and they'd be in constant conflict. Aside from reading garbage from the ROM, I assume they'd start to overheat quickly.
by rainwarrior
Wed Feb 17, 2021 5:10 pm
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

Oh, I see. Since we can't really know how many bytes the interrupted instruction was, but we can know what the next opcode is, you're suggesting placing another marker byte after a BRK... That seems like a valid way to mark it, though it's starting to hurt BRK's main use of being compact. It's about...
by rainwarrior
Wed Feb 17, 2021 12:14 pm
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

Pardon the double post. I may have figured out a workaround in case B doesn't reliably work that only has the JSR cost if there's no post-BRK payload whatsoever, and otherwise can be reduced to a byte, five bits, or further. The trick is to put an otherwise unused opcode as the RTI target. KIL/HLT/...
by rainwarrior
Wed Feb 17, 2021 2:05 am
Forum: General Stuff
Topic: Why does Super Mario Bros. Have 256 worlds??? Does the lost levels have 256 worlds as well?????
Replies: 14
Views: 920

Re: Why does Super Mario Bros. Have 256 worlds??? Does the lost levels have 256 worlds as well?????

You can't restore them; they don't represent any kind of unused or incomplete content. They are just other bits of the game's code being incorrectly interpreted as level data. You could make a ROMhack that creates 256 new worlds if you wanted, but the content would be coming from you, not anything t...
by rainwarrior
Wed Feb 17, 2021 1:16 am
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

My idea was, look up the byte 2 before and see that it is 00. i.e check for a BRK XX XX command. Now that I'm more awake, there are some cases were you could end up with a 00 2 before that was not actually a BRK and thus this is not fool proof either. Ohhh, I understand now. Hmm, yeah I can't think...
by rainwarrior
Wed Feb 17, 2021 12:07 am
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

Well yes for detecting the "BRK has been aborted" 4015 is not useful. however it is useful for knowing that one has happened and you do probably need to handle it reasonably fast, i.e at least first to keep the DCPM pumping. Then after servicing the DCPM, check to see if B exists and deal with it a...
by rainwarrior
Tue Feb 16, 2021 2:12 pm
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

Look man, just use a bit / byte in memory and save yourself the headaches and the cycles. I think the goal with using BRK is usually to save space, not cycles? All else considered, it's a fantastically concise way to dispatch some kinds of things. The stack manipulation sounds fussy to work with bu...
by rainwarrior
Tue Feb 16, 2021 2:13 am
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

Yes, the last byte pushed to the stack (P) is $101, X. The second last (PCL) is $102, X, etc...
by rainwarrior
Mon Feb 15, 2021 10:55 pm
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

It's not just BRK its any interrupt. If an IRQ interrupts a NMI or an NMI interrupts an IRQ you will get lost interrupts. When an NMI takes over an IRQ, for most types of IRQ devices it's not going to be an issue because with no acknowledge the IRQ will still be asserting when the NMI handler does ...
by rainwarrior
Mon Feb 15, 2021 5:53 pm
Forum: NESemdev
Topic: VRC7 discoveries
Replies: 13
Views: 1226

Re: VRC7 discoveries

Page 4 of this one:
https://www.datasheetarchive.com/pdf/do ... 191&type=M
It states 12cy after address, 84cy after data.
by rainwarrior
Mon Feb 15, 2021 3:14 pm
Forum: Newbie Help Center
Topic: BRK masking bug and reliability of B pseudoflag
Replies: 35
Views: 2218

Re: BRK masking bug and reliability of B pseudoflag

Using it with DPCM could be problematic i suppose: If you enable the DPCM interrupt it could present challenges, and, i don't know if the internal sample fetching logic would cause this BRK skip situation? Above my paygrade. I think the DPCM fetches only interfere with external interface like $2007...