Text mode Character set location

ZX evolution software and hardware

Postby justine » 31 Dec 2011, 20:34

I am making my own rom and i will be using 80 x 25 text mode at what memory location do i put the character set for this text mode?

Thanx for all your help in advance.
User avatar
justine
 
Posts: 101
Joined: 06 Jul 2011, 00:50
Location: Scotland
Group: Registered users

Postby justine » 31 Dec 2011, 22:02

Am i right in thinking that the character set for text mode is built into the FPGA ?
User avatar
justine
 
Posts: 101
Joined: 06 Jul 2011, 00:50
Location: Scotland
Group: Registered users

Postby DDp » 01 Jan 2012, 12:58

ATM-turbo2 have a singular textmode. %) :crazy: In BASECONF for ZX-Evo is implemented this mode (for compatible).

Code: Select all
Text mode 80x25 (ATM-Turbo2 compatible)

Placement:

For "first" screen (#7FFD bit3 = 0)
Characters - page 5
Attributes - page 1
For "second" screen (#7FFD bit3 = 1)
Characters - page 7
Attributes - page 3

Characters
┌──────┬────┬────┬────┬────┬─..─┬────┬────┐
│columns  0 │  1 │  2 │  3 │ .. │ 78 │ 79 │
├──────┼────┼────┼────┼────┼─..─┼────┼────┤
│row 0 │01C0│21C0│01C1│21C1│ .. │01E7│21E7│
│row 1 │0200│2200│0201│2201│ .. │0227│2227│
│row 2 │0240│2240│0241│2241│ .. │0267│2267│
│row 3 │0280│2280│0281│2281│ .. │02A7│22A7│
...........................................
│row 24│07C0│27C0│07C1│27C1│ .. │07E7│27E7│
└──────┴────┴────┴────┴────┴─..─┴────┴────┘

Attributes
┌──────┬────┬────┬────┬────┬─..─┬────┬────┐
│columns  0 │  1 │  2 │  3 │ .. │ 78 │ 79 │
├──────┼────┼────┼────┼────┼─..─┼────┼────┤
│row 0 │21C0│01C1│21C1│01C2│ .. │21E7│01E8│
│row 1 │2200│0201│2201│0202│ .. │2227│0228│
│row 2 │2240│0241│2241│0242│ .. │2267│0268│
│row 3 │2280│0281│2281│0282│ .. │22A7│02A8│
...........................................
│row 24│27C0│07C1│27C1│07C2│ .. │27E7│07E8│
└──────┴────┴────┴────┴────┴─..─┴────┴────┘
D356 47C0 35F8 F55E 8A52 A88F F3F8 B003 03EB 3D7F
DDp
 
Posts: 103
Joined: 27 Oct 2007, 11:29
Group: Registered users

Postby DimkaM » 01 Jan 2012, 16:51

Code: Select all
settxtmode
   ld a,1 ;set shadow mode
   out (0xBF),a
   ld bc,0xff77 ;set txt mode
   ld a,0x26
   out (c),a
   ld a,5^0xff ;set 5_ram_page to 1 bank z80
   ld bc,0x77f7
   out (c),a
   ld a,1^0xff  ;set 1_ram_page to 2 bank z80
   ld b,0xb7
   out (c),a
   ret

xy2txt_addr   ;input h=x l=y symbol
   ld a,0x07   ;output hl=address
   srl h
   jr nc,.l1
   ld a,0x87
.l1   add a,l
   ld l,h
   ld h,a
   xor a
   srl h
   rr a
   srl h
   rr a
   add a,l
   ld l,a
   set 6,h
   ret
   
xy2attr_addr   ;input h=x l=y symbol
   ld a,0x87    ;output hl=address
   srl h
   jr nc,.l1
   ld a,0x07
   inc h
.l1   add a,l
   ld l,h
   ld h,a
   xor a
   srl h
   rr a
   srl h
   rr a
   add a,l
   ld l,a
   set 7,h
   ret


TXT2ATTR      ;input hl=txt_symb address
   ld a,%11100000      ;output hl=attr_symb address
   xor h
   ld h,a
   bit 5,h
   ret nz
   inc hl
   ret
I'm a little drunk, no comments
ZX-Evo rev B, ZX-Evo rev C, ZXNetUsb rev A, ZXNetUsb rev С
http://nedoos.ru/ http://ti6.zxevo.ru/
DimkaM
 
Posts: 1387
Joined: 24 Mar 2010, 13:42
Location: джунгли Амазонки
Group: Registered users

Postby DimkaM » 02 Jan 2012, 13:22

to Support:Неплохо былобы в доки добавлять примеры говнокодинга. Про z-card там только видел.

то Алл: есть у кого оптимальный код конверсии ху_тхт в адрес?
ZX-Evo rev B, ZX-Evo rev C, ZXNetUsb rev A, ZXNetUsb rev С
http://nedoos.ru/ http://ti6.zxevo.ru/
DimkaM
 
Posts: 1387
Joined: 24 Mar 2010, 13:42
Location: джунгли Амазонки
Group: Registered users

Postby justine » 02 Jan 2012, 18:38

Thanx for your kind help DimkaM , TSLabs & DDp .
User avatar
justine
 
Posts: 101
Joined: 06 Jul 2011, 00:50
Location: Scotland
Group: Registered users

Postby justine » 04 Jan 2012, 17:17

Give me some documentation on your configuration and i may well try it. ;)
User avatar
justine
 
Posts: 101
Joined: 06 Jul 2011, 00:50
Location: Scotland
Group: Registered users

Postby DimkaM » 07 Jan 2012, 18:24

new txtmode(r530 firmware):
Code: Select all
settxtmode
   ld a,1 ;set shadow mode
   out (0xBF),a
   ld bc,0xff77 ;set new_txt_mode
   ld a,0x27
   out (c),a
   ld a,8^0xff ;set 8_ram_page to 1 bank z80
   ld bc,0x77f7
   out (c),a
   ret


xy2scr         ;input hl=xy
   ld a,0x1c
   srl h
   rr a
   rr a
   add a,l
   ld l,h
   ld h,a
   xor a
   srl h
   rr a
   srl h
   rr a
   add a,l
   ld l,a
   set 6,h
   ret

   
xy2attr
   ld a,0xc7
   srl h
   jr nc,.l1
   ld a,0x87
   inc h
.l1   add a,l
   ld l,h
   ld h,a
   xor a
   srl h
   rr a
   srl h
   rr a
   add a,l
   ld l,a
   set 6,h
   ret

TXT2ATTR      ;input hl=txt_symb address
     ld a,%00110000      ;output hl=attr_symb address
     xor h
     ld h,a
   bit 4,h
   ret nz
   inc hl
   ret

ZX-Evo rev B, ZX-Evo rev C, ZXNetUsb rev A, ZXNetUsb rev С
http://nedoos.ru/ http://ti6.zxevo.ru/
DimkaM
 
Posts: 1387
Joined: 24 Mar 2010, 13:42
Location: джунгли Амазонки
Group: Registered users


Return to Пентева - софт и железо

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron