1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-13 09:29:35 +00:00

make sure all presets start with a blank line, looks nicer (tools/checkpresets.py); updated nes

This commit is contained in:
Steven Hugg 2018-08-13 18:17:36 -04:00
parent 690b3ac013
commit 4a82d341bc
111 changed files with 248 additions and 247 deletions

View File

@ -48,6 +48,7 @@ TODO:
- how to revert included files? - how to revert included files?
- go to error in include files - go to error in include files
- BOM in upload/download? - BOM in upload/download?
- find version of neslib.h compatible with cc65
FYI: Image links for the books on http://8bitworkshop.com/ are broken 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? 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?

View File

@ -22,6 +22,7 @@
"test": "npm run test-node", "test": "npm run test-node",
"test-one": "mocha --recursive --timeout 60000", "test-one": "mocha --recursive --timeout 60000",
"test-node": "mocha --recursive --timeout 60000 test/cli", "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" "test-profile": "mocha --recursive --timeout 60000 --prof test/cli"
}, },
"repository": { "repository": {

View File

@ -1,3 +1,4 @@
; Conway II ; Conway II
; Lee W. Fastenau ; Lee W. Fastenau
; thelbane@gmail.com ; thelbane@gmail.com

View File

@ -1,4 +1,4 @@

#include <string.h> #include <string.h>
#include <conio.h> #include <conio.h>
#include <apple2.h> #include <apple2.h>

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
seg program seg program
org $803 org $803

View File

@ -1,3 +1,4 @@
/*****************************************************************************\ /*****************************************************************************\
** mandelbrot sample program for cc65. ** ** mandelbrot sample program for cc65. **
** ** ** **

View File

@ -139,7 +139,7 @@ byte ai_try_dir(Player* p, dir_t dir, byte shift) {
dir &= 3; dir &= 3;
x = p->x + (DIR_X[dir] << shift); x = p->x + (DIR_X[dir] << shift);
y = p->y + (DIR_Y[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; p->dir = dir;
return 1; return 1;
} else { } else {
@ -197,7 +197,7 @@ void declare_winner(byte winner) {
cputsxy(12,10,"WINNER:"); cputsxy(12,10,"WINNER:");
cputsxy(12,13,"PLAYER "); cputsxy(12,13,"PLAYER ");
cputcxy(12+7, 13, '1'+winner); cputcxy(12+7, 13, '1'+winner);
delay(75); delay(200);
gameover = 1; gameover = 1;
} }

View File

@ -1,55 +1,41 @@
/* /*
** Calculate all primes up to a specific number. ** Calculate all primes up to a specific number.
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <time.h> #include <time.h>
#include <conio.h> #include <conio.h>
/* Workaround missing clock stuff */ /* Workaround missing clock stuff */
#ifdef __APPLE2__ #ifdef __APPLE2__
# define clock() 0 # define clock() 0
# define CLOCKS_PER_SEC 1 # define CLOCKS_PER_SEC 1
#endif #endif
/*****************************************************************************/ /*****************************************************************************/
/* Data */ /* Data */
/*****************************************************************************/ /*****************************************************************************/
#define COUNT 4096 /* Up to what number? */ #define COUNT 4096 /* Up to what number? */
#define SQRT_COUNT 64 /* Sqrt of COUNT */ #define SQRT_COUNT 64 /* Sqrt of COUNT */
static unsigned char Sieve[COUNT]; static unsigned char Sieve[COUNT];
/*****************************************************************************/ /*****************************************************************************/
/* Code */ /* Code */
/*****************************************************************************/ /*****************************************************************************/
#pragma static-locals(1); #pragma static-locals(1);
static char ReadUpperKey (void) static char ReadUpperKey (void)
/* Read a key from console, convert to upper case and return */ /* Read a key from console, convert to upper case and return */
{ {
return toupper (cgetc ()); return toupper (cgetc ());
} }
int main (void) int main (void)
{ {
/* Clock variable */ /* Clock variable */
@ -118,4 +104,3 @@ int main (void)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -1,3 +1,4 @@
; From: http://www.deater.net/weave/vmwprod/tb1/tb_6502.html ; From: http://www.deater.net/weave/vmwprod/tb1/tb_6502.html
.segment "INIT" .segment "INIT"

View File

@ -1,3 +1,4 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <cc65.h> #include <cc65.h>
@ -6,8 +7,6 @@
#include <modload.h> #include <modload.h>
#include <tgi.h> #include <tgi.h>
#ifndef DYN_DRV #ifndef DYN_DRV
# define DYN_DRV 0 # define DYN_DRV 0
#endif #endif
@ -15,26 +14,19 @@
#define COLOR_BACK TGI_COLOR_BLACK #define COLOR_BACK TGI_COLOR_BLACK
#define COLOR_FORE TGI_COLOR_WHITE #define COLOR_FORE TGI_COLOR_WHITE
/*****************************************************************************/ /*****************************************************************************/
/* Data */ /* Data */
/*****************************************************************************/ /*****************************************************************************/
/* Driver stuff */ /* Driver stuff */
static unsigned MaxX; static unsigned MaxX;
static unsigned MaxY; static unsigned MaxY;
static unsigned AspectRatio; static unsigned AspectRatio;
/*****************************************************************************/ /*****************************************************************************/
/* Code */ /* Code */
/*****************************************************************************/ /*****************************************************************************/
static void CheckError (const char* S) static void CheckError (const char* S)
{ {
unsigned char Error = tgi_geterror (); unsigned char Error = tgi_geterror ();
@ -47,8 +39,6 @@ static void CheckError (const char* S)
} }
} }
#if DYN_DRV #if DYN_DRV
static void DoWarning (void) static void DoWarning (void)
/* Warn the user that the dynamic TGI driver is needed for this program */ /* Warn the user that the dynamic TGI driver is needed for this program */
@ -63,8 +53,6 @@ static void DoWarning (void)
} }
#endif #endif
static void DoCircles (void) static void DoCircles (void)
{ {
static const unsigned char Palette[2] = { TGI_COLOR_WHITE, TGI_COLOR_ORANGE }; static const unsigned char Palette[2] = { TGI_COLOR_WHITE, TGI_COLOR_ORANGE };

View File

@ -1,3 +1,4 @@
; Atari 5200 "Hello World" sample code ; Atari 5200 "Hello World" sample code
; Written by Daniel Boris (dboris@comcast.net) ; Written by Daniel Boris (dboris@comcast.net)
; ;

View File

@ -1,3 +1,4 @@
; Atari 5200 "Hello World" sample code ; Atari 5200 "Hello World" sample code
; Written by Daniel Boris (dboris@comcast.net) ; Written by Daniel Boris (dboris@comcast.net)
; ;

View File

@ -1,3 +1,4 @@
#ifndef _CV_COMMON_H #ifndef _CV_COMMON_H
#define _CV_COMMON_H #define _CV_COMMON_H

View File

@ -1,3 +1,4 @@
#include <stdint.h> #include <stdint.h>
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 }; 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 };

View File

@ -1,3 +1,4 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <cv.h> #include <cv.h>

View File

@ -1,3 +1,4 @@
#include <string.h> #include <string.h>
typedef unsigned char byte; typedef unsigned char byte;

View File

@ -1,3 +1,4 @@
#include <string.h> #include <string.h>
typedef unsigned char byte; typedef unsigned char byte;

View File

@ -1,3 +1,4 @@
#include <string.h> #include <string.h>
typedef unsigned char byte; typedef unsigned char byte;

View File

@ -1,3 +1,4 @@
#include "neslib.h" #include "neslib.h"
//#define DEBUG //#define DEBUG

View File

@ -1,3 +1,4 @@
//this example shows how to set up a palette and use 8x8 HW sprites //this example shows how to set up a palette and use 8x8 HW sprites
//also shows how fast (or slow) C code is //also shows how fast (or slow) C code is

View File

@ -1,3 +1,4 @@
//this example shows how to set up a palette and use 8x8 HW sprites //this example shows how to set up a palette and use 8x8 HW sprites
//also shows how fast (or slow) C code is //also shows how fast (or slow) C code is

View File

@ -1,4 +1,5 @@
#include "neslib.h"
#include "neslib.h"
//#define DEBUG //#define DEBUG
#define HAS_DEBUGGER #define HAS_DEBUGGER

View File

@ -1,103 +1,46 @@
;;;;; CONSTANTS include "nesdefs.asm"
PPU_CTRL equ $2000 ;;;;; VARIABLES
PPU_MASK equ $2001
PPU_STATUS equ $2002
PPU_SCROLL equ $2005
PPU_ADDR equ $2006
PPU_DATA equ $2007
DMC_FREQ equ $4010
;;;;; CARTRIDGE FILE HEADER seg.u RAM
org $0
processor 6502 ;;;;; NES CARTRIDGE HEADER
seg Header
org $7FF0
NES_MAPPER equ 0 ;mapper number NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical
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
.byte $4e,$45,$53,$1a ; header ;;;;; START OF CODE
.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
;;;;; 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 lda #$3f ; $3F -> A register
org $8000 ldy #$00 ; $00 -> Y register
start: sta PPU_ADDR ; write high byte first
_exit: sty PPU_ADDR ; $3F00 -> PPU address
sei ;disable IRQs lda #$1c ; $1C = light blue color
cld ;decimal mode not supported sta PPU_DATA ; $1C -> PPU data
ldx #$ff lda #CTRL_NMI
txs ;set up stack pointer sta PPU_CTRL ; enable NMI
inx ;increment X to 0 lda #MASK_COLOR
stx PPU_MASK ;disable rendering sta PPU_MASK ; enable 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
.endless .endless
jmp .endless ;endless loop jmp .endless ; endless loop
;;;;; SUBROUTINES ;;;;; COMMON SUBROUTINES
; wait for VSYNC to start include "nesppu.asm"
WaitSyncSafe: subroutine
bit PPU_STATUS
WaitSync:
bit PPU_STATUS
bpl WaitSync
rts
;;;;; INTERRUPT HANDLERS ;;;;; INTERRUPT HANDLERS
nmi: NMIHandler:
irq:
rti rti
;;;;; CPU VECTORS ;;;;; CPU VECTORS
org $fffa NES_VECTORS
.word nmi ;$fffa vblank nmi
.word start ;$fffc reset
.word irq ;$fffe irq / brk

View File

@ -1,121 +1,37 @@
;;;;; CONSTANTS include "nesdefs.asm"
PPU_CTRL equ $2000 ;;;;; VARIABLES
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
;;;;; ZERO-PAGE VARIABLES seg.u RAM
seg.u ZPVars
org $0 org $0
ScrollPos byte ; used during NMI ScrollPos byte ; used during NMI
Rand byte
;;;;; CARTRIDGE FILE HEADER ;;;;; NES CARTRIDGE HEADER
NES_MAP_HORIZ equ 0 NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical
NES_MAP_VERT equ 1
NES_MAP_QUAD equ 8
MAC NES_HEADER ;;;;; START OF CODE
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
NES_HEADER 0,2,1,1 ; mapper 0, 2 PRGs, 1 CHR, vertical Start:
NES_INIT ; set up stack pointer, turn off PPU
start: jsr WaitSync ; wait for VSYNC
_exit: jsr ClearRAM ; clear RAM
NES_INIT ; set up stack pointer, turn off PPU jsr SetPalette ; set palette colors
jsr WaitSync jsr FillVRAM ; set PPU video RAM
jsr WaitSync jsr WaitSync ; wait for VSYNC (and PPU warmup)
jsr ClearRAM
jsr WaitSync ;wait for VSYNC
jsr SetPalette ;set colors
jsr FillVRAM ;set PPU RAM
jsr WaitSync ;wait for VSYNC (and PPU warmup)
lda #0 lda #0
sta PPU_ADDR sta PPU_ADDR
sta PPU_ADDR ;PPU addr = 0 sta PPU_ADDR ; PPU addr = $0000
sta PPU_SCROLL sta PPU_SCROLL
sta PPU_SCROLL ;scroll = 0 sta PPU_SCROLL ; scroll = $0000
lda #$90 lda #$90
sta PPU_CTRL ;enable NMI sta PPU_CTRL ; enable NMI
lda #$1e lda #$1e
sta PPU_MASK ;enable rendering sta PPU_MASK ; enable rendering
.endless .endless
jmp .endless ;endless loop 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
; fill video RAM ; fill video RAM
FillVRAM: subroutine FillVRAM: subroutine
@ -133,41 +49,59 @@ FillVRAM: subroutine
bne .loop bne .loop
rts rts
; wait for VSYNC to start ; set palette colors
WaitSync: SetPalette: subroutine
bit PPU_STATUS ldy #$00
bpl WaitSync lda #$3f
sta PPU_ADDR
sty PPU_ADDR
ldx #32
.loop:
lda Palette,y
sta PPU_DATA
iny
dex
bne .loop
rts rts
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
;;;;; INTERRUPT HANDLERS ;;;;; INTERRUPT HANDLERS
nmi: NMIHandler:
irq:
; save registers ; save registers
pha ; save A pha ; save A
; update scroll position ; update scroll position (must be done after VRAM updates)
inc ScrollPos inc ScrollPos
lda ScrollPos lda ScrollPos
sta PPU_SCROLL sta PPU_SCROLL
lda #0
sta PPU_SCROLL sta PPU_SCROLL
; TODO: write high bits to PPUCTRL
lda ScrollPos
and #0
ora #$90 ; enable NMI
sta PPU_CTRL
; reload registers ; reload registers
pla ; reload A pla ; reload A
rti rti
;;;;; CONSTANT DATA ;;;;; CONSTANT DATA
align $100
Palette: Palette:
hex 1f001020 ; black, gray, lt gray, white hex 1f ;background
TextString: hex 09091900 ;bg0
byte "HELLO WORLD!" hex 09091900 ;bg1
byte 0 hex 09091900 ;bg2
hex 09091900 ;bg3
;;;;; CPU VECTORS ;;;;; CPU VECTORS
org $fffa NES_VECTORS
.word nmi ;$fffa vblank nmi
.word start ;$fffc reset
.word irq ;$fffe irq / brk
;;;;; TILE SETS ;;;;; TILE SETS

View File

@ -1,9 +1,9 @@
include "nesdefs.asm" include "nesdefs.asm"
;;;;; ZERO-PAGE VARIABLES ;;;;; VARIABLES
seg.u Zeropage seg.u RAM
org $0 org $0
ScrollPos byte ; used during NMI ScrollPos byte ; used during NMI
@ -12,8 +12,12 @@ Temp1 byte
SpriteBuf equ $200 SpriteBuf equ $200
;;;;; NES CARTRIDGE HEADER
NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical
;;;;; START OF CODE
Start: Start:
NES_INIT ; set up stack pointer, turn off PPU NES_INIT ; set up stack pointer, turn off PPU
jsr WaitSync jsr WaitSync

View File

@ -1,4 +1,4 @@

include "nesdefs.asm" include "nesdefs.asm"
;;;;; ZERO-PAGE VARIABLES ;;;;; ZERO-PAGE VARIABLES

View File

@ -28,6 +28,38 @@ OAM_DMA = $4014
; OAM local RAM copy goes from $0200-$02FF: ; OAM local RAM copy goes from $0200-$02FF:
OAM_RAM = $0200 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 ;;;;; CARTRIDGE FILE HEADER

View File

@ -1,3 +1,4 @@
//this example shows how to set up a palette and use 8x8 HW sprites //this example shows how to set up a palette and use 8x8 HW sprites
//also shows how fast (or slow) C code is //also shows how fast (or slow) C code is

View File

@ -1,3 +1,4 @@
//this example shows how to set up a palette and use 8x8 HW sprites //this example shows how to set up a palette and use 8x8 HW sprites
//also shows how fast (or slow) C code is //also shows how fast (or slow) C code is

View File

@ -1,3 +1,4 @@
;;;;; SUBROUTINES ;;;;; SUBROUTINES
ClearRAM: subroutine ClearRAM: subroutine

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Playing music on the Atari VCS can be challenging since ;; Playing music on the Atari VCS can be challenging since

View File

@ -1,3 +1,4 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Playing music on the Atari VCS can be challenging since ;; Playing music on the Atari VCS can be challenging since

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
; Assembler should use basic 6502 instructions ; Assembler should use basic 6502 instructions
processor 6502 processor 6502

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
processor 6502 processor 6502
include "vcs.h" include "vcs.h"
include "macro.h" include "macro.h"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
/* /*

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
module ball_absolute_top(clk, reset, hsync, vsync, rgb); module ball_absolute_top(clk, reset, hsync, vsync, rgb);

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "digits10.v" `include "digits10.v"
`include "scoreboard.v" `include "scoreboard.v"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
module ball_slip_counter_top(clk, reset, hsync, vsync, rgb); module ball_slip_counter_top(clk, reset, hsync, vsync, rgb);

View File

@ -1,3 +1,4 @@
module clock_divider( module clock_divider(
input clk, input clk,
input reset, input reset,

View File

@ -1,3 +1,4 @@
`ifndef CPU16_H `ifndef CPU16_H
`define CPU16_H `define CPU16_H

View File

@ -1,3 +1,4 @@
`ifndef ALU_H `ifndef ALU_H
`define ALU_H `define ALU_H

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "font_cp437_8x8.v" `include "font_cp437_8x8.v"
`include "ram.v" `include "ram.v"

View File

@ -1,3 +1,4 @@
`ifndef DIGITS10_H `ifndef DIGITS10_H
`define DIGITS10_H `define DIGITS10_H

View File

@ -1,3 +1,4 @@
; Architecture file for the FEMTO-8 ; Architecture file for the FEMTO-8
; default output format is a memory initialization file ; default output format is a memory initialization file

View File

@ -1,3 +1,4 @@
{ {
"name":"femto16", "name":"femto16",
"width":16, "width":16,

View File

@ -1,3 +1,4 @@
; Architecture file for the FEMTO-8 ; Architecture file for the FEMTO-8
; default output format is a memory initialization file ; default output format is a memory initialization file

View File

@ -1,3 +1,4 @@
{ {
"name":"femto8", "name":"femto8",
"vars":{ "vars":{

View File

@ -1,3 +1,4 @@
`ifndef FONT_CP437_H `ifndef FONT_CP437_H
`define FONT_CP437_H `define FONT_CP437_H

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "sprite_bitmap.v" `include "sprite_bitmap.v"
`include "sprite_renderer.v" `include "sprite_renderer.v"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "cpu16.v" `include "cpu16.v"

View File

@ -1,3 +1,4 @@
module gates(clk, out_not, out_and, out_or, out_xor, in); module gates(clk, out_not, out_and, out_or, out_xor, in);
input clk; input clk;

View File

@ -1,3 +1,4 @@
`ifndef HVSYNC_GENERATOR_H `ifndef HVSYNC_GENERATOR_H
`define HVSYNC_GENERATOR_H `define HVSYNC_GENERATOR_H

View File

@ -1,3 +1,4 @@
`ifndef LFSR_V `ifndef LFSR_V
`define LFSR_V `define LFSR_V

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
module sound_psg(clk, reset, out, reg_sel, reg_data, reg_write); module sound_psg(clk, reset, out, reg_sel, reg_data, reg_write);

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
module paddles_top(clk, reset, hsync, vsync, hpaddle, vpaddle, rgb); module paddles_top(clk, reset, hsync, vsync, hpaddle, vpaddle, rgb);

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "sprite_bitmap.v" `include "sprite_bitmap.v"
`include "sprite_renderer.v" `include "sprite_renderer.v"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "sprite_bitmap.v" `include "sprite_bitmap.v"
`include "sprite_renderer.v" `include "sprite_renderer.v"

View File

@ -1,3 +1,4 @@
`ifndef RAM_H `ifndef RAM_H
`define RAM_H `define RAM_H

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "digits10.v" `include "digits10.v"
`include "ram.v" `include "ram.v"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "digits10.v" `include "digits10.v"

View File

@ -1,3 +1,4 @@
`ifndef SCOREBOARD_H `ifndef SCOREBOARD_H
`define SCOREBOARD_H `define SCOREBOARD_H

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "cpu8.v" `include "cpu8.v"
`include "cpu16.v" `include "cpu16.v"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
module top(clk, reset, hsync, vsync, rgb); module top(clk, reset, hsync, vsync, rgb);

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "lfsr.v" `include "lfsr.v"

View File

@ -1,3 +1,4 @@
`ifndef SPRITE_BITMAP_H `ifndef SPRITE_BITMAP_H
`define SPRITE_BITMAP_H `define SPRITE_BITMAP_H

View File

@ -1,3 +1,4 @@
`ifndef SPRITE_RENDERER_H `ifndef SPRITE_RENDERER_H
`define SPRITE_RENDERER_H `define SPRITE_RENDERER_H

View File

@ -1,3 +1,4 @@
`ifndef SPRITE_ROTATION_H `ifndef SPRITE_ROTATION_H
`define SPRITE_ROTATION_H `define SPRITE_ROTATION_H

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "lfsr.v" `include "lfsr.v"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
`include "digits10.v" `include "digits10.v"
`include "sprite_rotation.v" `include "sprite_rotation.v"

View File

@ -1,3 +1,4 @@
.arch femto16 .arch femto16
.include "hvsync_generator.v" .include "hvsync_generator.v"

View File

@ -1,3 +1,4 @@
`include "hvsync_generator.v" `include "hvsync_generator.v"
module test_hvsync_top(clk, reset, hsync, vsync, rgb); module test_hvsync_top(clk, reset, hsync, vsync, rgb);

Some files were not shown because too many files have changed in this diff Show More