Skip to content

Commit 825384e

Browse files
committed
2.10 - 20241230
--------------- Changed: - show help with --help and -h too - Load/Save/Go input backspace without multiple ? - Go to room in capital HEX - better sanitize in Makefiles Bugfix: - with option -MAP missed NPC positions on map - auto select rendering to work with Raspberry Pi via X protocol/SSH tunnels
1 parent 551de14 commit 825384e

34 files changed

+14352
-14308
lines changed

Changelog.txt

+29-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
1+
2.10 - 20241230
2+
---------------
3+
Changed:
4+
- show help with --help and -h too
5+
- Load/Save/Go input backspace without multiple ?
6+
- Go to room in capital HEX
7+
- better sanitize in Makefiles
8+
Bugfix:
9+
- with option -MAP missed NPC positions on map
10+
- auto select rendering to work with Raspberry Pi via X protocol/SSH tunnels
11+
12+
**Note:** .tgz packages require to install dependencies libs. On Debian12 the command is:
13+
'$ sudo apt install libsdl2-image-2.0-0 libcurl4 libzip4'
14+
**Note:** the package **WL2.10b_Lin32_armv7l.tgz** is for Raspberry Pi 3B+ @ 32bit, is built with -mfpu=neon optimization and so is not compatible with Raspberry Pi 1 and 2
15+
**Note:** the package **WL2.10b_Lin64_aarch64.tgz** is for Raspberry Pi 3B+ @ 64bit. Both packages for Raspberry Pi work locally and remotely via X protocol/SSH tunnels.
16+
**Note:** the package **WL2.10b_Linux_riscv64_64bit.tgz** for StarFive VisionFive2
17+
RISC-V @ 64bit work via x11 but is really slow as the GPU support for RISC-V is
18+
in development
19+
**Note:** the package **WL2.10b_Z80_WinMxe32.7z** is generated linked with **Z80** CPU emulator, this is for compatibility with old WL1.x snapshot files, but those snapshots won't work with 64 bit binaries, and are incompatible with current default binary and snapshots, generated with **z80emu** CPU emulator of all other packages
20+
121
2.10b - 20231203
222
----------------
3-
Changed
23+
Changed:
424
- put WLS files in 'wls' directory, create it if missing
525
- if not found locally, download 'The Hobbit' binary, using libcurl
626
- get download link from WLconfig.txt config file
@@ -26,23 +46,25 @@ Changed
2646
- use osxcross-dmg(ricorsive findobj) to collect dylib
2747
- applied my coding style
2848
- use WLYEAR for copyright
49+
2950
Bugfix:
3051
- try increased delay to 20 ms between SDLtext to avoid flicker on macOS
3152
- switched to software rendering as on macOS flicker with red background
53+
3254
Modification to 'z80emu':
3355
- remember HALT state on different calls. Quit HALT by IRQ or NMI
3456
z80emu.c: use state->status = Z80_STATUS_FLAG_HALT;
3557
- fix z80emu.h enum for Z80_STATE's status to support Z80_CATCH_*
3658
- documented I/O with 16 bit port address for z80emu
3759

38-
Note: .tgz packages require to install dependencies libs. On Debian12 the command is:
39-
$ sudo apt install libsdl2-image-2.0-0 libcurl4 libzip4
40-
Note: the package WL2.10b_Lin32_armv7l.tgz is for Raspberry Pi 3B+ @ 32bit, is built with -mfpu=neon optimization and so is not compatible with Raspberry Pi 1 and 2
41-
Note: the package WL2.10b_Lin64_aarch64.tgz is for Raspberry Pi 3B+ @ 64bit. Both packages for Raspberry Pi work only locally like Windows version, so do not work remotely via X protocol/SSH tunnels.
42-
Note: the package WL2.10b_Linux_riscv64_64bit.tgz for StarFive VisionFive2
60+
**Note:** .tgz packages require to install dependencies libs. On Debian12 the command is:
61+
'$ sudo apt install libsdl2-image-2.0-0 libcurl4 libzip4'
62+
**Note:** the package **WL2.10b_Lin32_armv7l.tgz** is for Raspberry Pi 3B+ @ 32bit, is built with -mfpu=neon optimization and so is not compatible with Raspberry Pi 1 and 2
63+
**Note:** the package **WL2.10b_Lin64_aarch64.tgz** is for Raspberry Pi 3B+ @ 64bit. Both packages for Raspberry Pi work only locally like Windows version, so do not work remotely via X protocol/SSH tunnels.
64+
**Note:** the package **WL2.10b_Linux_riscv64_64bit.tgz** for StarFive VisionFive2
4365
RISC-V @ 64bit work via x11 but is really slow as the GPU support for RISC-V is
4466
in development
45-
Note: the package WL2.10b_Z80_WinMxe32.7z is generated linked with Z80 CPU emulator, this is for compatibility with old WL1.x snapshot files, but those snapshots won't work with 64 bit binaries, and are incompatible with current default binary and snapshots, generated with z80emu CPU emulator of all other packages
67+
**Note:** the package **WL2.10b_Z80_WinMxe32.7z** is generated linked with **Z80** CPU emulator, this is for compatibility with old WL1.x snapshot files, but those snapshots won't work with 64 bit binaries, and are incompatible with current default binary and snapshots, generated with **z80emu** CPU emulator of all other packages
4668

4769
2.09 - 20220907
4870
---------------

GlobalVars.h

+67-67
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
1-
/****************************************************************************\
2-
* *
3-
* GlobalVars.h *
4-
* *
5-
* The global variables for the WL project *
6-
* *
7-
* (c) 2012-2019 by CH, Copyright 2019-2023 Valerio Messina *
8-
* *
9-
* V 2.10b - 20231203 *
10-
* *
11-
* GlobalVars.h is part of Wilderland - A Hobbit Environment *
12-
* Wilderland is free software: you can redistribute it and/or modify *
13-
* it under the terms of the GNU General Public License as published by *
14-
* the Free Software Foundation, either version 2 of the License, or *
15-
* (at your option) any later version. *
16-
* *
17-
* Wilderland is distributed in the hope that it will be useful, *
18-
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
19-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20-
* GNU General Public License for more details. *
21-
* *
22-
* You should have received a copy of the GNU General Public License *
23-
* along with Wilderland. If not, see <http://www.gnu.org/licenses/>. *
24-
* *
25-
\****************************************************************************/
26-
27-
28-
#ifndef GLOBALVARS_H
29-
#define GLOBALVARS_H
30-
31-
#include <stdbool.h>
32-
33-
#include "SDLTWE.h"
34-
35-
36-
extern int NoScanLines;
37-
extern int HV; // Hobbit version
38-
extern struct CharSetStruct CharSet;
39-
extern word DictionaryBaseAddress;
40-
extern word ObjectsIndexAddress, ObjectsAddress;
41-
extern bool dockMap; // when true the map is docked
42-
43-
extern SDL_Window* winPtr;
44-
extern SDL_Window* MapWinPtr;
45-
extern SDL_Renderer* renPtr;
46-
extern SDL_Renderer* MapRenPtr;
47-
extern SDL_Surface* MapSfcPtr;
48-
extern struct TextWindowStruct LogWin;
49-
extern struct TextWindowStruct GameWin;
50-
extern struct TextWindowStruct HelpWin;
51-
extern struct TextWindowStruct ObjWin;
52-
extern struct TextWindowStruct MapWin;
53-
54-
// select the CPU emulator, CPUEMUL must be: eZ80 or ez80emu, see Makefile
55-
#if CPUEMUL == eZ80
56-
extern Z80 z80; // my Z80 processor
57-
#endif
58-
#if CPUEMUL == ez80emu
59-
extern Z80_STATE z80; // my Z80 processor
60-
extern int context;
61-
#endif
62-
extern byte ZXmem[]; // Spectrum 64 kB memory
63-
64-
extern SDL_Keycode CurrentPressedKey; // used by InZ80()
65-
extern uint16_t CurrentPressedMod; // used by InZ80()
66-
67-
#endif /* GLOBAL_VARS_H */
1+
/****************************************************************************\
2+
* *
3+
* GlobalVars.h *
4+
* *
5+
* The global variables for the WL project *
6+
* *
7+
* (c) 2012-2019 by CH, Copyright 2019-2024 Valerio Messina *
8+
* *
9+
* V 2.10 - 20241230 *
10+
* *
11+
* GlobalVars.h is part of Wilderland - A Hobbit Environment *
12+
* Wilderland is free software: you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation, either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
* Wilderland is distributed in the hope that it will be useful, *
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20+
* GNU General Public License for more details. *
21+
* *
22+
* You should have received a copy of the GNU General Public License *
23+
* along with Wilderland. If not, see <http://www.gnu.org/licenses/>. *
24+
* *
25+
\****************************************************************************/
26+
27+
28+
#ifndef GLOBALVARS_H
29+
#define GLOBALVARS_H
30+
31+
#include <stdbool.h>
32+
33+
#include "SDLTWE.h"
34+
35+
36+
extern int NoScanLines;
37+
extern int HV; // Hobbit version
38+
extern struct CharSetStruct CharSet;
39+
extern word DictionaryBaseAddress;
40+
extern word ObjectsIndexAddress, ObjectsAddress;
41+
extern bool dockMap; // when true the map is docked
42+
43+
extern SDL_Window* winPtr;
44+
extern SDL_Window* MapWinPtr;
45+
extern SDL_Renderer* renPtr;
46+
extern SDL_Renderer* MapRenPtr;
47+
extern SDL_Surface* MapSfcPtr;
48+
extern struct TextWindowStruct LogWin;
49+
extern struct TextWindowStruct GameWin;
50+
extern struct TextWindowStruct HelpWin;
51+
extern struct TextWindowStruct ObjWin;
52+
extern struct TextWindowStruct MapWin;
53+
54+
// select the CPU emulator, CPUEMUL must be: eZ80 or ez80emu, see Makefile
55+
#if CPUEMUL == eZ80
56+
extern Z80 z80; // my Z80 processor
57+
#endif
58+
#if CPUEMUL == ez80emu
59+
extern Z80_STATE z80; // my Z80 processor
60+
extern int context;
61+
#endif
62+
extern byte ZXmem[]; // Spectrum 64 kB memory
63+
64+
extern SDL_Keycode CurrentPressedKey; // used by InZ80()
65+
extern uint16_t CurrentPressedMod; // used by InZ80()
66+
67+
#endif /* GLOBAL_VARS_H */

Makefile

+22-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile: Copyright 2019-2023 Valerio Messina [email protected]
1+
# Makefile: Copyright 2019-2024 Valerio Messina [email protected]
22
#
33
# Makefile is part of Wilderland - A Hobbit Environment
44
# Wilderland is free software: you can redistribute it and/or modify
@@ -21,7 +21,8 @@
2121
# To use z80emu emulator build with: $ make CPUEMUL=ez80emu OR $ make
2222
# To use Z80 emulator build with: $ make CPUEMUL=eZ80
2323
# To avoid include and link libcurl and libzip build with: $ make NODL=1
24-
# To build for debug use: $ make BUILD=debug
24+
# To build for debug and sanitize=address use: $ make debug
25+
# Note: sanitize can be also $ make SAN=thread|memory debug
2526

2627
PKG = LIN64
2728
CPU = $(shell uname -m)
@@ -59,23 +60,16 @@ ifeq ($(CPUEMUL),ez80emu)
5960
CPUIF=z80emu/z80emu.h
6061
CPUOBJ=z80emu.o
6162
endif
62-
BUILD?=release
63-
ifeq ($(BUILD),debug)
64-
COPT=-O1 -g -fsanitize=address
65-
LOPT=-fsanitize=address
66-
else
67-
COPT=-O3
68-
endif
69-
ifeq ($(CPU),armv7l) # Raspberry Pi @32bit
70-
COPT += -mfpu=neon
71-
endif
7263

73-
CC = gcc
64+
CC ?= gcc
7465
LD = $(CC)
7566
STRIP = strip
76-
CFLAGS = -std=c99 -Wall $(COPT) -D__USE_MINGW_ANSI_STDIO=1 -DCPUEMUL=$(CPUEMUL) -fomit-frame-pointer
67+
CFLAGS = -std=c99 -Wall -O3 -DCPUEMUL=$(CPUEMUL) -fomit-frame-pointer
68+
ifeq ($(CPU),armv7l) # Raspberry Pi @32bit
69+
CFLAGS += -mfpu=neon
70+
endif
7771
SDLCFLAGS = $(shell pkg-config $(PARS) --cflags SDL2_image)
78-
LDFLAGS = $(shell pkg-config $(PARS) --libs SDL2_image) $(LOPT)
72+
LDFLAGS = $(shell pkg-config $(PARS) --libs SDL2_image)
7973
ifndef NODL
8074
CFLAGS += $(shell pkg-config --cflags libcurl)
8175
CFLAGS += $(shell pkg-config --cflags libzip)
@@ -85,6 +79,17 @@ ifndef NODL
8579
else
8680
CFLAGS += -DNODL
8781
endif
82+
83+
SAN?=address
84+
CFLAGS_address = -fsanitize=address -fno-omit-frame-pointer
85+
LDFLAGS_address = -fsanitize=address
86+
CFLAGS_thread = -fsanitize=thread
87+
LDFLAGS_thread = -fsanitize=thread
88+
ifeq ($(CC),clang)
89+
CFLAGS_memory = -fsanitize=memory -fPIE -fno-omit-frame-pointer -fsanitize-memory-track-origins
90+
LDFLAGS_memory = -fsanitize=memory -fPIE -pie
91+
endif
92+
8893
FILE = WL
8994
SOURCE = $(FILE)
9095
TARGET = $(FILE)
@@ -131,6 +136,8 @@ cleanbin:
131136

132137
clean: cleanobj cleanbin
133138

139+
debug: CFLAGS += -O2 -g -fsanitize=undefined $(CFLAGS_$(SAN))
140+
debug: LDFLAGS += -fsanitize=undefined $(LDFLAGS_$(SAN))
134141
debug: clean all cleanobj
135142

136143
bin: all cleanobj strip

Makefile32

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile32: Copyright 2019-2023 Valerio Messina [email protected]
1+
# Makefile32: Copyright 2019-2024 Valerio Messina [email protected]
22
#
33
# Makefile32 is part of Wilderland - A Hobbit Environment
44
# Wilderland is free software: you can redistribute it and/or modify
@@ -21,7 +21,8 @@
2121
# To use z80emu emulator build with: $ make CPUEMUL=ez80emu OR $ make
2222
# To use Z80 emulator build with: $ make CPUEMUL=eZ80
2323
# To avoid include and link libcurl and libzip build with: $ make NODL=1
24-
# To build for debug use: $ make BUILD=debug
24+
# To build for debug and sanitize=address use: $ make debug
25+
# Note: sanitize can be also $ make SAN=thread|memory debug
2526

2627
PKG = LIN32
2728
CPU = i686
@@ -50,20 +51,13 @@ ifeq ($(CPUEMUL),ez80emu)
5051
CPUIF=z80emu/z80emu.h
5152
CPUOBJ=z80emu.o
5253
endif
53-
BUILD?=release
54-
ifeq ($(BUILD),debug)
55-
COPT=-O1 -g -fsanitize=address -fno-omit-frame-pointer
56-
LOPT=-fsanitize=address
57-
else
58-
COPT=-O3
59-
endif
6054

61-
CC = gcc
55+
CC ?= gcc
6256
LD = $(CC)
6357
STRIP = strip
64-
CFLAGS = -std=c99 -Wall $(COPT) -D__USE_MINGW_ANSI_STDIO=1 -m32 -DCPUEMUL=$(CPUEMUL) -fomit-frame-pointer
58+
CFLAGS = -std=c99 -Wall -O3 -m32 -DCPUEMUL=$(CPUEMUL) -fomit-frame-pointer
6559
SDLCFLAGS = $(shell PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig: pkg-config $(PARS) --cflags SDL2_image)
66-
LDFLAGS = $(shell PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig: pkg-config $(PARS) --libs SDL2_image) -m32 $(LOPT)
60+
LDFLAGS = $(shell PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig: pkg-config $(PARS) --libs SDL2_image) -m32
6761
ifndef NODL
6862
CFLAGS += $(shell PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig: pkg-config --cflags libcurl)
6963
CFLAGS += $(shell PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig: pkg-config --cflags libzip)
@@ -72,6 +66,17 @@ ifndef NODL
7266
else
7367
CFLAGS += -DNODL
7468
endif
69+
70+
SAN?=address
71+
CFLAGS_address = -fsanitize=address -fno-omit-frame-pointer
72+
LDFLAGS_address = -fsanitize=address
73+
CFLAGS_thread = -fsanitize=thread
74+
LDFLAGS_thread = -fsanitize=thread
75+
ifeq ($(CC),clang)
76+
CFLAGS_memory = -fsanitize=memory -fPIE -fno-omit-frame-pointer -fsanitize-memory-track-origins
77+
LDFLAGS_memory = -fsanitize=memory -fPIE -pie
78+
endif
79+
7580
FILE = WL
7681
SOURCE = $(FILE)
7782
TARGET = $(FILE)32
@@ -117,6 +122,8 @@ cleanbin:
117122

118123
clean: cleanobj cleanbin
119124

125+
debug: CFLAGS += -O2 -g -fsanitize=undefined $(CFLAGS_$(SAN))
126+
debug: LDFLAGS += -fsanitize=undefined $(LDFLAGS_$(SAN))
120127
debug: clean all cleanobj
121128

122129
bin: all cleanobj strip

MakefileG32

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Makefile: Copyright 2019-2023 Valerio Messina [email protected]
1+
# MakefileG32: Copyright 2019-2024 Valerio Messina [email protected]
22
#
3-
# Makefile is part of Wilderland - A Hobbit Environment
3+
# MakefileG32 is part of Wilderland - A Hobbit Environment
44
# Wilderland is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
66
# the Free Software Foundation, either version 2 of the License, or
@@ -21,7 +21,7 @@
2121
# To use z80emu emulator build with: $ make CPUEMUL=ez80emu OR $ make
2222
# To use Z80 emulator build with: $ make CPUEMUL=eZ80
2323
# To avoid include and link libcurl and libzip build with: $ make NODL=1
24-
# To build for debug use: $ make BUILD=debug
24+
# To build for debug use: $ make debug
2525

2626
PKG = MGW32
2727
CPU = $(shell uname -m)
@@ -42,23 +42,16 @@ ifeq ($(CPUEMUL),ez80emu)
4242
CPUIF=z80emu/z80emu.h
4343
CPUOBJ=z80emu.o
4444
endif
45-
BUILD?=release
46-
ifeq ($(BUILD),debug)
47-
COPT=-O1 -g -fsanitize=address -fno-omit-frame-pointer
48-
LOPT=-fsanitize=address
49-
else
50-
COPT=-O3
51-
endif
5245

53-
CC = gcc
46+
CC ?= gcc
5447
LD = $(CC)
5548
STRIP = strip
56-
CFLAGS = -std=c99 -Wall $(COPT) -D__USE_MINGW_ANSI_STDIO=1 -DCPUEMUL=$(CPUEMUL) -fomit-frame-pointer
49+
CFLAGS = -std=c99 -Wall -O3 -D__USE_MINGW_ANSI_STDIO=1 -DCPUEMUL=$(CPUEMUL) -fomit-frame-pointer
5750
SDLCFLAGS = $(shell pkg-config --cflags SDL2_image)
5851
ifeq ($(OS),Msys) # on MINGW + SDL force console for debug
5952
SDLMINGWLDFLAGS = -mconsole
6053
endif
61-
LDFLAGS = $(shell pkg-config --libs SDL2_image) $(SDLMINGWLDFLAGS) $(LOPT)
54+
LDFLAGS = $(shell pkg-config --libs SDL2_image) $(SDLMINGWLDFLAGS)
6255
ifndef NODL
6356
CFLAGS += $(shell pkg-config --cflags libcurl)
6457
CFLAGS += $(shell pkg-config --cflags libzip)
@@ -67,6 +60,7 @@ ifndef NODL
6760
else
6861
CFLAGS += -DNODL
6962
endif
63+
7064
FILE = WL
7165
SOURCE = $(FILE)
7266
TARGET = $(FILE)

0 commit comments

Comments
 (0)