forked from jamesbowman/gd1-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.fs
82 lines (72 loc) · 2.38 KB
/
main.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
include crossj1.fs
variable filebase
: suffix ( addr u -- addr u ) \ append suffix to basename
0 padc !
filebase @ count pad+
pad+
pad padc @
;
: create-output-file w/o create-file throw to outfile ;
: cbyte s" 0x" type s>d <# # # #> type [char] , emit ;
hex
variable hiaddr
: coderange hiaddr @ 2B00 ;
: dumpall \ dump the target memory in every useful format
hex
\ .lst file is a human-readable disassembly
s" .lst" suffix create-output-file
coderange tuck - 2/ disassemble-block
\ .binbe is a big-endian binary memory dump
s" .binbe" suffix create-output-file
coderange do i t@ dup 8 rshift emit emit 2 +loop
\ .binle is a little-endian binary memory dump
s" .binle" suffix create-output-file
coderange do i t@ dup emit 8 rshift emit 2 +loop
\ .h is a little-endian memory dump of bytes 2B00-2BFF
s" .h" suffix create-output-file
s" static PROGMEM prog_uchar " type
filebase @ count type
s" _code[] = {" type cr
coderange do i t@ dup cbyte 8 rshift cbyte cr 2 +loop
s" };" type cr
;
decimal
: start-microcode
bl parse preserve filebase !
s" marker revert h# 2B02 org" evaluate
coldcross decimal
;
: end-microcode
there hiaddr !
s" h# 2B00 org code 0jump main ubranch end-code revert meta" evaluate
dumpall
s" target" evaluate
;
meta
coldcross
include basewords.fs
target
include hwdefs.fs
\ Build all these microcode files:
include memtest.fs
include helloworld.fs
include flowtest.fs
include setpixel.fs \
include wireframe.fs \ http://excamera.com/sphinx/gameduino/samples/wireframe/index.html
include eraser.fs
include splitscreen.fs \ http://excamera.com/sphinx/gameduino/samples/splitscreen/index.html
include selftest1.fs
include reload.fs
include palcopy.fs
include random.fs \ http://excamera.com/sphinx/gameduino/samples/snow/index.html
include rasterinterrupt.fs
include soundbuffer.fs \ http://excamera.com/sphinx/gameduino/samples/cowbell/index.html
include cold.fs
include testflash.fs
include bgstripes.fs \ http://excamera.com/sphinx/gameduino/samples/bgcolor/index.html
include dna.fs \ http://excamera.com/sphinx/gameduino/demos/dna/index.html
include regressfreq.fs
include showvoices.fs
include spectrum.fs \ http://excamera.com/sphinx/gameduino/demos/spectrum/index.html
include spr512.fs
meta