aboutsummaryrefslogtreecommitdiffstats
path: root/src/programs.asm
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-17 01:31:38 +0200
committeruser <user@clank>2026-07-17 01:31:38 +0200
commit62171c761c72f7bc515b20361d043bfd239f71c9 (patch)
tree4a3f1046403cd58177c4d9fa64d4af8ca066cac2 /src/programs.asm
parentnet: SLIP framing over the link port + a host gateway (echo round-trip) (diff)
downloadgbos-62171c761c72f7bc515b20361d043bfd239f71c9.tar.gz
gbos-62171c761c72f7bc515b20361d043bfd239f71c9.tar.xz
gbos-62171c761c72f7bc515b20361d043bfd239f71c9.zip
net: wget - real HTTP over the link port via the gateway
Grow the link-port demo from echo to actual network access. The Game Boy still only does SLIP framing + display; the host gateway does DNS/TCP/HTTP. - c/netlib.h: SLIP framing factored out (header-only, per-program copy). necho.c now uses it too. - c/wget.c: `wget URL` frames the URL, then prints the reply body. The gateway streams the body back as typed frames: 'D'<chunk> ... 'E'. - tools/gateway.py: add --mode http (urlopen the frame as a URL, cap the body, chunk it) alongside --mode echo; --cmd runs any gbos command. Verified: `wget example.com` streams back the full Example Domain HTML onto the terminal; `wget sl0p.foo` fetches the real page. A Game Boy on the web, over the link cable.
Diffstat (limited to 'src/programs.asm')
-rw-r--r--src/programs.asm7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/programs.asm b/src/programs.asm
index a0bef96..fbe6067 100644
--- a/src/programs.asm
+++ b/src/programs.asm
@@ -112,6 +112,9 @@ ProgPtest:
SECTION "prog_necho", ROMX[$4000], BANK[25]
ProgNecho:
INCBIN "c/necho.bin"
+SECTION "prog_wget", ROMX[$4000], BANK[26]
+ProgWget:
+ INCBIN "c/wget.bin"
; -----------------------------------------------------------------------------
; PROG_SH (bank 3) - the shell, now written in C (c/sh.c): parses >/</| and
@@ -202,6 +205,8 @@ ProgramTable::
dw ProgPtest
db LOW(BANK(ProgNecho)), HIGH(BANK(ProgNecho))
dw ProgNecho
+ db LOW(BANK(ProgWget)), HIGH(BANK(ProgWget))
+ dw ProgWget
; -----------------------------------------------------------------------------
; NameTable (ROM0) - command name -> program id, searched by sys_lookup.
@@ -256,4 +261,6 @@ NameTable::
db PROG_PTEST
db "necho", 0
db PROG_NECHO
+ db "wget", 0
+ db PROG_WGET
db 0