Skip to content

Commit

Permalink
Added experimental HP 95LX build
Browse files Browse the repository at this point in the history
  • Loading branch information
jhhoward committed Dec 13, 2021
1 parent 99f36f6 commit 984f199
Show file tree
Hide file tree
Showing 10 changed files with 1,148 additions and 13 deletions.
3 changes: 3 additions & 0 deletions project/DOS/DOS.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<ClCompile Include="..\..\src\DOS\DOSNet.cpp" />
<ClCompile Include="..\..\src\DOS\EGA.cpp" />
<ClCompile Include="..\..\src\DOS\Hercules.cpp" />
<ClCompile Include="..\..\src\DOS\HP95LX.cpp" />
<ClCompile Include="..\..\src\DOS\Platform.cpp" />
<ClCompile Include="..\..\src\DOS\TextMode.cpp" />
<ClCompile Include="..\..\src\Font.cpp" />
Expand All @@ -116,6 +117,7 @@
<ClInclude Include="..\..\src\DOS\DOSNet.h" />
<ClInclude Include="..\..\src\DOS\EGA.h" />
<ClInclude Include="..\..\src\DOS\Hercules.h" />
<ClInclude Include="..\..\src\DOS\HP95LX.h" />
<ClInclude Include="..\..\src\DOS\TextMode.h" />
<ClInclude Include="..\..\src\Image.h" />
<ClInclude Include="..\..\src\Interface.h" />
Expand All @@ -135,6 +137,7 @@
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\Unicode.inc" />
<None Include="hp95lx.mak" />
<None Include="Makefile" />
<None Include="TCP.CFG" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions project/DOS/dosbox-genimages.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ c:
imgmount A "../../floppy/freedos.boot.disk.720K.img"
imgmount B "../../floppy/freedos.boot.disk.360K.img"
d:LZEXE.EXE MICROWEB
d:LZEXE.EXE MWEB95
copy /Y MICROWEB.EXE A:
copy /Y MICROWEB.EXE B:
pause
Expand Down
72 changes: 72 additions & 0 deletions project/DOS/hp95lx.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
bin = MWEB95.exe
SRC_PATH = ..\..\src
OBJDIR=obj
objects = MicroWeb.obj App.obj Parser.obj Renderer.obj Tags.obj Platform.obj HP95LX.obj Font.obj Interface.obj DOSInput.obj DOSNet.obj Page.obj
memory_model = -ml
CC = wpp
CFLAGS = -zq -0 -ot -bt=DOS -w2 $(memory_model) -dHP95LX
LD = wlink

# begin mTCP stuff
tcp_h_dir = ..\..\lib\mTCP\TCPINC\
tcp_c_dir = ..\..\lib\mTCP\TCPLIB\

tcpobjs = packet.obj arp.obj eth.obj ip.obj tcp.obj tcpsockm.obj udp.obj utils.obj dns.obj timer.obj ipasm.obj trace.obj

tcp_compile_options = -0 $(memory_model) -DCFG_H="tcp.cfg" -oh -ok -ot -s -oa -ei -zp2 -zpw -we -ob -ol+ -oi+
tcp_compile_options += -i=$(tcp_h_dir)

.cpp : $(tcp_c_dir)

.asm : $(tcp_c_dir)

.asm.obj :
wasm -0 $(memory_model) $[*

.cpp.obj :
wpp $[* $(tcp_compile_options)
# end mTCP stuff

$(bin): $(objects) $(tcpobjs)
$(LD) system dos name $@ file { $(objects) $(tcpobjs) }


MicroWeb.obj: $(SRC_PATH)\MicroWeb.cpp
$(CC) -fo=$@ $(CFLAGS) $<

App.obj: $(SRC_PATH)\App.cpp
$(CC) -fo=$@ $(CFLAGS) $<

Parser.obj: $(SRC_PATH)\Parser.cpp
$(CC) -fo=$@ $(CFLAGS) $<

Renderer.obj: $(SRC_PATH)\Renderer.cpp
$(CC) -fo=$@ $(CFLAGS) $<

Tags.obj: $(SRC_PATH)\Tags.cpp
$(CC) -fo=$@ $(CFLAGS) $<

Page.obj: $(SRC_PATH)\Page.cpp
$(CC) -fo=$@ $(CFLAGS) $<

Platform.obj: $(SRC_PATH)\DOS\Platform.cpp
$(CC) -fo=$@ $(CFLAGS) $<

Font.obj: $(SRC_PATH)\Font.cpp
$(CC) -fo=$@ $(CFLAGS) $<

Interface.obj: $(SRC_PATH)\Interface.cpp
$(CC) -fo=$@ $(CFLAGS) $<

HP95LX.obj: $(SRC_PATH)\DOS\HP95LX.cpp
$(CC) -fo=$@ $(CFLAGS) $<

DOSInput.obj: $(SRC_PATH)\DOS\DOSInput.cpp
$(CC) -fo=$@ $(CFLAGS) $<

DOSNet.obj: $(SRC_PATH)\DOS\DOSNet.cpp
$(CC) -fo=$@ $(CFLAGS) -i=$(tcp_h_dir) -DCFG_H="tcp.cfg" $<

clean: .symbolic
del *.obj
del $(bin)
13 changes: 9 additions & 4 deletions src/DOS/DOSNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ void DOSNetworkDriver::Init()
return;
}

for (int n = 0; n < MAX_CONCURRENT_HTTP_REQUESTS; n++)
{
requests[n] = new DOSHTTPRequest();
}

isConnected = true;
}

Expand All @@ -87,7 +92,7 @@ void DOSNetworkDriver::Update()

for (int n = 0; n < MAX_CONCURRENT_HTTP_REQUESTS; n++)
{
requests[n].Update();
requests[n]->Update();
}
}
}
Expand All @@ -98,10 +103,10 @@ HTTPRequest* DOSNetworkDriver::CreateRequest(char* url)
{
for (int n = 0; n < MAX_CONCURRENT_HTTP_REQUESTS; n++)
{
if (requests[n].GetStatus() == HTTPRequest::Stopped)
if (requests[n]->GetStatus() == HTTPRequest::Stopped)
{
requests[n].Open(url);
return &requests[n];
requests[n]->Open(url);
return requests[n];
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/DOS/DOSNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
#include "../Platform.h"
#include "../URL.h"

#ifdef HP95LX
#define TCP_RECV_BUFFER_SIZE (8192)
#define MAX_CONCURRENT_HTTP_REQUESTS 1
#else
#define TCP_RECV_BUFFER_SIZE (16384)
#define MAX_CONCURRENT_HTTP_REQUESTS 3
#endif
#define HOSTNAME_LEN (80)
#define PATH_LEN (MAX_URL_LENGTH)
#define LINE_BUFFER_SIZE 512
Expand Down Expand Up @@ -108,6 +113,6 @@ class DOSNetworkDriver : public NetworkDriver
virtual void DestroyRequest(HTTPRequest* request);

private:
DOSHTTPRequest requests[MAX_CONCURRENT_HTTP_REQUESTS];
DOSHTTPRequest* requests[MAX_CONCURRENT_HTTP_REQUESTS];
bool isConnected;
};
Loading

0 comments on commit 984f199

Please sign in to comment.