Skip to content

Commit 2cbf85d

Browse files
committed
Calculate memory position based on cpu position instead of absolute coordinates
1 parent e8be068 commit 2cbf85d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/config.mlog

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# per-world config options
22
set IPT 500000
3-
set MEMORY_X 1 # bottom left memory proc x
4-
set MEMORY_Y 1 # bottom left memory proc y
3+
set MEMORY_X_OFFSET -3 # x offset from cpu of bottom left memory proc
4+
set MEMORY_Y_OFFSET -130 # y offset from cpu of bottom left memory proc
55
set MEMORY_WIDTH 128 # physical width of the memory procs
66
set ROM_SIZE 0x1000000 # total rom size in bytes (rx); also total decoded size in variables
77
set RAM_SIZE 0x3000000 # total ram size in bytes (rw)

src/main.mlog

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ reset:
2121

2222
# load config
2323
read IPT CONFIG "IPT"
24-
read MEMORY_X CONFIG "MEMORY_X"
25-
read MEMORY_Y CONFIG "MEMORY_Y"
24+
read MEMORY_X_OFFSET CONFIG "MEMORY_X_OFFSET"
25+
read MEMORY_Y_OFFSET CONFIG "MEMORY_Y_OFFSET"
2626
read MEMORY_WIDTH CONFIG "MEMORY_WIDTH"
2727
read ROM_SIZE CONFIG "ROM_SIZE"
2828
read RAM_SIZE CONFIG "RAM_SIZE"
2929

30+
op add MEMORY_X MEMORY_X_OFFSET @thisx
31+
op add MEMORY_Y MEMORY_Y_OFFSET @thisy
32+
3033
set ROM_START 0x0 # inclusive
3134
op add ROM_END ROM_START ROM_SIZE # exclusive
3235

0 commit comments

Comments
 (0)