Welcome, Guest. Please login or register.


Author Topic: Q&A (Read 56389 times)

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #120 on: 2016.January.07. 05:37:18 »
I took source from Col256 demo:
http://www.ep128.hu/Ep_Demo/Demo_eng.htm

seems code is out of synchronization.
how to fix one?

Online geco

  • Moderator
  • EP addict
  • *
  • Posts: 7070
  • Country: hu
    • Támogató Támogató
Re: Q&A
« Reply #121 on: 2016.January.07. 09:00:49 »
I took source from Col256 demo:
http://www.ep128.hu/Ep_Demo/Demo_eng.htm

seems code is out of synchronization.
how to fix one?
Your LPT contains only 289 lines
210 lines for mode 256
1 line empty
27 lines in char mode
12 lines SYNC
39 lines empty (from top of the screen)

change
>CD20  FF 02 00 00 00 00 00 00  :........

>CDA0  D9 13 3F 00 00 00 00 00  :Y.?.....

to.
>CD20  F4 02 00 00 00 00 00 00  :........

>CDA0  CD 13 3F 00 00 00 00 00  :Y.?.....

Online geco

  • Moderator
  • EP addict
  • *
  • Posts: 7070
  • Country: hu
    • Támogató Támogató
Re: Q&A
« Reply #122 on: 2016.January.07. 09:06:27 »
or it would be better to insert a new row between character lines and synchron into the original LPT

E9 02 3F 00 00 00 00 00  :........

Online Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14709
  • Country: hu
    • http://enterprise.iko.hu/
Re: Q&A
« Reply #123 on: 2016.January.07. 10:03:36 »
Now I writing small game on basic.
What is this source? It is look as assembly not as BASIC :oops:

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #124 on: 2016.January.07. 10:04:59 »
yes, changes works now. but pixels looks like a bricks ;)

What is a way to convert RGB values to EP mode?

Online geco

  • Moderator
  • EP addict
  • *
  • Posts: 7070
  • Country: hu
    • Támogató Támogató
Re: Q&A
« Reply #125 on: 2016.January.07. 10:22:06 »
yes, changes works now. but pixels looks like a bricks ;)

What is a way to convert RGB values to EP mode?
Yes, because in 256 col mode one pixel is 4x larger than in 4 col mode.
RGB values of Enterprise:

Code: [Select]
Bit 7 6 5 4 3 2 1 0
    g0r0b0g1r1b1g2r3

If you want to convert a picture to enterprise and not to 256 Col mode, then EPIMGCONV is the best tool for it.

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #126 on: 2016.January.07. 10:24:44 »
If you want to convert a picture to enterprise and not to 256 Col mode, then EPIMGCONV is the best tool for it.

yes, I see format nd description of rgb values. I have dump of picture (indexed values and palette - R,G,B) and now i am looking to conversion.


Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #127 on: 2016.January.07. 11:47:15 »
If you want to convert a picture to enterprise and not to 256 Col mode, then EPIMGCONV is the best tool for it.

Here is one of the pictures from the Col256 demo converted in various modes:

Original image
[ Guests cannot view attachments ]

Col256
[ Guests cannot view attachments ]

epimgconv 256-color mode (no interlace)
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]

epimgconv 16-color mode (no interlace)
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]

epimgconv attribute mode (interlace)
[ Guests cannot view attachments ]
[ Guests cannot view attachments ]

yes, I see format nd description of rgb values. I have dump of picture (indexed values and palette - R,G,B) and now i am looking to conversion.

If the conversion can only be lossy, or it requires finding an optimized palette/bias on the EP, then one possible solution is to convert the data to an image format that is recognized by epimgconv, and then convert that. It supports the XPM format, which is simple text, so it can easily be created in a program you write, or even a text editor.

Otherwise, it could be converted with a small program or script written specifically for this conversion.

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #128 on: 2016.January.07. 12:03:13 »
well, i try to create xpm.

Offline SlashNet

  • EP addict
  • *
  • Posts: 1186
  • Country: ua
  • Enterprise 128K | Cubietruck
    • My old site about Enterprise
Re: Q&A
« Reply #129 on: 2016.January.07. 14:15:04 »
What is this source? It is look as assembly not as BASIC :oops:
This is output of ZIPSRC tool from here.
Basic src I'll show later, when it will be more or less ready.
Now I trying to make some changes in gameplay to shrink code.

Here some animated graphics:
[ Guests cannot view attachments ]

Based on my art http://pixeljoint.com/pixelart/81327.htm
« Last Edit: 2016.January.07. 14:19:17 by SlashNet »

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Q&A
« Reply #130 on: 2016.January.11. 11:10:34 »
Is there a way to programatically check for turbo mode (and of what kind/speed is it)?

Online geco

  • Moderator
  • EP addict
  • *
  • Posts: 7070
  • Country: hu
    • Támogató Támogató
Re: Q&A
« Reply #131 on: 2016.January.11. 11:43:28 »
Is there a way to programatically check for turbo mode (and of what kind/speed is it)?
Yes, count the instructions in a frame, and in this way possible to decide if the program runs in an emulator, or on real machine also if it is a turbo EP.
My solution gives back 81h value in HL at 4 MHz 100h at 8 MHz, 200h at 16 MHz , and so on, but for this 14 lines should be defined into that LPB where the interrupt flag is set.
István's solution is much more flexible, you can find it in source of DTM player, or in multimedia pack, or in any game conversion by István.

Online Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14709
  • Country: hu
    • http://enterprise.iko.hu/
Re: Q&A
« Reply #132 on: 2016.January.11. 12:33:52 »
From my Quick memory test which is write the CPU speed at the startup screen:

At 38h:
Code: ZiLOG Z80 Assembler
  1. ROMIRQ            JP (IX)

Code: ZiLOG Z80 Assembler
  1.                 LD HL,0
  2.                 LD IX,IRQ1
  3.                 LD BC,30B4H
  4.                 OUT (C),B
  5.                 EI
  6.                 HALT
  7. IRQ1            LD IX,IRQ2
  8.                 OUT (C),B
  9.                 EI
  10. IRQW            INC HL
  11.                 JP IRQW
  12. IRQ2            DI
  13.                 LD BC,HL
  14.                 LD DE,1000
  15.                 CALL MUL_DE_BC
  16.                 LD BC,HL
  17.                 LD A,E
  18.                 LD DE,12485
  19.                 CALL DIV_ABC_DE
  20.                 OR A
  21.                 LD DE,6243
  22.                 SBC HL,DE
  23.                 JR C,NOTROUND
  24.                 INC C
  25. NOTROUND

Then you got Mhz*100 value in BC. Measurement code need to run in non waited memory.

In the real life these CPU speeds used: 4, 6, 7.12, 10 MHz.

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Q&A
« Reply #133 on: 2016.January.12. 03:19:29 »
Thanks.

Zozo, could you for completeness include the code for multiplication and division procedures :oops:

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #134 on: 2016.January.12. 09:10:54 »
A single multiplication is enough actually, with this code after IRQ2:
Code: ZiLOG Z80 Assembler
  1.         ld      de, 8
  2.         add     hl, de
  3.         ld      c, l
  4.         ld      b, h
  5.         ld      l, d
  6.         ld      h, d
  7.         ld      de, 5249
  8.         ; BCHL = BC * DE
  9.         ld      a, 16
  10. l01:    add     hl, hl
  11.         rl      c
  12.         rl      b
  13.         jr      nc, l02
  14.         add     hl, de
  15.         jr      nc, l02
  16.         inc     bc
  17. l02:    dec     a
  18.         jr      nz, l01
The constants 8 and 5249 may need to be tweaked for the most accurate result.