Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
remko committed Oct 31, 2023
1 parent a769982 commit bb85181
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
11 changes: 5 additions & 6 deletions scripts/emuwasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,13 @@ function generate() {
}
});

out += ` ));; end
out =
out.trim() +
`))
(global.set $wstp (local.get $wstp))
(global.set $rstp (local.get $rstp)))
(func $reset (export "reset")
(global.set $wstp (i32.const 0x00))
(global.set $rstp (i32.const 0x00))
Expand All @@ -978,10 +979,8 @@ function generate() {
(memory (export "memory") 2)
(global $wstp (mut i32) (i32.const -1))
(global $rstp (mut i32) (i32.const -1))
(start $reset))
(global $wstp (mut i32) (i32.const 0))
(global $rstp (mut i32) (i32.const 0)))
`;
console.log(out.trim());
}
Expand Down
11 changes: 3 additions & 8 deletions src/uxn.wat
Original file line number Diff line number Diff line change
Expand Up @@ -1888,14 +1888,11 @@
(local.set $rstp (i32.and (i32.add (local.get $rstp) (i32.const 254)) (i32.const 0xff)))
(i32.store8 offset=0x10100 (local.get $rstp) (i32.and (local.tee $val (i32.shl (i32.shr_u (local.get $n) (i32.and (local.get $t) (i32.const 0xf))) (i32.shr_u (local.get $t) (i32.const 4)))) (i32.const 0xff)))
(i32.store8 offset=0x10100 (i32.and (i32.add (local.get $rstp) (i32.const 1)) (i32.const 0xff)) (i32.shr_u (local.get $val) (i32.const 8)))
(br $loop)

));; end
(br $loop)))

(global.set $wstp (local.get $wstp))
(global.set $rstp (local.get $rstp)))


(func $reset (export "reset")
(global.set $wstp (i32.const 0x00))
(global.set $rstp (i32.const 0x00))
Expand All @@ -1906,7 +1903,5 @@

(memory (export "memory") 2)

(global $wstp (mut i32) (i32.const -1))
(global $rstp (mut i32) (i32.const -1))

(start $reset))
(global $wstp (mut i32) (i32.const 0))
(global $rstp (mut i32) (i32.const 0)))

0 comments on commit bb85181

Please sign in to comment.