about summary refs log tree commit diff
path: root/src/battle.go
diff options
context:
space:
mode:
authorEmile <git@emile.space>2024-11-09 18:59:34 +0100
committerEmile <git@emile.space>2024-11-09 18:59:34 +0100
commit795ff164d007f730bae2a0dd261ad6e4bdb20b90 (patch)
treea9d6d5e036e8baa75229b740fe070fffb2fec596 /src/battle.go
parent551fa2c7d5f6266153a99c7cfa914cf86a2e7dd1 (diff)
should fix the pc not working fine HEAD main
Diffstat (limited to 'src/battle.go')
-rw-r--r--src/battle.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/battle.go b/src/battle.go
index 3f82cf7..af7043b 100644
--- a/src/battle.go
+++ b/src/battle.go
@@ -1463,8 +1463,6 @@ func battleRunHandler(w http.ResponseWriter, r *http.Request) {
 
 		// TODO(emile): [L] implement some kind of queue
 
-		// TODO(emile): [S] use the information given from the battle, such as the right arch and bits
-
 		rawOutput += "[0x00000000]> # initializing the vm and the stack\n"
 		cmd = "aei"
 		output, _ = r2cmd(r2p1, cmd)
@@ -1552,6 +1550,9 @@ func battleRunHandler(w http.ResponseWriter, r *http.Request) {
 
 			rawOutput += fmt.Sprintf("[0x00000000]> ########################################################################\n")
 
+			rawOutput += "[0x00000000]> # Loading the registers\n"
+			r2cmd(r2p1, runtimeBots[currentBotId].Regs)
+
 			// this is architecture agnostic and just gets the program counter
 			pc, _ := r2cmd(r2p1, "aer~$(arn PC)~[1]")
 
@@ -1569,8 +1570,6 @@ func battleRunHandler(w http.ResponseWriter, r *http.Request) {
 			rawOutput += fmt.Sprintf("[0x00000000]> %s\n%s", cmd, output)
 
 			// load registers
-			rawOutput += "[0x00000000]> # Loading the registers\n"
-			r2cmd(r2p1, runtimeBots[currentBotId].Regs)
 			//  rawOutput += fmt.Sprintf("%+v\n", runtimeBots[currentBotId].Regs)
 
 			//  cmd = "dr"