install xquartz; brew install wine Mac direct install: use .pkg from https://dl.winehq.org/wine-builds/macosx/download.html Linux: use your distribution’s package manager
https://github.com/cc65/cc65 ➤ Mac Homebrew: brew install cc65 ➤ Mac direct install: git clone https://github.com/cc65/cc65.git; cd cc65 make export prefix=/usr/local; sudo make install ➤ Linux: use your distribution’s package manager, or: git clone https://github.com/cc65/cc65.git; cd cc65 make; sudo make avail
buy it. No matter how great the games, if mothers thought they were too expensive the machine would never take off. -Osamu Katayama, “Japanese Business into the 21st Century”
And with accumulator ➤ ASL Arithmetic Shift Left ➤ BCC Branch on Carry Clear ➤ BCS Branch on Carry Set ➤ BEQ Branch on result Equals zero ➤ BIT Bit Test ➤ BMI Branch on result Minus ➤ BNE Branch on result Not Equal zero ➤ BPL Branch on result Plus ➤ BRK Break ➤ BVC Branch on Overflow Clear ➤ BVS Branch on Overflow Set ➤ CLC Clear Carry flag ➤ CLD Clear Decimal flag ➤ CLI Clear Interrupt disable flag ➤ CLV Clear Overflow flag ➤ CMP Compare with accumulator ➤ CPX Compare with X register ➤ CPY Compare with Y register ➤ DEC Decrement memory ➤ DEX Decrement X register ➤ DEY Decrement Y register ➤ EOR Exclusive Or with accumulator ➤ INC Increment memory ➤ INX Increment X register ➤ INY Increment Y register ➤ JMP Jump to new location ➤ JSR Jump and Save Return address ➤ LDA Load Accumulator with value ➤ LDX Load X register with value ➤ LDY Load Y register with value ➤ LSR Logical Shift Right ➤ NOP No Operation ➤ ORA "OR" with Accumulator ➤ PHA Push Accumulator to stack ➤ PHP Push Processor status to stack ➤ PLA Pull Accumulator from stack ➤ PLP Pull Processor status from stack ➤ ROL Rotate bits Left ➤ RTI Return from Interrupt ➤ RTS Return from Subroutine ➤ SBC Subtract with Carry borrowing ➤ SEC Set Carry flag ➤ SED Set Decimal mode ➤ SEI Set Interrupt disable flag ➤ STA Store Accumulator in memory ➤ STX Store X register in memory ➤ STY Store Y register in memory ➤ TAX Transfer Accumulator to X register ➤ TAY Transfer Accumulator to Y register ➤ TSX Transfer Stack pointer to X register ➤ TXA Transfer X register to Accumulator ➤ TXS Transfer X register to Stack pointer ➤ TYA Transfer Y register to Accumulator
cause a carry?) Zero flag (was last result zero?) Interrupt flag (ignore for now) Decimal flag (NES does not support) Sign overflow flag (Negative number < -128) Negative flag (did last result have “1” in bit 7?)
.byte %00000001 .byte %00000000 .byte $00 .byte $00 iNES was an early NES emulator developed by Marat Fayzullin. Its most lasting contribution to the NES scene was its popularization of the iNES ROM file format and mapper numbering system. http://wiki.nesdev.com/w/index.php/INES
X register to zero set_up_sprites: LDA sprites,x ; load next byte STA $0200,x ; copy to $0200 + x INX CPX #$10 ; have we copied 16 values? BNE set_up_sprites ; if no, repeat
from RODATA ➤ Store our metatile’s location info in zeropage RAM ➤ Write a subroutine to draw the metatile based on that data ➤ Write a subroutine to update (move) the metatile ➤ Call both subroutines in the NMI handler
draw SOMETHING first, STA OAMADDR ; in case we run out LDA #$02 ; of vblank time, STA OAMDMA ; then update positions JSR update_sprite_position JSR draw_sprite RTI .endproc
sprite_y at beginning of .proc main Sprite direction: set sprite_h / sprite_v at beginning of .proc main Sprite speed: change amount added / subtracted in .proc update_sprite_position
to “latch” the buttons (stop listening for new input) ➤ Make eight reads to an MMIO address, one for each button - bit zero will be “1” for pressed, “0” for not-pressed
the paddle / subroutine to draw it ➤ Add a subroutine to read the controller ➤ Add a subroutine to update the paddle’s position based on controller read ➤ Add a subroutine to handle ball/paddle collisions
from PPUSTATUS to reset latch ➤Write high byte of nametable address to PPUADDR ➤Write low byte of nametable address to PPUADDR ➤Write data, one byte at a time, to PPUDATA
get current PPUCTRL CMP #%10010000 ; compare to table $2000 BEQ first_nametable LDA #%10010000 ; $2400 now, so write STA scroll_table ; $2000 table to PPUCTRL JMP no_wrap first_nametable: LDA #%10010001 ; $2000 now, so write STA scroll_table ; $2400 table to PPUCTRL