Moved to https://github.com/jblang/SN76489/blob/master/examples/music.pas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SECTION code_clib | |
PUBLIC disz80 | |
PUBLIC _disz80 | |
EXTERN fputc_cons | |
; This code is been found in a ZX Spectrum tool called UTILITY3 v1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 IR = 47104: REM CONTROL REGISTER $B800 | |
20 DR = 47360: REM DATA REGISTER $B900 | |
30 GOSUB 100 | |
40 INPUT "WHAT DO YOU WANT TO PRINT? ";S$ | |
50 GOSUB 200 | |
60 END | |
100 REM INITIALIZE LCD | |
110 FOR I = 1 TO 4 | |
120 POKE IR,56: REM 8-BIT BUS, 5X8 FONT, 2 LINES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Control APA102 LEDs attached to the YM2149 sound chip's | |
; IO port A on pins 0 (data) and 1 (clock) by bit banging a shift register | |
; Yes, I have turned my RC2014 into the world's most Rube Goldbergesque Arduino | |
ymaddr equ 0d8h ; address port on YM2149 | |
ymdata equ 0d0h ; data port on YM2149 | |
mixer equ 7h ; mixer/IO control register | |
iodira equ 40h ; port A direction bit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define bytesPerLine 16 | |
#define dataSize 131072 | |
#define A16 10 | |
#define _CE 11 | |
#define _OE 12 | |
#define _WE 13 | |
void setupPorts() { | |
// Set disable writing and output, enable chip | |
digitalWrite(_WE, HIGH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ram(clk, addr, data_in, data_out, cs, we); | |
parameter ADDR_WIDTH = 11; | |
parameter DATA_WIDTH = 8; | |
parameter INIT_FILE = ""; | |
input clk; | |
input [ADDR_WIDTH-1:0] addr; | |
input [DATA_WIDTH-1:0] data_in; | |
output reg [DATA_WIDTH-1:0] data_out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module cpu_tb; | |
reg clk; | |
reg reset; | |
reg irq; | |
reg nmi; | |
reg rdy; | |
wire [15:0] addr; | |
wire [7:0] cpu_do; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ram(clk, addr, data_in, data_out, cs, we); | |
parameter ADDR_WIDTH = 11; | |
parameter DATA_WIDTH = 8; | |
parameter INIT_FILE = ""; | |
input clk; | |
input [ADDR_WIDTH-1:0] addr; | |
input [DATA_WIDTH-1:0] data_in; | |
output [DATA_WIDTH-1:0] data_out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
leds = $D000 | |
dips = $D001 | |
* = $F000 | |
begin lda dips | |
sta leds | |
jmp begin | |
* = $FFFA |