Search found 47 matches
- Tue Mar 02, 2021 12:12 pm
- Forum: Newbie Help Center
- Topic: How do ca65 structs/unions work?
- Replies: 11
- Views: 5852
Re: How do ca65 structs/unions work?
These three are doing exactly the same thing. They calculate offsets for labels like Circle or Circle2::Point. Nested structs or unions still just calculate offsets. Using .tag inside the .struct only used to calculate offset. .struct Circle .struct Point .word 2 .endstruct Radius .word .endstruct ....
- Tue Mar 02, 2021 9:00 am
- Forum: Newbie Help Center
- Topic: How do ca65 structs/unions work?
- Replies: 11
- Views: 5852
Re: How do ca65 structs/unions work?
Okay. Can I get automatic computation of struct offsets or union size without allocating the bytes for the "default instance" of the struct/union? Yes? Simply declaring struct or union does not reserve any memory in any segment. ; 0 bytes reserved .struct Circle .struct Point .word 2 ; Al...
- Mon Mar 01, 2021 2:53 pm
- Forum: Newbie Help Center
- Topic: ca65 .charmap range error
- Replies: 2
- Views: 5504
Re: ca65 .charmap range error
Which is weird, because error check to include 0 in ca65 was removed in 2005 according to blame. https://github.com/cc65/cc65/blob/3caceb8174110110ba5b0c4c45a885d8c1c5711b/src/ca65/pseudo.c#L625 But still exists in cc65 https://github.com/cc65/cc65/blob/2646c06f61b46ed142bbefc723acb8c2113a23f9/src/...
- Mon Mar 01, 2021 2:37 pm
- Forum: Newbie Help Center
- Topic: How do ca65 structs/unions work?
- Replies: 11
- Views: 5852
Re: How do ca65 structs/unions work?
These are not c/c++ structs. They do not store the data, they just calculate offsets, and essentially fancy labels. So Circle::Point equals 0 and Circle::Radius equals 4 (in bytes). And you use them appropriately, as offsets, e.g. lda variableAddress+Circle::Radius That's why the following code make...
- Sun Feb 28, 2021 11:09 pm
- Forum: 2020 NESdev Competition
- Topic: No Good Choice
- Replies: 9
- Views: 10358
Re: No Good Choice
Updated the first post with the entry.
- Sat Feb 27, 2021 6:46 pm
- Forum: 2020 NESdev Competition
- Topic: Altercation
- Replies: 2
- Views: 5199
Re: Altercation
That's a nice entry. I'll play later with my partner. I feel this game is better experienced with another human
- Sat Feb 27, 2021 4:14 pm
- Forum: 2020 NESdev Competition
- Topic: Arkade Rush
- Replies: 9
- Views: 6926
Re: Arkade Rush
Nice little game!
- Fri Feb 19, 2021 7:28 pm
- Forum: NESdev
- Topic: VBCC Optimizing C-compiler now supports NES
- Replies: 194
- Views: 127205
Re: VBCC Optimizing C-compiler now supports NES
I found either nasty bug or nasty C compliant behavior. signed char a[10]; int main() { for(unsigned char i = 0; i < 10; i++) { a[i] = 0xFF; } for(unsigned char i = 0; i < 10; i++) { if(a[i] == 0xFF) { // <<-- relevant line here break; } } for(;;); } Generated code loads a[i] and if it is positive (...
- Tue Feb 02, 2021 10:40 am
- Forum: Newbie Help Center
- Topic: Batman cart blinks
- Replies: 10
- Views: 6882
Re: Batman cart blinks
I know Muramasa sells some. But afaik pinout is different.
https://www.muramasaentertainment.com/product/avrcic/
- Thu Dec 31, 2020 3:55 pm
- Forum: NESdev
- Topic: VBCC Optimizing C-compiler now supports NES
- Replies: 194
- Views: 127205
Re: VBCC Optimizing C-compiler now supports NES
On a small example it does look like this. LDA #$20 TAX LDA #$00 LDY PpuStatus_2002 STX PpuAddr_2006 STA PpuAddr_2006 I also wrote bunch of code since then, so now I can't reproduce it. Not sure what exact combination of optimizations caused this. Is it deeply embedded in the compiler to load immedi...
- Tue Dec 29, 2020 7:40 pm
- Forum: NESdev
- Topic: VBCC Optimizing C-compiler now supports NES
- Replies: 194
- Views: 127205
Re: VBCC Optimizing C-compiler now supports NES
I think I found another bug. Function here void ppu_SetAddr(__reg("a/x")uint16 addr) = " ldy PPUSTATUS\n" " stx PPUADDR\n" " sta PPUADDR\n"; Then usage ppu_SetAddr(0x2000); Assembly. Looks like LDA #$20 is being optimized out. Also "LDA #$00 TAX" cou...
- Sun Dec 27, 2020 12:05 am
- Forum: 2020 NESdev Competition
- Topic: No Good Choice
- Replies: 9
- Views: 10358
Re: Untitled (yet) action adventure game
I do also like how the character stands out from the background. Are you going to highlight people/objects in this way or was it just a coincidence? That's a coincidence so far... We'll see. As of a project update. I finished compiler for a selected syntax of the Twine to author dialogs in the game...
- Mon Dec 21, 2020 10:31 am
- Forum: NESdev
- Topic: VBCC Optimizing C-compiler now supports NES
- Replies: 194
- Views: 127205
Re: VBCC Optimizing C-compiler now supports NES
Dr. Volker, is there any way to figure out what exactly vlink is complaining about with the following error? Error 35: rpg.nes (text+0x2891): Calculated value 0x300 doesn't fit into relocation type R_ABS (offset=0, size=8, mask=0xffffffffffffffff). edit: Ah, nevermind. I allocated the variable in bs...
- Mon Dec 07, 2020 11:31 am
- Forum: 2020 NESdev Competition
- Topic: The Epic Game of Impossibility
- Replies: 6
- Views: 7134
Re: The Epic Game of Impossibility
Wow, this game is hard. I could barely pass the first level. Nice job!
- Sun Dec 06, 2020 6:58 pm
- Forum: NESdev
- Topic: VBCC Optimizing C-compiler now supports NES
- Replies: 194
- Views: 127205
Re: VBCC Optimizing C-compiler now supports NES
or just write the function label in assembly: static void dummy() { __asm( " global ppu_SetAddr\n" "_ppu_SetAddr:\n" " lda PPUSTATUS\n" " lda r1\n" " sta PPUADDR\n" " lda r0\n" " sta PPUADDR\n" " rts"); } Of course you ...