Skip to content

Commit 8a93d6f

Browse files
committed
Integrate Aznable codebase
1 parent 2aab758 commit 8a93d6f

File tree

169 files changed

+17258
-2057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+17258
-2057
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Auto detect text files and perform LF normalization
22
* text=auto
33
# Convert linux scripts to LF permanently
4-
*.sh crlf=input
4+
*.sh text eol=lf
5+
*.define text eol=lf

.gitignore

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,24 @@ verilator/obj_dir/*
4242
verilator/x64/*
4343
verilator/roms/*
4444
verilator/*.hex
45-
src/os.asm
46-
src/os.bin
47-
src/os.lk
48-
src/os.lst
49-
src/os.map
50-
src/os.noi
51-
src/os.sym
45+
rtl/*.hex
5246
.vscode/settings.json
5347
verilator/imgui.ini
5448
verilator/imgui.ini
55-
docs/*
49+
**/.vs/*
50+
**/bin/*
51+
**/obj/*
52+
docs/vids/*
53+
verilator/audio.wav
54+
*.log
55+
**/build/*.sym
56+
**/build/*.rel
57+
**/build/*.lst
58+
**/build/*.map
59+
**/build/*.noi
60+
**/build/*.lk
61+
**/build/*.asm
62+
**/sound/res/*
63+
**/sprites/res/*
64+
**/tilemap/res/*
65+
**/music/res/*

CURRENT_PROJECT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
inputtest

InputTest.qsf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING ON
5050
set_global_assignment -name ALM_REGISTER_PACKING_EFFORT MEDIUM
5151
set_global_assignment -name SEED 1
5252

53-
#set_global_assignment -name VERILOG_MACRO "MISTER_FB=1"
53+
set_global_assignment -name VERILOG_MACRO "MISTER_FB=1"
5454

5555
#enable it only if 8bit indexed mode is used in core
5656
#set_global_assignment -name VERILOG_MACRO "MISTER_FB_PALETTE=1"
@@ -60,6 +60,18 @@ set_global_assignment -name SEED 1
6060
#do not enable DEBUG_NOHDMI in release!
6161
#set_global_assignment -name VERILOG_MACRO "MISTER_DEBUG_NOHDMI=1"
6262

63+
# Aznable specific defines
64+
# ------------------------
65+
#set_global_assignment -name VERILOG_MACRO "DISABLE_CPU=1"
66+
#set_global_assignment -name VERILOG_MACRO "DISABLE_CHARMAP=1"
67+
#set_global_assignment -name VERILOG_MACRO "DISABLE_SPRITES=1"
68+
#set_global_assignment -name VERILOG_MACRO "DISABLE_TILEMAP=1"
69+
#set_global_assignment -name VERILOG_MACRO "DISABLE_MUSIC=1"
70+
#set_global_assignment -name VERILOG_MACRO "DISABLE_SOUND=1"
71+
#set_global_assignment -name VERILOG_MACRO "DISABLE_STARS_2=1"
72+
#set_global_assignment -name VERILOG_MACRO "DISABLE_STARS_3=1"
73+
#set_global_assignment -name VERILOG_MACRO "DEBUG_SPRITE_COLLISION=1"
74+
6375
source sys/sys.tcl
6476
source sys/sys_analog.tcl
6577
source files.qip

InputTest.sv

Lines changed: 73 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Input Test - emu module
33
44
Author: Jim Gregory - https://github.com/JimmyStones/
5-
Version: 1.0
6-
Date: 2021-07-12
5+
Version: 1.1
6+
Date: 2021-12-22
77
88
This program is free software; you can redistribute it and/or modify it
99
under the terms of the GNU General Public License as published by the Free
@@ -29,7 +29,7 @@ module emu
2929
input RESET,
3030

3131
//Must be passed to hps_io module
32-
inout [45:0] HPS_BUS,
32+
inout [47:0] HPS_BUS,
3333

3434
//Base video clock. Usually equals to CLK_SYS.
3535
output CLK_VIDEO,
@@ -180,14 +180,14 @@ assign USER_OUT = '1;
180180
assign {UART_RTS, UART_TXD, UART_DTR} = 0;
181181
assign {SD_SCK, SD_MOSI, SD_CS} = 'Z;
182182
assign {SDRAM_DQ, SDRAM_A, SDRAM_BA, SDRAM_CLK, SDRAM_CKE, SDRAM_DQML, SDRAM_DQMH, SDRAM_nWE, SDRAM_nCAS, SDRAM_nRAS, SDRAM_nCS} = 'Z;
183-
assign {DDRAM_CLK, DDRAM_BURSTCNT, DDRAM_ADDR, DDRAM_DIN, DDRAM_BE, DDRAM_RD, DDRAM_WE} = '0;
183+
assign FB_FORCE_BLANK = 0;
184184
assign VGA_F1 = 0;
185185
assign VGA_SCALER = 0;
186186
assign HDMI_FREEZE = 0;
187-
assign AUDIO_S = 0;
188-
assign AUDIO_L = 0;
189-
assign AUDIO_R = 0;
187+
188+
assign AUDIO_S = 1;
190189
assign AUDIO_MIX = 0;
190+
191191
assign LED_DISK = 0;
192192
assign LED_POWER = 0;
193193
assign BUTTONS = 0;
@@ -203,10 +203,25 @@ assign VIDEO_ARY = (!ar) ? 12'd3 : 12'd0;
203203
localparam CONF_STR = {
204204
"InputTest;;",
205205
"-;",
206+
"O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;",
207+
"OGJ,Analog Video H-Pos,0,-1,-2,-3,-4,-5,-6,-7,8,7,6,5,4,3,2,1;",
208+
"OKN,Analog Video V-Pos,0,-1,-2,-3,-4,-5,-6,-7,8,7,6,5,4,3,2,1;",
206209
"O89,Aspect ratio,Original,Full Screen,[ARC1],[ARC2];",
207210
"-;",
211+
"O6,Rotate video,Off,On;",
212+
"O7,Flip video,Off,On;",
213+
"-;",
214+
"RA,Open menu;",
215+
"-;",
216+
"P1,Pause options;",
217+
"P1OP,Pause when OSD is open,On,Off;",
218+
"P1OQ,Dim video after 10s,On,Off;",
219+
"-;",
208220
"F0,BIN,Load BIOS;",
221+
"F3,BIN,Load Sprite ROM;",
222+
"F4,YM,Load Music (YM5/6);",
209223
"-;",
224+
"R0,Reset;",
210225
"J,A,B,X,Y,L,R,Select,Start;",
211226
"V,v",`BUILD_DATE
212227
};
@@ -287,6 +302,7 @@ hps_io #(.CONF_STR(CONF_STR)) hps_io
287302
.joystick_l_analog_3(joystick_l_analog_3),
288303
.joystick_l_analog_4(joystick_l_analog_4),
289304
.joystick_l_analog_5(joystick_l_analog_5),
305+
290306
.joystick_r_analog_0(joystick_r_analog_0),
291307
.joystick_r_analog_1(joystick_r_analog_1),
292308
.joystick_r_analog_2(joystick_r_analog_2),
@@ -327,55 +343,95 @@ pll pll
327343

328344
/////////////////// CLOCK DIVIDER ////////////////////
329345
wire ce_pix;
346+
wire ce_2;
330347
jtframe_cen24 divider
331348
(
332349
.clk(clk_sys),
333-
.cen6(ce_pix)
350+
.cen6(ce_pix),
351+
.cen2(ce_2)
334352
);
335353

336354
/////////////////// VIDEO ////////////////////
337-
wire hblank, vblank, hs, vs;
355+
wire hblank, vblank, hs, vs, hs_original, vs_original;
338356
wire [7:0] r, g, b;
357+
358+
wire rotate_ccw = status[7];
359+
wire no_rotate = ~status[6];
360+
wire flip = status[7];
361+
screen_rotate screen_rotate (.*);
339362
arcade_video #(320,24) arcade_video
340363
(
341364
.*,
342365
.clk_video(clk_sys),
343-
.RGB_in({r,g,b}),
366+
.RGB_in(rgb_out),
344367
.HBlank(hblank),
345368
.VBlank(vblank),
346369
.HSync(hs),
347370
.VSync(vs),
348371
.fx(status[5:3])
349372
);
350373

374+
// H/V offset
375+
wire [3:0] voffset = status[23:20];
376+
wire [3:0] hoffset = status[19:16];
377+
jtframe_resync jtframe_resync
378+
(
379+
.clk(clk_sys),
380+
.pxl_cen(ce_pix),
381+
.hs_in(hs_original),
382+
.vs_in(vs_original),
383+
.LVBL(~vblank),
384+
.LHBL(~hblank),
385+
.hoffset(hoffset),
386+
.voffset(voffset),
387+
.hs_out(hs),
388+
.vs_out(vs)
389+
);
390+
391+
/////////////////// PAUSE SYSTEM ///////////////////
392+
wire m_pause = joystick_0[8];
393+
wire pause_cpu;
394+
wire [23:0] rgb_out;
395+
pause #(8,8,8,24) pause (
396+
.*,
397+
.user_button(m_pause),
398+
.pause_request(),
399+
.options(~status[26:25])
400+
);
401+
351402
/////////////////// MAIN CORE ////////////////////
352403
wire rom_download = ioctl_download && (ioctl_index < 8'd2);
353404
wire reset = (RESET | status[0] | buttons[1] | rom_download);
354405
assign LED_USER = rom_download;
355406

356407
system system(
357-
.clk_sys(clk_sys),
358-
.ce_pix(ce_pix),
408+
.clk_24(clk_sys),
409+
.ce_6(ce_pix),
410+
.ce_2(ce_2),
359411
.reset(reset),
360-
.VGA_HS(hs),
361-
.VGA_VS(vs),
412+
.pause(pause_cpu),
413+
.menu(status[10] || buttons[1]),
414+
.VGA_HS(hs_original),
415+
.VGA_VS(vs_original),
362416
.VGA_R(r),
363417
.VGA_G(g),
364418
.VGA_B(b),
365419
.VGA_HB(hblank),
366420
.VGA_VB(vblank),
367-
.dn_addr(ioctl_addr[13:0]),
421+
.dn_addr(ioctl_addr[16:0]),
368422
.dn_data(ioctl_dout),
369423
.dn_wr(ioctl_wr),
370424
.dn_index(ioctl_index),
371425
.joystick({joystick_5,joystick_4,joystick_3,joystick_2,joystick_1,joystick_0}),
372426
.analog_l({joystick_l_analog_5,joystick_l_analog_4,joystick_l_analog_3,joystick_l_analog_2,joystick_l_analog_1,joystick_l_analog_0}),
373427
.analog_r({joystick_r_analog_5,joystick_r_analog_4,joystick_r_analog_3,joystick_r_analog_2,joystick_r_analog_1,joystick_r_analog_0}),
374-
.paddle({paddle_5,paddle_4,paddle_3,paddle_2,paddle_1,paddle_0}),
428+
.paddle({paddle_5,paddle_4,paddle_3,paddle_2,paddle_1,paddle_0}),
375429
.spinner({7'b0,spinner_5,7'b0,spinner_4,7'b0,spinner_3,7'b0,spinner_2,7'b0,spinner_1,7'b0,spinner_0}),
376430
.ps2_key(ps2_key),
377431
.ps2_mouse({ps2_mouse_ext,7'b0,ps2_mouse}),
378-
.timestamp(timestamp)
432+
.timestamp(timestamp),
433+
.AUDIO_L(AUDIO_L),
434+
.AUDIO_R(AUDIO_R)
379435
);
380436

381437
endmodule

MiSTer.pf

-1.18 KB
Binary file not shown.

README.MD

Lines changed: 1 addition & 1 deletion

build.sh

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1-
# Make C code
2-
cd src
3-
make clean
1+
# Define current project and other variables
2+
PROJECT=$(cat CURRENT_PROJECT)
3+
CURRENTDIR=$(pwd)
4+
5+
# Compile C code
6+
cd src/$PROJECT
7+
#make clean
48
make all
5-
cd ..
9+
cd $CURRENTDIR
610

7-
# Verilate HDL
11+
# Compile verilator code
812
cd verilator
9-
./verilate.sh
10-
cd ..
13+
./verilate.sh $PROJECT
14+
cd $CURRENTDIR
15+
16+
# Build target locations
17+
TARGETS=( verilator rtl )
1118

12-
# Hexify roms
13-
od -An -t x1 -v src/os.bin > verilator/rom.hex
14-
od -An -t x1 -v src/os.bin > rtl/rom.hex
15-
od -An -t x1 -v PETSCII.pf > verilator/font.hex
16-
od -An -t x1 -v PETSCII.pf > rtl/font.hex
19+
# Hexify rom and font and copy to build targets
20+
for TARGET in "${TARGETS[@]}"; do
21+
od -An -t x1 -v src/$PROJECT/bin/rom.bin > $TARGET/rom.hex
22+
od -An -t x1 -v font.pf > $TARGET/font.hex
23+
done
1724

25+
# Hexify resource binarys and copy to build targets
26+
RESOURCES=( sprite palette music sound tilemap )
27+
for RESOURCE in "${RESOURCES[@]}"; do
28+
if [ -r "resources/$PROJECT/$RESOURCE.bin" ]; then
29+
echo "Updating resources/$PROJECT/$RESOURCE.bin"
30+
for TARGET in "${TARGETS[@]}"; do
31+
od -An -t x1 -v resources/$PROJECT/$RESOURCE.bin > $TARGET/$RESOURCE.hex
32+
done
33+
fi
34+
done

clean.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Make C code
2+
cd src
3+
make clean
4+
cd ..

files.qip

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@ set_global_assignment -name QIP_FILE rtl/tv80/TV80.qip
33
set_global_assignment -name CDF_FILE jtag.cdf
44
set_global_assignment -name QIP_FILE sys/sys.qip
55
set_global_assignment -name VERILOG_FILE rtl/JTFRAME/jtframe_vtimer.v
6+
set_global_assignment -name VERILOG_FILE rtl/JTFRAME/jtframe_resync.v
67
set_global_assignment -name VERILOG_FILE rtl/JTFRAME/jtframe_cen24.v
8+
set_global_assignment -name QIP_FILE rtl/jt49/jt49.qip
9+
set_global_assignment -name QIP_FILE rtl/jt5205/jt5205.qip
10+
set_global_assignment -name VERILOG_FILE rtl/charmap.v
11+
set_global_assignment -name VERILOG_FILE rtl/sprite_engine.v
12+
set_global_assignment -name VERILOG_FILE rtl/tilemap.v
13+
set_global_assignment -name VERILOG_FILE rtl/lfsr.v
14+
set_global_assignment -name VERILOG_FILE rtl/starfield.v
15+
set_global_assignment -name VERILOG_FILE rtl/music.v
16+
set_global_assignment -name VERILOG_FILE rtl/sound.v
17+
set_global_assignment -name VERILOG_FILE rtl/generic_timer.v
718
set_global_assignment -name VERILOG_FILE rtl/system.v
819
set_global_assignment -name VERILOG_FILE rtl/dpram.v
9-
set_global_assignment -name VERILOG_FILE rtl/spram.v
20+
set_global_assignment -name VERILOG_FILE rtl/dpram_w1r2.v
21+
set_global_assignment -name VERILOG_FILE rtl/spram.v
22+
set_global_assignment -name VERILOG_FILE rtl/pause.v

PETSCII.pf renamed to font.pf

File renamed without changes.

gfx/images/01_asteroids-4_2#1.png

587 Bytes

gfx/images/02_player1-4_2#2.png

395 Bytes

gfx/images/03_explosions-4_2#2.png

502 Bytes

gfx/images/04_pickups-3_2#2.png

380 Bytes

gfx/images/05_logo-8_2#3.png

481 Bytes

gfx/palette.bin

256 Bytes
Binary file not shown.

gfx/sprite.bin

11.5 KB
Binary file not shown.

prereq.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/inputtest/music.bin

64 KB
Binary file not shown.
12.1 KB
Binary file not shown.
32.1 KB
Binary file not shown.

resources/inputtest/music/tracks.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
main_theme.ym#maintheme
2+
game_over.ym#gameover

resources/inputtest/palette.bin

256 Bytes
Binary file not shown.

resources/inputtest/sound.bin

11.3 KB
Binary file not shown.

resources/inputtest/sound/alarm.vox

908 Bytes
Binary file not shown.

resources/inputtest/sound/alarm.wav

19.9 KB
Binary file not shown.
4.77 KB
Binary file not shown.
105 KB
Binary file not shown.

resources/inputtest/sound/newtype.vox

5.43 KB
Binary file not shown.

resources/inputtest/sound/newtype.wav

120 KB
Binary file not shown.

resources/inputtest/sound/pickup.vox

187 Bytes
Binary file not shown.

resources/inputtest/sound/pickup.wav

4.27 KB
Binary file not shown.

resources/inputtest/sound/samples.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
explosion#player_explode
2+
pickup#pickup_collect
3+
alarm#alarm
4+
newtype#newtype

resources/inputtest/sprite.bin

13.5 KB
Binary file not shown.
587 Bytes
502 Bytes
425 Bytes
365 Bytes
356 Bytes
205 Bytes
602 Bytes
158 Bytes

resources/inputtest/tilemap.bin

30 KB
Binary file not shown.
1.72 KB

0 commit comments

Comments
 (0)