Does ROM entry zero exist?


SP4CEBAR 2022-07-06 10:26

Palettes start at ROM(1), this made me always assume that ROM(0) doesn't exist, however ROM(0) doesn't give an error: zero is a valid parameter, so does it exist?

was8bit 2022-07-06 11:13

ROM(0), if you dont store anything there, is where the secretly added font set is stored...

IF you choose to store something in ROM(0) but dont manually add a font set to character page 4, PRINT and NUMBER are now posting blanks...

Rom0 test.nx | Open in app
2022-07-06 11:13

was8bit 2022-07-06 11:21 (Edited)

Save this test program, and run it... you see nothing...

Now, open up the code, and manually edit the #0 to #1

Now, run it again... NOW "TEST" is visible

... leaving ROM(0) empty will cause NX to secretly load the default font set ;)

was8bit 2022-07-06 11:24

Another test... save palette back to #0, and run again... now PRINT prints blank again...

Now, goto page 4 and add and save a font set.. run again... this time, PRINT shows TEXT, but it is now using the new font set you added....

was8bit 2022-07-06 12:06

Now, this will save a copy of the secret font to a file called Disk.nx and can be viewable and even copy/pasted into your own file data ;)

Rom0 Save.nx | Open in app
2022-07-06 12:06

SP4CEBAR 2022-07-06 20:41

I thought the secret font is stored in ROM(3) when it's left empty, I already have the default font, I probably got it from RAM

was8bit 2022-07-07 04:52

Rom(3) is background... and it defaults to empty space until you edit it..

Rom(2) is characters.... and again defaults to empty space.

Rom(1) is palettes, NX defaults to a preset colors

Rom(0) holds default font set... its abit of a secret, but Timo has talked about it at one point, that's how I learned about it :)

was8bit 2022-07-07 04:53

Rom 15 is sounds, it also starts with default data...

Timo 2022-07-07 17:13

Not sooo secret ;) https://lowresnx.inutilis.com/docs/manual.html#Editing

"Standard ROM Entries"

was8bit 2022-07-08 06:30 (Edited)

Ah, cool, its official :)

Standard ROM Entries

For an easy start you should use the ROM entry numbers of the following table. Their data is made ready for use automatically.

#0 Keep empty for default font
#1 Color palettes
#2 Characters (sprites, tiles)
#3 Background (tile map)
#15 Sounds and music

If cartridge ROM entry 0 is not used by a program, the compiler adds character data for the default font. It occupies the characters 192-255 and is automatically copied to video RAM on program start. If you want to use the default font, make sure to keep ROM entry 0 unused.

SP4CEBAR 2022-07-08 08:29

Thank you!

was8bit 2022-07-08 16:25

To be fair, the help file contains a LOT of information.... it's easy to pass over stuff... I didn't even realize that info was in there until a Timo pointed it out ;)

Anywhere Games 2022-07-11 16:30

Can you use all pages of ROM(0) to make the Font for a whole game?

was8bit 2022-07-11 16:37 (Edited)

Once you use ROM(0)... it immediately ceases its "secret" function of providing your game a font set, and converts to a generic storage file...

The ONLY way for you to create your own font set for your game is to..
1) goto page 4 of your character set, use FILE button, FONT button, select your font.. then SAVE
You can then edit this at your discretion, saving the changes you like..

2) to place your font set elsewhere in your character file, lets say you want to use page 2 as you only have a few graphics... so repeat the above steps except start on page 2.. THEN you must add FONT 64 to let lowres know your font set now starts at char#64 (default is #192 which is the first character page 4)

was8bit 2022-07-11 16:39

Theoretically, you can have more than one character file... however only one character file can be loaded at a time into active game memory, so even if you had 10 character graphic/fonts files you could only use one file/set at a time...

was8bit 2022-07-11 16:41 (Edited)

Now, you also could use page 3 and page 4 to store 2 sets of fonts... again you could only use one at a time, but changing FONT 128 for page 3 and FONT 192 for page 4 would let you flip flop back and forth ...

So, lets say you have a screen which simulates the player interacting with a computer terminal, so in this case you may want a digital font set... then in another screen you have characters with text boxes simulating them talking to each other... in that case you may want a smoother fancier text for that...

Anywhere Games 2022-07-11 16:47

Or Uppercase and lowercase?

was8bit 2022-07-11 16:47 (Edited)

As you can see, ALL your graphics MUST fit into a set of only 256 graphic character cells only 8x8 pixels big (chr#0 to chr#255) that is all that lowres can simultaneously display at one time... you can swap the sets out, or you could get clever and copy portions of one into memory manually, BUT are still limited to 256 characters at any one time...

was8bit 2022-07-11 16:49 (Edited)

Yes, you can do upper or lower case, but if you want both at the same time you will have to abandon using TEXT or PRINT and create your text manually...


Check this out....

In this case, i build the text using sprites so i can adjust each character up or down or left or right for a better fit..

One could do this easier by making your text fit an 8x8 cell better, but then manually use CELLx,y,C to manually place each letter, be it capatalized or small cased...

Timo 2022-07-11 17:03

Keep in mind that LowRes NX source code is always interpreted as upper case. But you could use other tricks to mark cases.

Log in to reply.