mirror of
https://github.com/sxpert/hp-saturn
synced 2024-12-24 21:59:33 +01:00
change the way the rom is encoded, makes things easier
This commit is contained in:
parent
9f0fadf1b1
commit
a44c6f6f36
3 changed files with 32789 additions and 10 deletions
14
gen_rom_hex.py
Executable file
14
gen_rom_hex.py
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
f = open("../docs/gxrom-r", "rb")
|
||||||
|
count=0
|
||||||
|
filedata = f.read()
|
||||||
|
f.close()
|
||||||
|
for b in filedata:
|
||||||
|
print("%1x %1x "%(int(b&0x0f),int((b&0xf0)>>4)), end="")
|
||||||
|
count += 1
|
||||||
|
if count == 8:
|
||||||
|
print(end=" ")
|
||||||
|
if count == 16:
|
||||||
|
print(end="\n")
|
||||||
|
count = 0
|
32768
rom-gx-r.hex
Normal file
32768
rom-gx-r.hex
Normal file
File diff suppressed because it is too large
Load diff
|
@ -8,8 +8,8 @@ module hp_rom (
|
||||||
);
|
);
|
||||||
localparam ROM_FILENAME = "rom-gx-r.hex";
|
localparam ROM_FILENAME = "rom-gx-r.hex";
|
||||||
|
|
||||||
reg [7:0] rom [0:524287];
|
//reg [3:0] rom [0:(2**20)-1];
|
||||||
//reg[7:0] rom [0:4096];
|
reg[7:0] rom [0:4096];
|
||||||
|
|
||||||
initial
|
initial
|
||||||
begin
|
begin
|
||||||
|
@ -19,8 +19,7 @@ end
|
||||||
|
|
||||||
always @(posedge clk)
|
always @(posedge clk)
|
||||||
if (enable)
|
if (enable)
|
||||||
nibble_out <= address[0] ? rom[address[19:1]][7:4] : rom[address[19:1]][3:0];
|
nibble_out <= rom[address];
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
|
||||||
|
@ -695,6 +694,7 @@ task inst_govlng_gosbvl;
|
||||||
4'hF:
|
4'hF:
|
||||||
begin
|
begin
|
||||||
decode_state <= DECODE_GOSBVL;
|
decode_state <= DECODE_GOSBVL;
|
||||||
|
rstk_ptr <= rstk_ptr + 1;
|
||||||
$write("%5h GOSBVL\t", saved_PC);
|
$write("%5h GOSBVL\t", saved_PC);
|
||||||
end
|
end
|
||||||
endcase
|
endcase
|
||||||
|
@ -709,17 +709,14 @@ task inst_govlng_gosbvl;
|
||||||
begin
|
begin
|
||||||
$display("\t=> %5h", jump_base);
|
$display("\t=> %5h", jump_base);
|
||||||
if (decode_state == DECODE_GOSBVL)
|
if (decode_state == DECODE_GOSBVL)
|
||||||
begin
|
RSTK[rstk_ptr] <= PC;
|
||||||
rstk_ptr = rstk_ptr + 1;
|
|
||||||
RSTK[rstk_ptr] = PC;
|
|
||||||
end
|
|
||||||
PC <= jump_base;
|
PC <= jump_base;
|
||||||
end_decode();
|
end_decode();
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
load_ctr = load_ctr + 1;
|
load_ctr <= load_ctr + 1;
|
||||||
read_state = READ_START;
|
read_state <= READ_START;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
endcase
|
endcase
|
||||||
|
|
Loading…
Reference in a new issue