Browse code

Simplified the file example

neauoire authored on 21/04/2021 18:38:30
Showing 2 changed files
... ...
@@ -32,7 +32,7 @@ else
32 32
 fi
33 33
 
34 34
 echo "Assembling.."
35
-./bin/assembler projects/examples/dev.console.usm bin/boot.rom
35
+./bin/assembler projects/examples/dev.file.usm bin/boot.rom
36 36
 
37 37
 echo "Running.."
38 38
 if [ "${2}" = '--cli' ]; 
... ...
@@ -1,9 +1,6 @@
1 1
 ( Dev/File )
2 2
 
3
-%RTN { JMP2r }
4
-%STEP8 { #0033 SFT2 }
5
-%++ { #01 ADD }
6
-
3
+%8+ { #0008 ADD2 }
7 4
 %MEMORY { #1000 }
8 5
 
9 6
 ( devices )
... ...
@@ -11,8 +8,6 @@
11 8
 |00 @System     [ &vector $2 &pad    $6 &r      $2 &g     $2 &b      $2 ]
12 9
 |10 @Console    [ &pad    $8 &char   $1 &byte   $1 &short $2 &string $2 ]
13 10
 |20 @Screen     [ &vector $2 &width  $2 &height $2 &pad   $2 &x      $2 &y $2 &addr $2 &color $1 ]
14
-|40 @Controller [ &vector $2 &button $1 &key    $1 ]
15
-|60 @Mouse      [ &vector $2 &x $2 &y $2 &state $1 &chord $1 ]
16 11
 |70 @File       [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ]
17 12
 
18 13
 ( variables )
... ...
@@ -24,25 +19,51 @@
24 19
 |0100 ( -> )
25 20
 
26 21
 	( theme )
27
-	#804b .System/r DEO2
28
-	#804b .System/g DEO2
29
-	#e0bb .System/b DEO2
22
+	#0efc .System/r DEO2
23
+	#03cc .System/g DEO2
24
+	#03ac .System/b DEO2
30 25
 
31 26
 	( load file )
32
-	#0100    .File/length DEO2
27
+	#1000    .File/length DEO2
33 28
 	;srcpath   .File/name DEO2
34 29
 	MEMORY     .File/load DEO2
35 30
 
36 31
 	.File/success DEI2 #0000 NEQ2 ;on-success JNZ2
37 32
 
33
+	;failedtxt .Console/string DEO2
34
+
38 35
 BRK
39 36
 
40 37
 @on-success ( -> )
41 38
 	
42
-	;srcpath .Console/string DEO2
43
-	;dstpath .Console/string DEO2
39
+	;successtxt .Console/string DEO2
40
+
41
+	( draw image )
42
+	MEMORY .Screen/addr DEO2
43
+	#0000 #0080
44
+	&ver
45
+		( save ) OVR2 .Screen/y DEO2
46
+		#0000 #0080
47
+		&hor
48
+			( save ) OVR2 .Screen/x DEO2
49
+			( draw ) #41 .Screen/color DEO
50
+			( incr ) .Screen/addr DEI2 #0010 ADD2 .Screen/addr DEO2
51
+			( incr ) SWP2 8+ SWP2
52
+			OVR2 OVR2 LTH2 ,&hor JNZ
53
+		POP2 POP2
54
+		( incr ) SWP2 8+ SWP2
55
+		OVR2 OVR2 LTH2 ,&ver JNZ
56
+	POP2 POP2
57
+
58
+	( save file )
59
+	#1000    .File/length DEO2
60
+	;dstpath   .File/name DEO2
61
+	MEMORY     .File/save DEO2
44 62
 
45 63
 BRK
46 64
 
47
-@srcpath  "README.md $1
48
-@dstpath  "bin/export.md $1
65
+@successtxt "Success! $1
66
+@failedtxt "Failed. $1
67
+
68
+@srcpath    "projects/pictures/ako10x10.chr $1
69
+@dstpath    "bin/image-copy.chr $1