-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92d72ec
commit 42891b0
Showing
11 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Common emulator flags and locations | ||
# Ensure the emulator and rom locations are for your system | ||
|
||
ALOEVERA = "../../../target/debug/aloevera" | ||
C128_EMU = x128 | ||
C128_EMU_FLAGS = | ||
#DEBUG = -debug 9000 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Common makefile include for examples | ||
# Don't run make from this directory, run | ||
# from subdirs | ||
|
||
C128_RUN = $(C128_EMU) $(C128_EMU_FLAGS) $(DEBUG) | ||
|
||
# Ensure ld65 and ca65 are on your path | ||
# Assembly flags | ||
CPU = 6502 | ||
AS = ca65 | ||
# Add defines, if needed (-DWHATEVER) | ||
ASFLAGS = -g --cpu $(CPU) | ||
|
||
# Linker flags | ||
LD = ld65 | ||
#Define segments and files in config.cfg | ||
LDFLAGS = -C ../common/c128-asm.cfg | ||
|
||
OBJS_$(NAME): $(NAME).o | ||
$(LD) $(LDFLAGS) -o $(NAME).prg -m $(NAME).map $(NAME).o | ||
|
||
$(NAME).o: project.av $(NAME).s | ||
$(AS) $(ASFLAGS) $(NAME).s | ||
|
||
run_fresh: | ||
$(C128_RUN) | ||
|
||
run_asm: OBJS_$(NAME) | ||
$(C128_RUN) -autostart $(NAME).prg | ||
|
||
run_bas: $(NAME).assembled.bas | ||
$(C128_RUN) -bas $(NAME).assembled.bas | ||
|
||
all: OBJS_$(NAME) | ||
clean: | ||
rm -rf ./output *.o *.prg *.map *.av *.log *.assembled.bas *.img *.BIN *.meta |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FEATURES { | ||
STARTADDRESS: default = $1C00; | ||
} | ||
MEMORY { | ||
ZP: file = "", start = $0002, size = $00FE, define = yes; | ||
LOADADDR: file = %O, start = %S - 2, size = $0002; | ||
MAIN: file = %O, start = %S, size = $D000 - %S; | ||
} | ||
SEGMENTS { | ||
ZEROPAGE: load = ZP, type = zp, optional = yes; | ||
LOADADDR: load = LOADADDR, type = ro; | ||
EXEHDR: load = MAIN, type = ro, optional = yes; | ||
CODE: load = MAIN, type = rw; | ||
RODATA: load = MAIN, type = ro, optional = yes; | ||
DATA: load = MAIN, type = rw, optional = yes; | ||
BSS: load = MAIN, type = bss, optional = yes, define = yes; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
;Basic Header | ||
.segment "LOADADDR" | ||
.word $1C01 | ||
|
||
.segment "EXEHDR" | ||
.word next, 10 | ||
.byte $9e, "7188", 0, 0 | ||
.word 0, 0, 0 | ||
next: .word 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
; adds a constant to 16 bit value | ||
; stored at addr | ||
.macro add_constant_16 addr, constant | ||
clc | ||
lda addr | ||
adc #<constant | ||
sta addr | ||
lda addr + 1 | ||
adc #>constant | ||
sta addr + 1 | ||
.endmacro | ||
|
||
; loop until value stored in addr equals constant | ||
.macro loop_till_eq_16 addr, constant, loop_label | ||
lda addr+1 | ||
cmp #>constant ;loop until 512 reached | ||
bne loop_label | ||
lda addr | ||
cmp #<constant | ||
bne loop_label | ||
.endmacro | ||
|
||
; set a 16 bit constant in addr | ||
.macro set_const_16 addr, constant | ||
lda #<constant | ||
sta addr | ||
lda #>constant | ||
sta addr+1 | ||
.endmacro | ||
|
||
VERA_ADDR_LO = $9F20 | ||
VERA_ADDR_MID = VERA_ADDR_LO + 1; | ||
VERA_ADDR_HI = VERA_ADDR_LO + 2; | ||
VERA_DATA0 = VERA_ADDR_LO + 3; | ||
VERA_DATA1 = VERA_ADDR_LO + 4; | ||
|
||
.macro v_address_set addr, stride | ||
lda #<(addr >> 16) | stride << 4 | ||
sta VERA_ADDR_HI | ||
lda #<(addr >> 8) | ||
sta VERA_ADDR_MID | ||
lda #<(addr) | ||
sta VERA_ADDR_LO | ||
.endmacro | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
include ../Makefile.vars | ||
NAME = p128 | ||
|
||
project.av: p128-ref-template.png | ||
$(ALOEVERA) create project project.av | ||
$(ALOEVERA) -p project.av palette import cbm_palette p128-ref-template-short.png | ||
$(ALOEVERA) -p project.av imageset import -k test_set_1 4 8 p128-ref-template-short.png | ||
$(ALOEVERA) -p project.av imageset format -v test_set_1 cbm_palette 4 | ||
$(ALOEVERA) -p project.av asm -f ca65 ./output/ all | ||
$(ALOEVERA) -p project.av asm -f bin ./output/ all | ||
|
||
generate_resources: project.av | ||
|
||
generate_basic: generate_resources | ||
cat $(NAME).bas > $(NAME).assembled.bas | ||
|
||
$(NAME).assembled.bas: generate_basic | ||
|
||
include ../common/Makefile |
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.include "../common/header.inc" | ||
|
||
VIC_BMP_START_ADDR = $2000 | ||
|
||
.code | ||
jmp start | ||
|
||
.proc set_mode | ||
lda #$3b | ||
sta $d011 | ||
lda #$18 | ||
sta $d016 | ||
rts | ||
.endproc | ||
|
||
.proc load_tile | ||
lda imageset | ||
sta VIC_BMP_START_ADDR | ||
rts | ||
.endproc | ||
|
||
start: | ||
jsr set_mode | ||
jsr load_tile | ||
rts | ||
|
||
.segment "RODATA" | ||
imageset: | ||
.include "output/imagesets/test_set_1.ca65.inc" |