Enterprise Forever
:UK => Enterprise DevCompo => Enterprise DevCompo #2 => Topic started by: geco on 2017.April.02. 17:33:56
-
256 byte version of well known Snake game. It runs on all EXOS versions, but there is no soft reset. There are 99 levels, when it is completed the border changes it's color.
Controls:
Internal joystick: move snake
Stop: restart game
Hold: set speed (default is 4)
[attach=2]
-
https://youtu.be/qiKTkpAX4Xc
-
https://youtu.be/qiKTkpAX4Xc
Thank you very much :)
-
if LPT adress is known ho to determine adresses of font and video memory?
-
if LPT adress is known ho to determine adresses of font and video memory?
Then LPT address + 4,5 gives the video memory (character map address) and LPT address + 6,7 gives the font memory/char mode.
Snake uses CHAR128 mode therefor LPT address +6,7 should be multiplied by 128, it will give the font memory, I use the normal EXOS font memory.
LPT 1 st char row used by the game:
F7 08 0B 73 28 C0 E9 01 00 92 00 49 FF 24 2D 36
Character map address: c028h
font address: 01e9h*80h= f480h
-
But font address are different in EXOS 2.0 (EP64) and EXOS 2.1 (EP128): B680/B480h
In my programs copy it from Status Line LPB.
-
But font address are different in EXOS 2.0 (EP64) and EXOS 2.1 (EP128): B680/B480h
In my programs copy it from Status Line LPB.
Sorry, Snake does the same :) Just I took the example from the game started under EXOS 2.1
-
Then LPT address + 4,5 gives the video memory (character map address) and LPT address + 6,7 gives the font memory/char mode.
Snake uses CHAR128 mode therefor LPT address +6,7 should be multiplied by 128, it will give the font memory, I use the normal EXOS font memory.
LPT 1 st char row used by the game:
F7 08 0B 73 28 C0 E9 01 00 92 00 49 FF 24 2D 36
Character map address: c028h
font address: 01e9h*80h= f480h
As I understand char data defines as +128 for each line?
-
As I understand char data defines as +128 for each line?
Yes, if you use the default 128 characters mode.
-
exactly.
-
well. I don't see characters( but address difers from C028
ld hl,($bff4)
push hl
inc hl,hl,hl,hl
ld e,(hl)
inc hl
ld d,(hl)
ld b,0
push de
mm:
ld a,b
ld (de),a
inc de
inc b
jr nz,mm
pop de
pop hl
-
well. I don't see characters( but address difers from C028
Your code seems to be good, please check the margin settings in LPT, I think it was set off.
-
ep128emu 2.0.10, EXDOS 2.1:
B900 F7 08 3F 74 B8 FE E9 01 :w.?t8~i.
B908 00 36 00 49 FF 24 2D 36 :.6.I.$-6
-
I think i know what is the problem, you use the NICK address for printing the characters, and in this case the address of status line, and 0ffh segment is not paged in into page 3.
-
yes, t works:
ld a,$FF
out ($B3),a
mm:
ld a,b
ld (de),a
inc de
inc b
jr nz,mm
but here is some issues with color.
-
but here is some issues with color.
Probably because character codes from 0-127 are displayed of palette color 0,1, and from 128-255 are displayed with 2,3
-
And can be a problem: EXOS character codes 128-159 are converted to 0-31 in video memory. If you directly copy text which including these character will be displayed with wrong color pair.
-
Now I see only one line of characters.
should I use VRES?
-
Now I see only one line of characters.
should I use VRES?
No, you used the charmap address of STATUS line, you should use the next LPB (LPT line) (if it has a right address, or you can set up your own character map address), and you should set the same charmap address of the following LPB's in this case you can see the same result in each line.
-
same picture:
ld hl,($bff4)
ld de,16+4
add hl,de
;
ld e,(hl)
inc hl
ld d,(hl)
;
ld b,0
ld a,$FF
out ($B3),a
mm:
ld a,b
ld (de),a
inc de
inc b
jr nz,mm
-
same picture:
Not the same :) now your characters were displayed in the 2nd line by green colour, if you set next LPT rows with the same charmap address, then each row will show the same characters, if your plan is to display all defined characters then probably the charmap address of 3rd LPT row is not continuation of 2nd LPT row, you can setup your addresses into LPT, or check address of next LPT line if the 1st row is flled with characters, and continue printing to that address.