Changing default screen mode.

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice.
Post Reply
Gigadave
Posts: 10
Joined: 03 Mar 2019, 10:50

Changing default screen mode.

Post by Gigadave » 03 Mar 2019, 10:56

Hi,

I have read and saved the code from ROM v3 and would like to change the default screen mode ( black lines ) and re-write the eprom.
Can someone please tell me the address and what to change.

Thanks

User avatar
marcelk
Posts: 178
Joined: 13 May 2018, 08:26

Re: Changing default screen mode.

Post by marcelk » 03 Mar 2019, 19:22

For ROM v3 the default video mode is set by Reset_v3.gcl by calling SYS_SetMode_v2_80 with the desired mode in vAC (0,1,2,3):

Code: Select all

\SYS_SetMode_v2_80 \sysFn=      {!!! Not in ROM v1 !!!}
1 80!                           {Mode 1 -> "ABC-"}
If we want to change it to 2 for example:

Code: Select all

\SYS_SetMode_v2_80 \sysFn=      {!!! Not in ROM v1 !!!}
2 80!                           {Mode 2 -> "A-C-"}
Now rebuild the ROM file, from the main directory of the repository.

Code: Select all

> make
[... snip a lot of output ...]

Compile file Core/Reset_v3.gcl label Reset ROM f7e2
 Segment at 0200 size 250 used 199 unused  51
 Segment at 0300 size 250 used 216 unused  34
 Variables count 12 bytes 24 end 0048
 : Char Pos PrintChar [79] PrintStartupMessage [132] SetupAudio [27]
 : SetupChannel [59] SetupVideo [64] Text [51] fontData i p q

Create file ROMv3.asm
Create file ROMv3.rom
OK used 64000 free 1536 size 131072
Now look at the diff:

Code: Select all

> git diff
diff --git a/Core/Reset_v3.gcl b/Core/Reset_v3.gcl
index 5b2b37c..8082f14 100644
--- a/Core/Reset_v3.gcl
+++ b/Core/Reset_v3.gcl
@@ -125,7 +125,7 @@ $814 Pos= PrintStartupMessage! {Returns 0}
 9 \ledTempo.                    {6.0 Hz ( = 60/(9+1)), was 5.5 Hz}
 
 \SYS_SetMode_v2_80 \sysFn=      {!!! Not in ROM v1 !!!}
-1 80!                           {Mode 1 -> "ABC-"}
+2 80!                           {Mode 2 -> "A-C-"}
 
 { Load and start main program }
 \Main \sysArgs0= $200 \vLR= \SYS_Exec_88 \sysFn= 88!
diff --git a/ROMv3.asm b/ROMv3.asm
index 1489865..f95af0b 100644
--- a/ROMv3.asm
+++ b/ROMv3.asm
@@ -57839,7 +57839,7 @@ Reset:        f7e2 0002  ld   $02         ;| RAM segment address (high byte firs
               f97b 002b  ld   $2b         ;03c2 STW
               f97c 0022  ld   $22
               f97d 0059  ld   $59         ;03c4 LDI
-              f97e 0001  ld   $01
+              f97e 0002  ld   $02
               f97f 00b4  ld   $b4         ;03c6 SYS
               f980 00e6  ld   $e6
               f981 0011  ld   $11         ;03c8 LDWI
diff --git a/ROMv3.rom b/ROMv3.rom
index c9b6596..4d8d841 100644
Binary files a/ROMv3.rom and b/ROMv3.rom differ
So there we are: the low order byte of word number 0xf97e in the ROM file. In this file, words happen to be in big endian order. So we must change the value of byte address 2*0xf97e+1 = 0x1f2fd. (Or just use the ROM file just created...)

Gigadave
Posts: 10
Joined: 03 Mar 2019, 10:50

Re: Changing default screen mode.

Post by Gigadave » 04 Mar 2019, 01:08

Hi,

Thanks for the info.

I am new and just want to change a couple of values using a HEX editor.
I have no programming experience and just want an easy option.
For example the Line (Address) number and the HEX values.

Thanks for helping :)

User avatar
marcelk
Posts: 178
Joined: 13 May 2018, 08:26

Re: Changing default screen mode.

Post by marcelk » 04 Mar 2019, 07:10

marcelk wrote:
03 Mar 2019, 19:22
change the value of byte address 2*0xf97e+1 = 0x1f2fd

Gigadave
Posts: 10
Joined: 03 Mar 2019, 10:50

Re: Changing default screen mode.

Post by Gigadave » 04 Mar 2019, 08:34

Thank you, that worked :)

I look forward to future roms with new games and programs.

Thanks for your help.

Post Reply