mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-02-23 05:29:26 +00:00
ViaCuda: allocate PRAM object dinamically.
This commit is contained in:
parent
6dd8d55577
commit
1a44d8e16c
@ -18,7 +18,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
ViaCuda::ViaCuda(std::string pram_file, uint32_t pram_size)
|
||||
ViaCuda::ViaCuda()
|
||||
{
|
||||
/* FIXME: is this the correct
|
||||
VIA initialization? */
|
||||
@ -30,13 +30,15 @@ ViaCuda::ViaCuda(std::string pram_file, uint32_t pram_size)
|
||||
this->via_regs[VIA_IER] = 0x7F;
|
||||
|
||||
//PRAM Pre-Initialization
|
||||
this->pram_obj = NVram("pram.bin", 256);
|
||||
this->pram_obj = new NVram("pram.bin", 256);
|
||||
|
||||
this->cuda_init();
|
||||
}
|
||||
|
||||
ViaCuda::~ViaCuda() {
|
||||
this->pram_obj.~NVram();
|
||||
ViaCuda::~ViaCuda()
|
||||
{
|
||||
if (this->pram_obj)
|
||||
delete (this->pram_obj);
|
||||
}
|
||||
|
||||
void ViaCuda::cuda_init()
|
||||
@ -249,11 +251,11 @@ void ViaCuda::cuda_pseudo_command(int cmd, int data_count)
|
||||
switch(cmd) {
|
||||
case CUDA_READ_PRAM:
|
||||
cuda_response_header(CUDA_PKT_PSEUDO, 0);
|
||||
this->pram_obj.read_byte(this->in_buf[2]);
|
||||
this->pram_obj->read_byte(this->in_buf[2]);
|
||||
break;
|
||||
case CUDA_WRITE_PRAM:
|
||||
cuda_response_header(CUDA_PKT_PSEUDO, 0);
|
||||
this->pram_obj.write_byte(this->in_buf[2], this->in_buf[3]);
|
||||
this->pram_obj->write_byte(this->in_buf[2], this->in_buf[3]);
|
||||
break;
|
||||
case CUDA_READ_WRITE_I2C:
|
||||
cuda_response_header(CUDA_PKT_PSEUDO, 0);
|
||||
|
@ -88,7 +88,7 @@ enum {
|
||||
class ViaCuda
|
||||
{
|
||||
public:
|
||||
ViaCuda(std::string pram_file = "pram.bin", uint32_t pram_size = 256);
|
||||
ViaCuda();
|
||||
~ViaCuda();
|
||||
|
||||
uint8_t read(int reg);
|
||||
@ -107,7 +107,7 @@ private:
|
||||
int32_t out_count;
|
||||
int32_t out_pos;
|
||||
|
||||
NVram pram_obj;
|
||||
NVram *pram_obj;
|
||||
|
||||
void print_enabled_ints(); /* print enabled VIA interrupts and their sources */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user