Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c9af4768db0c
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 512194034ecb
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Dec 1, 2018

  1. Copy the full SHA
    5121940 View commit details
19 changes: 15 additions & 4 deletions software/glasgow/applet/vga_terminal/__init__.py
Original file line number Diff line number Diff line change
@@ -115,10 +115,14 @@ class VGATerminalApplet(VGAOutputApplet, name="vga-terminal"):
def add_build_arguments(cls, parser, access):
super().add_build_arguments(parser, access)

parser.add_argument(
g_font = parser.add_mutually_exclusive_group()
g_font.add_argument(
"-fb", "--font-builtin", metavar="FILE", type=str, default="ibmvga8x16",
choices=["ibmvga8x16", "ibmvga8x14", "ibmvga8x8", "ibmvga8x8hi"],
help="load builtin font NAME (default: %(default)s, one of: %(choices)s)")
g_font.add_argument(
"-fd", "--font-data", metavar="FILE", type=argparse.FileType("rb"),
default=os.path.join(os.path.dirname(__file__), "ibmvga8x16.bin"),
help="load character generator ROM from FILE (default: ibmvga8x16.bin)")
help="load font ROM from FILE")
parser.add_argument(
"-fw", "--font-width", metavar="PX", type=int, default=8,
help="set font width to PX pixels (default: %(default)s)")
@@ -130,11 +134,18 @@ def build(self, target, args):
vga = super().build(target, args, test_pattern=False)
iface = self.mux_interface

if args.font_data:
font_data = args.font_data.read()
else:
font_path = os.path.join(os.path.dirname(__file__), args.font_builtin + ".bin")
with open(font_path, "rb") as f:
font_data = f.read()

subtarget = iface.add_subtarget(VGATerminalSubtarget(
vga=vga,
h_active=args.h_active,
v_active=args.v_active,
font_data=args.font_data.read(),
font_data=font_data,
font_width=args.font_width,
font_height=args.font_height,
blink_cyc=int(args.pix_clk_freq * 1e6 / 2),
Binary file not shown.
Binary file not shown.
Binary file not shown.