Skip to content

Commit

Permalink
add sd_card sample
Browse files Browse the repository at this point in the history
  • Loading branch information
yeastplume committed Feb 22, 2020
1 parent be06068 commit 08268c4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion samples/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ run_bas: $(NAME).assembled.bas

all: OBJS_$(NAME)
clean:
rm -rf ./output *.o *.prg *.map *.av *.log *.assembled.bas *.img
rm -rf ./output *.o *.prg *.map *.av *.log *.assembled.bas *.img *.BIN *.meta
10 changes: 8 additions & 2 deletions samples/sd_card/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ project.av: $(RESOURCES)
$(ALOEVERA) -p project.av bitmap init kq5_bmp kq5_screen
$(ALOEVERA) create sd_image kq5.img
$(ALOEVERA) -p project.av asm -s kq5.img -f bin . select -a 0x0000 kq5_bmp KQ5.BIN
$(ALOEVERA) -p project.av asm -f bin . select -a 0x0000 kq5_bmp KQ5.BIN
$(ALOEVERA) -p project.av asm -s kq5.img -f bin . select -a 0x0000 kq5_pal KQ5PAL.BIN
$(ALOEVERA) -p project.av asm -f bin . select -a 0x0000 kq5_bmp KQ5.BIN
$(ALOEVERA) -p project.av asm -f bin . select -a 0x0000 kq5_pal KQ5PAL.BIN

generate_resources: project.av

SD_CARD = -sdcard kq5.img
#SD_CARD = -sdcard kq5.img

generate_basic: generate_resources
cat $(NAME).bas > $(NAME).assembled.bas

$(NAME).assembled.bas: generate_basic

include ../common/Makefile
23 changes: 23 additions & 0 deletions samples/sd_card/sd_card.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
1 REM POKE MODE INTO LAYER 1
2 REM TILED, 4BPP, ON
3 REM IMAGESET ADDRESS $1A800
4 REM TILEMAP ADDRESS $10000
10 VPOKE $F,$2000,$61:VPOKE $F,$2001,$31
11 VPOKE $F,$2002,$00:VPOKE $F,$2003,$40
12 VPOKE $F,$2004,$00:VPOKE $F,$2005,$6A
13 PRINT "POKING PALETTE"
14 REM POKE PALETTE DATA
20 VLOAD "KQ5PAL.BIN",8,$0F,$1000
30 REM POKE MODE
31 VPOKE $F,$2000,$E1:VPOKE $F,$2001,$0
32 VPOKE $F,$2002,$00:VPOKE $F,$2003,$0
33 VPOKE $F,$2004,$00:VPOKE $F,$2005,$0
34 VPOKE $F,$2006,$00:VPOKE $F,$2007,$0
35 VPOKE $F,$0001,$40:VPOKE $F,$0002,$40

36 VLOAD "KQ5PAL.BIN",8,$0F,$1000
37 VLOAD "KQ5.BIN",8,$0,$0000

40 VPOKE $F,$3000,0

1000 REM DATA WILL BE APPENDED HERE
4 changes: 2 additions & 2 deletions src/cmd/asm/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ pub struct AsmSelectArgs {

pub fn asm_select(
g_args: &GlobalArgs,
mut asm_args: AsmArgs,
asm_args: AsmArgs,
args: &AsmSelectArgs,
) -> Result<(), Error> {
let proj = common::load_project(g_args.project_file.clone())?;
let mut line_start = 10000;
asm_args.out_dir = ".".into();
common::create_dir(&asm_args.out_dir)?;
// now look for the ID
if proj.palettes.contains_key(&args.asset_id) {
perform_assemble(
Expand Down

0 comments on commit 08268c4

Please sign in to comment.