Skip to content

Commit

Permalink
Post replies
Browse files Browse the repository at this point in the history
  • Loading branch information
desertkun committed Aug 1, 2021
1 parent fbeca16 commit eadf18e
Show file tree
Hide file tree
Showing 27 changed files with 383 additions and 124 deletions.
3 changes: 2 additions & 1 deletion client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ bin/channels__.bin: spectranet-libraries bin $(OBJECTS)
bin:
@mkdir -p bin

channels: channels-bin
channels: channels-bin channels-tap
channels-bin: bin/channels__.bin
channels-tap: bin/channels.tap

boot-zx: channels-bin
cp boot/boot.zx bin/boot.zx
Expand Down
Binary file modified client/boot/boot.zx
Binary file not shown.
20 changes: 18 additions & 2 deletions client/gui/tiles.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
/* png2c.py 1.4.3
*
* tiles.png (64x64)
* 8.0 x 8.0 (49 unique)
* 8.0 x 8.0 (51 unique)
*
* base: 128
*/

#define TILES_BASE 128
#define TILES_LEN 49
#define TILES_LEN 51
static uchar tiles[] = {
0xd0, 0xd0, 0xd0, 0xd0, 0xdf, 0xc0, 0xff, 0xff, // y:0, x:0 (128)
0x0b, 0x0b, 0x0b, 0x0b, 0xfb, 0x03, 0xff, 0xff, // y:0, x:1 (129)
Expand Down Expand Up @@ -58,5 +58,21 @@ static uchar tiles[] = {
0x00, 0x30, 0x76, 0x6f, 0xf6, 0x6e, 0x0c, 0x00, // y:5, x:5 (173)
0x10, 0x3c, 0x3e, 0x16, 0x68, 0x7c, 0x3c, 0x08, // y:5, x:6 (174)
0x00, 0x00, 0xaa, 0x55, 0xaa, 0x55, 0x00, 0x00, // y:5, x:7 (175)
0x00, 0x3c, 0x42, 0x56, 0x42, 0x3e, 0x02, 0x00, // y:6, x:0 (176)
0x00, 0x08, 0x1c, 0x3e, 0x5c, 0x48, 0x70, 0x00, // y:6, x:1 (177)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:6, x:2 (178)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:6, x:3 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:6, x:4 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:6, x:5 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:6, x:6 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:6, x:7 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:0 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:1 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:2 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:3 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:4 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:5 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:6 (179)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // y:7, x:7 (179)
};

1 change: 1 addition & 0 deletions client/gui/zxgui.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void zxgui_init()
font_state.fgnd_attr = BRIGHT | INK_GREEN | PAPER_BLACK;
font_state.fgnd_mask = 0;
font_state.fzx_draw = _fzx_draw_or;
font_state.left_margin = 0;

font_state.y = 32;
font_state.x = 0;
Expand Down
4 changes: 3 additions & 1 deletion client/gui/zxgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ enum gui_tiles {
GUI_ICON_7,
GUI_ICON_LOADING_SMALL_1,
GUI_ICON_LOADING_SMALL_2,
GUI_SELECTED_ENTRY
GUI_SELECTED_ENTRY,
GUI_ICON_REPLIES,
GUI_ICON_REPLY
};

enum gui_event_type {
Expand Down
2 changes: 2 additions & 0 deletions client/gui/zxlabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ static void label_render(uint8_t x, uint8_t y, struct gui_label_t* this, struct

uint8_t zxgui_label_text_height(uint8_t w, const char* title, uint16_t len)
{
w--;

char* c = (char*)title;
const char* end = c + len;
uint8_t res = 0;
Expand Down
1 change: 1 addition & 0 deletions client/gui/zxscene.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void zxgui_scene_add(struct gui_scene_t* scene, void* object)
{
struct gui_object_t* last = zxgui_scene_get_last_object(scene);
struct gui_object_t* o = (struct gui_object_t*)object;
o->next = NULL;
if (last == NULL)
{
scene->child = o;
Expand Down
Binary file modified client/sprites/tiles.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions client/src/channels.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ uint8_t channels_proxy_connect(const char* address, channels_disconnected_callba
return 0;
}

void channels_proxy_disconnect()
{
channels_proto_disconnect();
}

static void* channels_new_request(int socket, struct proto_process_t* proto)
{
return NULL;
Expand Down
1 change: 1 addition & 0 deletions client/src/channels.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ typedef void (*channels_object_callback_f)(ChannelObject* object);
typedef void (*channels_error_callback_f)(const char* error);

extern uint8_t channels_proxy_connect(const char* address, channels_disconnected_callback_f disconnected);
extern void channels_proxy_disconnect();
extern void channels_proxy_update();
extern void channels_set_channel(const char* channel);
extern const char* channels_get_channel();
Expand Down
5 changes: 3 additions & 2 deletions client/src/connect_to_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
static struct gui_scene_t scene;
static struct gui_image_t logo;
static struct gui_edit_t connect_address;
static const char* supported_api_version = "2";
static const char* supported_api_version = "3";
static char server_api_version[8] = {};

static void disconnected()
Expand Down Expand Up @@ -90,6 +90,7 @@ void init_connect_to_proxy()

{
zxgui_edit_init(&connect_address, 0, 0, 13, 2);
strcpy(connect_address.value, "127.0.0.1");
zxgui_form_add_child(&connect_to_proxy, &connect_address);
}

Expand All @@ -107,7 +108,7 @@ void init_connect_to_proxy()

void switch_connect_to_proxy()
{
strcpy(connect_address.value, "127.0.0.1");
channels_proxy_disconnect();

zxgui_scene_set(&scene);
zxgui_scene_set_focus(&scene, &connect_address);
Expand Down
2 changes: 1 addition & 1 deletion client/src/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "proto_asserts.h"
#include "system.h"

uint8_t heap_data[2560];
uint8_t heap_data[3200];

uint8_t next_allocated_blob = 0;

Expand Down

0 comments on commit eadf18e

Please sign in to comment.