~rabbits/spacetime

0d625d9cd3abd40f0e9b334a6a687e413e975da3 — neauoire 3 years ago dc9272d master
Changed mapping
6 files changed, 105 insertions(+), 18 deletions(-)

M .gitignore
M NOTES
A README.md
M src/cart.asm
M tools/asm6
M tools/lin6
M .gitignore => .gitignore +2 -0
@@ 1,1 1,3 @@
tools/asm6
tools/lin6
cart.nes
\ No newline at end of file

M NOTES => NOTES +11 -1
@@ 73,4 73,14 @@ function randomize_steps()
  for i=1,16 do
    step[i] = math.random(COMMANDS)
  end
end
\ No newline at end of file
end

thats it!
Dans le header:
change
.db $20 ;Flags 6 (BNROM)
pour
.db $21 ;Flags 6 (BNROM)
et recompile
tu va avoir mon prob
donc si t'es capable de changer les offsets ou tu write dans la nametable pour que ca donne le meme r├ęsultat avec $21 et $20 dans le flag 6 ca va marcher partout
\ No newline at end of file

A README.md => README.md +18 -0
@@ 0,0 1,18 @@
# spacetime 6502

spacetime is a weird function sequencer.
it plays a note on each step.
each step is a symbol for the action.

- `+` increase note
- `-` decrease note
- `<` go to bottom note
- `>` go to top note
- `*` random note
- `M` fast metro
- `m` slow metro
- `#` jump random position

## More info

https://llllllll.co/t/spacetime-6502-port/35807
\ No newline at end of file

M src/cart.asm => src/cart.asm +74 -17
@@ 1,13 1,16 @@

;; header

	.db "NES", $1a ; identification of the iNES header
	.db 1 ; number of 16KB PRG-ROM pages
	.db $01 ; number of 8KB CHR-ROM pages
	.db $00 ; NROM
	.dsb $09,$00 ; clear the remaining bytes
	.fillvalue $FF ; Sets all unused space in rom to value $FF
	.org $C000
	.db "NES",$1A
	.db $02 ;Size of PRG ROM in 16 KB units
	.db $00 ;Size of CHR ROM in 8 KB units (Value 0 means the board uses CHR RAM)
	.db $20 ;Flags 6 (BNROM)
	.db $20 ;Flags 7 (BNROM)
	.db $00 ;Size of PRG RAM in 8 KB units (Value 0 infers 8 KB for compatibility)
	.db $00 ;Flags 9
	.db $00 ;Flags 10 (unofficial)
	.db 0,0,0,0,0
	.org $8000

;; constants



@@ 60,6 63,7 @@
	rate                    .dsb 1
	timer                   .dsb 1
	seed                    .dsb 1
	ptr_src                 .dsb 1
	.ende 

;; reset


@@ 100,6 104,14 @@ Vblankwait2: ; Second wait for vblank

;; setup phase

	JSR ClearVram
	;load sprite base
	LDA #$00
	STA PPUADDR
	LDA #$00
	STA PPUADDR
	JSR LoadSprites

SetupPalettes: 
	LDA PPUSTATUS
	LDA #$3F


@@ 550,9 562,52 @@ Cleanup:
	STA PPUSCROLL
	RTI                                ; return from interrupt

;; tables
ClearVram: 
	LDA #$00
	STA PPUADDR
	STA PPUADDR
	TAY 
	LDX #6

ClearVramLoop: 
	STA PPUDATA
	STA PPUDATA
	STA PPUDATA
	STA PPUDATA
	STA PPUDATA
	STA PPUDATA
	STA PPUDATA
	STA PPUDATA
	DEY 
	BNE ClearVramLoop
	DEX 
	BNE ClearVramLoop
	RTS 

	.org $E000
;; Move sprites

LoadSprites: 
	LDA #Sprites&255
	STA ptr_src
	LDA #Sprites/256
	STA ptr_src+1
	LDY #0                             ; starting index into the first page
	STY PPUMASK                        ; turn off rendering just in case
	STY PPUADDR                        ; load the destination address into the PPU
	STY PPUADDR
	LDX #32                            ; number of 256-byte pages to copy

Loop: 
	LDA (ptr_src),y                    ; copy one byte
	STA PPUDATA
	INY 
	BNE Loop                           ; repeat until we finish the page
	INC ptr_src+1                      ; go to the next page
	DEX 
	BNE Loop                           ; repeat until we've copied enough pages
	RTS 

;; tables

Palettes: ;
	.db $0F,$3B,$16,$30, $3B,$3B,$0F,$0F, $0F,$3B,$0F,$0F, $0F,$3B,$0F,$0F


@@ 580,15 635,11 @@ NotesLo:
	.db $7e,$77,$70,$6a,$64,$5e,$59,$54,$4f,$4b,$46,$42
	.db $3f,$3b,$38,$34,$31,$2f,$2c,$29,$27,$25,$23,$21

;; Vectors

	.pad $FFFA
	.dw NMI
	.dw RESET
	.dw 0
;; sprites

;; Sprites
	.org $D000

Sprites: 
	.db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
	.db $fe,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
	.db $00,$00,$00,$00,$00,$00,$00,$00,$fe,$00,$00,$00,$00,$00,$00,$00


@@ 649,4 700,10 @@ NotesLo:
	.db $7c,$82,$82,$fe,$82,$82,$82,$00,$7c,$82,$82,$fe,$82,$82,$82,$00
	.db $74,$8a,$84,$fa,$82,$82,$82,$00,$74,$8a,$84,$fa,$82,$82,$82,$00
	.db $fc,$82,$82,$fc,$82,$82,$fc,$00,$fc,$82,$82,$fc,$82,$82,$fc,$00
	.dsw 3624,$0000

;; Vectors

	.pad $FFFA
	.dw NMI
	.dw RESET
	.dw 0

M tools/asm6 => tools/asm6 +0 -0
M tools/lin6 => tools/lin6 +0 -0