nedoPC.org

Electronics hobbyists community established in 2002
Atom Feed | View unanswered posts | View active topics It is currently 19 Mar 2024 01:25



Reply to topic  [ 148 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10
Альтернативная система на 68000 :) 
Author Message
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
Скорость отрисовки прямоугольников без заливки (рисует тем же обычным Брезенхемом в ПЛИСке, что и произвольные линии):


Attachments:
VID_20170808_043937.3gp [1.37 MiB]
Downloaded 727 times
08 Aug 2017 06:19
Profile
Doomed

Joined: 08 Apr 2013 04:04
Posts: 449
Location: 213.247.249.139
Reply with quote
Какая версия гцц? И можно пример кода, который он генерирует (с сорцом :)?

Спрашиваю потому, что пробовал собирать гцц 4.*.* под таргет 68к и увидел, что кодогенерация у него хреноватая... Не косячит вроде, но много лишних действий.

_________________
привет засранцу лавру :)


08 Aug 2017 07:17
Profile
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
версия кажется 3.4.6, не самая новая :)

вот, вчерашнее, там есть и код (main.bin) и дизассемблерный листинг.
Здесь скомпилено без оптимизации, можно сделать gcc -O1 .. тогда будет получше.

(это всё пока только заготовка...)


Attachments:
Z7UF19.ZIP [16.32 KiB]
Downloaded 429 times
08 Aug 2017 07:57
Profile
Doomed

Joined: 08 Apr 2013 04:04
Posts: 449
Location: 213.247.249.139
Reply with quote
Эммм... Дизасм от ГЦЦ лучше всего делать или так:
Code:
gcc -S main.c

или так:
Code:
objdump -dS main.o

А дизасм голого бинарника... :)

_________________
привет засранцу лавру :)


08 Aug 2017 08:48
Profile
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
Зато в голом бинарнике всё уже в том виде, в каком это попадет в память машины...
Ничего, всё там более-менее понятно :)


08 Aug 2017 08:55
Profile
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
По-немножку кодю.
Вот это уже реализовано (сами функции на асме):

void sys_enable_interrupts();
void sys_disable_interrupts();
void sys_restart();
void sys_halt(uint32 halt_code);
void sys_install_irq_handler(uint8 irq_num, uint8 mode, irqcb *cb_function);
void sys_uninstall_irq_handler(uint8 irq_num);
uint32 get_rnd32();
void init_rnd32(uint32 s);
void clear_keyboard_buffer();
uint8 key_pressed();
uint8 get_key();
void mouse_show();
void mouse_hide();
void set_mouse_crosspointer_control_word(uint16 cw);
uint16 get_mouse_crosspointer_control_word();
uint8 mouse_in(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
uint8 mouse_pressed();
uint8 get_mouse_buttons();
uint16 get_mouse_x();
uint16 get_mouse_y();
void set_mouse_window(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
void set_mouse_window_fullscreen();
void mouse_goto_xy(uint16 x, uint16 y);
void gfx_load_led_register(uint8 led_data);
void gfx_initialize();
void gfx_reset_vertical_retrace();
uint8 gfx_is_vertical_retrace();
void gfx_clear_screen(uint8 color);
void gfx_ramdac_set_pixel_mask(uint8 p_mask);
void gfx_ramdac_set_rgb_palette(uint8 *pal, uint8 start_color, uint16 n_colors);
void gfx_set_draw_mask(uint32 draw_mask);
void gfx_draw_pixel(uint16 x, uint16 y, uint8 color);
void gfx_move_to(uint16 x, uint16 y);
void gfx_line_to(uint16 x, uint16 y, uint8 color);
void gfx_line(uint16 x1, uint16 y1, uint16 x2, uint16 y2, uint8 color);
void gfx_rectangle(uint16 x1, uint16 y1, uint16 x2, uint16 y2, uint8 color);
void gfx_bar(uint16 x1, uint16 y1, uint16 x2, uint16 y2, uint8 color);
void gfx_bar_x2(uint16 x1, uint16 y1, uint16 x2, uint16 y2, uint8 color);
void gfx_draw_char(uint16 x, uint16 y, uint8 color ,uint16 mode, char c);
void gfx_draw_text(uint16 x, uint16 y, uint8 color, uint16 mode, uint16 offset, char *string);
void gfx_copy_picture_to_vram(uint16 dest_x, uint16 dest_y,
uint16 size_x, uint16 size_y,
uint8 *picture);
void gfx_copy_vram_block(uint16 source_x, uint16 source_y,
uint16 dest_x, uint16 dest_y,
uint16 size_x, uint16 size_y);
void rhytm_gen_load_k(uint32 k);
void rhytm_gen_set_clk_mux(uint8 s);
void rhytm_gen_start();
void rhytm_gen_stop();
void rs232_clear_rx_buf();
void rs232_clear_tx_buf();
uint8 rs232_is_rx_bytes();
uint8 rs232_is_tx_complete();
uint8 rs232_get_byte();
void rs232_send_byte(uint8 a);
void midi1_clear_rx_buf();
void midi1_clear_tx_buf();
uint8 midi1_is_rx_bytes();
uint8 midi1_is_tx_complete();
uint8 midi1_get_byte();
void midi1_send_byte(uint8 a);
void midi2_clear_rx_buf();
void midi2_clear_tx_buf();
uint8 midi2_is_rx_bytes();
uint8 midi2_is_tx_complete();
uint8 midi2_get_byte();
void midi2_send_byte(uint8 a);


Attachments:
E4KN59.ZIP [45.13 KiB]
Downloaded 429 times
12 Aug 2017 18:40
Profile
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
Подключила библиотеку FatFs от ChaN: http://elm-chan.org/fsw/ff/00index_e.html
Пришлось поразбираться и помучиться. Но в результате получилось!)
Еще добавила много всяких низкоуровневых функций (конечно же, они на ассемблере).
Заодно по-немножку привыкаю к Си. Нравится.

Теперь у нас есть SDшки и FAT16/32, можно читать и записывать всякие файлы :)
Можно подключить и другие устройства, если вдруг захочется.

Тест - загрузка картинки 640*480 c SDшки. Заодно - тест 256-цветного режима видео ПЛИСки и RAMDAC.
Видео (11Мбайт): http://disk.karelia.pro/veiC5l5/


Attachments:
IMG_3514_.jpg
IMG_3514_.jpg [ 592.16 KiB | Viewed 12934 times ]
IMG_3513.JPG
IMG_3513.JPG [ 925.51 KiB | Viewed 12940 times ]
04 Sep 2017 17:08
Profile
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
код (8Мб): http://disk.karelia.pro/dKaHgpW/


05 Sep 2017 03:54
Profile
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22383
Location: Silicon Valley
Reply with quote
видео уже недоступно - можно на ютуб его?

интересует как быстро такие картинки грузяцо с карточки на экран?

_________________
:dj: https://mastodon.social/@Shaos


24 Oct 2017 05:55
Profile WWW
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
Видео:
http://disk.karelia.pro/3B9CaJS/

...а залить на ютуб я не умею :)

Грузится с карточки через буфер примерно 1.5сек. Картинка не сжатая (то есть там 1 байт на пиксель, и получается 307200 байт на 640*480).
Узкое место - SPI до карточки. Такт 16МГц и SPI 1-битный :)


24 Oct 2017 09:42
Profile
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22383
Location: Silicon Valley
Reply with quote
да - быстро

_________________
:dj: https://mastodon.social/@Shaos


24 Oct 2017 21:33
Profile WWW
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
68K + ILDA интерфейс на мелкой GPIO плиске (наконец-то и она пригодилась :)
ЦАПики 572па1 + дифференциальные драйверы на TL074, TL072.


код:


Code:
module ILDA_port(ADDR, DIN, nAS, nUDS, nLDS, RW, nRESET, CLK,
                 DOUT, DEN, ILDA_X, ILDA_Y, ILDA_B, ILDA_G, ILDA_R, ILDA_I, ILDA_EN, DTA);
input wire [23:1] ADDR;
input wire [15:0] DIN;
input wire nAS,nUDS,nLDS,RW,nRESET,CLK;
output wire [15:0] DOUT;
output wire DEN;
output reg [9:0] ILDA_X;
output reg [9:0] ILDA_Y;
output wire ILDA_B,ILDA_G,ILDA_R, ILDA_I, ILDA_EN;
output wire DTA;

wire SEL,WORD,X_WSTB,Y_WSTB,C_WSTB,C_RSTB;
wire [9:0] TMPXY;
reg [7:0]  CR;
reg [20:0] TIMEOUT_CNT;
reg TIMEOUT;
reg EN_BEAM;

assign SEL = ~nAS & (ADDR[23:4] == 20'hFFFA0);
assign WORD = ~nUDS & ~nLDS;
assign DTA = SEL & (~nUDS | ~nLDS);
assign DEN = RW & SEL & (~nUDS | ~nLDS);

assign X_WSTB = ~RW & SEL & WORD & (ADDR[3:1] == 3'h0);  //=x0
assign Y_WSTB = ~RW & SEL & WORD & (ADDR[3:1] == 3'h1);  //=x2
assign C_WSTB = ~RW & SEL & ~nUDS & (ADDR[3:1] == 3'h7);  //=xE

assign C_RSTB = RW  & SEL & ~nUDS & (ADDR[3:1] == 3'h7);  //=xE

assign TMPXY = DIN[9:0] + 10'd512;

always@(negedge X_WSTB)  ILDA_X <= TMPXY;
always@(negedge Y_WSTB)  ILDA_Y <= TMPXY;

assign DOUT = ((CR & {8{C_RSTB}}) << 8);

always@(negedge C_WSTB or negedge nRESET)
  begin
    if (~nRESET) CR <= 8'h0;
      else CR <= DIN[15:8];
  end

assign ILDA_EN = CR[7] & EN_BEAM;
assign ILDA_I = (CR[0] | CR[1] | CR[2]) & ILDA_EN; 
assign ILDA_R = CR[2] & ILDA_EN; 
assign ILDA_G = CR[1] & ILDA_EN; 
assign ILDA_B = CR[0] & ILDA_EN; 

always@(posedge CLK or posedge X_WSTB or posedge Y_WSTB)
  begin
   if (X_WSTB || Y_WSTB) TIMEOUT_CNT <= 21'h0;
      else TIMEOUT_CNT <= TIMEOUT_CNT + 1'h1;
  end
 
always@(posedge CLK)  TIMEOUT <= (TIMEOUT_CNT == 22'h1FFFFF);

always@(posedge TIMEOUT or posedge X_WSTB or posedge Y_WSTB or negedge nRESET)
  begin
    if (~nRESET || TIMEOUT) EN_BEAM <= 0;
      else
        if (X_WSTB || Y_WSTB) EN_BEAM <= 1;
  end
 
endmodule


Attachments:
IMG_3566.JPG
IMG_3566.JPG [ 842.72 KiB | Viewed 12677 times ]
IMG_3563.JPG
IMG_3563.JPG [ 831.53 KiB | Viewed 12677 times ]
IMG_3565.JPG
IMG_3565.JPG [ 1.14 MiB | Viewed 12677 times ]


Last edited by Annett on 06 Nov 2017 01:36, edited 2 times in total.

05 Nov 2017 23:04
Profile
Senior

Joined: 30 Mar 2017 00:55
Posts: 137
Reply with quote
еще картинки :)
это просто первые тесты, еще на асме.
синусы и косинусы :)
Наверное нужно будет закодить С-шные функции для вывода координат и цвета...

видео (загрузка случайных векторов): http://disk.karelia.pro/psp7npf/


Attachments:
IMG_3568.JPG
IMG_3568.JPG [ 159.99 KiB | Viewed 12677 times ]
IMG_3567.JPG
IMG_3567.JPG [ 171.95 KiB | Viewed 12677 times ]
05 Nov 2017 23:07
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 148 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.