diff --git a/doc/notes.txt b/doc/notes.txt index 0bedfc4f..e9eced25 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -48,6 +48,7 @@ TODO: - how to revert included files? - go to error in include files - BOM in upload/download? +- find version of neslib.h compatible with cc65 FYI: Image links for the books on http://8bitworkshop.com/ are broken On the website the additional grey spacing next to the program line numbers is not dynamically resized when the web browser window size is changed. Intentional? diff --git a/package.json b/package.json index a8ac7082..1d66240b 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "test": "npm run test-node", "test-one": "mocha --recursive --timeout 60000", "test-node": "mocha --recursive --timeout 60000 test/cli", + "test-worker": "mocha --recursive --timeout 60000 test/cli/testworker.js", "test-profile": "mocha --recursive --timeout 60000 --prof test/cli" }, "repository": { diff --git a/presets/apple2/conway.a b/presets/apple2/conway.a index 9add438d..bd5bb943 100644 --- a/presets/apple2/conway.a +++ b/presets/apple2/conway.a @@ -1,3 +1,4 @@ + ; Conway II ; Lee W. Fastenau ; thelbane@gmail.com diff --git a/presets/apple2/cosmic.c b/presets/apple2/cosmic.c index 938183a0..6e353071 100644 --- a/presets/apple2/cosmic.c +++ b/presets/apple2/cosmic.c @@ -1,4 +1,4 @@ - + #include #include #include diff --git a/presets/apple2/hgrtest.a b/presets/apple2/hgrtest.a index 7d0217a3..0c232d77 100644 --- a/presets/apple2/hgrtest.a +++ b/presets/apple2/hgrtest.a @@ -1,3 +1,4 @@ + processor 6502 seg program org $803 diff --git a/presets/apple2/mandel.c b/presets/apple2/mandel.c index 71452675..845b54e1 100644 --- a/presets/apple2/mandel.c +++ b/presets/apple2/mandel.c @@ -1,3 +1,4 @@ + /*****************************************************************************\ ** mandelbrot sample program for cc65. ** ** ** diff --git a/presets/apple2/siegegame.c b/presets/apple2/siegegame.c index 00bc8a4e..f8d4318d 100644 --- a/presets/apple2/siegegame.c +++ b/presets/apple2/siegegame.c @@ -139,7 +139,7 @@ byte ai_try_dir(Player* p, dir_t dir, byte shift) { dir &= 3; x = p->x + (DIR_X[dir] << shift); y = p->y + (DIR_Y[dir] << shift); - if (x < COLS && y < ROWS && getchar(x, y) == ' ') { + if (x < COLS && y < ROWS && (getchar(x, y) & 0x7f) == ' ') { p->dir = dir; return 1; } else { @@ -197,7 +197,7 @@ void declare_winner(byte winner) { cputsxy(12,10,"WINNER:"); cputsxy(12,13,"PLAYER "); cputcxy(12+7, 13, '1'+winner); - delay(75); + delay(200); gameover = 1; } diff --git a/presets/apple2/sieve.c b/presets/apple2/sieve.c index e8b67dc1..65a0b76e 100644 --- a/presets/apple2/sieve.c +++ b/presets/apple2/sieve.c @@ -1,55 +1,41 @@ + /* ** Calculate all primes up to a specific number. */ - - #include #include #include #include #include - /* Workaround missing clock stuff */ #ifdef __APPLE2__ # define clock() 0 # define CLOCKS_PER_SEC 1 #endif - - /*****************************************************************************/ /* Data */ /*****************************************************************************/ - - #define COUNT 4096 /* Up to what number? */ #define SQRT_COUNT 64 /* Sqrt of COUNT */ static unsigned char Sieve[COUNT]; - - /*****************************************************************************/ /* Code */ /*****************************************************************************/ - - #pragma static-locals(1); - - static char ReadUpperKey (void) /* Read a key from console, convert to upper case and return */ { return toupper (cgetc ()); } - - int main (void) { /* Clock variable */ @@ -118,4 +104,3 @@ int main (void) return EXIT_SUCCESS; } - diff --git a/presets/apple2/tb_6502.s b/presets/apple2/tb_6502.s index 2ab7e3ac..731f8058 100644 --- a/presets/apple2/tb_6502.s +++ b/presets/apple2/tb_6502.s @@ -1,3 +1,4 @@ + ; From: http://www.deater.net/weave/vmwprod/tb1/tb_6502.html .segment "INIT" diff --git a/presets/apple2/tgidemo.c b/presets/apple2/tgidemo.c index ce6cfbfe..45a66439 100644 --- a/presets/apple2/tgidemo.c +++ b/presets/apple2/tgidemo.c @@ -1,3 +1,4 @@ + #include #include #include @@ -6,8 +7,6 @@ #include #include - - #ifndef DYN_DRV # define DYN_DRV 0 #endif @@ -15,26 +14,19 @@ #define COLOR_BACK TGI_COLOR_BLACK #define COLOR_FORE TGI_COLOR_WHITE - /*****************************************************************************/ /* Data */ /*****************************************************************************/ - - /* Driver stuff */ static unsigned MaxX; static unsigned MaxY; static unsigned AspectRatio; - - /*****************************************************************************/ /* Code */ /*****************************************************************************/ - - static void CheckError (const char* S) { unsigned char Error = tgi_geterror (); @@ -47,8 +39,6 @@ static void CheckError (const char* S) } } - - #if DYN_DRV static void DoWarning (void) /* Warn the user that the dynamic TGI driver is needed for this program */ @@ -63,8 +53,6 @@ static void DoWarning (void) } #endif - - static void DoCircles (void) { static const unsigned char Palette[2] = { TGI_COLOR_WHITE, TGI_COLOR_ORANGE }; diff --git a/presets/atari8-5200/hello.a b/presets/atari8-5200/hello.a index 58178929..92bf467d 100644 --- a/presets/atari8-5200/hello.a +++ b/presets/atari8-5200/hello.a @@ -1,3 +1,4 @@ + ; Atari 5200 "Hello World" sample code ; Written by Daniel Boris (dboris@comcast.net) ; diff --git a/presets/atari8-5200/hellopm.a b/presets/atari8-5200/hellopm.a index 3cdf6f05..a2eacd89 100644 --- a/presets/atari8-5200/hellopm.a +++ b/presets/atari8-5200/hellopm.a @@ -1,3 +1,4 @@ + ; Atari 5200 "Hello World" sample code ; Written by Daniel Boris (dboris@comcast.net) ; diff --git a/presets/coleco/common.h b/presets/coleco/common.h index 106304e8..a2d744a1 100644 --- a/presets/coleco/common.h +++ b/presets/coleco/common.h @@ -1,3 +1,4 @@ + #ifndef _CV_COMMON_H #define _CV_COMMON_H diff --git a/presets/coleco/simplemusic.c b/presets/coleco/simplemusic.c index ff1dc057..34d80458 100644 --- a/presets/coleco/simplemusic.c +++ b/presets/coleco/simplemusic.c @@ -1,3 +1,4 @@ + #include const uint16_t notes[] = { 12846, 12334, 11086, 10062, 10062, 9806, 10062, 10574, 11086, 10062, 11086, 12430, 11042, 12334, 12878, 14158, 14158, 12878, 13390, 13646, 10574, 9806, 10574, 12430, 12846, 12334, 11086, 10062, 10062, 9806, 10062, 10574, 11086, 10062, 11086, 12430, 11054, 12334, 12878, 14158, 14158, 12878, 13390, 13646, 10574, 10062, 10062, 10126, 11054, 12334, 12878, 14158, 13902, 14158, 14670, 14158, 13646, 12878, 13390, 13646, 3918, 12878, 14158, 13902, 12878, 12366, 12878, 12366, 12878, 11086, 10062, 9870, 12334, 11054, 11086, 10062, 10062, 9806, 10062, 10574, 11086, 10062, 11086, 12430, 11054, 12334, 12878, 14158, 14158, 12878, 13390, 13646, 10574, 10062, 10062, 10126, 0xffff }; diff --git a/presets/coleco/stars.c b/presets/coleco/stars.c index 7d32893d..9dc5f266 100644 --- a/presets/coleco/stars.c +++ b/presets/coleco/stars.c @@ -1,3 +1,4 @@ + #include #include #include diff --git a/presets/galaxian-scramble/gfxtest.c b/presets/galaxian-scramble/gfxtest.c index e8f38389..856453b9 100644 --- a/presets/galaxian-scramble/gfxtest.c +++ b/presets/galaxian-scramble/gfxtest.c @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/galaxian-scramble/shoot2.c b/presets/galaxian-scramble/shoot2.c index 2e334365..37663c3a 100644 --- a/presets/galaxian-scramble/shoot2.c +++ b/presets/galaxian-scramble/shoot2.c @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/galaxian-scramble/skeleton.sdcc b/presets/galaxian-scramble/skeleton.sdcc index d297f411..06e11789 100644 --- a/presets/galaxian-scramble/skeleton.sdcc +++ b/presets/galaxian-scramble/skeleton.sdcc @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/nes-lib/crypto.c b/presets/nes-lib/crypto.c index d0fd8030..becc7f85 100644 --- a/presets/nes-lib/crypto.c +++ b/presets/nes-lib/crypto.c @@ -1,3 +1,4 @@ + #include "neslib.h" //#define DEBUG diff --git a/presets/nes-lib/neslib2.c b/presets/nes-lib/neslib2.c index 004810e0..4c866dfb 100644 --- a/presets/nes-lib/neslib2.c +++ b/presets/nes-lib/neslib2.c @@ -1,3 +1,4 @@ + //this example shows how to set up a palette and use 8x8 HW sprites //also shows how fast (or slow) C code is diff --git a/presets/nes-lib/neslib3.c b/presets/nes-lib/neslib3.c index ee4e1949..16e3e430 100644 --- a/presets/nes-lib/neslib3.c +++ b/presets/nes-lib/neslib3.c @@ -1,3 +1,4 @@ + //this example shows how to set up a palette and use 8x8 HW sprites //also shows how fast (or slow) C code is diff --git a/presets/nes/crypto.c b/presets/nes/crypto.c index 72df388a..a2c08b9d 100644 --- a/presets/nes/crypto.c +++ b/presets/nes/crypto.c @@ -1,4 +1,5 @@ -#include "neslib.h" + +#include "neslib.h" //#define DEBUG #define HAS_DEBUGGER diff --git a/presets/nes/ex0.asm b/presets/nes/ex0.asm index 17b073e9..09f6d651 100644 --- a/presets/nes/ex0.asm +++ b/presets/nes/ex0.asm @@ -1,103 +1,46 @@ -;;;;; CONSTANTS + include "nesdefs.asm" -PPU_CTRL equ $2000 -PPU_MASK equ $2001 -PPU_STATUS equ $2002 -PPU_SCROLL equ $2005 -PPU_ADDR equ $2006 -PPU_DATA equ $2007 -DMC_FREQ equ $4010 +;;;;; VARIABLES -;;;;; CARTRIDGE FILE HEADER + seg.u RAM + org $0 - processor 6502 - seg Header - org $7FF0 +;;;;; NES CARTRIDGE HEADER -NES_MAPPER equ 0 ;mapper number -NES_PRG_BANKS equ 2 ;number of 16K PRG banks, change to 2 for NROM256 -NES_CHR_BANKS equ 1 ;number of 8K CHR banks (0 = RAM) -NES_MIRRORING equ 1 ;0 horizontal, 1 vertical, 8 four screen + NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical - .byte $4e,$45,$53,$1a ; header - .byte NES_PRG_BANKS - .byte NES_CHR_BANKS - .byte NES_MIRRORING|(NES_MAPPER<<4) - .byte NES_MAPPER&$f0 - .byte 0,0,0,0,0,0,0,0 ; reserved, set to zero +;;;;; START OF CODE -;;;;; CODE +Start: + NES_INIT ; set up stack pointer, turn off PPU + jsr WaitSync ; wait for VSYNC + jsr ClearRAM ; clear RAM + jsr WaitSync ; wait for VSYNC (and PPU warmup) - seg Code - org $8000 -start: -_exit: - sei ;disable IRQs - cld ;decimal mode not supported - ldx #$ff - txs ;set up stack pointer - inx ;increment X to 0 - stx PPU_MASK ;disable rendering - stx DMC_FREQ ;disable DMC interrupts - stx PPU_CTRL ;disable NMI interrupts - jsr WaitSyncSafe ;wait for VSYNC -; clear RAM -- not a subroutine because we clear the stack too - lda #0 - tax -.clearRAM - sta $0,x - sta $100,x - ; skip $200-$2FF, used for OAM display list - sta $300,x - sta $400,x - sta $500,x - sta $600,x - sta $700,x - inx - bne .clearRAM -; wait for PPU warmup - jsr WaitSync -; set palette background - ldy #$0 - lda #$3f - sta PPU_ADDR - sty PPU_ADDR - lda #$1c - sta PPU_DATA -; enable PPU rendering - lda #0 - sta PPU_ADDR - sta PPU_ADDR ;PPU addr = 0 - sta PPU_SCROLL - sta PPU_SCROLL ;scroll = 0 - lda #$90 - sta PPU_CTRL ;enable NMI - lda #$1e - sta PPU_MASK ;enable rendering + lda #$3f ; $3F -> A register + ldy #$00 ; $00 -> Y register + sta PPU_ADDR ; write high byte first + sty PPU_ADDR ; $3F00 -> PPU address + lda #$1c ; $1C = light blue color + sta PPU_DATA ; $1C -> PPU data + lda #CTRL_NMI + sta PPU_CTRL ; enable NMI + lda #MASK_COLOR + sta PPU_MASK ; enable rendering .endless - jmp .endless ;endless loop + jmp .endless ; endless loop -;;;;; SUBROUTINES +;;;;; COMMON SUBROUTINES -; wait for VSYNC to start -WaitSyncSafe: subroutine - bit PPU_STATUS -WaitSync: - bit PPU_STATUS - bpl WaitSync - rts + include "nesppu.asm" ;;;;; INTERRUPT HANDLERS -nmi: -irq: +NMIHandler: rti ;;;;; CPU VECTORS - org $fffa - .word nmi ;$fffa vblank nmi - .word start ;$fffc reset - .word irq ;$fffe irq / brk + NES_VECTORS diff --git a/presets/nes/ex1.asm b/presets/nes/ex1.asm index 98a211fc..2da8c6bc 100644 --- a/presets/nes/ex1.asm +++ b/presets/nes/ex1.asm @@ -1,121 +1,37 @@ -;;;;; CONSTANTS + include "nesdefs.asm" -PPU_CTRL equ $2000 -PPU_MASK equ $2001 -PPU_STATUS equ $2002 -OAM_ADDR equ $2003 -OAM_DATA equ $2004 -PPU_SCROLL equ $2005 -PPU_ADDR equ $2006 -PPU_DATA equ $2007 -PPU_OAM_DMA equ $4014 -DMC_FREQ equ $4010 +;;;;; VARIABLES -;;;;; ZERO-PAGE VARIABLES - - seg.u ZPVars + seg.u RAM org $0 ScrollPos byte ; used during NMI -Rand byte -;;;;; CARTRIDGE FILE HEADER +;;;;; NES CARTRIDGE HEADER -NES_MAP_HORIZ equ 0 -NES_MAP_VERT equ 1 -NES_MAP_QUAD equ 8 + NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical - MAC NES_HEADER - processor 6502 - seg Header - org $7FF0 -.NES_MAPPER SET {1} ;mapper number -.NES_PRG_BANKS SET {2} ;number of 16K PRG banks, change to 2 for NROM256 -.NES_CHR_BANKS SET {3} ;number of 8K CHR banks (0 = RAM) -.NES_MIRRORING SET {4} ;0 horizontal, 1 vertical, 8 four screen - byte $4e,$45,$53,$1a ; header - byte .NES_PRG_BANKS - byte .NES_CHR_BANKS - byte .NES_MIRRORING|(.NES_MAPPER<<4) - byte .NES_MAPPER&$f0 - byte 0,0,0,0,0,0,0,0 ; reserved, set to zero - seg Code - org $8000 - ENDM - - MAC NES_INIT - sei ;disable IRQs - cld ;decimal mode not supported - ldx #$ff - txs ;set up stack pointer - inx ;increment X to 0 - stx PPU_MASK ;disable rendering - stx DMC_FREQ ;disable DMC interrupts - stx PPU_CTRL ;disable NMI interrupts - bit PPU_STATUS ;clear VBL flag - ENDM +;;;;; START OF CODE - NES_HEADER 0,2,1,1 ; mapper 0, 2 PRGs, 1 CHR, vertical - -start: -_exit: - NES_INIT ; set up stack pointer, turn off PPU - jsr WaitSync - jsr WaitSync - jsr ClearRAM - jsr WaitSync ;wait for VSYNC - jsr SetPalette ;set colors - jsr FillVRAM ;set PPU RAM - jsr WaitSync ;wait for VSYNC (and PPU warmup) +Start: + NES_INIT ; set up stack pointer, turn off PPU + jsr WaitSync ; wait for VSYNC + jsr ClearRAM ; clear RAM + jsr SetPalette ; set palette colors + jsr FillVRAM ; set PPU video RAM + jsr WaitSync ; wait for VSYNC (and PPU warmup) lda #0 sta PPU_ADDR - sta PPU_ADDR ;PPU addr = 0 + sta PPU_ADDR ; PPU addr = $0000 sta PPU_SCROLL - sta PPU_SCROLL ;scroll = 0 + sta PPU_SCROLL ; scroll = $0000 lda #$90 - sta PPU_CTRL ;enable NMI + sta PPU_CTRL ; enable NMI lda #$1e - sta PPU_MASK ;enable rendering + sta PPU_MASK ; enable rendering .endless - jmp .endless ;endless loop - -;;;;; SUBROUTINES - -ClearRAM: subroutine - lda #0 - tax -.clearRAM - sta $0,x - cpx #$fe ; don't clear last 2 bytes of stack - bcs .skipStack - sta $100,x -.skipStack - ; skip $200-$2FF, used for OAM display list - sta $300,x - sta $400,x - sta $500,x - sta $600,x - sta $700,x - inx - bne .clearRAM - rts - -; set palette colors - -SetPalette: subroutine - ldy #$0 - lda #$3f - sta PPU_ADDR - sty PPU_ADDR - ldx #4 -.loop: - lda Palette,y - sta PPU_DATA - iny - dex - bne .loop - rts + jmp .endless ; endless loop ; fill video RAM FillVRAM: subroutine @@ -133,41 +49,59 @@ FillVRAM: subroutine bne .loop rts -; wait for VSYNC to start -WaitSync: - bit PPU_STATUS - bpl WaitSync +; set palette colors +SetPalette: subroutine + ldy #$00 + lda #$3f + sta PPU_ADDR + sty PPU_ADDR + ldx #32 +.loop: + lda Palette,y + sta PPU_DATA + iny + dex + bne .loop rts + +;;;;; COMMON SUBROUTINES + + include "nesppu.asm" + ;;;;; INTERRUPT HANDLERS -nmi: -irq: +NMIHandler: ; save registers pha ; save A -; update scroll position +; update scroll position (must be done after VRAM updates) inc ScrollPos lda ScrollPos sta PPU_SCROLL + lda #0 sta PPU_SCROLL +; TODO: write high bits to PPUCTRL + lda ScrollPos + and #0 + ora #$90 ; enable NMI + sta PPU_CTRL ; reload registers pla ; reload A rti ;;;;; CONSTANT DATA + align $100 Palette: - hex 1f001020 ; black, gray, lt gray, white -TextString: - byte "HELLO WORLD!" - byte 0 + hex 1f ;background + hex 09091900 ;bg0 + hex 09091900 ;bg1 + hex 09091900 ;bg2 + hex 09091900 ;bg3 ;;;;; CPU VECTORS - org $fffa - .word nmi ;$fffa vblank nmi - .word start ;$fffc reset - .word irq ;$fffe irq / brk + NES_VECTORS ;;;;; TILE SETS diff --git a/presets/nes/ex2.asm b/presets/nes/ex2.asm index 65259bc4..2109b985 100644 --- a/presets/nes/ex2.asm +++ b/presets/nes/ex2.asm @@ -1,9 +1,9 @@ include "nesdefs.asm" -;;;;; ZERO-PAGE VARIABLES +;;;;; VARIABLES - seg.u Zeropage + seg.u RAM org $0 ScrollPos byte ; used during NMI @@ -12,8 +12,12 @@ Temp1 byte SpriteBuf equ $200 +;;;;; NES CARTRIDGE HEADER + NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical +;;;;; START OF CODE + Start: NES_INIT ; set up stack pointer, turn off PPU jsr WaitSync diff --git a/presets/nes/helloworld.asm b/presets/nes/helloworld.asm index d614528a..64c9e5df 100644 --- a/presets/nes/helloworld.asm +++ b/presets/nes/helloworld.asm @@ -1,4 +1,4 @@ - + include "nesdefs.asm" ;;;;; ZERO-PAGE VARIABLES diff --git a/presets/nes/nesdefs.asm b/presets/nes/nesdefs.asm index 78074b31..85e6fb1e 100644 --- a/presets/nes/nesdefs.asm +++ b/presets/nes/nesdefs.asm @@ -28,6 +28,38 @@ OAM_DMA = $4014 ; OAM local RAM copy goes from $0200-$02FF: OAM_RAM = $0200 +; PPU_CTRL flags +CTRL_NMI = %10000000 ; Execute Non-Maskable Interrupt on VBlank +CTRL_8x8 = %00000000 ; Use 8x8 Sprites +CTRL_8x16 = %00100000 ; Use 8x16 Sprites +CTRL_BG_0000 = %00000000 ; Background Pattern Table at $0000 in VRAM +CTRL_BG_1000 = %00010000 ; Background Pattern Table at $1000 in VRAM +CTRL_SPR_0000 = %00000000 ; Sprite Pattern Table at $0000 in VRAM +CTRL_SPR_1000 = %00001000 ; Sprite Pattern Table at $1000 in VRAM +CTRL_INC_1 = %00000000 ; Increment PPU Address by 1 (Horizontal rendering) +CTRL_INC_32 = %00000100 ; Increment PPU Address by 32 (Vertical rendering) +CTRL_NT_2000 = %00000000 ; Name Table Address at $2000 +CTRL_NT_2400 = %00000001 ; Name Table Address at $2400 +CTRL_NT_2800 = %00000010 ; Name Table Address at $2800 +CTRL_NT_2C00 = %00000011 ; Name Table Address at $2C00 + +; PPU_MASK flags +MASK_TINT_RED = %00100000 ; Red Background +MASK_TINT_BLUE = %01000000 ; Blue Background +MASK_TINT_GREEN = %10000000 ; Green Background +MASK_SPR = %00010000 ; Sprites Visible +MASK_BG = %00001000 ; Backgrounds Visible +MASK_SPR_CLIP = %00000100 ; Sprites clipped on left column +MASK_BG_CLIP = %00000010 ; Background clipped on left column +MASK_COLOR = %00000000 ; Display in Color +MASK_MONO = %00000001 ; Display in Monochrome + +; read flags +F_BLANK = %10000000 ; VBlank Active +F_SPRITE0 = %01000000 ; VBlank hit Sprite 0 +F_SCAN8 = %00100000 ; More than 8 sprites on current scanline +F_WIGNORE = %00010000 ; VRAM Writes currently ignored. + ;;;;; CARTRIDGE FILE HEADER diff --git a/presets/nes/neslib2.c b/presets/nes/neslib2.c index db633e40..5a8b5959 100644 --- a/presets/nes/neslib2.c +++ b/presets/nes/neslib2.c @@ -1,3 +1,4 @@ + //this example shows how to set up a palette and use 8x8 HW sprites //also shows how fast (or slow) C code is diff --git a/presets/nes/neslib3.c b/presets/nes/neslib3.c index 9ec39570..a38c50b2 100644 --- a/presets/nes/neslib3.c +++ b/presets/nes/neslib3.c @@ -1,3 +1,4 @@ + //this example shows how to set up a palette and use 8x8 HW sprites //also shows how fast (or slow) C code is diff --git a/presets/nes/nesppu.asm b/presets/nes/nesppu.asm index 1cb813d6..788e4866 100644 --- a/presets/nes/nesppu.asm +++ b/presets/nes/nesppu.asm @@ -1,3 +1,4 @@ + ;;;;; SUBROUTINES ClearRAM: subroutine diff --git a/presets/vcs/examples/adventure.a b/presets/vcs/examples/adventure.a index 40aebd03..d7673074 100644 --- a/presets/vcs/examples/adventure.a +++ b/presets/vcs/examples/adventure.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/bankswitching.a b/presets/vcs/examples/bankswitching.a index a133546e..f351bb56 100644 --- a/presets/vcs/examples/bankswitching.a +++ b/presets/vcs/examples/bankswitching.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/bigsprite.a b/presets/vcs/examples/bigsprite.a index b095b50c..5cba4ced 100644 --- a/presets/vcs/examples/bigsprite.a +++ b/presets/vcs/examples/bigsprite.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/bitmap.a b/presets/vcs/examples/bitmap.a index ff5fd071..9d0317b6 100644 --- a/presets/vcs/examples/bitmap.a +++ b/presets/vcs/examples/bitmap.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/brickgame.a b/presets/vcs/examples/brickgame.a index a60a102d..72b30e96 100644 --- a/presets/vcs/examples/brickgame.a +++ b/presets/vcs/examples/brickgame.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/collisions.a b/presets/vcs/examples/collisions.a index 9dbdb374..a824c560 100644 --- a/presets/vcs/examples/collisions.a +++ b/presets/vcs/examples/collisions.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/complexscene.a b/presets/vcs/examples/complexscene.a index 906864e1..edc11604 100644 --- a/presets/vcs/examples/complexscene.a +++ b/presets/vcs/examples/complexscene.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/complexscene2.a b/presets/vcs/examples/complexscene2.a index c3fa6734..4a9ee18c 100644 --- a/presets/vcs/examples/complexscene2.a +++ b/presets/vcs/examples/complexscene2.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/fracpitch.a b/presets/vcs/examples/fracpitch.a index f3cd6ed6..d1559bd9 100644 --- a/presets/vcs/examples/fracpitch.a +++ b/presets/vcs/examples/fracpitch.a @@ -1,3 +1,4 @@ + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Playing music on the Atari VCS can be challenging since diff --git a/presets/vcs/examples/fractionalpitch.a b/presets/vcs/examples/fractionalpitch.a index cf6d3edb..284a18c3 100644 --- a/presets/vcs/examples/fractionalpitch.a +++ b/presets/vcs/examples/fractionalpitch.a @@ -1,3 +1,4 @@ + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Playing music on the Atari VCS can be challenging since diff --git a/presets/vcs/examples/fullgame.a b/presets/vcs/examples/fullgame.a index 0408c625..2b83f1f5 100644 --- a/presets/vcs/examples/fullgame.a +++ b/presets/vcs/examples/fullgame.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/hello.a b/presets/vcs/examples/hello.a index 802edbb3..9653e025 100644 --- a/presets/vcs/examples/hello.a +++ b/presets/vcs/examples/hello.a @@ -1,3 +1,4 @@ + ; Assembler should use basic 6502 instructions processor 6502 diff --git a/presets/vcs/examples/lines.a b/presets/vcs/examples/lines.a index e42f90a9..1dc3013b 100644 --- a/presets/vcs/examples/lines.a +++ b/presets/vcs/examples/lines.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/missiles.a b/presets/vcs/examples/missiles.a index d3bb6f57..14b98997 100644 --- a/presets/vcs/examples/missiles.a +++ b/presets/vcs/examples/missiles.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/multisprite1.a b/presets/vcs/examples/multisprite1.a index 795fd13a..0f5effea 100644 --- a/presets/vcs/examples/multisprite1.a +++ b/presets/vcs/examples/multisprite1.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/multisprite2.a b/presets/vcs/examples/multisprite2.a index d6330407..cdcbdbff 100644 --- a/presets/vcs/examples/multisprite2.a +++ b/presets/vcs/examples/multisprite2.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/multisprite3.a b/presets/vcs/examples/multisprite3.a index cd19fb47..03476027 100644 --- a/presets/vcs/examples/multisprite3.a +++ b/presets/vcs/examples/multisprite3.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/musicplayer.a b/presets/vcs/examples/musicplayer.a index c79b2e9f..d41b24ac 100644 --- a/presets/vcs/examples/musicplayer.a +++ b/presets/vcs/examples/musicplayer.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/piatable.a b/presets/vcs/examples/piatable.a index a5e9f9af..284da30c 100644 --- a/presets/vcs/examples/piatable.a +++ b/presets/vcs/examples/piatable.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/playfield.a b/presets/vcs/examples/playfield.a index 61d00578..c077272b 100644 --- a/presets/vcs/examples/playfield.a +++ b/presets/vcs/examples/playfield.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/procgen1.a b/presets/vcs/examples/procgen1.a index 67fc619d..0d4d4d97 100644 --- a/presets/vcs/examples/procgen1.a +++ b/presets/vcs/examples/procgen1.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/retrigger.a b/presets/vcs/examples/retrigger.a index 593cbfb9..b8b621c1 100644 --- a/presets/vcs/examples/retrigger.a +++ b/presets/vcs/examples/retrigger.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/road.a b/presets/vcs/examples/road.a index 2a7bd551..2f923a43 100644 --- a/presets/vcs/examples/road.a +++ b/presets/vcs/examples/road.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/score6.a b/presets/vcs/examples/score6.a index 81daf065..a0dc3e70 100644 --- a/presets/vcs/examples/score6.a +++ b/presets/vcs/examples/score6.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/scoreboard.a b/presets/vcs/examples/scoreboard.a index 819828d5..e817a1ff 100644 --- a/presets/vcs/examples/scoreboard.a +++ b/presets/vcs/examples/scoreboard.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/sprite.a b/presets/vcs/examples/sprite.a index a21412ed..2916757a 100644 --- a/presets/vcs/examples/sprite.a +++ b/presets/vcs/examples/sprite.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/timing1.a b/presets/vcs/examples/timing1.a index ff450a9d..e4c14986 100644 --- a/presets/vcs/examples/timing1.a +++ b/presets/vcs/examples/timing1.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/timing2.a b/presets/vcs/examples/timing2.a index a134c066..d1f93498 100644 --- a/presets/vcs/examples/timing2.a +++ b/presets/vcs/examples/timing2.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/tinyfonts.a b/presets/vcs/examples/tinyfonts.a index 56b0dc95..f7fd22f9 100644 --- a/presets/vcs/examples/tinyfonts.a +++ b/presets/vcs/examples/tinyfonts.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/tinyfonts2.a b/presets/vcs/examples/tinyfonts2.a index 3427a4db..5b838033 100644 --- a/presets/vcs/examples/tinyfonts2.a +++ b/presets/vcs/examples/tinyfonts2.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/vsync.a b/presets/vcs/examples/vsync.a index ea04ee17..aa6eb0d3 100644 --- a/presets/vcs/examples/vsync.a +++ b/presets/vcs/examples/vsync.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/examples/wavetable.a b/presets/vcs/examples/wavetable.a index 51481ae7..2d29503a 100644 --- a/presets/vcs/examples/wavetable.a +++ b/presets/vcs/examples/wavetable.a @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/vcs/skeleton.dasm b/presets/vcs/skeleton.dasm index 574a01bb..c2be8c5a 100644 --- a/presets/vcs/skeleton.dasm +++ b/presets/vcs/skeleton.dasm @@ -1,3 +1,4 @@ + processor 6502 include "vcs.h" include "macro.h" diff --git a/presets/verilog/7segment.v b/presets/verilog/7segment.v index 9bed775a..f05e36a8 100644 --- a/presets/verilog/7segment.v +++ b/presets/verilog/7segment.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" /* diff --git a/presets/verilog/ball_absolute.v b/presets/verilog/ball_absolute.v index b5dc5df7..60573577 100644 --- a/presets/verilog/ball_absolute.v +++ b/presets/verilog/ball_absolute.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" module ball_absolute_top(clk, reset, hsync, vsync, rgb); diff --git a/presets/verilog/ball_paddle.v b/presets/verilog/ball_paddle.v index 03d6a7ce..87b7a0f1 100644 --- a/presets/verilog/ball_paddle.v +++ b/presets/verilog/ball_paddle.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "digits10.v" `include "scoreboard.v" diff --git a/presets/verilog/ball_slip_counter.v b/presets/verilog/ball_slip_counter.v index be499a9c..0082b86d 100644 --- a/presets/verilog/ball_slip_counter.v +++ b/presets/verilog/ball_slip_counter.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" module ball_slip_counter_top(clk, reset, hsync, vsync, rgb); diff --git a/presets/verilog/clock_divider.v b/presets/verilog/clock_divider.v index 227947e3..12f4a83a 100644 --- a/presets/verilog/clock_divider.v +++ b/presets/verilog/clock_divider.v @@ -1,3 +1,4 @@ + module clock_divider( input clk, input reset, diff --git a/presets/verilog/cpu16.v b/presets/verilog/cpu16.v index f4c7d168..68a38cc1 100644 --- a/presets/verilog/cpu16.v +++ b/presets/verilog/cpu16.v @@ -1,3 +1,4 @@ + `ifndef CPU16_H `define CPU16_H diff --git a/presets/verilog/cpu8.v b/presets/verilog/cpu8.v index d8409fa5..8f3d4c59 100644 --- a/presets/verilog/cpu8.v +++ b/presets/verilog/cpu8.v @@ -1,3 +1,4 @@ + `ifndef ALU_H `define ALU_H diff --git a/presets/verilog/cpu_platform.v b/presets/verilog/cpu_platform.v index 073858d3..92f3b8e8 100644 --- a/presets/verilog/cpu_platform.v +++ b/presets/verilog/cpu_platform.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "font_cp437_8x8.v" `include "ram.v" diff --git a/presets/verilog/digits10.v b/presets/verilog/digits10.v index 8b8b6532..7a9768b8 100644 --- a/presets/verilog/digits10.v +++ b/presets/verilog/digits10.v @@ -1,3 +1,4 @@ + `ifndef DIGITS10_H `define DIGITS10_H diff --git a/presets/verilog/femto16.cfg b/presets/verilog/femto16.cfg index 73e17a68..747c5a1c 100644 --- a/presets/verilog/femto16.cfg +++ b/presets/verilog/femto16.cfg @@ -1,3 +1,4 @@ + ; Architecture file for the FEMTO-8 ; default output format is a memory initialization file diff --git a/presets/verilog/femto16.json b/presets/verilog/femto16.json index 6d049525..58475309 100644 --- a/presets/verilog/femto16.json +++ b/presets/verilog/femto16.json @@ -1,3 +1,4 @@ + { "name":"femto16", "width":16, diff --git a/presets/verilog/femto8.cfg b/presets/verilog/femto8.cfg index 13daa452..cc9f2e17 100644 --- a/presets/verilog/femto8.cfg +++ b/presets/verilog/femto8.cfg @@ -1,3 +1,4 @@ + ; Architecture file for the FEMTO-8 ; default output format is a memory initialization file diff --git a/presets/verilog/femto8.json b/presets/verilog/femto8.json index ce6eb4c5..77819e9a 100644 --- a/presets/verilog/femto8.json +++ b/presets/verilog/femto8.json @@ -1,3 +1,4 @@ + { "name":"femto8", "vars":{ diff --git a/presets/verilog/font_cp437_8x8.v b/presets/verilog/font_cp437_8x8.v index f6f2a01d..e318844d 100644 --- a/presets/verilog/font_cp437_8x8.v +++ b/presets/verilog/font_cp437_8x8.v @@ -1,3 +1,4 @@ + `ifndef FONT_CP437_H `define FONT_CP437_H diff --git a/presets/verilog/framebuf_vpu.v b/presets/verilog/framebuf_vpu.v index 6c996652..cebfd6f2 100644 --- a/presets/verilog/framebuf_vpu.v +++ b/presets/verilog/framebuf_vpu.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "sprite_bitmap.v" `include "sprite_renderer.v" diff --git a/presets/verilog/framebuffer.v b/presets/verilog/framebuffer.v index 17b8a422..5288de38 100644 --- a/presets/verilog/framebuffer.v +++ b/presets/verilog/framebuffer.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "cpu16.v" diff --git a/presets/verilog/gates.v b/presets/verilog/gates.v index 37f09018..17e44d8c 100644 --- a/presets/verilog/gates.v +++ b/presets/verilog/gates.v @@ -1,3 +1,4 @@ + module gates(clk, out_not, out_and, out_or, out_xor, in); input clk; diff --git a/presets/verilog/hvsync_generator.v b/presets/verilog/hvsync_generator.v index b8d6c465..175145af 100644 --- a/presets/verilog/hvsync_generator.v +++ b/presets/verilog/hvsync_generator.v @@ -1,3 +1,4 @@ + `ifndef HVSYNC_GENERATOR_H `define HVSYNC_GENERATOR_H diff --git a/presets/verilog/lfsr.v b/presets/verilog/lfsr.v index 63661a4c..3664db0d 100644 --- a/presets/verilog/lfsr.v +++ b/presets/verilog/lfsr.v @@ -1,3 +1,4 @@ + `ifndef LFSR_V `define LFSR_V diff --git a/presets/verilog/music.v b/presets/verilog/music.v index dd502675..8f1b3998 100644 --- a/presets/verilog/music.v +++ b/presets/verilog/music.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" module sound_psg(clk, reset, out, reg_sel, reg_data, reg_write); diff --git a/presets/verilog/paddles.v b/presets/verilog/paddles.v index 922b6960..3202f1fe 100644 --- a/presets/verilog/paddles.v +++ b/presets/verilog/paddles.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" module paddles_top(clk, reset, hsync, vsync, hpaddle, vpaddle, rgb); diff --git a/presets/verilog/racing_game.v b/presets/verilog/racing_game.v index 7e435d43..168be4de 100644 --- a/presets/verilog/racing_game.v +++ b/presets/verilog/racing_game.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "sprite_bitmap.v" `include "sprite_renderer.v" diff --git a/presets/verilog/racing_game_cpu.v b/presets/verilog/racing_game_cpu.v index 04de9427..941ec126 100644 --- a/presets/verilog/racing_game_cpu.v +++ b/presets/verilog/racing_game_cpu.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "sprite_bitmap.v" `include "sprite_renderer.v" diff --git a/presets/verilog/ram.v b/presets/verilog/ram.v index 0616918e..e4dacda6 100644 --- a/presets/verilog/ram.v +++ b/presets/verilog/ram.v @@ -1,3 +1,4 @@ + `ifndef RAM_H `define RAM_H diff --git a/presets/verilog/ram1.v b/presets/verilog/ram1.v index 1c9e1435..2f76b00e 100644 --- a/presets/verilog/ram1.v +++ b/presets/verilog/ram1.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "digits10.v" `include "ram.v" diff --git a/presets/verilog/ram2.v b/presets/verilog/ram2.v index 6d79463d..e4187872 100644 --- a/presets/verilog/ram2.v +++ b/presets/verilog/ram2.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "digits10.v" diff --git a/presets/verilog/scoreboard.v b/presets/verilog/scoreboard.v index 6a8b4742..cda8c499 100644 --- a/presets/verilog/scoreboard.v +++ b/presets/verilog/scoreboard.v @@ -1,3 +1,4 @@ + `ifndef SCOREBOARD_H `define SCOREBOARD_H diff --git a/presets/verilog/sharedbuffer.v b/presets/verilog/sharedbuffer.v index ca0b8634..b5bf52d4 100644 --- a/presets/verilog/sharedbuffer.v +++ b/presets/verilog/sharedbuffer.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "cpu8.v" `include "cpu16.v" diff --git a/presets/verilog/skeleton.verilator b/presets/verilog/skeleton.verilator index 972db69d..d1496c1f 100644 --- a/presets/verilog/skeleton.verilator +++ b/presets/verilog/skeleton.verilator @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" module top(clk, reset, hsync, vsync, rgb); diff --git a/presets/verilog/sound_generator.v b/presets/verilog/sound_generator.v index bc907878..1cd34eef 100644 --- a/presets/verilog/sound_generator.v +++ b/presets/verilog/sound_generator.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "lfsr.v" diff --git a/presets/verilog/sprite_bitmap.v b/presets/verilog/sprite_bitmap.v index 64afc424..98c6c0a5 100644 --- a/presets/verilog/sprite_bitmap.v +++ b/presets/verilog/sprite_bitmap.v @@ -1,3 +1,4 @@ + `ifndef SPRITE_BITMAP_H `define SPRITE_BITMAP_H diff --git a/presets/verilog/sprite_renderer.v b/presets/verilog/sprite_renderer.v index b90c1e63..4ef09498 100644 --- a/presets/verilog/sprite_renderer.v +++ b/presets/verilog/sprite_renderer.v @@ -1,3 +1,4 @@ + `ifndef SPRITE_RENDERER_H `define SPRITE_RENDERER_H diff --git a/presets/verilog/sprite_rotation.v b/presets/verilog/sprite_rotation.v index e841f5cc..30a6e3d4 100644 --- a/presets/verilog/sprite_rotation.v +++ b/presets/verilog/sprite_rotation.v @@ -1,3 +1,4 @@ + `ifndef SPRITE_ROTATION_H `define SPRITE_ROTATION_H diff --git a/presets/verilog/starfield.v b/presets/verilog/starfield.v index f9e5b526..d63491d0 100644 --- a/presets/verilog/starfield.v +++ b/presets/verilog/starfield.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "lfsr.v" diff --git a/presets/verilog/tank.v b/presets/verilog/tank.v index 1fbcb905..a2785a5d 100644 --- a/presets/verilog/tank.v +++ b/presets/verilog/tank.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "digits10.v" `include "sprite_rotation.v" diff --git a/presets/verilog/test.asm b/presets/verilog/test.asm index 503d460a..45f77335 100644 --- a/presets/verilog/test.asm +++ b/presets/verilog/test.asm @@ -1,3 +1,4 @@ + .arch femto16 .include "hvsync_generator.v" diff --git a/presets/verilog/test_hvsync.v b/presets/verilog/test_hvsync.v index ee33041d..2c938c90 100644 --- a/presets/verilog/test_hvsync.v +++ b/presets/verilog/test_hvsync.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" module test_hvsync_top(clk, reset, hsync, vsync, rgb); diff --git a/presets/verilog/tile_renderer.v b/presets/verilog/tile_renderer.v index 2e94193a..6d5b65cf 100644 --- a/presets/verilog/tile_renderer.v +++ b/presets/verilog/tile_renderer.v @@ -1,3 +1,4 @@ + `include "hvsync_generator.v" `include "font_cp437_8x8.v" `include "ram.v" diff --git a/presets/vicdual/gfxtest.c b/presets/vicdual/gfxtest.c index c9047c50..277045fb 100644 --- a/presets/vicdual/gfxtest.c +++ b/presets/vicdual/gfxtest.c @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/vicdual/hello.c b/presets/vicdual/hello.c index 6c7d4e7d..c80c8e04 100644 --- a/presets/vicdual/hello.c +++ b/presets/vicdual/hello.c @@ -1,3 +1,4 @@ + #include #include diff --git a/presets/vicdual/minimal.c b/presets/vicdual/minimal.c index a3b8cb1e..4443eaad 100644 --- a/presets/vicdual/minimal.c +++ b/presets/vicdual/minimal.c @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/vicdual/music.c b/presets/vicdual/music.c index b616c46d..9f0d5994 100644 --- a/presets/vicdual/music.c +++ b/presets/vicdual/music.c @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/vicdual/skeleton.sdcc b/presets/vicdual/skeleton.sdcc index 4694abab..48aa343e 100644 --- a/presets/vicdual/skeleton.sdcc +++ b/presets/vicdual/skeleton.sdcc @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/vicdual/snake1.c b/presets/vicdual/snake1.c index b03bc375..bfb200ec 100644 --- a/presets/vicdual/snake1.c +++ b/presets/vicdual/snake1.c @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/presets/vicdual/snake2.c b/presets/vicdual/snake2.c index fce330ef..52956271 100644 --- a/presets/vicdual/snake2.c +++ b/presets/vicdual/snake2.c @@ -1,3 +1,4 @@ + #include typedef unsigned char byte; diff --git a/src/platform/nes.js b/src/platform/nes.js index 9a1ae884..12685e15 100644 --- a/src/platform/nes.js +++ b/src/platform/nes.js @@ -1,17 +1,17 @@ "use strict"; var JSNES_PRESETS = [ - {id:'ex0.asm', name:'Initialization'}, - {id:'ex1.asm', name:'Scrolling Demo'}, - {id:'ex2.asm', name:'Sprite Demo'}, + {id:'ex0.asm', name:'Initialization (ASM)'}, + {id:'ex1.asm', name:'Scrolling Demo (ASM)'}, + {id:'ex2.asm', name:'Sprite Demo (ASM)'}, // {id:'hello.c', name:'C: Hello PPU'}, // {id:'conio.c', name:'C: Hello Console I/O'}, - {id:'siegegame.c', name:'Siege Game (C)'}, - {id:'neslib1.c', name:'Text (C)'}, - {id:'neslib2.c', name:'Sprites (C)'}, - {id:'neslib3.c', name:'Cursor (C)'}, - {id:'neslib4.c', name:'Metasprites (C)'}, - {id:'neslib5.c', name:'RLE Unpack (C)'}, + {id:'neslib1.c', name:'Text'}, + {id:'neslib2.c', name:'Sprites'}, + {id:'neslib3.c', name:'Cursor'}, + {id:'neslib4.c', name:'Metasprites'}, + {id:'neslib5.c', name:'RLE Unpack'}, + {id:'siegegame.c', name:'Siege Game'}, ]; var NES_NESLIB_PRESETS = [ diff --git a/src/ui.ts b/src/ui.ts index d431dcbd..5a5a75f4 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -920,7 +920,7 @@ function startUI(loadplatform : boolean) { // reset file? if (qs['file'] && qs['reset']) { initPlatform(); - store.removeItem(qs['file']); + store.removeItem(qs['fileview'] || qs['file']); qs['reset'] = ''; gotoNewLocation(); } else { diff --git a/tools/checkpresets.py b/tools/checkpresets.py new file mode 100644 index 00000000..262748c9 --- /dev/null +++ b/tools/checkpresets.py @@ -0,0 +1,16 @@ + +import os,sys,codecs + +for root, dirs, files in os.walk("./presets"): + for fn in files: + path = root + '/' + fn + if fn[-1] == '~': + continue + try: + with open(path,'r') as f: + data = f.read() + if data[0] != '\n': + print(path,'no initial newline') + except: + print(path,sys.exc_info()[0]) +