Search found 521 matches

by Movax12
Fri May 06, 2016 1:27 pm
Forum: NESdev
Topic: Greater than, less than
Replies: 21
Views: 4695

Re: Greater than, less than

I would possibly structure it like:

Code: Select all

lda value1
cmp value2
bcc lessThan
beq endif

  ; if value1 > value2  
  jmp endif ; (or use a branch if flag condition will be known)

lessThan:

  ; if value1 < value2 

endif:
by Movax12
Sat Feb 20, 2016 9:10 pm
Forum: NES Graphics
Topic: Is it possible to add new colors to the palette?
Replies: 24
Views: 12072

Re: Is it possible to add new colors to the palette?

You can only customize the palette if you change the PPU, or attach some extra hardware to it (e.g. NESRGB and Hi-Def NES ), which means the console has to be modified. It can't possibly be done from the cartridge side, because the cartridge is not at all involved with color generation, so there're...
by Movax12
Thu Feb 18, 2016 6:17 am
Forum: General Stuff
Topic: science fiction
Replies: 16
Views: 3668

Re: science fiction

Philip K. Dick has a ton of excellent short stories if you just want something quick and easy.
by Movax12
Mon Feb 01, 2016 7:28 am
Forum: General Stuff
Topic: Back to Windows 7 :(
Replies: 8
Views: 2995

Re: Back to Windows 7 :(

I just installed Windows 10 and found the install quick and easy and the OS itself to run beautifully. I installed some basic drivers (I think only nvidia video drivers actually) and my computer is running better than ever. There are many different configurations of hardware, so not sure why it does...
by Movax12
Fri Jan 08, 2016 7:00 am
Forum: Newbie Help Center
Topic: SBC help
Replies: 8
Views: 3570

Re: SBC help

To put it another way: BEFORE an addition with carry, you could think of carry as bit 8 from the previous addition, but it will now be added to bit 0 of the current addition. AFTER an addition with carry, carry holds bit 8, and will be cleared or set to reflect what bit 8 would be (If there was a bi...
by Movax12
Sun Dec 20, 2015 7:48 am
Forum: Newbie Help Center
Topic: comparing values in memory, which change very quickly
Replies: 7
Views: 3384

Re: comparing values in memory, which change very quickly

For myself, I just remember which is which by thinking "S is greater than C". CMP works just like the SBC instruction but without modifying the accumulator, so as you can see now, it also affects the carry flag in the same way. Unlike SBC, I'm pretty sure it doesn't use the carry flag as part of th...
by Movax12
Wed Dec 16, 2015 11:43 am
Forum: NESdev
Topic: 6502 ASM trick
Replies: 100
Views: 39492

Re: 6502 ASM trick

tepples wrote: To set a flag, beating the article by one byte but adding two cycles:

Code: Select all

sec
ror flag
As well as not modifying any registers! :D
by Movax12
Fri Dec 04, 2015 1:41 pm
Forum: NESdev
Topic: Naming libraries
Replies: 21
Views: 4905

Re: Naming libraries

It's trendy give things arbitrary names that have nothing to do with the thing. Examples: Chrome, Apache, or tangerine, a bank:
http://www.tangerine.ca
by Movax12
Sat Nov 28, 2015 9:08 am
Forum: NESdev
Topic: How do I do in CA65 things I do in ASM6?
Replies: 88
Views: 29274

Re: How do I do in CA65 things I do in ASM6?

I was using symbols to keep track of what macros were doing...it seems I can make the symbols global and access them with ::, but that definitely sounds like a bug to me. Not sure if this was mentioned exactly: You can create scopes that are for your macro and related macros, like: .scope mysuperma...
by Movax12
Fri Nov 13, 2015 5:13 am
Forum: NESdev
Topic: How do I do in CA65 things I do in ASM6?
Replies: 88
Views: 29274

Re: How do I do in CA65 things I do in ASM6?

tokumaru wrote:I see... so the scope is probably being opened and closed before the include itself is executed
I think this is basically what is happening.
by Movax12
Fri Nov 13, 2015 4:34 am
Forum: NESdev
Topic: How do I do in CA65 things I do in ASM6?
Replies: 88
Views: 29274

Re: How do I do in CA65 things I do in ASM6?

Hope that makes sense. Actually... I'm pretty confused! I couldn't find anything about resZP or resBSS, not in the documentation you liked to nor in the SMB High Level Disassembly files... What am I missing? These are separate macros just used as an example. They use .struct and track RAM usage. I ...
by Movax12
Wed Nov 11, 2015 3:02 pm
Forum: NESdev
Topic: How do I do in CA65 things I do in ASM6?
Replies: 88
Views: 29274

Re: How do I do in CA65 things I do in ASM6?

Some documentation for the "highlevel macros" https://www.assembla.com/spaces/ca65hl/wiki As far as reserving RAM, you can use .struct with macros to define your variables yourself, as constants at assemble time. This is not the intended use, but I do it. resZP baz .word ; or, multiple declarations ...
by Movax12
Mon Nov 09, 2015 11:05 am
Forum: NESdev
Topic: How do I do in CA65 things I do in ASM6?
Replies: 88
Views: 29274

Re: How do I do in CA65 things I do in ASM6?

Here's one option: .struct foo padding .res 10 ; or whatever other size bar .byte ; ... .endstruct Just to add, I'm pretty sure you can omit the name: .struct foo .res 10 ; or whatever other size, or expression you want here (if it is constant at assemble time) bar .byte ; ... .endstruct
by Movax12
Sat Nov 07, 2015 1:46 pm
Forum: NESdev
Topic: Optimizing important code parts
Replies: 16
Views: 6112

Re: Optimizing important code parts

Macros aren't library calls. Personally I don't like ADD and SUB macros because I don't want to get in the habit of using them and missing opportunities to optimize where the carry flag is already in the correct state. But macros can be super helpful.
by Movax12
Tue Oct 13, 2015 5:51 am
Forum: General Stuff
Topic: Good place to start learning C?
Replies: 24
Views: 4480

Re: Good place to start learning C?

Maybe just as important as learning the C language, one should adopt a style for how you space out source code and name variables, etc. Figure out what works for you and be consistent.
Search google: http://www.google.com/search?q=C+progra ... tyle+guide