Skip to content

Commit

Permalink
HP 95LX 240x128 support (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrenkelS authored May 26, 2024
1 parent 5b1c2c8 commit d0639cd
Show file tree
Hide file tree
Showing 6 changed files with 511 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/amiga
/DJ
/GCCIA16
/HP95LX
/Retro68
/WC16
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ No FPU required.
## How to add other platforms
Implement `i_system.h`. Look at `i_ibm.c` and `i_mac.c` for examples.

|Platform |Platform specific code |Compiler |Set environment variables|Compile code |Additional information |
|-----------------|-----------------------|---------------------------------------------------------------------------|-------------------------|----------------|----------------------------------------------------|
|Amiga 500 |`i_amiga.c` |[amiga-gcc](https://github.com/bebbo/amiga-gcc) |n/a |`compa500.sh` |Experimental, might not work on a real machine |
|IBM PC 16-bit |`i_ibm.c`, `i_ibma.asm`|[gcc-ia16](https://github.com/tkchia/gcc-ia16), [NASM](https://www.nasm.us)|n/a |`compia16.sh` |Use command line argument `lcd` to invert the colors|
|IBM PC 16-bit[^1]|`i_ibm.c` |[Watcom](https://github.com/open-watcom/open-watcom-v2) |`setenvwc.bat` |`compwc16.sh` |Use command line argument `lcd` to invert the colors|
|IBM PC 32-bit |`i_ibm.c` |[DJGPP](https://github.com/andrewwutw/build-djgpp) |`setenvdj.bat` |`compdj.bat` |Use command line argument `lcd` to invert the colors|
|Macintosh Plus |`i_mac.c` |[Retro68](https://github.com/autc04/Retro68) |n/a |`CMakeLists.txt`|Experimental, might not work on a real machine |
|Platform |Platform specific code |Compiler |Set environment variables|Compile code |Additional information |
|-----------------|--------------------------|---------------------------------------------------------------------------|-------------------------|----------------|----------------------------------------------------|
|Amiga 500 |`i_amiga.c` |[amiga-gcc](https://github.com/bebbo/amiga-gcc) |n/a |`compa500.sh` |Experimental, might not work on a real machine |
|HP 95LX |`i_hp95lx.c`, `i_ibma.asm`|[gcc-ia16](https://github.com/tkchia/gcc-ia16), [NASM](https://www.nasm.us)|n/a |`comphp95.sh` |No status bar, also runs on HP 100LX and HP 200LX |
|IBM PC 16-bit |`i_ibm.c`, `i_ibma.asm`|[gcc-ia16](https://github.com/tkchia/gcc-ia16), [NASM](https://www.nasm.us)|n/a |`compia16.sh` |Use command line argument `lcd` to invert the colors|
|IBM PC 16-bit[^1]|`i_ibm.c` |[Watcom](https://github.com/open-watcom/open-watcom-v2) |`setenvwc.bat` |`compwc16.sh` |Use command line argument `lcd` to invert the colors|
|IBM PC 32-bit |`i_ibm.c` |[DJGPP](https://github.com/andrewwutw/build-djgpp) |`setenvdj.bat` |`compdj.bat` |Use command line argument `lcd` to invert the colors|
|Macintosh Plus |`i_mac.c` |[Retro68](https://github.com/autc04/Retro68) |n/a |`CMakeLists.txt`|Experimental, might not work on a real machine |

[^1]: Two compilers can build the IBM PC 16-bit port. Gcc-ia16 produces faster code than Watcom. The static code analysers of both compilers detect different issues.
86 changes: 86 additions & 0 deletions comphp95.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
mkdir HP95LX

unset CFLAGS

#export RENDER_OPTIONS="-DONE_WALL_TEXTURE -DFLAT_WALL"
export RENDER_OPTIONS="-DUSE_ASSEMBLY -DDISABLE_STATUS_BAR -DVIEWWINDOWWIDTH=30"
#export RENDER_OPTIONS+=" -DEGA_DEBUG"

nasm i_ibma.asm -f elf -DVIEWWINDOWWIDTH=30

ia16-elf-gcc -c i_hp95lx.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c p_map.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c p_maputl.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c p_mobj.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c p_scroll.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c p_sight.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c r_draw.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c r_plane.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c tables.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c w_wad.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple
ia16-elf-gcc -c z_zone.c $RENDER_OPTIONS -march=i186 -mcmodel=medium -mnewlib-nano-stdio -Ofast -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=simple

export CFLAGS="-march=i186 -mcmodel=medium -li86 -mnewlib-nano-stdio -Os -fomit-frame-pointer -fgcse-sm -fgcse-las -fipa-pta -mregparmcall -flto -fwhole-program -funroll-loops -freorder-blocks-algorithm=stc"
#export CFLAGS="$CFLAGS -Ofast -flto -fwhole-program -fomit-frame-pointer -funroll-loops -fgcse-sm -fgcse-las -fipa-pta -Wno-attributes -Wpedantic"
#export CFLAGS="$CFLAGS -Wall -Wextra"

export GLOBOBJS=" d_items.c"
export GLOBOBJS+=" d_main.c"
export GLOBOBJS+=" g_game.c"
#export GLOBOBJS+=" i_hp95lx.c"
export GLOBOBJS+=" i_hp95lx.o"
export GLOBOBJS+=" i_ibma.o"
export GLOBOBJS+=" info.c"
export GLOBOBJS+=" m_random.c"
export GLOBOBJS+=" p_doors.c"
export GLOBOBJS+=" p_enemy.c"
export GLOBOBJS+=" p_floor.c"
export GLOBOBJS+=" p_inter.c"
export GLOBOBJS+=" p_lights.c"
#export GLOBOBJS+=" p_map.c"
export GLOBOBJS+=" p_map.o"
#export GLOBOBJS+=" p_maputl.c"
export GLOBOBJS+=" p_maputl.o"
#export GLOBOBJS+=" p_mobj.c"
export GLOBOBJS+=" p_mobj.o"
export GLOBOBJS+=" p_plats.c"
export GLOBOBJS+=" p_pspr.c"
#export GLOBOBJS+=" p_scroll.c"
export GLOBOBJS+=" p_scroll.o"
export GLOBOBJS+=" p_setup.c"
#export GLOBOBJS+=" p_sight.c"
export GLOBOBJS+=" p_sight.o"
export GLOBOBJS+=" p_spec.c"
export GLOBOBJS+=" p_switch.c"
export GLOBOBJS+=" p_tick.c"
export GLOBOBJS+=" p_user.c"
export GLOBOBJS+=" r_data.c"
#export GLOBOBJS+=" r_draw.c"
export GLOBOBJS+=" r_draw.o"
#export GLOBOBJS+=" r_plane.c"
export GLOBOBJS+=" r_plane.o"
export GLOBOBJS+=" r_things.c"
export GLOBOBJS+=" st_stuff.c"
#export GLOBOBJS+=" tables.c"
export GLOBOBJS+=" tables.o"
export GLOBOBJS+=" v_video.c"
#export GLOBOBJS+=" w_wad.c"
export GLOBOBJS+=" w_wad.o"
export GLOBOBJS+=" z_bmallo.c"
#export GLOBOBJS+=" z_zone.c"
export GLOBOBJS+=" z_zone.o"

ia16-elf-gcc $GLOBOBJS $CFLAGS $RENDER_OPTIONS -o HP95LX/DOOMTDHP.EXE

rm i_ibma.o
rm i_hp95lx.o
rm p_map.o
rm p_maputl.o
rm p_mobj.o
rm p_scroll.o
rm p_sight.o
rm r_draw.o
rm r_plane.o
rm tables.o
rm w_wad.o
rm z_zone.o
Loading

0 comments on commit d0639cd

Please sign in to comment.