Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev #519

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions picosim/srcsim/picosim.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

#include "disks.h"
#include "rgbled.h"
#include "picosim.h"

#ifdef WANT_ICE
static void picosim_ice_cmd(char *cmd, WORD *wrk_addr);
Expand Down
11 changes: 8 additions & 3 deletions z80core/simcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

Expand Down Expand Up @@ -298,6 +297,10 @@ BYTE io_in(BYTE addrl, BYTE addrh)
fp_led_data = io_data;
#endif

#ifdef IOPANEL
port_flags[addrl].in = true;
#endif

LOGD(TAG, "input %02x from port %02x", io_data, io_port);

cpu_time -= get_clock_us() - clk;
Expand Down Expand Up @@ -353,6 +356,10 @@ void io_out(BYTE addrl, BYTE addrh, BYTE data)
fp_led_data = IO_DATA_UNUSED;
#endif

#ifdef IOPANEL
port_flags[addrl].out = true;
#endif

cpu_time -= get_clock_us() - clk;
}

Expand All @@ -361,7 +368,6 @@ void io_out(BYTE addrl, BYTE addrh, BYTE data)
*/
void start_bus_request(BusDMA_t mode, Tstates_t (*bus_master)(BYTE bus_ack))
{

bus_mode = mode;
dma_bus_master = bus_master;
bus_request = 1;
Expand All @@ -372,7 +378,6 @@ void start_bus_request(BusDMA_t mode, Tstates_t (*bus_master)(BYTE bus_ack))
*/
void end_bus_request(void)
{

bus_mode = BUS_DMA_NONE;
dma_bus_master = NULL;
bus_request = 0;
Expand Down
8 changes: 8 additions & 0 deletions z80core/simdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef SIMDEFS_INC
#define SIMDEFS_INC

#include <stdbool.h>
#include <stdint.h>

#define COPYR "Copyright (C) 1987-2024 by Udo Munk and others"
Expand Down Expand Up @@ -92,6 +93,13 @@ typedef uint64_t Tstates_t; /* uint64 for counting T-states */
typedef enum { BUS_DMA_NONE, BUS_DMA_BYTE,
BUS_DMA_BURST, BUS_DMA_CONTINUOUS } BusDMA_t;

#ifdef IOPANEL
typedef struct port_flags {
bool in: 1; /* input port accessed */
bool out: 1; /* output port accessed */
} port_flags_t;
#endif

/*
* macro for declaring unused function parameters
*/
Expand Down
12 changes: 8 additions & 4 deletions z80core/simglb.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,21 @@ int cpu_needed; /* don't adjust CPU freq if needed */
#ifdef FRONTPANEL
uint64_t fp_clock; /* simulation clock */
float fp_fps = 30.0; /* frame rate, default 30 usually works */
WORD fp_led_address; /* lights for address bus */
BYTE fp_led_data; /* lights for data bus */
WORD address_switch; /* address and programmed input switches */
BYTE fp_led_output = 0xff; /* inverted IMSAI/Cromemco programmed output */
#endif
#ifdef SIMPLEPANEL
#if defined(FRONTPANEL) || defined(SIMPLEPANEL)
WORD fp_led_address; /* lights for address bus */
BYTE fp_led_data; /* lights for data bus */
BYTE fp_led_output = 0xff; /* inverted IMSAI/Cromemco programmed output */
#endif

/*
* Variables for iopanel
*/
#ifdef IOPANEL
port_flags_t port_flags[256]; /* port access flags */
#endif

/*
* Flags to control operation of simulation
*/
Expand Down
9 changes: 5 additions & 4 deletions z80core/simglb.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,18 @@ extern int tmax, cpu_needed;
#ifdef FRONTPANEL
extern uint64_t fp_clock;
extern float fp_fps;
extern WORD fp_led_address;
extern BYTE fp_led_data;
extern WORD address_switch;
extern BYTE fp_led_output;
#endif
#ifdef SIMPLEPANEL
#if defined(FRONTPANEL) || defined(SIMPLEPANEL)
extern WORD fp_led_address;
extern BYTE fp_led_data;
extern BYTE fp_led_output;
#endif

#ifdef IOPANEL
extern port_flags_t port_flags[256];
#endif

extern int s_flag, l_flag, m_flag, x_flag, i_flag, f_flag,
u_flag, r_flag, c_flag;
#ifdef HAS_CONFIG
Expand Down
Loading