A very BASIC font question

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
helpcomputer0
Microbot
Posts: 130
Joined: Fri Apr 22, 2022 6:11 pm
Contact:

A very BASIC font question

Post by helpcomputer0 »

Pardon the pun. I'm trying to load one of DamienG's fonts (https://damieng.com/typography/zx-origins/scribe/) to use in a game I'm making in BASIC but I can't get it work. I can't load it from the tape file included with each font, I'm trying to use FUSE emulator with +3.

I've seen this thread but nothing in it worked, I couldn't get it to load the font I wanted.

I used the following but just got a invalid filename error.

Code: Select all

10 CLEAR 63999
20 LOAD ""CODE 64000
30 POKE 23607,249
40 PRINT "Hello World"
I'm 100% sure I'm missing something/doing it wrong, so I need some step-by-step advice to add one of his fonts in my game.
User avatar
g0blinish
Manic Miner
Posts: 287
Joined: Sun Jun 17, 2018 2:54 pm

Re: A very BASIC font question

Post by g0blinish »

64000/256=$FA(250)
250-1=249

so, 23607 contains (value+1)*256

example:
https://disk.yandex.ru/d/N3SGyJGytXoQzQ
font loaded at 32768(128*256), poke 23607,127 is 128-1
helpcomputer0
Microbot
Posts: 130
Joined: Fri Apr 22, 2022 6:11 pm
Contact:

Re: A very BASIC font question

Post by helpcomputer0 »

g0blinish wrote: Mon Sep 11, 2023 6:41 am 64000/256=$FA(250)
250-1=249

so, 23607 contains (value+1)*256

example:
https://disk.yandex.ru/d/N3SGyJGytXoQzQ
font loaded at 32768(128*256), poke 23607,127 is 128-1
I get the memory addresses, but perhaps I wasn't clear.

My issue is the loading of the font data from tape, I don't know what I'm doing wrong, or how to do it properly.

Image

This is the structure of the tape, I want to load "Scribe Bol" and use it in my game. How do I do that?
User avatar
g0blinish
Manic Miner
Posts: 287
Joined: Sun Jun 17, 2018 2:54 pm

Re: A very BASIC font question

Post by g0blinish »

try LOAD ""CODE, but ut doesn't help
Xela
Drutt
Posts: 49
Joined: Tue Apr 18, 2023 8:17 am

Re: A very BASIC font question

Post by Xela »

helpcomputer0 wrote: Mon Sep 11, 2023 6:57 am This is the structure of the tape
Why is the file size 770 bytes? standard font size is 768 bytes. This could be the issue.

Image
Xela
Drutt
Posts: 49
Joined: Tue Apr 18, 2023 8:17 am

Re: A very BASIC font question

Post by Xela »

I checked the tape image from Damien's site and it has the correct file size at 768 bytes. What program do you use to create the tape image?

Image
User avatar
g0blinish
Manic Miner
Posts: 287
Joined: Sun Jun 17, 2018 2:54 pm

Re: A very BASIC font question

Post by g0blinish »

Xela wrote: Mon Sep 11, 2023 8:08 am Why is the file size 770 bytes? standard font size is 768 bytes. This could be the issue.

Image
probably 2 bytes added - type of block and checksum

where is .tap file?
Xela
Drutt
Posts: 49
Joined: Tue Apr 18, 2023 8:17 am

Re: A very BASIC font question

Post by Xela »

g0blinish wrote: Mon Sep 11, 2023 8:28 amwhere is .tap file?
https://damieng.com/typography/zx-origins/scribe/ - in a zip file.
Xela
Drutt
Posts: 49
Joined: Tue Apr 18, 2023 8:17 am

Re: A very BASIC font question

Post by Xela »

helpcomputer0 wrote: Mon Sep 11, 2023 6:19 am I used the following but just got a invalid filename error.

Code: Select all

10 CLEAR 63999
20 LOAD ""CODE 64000
30 POKE 23607,249
40 PRINT "Hello World"
Try this tap file - https://dropmefiles.com/8gkbl
Xela
Drutt
Posts: 49
Joined: Tue Apr 18, 2023 8:17 am

Re: A very BASIC font question

Post by Xela »

helpcomputer0 wrote: Mon Sep 11, 2023 6:19 amso I need some step-by-step advice to add one of his fonts in my game.
As I see it: the BASIC program is absolutely correct. Next, you need a code block with a font - its size, for a standard font - 768 bytes (maybe less if there are fewer characters, maybe more, but in general - 768 bytes) - on the Damien's site the fonts are exactly this size. Those. everything you did was correct, the file format may have changed somehow: extra bytes were added, the header was damaged... etc.
User avatar
1024MAK
Bugaboo
Posts: 3123
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: A very BASIC font question

Post by 1024MAK »

Are you sure that you are not accidentally trying to load the BASIC program as code?
Try putting the file name in the load command to prevent this.

Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
Xela
Drutt
Posts: 49
Joined: Tue Apr 18, 2023 8:17 am

Re: A very BASIC font question

Post by Xela »

1024MAK wrote: Mon Sep 11, 2023 10:11 amaccidentally trying to load the BASIC program as code?
How is it possible to load the BASIC as a code file with the LOAD "" CODE?
AndyC
Dynamite Dan
Posts: 1408
Joined: Mon Nov 13, 2017 5:12 am

Re: A very BASIC font question

Post by AndyC »

Xela wrote: Mon Sep 11, 2023 10:40 am How is it possible to load the BASIC as a code file with the LOAD "" CODE?
It's not, the loading routine will ignore BASIC programs if you tell it to load a CODE block.

More likely, because you're getting "invalid filename" and emulating a +3 is that it's trying to load from disc and "" is not valid with disk because there is no such thing as "the next file".

Try doing LOAD "t:" first to select tape loading mode, then try again.
User avatar
R-Tape
Site Admin
Posts: 6409
Joined: Thu Nov 09, 2017 11:46 am

Re: A very BASIC font question

Post by R-Tape »

Does it have to be on a +3 and in +3 BASIC @helpcomputer0? I think AndyC has cracked it above if so. Otherwise this works fine on a +3 in 48K mode:

10 CLEAR 63999: LOAD "Scribe Bol"CODE 64000: POKE 23607,249

Very nice font that.
C.Born
Manic Miner
Posts: 231
Joined: Sat Dec 09, 2017 4:09 pm

Re: A very BASIC font question

Post by C.Born »

g0blinish wrote: Mon Sep 11, 2023 8:28 am probably 2 bytes added - type of block and checksum

where is .tap file?
its definitly those two bytes.
i discussed that with the coders off Fuse after conducting my "knowledge" to the tzxlist routine.
I just copied the info from ZX80 zakboekje into the C file and that worked.
So
the tape index from fuse still shows the length PLUS the two 'hardware bytes' which are part off the tape'hardware' but not from the data.
helpcomputer0
Microbot
Posts: 130
Joined: Fri Apr 22, 2022 6:11 pm
Contact:

Re: A very BASIC font question

Post by helpcomputer0 »

Thanks for all the answers!
AndyC wrote: Mon Sep 11, 2023 11:13 am More likely, because you're getting "invalid filename" and emulating a +3 is that it's trying to load from disc and "" is not valid with disk because there is no such thing as "the next file".
I'm 99% sure it was this. I started FUSE this time without inserting the disk and it loaded from tape fine!
helpcomputer0
Microbot
Posts: 130
Joined: Fri Apr 22, 2022 6:11 pm
Contact:

Re: A very BASIC font question

Post by helpcomputer0 »

Xela wrote: Mon Sep 11, 2023 9:10 am As I see it: the BASIC program is absolutely correct. Next, you need a code block with a font - its size, for a standard font - 768 bytes (maybe less if there are fewer characters, maybe more, but in general - 768 bytes) - on the Damien's site the fonts are exactly this size. Those. everything you did was correct, the file format may have changed somehow: extra bytes were added, the header was damaged... etc.
Thanks for this. I can now attempt to add to the game.
User avatar
TMD2003
Rick Dangerous
Posts: 2045
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: A very BASIC font question

Post by TMD2003 »

FOR THE RECORD: Fuse's tape browser always shows tape blocks to have two more bytes than they actually contain. So if it says 770 bytes, it's legit - try it on Spectaculator and it'll show as 768 bytes.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
Bedazzle
Manic Miner
Posts: 305
Joined: Sun Mar 24, 2019 9:03 am

Re: A very BASIC font question

Post by Bedazzle »

R-Tape wrote: Mon Sep 11, 2023 12:04 pm 10 CLEAR 63999: LOAD "Scribe Bol"CODE 64000: POKE 23607,249
Nice address, didn't knew that before.
Post Reply